Title: A Natural Extension: Using the Com-plete HTTP Server for Web-Enablement
1A Natural ExtensionUsing the Com-plete HTTP
Server for Web-Enablement
- David Wimberly
- Project/Program Director, University of Arkansas
- wdw_at_uark.edu
2Presentation Overview
- The Com-plete HTTP server
- A Natural tool for web enablement
- Web-Enablement at the University of Arkansas
- Enhancing existing applications with web
technologies - Implementation considerations
- Tips and techniques
- Examples
3The Com-plete HTTP Server
- A Natural tool for web-enablement
- Com-plete 6.1 architecture
- Natural and the HTTP server
- Natural programmers view
- System view
- Advantages of this native MVS web and application
server
4Com-plete 6.1 Architecture
5Natural and the HTTP Server
6Natural Programmers View
Read user input from the web CALL HAANUPR
CGI-STATUS / Return code and reason code
CGI-ACTION / GET-DATA or PUT-DATA
FIELD-NAME / HTML form field name
FIELD-VALUE / User input value
FIELD-LENGTH / Length anticipated/returned SEPAR
ATE FIND EMPLOYEE WITH
7System View
- Natural programs
- Run in the buffer pool
- Access ADABAS and other resources
- Call external module HAANUPR
- To read HTML form inputs and controls (GET or
POST) - To send dynamically generated HTML to the browser
- Configuration parameters for default user ID,
library, buffer sizes, etc. - Automatic EBCDIC/ASCII translations and url
encoding/decoding
8Native MVS Web and Application Server
9Web-Enablement with the Com-plete HTTP Server
- Enhancing existing applications with web
technologies - Objectives
- Background
- Web session examples
10U of As Objectives
- To enhance and extend our mainframe applications
- Reach new audiences
- Employees and vendors
- Enhance the presentation of information
- Consolidate information and dress it up
- Simplify access for infrequent users
- Not to replace all or even most 3270 functions
- Not to literally move a 3270 application to the
web
11U of A Background
- Natural and ADABAS mainframe shop since 1986
- BASIS Business Administrative Strategic
Information Systems - Custom inhouse developed applications
- Everything but student systems
- Separate groups doing Java web development and
screen scraping web deployment - Preference for Natural application code
- Timing was right for the Com-plete HTTP Server
12Logon
13Menu
14Browse PO selection screen
15Help for Date-Close-Anticipated
16Help for PO status, selection
17Help for PO status, window
18PO status returned
19Budgetary Unit help
20BU help search
21Browse PO for Status and BU by Date
22Browse result and PO selection
23View of PO, top
24View of PO, bottom
25Select a PO to Browse Invoices for PO
26Browse Invoices for PO
27View Invoice
28Select a PO to e-mail
29E-mail the PO
30PO list, vendor help
31Vendor name search
32Select vendor
33PO search by vendor and date, initiated
34PO search by vendor and date, results
35Main menu, select pay activity
36Browse pay activity
37View earnings statement
38Main menu, select addresses
393270 Addresses, etc. equivalent
40Addresses, etc
41Enter changes, view errors and previous values
42Correct errors and update
43Update confirmation screen
44Logoff screen
45Implementation Considerations
- How to maintain state
- Back button
- Back button vs Return
- Data security
- Configuration
- Essential JavaScript
- Techniques for generating HTML
- Coding tips, debugging tips, and more
- Example HTML and Natural code
46How to Maintain State
- The web is stateless
- Each interaction (submission) is self contained
- No provision for a continuous user session
- To maintain state
- Use conversational mode, or
- Create a session ID (TIMESTMP)
- Place it on the form as a hidden field
- Save and restore user session information using
ADABAS
47Back Button
- Can subvert your state information
- User reappears not from where you left him
- We considered
- Disabling it
- Running in a window without the toolbar or
menubar - Issuing errors if they used it
- Limit the state information you maintain
- Not the active position within a READ loop
- Instead, hide the first and last ISN on a page
- Have one entry point -- a dispatcher program
- actionuwowdis
48Back Button vs Return
Browse A objects at level 1
Browse B objects at level 2
Browse C objects at level 3
As 1 - 10
Bs 1 - 10
Cs 1 - 10
Object selection or Paging
Cs 11 - 20
Bs 11 - 20
Back button
Return
Bs 21 - 30
49How to Return
- Save program hierarchy information in hidden
fields - Our browse functions stack for each level
- Program ID
- Search type in effect
- ISN and MU/PE occurrence of first record on the
screen - Whether page back was valid
- A Return
- Pops one of these from the stack
- Executes the program and re-initiates the browse
50Data Security
- Sensitive data requires encryption
- Com-plete HTTP server does not do SSL
- Proxy server introduced to do all encryption and
decryption - To avoid mixing document types and client side
warnings - Style sheets and graphics are delivered from a
separate web server using HTTPS
51U of As Environment
HTTPS
HTTP
Proxy Server for SSL encryption
IBM OS/390 running ADABAS, Natural, and Com-plete
6.1
Client with SSL enabled Web Browser
Web Server for .gif and .css files
52Com-plete HTTP Server Configuration
- HAANCONF
- SERVPOOLYES
- Uses a shared logon or session
- NATLIBdefault library
- Natural CGI programs in other libraries require
an implicit logon - HTTPUSERdefault user ID
- URL processing user exit
- Restrict access to specific hosts or domains
53Essential JavaScript
- Cursor placement
- Selection processing and linking to different
services - Set hidden form element to selected value
- Submit form
- Window management
- Open and Close windows
- Pass and return values
54Techniques for Generating HTML
- Output your HTML to the Source Work Area
- Use Natural ISPF macros
- But macros cannot be invoked directly as a
Natural CGI program - Use Natural
- DEFINE PRINTER (1) OUTPUT 'SOURCE'
- FORMAT (1) PS0 LS133
- EJECT OFF (1)
- SET CONTROL 'Z
- WRITE (1) NOTITLE
- Send the generated HTML to the browser
- HNANCGIP is provided, but limited to 72 character
lines - Create your own using longer lines via the
USR1035N interface
55Coding Tips
- Develop an architecture and generate your Natural
CGI programs using Natural ISPF macros - Fast delivery of new functions
- Consistent
- Easy to implement changes -- REGEN
- To simplify making changes in page appearance
- Use copy code, subprograms, constants defined in
an LDA, and an external style sheet - HTML form fields can have dashes, but javascript
cannot reference them - Translate them to under-scores
56HAANUPR Tips
- Field names
- Must end with a blank character
- Field values
- Are not blank filled, reset them before your CALL
- Field length
- Passed in the largest value you will receive
- Returned the actual size of the field entered
- CALL HAANUPR
- CGI-STATUS / Return and reason code
- CGI-ACTION / GET-DATA or PUT-DATA
- FIELD-NAME / HTML form field name
- FIELD-VALUE / User input value
- FIELD-LENGTH / Length anticipated/returned
57Debugging Tips
- You cant sprinkle WRITEs into your code
- You cant run the Natural debugger
- Trap and log errors on a data base file
- Note ERROR-TA always starts as HNANERR and can
only be changed by an assignment statement - Output your debugging information with your web
page using HTML - This may mean holding information until you reach
the page ltbodygt
58Code Reuse
- Develop a Natural subprogram to output the core
HTML document for an object (Purchase Order,
Earnings Statement, etc.) - Call from your Com-plete web application (Natural
CGI program) - Call from online 3270 session to generate an HTML
e-mail attachment - Read the source work area and send to SMTP using
ESS PROCESS WRITE-SPOOL - Call from batch to generate an HTML e-mail
attachment
59HTML for UWOMENU, part 1
60HTML for UWOMENU, part 2
61Natural code, UWCSBH
62Natural code, output Action
63Natural code, output table of Services
64Natural code, read HTML form fields
65Enhancement Proposal 958
- Efficient browsing of ADABAS data (no wasted I/O)
- Forward or backward (descending)
- Possible due to STARTING WITH ISN
- Regular descriptors
- MU type descriptors
- Unique PE type descriptors
- It is not possible with non-unique PE type
descriptors! - Vote for FIND DESCENDING, enhancement proposal 958
66Presentation Review
- The Com-plete HTTP server
- A great run time environment for Natural, and now
an enabler for Natural based web applications - Web-Enablement at the University of Arkansas
- Examples of what can be done with the Com-plete
HTTP server - Implementation considerations
- Tips and examples from the University of Arkansas
67Thank You!