Configure
Overview
This document describes how to configure a project to use the content library.
The diagram below illustrates the configuration is driven by a defaults.xml file. This file is used as input by a command generate-objects which in conjunction with template files, produces two output files: object.xml and job.xml.

Step #1: Edit defaults.xml
The defaults.xml file contains all the essential environment-specific information needed by the library. It answers questions like: What box is the ControlTier server? Which box is used for the development environment? Which for staging?
Open a text editor or better yet an XML editor. Cut and paste the contents of the (Linux specific) XML shown below (Windows equivalent here) and save it to disk. You can use the example verbatim if you're looking to setup the sample applications on the same box you installed the ControlTier server on.
<?xml version="1.0"?>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- Defaults data for ElementsProjectBuilder generate-objects project XML document. -->
<!-- -->
<!-- Defines a set of objects that implements the Duke's Bank and Hello World sample -->
<!-- application development and staging environments deployed to one or more systems. -->
<!-- -->
<!-- The target platform is JBoss 4.0 and HSQLDB database and Tomcat 6. -->
<!-- -->
<!-- Defines deployment and setting type objects as they are first used, and subsequently -->
<!-- refers to objects by type and name whenever they are needed again. -->
<!-- -->
<!-- This file can be supplied to the ProjectBuilder "generate-objects" command to load -->
<!-- sample objects into a project that contains the "content" library's type model. -->
<!-- -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<defaults>
<default>
<!-- The default node is the framework node of the Ctl client invoking the -->
<!-- generate-objects command. (For the default installation this will be -->
<!-- "localhost"). -->
<node>${framework.node}</node>
</default>
<!-- The default location of the installation directory for the Duke's Bank -->
<!-- and Hello World sample application source files and packages: -->
<installroot>${env.CTIER_ROOT}/demo/elements</installroot>
<!-- The out-of-the box sample applications can be configured to run on -->
<!-- from one to six systems. One system must be designated the ControlTier -->
<!-- server. This is the system where Workbench and Jobcenter run. Another -->
<!-- system is designated as the build box where CruiseControl and the Ant -->
<!-- based build are run. -->
<!-- -->
<!-- One or two boxes are assigned to the development environment. Builds are -->
<!-- run here, and the development JBoss instance and "source" HSQLDB database -->
<!-- instance are deployed here. A fifth and possibly sixth system host the -->
<!-- staging environment which includes both JBoss and HSQLDB instances. -->
<!-- -->
<!-- Note that all these systems can be the same box in which case separate -->
<!-- JBoss and HSQLDB server instances are started on separate ports. -->
<server>
<node>${defaults.default.node}</node>
</server>
<development>
<buildserver>
<!-- The default copy of the JBoss 4.0 modified Duke's Bank source code and the Tomcat 6 "Hello, World" sample application is kept under Subversion on Sourceforge: -->
<scmconnection>
<dukesbank>https://moduleforge.svn.sourceforge.net/svnroot/moduleforge/elements/branches/3.2/demo/DukesBank/src</dukesbank>
<helloworld>https://moduleforge.svn.sourceforge.net/svnroot/moduleforge/elements/branches/3.2/demo/HelloWorld</helloworld>
</scmconnection>
<node>${defaults.default.node}</node>
</buildserver>
<applicationserver>
<node>${defaults.default.node}</node>
</applicationserver>
<databaseserver>
<node>${defaults.default.node}</node>
</databaseserver>
</development>
<staging>
<applicationserver>
<node>${defaults.default.node}</node>
</applicationserver>
<databaseserver>
<node>${defaults.default.node}</node>
</databaseserver>
</staging>
</defaults>
You are at liberty to change any of the six box names to systems that make sense in your environment, thereby ending up with the sample application's development and staging environments deployed to as many as six and as few as a single system.
Step #2: Configure library objects
Register and install an ElementsProjectBuilder object:
ctl -p project -m Deployment -c Register -- \
-name name -type ElementsProjectBuilder \
-basedir $CTIER_ROOT/src/project -installroot $CTIER_ROOT/target/project \
-install
... or, specifically for the sample applications:
$ ctl -p default -m Deployment -c Register -- -name elements -type ElementsProjectBuilder -basedir $CTIER_ROOT/src/elements -installroot $CTIER_ROOT/target/elements -install Checking for existing object, (ElementsProjectBuilder) elements, in project, 'default'... Registered new object. . . . [command.timer.Deployment.Register: 3.096 sec] C:\>ctl -p default -m Deployment -c Register -- -name elements -type ProjectBuilder -basedir %CTIER_ROOT%\src\elements -installroot %CTIER_ROOT%\target\elements -install . . . [command.timer.Deployment.Register: 2.359 sec]
Copy the defaults.xml you created in Step #1 to $CTIER_ROOT/src/project/defaults.xml and run the generate-objects command:
ctl -p project -t ElementsProjectBuilder -o name -c generate-objects -- \
-name aName \
-defaults $CTIER_ROOT/src/project/defaults.xml -upload
... or, specifically for the sample applications (using different defaults XML files for Linux and Windows):
$ ctl -p default -t ElementsProjectBuilder -o elements -c generate-objects -- -defaults $CTL_BASE/depots/default/modules/ElementsProjectBuilder/templates/defaults.linux.xml -upload
.
.
.
[command.timer.generate-objects: 0.156 sec]
generate-objects completed. execution time: 0.156 sec.
After this command successfully completes, a new set of objects will be loaded into the ControlTier repository. You can view them via ElementsProjectBuilder's find-objects command:
ctl -p project -t ElementsProjectBuilder -o name -c find-objects -- \
-name aName
Before you can run any commands, it is necessary to deploy the objects. This is done via the AntDepo command, ctl-depot. Run the following installation command on all boxes in your configuration:
ctl-depot -p project -a install
... or, if you're following the sample application setup instructions, more specifically (for a single box example):
$ ctl-depot -p default -a install "Install" command running for object: (Site) stagingDukesBank "Install" command running for object: (TomcatAntBuilder) helloWorld "Install" command running for object: (TomcatServer) stagingHelloWorld "Install" command running for object: (Site) developmentHelloWorld "Install" command running for object: (Updater) developmentHelloWorld "Install" command running for object: (AntBuilder) helloWorld "Install" command running for object: (CruiseControl) dukesBank "Install" command running for object: (JBossServer) developmentDukesBank "Install" command running for object: (CruiseControl) elements "Install" command running for object: (Updater) developmentDukesBank "Install" command running for object: (JBossAntBuilder) dukesBank "Install" command running for object: (HsqldbRdbExportBuilder) dukesBank "Install" command running for object: (HsqldbRdb) developmentDukesBank "Install" command running for object: (ElementsProjectBuilder) elements "Install" command running for object: (Site) stagingHelloWorld "Install" command running for object: (TomcatServer) developmentHelloWorld "Install" command running for object: (Site) developmentDukesBank "Install" command running for object: (HsqldbRdb) stagingDukesBank "Install" command running for object: (JBossServer) stagingDukesBank
Step #3: Upload job definitions
Define the sample application jobs in JobCenter using the ProjectBuilder "generate-jobs" command:
$ ctl -p default -t ElementsProjectBuilder -o elements -c generate-jobs -- -defaults $CTL_BASE/depots/default/modules/ElementsProjectBuilder/templates/defaults.linux.xml -upload Using defaults file: /home/jboss/ctier/ctl/depots/default/modules/ElementsProjectBuilder/templates/defaults.linux.xml ... Copying 1 file to /home/jboss/ctier/src/elements Generated job.xml file: /home/jboss/ctier/src/elements/default-job.xml Invoking load-jobs -filename /home/jboss/ctier/src/elements/default-job.xml . . .
The new jobs will be listed on the home page of JobCenter.
Step #4: Upload packages to the repository
The solution library also manages all the platform (3rd party) software packages needed to establish environments. The only assumptions are that you have a compatible OS image at your disposal, a user account with the ControlTier client installed and available, and sufficient disk space to deploy the platform and application software.
The general method of adding 3rd party packages to the ControlTier repository is by uploading them using Workbench:

If your intention is to run the sample applications and you have generated and configured the example library objects mentioned above, then upload the following packages into the ControlTier repository via Workbench (i.e. select package objects and upload one at a time):
- The Zip archive of the binary distribution of Ant 1.7.0 (http://ant.apache.org/bindownload.cgi).
- The Zip archive of the binary distribution of CruiseControl 2.7.1 (http://sourceforge.net/project/showfiles.php?group_id=23523&package_id=16338).
- The Zip version of the JBoss 4.0.3SP1 subscription or community edition (http://labs.jboss.com/jbossas/downloads/).
- The Zip archive of HSQLDB 1.8.0.9 (http://sourceforge.net/project/showfiles.php?group_id=23316&package_id=16653).
- The initial version of the Duke's Bank data package from Moduleforge (http://moduleforge.svn.sourceforge.net/viewvc/moduleforge/elements/branches/3.2/demo/DukesBank/data).
- The Zip version of Apache Tomcat 6.0.14 (http://archive.apache.org/dist/tomcat/tomcat-6/v6.0.14/bin/apache-tomcat-6.0.14.zip).



