ATK Demo Walkthrough
From ATK Wiki
This is a walkthrough guide for the ATK demo application. First time users are encouraged to run the demo and read this guide, to get an understanding of the way ATK works.
Developing an application in ATK is sometimes referred to as 'Declarative Programming'. This means you define data structures, and the framework uses these to build the application around it. ATK is also a form of RAD. Not in the traditional visual click-an-interface sense such as Visual Basic, but it’s Application Development, and after building your first application, we hope that you'll say "Now that was Rapid!".
This guide takes you through the steps of installing the demo, walking through the demo lessons, and finally getting you started developing your own apps. It’s like we first help you unpack your bicycle, then hold the bike while you are learning to keep your balance, and finally let you go to drive off on your own. But not without protection and a helmet.
Running the On-Line Demo
If you are not ready to install ATK but want to learn more about it, you can run the ATK On-Line Demo. To login, use ‘administrator’ as username and ‘demo’ as password.
If you want to install ATK now, see the ATK Installation instructions to install the demo application. (In the installation instructions, follow the steps that say 'with demo application').
Once you’ve installed the demo, let’s see if it works. Browse the application with a web-browser (for example http://localhost/atk5-demo/ or wherever you installed it), and see if you get a login prompt. If you did not change the configuration file, you should be able to log in using ‘administrator’ as username and ‘demo’ as password.
A first look - Testing the demo installation
Once logged in, you see the default application layout. At the top, there’s a frame telling you who you are, with the possibility to log out. On the left, there’s the menu, containing 10 lessons. The rest of the screen is where all the action will take place.
If you click lesson 1 in the menu, you’ll see a submenu containing an entry called ‘Employees’. Click it, and to the right you will now see the employee administration screen. About three employees should be listed. You should be able to use the edit button to edit an employee, and the add link to add a new employee.
If this works, the installation is ok.
If you don’t see any of this, or if you are unable to login, or get an error, or are in any other way unable to ride the bike, revisit chapter one and see if you missed anything there. If you still have trouble getting the demo to run, subscribe to the ATK mailinglist (http://www.achievo.org/atk/support) and ask for help.
Becoming familiar with how an ATK application is set up
Before you start to use your bicycle, it’s good to know what the pedals are for, and where the brakes are.
Let’s have a look. The directory that contains the demo has several files and subdirectories. The ‘atk’ directory is the location of the ATK library. This is where all the framework code resides. When you develop an application, anything in this directory is usually not changed. Unless of course you want to extend the ATK base library.
The ‘atktmp’ directory is a temporary directory, where ATK stores temporary files, like compiled or cached templates. Files are cached or compiled for performance reasons, and neither you as a developer nor the end user has to worry about these files, they are handled by the system. The only thing you have to keep in mind is that this directory must be writable by the webserver (which you did during installation of the demo).
The modules subdir is where your application code will be located. An application is built out of modules. For example, when developing a shop administration application, you might have a products module, a customer module, a finance module etc. It is possible to build an application in one big module, but this is not advisable. The bigger a module, the harder to understand it will be. Small modules are also easier to reuse. For example, if an application you build has a ‘customer’ module, it’s very easy to reuse this module in other applications that deal with customers. In the demo, each lesson is a separate module.
The ‘languages’ directory contains application-wide language files. It contains the translations of strings in the languages that you want to support in your application. Most strings will be placed in the modules, so the application wide files will only contain some very general translations like the application title.
Walkthrough of each lesson in the demo
For the most part, these lessons are designed to be followed in order.