Deploying Java classes used in BIRT reports
A BIRT report uses scripts to implement custom functionality. For example, you can use scripts to create a scripted data set or to provide custom processing for a report element. When you deploy a BIRT report to a volume, you must provide iHub with access to the Java classes that the scripts reference. You package these classes as JAR files so an iHub Java factory process can recognize and process them. There are two ways to deploy Java classes:
*Deploy the JAR files to the volume.
This method supports creating specific implementations for each volume in iHub. This method of deployment requires packaging the Java classes as a JAR file and attaching the JAR file as a resource to the report design file. You treat a JAR file as a resource in the same way as a library or image. Using this method, you publish the JAR file to iHub every time you make a change in the Java classes.
*Deploy the JAR files to the following iHub subdirectory:
$ACTUATE_HOME\iHub\resources
This method uses the same implementation for all volumes in iHub. Actuate does not recommend deploying JAR files to an iHub /resources folder because you must restart the iHub after deploying the JAR file. Another disadvantage of this deployment technique is that the JAR file, deployed in the iHub /resources directory, is shared across all volumes, which can cause conflicts if you need to have different implementations for different volumes. When using this method, you do not have to add the JAR file to the report design’s Resource property.
iHub uses Java 1.6 compliance settings by default. A Java event handler deployed to iHub requires the same of lower level of Java compliance in the compiled class file.
How to configure BIRT to use a compliance level of Java 1.6 in an event handler
1 Open the Java event handler in BIRT Designer Professional.
2 Choose WindowPreferences.
3 In Preferences, in the navigation tree, expand Java and select Compiler.
4 In Compiler, in JDK Compliance, in compiler compliance level, select 1.6, as shown in Figure 42‑28.
Figure 42‑28 Setting the Java compiler compliance level
Choose OK.
5 Recompile the event handler classes.
How to configure BIRT reports and deploy a JAR file to a volume
1 Package the Java classes as a JAR file and copy the JAR file to the BIRT Designer Professional resource folder.
2 Open the report design in BIRT Designer Professional.
3 In Outline, select the root report design slot and select Resources property group in the Property Editor window.
4 In Resources, in JAR files, choose Add, and navigate through the Resource folder to select the JAR file, as shown in Figure 42‑29.
Figure 42‑29 Add JAR file as a resource to a report
When the report executes, the engine searches for the required classes and methods only in this JAR file.
How to deploy a JAR file to an iHub /resources folder
1 Copy the JAR file to the following iHub subdirectory:
$ACTUATE_HOME\iHub\resources
$ACTUATE_HOME is the folder where Actuate products install.
2 Publish the report to iHub, as described in Sharing applications.
3 Restart iHub.
4 Run the report from BIRT iHub Information Console.