iModernize - The Profound Logic Software Blog

Using All-in-One Display Files, Part Two: Putting the Feature to Work

Posted by Alex Roytman on Jan 15, 2015 7:33:03 AM

Using Profound UI All-in-One Display Files Read part one of this series here.

Many organizations choose to keep green-screen interfaces for a significant period of time after modernizing to a Rich user interface. A common challenge for these companies is the need to maintain separate files and programs as the capabilities of the two types of interfaces diverge.

Profound UI's All-in-one Display Files provide the ability to package green-screen and Rich interfaces in the same set of display files and RPG programs. While the new Rich UI is no longer connected to or limited by the green-screen, the metadata for it can be stored in the same display file as the green-screen. Furthermore, the same RPG program can be used to drive the separate interfaces, even after the RPG Open Access Handler is added.

You can read all about the All-in-One Display Files feature on our product documentation wiki. But here are the highlights to get you started:

Converting a green-screen into an All-in-one Display File
When using the DDS conversion in the Visual Designer, make sure to select the 'Retain Green Screens' option in the conversion dialog. This will automatically create an All-in-one Display File.

When you save the converted display file, both the original DDS and the new Rich interface (added via DDS HTML keywords) will be kept in the source member.

Storing All-in-One Display Files
Profound UI knows that it is working with an All-in-display File because it is marked with a pseudo file level keywords called ALLINONE. To check if the ALLINONE keyword is present, select File Keywords in the Visual Designer.

Since ALLINONE is not a real DDS keyword, it is written to the source member as a special comment.

When you are ready to retire your green-screens, you can permanently remove the DDS that describes the green-screen in a Rich Display File by simply removing the ALLINONE keyword from the File Keywords Dialog and saving the display file in the Profound UI Visual Designer.

When a conversion to an All-in-one Display File occurs, all original DDS is retained, while new Rich UI information is added as JSON (JavaScript Object Notation) via the HTML keyword. While the information is stored within the same display file, the two definitions (green-screen and Rich UI) are treated separately. Therefore, the Rich user interface is not “sitting on top” of the green-screen and is not limited by 5250. The Rich UI portion can have additional information, more functionality, more rows and columns in subfile listings, drag and drop features, and other capabilities that the green-screen will not have.

However, the definition for fields that are shared between the two interfaces must match. The JSON for those field definitions must be equivalent to the DDS definition. Otherwise, you will receive an error message while trying to save the file in the Visual Designer.

Modifying the RPG
In the RPG source, only the HANDLER keywords must be added to the F spec of the Display File declaration. See Open Access.

FMYDSPFILE CF E WORKSTN HANDLER('PROFOUNDUI(HANDLER)')

No other directives are necessary to enable All-in-one Display Files. Similarly, a separate copy of the RPG source and/or program object does NOT have to be created. Everything is retained in one display file and one program. Future changes and additions to the RPG code will affect both interfaces.

Running the Application
Profound UI will automatically detect the mode it is running in and either call system APIs for displaying green-screens or use its internal functionality for displaying browser interfaces.

The green-screen version is called from a regular 5250 session using any standard desktop 5250 emulator, while the Rich UI browser version can be called by either launching an anonymous session, a Profound UI Rich Display File session, or a Genie session. See Launching Programs for more details.

Maintaining and Enhancing All-in-one Display Files
The Rich UI portion of an All-in-one Display File must be maintained within the Profound UI Visual Designer. The Visual Designer will maintain the green-screen portion of the display file intact. Developers can add new elements and fields or remove elements and fields from the interface as needed. However, if a field’s data type or length must be modified and this field also exists on the green-screen interface, this change should first be made in the green-screen DDS code.

The green-screen portion of an All-in-one Display File can be maintained using RDi’s Screen Designer or SDA. However, RDi is the recommended tool, since SDA is no longer enhanced by IBM. Both RDi and SDA will maintain the Rich UI portion of the display, stored as JSON within HTML keywords, intact as you modify the green-screen interface.

However, developers should be aware of a known SDA bug. SDA does not properly encode single quotes within HTML keywords when saving display files. If your Rich UI screens contain constants with single quotes in them, each single quote must be encoded as 2 single quotes within the HTML keyword. SDA does not do this and this may cause your display file not to compile. If you run into this issue, one solution to this is to reopen the display file in the Profound UI Visual Designer and then save it again. This re-encodes the single quotes within the JSON and fixes the problem.

Topics: RPG Development, New Features

Subscribe to Blog Updates

....and get The 2017 State of IBM i Modernization White Paper FREE!

cover page.png

Recent Posts