CentraSite 10.7 | CentraSite Developer's Guide | Customizing CentraSite | Customization of CentraSite Control | Customizing the Welcome Page | Implementing the Sample Customized Welcome Page
 
Implementing the Sample Customized Welcome Page
1. Implement the demo as an Eclipse Java project.
a. Start Eclipse.
If you want to use Eclipse as your development environment for updating the Java sources of the customized welcome page, the demos\WelcomePage folder contains the Eclipse project files .classpath and .project. You can use these files to create an Eclipse Java project for managing your Java sources.
b. Select File > New > Project > Java Project.
c. Select Create project from existing source.
d. Specify the path demos\WelcomePage as the location of the existing project files.
When you build the project in Eclipse (using for example Project > Build Project), there should be no errors reported.
2. Build the deployment files for Software AG Runtime.
a. Build the jar file by using Apache Ant with the build file build.xml provided in the demos\WelcomePage folder.
To deploy the demo Welcome page to Software AG Runtime, you have to create a jar file containing the Java classes of the Java sources, then copy the jar file and any required graphic icons to the Software AG Runtime environment.
The file build.xml uses a properties file build.properties to define some customer-specific files names and folder locations. The build file, build.xml also builds a zip file that contains the jar file and all required graphical icons. To deploy the demo welcome page, you can extract the contents of the zip file directly into your Software AG Runtime location.
The file build.properties contains the following properties that you should tailor to your working environment before you run build.xml.
Property
Description
projectName
This is the name that is used for the jar file and zip file that are created by the Ant task.
The jar file is copied to the CentraSite\lib folder in the Software AG Runtime environment, so select a name that is easily distinguishes the jar file from other jar files at the Software AG Runtime location.
pluggableLocation
This is the location of the webapps/PluggableUI folder in the Software AG Runtime environment. In a Windows environment, you should use forward slash instead of backward slash in the path name.
centraSiteLocation
This is the path where your CentraSite installation is located. In a Windows environment, you should use forward slash instead of backward slash in the path name.
3. Build the deployment files using Eclipse or from Command Line.
The build.xml file contains the definition of the tasks to be performed by Ant. The tasks defined in the delivered demo version are:
*Compile the Java sources that are located in the folder src and store the Java classes in the folder classes.
*Create a jar file containing all of the class files, and store the jar file in the folder lib.
*Create a zip file that contains the jar file and all icons associated with the customized welcome page and store the zip file in the folder lib.
The build.xml file is an XML file that contains element definitions such as:
<zipfileset dir="resources" prefix="images"> <include name="*.png" /> </zipfileset>
In such cases, the dir attribute indicates the name of the folder in the build environment where Ant can locate the required files, and the prefix attribute indicates the folder in the Software AG Runtime environment where the files is copied to. In the extract shown above, Ant searches for all PNG graphics files ("*.png") in the resources folder in the build environment and add them to the zip file so that they can be extracted into the images folder in the Software AG Runtime environment.
Whether you build the deployment files using Eclipse or the command line, the Ant tasks defined in the build.xml are processed. Ant builds a new jar file demos\WelcomePage\lib\SagBlueWelcomePage.jar, containing all of the Java classes required for the Software AG Runtime environment. It also build a zip file demos\WelcomePage\lib\SagBlueWelcomePage.zip, containing the jar file and all required PNG graphics. The name SagBlueWelcomePage comes from the definition of the property projectName in the file build.properties.
*Building the Deployment Files Using Eclipse
1. In Eclipse, select the build.xml file in the Package Explorer view.
2. In the context menu, click Run As > Ant Build....
3. Ensure that the options are set for Clear Environment, Compile Sources, Create JAR file, Create ZIP file.
4. Click Run.
*Building the Deployment Files from the Command Line
1. Open a command prompt window.
2. Go to the demos\WelcomePage folder.
3. Type the command ant clean.
4. Type the command ant.
4. Deploying the Demo to Software AG Runtime
a. Stop Software AG Runtime.
b. Do one of the following alternatives:
*Unzip the zip file created by the Ant build into <RuntimeDir>\workspace\webapps\PluggableUI\CentraSiteControl directory.
This copies the jar file created by Ant into the folder <RuntimeDir>\workspace\webapps\PluggableUI\CentraSiteControl\lib and the PNG files into the folder <RuntimeDir>\workspace\webapps\PluggableUI\CentraSiteControl\images.
*As an alternative to using the zip file, you can just copy the jar file from the Ant build into <RuntimeDir>\workspace\webapps\PluggableUI\CentraSiteControl\lib and the PNG files into <RuntimeDir>\workspace\webapps\PluggableUI\CentraSiteControl\images.
c. Update the plugin.xml file in the Software AG Runtime environment to point to the Java classes of the customized Welcome page, as described in Implementing the Sample Customized Welcome Page. The file plugin.xml in the folder demos\WelcomePage\resources contains the elements that must be updated in the plugin.xml file for Software AG Runtime.
Copy the entries manually from demos\WelcomePage\resources\plugin.xml to the plugin.xml file under Software AG Runtime. Remember to comment out the original entries for the standard Welcome page when you copy in the new entries.
d. Restart Software AG Runtime.
5. Display the demo Welcome page.
After you have deployed the demo to the Software AG Runtime environment and restarted Software AG Runtime, the demo Welcome page is visible when you start CentraSite Control.