Portal UI Customization: Advanced

Installing UI Customization Sample Projects (Java)

Many ALI development topics use UI customization sample code in the SampleProjects-60x.zip available on the ALUI Developer Center on dev2dev, in the Code Samples directory. The instructions that follow explain how to install the files and add the projects to your IDE. The default file locations are shown below:




C:\Program Files\plumtree\ptportal\6.0

Note: In most cases, you should first set up your IDE for portal development as explained in the Setting Up the Java Development Portal.

Sample Projects

The sample code package includes the following projects:

Preparing the Sample Code

To prepare the samples for running:

  1. Extract SampleProjects-60x.zip to a new SAMPLE_HOME location (for example, C:\Sample Code). The directory structure created will include \ptwebui-samples, \_buildcommon, and \_local_repository.

    : Do not unzip the samples on top of the UI source code directory (SOURCE_HOME); they will conflict with existing build scripts.

  2. Confirm that you are using Ant 1.6.2 and Java JDK 1.4.2 or above. You must configure ANT_HOME and JAVA_HOME to point to the respective home directories (for example, ANT_HOME=c:\jakarta-ant-1.6.2).

  3. Make sure your JDKs bin directory is on your PATH. Test it by trying to run the JDK application jar from the command line.

  4. Build the samples by navigating to SAMPLE_HOME and typing the following: ant build  
    This will create a new subdirectory in SAMPLE_HOME called \buildoutput\java-samples that contains the sample JAR files.

Importing to Eclipse

To import the sample code into Eclipse:

  1. Extract SampleProjects-60x.zip to SOURCE_HOME\portalui\6.0.

    : This will overwrite some of the existing build files with new ones that contain targets for the sample projects. If you have previously downloaded the sample code and modified these files to add your own custom projects, your modifications will be overwritten.

  2. Open Eclipse, and click File | Import | Existing Project into Workspace.

  3. Click Next.

  4. Browse to the \java subdirectory of the project you want to import in SOURCE_HOME (i.e., \plumtree_ui_source\sampleview\java).

  5. Click OK and Finish.

Deploying the Sample Code JARs

Last, deploy the sample code JARs. Since the sample jar files must be accessible to both your Web application server (BEA, WebSphere, Tomcat) and the portal's Dynamic Discovery loader, you must copy the sample JARs to two locations.

  1. Copy the sample JARs from SAMPLE_HOME\buildoutput\java-samples to PORTAL_HOME\lib\java so they can be accessed by the portal's Dynamic Discovery mechanism.

  2. Add the JARs to your Web application server using the instructions below:

    1. Change directories to PORTAL_HOME\webapp.

    2. Move or delete the .ear file.

    3. Unzip the WAR file using Javas JAR command: jar xvf portal.war

    4. Copy the sample JAR files from SAMPLE_HOME\buildoutput\java-samples to PORTAL_HOME\webapp\WEB-INF\lib.

    5. Re-zip the WAR file using the JAR command: jar cvf portal.war *.*

  3. Add the sample projects to the debug configuration:

    1. In Eclipse, go to Run - Debug and open the Tomcat debug configuration (created during the UICI installation process).

    2. Go to the classpath tab and select User Entries. Click Add Projects and add any sample projects you want to debug.

Once you have made these changes, you can use the sample code.

Next: Creating a Custom Project