Tutorial
Installation and setup
- Download troika-asp.zip from
http://www.troika-asp.com/download - Extract troika-asp.zip into a folder, let us say c:/ troika-asp
-
You will see the following directory structure.
- WEB-INF
- A root folder for private application resources, not accessible through the web site directly
- WEB-INF/classes
- This is where JavaScript classes for both the framework and the web application are stored
- WEB-INF/classes/base
-
Base “package” contains definition of common reusable classes like Lists, Maps, Iterator and extended Object and String classes.
We extended Object class through JavaScript prototype mechanism. Any other classes implicitly extend Object class and hence inherit the following important functionality:
- Method toXML(), recursively accesses all instance properties and represents it as XML string.
- Method toString(), converts the instance to JavaScript literal object notation in JSON string format.
- Method valueOf(json), takes JSON string and converts it back to native JavaScript object
- Method flatten(), converts each instance properties to string.
- Method assign(fromObj), copies values of corresponding properties from fromObj to this instance.
- WEB-INF/classes/commands
- This is where application specific commands go. All command extend the Command object located in WEB-INF/classes/framework/Command.js
- WEB-INF/classes/forms
- This is there application specific RequestContext classes are stored
- WEB-INF/classes/framework
- This folder contains most of the framework implementation classes which rarely need changing
- WEB-INF/classes/models
- Contains generated DAO/VO classes, this is where you would place your business logic Model classes
- WEB-INF/classes/xml
- Contains helper classes for XML parsing and XSLT transformation
- WEB-INF/logs
- Contains application log files by default
- WEB-INF/views
- This is where you would store XSL templates for your application
- WEB-INF/config.dtd
- DTD definition for config.xml. It helps to validate the syntax of config.xml
- WEB-INF/config.xml
- Main application configuration file. Contains various Command, RequestContext and View mappings, database connection strings, logger setup and declarative security
- WWW
- Root to public accessible website pages, scripts, images and other resources
- Note: The JavaScript classes are broken into “packages” (base, commands, forms etc) for convenience and can be saved in any other folder or even in the same directory as long as they have unique names.
-
Configure your IIS server to use c:/troika-asp/www as your home directory:
-
(Optional step) Configure your IIS server to forward 500;100 ASP errors to your custom handler: