Blogs about Jazz

Blogs > Jazz Team Blog >

JavaScript improvements with Rational Publishing Engine 2.1.1

JavaScript is one of the key components while building a Rational Publishing Engine (RPE) template. The plain JavaScript dialog editor has been improved with:

  • Content Assist: Ctrl + space lists available variables, helps with syntax of various JavaScript functions, parameters to be passed to a function. Tip: If the variable is a data attribute from a query, store it in a JavaScript variable to take advantage of content assist.
  • Syntax coloring: For any programming language, syntax coloring is a must.
  • Line marking: The line containing the cursor has a line marking.

JavaScript dialog

Include JavaScript files from RPE Document Builder during template design

Create and include reusable JavaScript files (with functions) in RPE Document Builder. These functions can be used and reused across the organization or deployment while designing the RPE template, instead of each of the template designers writing their own set of JavaScript functions.

JS-assetExamples of reusable JavaScript functions:

  • Convert a date from one format to another format
  • Convert the machine identifiers to human understandable values, like “ common.underreview” to “Under review”, etc.
  • Any organization-specific functions

Tip: Use JavaScript elements to include or write reusable functions and mark it as library script so that these functions are visible within any palette elements within the template.

Include JavaScript asset as actual content

Include the JavaScript asset as a physical embedded function within the template. Once the contents of the JavaScript files is embedded, there is no link between the JavaScript functions within the template to the one in RPE Document builder. The changes made to the template functions will not be reflected to JavaScript asset in the Document Builder.

Include JavaScript asset as dynamic link

When a JavaScript asset is included as a dynamic link and document generation is triggered, the latest copy from the Document Builder JavaScript file is used. Suppose you have included the same JavaScript asset in five different templates that use a few functions. Later, if you need to modify the function to fix an issue, you can modify the function in the Document Builder. This prevents you from having to make changes to five different templates by having a centralized, reusable function as a JavaScript asset within the RPE Document Builder.

JS include script

For RPE Studio / Launcher to integrate with RPE Document Builder, configure through Windows -> Preferences -> RPE -> Engine Preferences.

Check out the video on JavaScript improvements in RPE 2.1.1 for a template designer.

For more RPE 2.1.1 videos, visit the Rational Publishing Engine 2.1.1 YouTube playlist.