Command-line switches for the API example

You can run the example as an application from a command-line utility.

Open a command-line utility and run commands in this format:
java –jar SampleDocgen.jar <docspecpath> [-home file_path] [-workArea file_path] [-remoteURL URL] [-remoteUser user] [-remotePassword password] [-Duser.language=language_code] [-Duser.country=country_code]
Table 1. Command-line options for the API
Command-line options Description
-home A full path to the parent directory of the config folder.
  • Optional if IBM Engineering Lifecycle Optimization - Publishing is installed.
  • Required if Engineering Publishing is not installed.
-workArea A full path to where PUB creates temporary files. If no value is specified, PUB uses the temp folder. Optional.
-remoteURL A URL to the document generation node (dgaas). If no value is specified, the document-style report is generated locally.
-remoteUser A username for authenticating with the document-style report generation service. Optional.
-remotePassword A password for authenticating with the document-style report generation service. Optional.

For more information about how usernames and passwords are stored, see Security considerations for PUB.

-Duser.country A country code that corresponds to your language setting. Optional.

A common Java™ Runtime Environment switch that is not unique to PUB.

-Duser.language A language code. Optional.

A common Java Runtime Environment switch that is not unique to PUB.

Local document-style report generation:
java –jar SampleDocgen.jar d:\test\rpe\sample.dsx -home d:\test\rpe\home -workArea d:\tmp -Duser.language=pt -Duser.country=BR
Secure remote generation by using dgaas service:
java –jar SampleDocgen.jar d:\tmp\testRemote.dsx -type DOCSPEC -remoteURL https://server:8080/dgaas -remoteUser rpe_user -remotePassword password -Duser.language=pt -Duser.country=BR
Secure remote generation by using dgaas:
java –jar SampleDocgen.jar  {report_json} -type REPORT_JSON -remoteURL https://server:8080/dgaas -remoteUser rpe_user -remotePassword password -rpengURL https://server:8080/rpeng
-Duser.language=pt -Duser.country=BR

Results

  • 0: The document-style report generation completed successfully.
  • 1: The document-style report generation could not be executed.