Doco HomeTutorial Home
Tutorial steps: 1,   2 and 3,   4 and 5,   6 and 7,   8

Step 2 and 3 - Directory tree setup, making DODS code, HTML markup, etc

Step 2 - Starting point

The slice1.tar content is generated from the slice0.tar by running

newapp timesheet
cd timesheet
make -s
starting in the parent directory of the application root directory. (Note: the -s option to make could be left off - but it suppresses some verbiage that just clutters the screen, IMHO.)

Step 3 - Overview of developer actions

At this stage, the developer has to configure the Makefiles, and mark up the HTML files with ID attributes in tags, and create files required by the Makefile system.

Optionally, the developer may also convert the HTML prototypes into m4. This allows common structures - such as the HEAD section, and page headers and footers - to be captured in a single m4_include file.

Detail of developer actions

The script confpres in platypus bin does a lot of the this work for the developer ... but isn't quite polished. It must be configured by editing the script. Use it if you wish.

Standard pages
Copy the files in platypus/src/app into the src/presentation directory.
In the Java files, change applicationName to the name.
The script confpres does this.
Presentation subdirectories
Create subdirectories, corresponding to those in the artists directory, within the presentation directory. Put Makefiles into these subdirectories.
The script confpres creates these directories, and puts Makefile stubs into them. However, the Makefiles need some hand editing.
Business subdirectories
Create subdirectories, corresponding to those in the artists directory, within the business directory. Put Makefiles into these subdirectories.
The script confpres creates these directories, and puts Makefile stubs into them. However, the Makefiles need some hand editing. Note that the BDO classes aren't even stubbed in the Makefiles.
Prototype HTML
Copy the HTML from the artists directory tree into the presentation directory tree.
The script confpres does this.
Create config.xmlc
Create a config.xmlc file, or alter .html to .po in the prototype HTML were necessary. If you have subdirectories, you should use regexps in config.xmlc.
Note: in the tutorial, we have edited the prototype HTML.
Note: even if you alter .html to .po in the prototype HTML, you need to create an empty config.xmlc file because the Makefile system assumes it exists - and uses it as a dependency in the rule for running XMLC.
Convert to m4
[Optional] We often use the m4 preprocessor to generate out prototype HTML. This allows us to extract common headers, etc, into a single file. We haven't used m4 in this tutorial app.
dev.conf
Create the dev.conf file in the application root directory. This file is described here.
The script confpres will create a dev.conf file, and put in the CORE.PO section.
src/data/db/Makefile
The ROOT variable is given an incorrect value here. It should be "../../..". (Currently, it is generated with the value "../..".)
HTML markup
See hints on marking up HTML.
Restore SUBDIRS in src/Makefile.
NewApp creates the src/Makefile with a variable called UNUSED_SUBDIRS containing the various subdirectories for the make - usually util, data, business and presentation. Move at least data, business and presentation to SUBDIRS. The subdirectory util need only be done if you plan to create utility classes in there for the application.
DODS
To get the database schema shown in first tutorial step (slice0.tar), DODS would have been run to setup the various tables. Copy the doa file created into the src/data directory. Go to the src/data directory and type make -s. This will invoke DODS and generates code into the applicationName/data area. During this process, the code is also compiled into the classes directory.
Subdirectories in classes/timesheet
Ensure util, data, business and presentation classes directories exist. The script confpres does this.
mkdir -p classes/$APP_NAME/util
mkdir -p classes/$APP_NAME/data
mkdir -p classes/$APP_NAME/business
mkdir -p classes/$APP_NAME/presentation 
PO lists in Makefiles
In the Makefiles under src/presentation/, there are lists PO_UNUSED, PO_DOM, etc. The POs should be moved from PO_UNUSED to PO_CONF in each of these Makefiles.

The slice2.tar contains the marked up prototypes, hand-edited from the slice1.tar content.