Using the Universal Display File Editor

Editor Components

The Universal Display File editor is accessed by navigating a web browser to the following URL: 

http://IBMi:port/profoundui/universal

The port number 8080 is the default for Profound UI, but this can be customized at time of installation. You'll be prompted to sign on, if you have not already signed into the Profound UI HTTP server with your browser. You should use your normal IBM i profile that you use for programming tasks. 

The following illustration shows the different components of the Universal Display File Editor:

Editor Library List

If you will be defining Universal Display File fields by referencing from another file (as in REF/REFFLD in traditional DDS), the Editor will need to locate the referenced files when the Universal Display Files are created. The library list used for this is configured using the Library List button on the toolbar. 

The library list is unique to the user profile that is signed into the Editor. The library list for the user profile is stored in a database on the IBM i, so will be retained for any future Editor sessions.

Adding Static Content in the Editor

Static content is entered by typing into the content editor, or by using CTRL+V to paste content from the clipboard. The content can also be populated by importing from a text file on the IBM i IFS, or on the local PC.

The editor is aware of HTML, XML, and JavaScript/JSON syntax, and will offer suggestions to correct any errors found in the document. The document type is set using the record format’s “document type” property.

Adding Dynamic Content Using Fields

Dynamic content is added by using the Insert Field button in the toolbar.

The new field will be placed into the document at the current cursor position.

The field that is inserted is a 10-character value, with a generic name. Double-clicking on the field will display the Field Binding dialog which can be used to set the field’s data type, length, and formatting options. Fields can be removed by pressing the Delete key on the keyboard while the cursor is in the field.

Using the Binding Dialog

The binding dialog allows you to set the data type, length, and formatting options for fields. The binding dialog can be accessed by either double-clicking on the field, or by clicking on the field to select it, then clicking on the field binding button on the field’s “bound field” property in the Properties Window.

The following data types are supported:

  • Character
  • Decimal (zoned)
  • Indicator
  • Indicator Expression
  • Date
  • Time
  • Timestamp
  • Graphic (Unicode)

Date and Time fields will always use *ISO internal representation. However, other representations are supported if Date and Time fields are referenced from fields with DATFMT/DATSEP or TIMFMT/TIMSEP keywords. The internal representation will only be displayed if the Default formatting is used. All of the Date and Time formatting options will function consistently, regardless of the internal date or time format.

Indicators can be either numbered (true indicators), or named (1 character fields). A numbered indicator is defined by using field names like *IN70, *IN90, etc., or by using the Indicator Expression type. Named indicators (actually 1 character fields) will be considered to be *On when the field contains a ‘1’, and will be considered to be *Off for any other value.

Graphic fields are always defined with CCSID 1200 (UTF-16 BE), unless referenced from a field with a CCSID keyword that specifies a different encoding.

Fields can be referenced from another file by setting the data type to “Use Reference Field”.  Clicking here will display the Reference Field Details dialog.

The parameters on the Reference Field Details dialog are identical to the REFFLD keyword in traditional DDS. The easiest way to use this dialog is to enter the desired file name, then click here to select from a list of fields:

Dividing Content into Record Formats

Record formats can be added, removed, renamed, and re-ordered using the functions in the Record Formats panel.

 

Each record format will have its own static content and dynamic fields. Using multiple record formats is the way to divide a document into separate “header”, “detail”, “footer”, etc., sections. You can switch between record formats by clicking on the record format name in this panel.

Working with Properties

Both record formats and the fields contained within them have various properties which can be set using the Properties Window.  When a field is selected, its properties will be displayed. When no fields are selected, the record format’s properties are displayed.

Properties can be set to static values by typing or selecting a value to the right of the property name. Some properties can also be bound to fields in the record format, which allows the property value to be set dynamically by RPG.

When properties are bound to fields, the data should be populated by RPG exactly as if the value were typed into or selected in the Properties Window.

Record Format Properties

  • Identification
    • record format name: Sets the name of the record format. This can also be set in the Record Formats panel.
    • description: A text description for the record format. This displays next to the record format name in the Record Formats Panel. It has no other purpose.
    • document type: This sets the document type for the purpose of syntax validation in the editor. This is also used as the default content type for HTTP output.
    • Input parameters: Maps HTTP query string or POST parameters to field names for input on a READ operation.
  • HTTP Header (these apply only in Web Connector)
    • content type: Sets the value of the HTTP ‘Content-Type’ header. If not specified, the Content-Type header will be defaulted, based on the document type property.
    • attachment name: When this is specified, a ‘Content-Disposition: attachment’ header. Will be included in the HTTP output. This property sets the attachment file name.
    • no cache:  When set to true, a ‘Cache-Control: no-cache’ header will be included in the HTTP output.
    • custom headers: Specifies custom headers to be included in the HTTP response.
  • Misc
    • separator: A character, or string of characters, to output between subsequent WRITE operations to the record format. For example, this should be set to a comma character (,), if the record format output is a JSON array element. The separator is output before the record content on any WRITE operation other than the first WRITE after opening the display file.
    • destination: Specifies an IFS path to send the output to. The file path is set on the first write to this record format, and cannot be changed without closing and re-opening the display file. If not specified, the output is sent to STDOUT.
    • existing file action: Action to take if destination file already exists when the program starts writing this record format. 'append' will append to existing file content. 'replace' will delete/re-create the file. 'exception' will cause the handler to send an escape message to the program.
    • user defined data: Specifies user-defined general purpose data associated with the record format. To provide multiple user defined data values, right-click the property and select Add Another User Defined Value.

Field Properties

  • Identification
    • bound field name: Sets the field name, data type, length, and formatting options, via the Binding Dialog.
    • description:  A text description for the field, which displays only here. It has no functional purpose.
  • Misc
    • encoding: Sets the encoding type for the field. If not set, this defaults based on the document type property.
    • visibility: Controls whether or not the field data will be output.
    • user defined data:  Specifies user-defined general purpose data associated with the field. To provide multiple user defined data values, right-click the property and select Add Another User Defined Value.