Building HTML Application Systems:

Converting Existing MS-Windows Applications to HTML

Author: Robert K. Thralls, Senior Technical Consultant

NOTE: For optimal output, view with a good fill-out FORM client: like Mosaic, MS-WINDOWS Alpha6

Abstract

This paper conveys the idea of converting currently existing applications from Microsoft Windows (or compatable) environment to HTML (fill-out FORMs). Most MS-Windows applications take advantage of resource files. These resource files define the look and feel of the product. Inside these files, one finds definitions of dialog boxes, menus, icons, and the like. These textual descriptions usually compile into object files and attatch to executables for the application to use at run-time. One now uses these files to create HTML fill-out FORMs and backend host programs conformant to Common Gateway Interface (CGI) standards. This paper addresses both the tools used to achieve the port and the short comings of HTML in the area of reproducing look and feel qualities of many MS-Windows applications.

This concept of conversion directly mimicks the system it augments. The Centers for Disease Control (CDC) PC/Wonder product utilizes a generic forms processor and resources which define contents of forms. The generic form processor directly corresponds to the functionality of an HTML client that supports fill-out FORMs (MOSAIC). The resources reflect the contents of the HTML FORM. Through this analogy, one sees the direct implication of conversion from MS-Windows' Dialog Boxes, for example, to an HTML fill-out FORM. Although designed specifically for CDC PC/Wonder, the entire conversion process elegantly lends itself to generic application processing for data requests at remote server sites. Use of the converter with resource files for even simple fill-out forms dramatically increases consistency in user interface look and feel.


TEXT

Table of Contents


Project Overview: CDC PC/Wonder

(Wide-ranging ONline Data for Epidemiology Research)

In the beginning, WONDER existed as a mainframe application. Today, the PC version of the software outmodes archaic 3270 terminal access. However, the Data Sets still exist on the mainframe. Thus, facilitating data directly to the PC environment takes time and patience. The PC client must make requests to the mainframe data sets in batch mode.

CDC PC/Wonder runs on a PC platform. The package allows public health officials world-wide access to CDC information. Primarily a request/response engine, a user fills out request screens and submits them to the appropriate Data Set server. Data Set servers return a response that may be either dynamic information for the next request screen or the final information that completes the users request. Information is displayed in one of three ways. Data returned for the next screen feeds to the next appropriate screen. Data in report format displays as hypertext with tables and figures. Raw data generally funnels to an external spreadsheet called Tables and Graphs (T&G;) for display and manipulation. T&G; also displays maps of the US for data associated with specific regions.

Recently, the identification of users on the Internet spurred a remarkable development. CDC decided to grant Internet access to its data for public health officials. CDC PC/Wonder contains abilities for ASYNC and NOVELL LAN connectivity. Clearly, Internet access complicates the release of a product due to non homogenious makeup of the Internet community. Thus the addition of TCP/IP protocol stacks into CDC PC/Wonder could not support all potential internet users of WONDER.

Introducing MOSAIC/Wonder, the newest interface to WONDER. This MOSAIC interface is directly derived from the CDC PC/Wonder user interface description (Resource Files). MOSAIC/Wonder allows an Internet user to use the application precisely in the same manner as CDC PC/Wonder. The system creates HTML and CGI backend programs on-the-fly for each screen. HTML fill-out FORMs mimick most of the user interface and functionality of the PC version. Resource file converters and integration tools provide the bulk of processing capability in a very generic fashion. These tools lend themselves well to any existing application or any future HTML application designers.

Converting Existing MS-Windows Applications to HTML

MS-Windows applications can be ported to the HTML environment. Limits to conversion exist on the HTML side. Conversion in this context is limited to the Resource files that define look and feel, as well as data on the screen.

Of course, one need not use this conversion utility simply for porting an MS-Windows application. This tool set allows HTML authors to control look and feel issues for their FORMs user interface. Also, the tool set manages user data maintained at the server site. The tool box automates server content management with reguard to the integrated FORMs; although, application data remains in the hands of the system administrator.

WYSIWYG Fill-Out Form Creation

Resource files exists for most MS-Windows applications. Resource files created with WYSIWYG tools such as App Studio, bundled with Visual C/C++, give the creator instant knowledge of look and feel issues for a set of screens. No questions remain as to what a dialog or menu looks like nor how it behaves. WYSIWYG tools speed up the development process. Even non-existent HTML applications can take advantage of WYSIWYG tools. HTML authors need only to point and press with a resource file generator (App Studio) and then use the resource compiler for HTML and backend generator. This section examines these steps more closely.

App Studio and Resource Workshop

One uses Microsoft App Studio or Borland Resource Workshop to create the desired Menu or Dialog. An assumption is made about access to and knowledge of one or more of these products. Readily available, these well documented tools are left for the experienced user to explore. The converter supports resource file output not limited to the following:

Resource Files

Resource (RC) files describe dialog boxes, menus, and other display items. The ease in creating these files depends upon the tool of choice. Some elegant tools are WYSIWYG and allow effective management of the user interface. RC files allow one to maintain the consistency in look and feel that application users appreciate. RC files enforce standards in look and feel and yield the consistency of a professional application from start to finish. These files are converted to HTML and 'C' code (CGI backend process) with the same effect as the resource compiler would attatch a usable run-time object to a MS-Windows application (.exe). The following example demonstrates the flexibility and dynamic nature of the converter.

Often the RC files will #include files for values and strings. The converter interprets most ANSI standard 'C' preprocessor directives. This includes, but not limited to:

In the example, this RC file previously existed in an application written for a multi-platform enviroment. Magma Software Systems "Mule", an MS-Windows Compatable Application Programming Interface (API), is used as the development environment. Note that Magma Systems recommends Borland's "Resource Tool Kit" to build resource files in a WYSIWYG fashion; however, Mule comes with its own resource compiler.

