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

XOBWPST.m

Go to the documentation of this file.
  1. XOBWPST ;ALB/MJK - HWSC - Post-Init ; 09/13/10 4:00pm
  1. ;;1.0;HwscWebServiceClient;;September 13, 2010;Build 31
  1. ;
  1. QUIT
  1. ;
  1. EN ; -- main entry point for post-init
  1. NEW XOBSTAT
  1. ;
  1. ; -- delete all classes in xobw package
  1. DO DELETE()
  1. ;
  1. ; -- build primary key indices (for those who had installed early developer previews)
  1. DO INDEX()
  1. ;
  1. ; -- delete IP ADDRESS field (for those who had installed early developer previews)
  1. DO DELIP()
  1. ;
  1. ; -- remove HtttpProxy* fields and 2 node (for those who had installed early developer previews)
  1. DO DELHP()
  1. ;
  1. ; -- load hwsc support classes (mapped FM classes, etc.)
  1. NEW XOBSTAT
  1. SET XOBSTAT=$$IMPORT^XOBWLIB1($$GETDIR(),$$SUPPORT^XOBWENV())
  1. IF 'XOBSTAT DO GOTO ENQ
  1. . DO BMES^XPDUTL("Error occurred during the importing of support classes file:")
  1. . DO MES^XPDUTL(" Directory: "_$$GETDIR())
  1. . DO MES^XPDUTL(" File Name: "_$$SUPPORT^XOBWENV())
  1. . DO MES^XPDUTL(" Error: "_$PIECE(XOBSTAT,"^",2))
  1. . DO MES^XPDUTL(" o Classes not imported.")
  1. ELSE DO
  1. . DO MES^XPDUTL(" o Support classes imported successfully.")
  1. . DO MES^XPDUTL(" ")
  1. ;
  1. ENQ ;
  1. QUIT
  1. ;
  1. DELETE() ; -- delete classes for clean slate and remove previous releases
  1. NEW XOBSTAT
  1. ; -- delete all classes in xobw package
  1. DO BMES^XPDUTL(" o Deleting xobw classes:")
  1. ;
  1. SET XOBSTAT=$SYSTEM.OBJ.DeletePackage("xobw")
  1. DO BMES^XPDUTL(" ...[xobw] deletion "_$SELECT(XOBSTAT:"finished successfully.",1:"failed."))
  1. DO MES^XPDUTL("")
  1. QUIT
  1. ;
  1. INDEX() ; -- build indices if data exists but index not defined
  1. NEW XOBFILE,DIK,DA,XOBCNT
  1. ; -- primary key indices for 18.02,18.12
  1. FOR XOBFILE=18.02,18.12 DO
  1. . IF $ORDER(^XOB(XOBFILE,0)),$ORDER(^XOB(XOBFILE,"PRIMARY",""))="" DO
  1. . . SET DIK="^XOB("_XOBFILE_","
  1. . . SET DIK(1)=".01^PRIMARY"
  1. . . DO ENALL^DIK
  1. . . DO BMES^XPDUTL(" o PRIMARY index set for "_$SELECT(XOBFILE="18.02":"WEB SERVICE",1:"WEB SERVER")_" (#"_XOBFILE_") file.")
  1. ; AB index for 18.121
  1. IF $ORDER(^XOB(18.12,0)),$ORDER(^XOB(18.12,"AB",""))="" DO
  1. . SET XOBCNT=0,DA(1)=0 FOR SET DA(1)=$ORDER(^XOB(18.12,DA(1))) Q:DA(1)'>0 DO
  1. . . SET DIK="^XOB(18.12,"_DA(1)_",100,"
  1. . . SET DIK(1)=".01^AB"
  1. . . DO ENALL^DIK SET XOBCNT=XOBCNT+1
  1. . DO BMES^XPDUTL(" o AB whole-file index set for "_XOBCNT_" AUTHORIZED WEB SERVICES (#18.121) subfiles.")
  1. QUIT
  1. ;
  1. DELIP() ; -- move IP ADDRESS to SERVER field if blank and delete IP ADDRESS (#.02)
  1. NEW XOBDA,XOBDA0,XOBY,XOBERR
  1. ; -- make sure IP ADDRESS field is present
  1. DO FIELD^DID(18.12,.02,"N","LABEL","XOBY","XOBERR")
  1. IF $GET(XOBY("LABEL"))'="IP ADDRESS" GOTO DELIPQ
  1. ;
  1. ; -- move data
  1. SET XOBDA=0
  1. FOR SET XOBDA=$ORDER(^XOB(18.12,XOBDA)) Q:'XOBDA SET XOBDA0=$GET(^(XOBDA,0)) DO
  1. . NEW SERVER,IP
  1. . SET SERVER=$PIECE(XOBDA0,"^",4)
  1. . SET IP=$PIECE(XOBDA0,"^",2)
  1. . IF IP]"" DO
  1. . . NEW XOBIENS,XOBFDA,XOBERR
  1. . . SET XOBIENS=XOBDA_","
  1. . . ; -- Set up array with field values
  1. . . IF SERVER="" SET XOBFDA(18.12,XOBIENS,.04)=IP
  1. . . SET XOBFDA(18.12,XOBIENS,.02)="@"
  1. . . DO FILE^DIE("","XOBFDA","XOBERR")
  1. DO BMES^XPDUTL(" o IP ADDRESS (#.02) field data moved to SERVER (#.04) if SERVER blank")
  1. DO MES^XPDUTL(" in WEB SERVER (#18.12) file")
  1. ;
  1. ; -- delete field
  1. DO DELFLD(.02,"IP ADDRESS")
  1. DELIPQ ;
  1. QUIT
  1. ;
  1. DELHP() ; -- remove HtttpProxy* fields and 2 node
  1. NEW XOBX
  1. ; -- delete HtttpProxy* field definitions
  1. DO DELFLD(2.01,"HttpProxyHTTPS")
  1. DO DELFLD(2.02,"HttpProxyServer")
  1. DO DELFLD(2.03,"HttpProxyPort")
  1. ; -- remove 2 nodes
  1. NEW XOBDA
  1. SET XOBDA=0
  1. FOR SET XOBDA=$ORDER(^XOB(18.12,XOBDA)) Q:'XOBDA KILL ^XOB(18.12,XOBDA,2)
  1. QUIT
  1. ;
  1. DELFLD(XOBNUM,XOBLABEL) ; -- delete a field from WEB SERVER file
  1. NEW XOBY,XOBERR,DIK,DA
  1. DO FIELD^DID(18.12,XOBNUM,"N","LABEL","XOBY","XOBERR")
  1. IF $GET(XOBY("LABEL"))'=XOBLABEL GOTO DELFLDQ
  1. SET DIK="^DD(18.12,"
  1. SET DA=XOBNUM
  1. SET DA(1)=18.12
  1. DO ^DIK
  1. DO BMES^XPDUTL(" o "_XOBLABEL_" (#"_XOBNUM_") field deleted from WEB SERVER (#18.12) file")
  1. DELFLDQ ;
  1. QUIT
  1. ;
  1. GETDIR() ; -- get directory where install files are located
  1. QUIT $$DEFDIR^%ZISH($G(XPDQUES("POSXMLDIR"),""))
  1. ;