BLOG CATEGORIES



RPE Command Line API

RPE command Line API allows users to start RPE Launcher and load a document specification which is provided as a parameter, to create a new document specification using a definition file, to generate documents or to start the publish wizard in order to configure a document specification to be published.

You can configure RPE with two types of parameters. There are parameters specifically to RPE and also parameters which can be used to configure any Eclipse based application.

RPE Launcher valid switches:

  • docspec

Loads the document specification which is specified. This parameter should be provided with a dsx file path.

  • wizard

Minimizes the launcher and starts the Publish wizard in the foreground. Optionally this argument can be followed by the path to a definition file, which pre-configures the data source in the template that is selected in the wizard. RPE will close when generation process is finished successfully. If errors occurs during the generation process RPE will stay open and display the errors in the console.

  • noresult

Causes the Results dialog to not be shown. This is useful if you have a batch file in which you have more than one publish commands. So the publishing process will not be hold in by the dialog after each document generation.

  • publish

Publishes document specification.

  • makedocspec

Creates a new document specification from a definition file. The definition file has three sections:

<docspec> which specifies the location of where the document specification will be saved

<datasources> which specifies the properties that will be configures for a specific data source

<template> for the path to a template that will be added in dsx file.

RPE will close after the document specification is created, but if during this process an error occurs, RPE will stay open and users can read the errors that occurred.

  • err

Verifies if document specification is completely configured before starting the generation process and the user will be prompted if not all data sources are configured. This parameter should be specified along with publish argument.

The commands are handled before creating the workbench and also after the workbench is created and RPE is started.

Before workbench is created RPE checks for makedocspec command. If makedocspec argument was found with the path to a definition file a new document specification will be created and RPE Launcher will close – no workbench will be created.

After creating the workbench RPE will handle the rest of arguments. So, in case if the user provided a docspec command with a path to a document specification RPE Launcher will load the document specification and it will start. Or if publish was found RPE will start the publishing process. In this case, if error argument was provided and the data sources from document specification are not completely configured the user will be prompted. So he can choose to reconfigure the document or he can start the publishing process even if not all data sources are configured. After RPE finishes the document generation, the results dialog will not be displayed if noresult argument was provided.

If wizard argument was found, the RPE Launcher will be minimized and the Publish wizard will start in the foreground. Also, if a path to a valid definition file was provided RPE will pre-configure the selected data sources.

Also some Eclipse Platform parameters can be used. The Eclipse platform is highly configurable. These are some commands used in RPE configuration. RPE parameters can be edited in rpe-launcher.ini configuration file from RPE Launcher installation folder:

  • nosplash

This option causes the splash screen to not be shown when RPE starts.

  • vm

Using this option you can specify the path to visual machine. RPE support both Java 1.5 and Java 1.6.

  • Dfile.encoding

Character encoding for console output. Default for RPE is UTF-8 in order to support East Asian languages.

  • vmargs

The arguments passed to the VM.

This is used if you want to run the application with a larger memory area

Some JVMs put restrictions on the total amount of memory available on the heap. If you are getting OutOfMemoryErrors while running, the VM can be told to let the heap grow to a larger amount by passing this command to the application launcher. The arguments are directly passed to the VM.

Xms – set initial Java heap size

Xmx – set maximum Java heap size

  • nl

The name of the locale on which RPE will run. At the time when this article was written, RPE supported 11 languages: German, French, Japanese, Chinese, Chinese (Taiwan), Portuguese, Polish, Korean, Czech, Spanish, Italian.

The internationalization is available only for RPE Launcher.

  • dir

The workbench direction (RTL, LTR). Forces left-to-right or right-to-left rendering direction of the UI for all languages. By default, the direction is determined by the platform locale.

For RTL direction, RPE supports bi-directional text (text containing text in both directionalities, both right-to-left and left-to-right). This feature is used where the string which is displayed (read-only text) has a series of segments where the ordering of the segments is the same no matter what language you are displaying. The most common examples are file associations, file paths, URLS and URIs. Also, RPE users can choose the writing direction. Both RPE Launcher and RPE Document Studio have a preference page where the writing direction in dialogs can be set. This can be made using F2 key in dialog at design time – not working on Linux platform (it is a limitation of Eclipse platform design for Linux).

