Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: CIAVUTIL

CIAVUTIL.m

Go to the documentation of this file.
  1. CIAVUTIL ;MSC/IND/DKM - VueCentric Manager Utilities ;27-Feb-2007 00:33;DKM
  1. ;;1.1V2;VUECENTRIC FRAMEWORK;;Mar 20, 2007
  1. ;;Copyright 2000-2006, Medsphere Systems Corporation
  1. ;=================================================================
  1. ; Initiate shutdown sequence for applications
  1. SHUTDOWN N DELAY,MSG
  1. W !,"Initiate VueCentric Shutdown Sequence",!!
  1. D SHOWSESS()
  1. W:$$GETLOGIN'="" "Note: shutdown has already been initiated.",!!
  1. F D Q:$D(DELAY)
  1. .R !,"# of seconds till shutdown (30 minimum): ",DELAY:DTIME,!
  1. .E S DELAY=U
  1. .S DELAY=$TR(DELAY," ")
  1. .Q:DELAY[U
  1. .I DELAY["?" D Q
  1. ..K DELAY
  1. ..W "Enter number of seconds before shutdown.",!
  1. ..W "To specify time in minutes, follow number with letter M.",!
  1. .S:DELAY?1.N1(1"M",1"m") DELAY=DELAY*60
  1. .S DELAY=DELAY\1
  1. .K:DELAY<30 DELAY
  1. Q:DELAY[U
  1. Q:'$$ASK^CIAU("Do you really want to shut down VueCentric in "_DELAY_" seconds")
  1. D SDINIT(.MSG,DELAY,1)
  1. W !!,MSG,!!
  1. Q
  1. ; Abort a shutdown sequence in progress
  1. ABORTSD N MSG
  1. W !,"Abort VueCentric Shutdown and Enable Logins",!!
  1. D SHOWSESS()
  1. W:$$GETLOGIN="" "Note: a shutdown does not appear to be in progress.",!!
  1. Q:'$$ASK^CIAU("Do you really want to abort any shutdowns in progress and enable logins")
  1. D SDABORT(.MSG,1)
  1. W !!,MSG,!!
  1. Q
  1. ; RPC: Initiate shutdown
  1. SDINIT(DATA,DELAY,LOCK,USR) ;
  1. N MSG
  1. S MSG=$P(DELAY,U,2),DELAY=DELAY\1
  1. I DELAY<30 S DATA="Invalid value for shutdown delay." Q
  1. D:$G(LOCK) SETLOGIN("Application is currently offline. Please try later.")
  1. S:'$L(MSG) MSG="Application is shutting down in "_DELAY_" seconds. Please log off."
  1. D BRDCAST^CIANBEVT("SHUTDOWN",DELAY_U_MSG,.USR)
  1. S DATA="Shutdown sequence initiated. "_$$SDMSG
  1. Q
  1. ; RPC: Abort shutdown
  1. SDABORT(DATA,UNLOCK,USR) ;
  1. D BRDCAST^CIANBEVT("SHUTDOWN","-1^Application shutdown has been aborted. You may continue.",.USR)
  1. D:$G(UNLOCK) SETLOGIN()
  1. S DATA="Shutdown sequence aborted. "_$$SDMSG
  1. Q
  1. ; Login status message
  1. SDMSG() Q "Logins are "_$S($L($$GETLOGIN):"disabled.",1:"enabled.")
  1. ; Get inhibit login message
  1. GETLOGIN() ;
  1. Q $$OPTMSG^CIANBUTL("CIAV VUECENTRIC")
  1. ; Set inhibit login message
  1. SETLOGIN(MSG) ;
  1. D OPTMSG^CIANBUTL("CIAV VUECENTRIC",$G(MSG))
  1. Q
  1. ; RPC: Get/set inhibit login message
  1. MSGLOGIN(DATA,MSG) ;
  1. I '$D(MSG) S DATA=$$GETLOGIN
  1. E D SETLOGIN(MSG)
  1. Q
  1. ; Cleanup user data upon user termination
  1. USRTRM(USR) ;
  1. D TMPLDEL^CIAVMCFG("$"_USR)
  1. Q
  1. ; Show active VueCentric sessions
  1. SHOWSESS() ;
  1. N X
  1. S X=$$SHOWSESS^CIANBUTL("CIAV VUECENTRIC")
  1. Q:$Q X
  1. Q