500 likes | 683 Views
Web Enablement: Challenges and Solutions http://www.uark.edu/basis/UAWEB/Challenges.html. David Wimberly University of Arkansas wdw@uark.edu. Web Enablement Challenges. Field help Selecting data Accommodating the browser Back button Stateless forward and backward browsing of ADABAS data.
E N D
Web Enablement:Challenges and Solutionshttp://www.uark.edu/basis/UAWEB/Challenges.html David Wimberly University of Arkansas wdw@uark.edu
Web Enablement Challenges • Field help • Selecting data • Accommodating the browser Back button • Stateless forward and backward browsing of ADABAS data
Background • Long term Natural/ADABAS shop • All non-student systems developed in house -- BASIS • Late to web enable • Inexperienced and unschooled • Com-Plete v6.1 HTTP Server • Natural as the CGI language • Natural code generated via Natural ISPF macros
1. Field Help • Traditionally available on 3270 terminals as help windows • Solution, three web examples • Technique • Selecting help and opening a window • Passing parameters to the help program • Returning a selected value
Web Field Help Example Field definition only
Web Field Help Example Field with discrete values
Web Field Help Example Field definition with search criteria for a table
Web Field Help Example Browse of selectable table values
Selecting Help & Opening a Window <a href="#" target="p8EPODIRM" tabindex="-1" title="Help for Employee Privacy Code" onclick="window.open( 'uwohfddv…', 'p8EPODIRM', 'resizable,scrollbars,width=400,height=400'); return false"> Privacy Code <br />(for directory)</a>
Passing Parameters In onclick="window.open( 'uwohfddv?pAA=HR& pFld=EMP-PRIVACY-CD& wFm=webForm& wFld=EMP_PRIVACY_CD', 'p8EPODIRM', ‘resizable,scrollbars,width=400,height=400'); return false"
Returning a Selected Value <script language='JavaScript'> <!-- Begin function setVC (dVal) { // Set opener Value and Close opener.document.webForm.EMP_PRIVACY_CD.value=dVal; window.close(); } // End --> </script> <a href='#' title='Choose this entry' onClick='setVC("1"); return false'>1</a>
Field Help Summary Using JavaScript and the DOM • Invoke help: <a … • Open a window: onclick=“window.open(… • Pass parameters: program?parm=value • Select a value: <a … • Return the value: opener.document.form.field.value=…
2. Selecting Data • Browse-Select user interface • Web examples • Solution • Hidden form fields • Entry selection • Field assignment
Browse of Purchase Orders • Action selected to view invoices for the selected PO
Browse of Invoices for a PO • Action selected to view the invoice data
Hidden Form Fields • HTML form fields are needed to pass selection identifiers to the next program • These fields are behind the scene since the user is not keying values into them <input type="hidden" name="PO_NO">
Entry Selection • Once again we use a null link to execute a JavaScript function <a href='#' tabindex='1' title='Choose this entry' onClick='setVS(1); return false'>6001260</a>
Field Assignment • JavaScript assigns the hidden form field and submits the form function setVS (le_x) { // Set Value and Submit listEl1 = new Array(); listEl1[1]="6001260"; listEl1[2]="6001264"; document.webForm.PO_NO.value=listEl1[le_x]; document.webForm.actionReq.value="Execute"; document.webForm.submit(); }
Selecting Data Summary • Hidden form fields: <input type=“hidden” … • Entry selection: <a … onclick=… • Hidden field assignment: document.form.field.value=… • Form submission: document.form.submit();
3. The BACK Button • The issue: state on the mainframe really is meaningless if the user can interact from any prior page • Web example • Solution: maintain minimum state information within each page via hidden fields • First/Last ISN and occurrence for paging • Program stack for ‘return’
First/Last ISN and Occurrence • Using these we access the first/last record to restore our search key values and then page (read) forward or backward <input type="hidden" name="FirstISNOcc" value="734.000"> <input type="hidden" name="LastISNOcc" value="738.000">
Program Stack, Titles • List of menus/functions visited <input type="hidden" name="title_rs1" value="Main Menu"> <input type="hidden" name="title_rs2" value="Purchasing/Payables Menu"> <input type="hidden" name="title_rs3" value="Purchase Orders">
Program Stack, Program Names • Natural program names for those functions and the action and search type selected (retained as index values) <input type="hidden" name="psPrgmID" value="UWOMENUH11;UWOMENUH11;UPOBPO 21;">
Program Stack, First ISN per Level • ISN and occurrence of the first record displayed at each level (the occurrence is only retained when necessary, negative values indicate page back was allowed) <input type="hidden" name="psFirstISN" value="5;10;-734;">
BACK Button Summary • Maintain state information within each page via hidden fields • For our browse models: • First and last ISN & occurrence • Info for each level (menu hierarchy) • Title • Program with action and search type • First ISN & occurrence
4. Stateless Browsing (ADABAS) • No active loop required • Thanks to STARTING WITH ISN • Backward browsing • Thanks to READ/HISTOGRAM … IN VARIABLE #DIRECTION • Descriptor types • Regular descriptors • MU descriptors • Unique PE descriptors
Regular Descriptor, Search Value • Search value (key) definition * DBV Search key for Search Type VEND 1 SK-VEND 2 VENDOR-NO (P6) 2 DATE-ORDER-EFFECTIVE (D) 1 REDEFINE SK-VEND 2 #SK-VEND (B8)
Regular Descriptor, Restore Keys • GET and MOVE BY NAME used to restore the search key after a paging request GET DBV #START-ISN /* Get the previous /* first/last record MOVE BY NAME DBV TO SK-VEND /* Pull its starting key
Regular Descriptor, Read • Data base READ and subsequent check for the same vendor RVEND. READ DBV IN VARIABLE #DIRECTION BY VENDOR-DATE-KEY = #SK-VEND STARTING WITH ISN = #START-ISN IF DBV.VENDOR-NO NE SK-VEND.VENDOR-NO /* So we don't page across high order keys ESCAPE BOTTOM END-IF
MU Descriptor, Search Value • Search value (key) definition for our Browse all Services • Applicable to super descriptors composed from an MU or elementary MU fields * DBV Search key for Search Type 3 - KEYW 1 SK-KEYW 2 #ACCESS-GROUP-CD (A4) 2 MENU-KEYWORD (A12) 1 REDEFINE SK-KEYW 2 #SK-KEYW (A16)
MU Descriptor, View Use HISTOGRAM & READ because • With READ alone you do not know which descriptor value (occurrence) was used to access the record • You cannot use HISTOGRAM and FIND because there is no FIND … DESCENDING 1 HKEYWV VIEW OF WEB-MENU 2 ACCESS-KEYWORD-KEY (1) 2 REDEFINE ACCESS-KEYWORD-KEY 3 #ACCESS-GROUP-CD (A4) 3 #MENU-KEYWORD (A12)
MU Descriptor, Restore Keys • Statements to restore the search key after a paging request (with the occurrence reference) GET DBV #START-ISN /* get the previous /* first/last record SK-KEYW.MENU-KEYWORD /* and pull its starting key := DBV.MENU-KEYWORD(#START-OCC)
MU Descriptor, Histogram • HISTOGRAM to obtain the key word values /* Set the fixed access group SK-KEYW.#ACCESS-GROUP-CD := WSI.ACCESS-GROUP-CD /* Histogram to get the keywords HKEYW. HISTOGRAM HKEYWV IN VARIABLE #DIRECTION FOR ACCESS-KEYWORD-KEY FROM #SK-KEYW IF HKEYWV.#ACCESS-GROUP-CD NE SK-KEYW.#ACCESS-GROUP-CD ESCAPE BOTTOM (HKEYW.) END-IF
MU Descriptor, Starting ISN • The READ may be a continuation only for the 1st descriptor value IF *COUNTER(HKEYW.) GT 1 /* Only restrict the records in the READ for the /* first key obtained RESET #START-ISN /* Will be ignored when used in /* STARTING WITH ISN (descending /* as well as ascending) END-IF
MU Descriptor, Read • Read the records with the descriptor value /* Read the data RKEYW. READ DBV IN VARIABLE #DIRECTION WITH ACCESS-KEYWORD-KEY = HKEYWV.ACCESS-KEYWORD-KEY(1) STARTING WITH ISN = #START-ISN IF NOT HKEYWV.#MENU-KEYWORD = DBV.MENU-KEYWORD(*) ESCAPE BOTTOM END-IF
MU Descriptor, Wrap Around • Do not report the same record twice when adjacent keywords exist within the same record IF NOT HKEYWV.#MENU-KEYWORD = DBV.MENU-KEYWORD(*) /* Ensure we don't cycle around or (#DIRECTION = 'A' AND *ISN(RKEYW.) LE #START-ISN) OR (#DIRECTION = 'D' AND #START-ISN NE 0 AND *ISN(RKEYW.) GE #START-ISN) ESCAPE BOTTOM END-IF #START-ISN := *ISN(RKEYW.)
PE Descriptor • You cannot page back (without wasted I/O) in a stateless environment with a non-unique PE type descriptor without FIND … DESCENDING • See enhancement proposal #958 on Quest or Servline24 and add your comments
Unique PE Descriptor, Search Key • Search value definition * DBV Search key for Search Type RACT 1 SK-RACT 2 REVIEWER-DESK-ID (A8) 2 #RPI (L) INIT <TRUE> 2 APPLICATION-ID (A8) 2 COMMAND-ID (A4) 2 TIME-TXN-REQUESTED (T) 1 REDEFINE SK-RACT 2 #SK-RACT (A28)
Unique PE Descriptor, View • HISTOGRAM view to obtain the descriptor values * HGV for PE type descriptor 1 HGV VIEW OF TARGET-TXN 2 REV-RPI-ACMD-TRTIME-KEY 2 REDEFINE REV-RPI-ACMD-TRTIME-KEY 3 #REVIEWER-DESK-ID (A8) 3 #RPI (L) 3 #APPLICATION-ID (A8) 3 #COMMAND-ID (A4) 3 #TIME-TXN-REQUESTED (T)
Unique PE Descriptor, Restore Keys • Statements to restore the search key after a paging request GET DBV #START-ISN /* get the previous /* first/last record MOVE DBV.APPLICATION-ID TO SK-RACT.APPLICATION-ID MOVE DBV.COMMAND-ID TO SK-RACT.COMMAND-ID MOVE DBV.REVIEWER-DESK-ID(#START-OCC) TO SK-RACT.REVIEWER-DESK-ID MOVE DBV.TIME-TXN-REQUESTED TO SK-RACT.TIME-TXN-REQUESTED
Unique PE Descriptor, Histogram • HISTOGRAM to obtain the PE descriptor values HRACT. HISTOGRAM HGV IN VARIABLE #DIRECTION FOR REV-RPI-ACMD-TRTIME-KEY STARTING WITH #SK-RACT IF HGV.#REVIEWER-DESK-ID NE SK-RACT.REVIEWER-DESK-ID ESCAPE BOTTOM (HRACT.) END-IF
Unique PE Descriptor, FIND • FIND the record with the unique descriptor value /* Treat this descriptor as if it is unique FRACT. FIND (1) DBV WITH REV-RPI-ACMD-TRTIME-KEY = HGV.REV-RPI-ACMD-TRTIME-KEY END-FIND …
Stateless Browsing Summary • Thanks to READ/HISTOGRAM … DESCENDING and STARTING WITH ISN we have efficient forward and backward browsing of ADABAS: • Regular descriptors, MU type descriptors, and Unique PE type descriptors • Enhancement needed for non-unique PE type descriptors (proposal #958) FIND … DESCENDING
Presentation Summary Techniques for: • Implementing field help, • Selecting data, • Working with the browser BACK button, and • Stateless forward and backward browsing of ADABAS files. Thank You