XOBVRM ;; mjk/alb - VistaLink Request Manager ; 07/27/2002 13:00
;;1.6;VistALink Security;**4**;May 08, 2009;Build 7
; ;Per VA Directive 6402, this routine should not be modified.
Q
;
; --------------------------------------------------------------------------------
; Request Manager
; --------------------------------------------------------------------------------
;
EN(XOBROOT,XOBDATA,XOBHDLR) ; -- main entry point for Request Manager
N XOBOK,XOBOPT
S XOBOK=0
;
; -- if 'current' request handler is not defined then parse xml global buffer
; Note: 'Current' request handler could be define already via proprietary format reader
I $G(XOBHDLR)="" S XOBOPT="" D EN^XOBVRMX(XOBROOT,.XOBOPT,.XOBDATA,.XOBHDLR)
;
; -- default single call processing if not specified by request handler
I $G(XOBDATA("MODE"),"single call")="single call" S XOBSTOP=1
;
; -- check if request handler info was successfully initialized / if not, throw exception
S XOBHDLR=+$G(XOBHDLR)
I '$G(XOBHDLR(XOBHDLR)) D G ENQ
. S XWBTIP=$$GETPEER^%ZOSV ; try get client IP for error trap. Use of GETPEER^%ZOSV: DBIA #4056
. D RMERR(184001,$G(XOBHDLR(XOBHDLR,"ERROR"),"Request Manager not defined"))
. S XOBOK=0
;
; -- do authentication check for message type?
I $G(XOBHDLR(XOBHDLR,"AUTHENTICATE")) D
. S XOBOK=$$LOGGEDON^XOBSCAV()
E D
. S XOBOK=1
;
; -- call request handler
I XOBOK X $G(XOBHDLR(XOBHDLR,"REQHDLR"))
;
ENQ ;
Q XOBOK
;
; ----------------------------------------------------------------------------------
; Request Manager Error Handler
; ----------------------------------------------------------------------------------
RMERR(XOBCODE,XOBMSG) ; -- send request error message
N XOBDAT,$ET,$ES
S XOBDAT("MESSAGE TYPE")=3
S XOBDAT("ERRORS",1,"FAULT STRING")="System Error"
S XOBDAT("ERRORS",1,"FAULT ACTOR")="Request Manager"
S XOBDAT("ERRORS",1,"CODE")=XOBCODE
S XOBDAT("ERRORS",1,"ERROR TYPE")="Request Manager"
S XOBDAT("ERRORS",1,"CDATA")=0
S XOBDAT("ERRORS",1,"MESSAGE",1)=$$EZBLD^DIALOG(XOBCODE,XOBMSG)
D ERROR^XOBVLIB(.XOBDAT)
;DO ^%ZTER
D APPERROR^%ZTER("VistALink Error "_XOBCODE) ;*4
Q
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HXOBVRM 2260 printed Dec 13, 2024@02:44:49 Page 2
XOBVRM ;; mjk/alb - VistaLink Request Manager ; 07/27/2002 13:00
+1 ;;1.6;VistALink Security;**4**;May 08, 2009;Build 7
+2 ; ;Per VA Directive 6402, this routine should not be modified.
+3 QUIT
+4 ;
+5 ; --------------------------------------------------------------------------------
+6 ; Request Manager
+7 ; --------------------------------------------------------------------------------
+8 ;
EN(XOBROOT,XOBDATA,XOBHDLR) ; -- main entry point for Request Manager
+1 NEW XOBOK,XOBOPT
+2 SET XOBOK=0
+3 ;
+4 ; -- if 'current' request handler is not defined then parse xml global buffer
+5 ; Note: 'Current' request handler could be define already via proprietary format reader
+6 IF $GET(XOBHDLR)=""
SET XOBOPT=""
DO EN^XOBVRMX(XOBROOT,.XOBOPT,.XOBDATA,.XOBHDLR)
+7 ;
+8 ; -- default single call processing if not specified by request handler
+9 IF $GET(XOBDATA("MODE"),"single call")="single call"
SET XOBSTOP=1
+10 ;
+11 ; -- check if request handler info was successfully initialized / if not, throw exception
+12 SET XOBHDLR=+$GET(XOBHDLR)
+13 IF '$GET(XOBHDLR(XOBHDLR))
Begin DoDot:1
+14 ; try get client IP for error trap. Use of GETPEER^%ZOSV: DBIA #4056
SET XWBTIP=$$GETPEER^%ZOSV
+15 DO RMERR(184001,$GET(XOBHDLR(XOBHDLR,"ERROR"),"Request Manager not defined"))
+16 SET XOBOK=0
End DoDot:1
GOTO ENQ
+17 ;
+18 ; -- do authentication check for message type?
+19 IF $GET(XOBHDLR(XOBHDLR,"AUTHENTICATE"))
Begin DoDot:1
+20 SET XOBOK=$$LOGGEDON^XOBSCAV()
End DoDot:1
+21 IF '$TEST
Begin DoDot:1
+22 SET XOBOK=1
End DoDot:1
+23 ;
+24 ; -- call request handler
+25 IF XOBOK
XECUTE $GET(XOBHDLR(XOBHDLR,"REQHDLR"))
+26 ;
ENQ ;
+1 QUIT XOBOK
+2 ;
+3 ; ----------------------------------------------------------------------------------
+4 ; Request Manager Error Handler
+5 ; ----------------------------------------------------------------------------------
RMERR(XOBCODE,XOBMSG) ; -- send request error message
+1 NEW XOBDAT,$ETRAP,$ESTACK
+2 SET XOBDAT("MESSAGE TYPE")=3
+3 SET XOBDAT("ERRORS",1,"FAULT STRING")="System Error"
+4 SET XOBDAT("ERRORS",1,"FAULT ACTOR")="Request Manager"
+5 SET XOBDAT("ERRORS",1,"CODE")=XOBCODE
+6 SET XOBDAT("ERRORS",1,"ERROR TYPE")="Request Manager"
+7 SET XOBDAT("ERRORS",1,"CDATA")=0
+8 SET XOBDAT("ERRORS",1,"MESSAGE",1)=$$EZBLD^DIALOG(XOBCODE,XOBMSG)
+9 DO ERROR^XOBVLIB(.XOBDAT)
+10 ;DO ^%ZTER
+11 ;*4
DO APPERROR^%ZTER("VistALink Error "_XOBCODE)
+12 QUIT
+13 ;