Blogs about Jazz

Blogs > Jazz Team Blog >

Generating Word document from Rational Publishing Engine with attachments embedded as objects

Inserting a file as an object into the Word output document offers several advantages over hyperlinks. First, users can transfer output documents with embedded objects (compound Word document) to other computers or mail them without breaking any links. Second, users can edit embedded objects without changing the content of the original. Sometimes, this separation is precisely what is required. These embedded objects can be edited using the applications which created the source files.

Here is an example that shows how to embed attachments from point products (ex. Rational Quality Manager) as objects in Rational Publishing Engine (RPE) output document. The attachment files could be of any format such as Word, Excel, PowerPoint, PDF, image, etc. These files are downloaded during document generation and the local file path is used as the hyperlink address. We will use a post processing macro that iterates the hyperlinks and insert the corresponding files as OLE objects.

Template Design (Sample):

template

Steps:

  1. Configure document specification
  2. Copy RQMUrlUtility.jar (https://jazz.net/wiki/bin/view/Main/RQMURLUtility) to the location set in attachmentsPath variable.
    • Set variable attachmentsPath to location where the files to be downloaded. By default, it is C:\Attachments
    • Set RQM Username and Password to qmUser and qmPassWord variables respectively.
  3. Generate document.

 Word output (Sample):

WordOutput

The accompanying Rational Publishing Engine template, document specification, stylesheet along with RQMURLUtility can be downloaded from here.

Note: The execution of commands is disabled by default in RPE 1.3 and later versions. You can enable command execution by setting the com.ibm.rational.rpe.enable_commands property to true in %rpe_home%\studio\rpe-studio.ini and %rpe_home%\launcher\rpe-launcher.ini.