Overview - Publish BIRT Resources to iServer Express


Main Page | Discussion | Edit | History | Help | Switch to MediaWiki mode


BIRT reports often reference other files, called resources. This section discusses how to publish your resources to iServer Express. This section is a bit more detailed than others because we describe how to deploy your own resources in addition to showing a simple example.

Contents

Resource Overview

BIRT reports can be self-contained files or they can reference resources stored in other files. BIRT resource files include the following:

  • Images
  • Cascading Style Sheets (CSS files)
  • Java event handlers in JAR files
  • JavaScript source code
  • Report libraries
  • Localization files (name/value pairs often used for translating report text. Somewhat confusingly, these files are also called "resource files" in the designer UI.)

BIRT resource files are placed into the "/Resource" folder on the server. Problem-free uploading requires that you understand the relationship between the resources in your development environment and the copies you upload to iServer Express. Follow these steps for a trouble-free deployment:

  1. Identify where your design resources are located
  2. Create the correct resource structure on iServer Express
  3. Upload resources
  4. Upload reports
  5. Test reports

This introduction shows how to use Management Console to upload resources so that you can get started quickly. In practice, you'll want to use an Actuate BIRT Report Designer (described below) to perform resource upload with one click.

Identify Report Resources

BIRT locates resources using the resource directory set in preferences. The preferences dialog is available from the top Eclipse menu in Window → Preferences. Within the preferences tree, look in Report Design → Resource. The directory shown here is your design-time resource directory:

BIRT Resource Preferences Dialog


The design-time Resource folder shown here corresponds to the iServer Express /Resource folder.

There are two possibilities for this setting:

  • Resources Stored in Each Project
  • Resources Stored in Central Location

Resources Stored in Each Project

The default setting, shown in the screen shot above, is to store resources for each BIRT project in the project folder itself. For example, if you have an "Accounting" project, then resources used by that project are stored in the "Accounting" project folder, while "Billing" project resources are located in the "Billing" project, and so on.

When you upload resources to iServer Express, the resources for all your projects are placed together in the iServer Express /Resource folder. Because of this, you must ensure that resource file names are unique across all projects. Ways to ensure unique names include:

  • Choosing descriptive names: "aging.js" instead of "scripts.js".
  • Placing resource files in folders that include the project name: "Accounting Resources", "Billing Resources", etc.
  • Adding prefixes or suffixes to file names: "acct-styles.css", "logo-billing.png", etc.

Resources Stored in Central Location

Some people divide their BIRT applications across multiple Eclipse projects. In this case, resources shared across projects, or shared within a project, are placed in a single central location. The Resource folder in the preferences dialog will point to a specific location on your file system such as "/projects/shared-resources". Again, the designer's Resource folder corresponds to the /Resource folder on iServer Express. But, in this case, all resources are already combined at design time into a single location and so the iServer Express /Resource folder will contain a copy of of the design Resource folder.

Mapping Resource Structure to iServer Express

Smaller projects may place all resources directly in the designer's Resource folder. Larger projects may choose to create folders to help organize resources. For example, a project might define three resource folders:

  • images, for storing images used in a report,
  • libraries, which stores report libraries and CSS files, and
  • scripts, which stores JavaScript files and Java event handler JAR files.

Depending on how you've got your Resource folder set in the designer, this structure could appear within each project, or in a single shared location. In either case, you will reproduce this structure, subfolders and all, within the iServer Express /Resources folder. For example, if you had the folders above, then you would create a folder "/Resources/images" on iServer Express to hold your images.

Example Report

Let's use an example report to make the following steps more concrete.

  • Download the example report and resources attached to this DevShare entry.
  • Within the BIRT or Eclipse designer, create a new project. From the top menu, choose File → New → Project.
  • Choose "Business Intelligence and Reporting Tools" → Report Project.
  • Click Next >.
  • Give your project the name "Resource Example" and click Finish.
  • Unzip the contents of the downloaded file into the file system folder that Eclipse created for your project.
  • Within the Eclipse, open the Navigator. Find your project. Use the context menu Refresh option.

You should now see the following:

Eclipse Navigator for the Sample Report


This project contains a report and one of each type of resource file, organized into folders. The example assumes you are using the default Resource folder setting, "Current Project Folder". If you have a central shared location, you must copy the resource files into that location.

  • Open the "Resource Example" report.
  • Preview it using the Preview tab.

You should see the following:

Output of the Example Report


Each line verifies that BIRT has found a different kind of resource. (If your output looks different, or if an error appears, verify that your Resource folder is set as described above.)

Verify Resource References

There are minor differences between the way resources are handled in Eclipse and Actuate BIRT versions. If you created your reports in Eclipse BIRT, it is a good idea to take a quick look at the resources used by your report before you upload it to prevent surprises later. In particular, review reports that reference JavaScript source files or Java event handler JAR files before you upload them. See Toubleshooting BIRT Resources for details. (This step is not needed for reports created in the Actuate BIRT designers.)

Create Resource Folders

