Green-Screen to Web Conversion Wizard


Overview


This wizard converts an iSeries (AS/400) Green-Screen program to a Web application in minutes. The wizard will convert a DDS display file to HTML. Then, it will import the related ILE RPG code and modify it for use with the new HTML to produce a fully functional and customizable web application. RPGsp's Dream Architecture will simulate the traditional Green-Screen environment for your converted application.
If you are converting a complex application that calls other display programs, be sure to convert these programs first.

From this

To this

The wizard is capable of converting virtually 100% of green-screen programs to web applications instantly, and it can also serve as a great learning tool for going from traditional RPG development to RPG-based web development.

Retrieving Source and Field Definitions

The first step in the Green Screen to Web Conversion Wizard is to retrieve the DDS source and display file field definitions. To do this, you must first specify the display file source member and the display file object, and then click on the blue button labeled "Retrieve Source and Field Definitions".

Source File Name/Library

Type in the File Name and Library Name of the file that contains the DDS source member. The default file name is QDDSSRC. *LIBL is not acceptable for library name in this wizard.

DDS Source Member

Type in the source member name for the display file. You can also click on the button next to the DDS member field to browse for the member. This will most likely be the same as the Display File name.

Display File Object / Library

Type in the Object Name and Library Name of the Display File Object. By default, the display file object will be filled in with the same name as the DDS source member, and the library name will be the same as the source file library name. *LIBL is not acceptable for library name in this wizard.

Use Free Format RPG

When this box is checked, all wizard generated code will use free-format RPG. If you would like the wizard to generate fixed-format C specs, leave this box unchecked.


Finishing the Wizard

If the DDS source and field definition retrieval is successful, the Convert button will become enabled. You must specify an RPGLE source member that relates to the display file before clicking the Convert button. Alternatively, you can specify Convert Selected Formats, which would allow you to convert one or more display file formats at a time.

Display File Formats

If Convert Selected Formats is selected, the Conversion Wizard will show you the available Display File Formats (or screens) that you can choose from. Click on the desired format to highlight it. You can select more than one format.

Overlay Checkbox

By default, if Convert Selected Formats is enabled, a separate RPGsp page is created for every file format you select. This is because web applications are generally developed one page at a time. The overlay option allows you to superimpose multiple formats onto one page. One common use for this option is for overlaying a subfile and a subfile control record format. The overlay option will not place one file format after another; it will place a file format over another.

Layout Type

Layout determines how the fields and constants are organized (or positioned) on a page.

Table layout uses an HTML Table along with its rows and cells to position elements on a page, while Absolute layout uses pixel-based coordinates to position elements on a page.

Absolute elements are removed from the normal HTML flow and positioned using style sheet attributes. The position of an absolute element is specified in pixels from the top and left sides of the document.

In contrast to standard elements, absolute elements can be placed anywhere on the page by simply dragging and dropping them with your mouse. Normal elements, on the other hand, must follow the rules of top-to-bottom html flow, and therefore use HTML tables for positioning.

While Absolute layout makes it easier to position elements in Design View, the HTML code tends to be more organized with a Table layout, which is important when it comes to coding the RPG logic around the HTML. Subfiles typically use Table layout.

Use Dream Architecture

When this box is checked, the Green Screen to Web conversion wizard will use RPGsp's Dream Architecture to convert your application. The Dream Architecture simulates a traditional iSeries (AS/400) development environment, including the program call stack, display files with multiple record formats, inherent record-locking, subfiles with updatable fields, and program parameters. The Dream Architecture hides the stateless nature of Web applications, and provides a familiar top-down programming approach.

Inactivity Timeout

In this field, you can specify the time (in minutes), before your converted program will end due to user inactivity.

After the Conversion

If your converted display file has more than one format, the HTML designer will render them one at a time. Click on the tabs at the top of the design window to select and work with any of your screens.

After converting all formats and importing the RPG using Dream Architecture

This option automatically combines all display file formats into a single RPGsp page. Each display file format will be displayed in the designer separately. You can use the tabs at the top of the design window to switch between display formats. Each format is placed into a separate callable subroutine. Then, the wizard adds the original RPG code into the new RPGsp page. The wizard replaces each ExFmt (Execute Format) call with an ExSr (Execute Subroutine) to the appropriate subroutine. RPGsp's Dream Architecture emulates the statefull nature of green-screen applications.

With the Dream Architecture, virtually 100% of green-screen programs can be converted with minimal manual intervention by the developer. The wizard handles writing and reading subfiles, overlayed screens, call stacks, inherent record locking, free-format code, push-buttons, program calls, and much more.

If you are converting a complex application that calls other display programs, be sure to first convert the called programs. The Dream Architecture will allow your calling program to use the traditional Call interface, including program parameters.

After converting all formats and importing the RPG without using Dream Architecture

This option automatically combines all display file formats into a single RPGsp page. Each format is placed into a separate callable subroutine. Then, the wizard adds the original RPG code to the new RPGsp page. The wizard replaces each ExFmt (Execute Format) call with an ExSr (Execute Subroutine) to the appropriate subroutine. Afterwards, the code is adjusted for stateless programming.

If your green-screen application uses a lot of screens within one display file (more than 4 or 5 screens), it is best to convert each screen at a time, and add the RPG code manually. This will make it much easier to maintain the application in the future. Web applications are generally coded one screen at a time vs. one program that deals with all the screens.

After converting display file formats only

While this option converts all DDS specifications, including indicators, function keys, and fields, the RPG code related to the Display File is not brought over automatically.

You should be able to reuse much of the existing RPG code as is, by importing or reusing it within your new RPGsp application. You must, however, keep in mind the stateless nature of web applications. Instead of using something like an ExFmt operation to display a screen, an RPGsp page will automatically display itself once it is called from a browser.

The Green Screen to Web Conversion Wizard creates some RPG code for you that serves as a shell for importing your existing RPG logic or writing RPG logic from scratch. If your existing code is well organized with subroutines, subprocedures, modules, or service programs, then it should be easier to adopt the code to your new web application.

It is possible to mimic the ExFmt functionality by packaging each screen into a subroutine or subprocedure. This would even allow you to put many screens on one page, by copying them one after another. A call to the subroutine or subprocedure would then be equivalent to an ExFmt. However, you must still consider the stateless nature of web development -- an RPGsp web program must end before allowing any user input.


Profound Logic Software, Inc.
www.ProfoundLogic.com
(937) 439-7925