project BLF > class BApplicationProperty > method APIGetAppServerInformationV01
Description
Get appserver information.
Parameters
Internal usage
unused
program code (program3/bapplicationproperty.p)
empty temp-table tAppserverHotfixes.
<M-27 run APIGetAppServerInformation
(output dAppServerInformation (dAppServerInformation),
output viFcReturnSuper (oiReturnStatus)) in BApplicationProperty>
if viFcReturnSuper <> 0
then oiReturnStatus = viFcReturnSuper.
if viFcReturnSuper < 0
then return.
/* ==================================================================================== */
/* Search propath for hotfixes */
/* (fin code installed outside of qadfin.pl) */
/* ==================================================================================== */
/* we use appinfo/timestamp.r and we check all entries in the propath which are defined */
/* before the entry holding appinfo/timestamp.r */
/* ==================================================================================== */
assign vcpropath = replace (propath,chr(92),"/")
vcpath = search ("appinfo/timestamp.r").
if vcpath <> ?
then do:
assign vcpath = replace (vcpath,chr(92),"/").
if index (vcpath,".pl<<") = 0
then vcpath = substring (vcpath,1,length(vcpath,"character") - 20,"character").
else vcpath = substring (vcpath,1,index(vcpath,".pl<<") + 2,"character").
/* Keep only the folders which are defined befcre the standard place */
assign vcpropath = substring (vcpropath,1,index(vcpropath,vcpath) - 2,"character").
TRY: repeat transaction vipath = 1 to num-entries(vcpropath) on error undo, throw:
assign vcpath = entry (vipath,vcpropath).
<M-58 run GetFiles
(input vcpath + '/appinfo' (icFilePath),
input vipath (iiPropathEntryNum)) in BApplicationProperty>
<M-21 run GetFiles
(input vcpath + '/custprogram' (icFilePath),
input vipath (iiPropathEntryNum)) in BApplicationProperty>
<M-39 run GetFiles
(input vcpath + '/ins' (icFilePath),
input vipath (iiPropathEntryNum)) in BApplicationProperty>
<M-46 run GetFiles
(input vcpath + '/program' (icFilePath),
input vipath (iiPropathEntryNum)) in BApplicationProperty>
<M-10 run GetFiles
(input vcpath + '/program0' (icFilePath),
input vipath (iiPropathEntryNum)) in BApplicationProperty>
<M-97 run GetFiles
(input vcpath + '/program1' (icFilePath),
input vipath (iiPropathEntryNum)) in BApplicationProperty>
<M-54 run GetFiles
(input vcpath + '/program2' (icFilePath),
input vipath (iiPropathEntryNum)) in BApplicationProperty>
<M-79 run GetFiles
(input vcpath + '/program3' (icFilePath),
input vipath (iiPropathEntryNum)) in BApplicationProperty>
<M-71 run GetFiles
(input vcpath + '/program4' (icFilePath),
input vipath (iiPropathEntryNum)) in BApplicationProperty>
<M-48 run GetFiles
(input vcpath + '/program5' (icFilePath),
input vipath (iiPropathEntryNum)) in BApplicationProperty>
<M-30 run GetFiles
(input vcpath + '/program6' (icFilePath),
input vipath (iiPropathEntryNum)) in BApplicationProperty>
<M-13 run GetFiles
(input vcpath + '/program7' (icFilePath),
input vipath (iiPropathEntryNum)) in BApplicationProperty>
<M-34 run GetFiles
(input vcpath + '/program8' (icFilePath),
input vipath (iiPropathEntryNum)) in BApplicationProperty>
<M-67 run GetFiles
(input vcpath + '/program9' (icFilePath),
input vipath (iiPropathEntryNum)) in BApplicationProperty>
<M-29 run GetFiles
(input vcpath + '/query' (icFilePath),
input vipath (iiPropathEntryNum)) in BApplicationProperty>
<M-23 run GetFiles
(input vcpath + '/ref_int' (icFilePath),
input vipath (iiPropathEntryNum)) in BApplicationProperty>
file-info:file-name = vcpath + "/api".
if file-info:file-type begins "D"
then do:
input stream sapplinp from os-dir (vcpath + "/api").
repeat on error undo, throw:
import stream sapplinp vc1 vc2 vc3.
if vc3 = "D"
and not (vc1 = "." or vc1 = "..")
then do:
<M-98 run GetFiles
(input vc2 (icFilePath),
input vipath (iiPropathEntryNum)) in BApplicationProperty>
end.
end.
end.
finally:
input stream sapplinp close.
end finally.
end. /* TRY */
end.
Sample code: how to call this method through RPCRequestService (QXtend Inbound)
define temp-table ttContext no-undo
field propertyQualifier as character
field propertyName as character
field propertyValue as character
index entityContext is primary unique
propertyQualifier
propertyName
index propertyQualifier
propertyQualifier.
define dataset dsContext for ttContext.
define variable vhContextDS as handle no-undo.
define variable vhExceptionDS as handle no-undo.
define variable vhServer as handle no-undo.
define variable vhInputDS as handle no-undo.
define variable vhInputOutputDS as handle no-undo.
define variable vhOutputDS as handle no-undo.
define variable vhParameter as handle no-undo.
/* Create context */
create ttContext.
assign ttContext.propertyName = "programName"
ttContext.propertyValue = "BApplicationProperty".
create ttContext.
assign ttContext.propertyName = "methodName"
ttContext.propertyValue = "APIGetAppServerInformationV01".
create ttContext.
assign ttContext.propertyName = "applicationId"
ttContext.propertyValue = "fin".
create ttContext.
assign ttContext.propertyName = "entity"
ttContext.propertyValue = "1000".
create ttContext.
assign ttContext.propertyName = "userName"
ttContext.propertyValue = "mfg".
create ttContext.
assign ttContext.propertyName = "password"
ttContext.propertyValue = "".
/* Connect the AppServer */
create server vhServer.
vhServer:connect("-URL <appserver-url>").
if not vhServer:connected()
then do:
message "Could not connect AppServer" view-as alert-box error title "Error".
return.
end.
/* Run */
assign vhContextDS = dataset dsContext:handle.
run program/rpcrequestservice.p on vhServer
(input-output dataset-handle vhContextDS by-reference,
output dataset-handle vhExceptionDS,
input dataset-handle vhInputDS by-reference,
input-output dataset-handle vhInputOutputDS by-reference,
output dataset-handle vhOutputDS).
/* Handle output however you want, in this example, we dump it to xml */
if valid-handle(vhExceptionDS)
then vhExceptionDS:write-xml("file", "Exceptions.xml", true).
if valid-handle(vhOutputDS)
then vhOutputDS:write-xml("file", "Output.xml", true).
/* Cleanup */
vhServer:disconnect().
assign vhServer = ?.
if valid-handle(vhInputDS)
then delete object vhInputDS.
if valid-handle(vhOutputDS)
then delete object vhOutputDS.
if valid-handle(vhExceptionDS)
then delete object vhExceptionDS.