Example RC File
#include "style.h" #include "basic.h" MMWR DIALOG 1, 1, 75, 23 CAPTION "MMWR Search Criteria" STYLE WS_SHADOW BEGIN TEXT "Co~mment:", 11, 4, 3, 20, 1 WS_GROUP EDIT "", 2001, 17, 3, 42, 1 ES_MARGIN TEXT "~Filename:", 11, 4, 4, 12, 1 WS_GROUP EDIT "", 2002, 17, 4, 10, 1 ES_MARGIN TEXT ".REQ/PCW", 11, 27, 4, 20, 1 TEXT "~1:", 11, 4, 6, 2, 1 WS_GROUP EDIT "", 2003, 7, 6, 26, 1 ES_MARGIN TEXT "or", 11, 36, 6, 2, 1 TEXT "~2:", 11, 41, 6, 2, 1 WS_GROUP EDIT "", 2004, 44, 6, 26, 1 ES_MARGIN TEXT "AND", 11, 36, 7, 3, 1 TEXT "~3:", 11, 4, 8, 2, 1 WS_GROUP EDIT "", 2005, 7, 8, 26, 1 ES_MARGIN TEXT "or", 11, 36, 8, 2, 1 TEXT "~4:", 11, 41, 8, 2, 1 WS_GROUP EDIT "", 2006, 44, 8, 26, 1 ES_MARGIN CHECKBOX "Search ~Titles Only", 2007, 26, 9, 22, 1 TEXT "AND", 11, 39, 11, 3, 1 TEXT "Source: Vo~lume", 11, 7, 13, 16, 1 WS_GROUP EDIT "", 2008, 24, 13, 4, 1 ES_MARGIN TEXT "through", 11, 35, 13, 7, 1 TEXT "Vol~ume", 11, 47, 13, 7, 1 WS_GROUP EDIT "", 2009, 55, 13, 4, 1 ES_MARGIN TEXT "(31 - 48)", 11, 64, 13, 9, 1 TEXT "~Issue", 11, 16, 14, 6, 1 WS_GROUP EDIT "", 2010, 24, 14, 7, 1 ES_MARGIN TEXT "Issu~e", 11, 47, 14, 6, 1 WS_GROUP EDIT "", 2011, 55, 14, 7, 1 ES_MARGIN TEXT "~Page", 11, 16, 15, 5, 1 WS_GROUP EDIT "", 2012, 24, 15, 7, 1 ES_MARGIN TEXT "Pa~ge", 11, 47, 15, 5, 1 WS_GROUP EDIT "", 2013, 55, 15, 7, 1 ES_MARGIN TEXT "OR", 11, 7, 16, 2, 1 WS_GROUP RADIOBUTTON "Select ~Date", 2014, 10, 17, 32, 1 WS_GROUP | WS_TABSTOP RADIOBUTTON "This ~Week's Issue", 2015, 40, 17, 37, 1 TEXT "Fr~om:", 12, 10, 19, 6, 1 WS_GROUP EDIT "", 2016, 16, 19, 4, 1 ES_MARGIN TEXT "/", 13, 20, 19, 1, 1 WS_GROUP EDIT "", 2017, 21, 19, 4, 1 ES_MARGIN TEXT "/", 14, 25, 19, 1, 1 EDIT "", 2018, 26, 19, 4, 1 ES_MARGIN TEXT "th~rough", 15, 35, 19, 8, 1 WS_GROUP EDIT "", 2019, 47, 19, 4, 1 ES_MARGIN TEXT "/", 16, 51, 19, 1, 1 WS_GROUP EDIT "", 2020, 52, 19, 4, 1 ES_MARGIN TEXT "/", 17, 56, 19, 1, 1 EDIT "", 2021, 57, 19, 4, 1 ES_MARGIN TEXT "(1982-99)", 18, 64, 19, 9, 1 TEXT "(mm / dd / yy)", 19, 16, 20, 14, 1 PUSHBUTTON "~Send", IDOK, 10, 22, 8, 1 WS_GROUP | BS_DEFAULT | WS_BORDER PUSHBUTTON "Sa~ve", IDD_SAVE, 27, 22, 8, 1 WS_BORDER PUSHBUTTON "~Help", IDD_HELP, 43, 22, 8, 1 WS_BORDER PUSHBUTTON "~Cancel", IDCANCEL, 60, 22, 10, 1 WS_BORDER END STRINGTABLE BEGIN 1001 "_IF_ '' = $2003 _AND_ '' = $2004 _AND_ '' = $2005 _AND_ '' = $2006 _AND_ '' = $2008 _AND_ '' = $2016 _AND_ $2015 OFF _THEN_ ' Must specify some search criteria! '" 1002 "_IF_ '' != $2010 _OR_ '' != $2011 _THEN_ '' = $2012 _AND_ '' = $2013 _ELSE_ ' Use issue OR page numbers to select; not both '" 1003 "_IF_ '' != $2009 _THEN_ '' != $2008 _ELSE_ ' Must specify a start and end volume '" 1004 "_IF_ $2008 < '31' _OR_ $2008 > '48' _AND_ '' != $2008 _THEN_ ' Volume number must be between 31 and 48 '" 1005 "_IF_ $2009 > '48' _AND_ '' != $2009 _THEN_ ' Volume number must be between 31 and 48 '" 1006 "_IF_ $2008 > $2009 _AND_ '' != $2009 _THEN_ ' Volume number ranges must be ascending '" 1007 "_IF_ '' != $2011 _THEN_ '' != $2010 _ELSE_ ' Must specify a start and end issue '" 1008 "_IF_ '' != $2013 _THEN_ '' != $2012 _ELSE_ ' Must specify a start and end page '" 1009 "_IF_ $2010 > $2011 _AND_ '' != $2011 _THEN_ ' Issue number ranges must be ascending '" 1010 "_IF_ $2012 > $2013 _AND_ '' != $2013 _THEN_ ' Page number ranges must be ascending '" 1011 "_IF_ '' != $2010 _THEN_ '' != $2008 _ELSE_ ' Must specify volume number with issue numbers '" 1012 "_IF_ '' != $2012 _THEN_ '' != $2008 _ELSE_ ' Must specify volume number with page numbers '" 1013 "_IF_ '' != $2011 _THEN_ '' != $2009 _ELSE_ ' Must specify volume number with issue numbers '" 1014 "_IF_ '' != $2013 _THEN_ '' != $2009 _ELSE_ ' Must specify volume number with page numbers '" 1015 "_IF_ '' = $2011 _AND_ '' != $2010 _THEN_ '' = $2009 _ELSE_ ' Must specify ending issue number '" 1016 "_IF_ '' = $2013 _AND_ '' != $2012 _THEN_ '' = $2009 _ELSE_ ' Must specify ending page number '" 2000, "MMWR, 21, 16" 2001, "Comment, EDIT, _DATE__TIME__SYSNAME" 2002, "Filename, EDIT, MMWR1, ALLOW, '__ALPHA_NUMBER'" 2003, "KEY1, EDIT, _, ALLOW, '_ALPHA *.-$#&_NUMBER'" 2004, "KEY2, EDIT, _, ALLOW, '_ALPHA *.-$#&_NUMBER'" 2005, "KEY3, EDIT, _, ALLOW, '_ALPHA *.-$#&_NUMBER'" 2006, "KEY4, EDIT, _, ALLOW, '_ALPHA *.-$#&_NUMBER'" 2007, "TITL, CHECKBOX, OFF, Y, N" 2008, "VOL1, EDIT, _, ALLOW, '_NUMBER'" 2009, "VOL2, EDIT, _, ALLOW, '_NUMBER'" 2010, "ISS1, EDIT, _" 2011, "ISS2, EDIT, _" 2012, "PAG1, EDIT, _" 2013, "PAG2, EDIT, _" 2014, "RAD1, RADIOBUTTON, ON, 2014, 2015, DATE, TOGGLE, ON, 2016, 2017, 2018, 2019, 2020, 2021, 12, 13, 14, 15, 16, 17, 18, 19, OFF" 2015, "RAD2, RADIOBUTTON, OFF, 2014, 2015, THIS, TOGGLE, ON, OFF, 2016, 2017, 2018, 2019, 2020, 2021, 12, 13, 14, 15, 16, 17, 18, 19" 2016, "DAT1, DATE, _, MONTH, MDY, 820101, 991231, BEFORE, 2019" 2017, "DAT1, DATE, _, DAY, MDY, 820101, 991231, BEFORE, 2019" 2018, "DAT1, DATE, _, YEAR, MDY, 820101, 991231, BEFORE, 2019" 2019, "DAT2, DATE, _, MONTH, MDY, 820101, 991231, AFTER, 2016" 2020, "DAT2, DATE, _, DAY, MDY, 820101, 991231, AFTER, 2016" 2021, "DAT2, DATE, _, YEAR, MDY, 820101, 991231, AFTER, 2016" END

