previous next

3. Integration

3.1. Building the Engine class

To compile your Engine class, you need to have the rwrun.jar in your classpath. The rwrun.jar file is in the $ORACLE_HOME/reports/jlib directory. If you are using Oracle JDeveloper (Oracle DS), just add the Reports Runtime library to your project.

The complete URL Engine example used in this tutorial is available in the resources section. The example zip file contains two URLEngine jar files - URLEngine_9i.jar, and URLEngine_10g.jar. Depending on the Reports version you are using (9i or 10g) you should extract the relevant jar file into the ORACLE_HOME\reports\jlib folder, and rename it to URLEngine.jar.

3.2. Registering the new Engine

Open the Reports Server configuration file ($ORACLE_HOME/reports/conf/<server_name>.conf) and locate the engine element. You will notice that two types of engines are configured by default - the Reports default engine (rwEng) and the in-built URL Engine (rwURLEng).

To register the sample URL engine, you will have to add an XML entry for this engine in the Reports Server configuration file.

Add a new XML entry to the Reports Server configuration file:

<engine id="rwURLEngSample" class="oracle.reports.plugin.engine.urlengine.URLEngine" initEngine="1" maxEngine="1" minEngine="0" engLife="50" maxIdle="30" callbackTimeOut="60000" classPath="ORACLE_HOME\reports\jlib\URLEngine.jar" />

Replace ORACLE_HOME with the actual path on your machine. Notice that the above XML entry is different from the existing <rwURLEng...> entry in the following 2 ways:

  • The class attribute points to the plugin sample class instead of the in-built URL Engine class that comes with Oracle Reports installation.
  • The classPath element is introduced to explicitly include the URLEngine.jar file in the engine classpath.

If your custom engine needs some additional attributes you can add them to the configuration file using name value pairs. For example:

<engine id="rwURLEngSample" ... >
<property name="..." value="..."/>
<property name="..." value="..."/>
</engine>

Note: The Reports Server picks up these attributes and passes them to the engine in a Properties object (name:value pairs).

Now we have registered the sample URL engine with the Reports Server. The next step is to add a new element called jobType to the Server configuration file.

Add the following element to the Reports Server configuration file:

<job jobType="rwurlsample" engineId="rwURLEngSample"/>

This element associates the command line parameter jobType=rwurlsample with the Engine ID rwURLEngSample. This will make sure that whenever a request (job) is submitted to the Reports Server with the parameter jobType=rwurlsample, the job is sent to the sample URL engine for processing, and not to the default engine or to the in-built URL Engine.

 3.4. Using your new Engine

Now your sample URL Engine is deployed and registered with your Reports Server. You can submit requests to this engine using the following command line:

http://<machine>:<port>/reports/rwservlet?server=<serverName>+jobtype=rwurlsample+urlparameter='http://www.oracle.com'+
destype=file+desformat=htmlcss+desname=D:\temp\test.html

 

previous next


Copyright © 2002, Oracle Corporation. All rights reserved.