1 | XWBRMX ;OIFO-Oakland/REM - M2M Broker Server Request Mgr ;05/17/2002 17:41
|
---|
2 | ;;1.1;RPC BROKER;**28**;Mar 28, 1997
|
---|
3 | ;
|
---|
4 | QUIT
|
---|
5 | ;----------------------------------------------------------------------
|
---|
6 | ;
|
---|
7 | ; Request Manager -Parse XML Requests using SAX interface
|
---|
8 | ;
|
---|
9 | ;----------------------------------------------------------------------
|
---|
10 | ;
|
---|
11 | EN(DOC,XWBOPT,XWBDATA) ; -- Parse XML uses SAX parser
|
---|
12 | N XWBCBK,XWBINVAL
|
---|
13 | SET XWBINVAL="#UNKNOWN#"
|
---|
14 | ;
|
---|
15 | SET XWBDATA("DUZ")=XWBINVAL ;**M2M don't need duz
|
---|
16 | SET XWBDATA("SECTOKEN")=XWBINVAL
|
---|
17 | DO SET(.XWBCBK)
|
---|
18 | DO EN^MXMLPRSE(DOC,.XWBCBK,.XWBOPT)
|
---|
19 | ;
|
---|
20 | ;;D ^%ZTER
|
---|
21 | ;
|
---|
22 | ENQ Q
|
---|
23 | ;
|
---|
24 | SET(CBK) ; -- set the event interface entry points
|
---|
25 | SET XWBCBK("STARTELEMENT")="ELEST^XWBRMX"
|
---|
26 | SET XWBCBK("ENDELEMENT")="ELEND^XWBRMX"
|
---|
27 | SET XWBCBK("CHARACTERS")="CHR^XWBRMX"
|
---|
28 | QUIT
|
---|
29 | ;
|
---|
30 | ESC(X) ; -- convert special characters to \x format
|
---|
31 | Q X
|
---|
32 | ;
|
---|
33 | N C,Y,Z
|
---|
34 | F Z=1:1 S C=$E(X,Z) Q:C="" D
|
---|
35 | .S Y=$TR(C,$C(9,10,13,92),"tnc")
|
---|
36 | .S:C'=Y $E(X,Z)="" ;$S(Y="":"\\",1:"\"_Y),Z=Z+1
|
---|
37 | Q X
|
---|
38 | ;
|
---|
39 | ELEST(ELE,ATR) ; -- element start
|
---|
40 | IF ELE="vistalink",$G(ATR("type"))="Gov.VA.Med.RPC.Request" DO
|
---|
41 | . SET XWBDATA("APP")="RPC"
|
---|
42 | . ;SET XWBDATA("MODE")=$G(ATR("mode"),"singleton") ;Comment out for M2M
|
---|
43 | . SET XWBDATA("MODE")=$G(ATR("mode"),"RPCBroker") ;M2M change to RPCBroker
|
---|
44 | ;
|
---|
45 | IF ELE="vistalink",$G(ATR("type"))="Gov.VA.Med.Foundations.CloseSocketRequest" DO QUIT
|
---|
46 | . SET XWBDATA("APP")="CLOSE"
|
---|
47 | . SET XWBDATA("MODE")=$G(ATR("mode"),"single call")
|
---|
48 | ;
|
---|
49 | IF ELE="session" SET XWBSESS=1 QUIT
|
---|
50 | ; -- set session vars here so apps can use during xml parsing
|
---|
51 | ;
|
---|
52 | ;*M2M - check for RPCBroker
|
---|
53 | IF $G(XWBSESS) DO QUIT
|
---|
54 | .IF ELE="duz" SET (DUZ,XWBDATA("DUZ"))=$G(ATR("value")) IF +DUZ=0 SET (DUZ,XWBDATA("DUZ"))=XWBINVAL QUIT
|
---|
55 | . IF $G(XWBSEC) DO QUIT
|
---|
56 | . . IF ELE="token" SET XWBDATA("SECTOKEN")=$G(ATR("value")) IF XWBDATA("SECTOKEN")="" SET XWBDATA("SECTOKEN")=XWBINVAL QUIT
|
---|
57 | . IF ELE="security" SET XWBSEC=1 QUIT
|
---|
58 | ;
|
---|
59 | ; -- // TODO: make dynamic off RPC app config
|
---|
60 | IF $GET(XWBDATA("APP"))="RPC" DO ELEST^XWBRPC(.ELE,.ATR)
|
---|
61 | Q
|
---|
62 | ;
|
---|
63 | ELEND(ELE) ; -- element end
|
---|
64 | IF ELE="session" KILL XWBSESS QUIT
|
---|
65 | IF $G(XWBSESS) DO QUIT
|
---|
66 | . IF ELE="security" KILL XWBSEC
|
---|
67 | ;
|
---|
68 | ;
|
---|
69 | ; -- // TODO: make dynamic off RPC app config
|
---|
70 | IF $G(XWBDATA("APP"))="RPC" DO ELEND^XWBRPC(.ELE)
|
---|
71 | Q
|
---|
72 | ;
|
---|
73 | CHR(TXT) ;
|
---|
74 | ; -- // TODO: make dynamic off RPC app config
|
---|
75 | IF $G(XWBDATA("APP"))="RPC" DO CHR^XWBRPC(.TXT)
|
---|
76 | Q
|
---|
77 | ;
|
---|