- Home
- DevShare
- Forums
- Wiki
- Products & Services
- Downloads
- Documentation
- Webinars
- Store
- Blog
The Encyclopedia Reporting Example is part of the Server Integration Technology download available from BIRT Exchange. It shows how to use BIRT reports to display information from the iServer Express Encyclopedia.
Contents |
This example shows how to use the BIRT Web Services Data Source to retrieve information from the Actuate iServer using the Actuate IDAPI. The Web Services Data Source in this example uses a custom connector class to perform the IDAPI communications with the Actuate iServer.
The example includes a report which performs three IDAPI operations: SelectUsers, SelectRoles, and SelectFiles. The Web Service data source takes the responses from these operations to generate a data set in the same way it would take a result set returned from a database query.
This example shows how to use BIRT reports to display information from the iServer Express Encyclopedia. The Encyclopedia is the database which stores information about reports, users, roles, jobs, etc. iServer Express provides a web services API called the IDAPI that performs a wide range of operations including queries against the Encyclopedia.
The example uses BIRT report elements that retrieve data from web services. The Web Services data source manages a connection to a SOAP server. Eclipse BIRT provides a Web Services data source that does most of the work required to connect to a web service. (See the references in the [#Documentation|Documentation section] below.) This data source needs custom Java code to add login credentials to the SOAP header sent to the server. The example includes Java code (in both source and compiled form) that perform these tasks for iServer Express. You can use this code directly in your own application.
The Web Services data set sends a SOAP message and parses the response into BIRT's row-and-column data set format. Most of the work to get data from the Encyclopedia, or indeed any web service, is in building the required Web Services data set.
The example report demonstrates the IDAPI data source by listing users, roles and files from your iServer Express instance. The report itself is simply an example; but you can copy and past the data sources and data sets into your own application.
The report lists the users, roles and files. User information includes name, home folder, e-mail address and more. Role information includes name and description. File information displays the entire folder hierarchy using a depth-first scan. Each file displays the name, version number, type, size and more.
The following is an example report run from within Eclipse:
The files for this example reside in "Actuate 9/ServerIntTech/Encyclopedia Reporting". The example directory contains two subdirectories: "BIRT Reports" which applies to iServer Express and "e.Reports" which applies to the Enterprise product and won't be further discussed here. "BIRT Reports" contains the following:
The Web Services Data Source and Data Set used in this example are based on components provided by the Eclipse Data Tools project. As a result, they do not use the same class path mechanisms as the rest of BIRT: you cannot put your custom driver classes in the usual BIRT locations, nor can you upload the driver JAR file to the server as described in Publish BIRT Resources to iServer Express. Instead, you must use the techniques described below. This is a known issue in both the Eclipse Data Tools project and iServer Express team and may be improved in a future release.
The best way to try the example is to create an Eclipse project that holds the example files. Here's how:
The example report is designed to connect to an iServer Express running on the local machine using default port numbers. If iServer Express is on a remote machine, or you changed the port numbers during install, then you'll need to adjust these values.
The example includes a JAR file, but the path to the jar file is incorrect. We'll need to fix it.
...\Actuate9\ServerIntTech\Encyclopedia Reporting\BIRT Reports\Jar\BIRTReporting.jar;
Where "...\Actuate9" is the location of your Server Integration Technology install, usually C:/Program Files/Actuate9 on Windows.
Note that the driver jar file path here must be absolute due to issues described above. The class path you specify here is used by the BIRT designer. However, it is not used when the report is run on iServer Express. Hence, the path here must be visible from the BIRT designer, but need not be visible to iServer Express.
The report will run. The report sends a series of SOAP messages to iServer Express, parses the response into row and columns, formats the data into a report, and displays the result. The first run might take a while to cache the needed information. The second and subsequent runs are much faster. The preview tab will display the sample report shown earlier.
While we ran the report in Eclipse, it can also be run on the server. Simply:
The example report shows the basics of creating BIRT reports against the iServer Encyclopedia. This section explores some of the details involved in creating your own reports.
The iServer Express IDAPI provides a wealth of information about your Encyclopedia. In fact, iPortal and Management console use IDAPI to perform all their operations. The job is to identify which information you need, and to craft a data source and report that present that information. To learn with the IDAPI provides, see the documentation references below.
The example Web Services Data Source driver connects to iServer Express using the "administrator" login with no password. While this works for a prototype, it does not work once you change the administrator password.
One solution is to create a special "reporting" user with the right permissions. Hard-code that user name and password into the driver code, and rebuild the driver. Another solution is to store login information in a configuration file that your driver reads. (The BIRT report cannot pass parameters to the driver, nor does the driver have access to BIRT's connection profile mechanism.)
BIRT will use your driver in three different ways. The BIRT designer locates your driver JAR differently than iServer Express.
Actuate9\iServer\JavaReportAPI\engines\birt\lib directory within the file system. The Web Service data source does not look in the iServer Express /Resource folder (where most other BIRT JAR files are put), nor does iServer Express use the Driver Class Path field.
If you want to report on users, roles or files, you can simply copy the data sets from the example report. If you want to report on any of the other data available on the server (jobs, groups, role assignments, schedules, etc.), then you'll need to create a data set to retrieve the data.
The example reports show how to report on users, roles and files. You can create your own reports on these objects simply by modifying the example data sets. Here's how.
Copy the data set into your report. In order to change the data set, you must correct the location to the sample response. We'll show how to do this in the sample report.
BIRT requires a sample of the response in order to determine the set of columns available for use. BIRT can get a live sample (by selecting Query Web Services at SOAP end point"), or by using external sample data. The example report uses the latter approach. However, the path in the example report is incorrect, and you must adjust it.
In the default Windows installation, the file is at:
C:/Program Files/Actuate9/ServerIntTech/Encyclopedia Reporting/BIRT Reports/Reports/SelectUsers_response.xml
The Table Mapping tab chooses the element from the response that contains each item of returned data. For the Users data source, it is the User element shown in the XPath Expression field.
This page shows the fields available within the table structure selected above.
You can see that the example provides columns for a small subset of the available fields. Note that not all returned fields apply to iServer Express; some apply to other versions of the product.
To be done...
See BIRT: A Field Guide to Reporting, 2e, Chapter 6, section "Accessing a web service" for more information about the Web Services data source.
See Integrating and Extending BIRT, 2e, Chaper 12, "Creating a web services data source using a custom connection class" for more information about the custom connection used to access the iServer Express IDAPI.
See http://www.birt-exchange.com/modules/documentation/ → BIRT Deployment → iServer Express Report Server → Programming with Actuate iServer APIs for information on the IDAPI web services API to iServer Express.