Open.ControlTier > ModuleForge
 

ElementsProjectBuilder

Builds and manages projects that use the Elements modules library

Overview

Open in Workbench ElementsProjectBuilder: Builds and manages projects that use the Elements modules library

ElementsProjectBuilder is derived from ProjectBuilder providing the ability to manage a ControlTier project. If you are new to ProjectBuilder see the tutorial starting with: Getting started using ProjectBuilder

The following sections describe how to obtain, install and use the Elements Module Library.

Obtaining the Elements module library

Follow the steps below to obtain and install the content library.

1) Download the desired library jar file from Sourceforge (at least 2.0):

Elements module library file release

2) Run the Register command specifying the following arguments:

ad -p project -t ProjectBuilder -o elements -c Register -- \
	 -basedir /path/to/basedir -installroot /path/to/targetdir

3) Run the load-library command specifying the following arguments:

ad -p project -t ProjectBuilder -o elements -c load-library -- \
        -jar /path/to/downloaded/elements-version-seed.jar

The destination project should now have the Elements module library types loaded.

Using the Elements module library

If you do not have the Element module library types loaded, see the preceding section.

After the Elements module library is installed, begin using the types in the library beginning with ElementsProjectBuilder:

1) Run the Register command specifying the following arguments:

 ad -p project -t ElementsProjectBuilder -o name -c Register -- \
        -basedir /path/to/module/srcdir -installroot /path/to/build/targetdir -install

2) Run the generate-objects command specifying the following arguments:

 ad -p project -t ElementsProjectBuilder -o name -c generate-objects -- \
        -name aName -defaults /path/to/your/defaults.properties -load

The -name argument is used as the name for each generated object. The -load flag specifies to have loaded the object definitions loaded on the server.

3) Run the depot-setup command to deploy the objects in AntDepo:

depot-setup -p project -a deploy

The objects are now ready for use either via the AntDepo CLI command, ad, or via JobCenter webapp GUI.

The objects are now ready for use either via the AntDepo CLI command, ad, or via JobCenter webapp GUI.

4) Run the BuildAndUpdate command that will use the newly generated set of objects:

ad -p project -t ElementsUpdater -o aName -c BuildAndUpdate -- \
        -buildstamp buildstamp

Note
Optionally, you can upload the job definition to Job Center. The generate-objects command will have also generated a name-job.xml. Login to JobCenter and push the "Create a new Job" button and upload the name-job.xml file.

The generate-objects command reads two template files and a defaults.properties file to generate two working files that can be used to load in the server. Without specific arguments, generate-objects will use templates from its templates directory as defined by the attribute templateDir.

Example:

      ad -p project -t ElementsProjectBuilder -o object -c generate-objects --\
         -name aName -defaults /path/to/defaults.xml -load
      

Yields an object model like so in the project:

	+aName [ElementsUpdater]
          |
          + aName [ConentBuilder]
          |  |
          |  |-aName [BuilderPackageInstallroot]
          |  |-aName [BuilderScmConnection]
          |  `-aName [BuilderScmModule]
          |
          ` aName [ElementsSite]
             |
             `-aName [ElementsDeployment]
      

The -defaults option specifies the defaults.properties file to use in conjunction with a object.template.xml file and provides a set of properties used during the generation process.

Example: defaults.properties

	#
	# Common name given to generated objects
	common.name=${opts.name}
	#
	# ElementsBuilder settings
	#
	scmConnection=http://svn/repos/example-content
	scmModule=${opts.name}.war
	packageInstallroot=/apps/${opts.name}
	#
	# deployment locations
	# 
	common.node=${framework.node}
	ElementsBuilder.node=${framework.node}
	ElementsDeployment.node=${framework.node}
      

Design

Super Type
ProjectBuilder

Extends ProjectBuilder

Role Concrete. (Objects can be created.)
Instance Names Unique
Notification false
Template Directory
Data View Children, proximity: 1
Logger Name ElementsProjectBuilder

Constraints

Allowed Child Dependencies

  • BuilderBuildFile1
  • BuilderBuildTarget1
  • BuilderScmBinding1
  • BuilderScmConnection1
  • BuilderScmLabel1
  • BuilderScmModule1
  • BuilderStageExtension1
  • BuilderStageFilebase1
  • ProjectBuilderDefaults1
  • ProjectBuilderDocBase1
  • ProjectBuilderForrestHome1
  • ProjectBuilderOrganizationDescription1
  • ProjectBuilderOrganizationName1
  • ProjectBuilderOrganizationURL1
  • ProjectBuilderProjectDescription1
  • ProjectBuilderProjectName1
  • ProjectBuilderProjectURL1
  • ProjectBuilderTemplateDir1

1: These types have a Singleton constraint. Only one instance may be added as a resource.

Allowed Parent Dependencies

  • Node

Attributes

Exported Attributes

Name Property
basedir deployment-basedir
targetdir deployment-install-root

Defaults for Imported Attributes

Name Default
buildFile ${modules.dir}/ElementsProjectBuilder/lib/build.xml
buildTarget all
defaults ${modules.dir}/ElementsProjectBuilder/templates/defaults.properties
docbase ${env.CTIER_ROOT}/src/doc
forresthome ${env.FORREST_HOME}
organizationDescription ControlTier Open Source project
organizationName Open.ControlTier
organizationURL http://open.controltier.com
projectDescription Elements Module Library 2.0
projectName elements
projectURL http://open.controltier.com
scmBinding svn
scmConnection https://moduleforge.svn.sourceforge.net/svnroot/moduleforge/elements/branches/2.0
stageextension jar
stagefilebase .*
templateDir ${modules.dir}/ElementsProjectBuilder/templates

Commands

Note
Commandline options displayed in square brackets "[]" are optional. If an option expects arguments, then angle brackets are shown after the option "<>". Any default value is shown within the brackets.

Related Types

The following types are defined for use with ElementsProjectBuilder.

ElementsProjectBuilderSetting

Overview

Open in Workbench ElementsProjectBuilderSetting: A ElementsProjectBuilder setting.

Design

Super Type
Setting
Role Abstract. (Objects cannot be created.)
Instance Names Unique

Constraints

Allowed Parent Dependencies
  • Builder

ElementsProjectBuilderDefaults

Overview

Open in Workbench ElementsProjectBuilderDefaults: file containing project defaults properties

Design

Super Type
ElementsProjectBuilderSetting
Role Concrete. (Objects can be created.)
Instance Names Unique

Attributes

Exported Attributes
Name Property
defaults settingValue

ElementsProjectBuilderTemplateDir

Overview

Open in Workbench ElementsProjectBuilderTemplateDir: file containing project template files

Design

Super Type
ElementsProjectBuilderSetting
Role Concrete. (Objects can be created.)
Instance Names Unique

Attributes

Exported Attributes
Name Property
templateDir settingValue