When a GUI is translated to a language with a right-to-left script (such as Hebrew or Arabic), the entire geometry of the GUI must be mirrored to match the expectation of the users of these languages who read from right to left. This includes mirroring of all the widgets that constitute the GUI window. Not all icons are overridden in a right to left language, only those icons that imply a textual direction with a horizontal arrow.

 

These are some examples to run RPE from Command Line:

  • Publish a local document specification with –noresult parameter:

"C:\Program Files\IBM\Rational\Publishing Engine\1.1.1.2\launcher\rpe-launcher.exe" -publish "D:\RPE\docspec.dsx" -noresult

  • Create a new document specification with “doors_data.dta” template configured using the configuration file:

"C:\Program Files\IBM\Rational\Publishing Engine\1.1.1.2\launcher\rpe-launcher.exe" -makedocspec D:\RPE\def_file.xml

And the definition file is:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<definition xmlns="http://www.ibm.com/rational/rpe/definitionFile" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.ibm.com/rational/rpe/definitionFile definitionFile.xsd">

<docspec>C:\temp\generatedds.dsx</docspec>

<datasource id="DS1">

<property name="URI">/demo/car/System requirements</property>

<property name="baseline">Current</property>

<property name="view">Industrial</property>

</datasource>

<template>C:\Program Files\IBM\Rational\Publishing Engine\1.1.1.2\source\DOORS\examples\doorsData.dta</template>

</definition>

8 Comments to “RPE Command Line API”

  1. Heather L says:

    Is it possible to define more than one datasource in the defintition file so that a document will get generated for each datasource using the specified template?

    • Dan says:

      Hi Heather,

      Sorry for the delay but are very busy this month with the preparation for Innovate Conference 2011.
      Regarding your question: The answer is “NO”. There is no way in this moment to have multiple document generations for each data source from your definition file. It’s possible to have multiple multiple data source configurations in your file, if inside your template you are using more than a data source. I think it will be possible to create a script to generate documents for each DS configuration. We can provide you such a solution if you are interested. Please contact me for more details, or we can discuss at Innovate. We are in both 320. Don’t hesitate to visit us.

  2. navaneethms says:

    Hello,
    I am trying to run the RPE from command line. But data source type is REST. How the configuration for this source type need to be set(settings in definition file)?

    Thanks
    Navaneeth MS

    • Dan says:

      Hi,

      For a REST data source the definition file will be like this:

      <?xml version="1.0" encoding="UTF-8" standalone="yes"?>

      <definition xmlns="http://www.ibm.com/rational/rpe/definitionFile" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.ibm.com/rational/rpe/definitionFile definitionFile.xsd">
      <docspec>C:\docSpecs\REST-Doc-Spec.dsx</docspec>
      <datasource id="REST-DS1">
      <property name="URI">http://serverName:8181/DataServices/RequisitePro/Learning Project</property>
      <property name="username">${username}</property>
      <property name="password">XXXXX>/property>
      </datasource>
      <template>C:\templates\REST\examples\restTemplate.dta</template>
      </definition>

  3. Gordon Woods says:

    It is easy to define the data source properties, but how do you define the word output file name and location when building the definition file?
    No one seems to know…
    my guess is something like

    “filepath/name”

    Thanks for your help

    Gordon

    • BlancaL says:

      The output Word document is defined at the RPE launcher.
      In the .dsx file will be executed, at the Document Specification window go to:
      >Runtime > Output > Word
      Go to the Properties window: >Path
      Insert the complete path of the Word document (
      It does not matter it the document already exists or not. If it does not exist, a new document will be created. If the document already exists, the document will be overwritten.

      I hope this will help you.
      Blanca

      Blanca

    • Blanca says:

      The output Word document is defined at the RPE Launcher.

      On the “.dsx” file go to the Document Specification window.
      Go to: Runtime> Output> Word
      At the Properties window go to Path
      Insert the complete path of the document.

      If the document does not exist, a new document will be created at that location.
      If the document already exists, the document will overwritten.

      I hope this will help you.
      Blanca

  4. Sunil says:

    Can you please help how to parse OSLC Configuration context and the DataSource URI in a definition file.

Leave a Reply

(required)

(required)