The previous resource file demonstrates the presentation of a DIALOG box. Consistency in look and feel stem from the project's style guide; file format and elements utilized in a DIALOG box contribute to the consistancy in HTML generation. The onus of application look and feel remains the issue of the application programmer (DIALOG designer), but one must still operate within a consistent structure. Thus, no matter what one does with a DIALOG BOX, one is assured of a consistent interface.

Now that one generated an RC file, one considers how to interpret that file. The converter supports either of two choices, dynamic or static. Static conversion simply creates an HTML file and an CGI compliant backend. The author uses these files statically in ANCHOR tag statments. Include static HTML FORMs in any HTML document as one would use any other HTML document. Applications utilize dynamic RC interpretation. Most applications contain MENUs, DIALOGS, MESSAGE BOXes, etc. Addressed later, the Integration of HTML FORMs yeild the same look and feel of the MS-Windows application. The integration allows branching to other FORMs from MENUs and dynamic data insertion into the FORM. Dynamic creation of FORMs also allows for "standard security" functionality. This separates user sessions by USERID.

Code Generation

The conversion program is run against the resource file and the following items are produced:

HTML Source Generation

The converter reads an RC file and directly translates from resource commands to HTML statements for fill-out FORM support. The idea is to mimick the MS-Windows user interface as closely as possible. For instance, DIALOG translates to <FORM>, CAPTION translates to <TITLE>, and EDIT (EDITTEXT) translates to <INPUT>. Each FORM is placed in its own file, thus a scheme of "ROOT" and "BASE" is formed. "ROOT" applies to the root name of the RC file. "BASE" refers to the FORM number inside the RC file. Since all FORMS get their own file, they are named according to the scheme: ROOT.BASE.html. The combination of "ROOT" and "BASE" uniquely identify a FORM in the system. This identity is used through out integration, as a means of distinguishing individual FORMs. These FORMs are deposited in the USER's directory for his specific use. The CGI backend process removes the HTML file after the FORM is processed. In some cases, there is no FORM file, so reload will fail. Such dynamic FORMs are generally processed data requiring immediate attention and written directly to the WWW Client (MOSAIC).

The expample below demonstrates the conversion process. This HTML is generated from the previous RC file example: "ROOT" is MMWR and "BASE" is "00", this means that this is the only FORM in the file "mmwr.rc".

Example HTML Source

(Whitespace edited)

MMWR Search Criteria

Comment:

Filename: .REQ/PCW

1: or 2:

AND

3: or 4:

Search Titles Only

AND

Source: Volume through Volume (31 - 48)

Issue Issue

Page Page

OR

INPUT TYPE="radio" NAME="GROUP_1" VALUE="RAD1"> Select Date This Week's Issue

From: / / through / / (1982-99)

(mm / dd / yy)


Actual Interpretation of HTML Source:

(Warning: some older HTML viewers may not display properly)

MMWR Search Criteria

Comment:

Filename: .REQ/PCW

1: or 2:

AND

3: or 4:

Search Titles Only

AND

Source: Volume through Volume (31 - 48)

Issue Issue

Page Page

OR

Select Date This Week's Issue

From: / / through / / (1982-99)

