RDML of SET229A

LANSA

RDML of SET229A
* =======================================================
* Process ........: SET_229
* Function .......: SET229A
* Created on .....: 07/12/01 at 06:15:26
* Description ....: Event logging
* Version.........: 1
*
* Full Description: This function presents a simple
* web page with Search field and a few links. The
* objective is to show how to use Event logging in
* LANSA for the WEB
*
* Disclaimer: The following material is supplied as
* sample material only. No warranty concerning the
* material or its use in any way whatsoever is
* expressed or implied.
*
*
* =======================================================
* Function control options
Function Options(*DIRECT *WEBEVENT)
*
* Group and field definitions
Define Field(#S_CLICKED) Type(*CHAR) Length(030) Default('FORM.INITIALIZE')
Define Field(#S_229DESC) Reffld(#S_FUNDESC)
Define Field(#S_229DES1) Reffld(#S_FUNDESC)
Define Field(#S_229SEAR) Reffld(#S_BUTTON)
Define Field(#S_FUNTITL) Reffld(#FUNCDESC)
Define Field(#S_REDIREC) Type(*CHAR) Length(50) Input_Atr(LC) Default(*blanks)
*
Group_By Name(#PANELDATA) Fields((#S_229DESC *NOID) (#S_229DES1 *NOID) #S_229SRCH (#S_229SOFF *NOID) (#S_229IBML *NOID) (#S_229MSL *NOID) (#S_229SEAR *NOID) (#S_CLICKED *HIDDEN) (#S_FUNTITL *HIDDEN) (#S_REDIREC *HIDDEN) (#STDTRCFLD *HIDDEN))
*
* Always initialize the redirection field to blanks.
* Depending on what was clicked on the page, the
* contents of it will be changed.
* #S_REDIREC is a condition used in SET_229_LAYOUT
* that controls whether to include the Refresh meta tag
* in the html sent to the browser. When it is non blank,
* it will contain a URL where the current page should be
* redirected. That happens when the user clicks on either
* The IBM or the Microsoft logos.
Change Field(#S_REDIREC) To(*DEFAULT)
* Mainline
Case Of_Field(#S_CLICKED)
When Value_Is('= FORM.INITIALIZE')
Execute Subroutine(INIT_FORM)
When Value_Is('= SEARCH')
When Value_Is('= SPECIAL_OFFERS')
When Value_Is('= IBM_LINK')
Execute Subroutine(REDIRECT) With_Parms('http://www.ibm.com')
When Value_Is('= MICROSOFT_LINK')
Execute Subroutine(REDIRECT) With_Parms('http://www.microsoft.com')
Endcase
*
Request Fields(#PANELDATA) Exit_Key(*NO) Menu_Key(*NO) Prompt_Key(*NO)
Return
* =======================================================
* Subroutine INIT_FORM
* Description ...: Initialize function
* =======================================================
Subroutine Name(INIT_FORM)
Change Field(#S_FUNTITL) To(*DEFAULT)
* Specify fields to log
Execute Subroutine(SUBST_FLD) With_Parms(S_229SRCH 1)
Execute Subroutine(SUBST_FLD) With_Parms(S_CLICKED 11)
Endroutine
* =======================================================
* Subroutine SUBST_FLD
* Description ...: Substring the field names whose
* content we want to log into the LANSA standard
* shipped trace field #STDTRCFLD. This field must be
* included in the REQUEST command as hidden. LANSA will
* then automatically log the contents of the fields being
* logged into file DC@W27.
* =======================================================
Subroutine Name(SUBST_FLD) Parms((#SUBST_VAL *RECEIVED) (#STR_POS *RECEIVED))
Define Field(#SUBST_VAL) Type(*CHAR) Length(10)
Define Field(#STR_POS) Type(*DEC) Length(2) Decimals(0)
Substring Field(#SUBST_VAL) Into_Field(#STDTRCFLD #STR_POS)
Endroutine
*
Subroutine Name(REDIRECT) Parms((#S_REDIREC *RECEIVED))
Endroutine