ProGen WebSmart

Product Review – WebSmart www.progenwebsmart.com

400times Hot Product
Version Tested 1.20
Earliest OS/400 Release V4R2
400times Score 9.5/10
Need an AS/400 web site in a hurry?

ProGen WebSmart is the latest web application tool to land on the 400times test system. This new tool allows you to build dynamic web pages that hook up to your AS/400 database with all the ease of writing a query. Unlike Websphere which requires you to use a new skill set, and FreeStyle which allows you to use pure RPG, WebSmart combines both the design editor and an RPG generator into one bundle to provide quick and easy web sites.

The visual design stage allows you to specify tables and fields to use on your pages, while the generated language unique to WebSmart allows you to add much of the refinements we have come to expect from DDS definitions along with some extra functionality to help you build an impressive site.

Knowledge of HTML or any other web based language is not mandatory, although as we look at what is provided it is useful to know how to edit code directly to get the desired results.
Get Web Smart

WebSmart provides you with a set of templates with which to build your site from. The templates are held in ASCII text formats which are easy to read and understand, and therefore easy to create and edit. Changes can be made to templates using any text editor program, for example, Microsoft Windows Notepad and Wordpad utilities. If you wanted to create a template family with your own look and feel, you can easily copy the existing templates into a new working directory on the PC or Server to use with your site.

Some of the templates provide considerable amounts of HTML and Java Script which adds complexity when starting out and it is advised that you use the more simple templates at first. If and when you want to add additional complexity/functionality, code can be copied into your template from an existing one as easy as “cut and paste”.

After selecting your template, you need to give the new program some AS/400 definition. The generated program will need an AS/400 name and location to which the new object will be compiled to, as well as a short description which, as well as being used in the object description can also be used as web page title. Additional details can be entered for where generated source is to be retained. At first, my assumption was that the source location would be necessary to secure source for change management purposes, but the generated source is a bi-product of the generation only, the description to create an object is held in the PC file and generated from within WebSmart itself. Therefore as long as the PC files are secured, objects could be regenerated without the traditional source code.

The “library list object” is used in the compilation of the object and is a component of WebSmart that is stored on the AS/400. It consists of a data area in the WebSmart Application Server library that contains a list of one or more libraries on the system. It is used to establish the library list at the time a referencing ProGen WebSmart program is run. This approach ensures that files used by the program can be resolved and successfully opened. It also allows you to change your run-time environment simply by changing the libraries in the library list object, which is extremely useful for testing.

Next you are required to enter the name of the file you wish to use within your web page. For the purpose of this demo I created three physical files (VENDORS, CONTACTS, and PRODUCTS) and placed them in the demo library, to emulate a real scenario.

As each additional file is added, a relational link between the files is established by a simple drag and drop action, dragging the matching field from the available list on the right to the link field column on the left.

Once links are established it is then a case of specifying which fields are to be used within the web page. It is also relevant to mention that the file descriptions of the database files are held in a repository. Once the definition is added into the repository, lightning fast retrieval is made possible. Of course, a repository can be re-synched with the AS/400 definition should a record format have changed, or should the repository become quite old.
PML – An Overview

WebSmart includes an area (the PML Editor) in the IDE that lets you write free-hand code in a language that they have called PML (ProGen Macro Language). PML controls the entire flow of your program, and gives you great flexibility and virtually unlimited license to change the way your program works. Each program you create will contain some initial PML that comes from a template. You can then modify the code using the PML Editor. Templates form the building blocks for programs in ProGen WebSmart. Each template has PML embedded in it, with tokens, or placeholders, for information that is provided by the designer when they start to design a new program. As you go through the initial design process, the IDE uses intelligent Wizards to prompt you for the relevant information to construct a complete program. The information that is asked for is based on the template’s contents. The PML language, in conjunction with other components in the template, defines how the generated program will behave. When you select a particular template, it includes a set of predefined behaviors. However, once you have completed the initial steps provided by the Wizards, you can change the functionality of the program in any way shape or form, by changing the PML code. You can also create new templates, which incorporate the behaviors and the look and the feel of the pages and programs you wish to create for your site.

For the first part of this demo, I selected four fields from the vendors file and progressed onto the next stage. This is where the HTML is generated, based on rules supplied via the PML. Although PML is a new language to this RPG programmer, it is readable enough to make sense of what is about to happen.

At this point it is worth looking at some of the features in these two editors. In the top view you will see that I have a selection of fields available for use in the design, and in the second image I have changed to show some of the collection of functions that are available. In the bottom left corner of the HTML view are a collection of snippets and scripts that can be added to the page by a simple drag and drop action. And in the PML view a navigation tree of the functions that will be executed is shown.

