UF_QRY03 - Listening for Ramp Objects And View Their Properties
* =============================================================================
*
* Component : UF_QRY03
* Type : Reusable Component
* Ancestor : VF_AC010 (Command Handler)
*
* PLEASE NOTE: This UF_ (User Framework) component is the shipped version. You
* may choose to modify it. You should do this by copying the source
* code of this component into your own component and then change
* the copied version. This will prevent the accidental loss of your
* changes if you upgrade your Visual LANSA framework version. Refer
* to the end of this component for more details about making your
* own version of this component.
*
* This is example code only - No warranty is expressed or implied.
* Neither this program, nor any derivative of it, should be ever be used in
* production or end-user environments.
*
* =============================================================================
*
* This demonstrates how to listen for RAMP objects and view their properties
* =============================================================================
Function Options(*DIRECT)
Begin_Com Role(*EXTENDS #VF_AC010) Height(336) Layoutmanager(#ATLM_2) Width(552)
* ================================================================================
* Simple Field and Group Definitions
* ================================================================================
* ================================================================================
* Component definitions
* ================================================================================
* Body and Button arrangement panels
Define_Com Class(#PRIM_PANL) Name(#BUTTON_PANEL) Displayposition(2) Height(311) Layoutmanager(#BUTTON_FLOW) Left(464) Parent(#COM_OWNER) Tabposition(2) Tabstop(False) Top(25) Width(88)
Define_Com Class(#PRIM_PANL) Name(#BODY_HEAD) Displayposition(1) Height(311) Layoutmanager(#ATLM_1) Left(0) Parent(#COM_OWNER) Tabposition(1) Tabstop(False) Top(25) Verticalscroll(True) Width(464)
* Attachment and flow layout managers
Define_Com Class(#PRIM_ATLM) Name(#MAIN_LAYOUT)
Define_Com Class(#PRIM_ATLI) Name(#BUTTON_ATTACH) Attachment(Right) Manage(#BUTTON_PANEL) Parent(#MAIN_LAYOUT)
Define_Com Class(#PRIM_FWLM) Name(#BUTTON_FLOW) Direction(TopToBottom) Flowoperation(Center) Marginbottom(4) Marginleft(4) Marginright(4) Margintop(4) Spacing(4) Spacingitems(4)
Define_Com Class(#PRIM_ATLI) Name(#BODY_ATTACH) Attachment(Center) Manage(#BODY_HEAD) Parent(#MAIN_LAYOUT)
* The report button
Define_Com Class(#PRIM_PHBN) Name(#PHBN_REPORT) Buttondefault(True) Caption('Report') Displayposition(1) Left(4) Parent(#BUTTON_PANEL) Tabposition(1) Top(4)
Define_Com Class(#PRIM_FWLI) Name(#FWLI_SAVE_BUTTON) Manage(#PHBN_REPORT) Parent(#BUTTON_FLOW)
* The Traverse component
Define_Com Class(#UF_TRVRS) Name(#UF_TRVRS)
* The Output List
Define_Com Class(#PRIM_GRID) Name(#LTVW_1) Displayposition(1) Height(142) Left(2) Parent(#BODY_HEAD) Rowresize(True) Showselection(True) Showsortarrow(True) Tabposition(1) Top(2) Width(460)
Define_Com Class(#PRIM_GDCL) Name(#LVCL_4) Displayposition(1) Parent(#LTVW_1) Source(#DF_ELTXTL) Width(100) Widthtype(Remainder)
Define_Com Class(#PRIM_ATLM) Name(#ATLM_1) Marginbottom(2) Marginleft(2) Marginright(2) Margintop(2)
Define_Com Class(#PRIM_ATLI) Name(#ATLI_1) Attachment(Center) Parent(#ATLM_1)
Define_Com Class(#PRIM_ATLM) Name(#ATLM_2)
Define_Com Class(#PRIM_ATLI) Name(#ATLI_2) Attachment(Center) Manage(#BODY_HEAD) Parent(#ATLM_2)
Define_Com Class(#PRIM_ATLI) Name(#ATLI_3) Attachment(Right) Manage(#BUTTON_PANEL) Parent(#ATLM_2)
Define_Com Class(#PRIM_ATLI) Name(#ATLI_4) Attachment(Center) Manage(#LTVW_1) Parent(#ATLM_1)
* The Script List
Define_Com Class(#PRIM_MEMO) Name(#SCRIPT) Componentversion(1) Currentline(1) Displayposition(2) Height(165) Left(2) Maximumlinelength(200) Parent(#BODY_HEAD) Showselectionhilight(False) Tabposition(2) Top(144) Width(460)
Define_Com Class(#PRIM_ATLI) Name(#ATLI_5) Attachment(Bottom) Manage(#SCRIPT) Parent(#ATLM_1)
Define_Com Class(#PRIM_MECL) Name(#MECL_1) Columnrole(Data) Displayposition(1) Parent(#SCRIPT) Source(#VF_ELTXTB)
Define_Com Class(#PRIM_GDCL) Name(#GDCL_1) Caption('Member ID') Captiontype(Caption) Displayposition(2) Parent(#LTVW_1) Source(#VF_ELIDN)
* Show Script push button
Define_Com Class(#PRIM_PHBN) Name(#PHBN_1) Displayposition(3) Left(0) Parent(#COM_OWNER) Tabposition(3) Top(0) Width(552)
Define_Com Class(#PRIM_ATLI) Name(#ATLI_6) Attachment(Top) Manage(#PHBN_1) Parent(#ATLM_2)
Define_Com Class(#PRIM_PHBN) Name(#PHBN_SCRIPT) Caption('Show Script') Displayposition(2) Left(4) Parent(#BUTTON_PANEL) Tabposition(2) Top(33)
Define_Com Class(#PRIM_FWLI) Name(#FWLI_1) Manage(#PHBN_SCRIPT) Parent(#BUTTON_FLOW)
Define_Com Class(#PRIM_PHBN) Name(#PHBN_FKEY) Caption('Show FKeys') Displayposition(3) Left(4) Parent(#BUTTON_PANEL) Tabposition(3) Top(62)
Define_Com Class(#PRIM_FWLI) Name(#FWLI_2) Manage(#PHBN_FKEY) Parent(#BUTTON_FLOW)
* Framework - class #VF_FP001 #TempVF_FP001 Reference(*Dynamic)
* Application - class #VF_FP002 #TempVF_FP002 Reference(*Dynamic)
* Business Object - class #VF_FP003 #TempVF_FP003 Reference(*Dynamic)
* Command - class #VF_FPM09 #TempVF_FPM09 Reference(*Dynamic)
* Command Usage - class #VF_FPM10 #TempVF_FPM10 Reference(*Dynamic)
* Filter - class #VF_FPM14 #TempVF_FPM14 Reference(*Dynamic)
* ================================================================================
* Events Definitions
* ================================================================================
* ================================================================================
* Property Definitions
* ================================================================================
* ================================================================================
* Method Definitions
* ================================================================================
* --------------------------------------------------------------------------------
* Handle Command Execution
* --------------------------------------------------------------------------------
Mthroutine Name(uExecute) Options(*REDEFINE)
* The return code field and testing condition
Define #Ret_Code reffld(#IO$STS)
Def_cond Name(*RetOkay) Cond('#Ret_Code = OK')
* Do any execution logic defined in the ancestor
Invoke #Com_Ancestor.uExecute
Endroutine
* ================================================================================
* Subroutines
* ================================================================================
* ================================================================================
* Event Handlers
* ================================================================================
* --------------------------------------------------------------------------------
* Handle the save button
* --------------------------------------------------------------------------------
EVTROUTINE HANDLING(#PHBN_REPORT.Click)
* Tell the Traverse reusable part to read through the entire system in no particular order
* This program listens for the signals for each new object,
clr_list #LTVW_1
invoke #UF_TRVRS.uTraverseFramework
ENDROUTINE
* Listen for the RAMP Container
EVTROUTINE HANDLING(#UF_TRVRS.RAMPContainer) Reference(#TempVF_FP025)
* Output generic details
Invoke #Com_Owner.uOutputGeneric uLevel(1) uType('RAMP Session') uObject(#TempVF_FP025)
* For more details of the RAMP Session object, click on #TempVF_FP025 above and press F2, and look at the properties of class VF_FP025
add_entry #LTVW_1
* Store a reference to the object against the list line
Set Com(#ltvw_1.currentitem) Relatedreference(#TempVF_FP025)
ENDROUTINE
* Listen for a RAMP Session
EVTROUTINE HANDLING(#UF_TRVRS.RAMPSession) Reference(#TempVF_FP026)
* Output generic details
Invoke #Com_Owner.uOutputGeneric uLevel(1) uType('RAMP Group') uObject(#TempVF_FP026)
* For more details of the RAMP Group object, click on #TempVF_FP026 above and press F2, and look at the properties of class VF_FP026
add_entry #LTVW_1
* Store a reference to the object against the list line
Set Com(#ltvw_1.currentitem) Relatedreference(#TempVF_FP026)
ENDROUTINE
* Listen for a RAMP Destination
EVTROUTINE HANDLING(#UF_TRVRS.RAMPDestination) Reference(#TempVF_FPM27)
* Output generic details
Invoke #Com_Owner.uOutputGeneric uLevel(1) uType('RAMP Destination')
* Specific details
* For more details of the RAMP Destination object, click on #TempVF_FPM27 above and press F2, and look at the properties of class VF_FPM27
* Store the member Identifier for this destination
Change #VF_ELIDN #TempVF_FPM27.CurrentMemberGUID
#DF_ELTXTL := 'Destination ' + #TempVF_FPM27.uCaption + ' Technical Caption ' + #TempVF_FPM27.uTechnicalCaption + ' Navigate Script ID ' + #TempVF_FPM27.uNavigateScriptIDN + ' Return Script ID ' + #TempVF_FPM27.uReturnScriptIDN
add_entry #LTVW_1
* Store a reference to the object against the list line
Set Com(#ltvw_1.currentitem) Relatedreference(#TempVF_FPM27)
ENDROUTINE
* Listen for a RAMP Junction
EVTROUTINE HANDLING(#UF_TRVRS.RAMPJunction) Reference(#TempVF_FPM28)
* Output generic details
Invoke #Com_Owner.uOutputGeneric uLevel(1) uType('RAMP Destination')
* Specific details
* For more details of the RAMP Destination object, click on #TempVF_FPM28 above and press F2, and look at the properties of class VF_FPM28
* Store the member Identifier for this junction
Change #VF_ELIDN #TempVF_FPM28.CurrentMemberGUID
#DF_ELTXTL := 'Junction ' + #TempVF_FPM28.uCaption + ' Technical Caption ' + #TempVF_FPM28.uTechnicalCaption + ' Script ID ' + #TempVF_FPM28.uIdentifier + ' Screen Name ' + #TempVF_FPM28.uScreenName
add_entry #LTVW_1
ENDROUTINE
* Listen for a RAMP Special
EVTROUTINE HANDLING(#UF_TRVRS.RAMPSpecial) Reference(#TempVF_FPM29)
* Output generic details
Invoke #Com_Owner.uOutputGeneric uLevel(1) uType('RAMP Special')
* Specific details
* For more details of the RAMP Destination object, click on #TempVF_FPM29 above and press F2, and look at the properties of class VF_FPM29
* Store the member Identifier for this special
Change #VF_ELIDN #TempVF_FPM29.CurrentMemberGUID
#DF_ELTXTL := 'Special ' + #TempVF_FPM29.uCaption + ' Technical Caption ' + #TempVF_FPM29.uTechnicalCaption
add_entry #LTVW_1
ENDROUTINE
* Listen for a RAMP Script
EVTROUTINE HANDLING(#UF_TRVRS.RAMPScript) Reference(#TempVF_FPM30)
* Output generic details
Invoke #Com_Owner.uOutputGeneric uLevel(1) uType('RAMP Script')
* Specific details
* For more details of the RAMP Destination object, click on #TempVF_FPM30 above and press F2, and look at the properties of class VF_FPM30
* Store the member Identifier for this script
Change #VF_ELIDN #TempVF_FPM30.CurrentMemberGUID
#DF_ELTXTL := 'Script ' + #TempVF_FPM30.uCaption + ' Technical Caption ' + #TempVF_FPM30.uTechnicalCaption
add_entry #LTVW_1
* Store a reference to the object against the list line
Set Com(#ltvw_1.currentitem) Relatedreference(#TempVF_FPM30)
ENDROUTINE
* Output a line of description of the object
mthroutine uOutputGeneric
define_map *input #std_num #uLevel
define_map *input #df_elmsg #uType
Define_Map For(*input) Class(#vf_fp001) Name(#VisParent1) Mandatory(*NULL) Pass(*BY_REFERENCE)
Define_Map For(*input) Class(#vf_fp002) Name(#VisParent2) Mandatory(*NULL) Pass(*BY_REFERENCE)
Define_Map For(*input) Class(#vf_fp003) Name(#VisParent3) Mandatory(*NULL) Pass(*BY_REFERENCE)
Define_Map For(*input) Class(#vf_ac001) Name(#uObject) Mandatory(*NULL) Pass(*BY_REFERENCE)
Change #vf_elidn *blanks
* Object details
if_ref #uObject is_not(*null)
#DF_ELTXTL := #uType + ' ' + #uObject.uCaption + ' ' + #uObject.uIdentifier + ' ' + #uObject.uUserObjectType
endif
endroutine
* Button press - Show the lines of script for a script
EVTROUTINE HANDLING(#PHBN_SCRIPT.Click)
Define_Com Class(#VF_FPM30) Name(#TempVF_FPM30) Reference(*DYNAMIC)
selectlist #LTVW_1
if #LTVW_1.CurrentItem.Selected
If_Ref Com(#LTVW_1.CurrentItem.RelatedReference) Is(*INSTANCE_OF #VF_FPM30)
set_ref #TempVF_FPM30 (*Dynamic #LTVW_1.CurrentItem.RelatedReference)
invoke #Com_Owner.uShowScript uScriptManager(#TempVF_FPM30) UseScriptGUID(#VF_ELIDN)
endif
endif
endselect
ENDROUTINE
* Show a script
mthroutine uShowScript
Define_Map For(*input) Class(#VF_FPM30) Name(#uScriptManager) Pass(*BY_REFERENCE)
define_map *input #VF_ELMBRi #UseScriptGUID
define #First reffld(#vf_elbool)
Define_Com Class(#vf_elindx) Name(#LoopLimit)
clr_list #Script
* When working with any VF_FPM objects you have to set the CurrentMemberGUID before reading or writing to them.
* This is stored in field #VF_ELIDN in list #LTVW_1
* set #VF_FPM30 to the correct member
#uScriptManager.CurrentMemberGUID := #UseScriptGUID
Change Field(#LoopLimit) To(#uScriptManager.uSLMax)
Change Field(#VF_ELLICT) To(0)
Change #First TRUE
Begin_Loop To(#LoopLimit)
* Read each script line into field #vf_eltxtb
Invoke Method(#uSystem.uRestorePropertySet) Ucursor('0') Ufirst(#First) Uname(uSL) Ualphavalue(#vf_eltxtb) Udefaultalphavalue('*NONE') Ac0x1object(#uScriptManager.SetMember( #UseScriptGUID ))
Add_Entry To_List(#SCRIPT)
Change #First FALSE
End_Loop
endroutine
* Button press - Show the function keys for a destination
EVTROUTINE HANDLING(#PHBN_FKEY.Click)
Define_Com Class(#VF_FPM27) Name(#TempVF_FPM27) Reference(*DYNAMIC)
selectlist #LTVW_1
if #LTVW_1.CurrentItem.Selected
If_Ref Com(#LTVW_1.CurrentItem.RelatedReference) Is(*INSTANCE_OF #VF_FPM27)
set_ref #TempVF_FPM27 (*Dynamic #LTVW_1.CurrentItem.RelatedReference)
invoke #Com_Owner.uShowFKeys uDestinationManager(#TempVF_FPM27) UseDestGUID(#VF_ELIDN)
endif
endif
endselect
ENDROUTINE
* Show the function keys for a destination
Mthroutine Name(uShowFkeys)
Define_Map For(*input) Class(#VF_FPM27) Name(#uDestinationManager) Pass(*BY_REFERENCE)
define_map *input #VF_ELMBRi #UseDestGUID
Define_Com Class(#vf_elindx) Name(#LoopLimit)
Define_Com Class(#vf_elindx) Name(#LoopIndex)
Define_Com Class(#vf_elindx) Name(#KeyTotal)
Clr_List Named(#SCRIPT)
* When working with any VF_FPM objects you have to set the CurrentMemberGUID before reading or writing to them.
* This is stored in field #VF_ELIDN in list #LTVW_1
Set_Ref Com(#uDestinationManager ) To(#uFramework.VF_FP027Manager)
#uDestinationManager.CurrentMemberGUID := #UseDestGUID
Change Field(#LoopLimit) To(#uDestinationManager.uKeyTotal)
* Load cherry function keys
Begin_Loop Using(#LoopIndex) To(#LoopLimit)
Change Field(#vf_elindx) To(#LoopIndex)
#vf_eltxtb := ' Caption: ' + #uDestinationManager.uKeyCaption<#LoopIndex>
#vf_eltxtb += ' , '
#vf_eltxtb += ' Enabled in Newlook: ' + #uDestinationManager.uKeyEnabledNL<#LoopIndex>
#vf_eltxtb += ' , '
#vf_eltxtb += ' Enabled in VLF: ' + #uDestinationManager.uKeyEnabledVLF<#LoopIndex>
#vf_eltxtb += ' , '
#vf_eltxtb += ' Key to Send: ' + #uDestinationManager.uKeytoSend<#LoopIndex>
Add_Entry To_List(#SCRIPT)
End_Loop
endroutine
End_Com