RPE Java API example built for 1.2.1


RPE ships with an example for using its Java API. See Using the Java API  for more information on the RPE Java API and how to use it. Since we ship only the source code for the example before using it you need to build the example using the libraries from the %RPE_HOME%\lib folder. For convenience I’m providing a binary version of this example here.

Download: sampledocgen for 1.2.1

Once downloaded, inflate the archive and rename the included file to .jar.

 Sample usage – RPE installed on the machine

1. copy sampledocgen.jar in the %RPE_HOME%/lib folder

2. create a .bat file with the following content

@echo off

set PATH=%RPE_HOME%\lib;%PATH%   

rem run the document generation. %1 is the argument provided to the batch file
"%RPE_HOME%\jre\bin\java" -jar "%RPE_HOME%\lib\SampleDocgen.jar" %1 -home "%RPE_HOME%"

echo Document generation process returned %ERRORLEVEL%

 3. run the script by providing as argument the full path ( enclosed in “”) for the docspec you want to run.

SampleDocgen.bat d:\test\sampleDocSpec.dsx

 Sample usage – RPE not installed on the machine

1. create an RPE folder and copy in it the config, lib, source and utils folders from an installed RPE. This folder can be on a shared folder

2. copy sampledocgen.jar in the lib folder you just created

3. create a .bat file with the following content

@echo off

@rem example set JRE_PATH=C:\Program Files (x86)\IBM\Java60
set JRE_PATH=<path of a supported JRE>

set RPE_HOME=<path of the folder created at step 1>

set PATH=%RPE_HOME%\lib;%PATH%   

rem run the document generation. %1 is the argument provided to the batch file
"%JRE_PATH%\jre\bin\java" -jar "%RPE_HOME%\lib\SampleDocgen.jar" %1 -home "%RPE_HOME%"

echo Document generation process returned %ERRORLEVEL%

 4. run the script by providing as argument the full path ( enclosed in “”) for the docspec you want to run.

SampleDocgen.bat d:\test\sampleDocSpec.dsx
Advertisements

Author: Dragos Cojocari

Architect for Rational Publishing Engine

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s