(mm / dd / yy)



NOTE: the above URL cannot be accessed by anyone other than user rbt5 at a very specific IP address. If the url is currently available, then one recieves a security violation error, if IP address does not match the actual user's IP address that created the CGI backend. The backend is generated at the same time the screen is generated, thus the CGI backend knows exacly what IP address to expect screen data submitions from.

Header Source

Include files are generated to give the generic processing code of the CGI backend the ability to map specific data with specific declared space in the 'C' program. The user need not know the organization of the include files, but it helps to explain how data is handled by the host process. Include files are divided into several sections:

Variable Declarations
This is physical space pointers needed to keep track of FORM field variables. Variables are referenced by name in application specific code (main()) and by string reference only in auto.o.
Variable Mapping Tables
This table maps variable name to physical space. It is utilized by generic CGI code (auto.o) to store and retrieve variables in a generic fashion. Thus, variables can be dealt with by string name in generic code for generalized application purposes. This allows generic code to loop through a list of predetermined variables made by application specific code, but unknown to generic code.
Acceptable Values
Acceptable vaules specific to each field and/or field type. If listed in the table, then the variable content must match ONE of the entries in the table. This makes sure that if a field, for instance, is a <SELECT> (LIST BOX), then the <OPTIONS> (list members) are in the acceptable values list. If the variable value does not match a coresponding value in this table, then an error message is returned. (This type of check prevents the user from editing HTML source (OPTIONS), loading the FORM locally, and then submitting the FORM data to the backend).
Table of Values to Change
This table represents vales that must be altered from HTML default values, such as "ON" or "OFF", to values that make sense for the application (like "Y" or "N" or "Yes" or "No"). Applies to items like RADIOBUTTONS and CHECKBOXes.
Table of Menu Items
This table is utilized only for DROPDOWN or POPUP MENUs. It maps menu selections to functionality. It maps the value of a WM_MESSAGE to the MENU item identifier. This is for use in the menu tables. Menu Tables simply match item identifier with "ROOT" and "BASE" to determine which form to display next.

Example Header for CGI program to match FORM:

/* THIS FILE PROGRAMMICALLY GENERATED, DO NOT MODIFY!! */ /* Include statements */ #include "vartable.h" /* Variable Declarations */ char *USERID = ""; /* for name USERID */ char *PASSWD = ""; /* for name PASSWD */ char *REMOTE_ADDR = ""; /* for name REMOTE_ADDR */ char *ROOT = ""; /* for name ROOT */ char *BASE = ""; /* for name BASE */ char *GROUP_1 = ""; /* for name GROUP_1 */ char *Comment = ""; /* for name Comment */ char *Filename = ""; /* for name Filename */ char *KEY1 = ""; /* for name KEY1 */ char *KEY2 = ""; /* for name KEY2 */ char *KEY3 = ""; /* for name KEY3 */ char *KEY4 = ""; /* for name KEY4 */ char *TITL = ""; /* for name TITL */ char *VOL1 = ""; /* for name VOL1 */ char *VOL2 = ""; /* for name VOL2 */ char *ISS1 = ""; /* for name ISS1 */ char *ISS2 = ""; /* for name ISS2 */ char *PAG1 = ""; /* for name PAG1 */ char *PAG2 = ""; /* for name PAG2 */ char *RAD1 = ""; /* for name RAD1 */ char *RAD2 = ""; /* for name RAD2 */ char *DAT1 = ""; /* for name DAT1 */ char *DAT2 = ""; /* for name DAT2 */ /* Variable Mapping Tables */ variables vars[] = { { "USERID", &USERID;, 0, 0 }, { "PASSWD", &PASSWD;, 0, 0 }, { "REMOTE_ADDR", &REMOTE;_ADDR, 0, 0 }, { "ROOT", &ROOT;, 0, 0 }, { "BASE", &BASE;, 0, 0 }, { "GROUP_1", &GROUP;_1, 0, 398888 }, { "Comment", &Comment;, 2001, 2001 }, { "Filename", &Filename;, 2002, 2002 }, { "KEY1", &KEY1;, 2003, 2003 }, { "KEY2", &KEY2;, 2004, 2004 }, { "KEY3", &KEY3;, 2005, 2005 }, { "KEY4", &KEY4;, 2006, 2006 }, { "TITL", &TITL;, 2007, 2007 }, { "VOL1", &VOL1;, 2008, 2008 }, { "VOL2", &VOL2;, 2009, 2009 }, { "ISS1", &ISS1;, 2010, 2010 }, { "ISS2", &ISS2;, 2011, 2011 }, { "PAG1", &PAG1;, 2012, 2012 }, { "PAG2", &PAG2;, 2013, 2013 }, { "RAD1", &RAD1;, 2014, 2014 }, { "RAD2", &RAD2;, 2015, 2015 }, { "DAT1", &DAT1;, 2016, 2016 }, { "DAT2", &DAT2;, 2019, 2019 }, {0,0,0,0}, 0 }; /* Table of Acceptable Values */ str_table values[] = { { "USERID", "rbt5" }, { "PASSWD", "secret" }, { "REMOTE_ADDR", "158.111.166.100" }, { "ROOT", "mmwr" }, { "BASE", "00" }, { "TITL", "ON" }, { "TITL", "OFF" }, { "GROUP_1", "RAD1" }, { "RAD1", "ON" }, { "RAD1", "OFF" }, { "GROUP_1", "RAD2" }, { "RAD2", "ON" }, { "RAD2", "OFF" }, {0,0}, 0 }; /* Table of Values to change */ conv_tbl convert_values[] = { { "TITL", "ON", "Y" }, { "TITL", "OFF", "N" }, { "TITL", "", "N" }, { "RAD1", "", "OFF" }, { "RAD2", "", "OFF" }, {0,0,0}, 0 }; /* Table of Menuitems */ menu menuitems[] = { {0,0}, 0 }; /* END GENERATED CODE */

C Source Code

