XOBWENV ;ALB/MJK - HWSC :: Environmental Check ; 06/10/2016
;;1.0;HwscWebServiceClient;**4**;September 13, 2010;Build 9
;Per VA Directive 6402, this routine should not be modified.
;
; ***** IMPORTANT NOTE *******************************************
; This routine requires access to the manager (%SYS) namespace and
; can only be run by a user with permissions to that namespace.
; ****************************************************************
;
Q
EN ;- entry point
; -- must be a supported M implementation
DO VALIDM IF $GET(XPDABORT) GOTO ENQ
; -- passed load check
IF '$GET(XPDENV),'$GET(XPDABORT) DO
. WRITE !!?1,">>> Environment check completed for KIDS Load a Distribution option.",!
; -- passed install check
IF $GET(XPDENV)=1,'$GET(XPDABORT) DO
. WRITE !!?1,">>> Environment check completed for KIDS Install Package option.",!
ENQ QUIT
;
VALIDM ; -- check if HWSC supports M implementation and set KIDS flag if not
IF $$PROD^XUPROD(0),'$$SSLOK() DO
. WRITE !,"Note: Your current production M environment does not support SSL/TLS"
. WRITE !," connectivity! SSL/TLS support is provided in Cache v5.2.3 and greater."
. WRITE !," Also, SSL/TLS is not currently supported on VMS."
. NEW DIR S DIR(0)="E" D ^DIR
;
IF '$$OSOK() DO
. SET XPDABORT=1
. WRITE !?5,"This software can only be installed in a Cache v5.2.3 or greater environment!",!
QUIT
;
OSOK() ; -- check environment for operating system, 5.2.3 or greater
IF $PIECE($GET(^%ZOSF("OS")),"^")'["OpenM" QUIT 0
NEW XOBVER,MAJOR,MINOR,SUBMINOR
SET XOBVER=$$VERSION^%ZOSV()
; -- checks major version # against 5
SET MAJOR=+$P(XOBVER,".")
IF MAJOR<5 QUIT 0
IF MAJOR>5 QUIT 1
; -- checks minor version # against 2
SET MINOR=+$P(XOBVER,".",2)
IF MINOR<2 QUIT 0
IF MINOR>2 QUIT 1
; -- checks sub-minor version # against 3
SET SUBMINOR=+$P(XOBVER,".",3)
IF SUBMINOR<3 QUIT 0
IF SUBMINOR>2 QUIT 1
QUIT 0
;
SSLOK() ; -- check environment if SSL/TLS is supported (Cache 5.2.3 or greater, and *not* VMS)
; also called in [XOBW WEB SERVER SETUP] edit template
;IF $$SYSOS()="VMS" QUIT 0 ; prevent SSL use on VMS ; - XOBW*1*4
QUIT $$OSOK() ; 5.2.3 or greater
;
KIDSCHK(XOBDIR) ; -- check input from installer
; input: XOBDIR := directory where wsdl file is located (
; Note: If applicable, XOBDIR should contain the os-specific final delimiter, like '/home/cache/'
NEW XOBPATH
IF '##class(%File).DirectoryExists(XOBDIR) DO QUIT 0
. WRITE !," o Directory does not exist: "_XOBDIR
SET XOBPATH=XOBDIR_$$SUPPORT()
IF '##class(%File).Exists(XOBPATH) DO QUIT 0
. WRITE !," o File to be imported does not exist: "_XOBPATH
QUIT 1
;
SUPPORT() ; -- returns name of xml file containing support classes (wsdl handler, vista info header, etc.)
QUIT "xobw4.xml"
;
VERSION() ; -- returns the version number for this build
QUIT +$PIECE($PIECE($TEXT(XOBWENV+1),";",7),"Build ",2)
;
SYSOS() ; -- get system operating system
; returns VMS, UNIX, NT or UNK
NEW XOBOS SET XOBOS=^%ZOSF("OS")
QUIT $SELECT(XOBOS["OpenM":$$OS^%ZOSV(),XOBOS["DSM":"VMS",1:"UNK")
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HXOBWENV 3145 printed Sep 15, 2024@22:09:57 Page 2
XOBWENV ;ALB/MJK - HWSC :: Environmental Check ; 06/10/2016
+1 ;;1.0;HwscWebServiceClient;**4**;September 13, 2010;Build 9
+2 ;Per VA Directive 6402, this routine should not be modified.
+3 ;
+4 ; ***** IMPORTANT NOTE *******************************************
+5 ; This routine requires access to the manager (%SYS) namespace and
+6 ; can only be run by a user with permissions to that namespace.
+7 ; ****************************************************************
+8 ;
+9 QUIT
EN ;- entry point
+1 ; -- must be a supported M implementation
+2 DO VALIDM
IF $GET(XPDABORT)
GOTO ENQ
+3 ; -- passed load check
+4 IF '$GET(XPDENV)
IF '$GET(XPDABORT)
Begin DoDot:1
+5 WRITE !!?1,">>> Environment check completed for KIDS Load a Distribution option.",!
End DoDot:1
+6 ; -- passed install check
+7 IF $GET(XPDENV)=1
IF '$GET(XPDABORT)
Begin DoDot:1
+8 WRITE !!?1,">>> Environment check completed for KIDS Install Package option.",!
End DoDot:1
ENQ QUIT
+1 ;
VALIDM ; -- check if HWSC supports M implementation and set KIDS flag if not
+1 IF $$PROD^XUPROD(0)
IF '$$SSLOK()
Begin DoDot:1
+2 WRITE !,"Note: Your current production M environment does not support SSL/TLS"
+3 WRITE !," connectivity! SSL/TLS support is provided in Cache v5.2.3 and greater."
+4 WRITE !," Also, SSL/TLS is not currently supported on VMS."
+5 NEW DIR
SET DIR(0)="E"
DO ^DIR
End DoDot:1
+6 ;
+7 IF '$$OSOK()
Begin DoDot:1
+8 SET XPDABORT=1
+9 WRITE !?5,"This software can only be installed in a Cache v5.2.3 or greater environment!",!
End DoDot:1
+10 QUIT
+11 ;
OSOK() ; -- check environment for operating system, 5.2.3 or greater
+1 IF $PIECE($GET(^%ZOSF("OS")),"^")'["OpenM"
QUIT 0
+2 NEW XOBVER,MAJOR,MINOR,SUBMINOR
+3 SET XOBVER=$$VERSION^%ZOSV()
+4 ; -- checks major version # against 5
+5 SET MAJOR=+$PIECE(XOBVER,".")
+6 IF MAJOR<5
QUIT 0
+7 IF MAJOR>5
QUIT 1
+8 ; -- checks minor version # against 2
+9 SET MINOR=+$PIECE(XOBVER,".",2)
+10 IF MINOR<2
QUIT 0
+11 IF MINOR>2
QUIT 1
+12 ; -- checks sub-minor version # against 3
+13 SET SUBMINOR=+$PIECE(XOBVER,".",3)
+14 IF SUBMINOR<3
QUIT 0
+15 IF SUBMINOR>2
QUIT 1
+16 QUIT 0
+17 ;
SSLOK() ; -- check environment if SSL/TLS is supported (Cache 5.2.3 or greater, and *not* VMS)
+1 ; also called in [XOBW WEB SERVER SETUP] edit template
+2 ;IF $$SYSOS()="VMS" QUIT 0 ; prevent SSL use on VMS ; - XOBW*1*4
+3 ; 5.2.3 or greater
QUIT $$OSOK()
+4 ;
KIDSCHK(XOBDIR) ; -- check input from installer
+1 ; input: XOBDIR := directory where wsdl file is located (
+2 ; Note: If applicable, XOBDIR should contain the os-specific final delimiter, like '/home/cache/'
+3 NEW XOBPATH
+4 IF '##class(%File).DirectoryExists(XOBDIR)
Begin DoDot:1
+5 WRITE !," o Directory does not exist: "_XOBDIR
End DoDot:1
QUIT 0
+6 SET XOBPATH=XOBDIR_$$SUPPORT()
+7 IF '##class(%File).Exists(XOBPATH)
Begin DoDot:1
+8 WRITE !," o File to be imported does not exist: "_XOBPATH
End DoDot:1
QUIT 0
+9 QUIT 1
+10 ;
SUPPORT() ; -- returns name of xml file containing support classes (wsdl handler, vista info header, etc.)
+1 QUIT "xobw4.xml"
+2 ;
VERSION() ; -- returns the version number for this build
+1 QUIT +$PIECE($PIECE($TEXT(XOBWENV+1),";",7),"Build ",2)
+2 ;
SYSOS() ; -- get system operating system
+1 ; returns VMS, UNIX, NT or UNK
+2 NEW XOBOS
SET XOBOS=^%ZOSF("OS")
+3 QUIT $SELECT(XOBOS["OpenM":$$OS^%ZOSV(),XOBOS["DSM":"VMS",1:"UNK")