WAM095. Appendix B
Sample RDMLX for iiiDspEmpDocs, when not using DXDOCS file.
This WAM to be run locally
Begin_Com Role(*EXTENDS #PRIM_WAM) Layoutweblet('iiilay01')
Web_Map For(*BOTH) Fields((#stdrentry *hidden))
Group_By Name(#empdata) Fields(#EMPNO #SURNAME #GIVENAME #ADDRESS1 #ADDRESS2 #ADDRESS3 #POSTCODE #deptment #section)
Def_List Name(#doclist) Fields(#df_elfnam) Type(*Working)
Def_List Name(#mydocs) Fields(#std_textl) Type(*working)
Webroutine Name(Begin)
Web_Map For(*both) Fields(#empno)
Web_Map For(*output) Fields((#fullname *out) (#address1 *out) (#address2 *out) (#address3 *out) (#postcode *out) (#deptment *out) (#section *out) #doclist)
Define Field(#retcode) Reffld(#io$sts)
If (#stdrentry = S)
Clr_List Named(#doclist)
Fetch Fields(#empdata) From_File(pslmst) With_Key(#empno)
#fullname := #givename + ', ' + #surname
Use Builtin(transform_file) With_Args(#mydocs 'c:\Program Files (x86)\LANSA13\WAM095_DOCS.txt') To_Get(#retcode)
Selectlist Named(#mydocs)
#df_elfnam := #std_textl.trim
Add_Entry To_List(#doclist)
Endselect
Endif
Endroutine
Webroutine Name(SEND_DOCUMENT) Response(#HTTPR) Desc('Sample Document')
Web_Map For(*input) Fields(#DF_ELFNAM)
#HTTPR.ContentFile := "C:\Program Files (x86)\LANSA13\" + #DF_ELFNAM
Endroutine
End_Com
This WAM to be run on the IBM i
Begin_Com Role(*EXTENDS #PRIM_WAM) Layoutweblet('iiilay01')
Web_Map For(*BOTH) Fields((#stdrentry *hidden))
Group_By Name(#empdata) Fields(#EMPNO #SURNAME #GIVENAME #ADDRESS1 #ADDRESS2 #ADDRESS3 #POSTCODE #deptment #section)
Def_List Name(#doclist) Fields(#df_elfnam) Type(*Working)
Def_List Name(#mydocs) Fields(#std_textl) Type(*working)
Webroutine Name(Begin)
Web_Map For(*both) Fields(#empno)
Web_Map For(*output) Fields((#fullname *out) (#address1 *out) (#address2 *out) (#address3 *out) (#postcode *out) (#deptment *out) (#section *out) #doclist)
Define Field(#retcode) Reffld(#io$sts)
If (#stdrentry = S)
Clr_List Named(#doclist)
Fetch Fields(#empdata) From_File(pslmst) With_Key(#empno)
#fullname := #givename + ', ' + #surname
Use Builtin(transform_file) With_Args(#mydocs '/LANSA_d13pgmlib/MYDOCS.txt') To_Get(#retcode)
Selectlist Named(#mydocs)
#df_elfnam := #std_textl.trim
Add_Entry To_List(#doclist)
Endselect
Endif
Endroutine
Webroutine Name(SEND_DOCUMENT) Response(#HTTPR) Desc('Sample Document')
Web_Map For(*input) Fields(#DF_ELFNAM)
#HTTPR.ContentFile := "/LANSA_d13pgmlib/webserver/images/" + #DF_ELFNAM
Endroutine
End_Com