The Build Environment
This section explains the build environment for generating the HTML files that are used for the GUI and for compiling the necessary Java source files. It assumes the use of Ant, the Java-based build tool.
The following file system structure under the computed profile directory is assumed:
Name of File or Folder | Description |
META-INF | This folder contains the config.properties file, which is the build file for the computed profile. This properties file contains an entry of the following format: com.softwareag.centrasite.computed.profil e.bui.impl.class=com.softwareag.centrasite.bui.profil e.server.SampleComputedProfileImpl |
src | This folder that holds the Java source files. |
lib | This folder contains the archive file with the source code examples, the plug-in's executor class and the external libraries. |
html | This folder holds the html files that specify your computed profile window. |
images | This folder holds the image files. |
css | This folder holds the css files. |
js | This folder holds the JavaScript codes. |
build.xml | The Ant input file for building the destination files |
The Ant file shown below, named build.xml, can be used to establish a custom computed profile.
<?xml version="1.0" encoding="utf-8"?>
<project name="SampleProfile" default="all" basedir=".">
<property file="${basedir}/build.properties" />
<property name="src.dir" value="${basedir}/src" />
<property name="classes.dir" value="${basedir}/classes" />
<property name="build.output.dir" value="${basedir}/build_output" />
<path id="project.class.path">
<fileset dir="${gwt.home}">
<include name="gwt-dev.jar" />
<include name="gwt-user.jar" />
<include name="validation-api-1.0.0.GA.jar" />
<include name="validation-api-1.0.0.GA-sources.jar" />
</fileset>
<fileset dir="${centrasite.redist.dir}">
<include name="gf.jaxr-api-osgi.jar" />
<include name="INMConfiguration.jar" />
</fileset>
<fileset dir="${centrasite.rts.dir}">
<include name="CentraSiteLogicLayer-API.jar" />
<include name="CentraSiteLogicLayer-impl.jar" />
<include name="CentraSiteUtils.jar" />
<include name="gf.jaxr-api-osgi.jar" />
<include name="CentraSiteJAXR-API.jar" />
</fileset>
<fileset dir="${others.dir}">
<include name="gson-2.2.2.jar" />
</fileset>
<pathelement location="${src.dir}" />
</path>
<target name="all"
depends="clean, compile, compile-to-javascript,create-jar,create-zip" />
<target name="clean">
<delete dir="${basedir}/gwt-unitCache" />
<delete dir="${build.output.dir}" />
<delete dir="${classes.dir}" />
<delete dir="${basedir}/html/SampleProfile" />
</target>
<target name="compile">
<mkdir dir="${classes.dir}" />
<javac srcdir="src" destdir="${classes.dir}" debug="${javac.debug}"
debuglevel="${javac.debuglevel}" optimize="${javac.optimize}"
deprecation="${javac.deprecation}" classpathref="project.class.path"
failonerror="true" memoryMaximumSize="512m" fork="true" />
</target>
<target name="compile-to-javascript" depends="compile"
description="GWT compile to JavaScript">
<mkdir dir="${build.output.dir}" />
<java failonerror="true" fork="true"
classname="com.google.gwt.dev.Compiler" classpathref="project.class.path">
<arg value="-war" />
<arg value="${build.output.dir}" />
<arg value="com.softwareag.centrasite.bui.profile.SampleProfile" />
<jvmarg value="-Xms1024m" />
</java>
</target>
<target name="create-jar" depends="compile"
description="create the jar by including the domain and server">
<jar destfile="classes/lib/SampleProfile.jar">
<fileset dir="classes"
excludes="**/client/** **/junit/** **/test/** **/lib/**" />
<manifest>
<section name="com/softwareag/centrasite/bui/profile/server">
<attribute name="Implementation-Title"
value="Rule for SampleProfile profile assertion" />
<attribute name="Implementation-Version"
value="${component.full.version}.${working.build.number}" />
<attribute name="Implementation-Vendor" value="Software AG" />
</section>
</manifest>
</jar>
</target>
<target name="create-zip" depends="compile,compile-to-javascript,create-jar"
description="Creating the computed profile zip">
<delete dir="html/SampleProfile" />
<copydir src="${build.output.dir}/SampleProfile"
dest="html/SampleProfile" />
<zip update="yes" basedir="." includes="META-INF/**"
destfile="${build.output.dir}/SampleProfile.zip" />
<zip update="yes" basedir="." includes="html/**, css/**, js/**"
destfile="${build.output.dir}/SampleProfile.zip" />
<zip update="yes" basedir="classes" includes="lib/**"
destfile="${build.output.dir}/SampleProfile.zip" />
</target>
</project>
The classpath for the build step must refer to all JAR files contained in the redist folder of the CentraSite installation. Add these JAR files to the build path of your java project also.