Demos Updated

Monday, October 4th, 2010|Misc|by Romans

Groundwork for new demo.atk4.com is complete. Lots of features to come soon such as commenting, suggestions, reviews, search and more.

http://demo.atk4.com/demo.html

If your team is developing a web application using Agile Toolkit then you might want to build your own demos / test-cases. Good news is – you can re-use same architecture for your own demonstration site, here is how:

Download Agile Toolkit

If you do not have installation of Agile Toolkit, then simply click on the download link and get a sample suite into your webroot.

Fresh Addons

You must ensure that your are using “addons” from the svn.

rm -rf addons; svn co https://agiletech.ie/svn/amodules3/addons .
If you want to use demos or tests in your existing project, then you might have to edit svn:externals property instead.

Attaching addons

Inside your API initialization you must ensure, that addons are included in search paths.

[php]
$this->addLocation(‘addons’,array(
‘php’=>array(‘camper’,
‘billing/lib’,
‘misc/lib’,
),
‘template’=>’misc/templates/’,
))->setParent($this->pathfinder->base_location);
[/php]

Adding Demo page

This should as easy as:

[php]
class page_demo extends Page_Doc_Howto {
}
[/php]

You do need to redefine anything on that page. It will automatically list all demos from the database as per Model_Doc_Howto.

Database

You will need to create doc_howto table. Schema and initial data can be found in addons/misc/doc/howto.*.sql. It also contains a sample “user” table, because this table is used in several examples. Feel free to use other table if you already have user table or do not wish to create it.

Editing Demo-cases

Because model for Demo-cases is provided you can use it with EntityManager page to build a simple administration system for your test-cases. Be sure to protect access to this page, because it allows user with access to execute arbitrary PHP code through demo page.

[php]

class page_howtoadmin extends Page_EntityManager {
public $controller=’Controller_Doc_Howto’;
public $returnpage=’howtoadm’;
}
[/php]

Thanks

I hope you will find demo website useful. I will continue to add additional how-to’s to the demo site. Let me know if experience any problems.