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