Each converted RC file receives an HTML fill-out FORM accompanied by an CGI compliant backend processor to validate and process FORM data. These CGI programs parse stdin and associate variables values with pre-defined global variables. CGI programs only accept variables defined in the RC files. Various variables are dynamically allocated for the segregation of data by USERID and for security purposes. The CGI program checks these extraneous variables to ensure that only the USER for the FORM runs the backend process.

The object file auto.o is written for binding to an object file simply containing a main() function and the standard include file (arrays and declarations). The auto.o object file contains code that addresses variables via an array of variables to eleviate the need to know specific variable names.

parse_args();
This function parses the command line and the stdin stream for input to the program. It maps variables from the stdin stream to those in the array vars. Variables on stdin stream not contained in the array vars are ignored. Also, values for variables must be validated if an entry in the values array for that field exists. For instance, the REMOTE_ADDR variable must match identically to the one stored in the value array or the form is invalid. Although this variable is not contained in the FORM itself, it is contained in the CGI programs environment. The variable is extracted from the environment and placed in the REMOTE_ADDR variable before checks are performed. This integral security check ensures that only the one who requested the FORM and backend be created can use the backend process.
convert_args();
This function converts variables from HTML FORM values to application specific values. It converts items like radio button values from a variable name to altering the value of that variable name. IE: GROUP1="RAD1" is translated to the variable named RAD1 storing the value of "ON".
check_menu();
This function is part of the functionality integration package. It consults menu configuration files for the next screen to display or function config files for functionality to envoke. See also FORMs Integration .
conversion();
This function converts values of stored data from FORM specific to application meaningful values. IE: "ON" may equate to "Yes" for a particular variable. Other applications may require a YES or NO value to be converted to a 1 or 0 value, respectively. As long as a valid replacement value is described for YES/NO, this function will replace it. Radio buttons are but a fraction of conversion processing. There are checkboxes, too, in which valid values exist for checked and unchecked variables.
print_request();
This function stores the data from the FORM in a specific format on the httpd host for further application specific processing. FTP moves the "request" file from the server host to the processor responsible for data sets (App Server). App Server will FTP results from queries to the USER's directory on the httpd host machine.
Application Specific Code and Type Checking
Application specific code is derived from the IF,THEN,ELSE syntax contained in the RC file. Generally, string checks performed relate to the contents of a specific field values (ALLOW valid characters)(common for type-checking), or can be related to another field (like date or number values in RANGES greater than or less than another field or set of fields. Keywords are used in any combination for this type of checking, some are as follows:
  • IF THEN ELSE
  • &&, ||, ==, =, !=, _AND_, _OR_, ON, OFF, etc.
  • RANGE RANGE1 RANGE2
  • COMBORANGE COMBORANGE1 COMBORANGE2
  • BEFORE AFTER
  • MESSAGE
  • ALLOW

The programatic control over field type checking and FORM validation is endless.
The Source Code that processes data from this FORM looks as follows:

CGI Compliant Backend (Example Generated Source Code):
[WHITESPCE EDITED (80 cols)] /* THIS FILE PROGRAMICALLY GENERATED:: DO NOT MODIFY!! */ #include #include #include "/home/rbt5/cern/www/wonder/test/mosaic/rbt5/mmwr.h" main( argc, argv ) int argc; char **argv; { int i; int fail=0; int menu_process; fail = parseargs( argc, argv ); convert_args(); menu_process = check_menu(); if( menu_process ) { exit( 0 ); } if( (strcmp( "", KEY1 ) == 0 ) && (strcmp( "", KEY2 ) == 0 ) && (strcmp( "", KEY3 ) == 0 ) && (strcmp( "", KEY4 ) == 0 ) && (strcmp( "", VOL1 ) == 0 ) && (strcmp( "", DAT1 ) == 0 ) && ( !strcmp( RAD2, "OFF" ) ) ) { printf( "' Must specify some search criteria! '<P>\n" ); fail=1; } if( (strcmp( "", ISS1 ) != 0 ) || (strcmp( "", ISS2 ) != 0 ) ) { if( (strcmp( "", PAG1 ) == 0 ) && (strcmp( "", PAG2 ) == 0 ) ) { /* NADA */; } else { printf( "' Use issue OR page numbers to select; not both '<P>\n" ); fail=1; } } [... deleted lines ...] if( memcmp( DAT2, DAT1, strlen( DAT1 ) ) <= 0 ) { fail=1; printf( "DATE: %s (%s) must be AFTER %s (%s)<P>\n", "DAT2", DAT2, "DAT1", DAT1 ); } conversion(); if( !fail ) { print_request( "mmwr" ); } else printf( "failure to pass field validation!\n" ); return(0); } /* END GENERATED CODE */

FORMs Integration

FORMs integration encapsulates the ability to branch (MENU) to other forms, or chain forms together in a sequence yielding an application scenario. This gives substance to the application. This constitutes the heart and soul of the command/response driven application, allowing data to be entered and data to be viewed in a sequence that makes sense to the overall application. The following sections describe how this is accomplished with examples from CDC Mosaic/WONDER

Menu (Config File) Processing

Menu processing performs the association between MENU selections (currently emulated by a radio button list in HTML) to the actual FORM to load for the user next. This is accomplished through a menu configuration file ("menu"):

# Menu file (extracts) { id: IDM_DATABASE root: basicnew base: 01 args: 1 backend: BUILDNEXT next_root: _IDD_LIST next_base: 00 create: 0 rm: 0 } { id: IDM_LOGON root: basicnew base: 08 args: 1 backend: REMOTE next_root: basicnew next_base: 09 create: 0 rm: 0 } { id: XXXX root: basicnew base: 09 args: 1 backend: REMOTE next_root: basicnew next_base: 00 create: 1 rm: 0 } { id: XXXX root: basicnew base: 00 args: 1 backend: REMOTE create: 0 rm: 0 } { id: YYYYY root: mmwr base: 00 args: 1 backend: REMOTE } { id: YYYYY root: MMWR1 base: 00 args: 3 backend: REMOTE } #end of file

The menu RC file looks like list (edited version of ROOT=basicnew BASE=00)::

[... lines deleted ...] PullDown MENU BEGIN POPUP "Re~quests" BEGIN MENUITEM "~New...", IDM_DATABASE MENUITEM "~Old...", IDM_OLDREQ END [... lines deleted ...] END

One may notice that for a "New Request" one generates the value of IDM_DATABASE. In the menu file, basicnew 00 does not map or chain to any other FORM, but IDM_DATABASE is used as a unique identifier for FORM basicew 01. This mapping is dynamic based on the users selection. Thus if the user selected "New Request" from the menu "PullDown", the next screen to display would be the basicnew.01.html FORM.

Dynamic Form Data

Dynamic FORMs Data represents an interface to both data sets and previous work Each user's directory stores data generated by both user and data set server. The user views the data either via fill-out FORM or through hypertext presentation of reports, tables, figures, data, context sensitive maps, etc. Much of the dynamic data is gerated at remote data set server sites, but dynamic data can also be generated at the user site and at the httpd site. The user site data is generally upload files from other applications (spreadsheets, data files, word processor files, whatever) to the Server Site and then on to the Data Set maintainer. Httpd site dynamic data is generated for incorporation into fill-out FORMs (directory listings, static or ascii data files, etc.).

Local Services (Http Server Site)

Continuing with the above example, basicnew.01.html is built with a "BUILDNEXT" argument. This constitues a local service on the HTTP server machine. The form is built with dynamic data (used for <OPTIONS>)taken from a program run in the background (BUILDNEXT). Note the following config file (basicnew.cfg)

# this file (basicnew.cfg) is for dynamic conversion of BASICNEW.RC { form: DataSet id: IDD_LIST program: cd arg_1: ../../resource; arg_2: resource arg_3: 1 arg_4: . arg_5: | arg_6: sort } And the following code clip from basnicew.rc (basicnew.01) that has been edited to 80 columns.

DataSet DIALOG 14, 8, 52, 12 CAPTION "New Request" STYLE WS_SHADOW BEGIN LISTBOX "~Data Sets", IDD_LIST, 16, 10, 48, 7 LBS_NOTIFY PUSHBUTTON "~Open", IDOK, 21, 18, 8, 1 BS_DEFAULT | WS_BORDER PUSHBUTTON "~Help", IDD_HELP, 35, 18, 8, 1 WS_BORDER PUSHBUTTON "~Cancel", IDCANCEL, 49, 18, 10, 1 WS_BORDER END Note that the FORM DataSet and ID "IDD_LIST" in the config file have an external program associated with them to produce the <OPTION> lines for the HTML fill-out FORM. HTML produced from the above referenced RC file (basicnew.rc) is placed in basicnew.00.html. For <OPTIONS> to the LISTBOX "IDD_LIST", we execute the external program referenced in the config file. Stdout from the external program becomes the <OPTIONS> list for the converted <SELECT> statement. This example is a simple directory listing of available Data Sets (RC files) for use by the user. The selected RC file is dynamically converted and becomes the next form in viewer window.

Remote Services (Data Set Server Site)

Remote services for dynamic data also fills the <SELECT> statement with <OPTIONS>. There is only one general form to accomplish this, via VARS files. VAR files allow the persistent storage of variables and data in an ascii file. Data Set processors and CGI backends produce this type of file, allowing one to bring information from Data Sets into a fill-out FORM as well as SAVE old form data, retrieve it, alter it and re-submit that data to data set servers. Below, a resource file (MMWR1.RC) demonstrates how this is accomplished. The file MMWR1.RC is chained off of a directory listing of VARS files. The VARS file contains resource file information which the converter will find when the file is parsed. (MMWR2 simply shows a FORM that offers dynamic selection criterion assembled from a data request previously submitted to the Data Set Server...)

#include "style.h" #include "basic.h" MMWR1 DIALOG -1, 0, 82, 26 CAPTION "MMWR Selection Screen" BEGIN TEXT "Co~mment = ", 11, 2, 1, 20, 1 EDIT "", 2001, 14, 1, 42, 1 ES_MARGIN TEXT "~Filename = ", 11, 2, 2, 12, 1 EDIT "", 2002, 14, 2, 10, 1 ES_MARGIN TEXT ".REQ/PCW", 11, 24, 2, 20, 1 "VirtList" "~Articles:", 2003, 0, 3, 80, 19 LBS_NOTIFY | LBS_MULTIPLESEL | LBS_OWNERDRAWFIXED | WS_GROUP | WS_TABSTOP CHECKBOX "Include tables and graphs if present in article?",2004,10,22,25,1 PUSHBUTTON "~Send", IDOK, 10, 24, 8, 1 BS_DEFAULT | WS_BORDER PUSHBUTTON "Sa~ve", IDD_SAVE, 27, 24, 8, 1 WS_BORDER PUSHBUTTON "~Help", IDD_HELP, 43, 24, 8, 1 WS_BORDER PUSHBUTTON "~Cancel", IDCANCEL, 60, 24, 10, 1 WS_BORDER END STRINGTABLE BEGIN 2000, "MMWR, 18, 0" 2001, "Comment, EDIT, _DATE__TIME__SYSNAME" 2002, "Filename, EDIT, MMWR2, ALLOW, '__ALPHA_NUMBER'" 2003, "R, VIRTUAL_LIST, CURRENT, MIXED, 9, 1, CONT_REC" 2004, "GRPH, CHECKBOX, ON, GRAPHS, -" 2005, "KEY1, VARS" 2006, "KEY2, VARS" 2007, "KEY3, VARS" 2008, "KEY4, VARS" 2009, "TITL, VARS" 2010, "NAME, VARS" 2011, "VOL1, VARS" 2012, "VOL2, VARS" 2013, "ISS1, VARS" 2014, "ISS2, VARS" 2015, "PAG1, VARS" 2016, "PAG2, VARS" 2017, "DAT1, VARS" 2018, "DAT2, VARS" END The Dynamic Data Set Generated VARS File is as follows: source "CDC WONDER/PC Data File" Version 2.5 SystemName="MMWR System" RequestDate = " 8/ 4/94 10:32" Comment=" 8/ 4/94 10:30 MMWR" Filename="MMWR1" ReportDate=" 8/ 4/94 10:39" ResourceFile="MMWR1" matrix Doc2 contains String DocID (size=9 format=9) Integer DocSize (size=7 format=7) values 000022311 11351 000025850 27798 000000000 00000 000019835 12017 [... Lines Deleted ...] endmatrix TEXT Doc1 size = 4076 12/10/93 Infant Mortality -- United States, 1991 08/27/93 Behavioral Risk Factor Surveillance, 1991: Monitoring Progress Toward the Nation's Year 2000 Health Objectives 03/12/93 Infant Mortality -- United States, 1990 [... TEXT Data Deleted ...] The fill out form final source is as follows: (Whitespace edited to 80 cols)

MMWR Selection Screen

Comment =

Filename = .REQ/PCW

Articles:

Include tables and graphs if present in article?

The form is interpreted as follows: (Warning: some older HTML viewers may not display properly)

MMWR Selection Screen

Comment =

Filename = .REQ/PCW

Articles:

Include tables and graphs if present in article?

Chaining Forms Together

The integration of fill-out FORMs also includes the ability to Chain FORMs together. This means that once a fill-out FORM is submited successfully, the next FORM in the chain sequence will appear on the screen. This is accomplished via the menu file; facilitated through the use of "next_root" and "next_base" table entries. In the previous menu file, id IDM_LOGON (basicnew.08) calls the FORM basicnew.09 (the Password entry screen). The Password screen (basicnew.09) calls the Main Menu (basicnew.00). This example of a simple FORM chain demonstrates the LOGIN process ( USERID, PASSWORD, then present the user with the MAINMENU (PullDown)). From there the application may have many more chains of FORMs.

Note that PullDown is just a name, and a poor one at that, the RC file was used as is, but will be edited to reflect a meaningful name (like "Main Menu").


Features of the Resource Converter

There are many features of the resource converter, these will have to be demonstrated at the conference in order to fully appreciate the power of this tool. Below is a partial list of features:


Missing Items in HTML

The following items will discussed at length in terms of a proposal for future HTML functionality enhancements. These features are considered to be extremely important to the development of new and porting of existing applications to the HTML/CGI combination environment. enjoy.

Preformatted FORM Support

The use of <PRE WIDTH=180>...</PRE> within the context of fill-out FORM support. Currently, this use works on text, however, tags interfere with the preformatted text by beginning on the next line. IE: <INPUT> could not appear in the middle of a line on a FORM that uses <PRE>. This is a problem when attempting to group like items on a fill-out FORM together. The fill-out FORM creator is at the mercy of the MOSAIC formater for the placement of fields in the window. This must end if there is to be any control over look and feel issues of an applications user interface. There needs to be some latitude to override the line wrapping functions in HTML viewer like MOSAIC. If this functionality already exists, or its intent exists, then the BUG needs to fixed in short order.

Data Types

This section deals with the insuffient data types of HTML Input variables.

Base Data Types

Although these data types are defined as part of HTML+, it is imperitive that they be implemented in HTML viewers in the very near future. Complex applications will begin to eat bandwith without type checking. Free form input, as currently implemented, must be checked by CGI programs and errors returned over the net. Simple type checking can go a long way to preventing such bandwidth from being consumed due to relatively simple typing errors.

INT
proposed already, but desperate need exists for implementation.
FLOAT
proposed already, but desperately needs implementation.
STRING (TEXT)
already exists, but needs to be intelligently checked by the HTML CLIENT viewer. IE: see below for field checking.
DATE
already has strong need for implementation. Also, will require parameter for date input format or a user selectable format with a stadard date format that is passed to CGI backend. Either way is very acceptable.

Complex Data Types and Multi-Level Input

STRUCT
Structures should be allowed as FORM items, instead of individual fields, the FORM should evolve into a structure made of data elements, types, and display locations. Locations are important, look and feel should not be left to the whim of a line wrapping algorithm...
MULTI-LEVEL INPUT
Multi-level input allows pop-up data entry or lookup type data that is dynamic in nature or too large to keep in the original FORM. Thus allowing for HTML multi-part FORMs to distinguish input that must be querried from vasts amounts of valid field data. The results must paste back to the original data field(s) of the base FORM. Thus allowing programable cut and paste activities back to relatively simple fill out forms. Quite often, hard coded lists are inadequate for 30,000 codes stored in data bases... functionality like the folowing would help to solve the problem.
<INPUT MULTILEVEL="url:fieldname">
Perhaps a double-click in this field brings up the url (FORM, HELPFILE, etc) in a child window, any data that is in the selected field (fieldname) of the childform will be pasted back to the calling INPUT field. Or some similar situation to this would be greatly useful in HTML applications.

Intelligent Frontend Processing

Intelligent frontend processing cuts the amount of bandwidth used for incorrect data entry or invalid data entry. As HTML applications begin to develop into more and more complex applications, this may prove to be a large resource hog. Therefore, I propose the following enhancements to HTML to cover the pitfalls of usable applications in that environment. The more intelligent processing performed by the Client viewers like MOSAIC, the less bandwidth is used. Not to mention the fact that the applications become more user friendly and backends use less server CPU. This yields better network throughput and more available cycles on the http server; thus, more users with existing equipment.

Some sites may not encounter this problem of mass access, but CDC PC/Wonder already tops 2000 consistent users and Internet access version CDC MOSAIC/Wonder will expand the user base to several times that over the next few years; even more so as CDC information is wanted by NON-US Public Health Officials. Unnecessary bandwidth or CPU consumption is not acceptable. The intense use of the httpd machine should not be burdened with the client end of a client/server architectural language (HTML). From this angle, I can advocate the spending of distributed Client CPU through the use of elaborate HTML, rather than burdening an already taxed central httpd server.

Clickable IMAGE Support to Client Viewer

Misplaced CPU usage is especially true when considering clickable IMAGE support. For WONDER, as well as other complex mapping applications, it may be next to impossible to keep the httpd server from crawling on its knees with serveral thousand users all clicking context sensitive maps of the US that are individually built for the types of data they are viewing. Clickable Image support should be encoded in HTML for the IMAGE that is being dealt with. The movement of polygonal calculation to the HTML viewer coupled with a download file for that IMAGE would move much CPU usage to the CLIENT and off of the SERVER. <IMG CLICK ISMAP="mapfile"> would accomplish this quite nicely. Where mapfile contains non-platform specific coordinates. The url's are loaded locally and the server is left unstrained by the multitudes clicking images.

Type Checking

This would be simple field type checking, as mentioned previously. Basic types checked for valid entry of INT, TEXT, DATE, and FLOAT (from HTML+ specification).

Field Validation

Field validation should be performed by the viewer. Currently only a backend can determine if a value of "20.02" is a valid entry in an input field based on other field criterion. By allowing definable values or acceptable ranges of input to <INPUT> fields, one reduces the amount of Internet traffic associated with incorrect or invalid data entry. Pop-up of contextual Help functions (self-contained window, so as not to Hyper off to other FORMs nor alter the display area of the HTML viewer) may also help in this area.

<INPUT ALLOW="%4.2f">
Where ALLOW is some sort of standard for scanning (scanf like?) input. This could be over simplified to include things like ALPHA, ALPHANUMERIC, "$###.##", NOWHITESPACE, etc. However, I would advocate the use of more complicated scanning definitions so that length (even though SIZE=a,b is available, it doesn't define pre/post decimal input operations) and allowable input could be determined (such as "%4.2f" or "%3.3[012579ABDFQ]" to allow for application meaningful and specific input).

Form Validation

Form validation may very well belong in the CGI program, however, various aspects of FORM validataion can be implemented for simple fill-out FORMs in the HTML viewer. The viewer would have to have contextual (structure) data stored about a FORM, and then make sure that related data in one field corresponds with ranges of data in other related fields. Yes, this sounds like 4GL style FORM coding. 4GL code may very well need to be in the future of HTML fill-out FORM support. Perhaps support of simple structure statements and if-then-else syntax would improve FORM context before submission to CGI programs. This would be fairly easy to implement string massaging functionality.

User Menu Programming

After carefull consideration, it is believed that programable access to the user menu would be beneficial to HTML applications. This could be implemented in a MENU set of HTML language. These MENU tags are not related to the original MENU and LI tags, which basically gives a bullet list (if my memory serves me correctly). Instead these would either yeild a programmable menu line inside the viewer window or actually alter the MOSAIC user menu bar. Thus one has the branch factor of an Event driven application.

Pulldown for Form Actions

The menu items would either be distinguished URLs to allow functionality differences for each FORM submittal or set a common variable to distinguish functional processing by the single URL associated with the fill-out FORM.

The following items would need to be implemented in HTML

<USERMENU>
This tag signals the creation of a set of USER pulldown menus.
<POPUP>
This tag is for the creation of POPUP style menus in place on FORM.
<MENUITEM>
Declares an ITEM of selectable significance on a USERMENU or POPUP.
href="url"
url reference functionality
VALUE=""
This value is for the MENU CGI backend processor. Implemented as either a variable passed as usual to CGI backend or as separate program. This is the value of the selection made from the menu. This allows more than one branch from any particular FORM.
DISABLE (Inactive functionality)
Allows a menuitem to be temporarily disabled from user selection. Preferably GREYED out...


Bibliography

CDC Internal Publications

Public Documents

Published Documents


About the Author

Robert K. Thralls

206 Ridge Brook Trail NW
Duluth, GA 30136 USA
(404) 662-0997

BACKGROUND

Robert enjoys time with his wife, Susanne. They expect an addition to the family sometime in the VERY near future (Jerimy Daniel). Robert and Susanne met in Naples Florida on Christmas Day. Robert grew up in Naples. Susanne grew up in Germany (Wuppertal). Robert, Susanne, and Jerimy plan to move (return) to Germany in the next few years.

EDUCATION

Electronic Warfare Signals Intelligence Analyst
E/W Sigint Analyst Course (6 months - 1140 hours) at Goodfellow AFB, TX. 1984
Environmental Science
Currently studying Environmental Science (Combined degree program BS/MS) at Chadwick University

EMPLOYMENT HISTORY

The Orkand Corporporation
Senior Technical Consultant to the Centers for Disease Control. Project: CDC PC/Wonder, Internet Access. UNIX/C, MS-Windows (Visual C++), OOD/OOP.
NetExpress, Inc.
Member Technical Staff III. Project: Elsag-Bailey/Italian Postal System, Automated Recovery and Redundancy of postal systems. Integration of applications in LAN environment, fully automated disaster recovery procedures, and dynamic monitoring of systems and sub-systems. UNIX/C, OOD/OOP (Communication Libraries, Protocol Design, and Daemon Processes).
Computer Consoles, Inc.
Software Engineer. Unix internals design and programming (BSD 4.3).
NetExpress, Inc.
Programmer/Analyst. Projects: DHL Worldwide Express Customer Service Module (CSM) and PC-Dispatch. Automation of Customer Service operations and Dispatch operations. CSM implemented on Unix platform, PC-Dispatch implemented under MS-Windows (SDK v1.01). Unix/C, MS-Windows SDK (C).
Thralls and Associates
Jr. Programmer. Maintenance of Pascal programs. Borland Turbo Pascal (MS-DOS). Hey, Its rough working for Dad, especially when one has two older brothers hovering about the office!

Contact the Author

You can contact Robert Thralls at the followning E-mail address:

rbt5@orkand.em.cdc.gov

[MOONSCAPE HERE] CDC WONDER