ajaxed 1.0 released    Releases

the new major release of asp ajaxed is here. I have jumped with counting to version 1.0 because it has been such a big update and the library reached its maturity level. Curious whats new in the box? A lot of improvements and new stuff - i got a lot of inspiration from ruby on rails as well and the biggest goodie is an own developer console with unit tests, documentation creator...

For all who cannot wait go directly to the download and update to the new version.

Ok, so whats new in 1.0? I have aggregated all the comments and tried to implement all your requests. As I am developing with Ruby on Rails, I have added some rubyism to the whole library as well. Do I have to change my running system completely now? No! no need to panick. There are only two small things you need to prepare before upgrading to 1.0 (mentioned at the end of the article). Ok, let's move to the updates...

ajaxed console

Probably the most fancy update is the new ajaxed console which supports you while you develop your applications. its immediately available through /ajaxed/console/ on your server. You'll find there a lot of useful stuff like a test runner, current configuration, documentation creator, regular expression evaluator, etc. Check a demo of the console here.

New ajaxed config

The ajaxed config (config.asp) has been moved to an own folder which is located in the webroot /ajaxedConfig/config.asp. Seperating the configuration from the library makes the update process easier now. You can overwrite the ajaxed library without any thoughts...

html, head and body tags integration (header & footer)

People used to have problems of integrating the html, head and body tags into their pages. This has been solved now and you can find a header.asp and footer.asp in your ajaxedConfig folder. Those files are automatically loaded within your pages. This change brought some additional features as well

<% sub header() %>
        /* some styles */
    <% page.loadJSFile "someJSFile.js" %>
<% end sub %>

Best thing is you take a look into the predefined header.asp in your config to see whats going on there. And don't forget it's up to you what you bung in there. You can add as many lib.exec calls as you want.

Environment support

ajaxed supports two environments now: LIVE (production) and DEV (development). The config variable AJAXED_ENVIRONMENT sets the current environment. This enhancement allows us ...
(The default environment is always development)

Unit tests

TestFixture class lets you create unit tests for your own applications. It comes with a lot of different asserts (as commonly known in other unit testing frameworks) and is very quickly to set up. After you have written your tests you can run them directly from the ajaxed console. Tests for the library itself are located there as well. Here is an example of how you write a simple test (test file must start with test_):

<!--#include virtual="/ajaxed/class_testFixture/testFixture.asp"-->
set tf = new TestFixture

'create test methods starting with test_ 
'followed by an increasing number
sub test_1()
    tf.assertEqual "x", "x", "x should be x"
    tf.assert 1 = 1, "one should be definitely one"
    tf.assertInstanceOf "testFixture", tf, "this test should be a TestFixture"
    tf.assertInDelta 1, 1.1, 0.1, "equality with a delta"
    tf.assertHas array(1, 2, 3), 2, "the array should contain 2"
end sub

Documentation generator (Documentor)

Some of you have long waited for the day to come :) Finally its here! Automatically create a documentation of your ASP code. The tool is called Documentor and can be found within your ajaxed console. It is also used for the generation of the actual ajaxed documentation which got a small face lift as well. Read How to document to know more about documenting your code (This manual can be found in your ajaxed console). Example of a method documentation:

'' @DESCRIPTION: gets all users for a given country
'' @PARAM: country [string]: specified country. e.g. AT
'' @RETURN: [recordset]
function getUsersBy(country)
end function

Automatic version check

The ajaxed console checks automatically for a new version of ajaxed and reminds you if there is a new version available. Never miss an update.

MD5 hash class

We have a hash on board of the library now. Hash your passwords, etc. easily with:

<% hash = (new MD5).hash("mypassword") %>

Database methods

There are some new useful database methods which makes your code more readable and easier to debug.

'get the number of records of a table
numberOfRecords = db.count("tablename", empty)

'get number of records with condition
numberOfRecords = db.count("tablename", "active = 1")

'insert a record into a table (returns the ID)
ID = db.insert("tablename", array("firstname", "jack", "lastname", "johnson"))

'updating a record
db.update "tablename", array("firstname", "Johnny"), ID

'works as well with condition
db.update "tablename", array("firstname", "Johnny"), "firstname = 'Jack'"

'delete a record with a condition
db.delete "tablename", "active = 0"

'delete with an ID
db.delete "tablename", 10

'toggle the value of bit fields.
db.toggle "tablename", "active", "country = 'AT'"

'or with ID
db.toggle "tablename", "active", 10

Most of them support a condition parameter which can be either a number (its used automatically as ID) or a string (which is a condition for the WHERE clause).
Those are handy for common CRUD operations. If you need more sophisticated stuff you should still use db.getRecordset().

RSS reader and writer

If you ever want to generate an RSS feed in your application or read another one - it's no problem anymore. ajaxed has the right component inside. There is a full detailed article about this component here.

'example of reading some feed
set r = new RSS
r.url = "http://domain.com/feed"

Template class

ajaxed 1.0 includes a template class called TextTemplate. Very useful if you send emails within your applications. Create an template for the content of your email and parse it using TextTemplate. The ajaxed console provides a simple management of templates. For more details about TextTemplate read the article Template component for classic ASP or check the ajaxed documentation. Simple example

set t = new TextTemplate
t.filename = "mytemplate.template"
t.add "name", "jack johnson"

'your email object
'i use the first line of the template as the subject of my emails
mail.subject = t.getFirstLine()
mail.body = t.getAllButFirstLine()

Cache component

Caching data, rss feeds, etc. globally for all visitors can be achieved now with the Cache class. This class has been around for while as well and a details article is available here.

Discussion group launched

Google GroupsI have created an own google asp ajaxed discussion group for better support and communication with all ajaxed users.

Minor changes/improvements

That was it. Hope you enjoy working with the new version and I am looking forward for your feedback .. which already made the library what it is! Here are some things i am working on already...

If you UPGRADE from 0.3 then the only thing you need to do is to move your config.asp into the new /ajaxedConfig/ folder. Last but not least create a header.asp and footer.asp in that folder. Put all your html, head and body tags there. You can use the existing ones and adopt them to your needs. Last but not least change AJAXED_ENVIRONMENT to your needed environment.

Download ajaxed 1.0
If you want to live on the edge then grab the latest version from SVN.

Posted in Releases 1983 days ago

Version 2.1 released1793 days ago