The example report organizes resources into folders. We must mimic the project's folder structure within the iServer Express Resources folder.

  • Log into the iServer Express Management Console as Administrator (or as a user that has the Administrator role.) (See "Log into Management Console" in Set up Users & Security Roles for details.)

Navigate to the /Resources Folder.

  • Find the navigation trail at the top of the page which will show something like:
    machine-name > Home > administrator.
  • Click on the machine-name link. (It will display the name of your machine.)
  • A list of folders appears. Click on Resources.

You should see something like the following:

Resources Folder Page in Management Console


iServer Express comes with several resource files pre-installed. We will add additional resources needed by the example report. The first step is to create folders within /Resources that correspond to the folder structure. The example report contains four folders: "Images", "Libraries", "Messages" and "Scripts." Let's create them.

  • Click the Create Folder button.

The following dialog appears:

New Folder Dialog in Management Console


  • Type in the first folder name, "Images".
  • You can leave the Description field blank.
  • Click OK.
  • Repeat for the other folders, "Libraries", "Messages" and "Scripts."

The Resource folder should now appear as follows:

Resources Folder with Sample Folders Created


Upload the Resources

Now we can upload the resource files themselves. There are two ways to upload resources: using the iServer Express Management Console, and using the publish feature of the Actuate BIRT designer. We will use the Management Console approach here. We will upload the resources needed for the sample report.

  • Click on Images to open the Images folder.
  • Click on Add File to open the file add dialog.
  • Click on the Browse button to find the image on your local disk. It appears in the BIRT project folder that you created for the example report, within the Images folder.
  • Click "Replace the latest version." (Not really required when adding a new file, but you should choose this when replacing existing resource files.)

At this point, this is what you should see:

Add File Dialog in Management Console


  • Click Upload to upload the file.

The file properties dialog appears:

File Properties Page in Management Console


  • Click OK.
  • Repeat for each of the other five resource files in the sample project. Be sure to upload them to the correct folders on iServer Express:
    • Libraries/Example CSS Resource.css
    • Libraries/Example Library.rptlibrary
    • Messages/Resource Example.properties
    • Scripts/Example Java Resource.jar
    • Scripts/Example JavaScript Resource.js

Upload the Report

The next step is to upload the sample report itself. We will place it in the user's home folder.

Switch to the current user's home folder:

  • Find the navigation trail at the top of the page which will show something like:
    machine-name > Resources
  • Click on the machine-name link. (It will display the name of your machine.)
  • A list of folders appears. Click on Home.
  • Locate the home folder for the current user and click it.

Upload the sample report:

  • Click on Add File to open the file add dialog.
  • Click on the Browse button to find the report called "Resource Example.rptdesign". It appears in the BIRT project folder that you created for the example report.
  • Click Upload to upload the file.
  • The file properties dialog appears. Click OK.

Test the Report

The final step is to test the report using iPortal for iServer Express.

You will see the user's home folder that contains the sample report.

You should see the same output as you saw in the designer:

Example Report Output in iPortal


Not very pretty, but it does demonstrate that BIRT was able to find each kind of resource file.

Replacing Resources

As you maintain your reports, you may find the need to replace resource files. iServer Express supports file versions. However, the Java infrastructure that BIRT uses does not recognize versions. Instead, if the Resource folder on iServer Express contains files with multiple versions, BIRT always uses the latest version. To ensure that new resources work as expected, keep only one version of each resource on iServer Express. To do this, choose the "Replace the latest version" option when uploading:

Add File Dialog Showing "Replace the latest version" Checked


If you replace a JAR file, you must stop, then restart iServer Express for BIRT to pick up the new version. Use the Services tool on Windows.

Actuate BIRT Designers

The above procedure has assumed you are new to Actuate and are using the open source Eclipse designer. Actuate offers enhanced versions of the BIRT designer that make it much easier to upload BIRT reports and resources. Actuate offers two designers: BIRT Report Designer and BIRT Report Designer Professional. The Actuate BIRT designers provide many advantages beyond Eclipse BIRT. Two are of special interest when working with BIRT Resources:

Single-click upload of designs and resource files
The above steps used Management Console to create each resource folder one-by-one, then upload each resource file one-by-one. All of this can be done with a single click in the Actuate BIRT designers.
Designer guaranteed to be at same version level as iServer Express
The Toubleshooting BIRT Resources page discusses changes you must make to your design to ensure that resource paths are compatible with iServer Express. These problems occur because the Eclipse version of BIRT is slightly different than the Actuate version. Using the Actuate BIRT designers ensures that designer and server are using compatible versions.

References

Toubleshooting BIRT Resources
for help if you encounter problems with BIRT resources on iServer Express.
Using the Actuate BIRT Report Option in product documentation
Information about resources can be found in "Deploying BIRT Reports to Actuate iPortal and iServer" → "Deploying BIRT reports in enterprise mode and iServer Express" → "Publishing a BIRT report resource to Actuate iServer"

Product documentation is available in two places:


Retrieved from "http://www.birt-exchange.com/wiki/Overview_-_Publish_BIRT_Resources_to_iServer_Express/"

This page has been accessed 964 times. This page was last modified 16:28, 16 July 2008.