XOBVPOST ;; ld,mjk/alb - VistaLink Post-Init ; 07/27/2002 13:00
;;1.5;VistALink;;Sep 09, 2005
;;Foundations Toolbox Release v1.5 [Build: 1.5.0.026]
;
QUIT
;
EN ; -- add post-init code here
NEW XOBCFG,XOBOS
SET XOBOS=$$GETOS^XOBVTCP()
SET XOBCFG=0
;
; -- add config if Cache NT
IF XOBOS="OpenM-NT" SET XOBCFG=$$CFG()
;
; -- add params entry
DO PARMS(XOBCFG)
;
; -- add STARTUP task if OpenM-NT and on Windows
IF XOBOS="OpenM-NT",$$SYSOS^XOBVLIB(XOBOS)="NT" DO SCHEDOPT
;
; -- add XOBVTESTER,APPLICATION PROXY user if not present
DO ADDPROXY("XOBVTESTER,APPLICATION PROXY")
;
QUIT
;
;
CFG() ; -- add default config if not pressent
NEW DIC,X,Y,XOBDA,XOBNEW
;
; -- DEFAULT configuration --
SET DIC="^XOB(18.03,"
SET DIC(0)="LX"
SET X="DEFAULT"
DO ^DIC
; -- quit if lookup failed
IF Y=-1 GOTO CFGQ
;
SET XOBDA=+Y
SET XOBNEW=$PIECE(Y,U,3)
;
; -- add default port to multiple
IF XOBNEW,'$$PORTS(XOBDA) GOTO CFGQ
;
CFGQ ;
QUIT +$GET(XOBDA)
;
;
PORTS(XOBDA) ; -- add 8000 port
NEW XOBOK,XOBNEW,DIC,DIE,DR,X,DA,Y
;
; -- set oth of multiple is needed
IF $DATA(^XOB(18.03,1,"PORTS",0))=0 SET ^XOB(18.03,1,"PORTS",0)="^18.031^^"
;
SET DA(1)=XOBDA
SET DIC="^XOB(18.03,"_XOBDA_",""PORTS"","
SET DIC(0)="LX"
SET X=8000
DO ^DIC
;
; -- quit if lookup failed
IF Y=-1 SET XOBOK=0 GOTO PORTSQ
SET XOBNEW=$PIECE(Y,U,3)
;
; -- if multiple entry is new, set port to NOT startup when config is started
; (site should change to startup explicitly)
IF XOBNEW DO
. SET DA(1)=XOBDA
. SET DA=+Y
. SET DR=".02////0"
. SET DIE="^XOB(18.03,"_XOBDA_",""PORTS"","
. DO ^DIE
;
SET XOBOK=1
PORTSQ ;
QUIT XOBOK
;
;
PARMS(XOBCFG) ; -- add parameter entry
NEW DIC,X,Y,DIE,DA,DR,XOBBOX,XOBDA,XOBMULI,XOBNEW
;
; -- box-pair name, no ien
SET XOBBOX=$PIECE($$GETENV^XOBVTCP(),U,4)
;
; -- Top-Level Parameters --
SET DIC="^XOB(18.01,",DIC(0)="LXZ",X=$$DOMAIN() DO ^DIC
;
; -- quit if lookup failed or if already exists
IF Y=-1 GOTO PARMSQ
;
SET XOBDA=+Y
SET XOBNEW=0
IF $PIECE(Y(0),U,2)="",$PIECE(Y(0),U,3)="" SET XOBNEW=1
;
; -- set basic parameters (HEARTBEAT RATE and LATENCY DELTA)
IF XOBNEW DO
. SET DA=XOBDA
. SET DR=".02////180;.03////180"
. SET DIE="^XOB(18.01,"
. DO ^DIE
;
; -- Listeners Multiple --
;
; -- quit if no config passed in (ie. not Cache NT)
IF '$GET(XOBCFG) GOTO PARMSQ
;
; -- set oth of multiple is needed
IF $DATA(^XOB(18.01,1,"CONFIG",0))=0 SET ^XOB(18.01,1,"CONFIG",0)="^18.012P^^"
;
SET DA(1)=XOBDA
SET DIC="^XOB(18.01,"_XOBDA_",""CONFIG"","
SET DIC(0)="LX"
SET X=XOBBOX
DO ^DIC
;
; -- quit if lookup failed or if already exists
IF Y=-1 GOTO PARMSQ
;
SET XOBMULI=+Y
SET XOBNEW=$PIECE(Y,U,3)
;
; -- set listener config default
IF XOBNEW DO
. SET DA(1)=XOBDA
. SET DA=XOBMULI
. SET DR=".02////"_XOBCFG
. SET DIE="^XOB(18.01,"_XOBDA_",""CONFIG"","
. DO ^DIE
;
PARMSQ ;
QUIT
;
;
DOMAIN() ; -- get account's domain entry
;
QUIT $$KSP^XUPARAM("WHERE")
;
;
SCHEDOPT ;-- Schedule XOBV LISTENER STARTUP option in TaskMan
;
; This procedure will schedule the XOBV LISTENER STARTUP option
; in the OPTION SCHEDULING file (#19.2).
;
NEW XOBMSG,XOBOIEN,XOBSIEN
;
;-- XOBOIEN = IEN (OPTION file), XOBSIEN = IEN (OPTION SCHEDULING file)
SET (XOBOIEN,XOBSIEN)=0
;
DO BMES^XPDUTL(">>> Scheduling the XOBV LISTENER STARTUP option...")
;
;-- Check that option was added to OPTION file #19 during installation
SET XOBOIEN=$$FIND1^DIC(19,"","BX","XOBV LISTENER STARTUP","","","")
;
;-- Error XOBMSG and quit if option was not added
IF 'XOBOIEN DO QUIT
. SET XOBMSG(1)=""
. SET XOBMSG(2)=">>> Error: Option XOBV LISTENER STARTUP was not created in the OPTION (#19)"
. SET XOBMSG(3)=" file during the KIDS installation. Please reinstall."
. DO BMES^XPDUTL(.XOBMSG)
;
;-- Check if option was already scheduled
SET XOBSIEN=$$CHKOPT(XOBOIEN)
;
;-- Display option and quit if option was previously added
IF XOBSIEN DO QUIT
. DO BMES^XPDUTL(">>> The XOBV LISTENER STARTUP option has previously been scheduled:")
. DO DSPLYOP(XOBSIEN)
;
;-- Schedule the option
SET XOBSIEN=$$FILEOPT(XOBSIEN,XOBOIEN,,,,"S")
IF XOBSIEN DO
. DO BMES^XPDUTL(">>> The XOBV LISTENER STARTUP option has been scheduled as follows:")
. DO DSPLYOP(XOBSIEN)
ELSE DO
. SET XOBMSG(1)=">>> Error: There was an error scheduling the XOBV LISTENER STARTUP option."
. SET XOBMSG(2)=" Please schedule this option using 'Schedule/Unschedule Options'"
. SET XOBMSG(3)=" in the Taskman Management menu."
. DO BMES^XPDUTL(.XOBMSG)
QUIT
;
;
CHKOPT(IEN) ;-- Check if option is already scheduled
;
; Input:
; IEN - IEN of option in OPTION file (#19)
;
; Output:
; XOBSIEN - IEN of option in OPTION SCHEDULING file (#19.2) or zero if it does not exist
;
NEW X,X1,X2,XOBARY,XOBI,XOBIEN2
SET (X1,X2,XOBI,XOBIEN2)=0
DO FIND^DIC(19.2,"","@;.01I;9I","","XOBV LISTENER STARTUP","*","B","","","XOBARY")
SET X=+$PIECE($GET(XOBARY("DILIST",0)),"^")
FOR SET XOBI=$ORDER(XOBARY("DILIST","ID",X,XOBI)) QUIT:'XOBI DO
. IF XOBI=.01,$GET(XOBARY("DILIST","ID",X,XOBI))=IEN SET X1=1
. IF XOBI=9,$GET(XOBARY("DILIST","ID",X,XOBI))["S" SET X2=1
. IF X1,X2 SET XOBIEN2=+$GET(XOBARY("DILIST",2,X))
QUIT XOBIEN2
;
;
DSPLYOP(IEN) ;-- Display fields from OPTION SCHEDULING file (#19.2)
;
; Input:
; IEN - IEN of record in file #19.2
;
; Output:
; Display of fields in record
;
QUIT:'$GET(IEN)
NEW DA,DIC,DIQ
SET DIC="^DIC(19.2,",DA=IEN,DIQ(0)="CAR"
DO MES^XPDUTL("")
DO EN^DIQ
DO BMES^XPDUTL("")
QUIT
;
;
FILEOPT(XOBIEN,XOBOPT,XOBQUE,XOBDEV,XOBRSCH,XOBSPARM) ;-- Schedule the option
;
;-- File a new record in file #19.2 or edit existing
;
; Input:
; XOBIEN - IEN from record in file #19.2 if it exists
; XOBOPT - IEN of option (file #19); (required)
; XOBQUE - Queued to run at what time; (optional)
; XOBDEV - Device for queued job output; (optional)
; XOBRSCH - Rescheduling frequency; (optional)
; XOBSPARM - Special queueing; (optional)
;
; Output:
; Function Value - Returns IEN of record on success, 0 on failure
;
NEW XOBFDA,XOBFDAI,XOBERR,XOBIENS
;
SET XOBIEN=+$GET(XOBIEN)
;
;-- If record doesn't already exist, create new
IF XOBIEN SET XOBIENS=XOBIEN_","
ELSE SET XOBIENS="+1,"
;
;-- Set up array with field values
SET XOBFDA(19.2,XOBIENS,.01)=$GET(XOBOPT)
SET XOBFDA(19.2,XOBIENS,2)=$GET(XOBQUE)
SET XOBFDA(19.2,XOBIENS,3)=$GET(XOBDEV)
SET XOBFDA(19.2,XOBIENS,6)=$GET(XOBRSCH)
SET XOBFDA(19.2,XOBIENS,9)=$GET(XOBSPARM)
;
IF XOBIEN DO
. DO FILE^DIE("","XOBFDA","XOBERR")
. IF $DATA(XOBERR) SET XOBIEN=0
ELSE DO
. DO UPDATE^DIE("","XOBFDA","XOBFDAI","XOBERR")
. IF '$DATA(XOBERR) SET XOBIEN=$GET(XOBFDAI(1))
;
QUIT $SELECT($GET(XOBIEN)>0:XOBIEN,1:0)
;
ADDPROXY(XOBANAME) ; add application proxy if not present
; depends on XU*8*361
NEW XOBID,XOBMSG,XOBSUBER,XOBSUBTX,XOBLINE
;
; if already present don't add
QUIT:(+$$APFIND^XUSAP(XOBANAME))>0
;
SET XOBID=$$CREATE^XUSAP(XOBANAME,"","XOBV VISTALINK TESTER")
IF (+XOBID)>0 DO
. SET XOBMSG(1)=" Added new Kernel Application Proxy User '"_XOBANAME_"'."
. SET XOBMSG(2)=" ::This application proxy user account is used in the VistALink sample web"
. SET XOBMSG(3)=" ::application, to demonstrate usage of the VistaLinkAppProxyConnectionSpec"
. SET XOBMSG(4)=" ::connection spec."
. DO BMES^XPDUTL(.XOBMSG)
IF (+XOBID)=0 DO
. ; already checked if user present, should never get 0 back
. SET XOBMSG(1)=">>> Error: Could not add VistALink Application Proxy User '"_XOBANAME_"' -- Already exists."
. DO BMES^XPDUTL(.XOBMSG)
IF (+XOBID)<0 DO
. SET XOBMSG(1)=">>> Error: Could not add VistALink Application Proxy User '"_XOBANAME_"'."
. SET XOBMSG(2)=" DIERR nodes: <start of error(s)>"
. SET XOBLINE=3,XOBSUBER=0 FOR SET XOBSUBER=$O(^TMP("DIERR",$J,XOBSUBER)) QUIT:(+XOBSUBER)'>0 DO
. . SET XOBMSG(XOBLINE)=" "_^TMP("DIERR",$J,XOBSUBER),XOBLINE=XOBLINE+1
. . SET XOBSUBTX=0 FOR SET XOBSUBTX=$O(^TMP("DIERR",$J,XOBSUBER,"TEXT",XOBSUBTX)) QUIT:(+XOBSUBTX)'>0 DO
. . . SET XOBMSG(XOBLINE)=" "_^TMP("DIERR",$J,XOBSUBER,"TEXT",XOBSUBTX),XOBLINE=XOBLINE+1
. SET XOBMSG(XOBLINE+1)=" <end of error(s)>"
. DO BMES^XPDUTL(.XOBMSG)
. K ^TMP("DIERR",$J)
;
QUIT
XOBVPOST ;; ld,mjk/alb - VistaLink Post-Init ; 07/27/2002 13:00
+1 ;;1.5;VistALink;;Sep 09, 2005
+2 ;;Foundations Toolbox Release v1.5 [Build: 1.5.0.026]
+3 ;
+4 QUIT
+5 ;
EN ; -- add post-init code here
+1 NEW XOBCFG,XOBOS
+2 SET XOBOS=$$GETOS^XOBVTCP()
+3 SET XOBCFG=0
+4 ;
+5 ; -- add config if Cache NT
+6 IF XOBOS="OpenM-NT"
SET XOBCFG=$$CFG()
+7 ;
+8 ; -- add params entry
+9 DO PARMS(XOBCFG)
+10 ;
+11 ; -- add STARTUP task if OpenM-NT and on Windows
+12 IF XOBOS="OpenM-NT"
IF $$SYSOS^XOBVLIB(XOBOS)="NT"
DO SCHEDOPT
+13 ;
+14 ; -- add XOBVTESTER,APPLICATION PROXY user if not present
+15 DO ADDPROXY("XOBVTESTER,APPLICATION PROXY")
+16 ;
+17 QUIT
+18 ;
+19 ;
CFG() ; -- add default config if not pressent
+1 NEW DIC,X,Y,XOBDA,XOBNEW
+2 ;
+3 ; -- DEFAULT configuration --
+4 SET DIC="^XOB(18.03,"
+5 SET DIC(0)="LX"
+6 SET X="DEFAULT"
+7 DO ^DIC
+8 ; -- quit if lookup failed
+9 IF Y=-1
GOTO CFGQ
+10 ;
+11 SET XOBDA=+Y
+12 SET XOBNEW=$PIECE(Y,U,3)
+13 ;
+14 ; -- add default port to multiple
+15 IF XOBNEW
IF '$$PORTS(XOBDA)
GOTO CFGQ
+16 ;
CFGQ ;
+1 QUIT +$GET(XOBDA)
+2 ;
+3 ;
PORTS(XOBDA) ; -- add 8000 port
+1 NEW XOBOK,XOBNEW,DIC,DIE,DR,X,DA,Y
+2 ;
+3 ; -- set oth of multiple is needed
+4 IF $DATA(^XOB(18.03,1,"PORTS",0))=0
SET ^XOB(18.03,1,"PORTS",0)="^18.031^^"
+5 ;
+6 SET DA(1)=XOBDA
+7 SET DIC="^XOB(18.03,"_XOBDA_",""PORTS"","
+8 SET DIC(0)="LX"
+9 SET X=8000
+10 DO ^DIC
+11 ;
+12 ; -- quit if lookup failed
+13 IF Y=-1
SET XOBOK=0
GOTO PORTSQ
+14 SET XOBNEW=$PIECE(Y,U,3)
+15 ;
+16 ; -- if multiple entry is new, set port to NOT startup when config is started
+17 ; (site should change to startup explicitly)
+18 IF XOBNEW
Begin DoDot:1
+19 SET DA(1)=XOBDA
+20 SET DA=+Y
+21 SET DR=".02////0"
+22 SET DIE="^XOB(18.03,"_XOBDA_",""PORTS"","
+23 DO ^DIE
End DoDot:1
+24 ;
+25 SET XOBOK=1
PORTSQ ;
+1 QUIT XOBOK
+2 ;
+3 ;
PARMS(XOBCFG) ; -- add parameter entry
+1 NEW DIC,X,Y,DIE,DA,DR,XOBBOX,XOBDA,XOBMULI,XOBNEW
+2 ;
+3 ; -- box-pair name, no ien
+4 SET XOBBOX=$PIECE($$GETENV^XOBVTCP(),U,4)
+5 ;
+6 ; -- Top-Level Parameters --
+7 SET DIC="^XOB(18.01,"
SET DIC(0)="LXZ"
SET X=$$DOMAIN()
DO ^DIC
+8 ;
+9 ; -- quit if lookup failed or if already exists
+10 IF Y=-1
GOTO PARMSQ
+11 ;
+12 SET XOBDA=+Y
+13 SET XOBNEW=0
+14 IF $PIECE(Y(0),U,2)=""
IF $PIECE(Y(0),U,3)=""
SET XOBNEW=1
+15 ;
+16 ; -- set basic parameters (HEARTBEAT RATE and LATENCY DELTA)
+17 IF XOBNEW
Begin DoDot:1
+18 SET DA=XOBDA
+19 SET DR=".02////180;.03////180"
+20 SET DIE="^XOB(18.01,"
+21 DO ^DIE
End DoDot:1
+22 ;
+23 ; -- Listeners Multiple --
+24 ;
+25 ; -- quit if no config passed in (ie. not Cache NT)
+26 IF '$GET(XOBCFG)
GOTO PARMSQ
+27 ;
+28 ; -- set oth of multiple is needed
+29 IF $DATA(^XOB(18.01,1,"CONFIG",0))=0
SET ^XOB(18.01,1,"CONFIG",0)="^18.012P^^"
+30 ;
+31 SET DA(1)=XOBDA
+32 SET DIC="^XOB(18.01,"_XOBDA_",""CONFIG"","
+33 SET DIC(0)="LX"
+34 SET X=XOBBOX
+35 DO ^DIC
+36 ;
+37 ; -- quit if lookup failed or if already exists
+38 IF Y=-1
GOTO PARMSQ
+39 ;
+40 SET XOBMULI=+Y
+41 SET XOBNEW=$PIECE(Y,U,3)
+42 ;
+43 ; -- set listener config default
+44 IF XOBNEW
Begin DoDot:1
+45 SET DA(1)=XOBDA
+46 SET DA=XOBMULI
+47 SET DR=".02////"_XOBCFG
+48 SET DIE="^XOB(18.01,"_XOBDA_",""CONFIG"","
+49 DO ^DIE
End DoDot:1
+50 ;
PARMSQ ;
+1 QUIT
+2 ;
+3 ;
DOMAIN() ; -- get account's domain entry
+1 ;
+2 QUIT $$KSP^XUPARAM("WHERE")
+3 ;
+4 ;
SCHEDOPT ;-- Schedule XOBV LISTENER STARTUP option in TaskMan
+1 ;
+2 ; This procedure will schedule the XOBV LISTENER STARTUP option
+3 ; in the OPTION SCHEDULING file (#19.2).
+4 ;
+5 NEW XOBMSG,XOBOIEN,XOBSIEN
+6 ;
+7 ;-- XOBOIEN = IEN (OPTION file), XOBSIEN = IEN (OPTION SCHEDULING file)
+8 SET (XOBOIEN,XOBSIEN)=0
+9 ;
+10 DO BMES^XPDUTL(">>> Scheduling the XOBV LISTENER STARTUP option...")
+11 ;
+12 ;-- Check that option was added to OPTION file #19 during installation
+13 SET XOBOIEN=$$FIND1^DIC(19,"","BX","XOBV LISTENER STARTUP","","","")
+14 ;
+15 ;-- Error XOBMSG and quit if option was not added
+16 IF 'XOBOIEN
Begin DoDot:1
+17 SET XOBMSG(1)=""
+18 SET XOBMSG(2)=">>> Error: Option XOBV LISTENER STARTUP was not created in the OPTION (#19)"
+19 SET XOBMSG(3)=" file during the KIDS installation. Please reinstall."
+20 DO BMES^XPDUTL(.XOBMSG)
End DoDot:1
QUIT
+21 ;
+22 ;-- Check if option was already scheduled
+23 SET XOBSIEN=$$CHKOPT(XOBOIEN)
+24 ;
+25 ;-- Display option and quit if option was previously added
+26 IF XOBSIEN
Begin DoDot:1
+27 DO BMES^XPDUTL(">>> The XOBV LISTENER STARTUP option has previously been scheduled:")
+28 DO DSPLYOP(XOBSIEN)
End DoDot:1
QUIT
+29 ;
+30 ;-- Schedule the option
+31 SET XOBSIEN=$$FILEOPT(XOBSIEN,XOBOIEN,,,,"S")
+32 IF XOBSIEN
Begin DoDot:1
+33 DO BMES^XPDUTL(">>> The XOBV LISTENER STARTUP option has been scheduled as follows:")
+34 DO DSPLYOP(XOBSIEN)
End DoDot:1
+35 IF '$TEST
Begin DoDot:1
+36 SET XOBMSG(1)=">>> Error: There was an error scheduling the XOBV LISTENER STARTUP option."
+37 SET XOBMSG(2)=" Please schedule this option using 'Schedule/Unschedule Options'"
+38 SET XOBMSG(3)=" in the Taskman Management menu."
+39 DO BMES^XPDUTL(.XOBMSG)
End DoDot:1
+40 QUIT
+41 ;
+42 ;
CHKOPT(IEN) ;-- Check if option is already scheduled
+1 ;
+2 ; Input:
+3 ; IEN - IEN of option in OPTION file (#19)
+4 ;
+5 ; Output:
+6 ; XOBSIEN - IEN of option in OPTION SCHEDULING file (#19.2) or zero if it does not exist
+7 ;
+8 NEW X,X1,X2,XOBARY,XOBI,XOBIEN2
+9 SET (X1,X2,XOBI,XOBIEN2)=0
+10 DO FIND^DIC(19.2,"","@;.01I;9I","","XOBV LISTENER STARTUP","*","B","","","XOBARY")
+11 SET X=+$PIECE($GET(XOBARY("DILIST",0)),"^")
+12 FOR
SET XOBI=$ORDER(XOBARY("DILIST","ID",X,XOBI))
IF 'XOBI
QUIT
Begin DoDot:1
+13 IF XOBI=.01
IF $GET(XOBARY("DILIST","ID",X,XOBI))=IEN
SET X1=1
+14 IF XOBI=9
IF $GET(XOBARY("DILIST","ID",X,XOBI))["S"
SET X2=1
+15 IF X1
IF X2
SET XOBIEN2=+$GET(XOBARY("DILIST",2,X))
End DoDot:1
+16 QUIT XOBIEN2
+17 ;
+18 ;
DSPLYOP(IEN) ;-- Display fields from OPTION SCHEDULING file (#19.2)
+1 ;
+2 ; Input:
+3 ; IEN - IEN of record in file #19.2
+4 ;
+5 ; Output:
+6 ; Display of fields in record
+7 ;
+8 IF '$GET(IEN)
QUIT
+9 NEW DA,DIC,DIQ
+10 SET DIC="^DIC(19.2,"
SET DA=IEN
SET DIQ(0)="CAR"
+11 DO MES^XPDUTL("")
+12 DO EN^DIQ
+13 DO BMES^XPDUTL("")
+14 QUIT
+15 ;
+16 ;
FILEOPT(XOBIEN,XOBOPT,XOBQUE,XOBDEV,XOBRSCH,XOBSPARM) ;-- Schedule the option
+1 ;
+2 ;-- File a new record in file #19.2 or edit existing
+3 ;
+4 ; Input:
+5 ; XOBIEN - IEN from record in file #19.2 if it exists
+6 ; XOBOPT - IEN of option (file #19); (required)
+7 ; XOBQUE - Queued to run at what time; (optional)
+8 ; XOBDEV - Device for queued job output; (optional)
+9 ; XOBRSCH - Rescheduling frequency; (optional)
+10 ; XOBSPARM - Special queueing; (optional)
+11 ;
+12 ; Output:
+13 ; Function Value - Returns IEN of record on success, 0 on failure
+14 ;
+15 NEW XOBFDA,XOBFDAI,XOBERR,XOBIENS
+16 ;
+17 SET XOBIEN=+$GET(XOBIEN)
+18 ;
+19 ;-- If record doesn't already exist, create new
+20 IF XOBIEN
SET XOBIENS=XOBIEN_","
+21 IF '$TEST
SET XOBIENS="+1,"
+22 ;
+23 ;-- Set up array with field values
+24 SET XOBFDA(19.2,XOBIENS,.01)=$GET(XOBOPT)
+25 SET XOBFDA(19.2,XOBIENS,2)=$GET(XOBQUE)
+26 SET XOBFDA(19.2,XOBIENS,3)=$GET(XOBDEV)
+27 SET XOBFDA(19.2,XOBIENS,6)=$GET(XOBRSCH)
+28 SET XOBFDA(19.2,XOBIENS,9)=$GET(XOBSPARM)
+29 ;
+30 IF XOBIEN
Begin DoDot:1
+31 DO FILE^DIE("","XOBFDA","XOBERR")
+32 IF $DATA(XOBERR)
SET XOBIEN=0
End DoDot:1
+33 IF '$TEST
Begin DoDot:1
+34 DO UPDATE^DIE("","XOBFDA","XOBFDAI","XOBERR")
+35 IF '$DATA(XOBERR)
SET XOBIEN=$GET(XOBFDAI(1))
End DoDot:1
+36 ;
+37 QUIT $SELECT($GET(XOBIEN)>0:XOBIEN,1:0)
+38 ;
ADDPROXY(XOBANAME) ; add application proxy if not present
+1 ; depends on XU*8*361
+2 NEW XOBID,XOBMSG,XOBSUBER,XOBSUBTX,XOBLINE
+3 ;
+4 ; if already present don't add
+5 IF (+$$APFIND^XUSAP(XOBANAME))>0
QUIT
+6 ;
+7 SET XOBID=$$CREATE^XUSAP(XOBANAME,"","XOBV VISTALINK TESTER")
+8 IF (+XOBID)>0
Begin DoDot:1
+9 SET XOBMSG(1)=" Added new Kernel Application Proxy User '"_XOBANAME_"'."
+10 SET XOBMSG(2)=" ::This application proxy user account is used in the VistALink sample web"
+11 SET XOBMSG(3)=" ::application, to demonstrate usage of the VistaLinkAppProxyConnectionSpec"
+12 SET XOBMSG(4)=" ::connection spec."
+13 DO BMES^XPDUTL(.XOBMSG)
End DoDot:1
+14 IF (+XOBID)=0
Begin DoDot:1
+15 ; already checked if user present, should never get 0 back
+16 SET XOBMSG(1)=">>> Error: Could not add VistALink Application Proxy User '"_XOBANAME_"' -- Already exists."
+17 DO BMES^XPDUTL(.XOBMSG)
End DoDot:1
+18 IF (+XOBID)<0
Begin DoDot:1
+19 SET XOBMSG(1)=">>> Error: Could not add VistALink Application Proxy User '"_XOBANAME_"'."
+20 SET XOBMSG(2)=" DIERR nodes: <start of error(s)>"
+21 SET XOBLINE=3
SET XOBSUBER=0
FOR
SET XOBSUBER=$ORDER(^TMP("DIERR",$JOB,XOBSUBER))
IF (+XOBSUBER)'>0
QUIT
Begin DoDot:2
+22 SET XOBMSG(XOBLINE)=" "_^TMP("DIERR",$JOB,XOBSUBER)
SET XOBLINE=XOBLINE+1
+23 SET XOBSUBTX=0
FOR
SET XOBSUBTX=$ORDER(^TMP("DIERR",$JOB,XOBSUBER,"TEXT",XOBSUBTX))
IF (+XOBSUBTX)'>0
QUIT
Begin DoDot:3
+24 SET XOBMSG(XOBLINE)=" "_^TMP("DIERR",$JOB,XOBSUBER,"TEXT",XOBSUBTX)
SET XOBLINE=XOBLINE+1
End DoDot:3
End DoDot:2
+25 SET XOBMSG(XOBLINE+1)=" <end of error(s)>"
+26 DO BMES^XPDUTL(.XOBMSG)
+27 KILL ^TMP("DIERR",$JOB)
End DoDot:1
+28 ;
+29 QUIT