The PML code is automatically color coded as it is added, and periodically refreshed when you toggle back and forth between different views. Below is a list of the colors associated with the different components of you PML code.

Red Punctuation marks, such as (),;{}. Also operands such as +/-=.

Blue Function names, structures and conditionals. For example: func, if, while, and.

Olive Constant values, marked by being within double quotes. For example “Order Number” and “57CHEVY”.

Green Comments. Comment lines must start with //, and can be on their own, or appended to other statements.

Black Everything else. This includes function and field names, and other function parms.

In addition to the automatic color coding, when you press Enter after adding a new line of PML, the editor also indents new lines of PML code to the right level, based on your current nesting level within structures.

From within the PML editor, almost everything has field context F1 help support, helping you to grasp anything that is not fully understood. The help is amazingly detailed, providing descriptions, parms, use considerations and examples.

PML also has its own built in syntax checker that will pre-validate your code before you submit for compile. In most cases, problems are detected by the syntax-checker before a compile is attempted, but what if it doesn’t? No problem, because the resulting object is just an RPGIV program; you would follow basic error correction principles – find the listing and the error and review the source.

Should any errors be detected by the syntax checker, clicking on the error will take you to the offending line in the PML editor. Detected errors are should in a separate window below the PML editor.
Moving On

After these simple tasks WebSmart now contains enough information about the program to be compiled and run. Although a raw examples it is a good indication of the effortless way in which sites can be developed. Without tidying up the presentation in anyway, the following was produced.

From this humble beginning I went on to add more fields and activate the Home Page column as real hypertext links, and map the values in the company logo column to objects held in the IFS in less than 40 minutes. The result is a little too large to show, but believe me it was impressive and knocks spots off our own 400times site design!
Smarten Up The Image

One feature I found extremely useful when looking to provide a more friendly image was the ability to apply edit codes directly to the HTML. Right click a numeric value in the HTML editor and you are presented with an option to enter an edit code, as prescribed by Doctor DDS himself!

The resulting entry in the HTML is described as which makes life very easy and so much more readable.

In smartening up both the image and the functionality, the following is an example of the generated HTML view.

More Features

The creation of this simple page was both fun and easy, but also very simple. There are many features available in WebSmart that cannot be described in detail on these pages, however everything appears to be covered.

My main concerns were:

Change management, which was addressed by the fact that the PC object holds the key to AS/400 object generation and could therefore be incorporated into a PC change management solution.

Security. This is provided by the HTTP server config, validation lists, or SSL. These are not specifically WebSmart features, but WebSmart does provide PML functions to support creating and managing validation lists. Combining the native AS/400 security features with WebSmart’s provides you with a complete security implementation.

Adding your own programs.

Adding your own programs was a big concern. Whilst there are enough built in functions included that most cater for most needs there are always the exceptions that need to be dealt with. This can be achieved by coding for additional scenarios by wrapping your RPGIV code within a format recognisable by PML.

Moreover, the ability to call non CGI programs or Server Side Functions can solve most problems without the need to build functions and also retain some of your legacy logic. Functions currently supported are:

call used to call a server-side program

callb used to call a server-side ILE bound module

openfile used to open a file or all files

sendmail used to send email

setlibl used to set job’s library list

For example, the call function allows the passing of parameters just like any other call. There are many existing routines, for example calculating available credit or on-hand inventory, that could, in most cases be hooked into your existing suite of application logic.
Summary

WebSmart is a sophisticated tool to help you deploy your applications on the web, and because of its clean and rather elegant templates will not require an in depth understanding of HTML or Java Script to get there easily and quickly. If your total requirements can be executed using the provided functionality, deployment should be a breeze. If, however, you want something more, extending the PML is an option waiting to be tailored to your requirements. I would imagine that in most cases the base system would be more than sufficient.

The many built in functions and scripts available are astounding, and some really cool additions to your web site design can be made very, very easily.

The documentation for this product was excellent, but coming in at over 600 pages it is impossible to describe all the functions in detail within these pages. The PC client software is also remarkable – no hangs, no freezes and very easy to configure. There are a few instances where in creating the test page I became a little unsure as to how to add to my page through the client options – but with more practice I am sure this would be overcome. And although I was unsure, I did not hit a dead end, instead I just edited the HTML manually to get my desired result.

As for performance – programming performance was excellent, even in my short experiment, by allowing me to create something so impressive in a short period of time. I did create three pages in total, the last one coming in at about 20 minutes including RPG compilation. System performance was as I would expect to serve a page of data via a CGI program – no faster, no slower, just right!

My advice is simple – take a look for yourselves!

Free demo copies are available from : www.progenwebsmart.com

400times Home Page
© Copyright 400times.co.uk MM.
For problems or questions regarding this web contact [email protected]
AS/400™ is a registered trademark of IBM Corporation

Posted on