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

XPDI1.m

Go to the documentation of this file.
  1. XPDI1 ;SFISC/RSD - Cont of Install Process ;10/28/2002 17:14
  1. ;;8.0;KERNEL;**58,61,95,108,229,275**;Jul 10, 1995
  1. ;lookup into file 9.7, XPDS=DIC("S") for lookup
  1. ;return 0-fail or ien, XPDT=array of linked builds
  1. LOOK(XPDS,XPDL) ;lookup Install
  1. N DIC,Y,XPD,XPDIT,%
  1. S DIC(0)="QEAMZ",DIC="^XPD(9.7,"
  1. S:$L($G(XPDS)) DIC("S")=XPDS
  1. D ^DIC Q:Y<0 0
  1. I '$G(XPDL) L +^XPD(9.7,+Y,0):0 E W !,"Being accessed by another user" Q 0
  1. S XPD=+Y,XPDIT=0
  1. W !!,"This Distribution was loaded on ",$$FMTE^XLFDT($P(Y(0),U,3))," with header of ",!?3,$G(^XPD(9.7,XPD,2)),!?3,"It consisted of the following Install(s):",!
  1. ;build XPDT array
  1. I '$D(^XPD(9.7,"ASP",XPD)) D XPDT(1,XPD) Q XPD
  1. F S XPDIT=$O(^XPD(9.7,"ASP",XPD,XPDIT)) Q:'XPDIT S Y=+$O(^(XPDIT,0)) D XPDT(XPDIT,Y)
  1. I '$O(XPDT(0)) S XPDQUIT=1 D QUIT(XPD)
  1. Q XPD
  1. ;
  1. QUIT(Y) ;unlock ien Y
  1. L -^XPD(9.7,+Y) Q
  1. ;
  1. XPDT(P1,P2) ;Build XPDT array
  1. N % S %=$P($G(^XPD(9.7,P2,0)),U)
  1. I %="" W:$X ! W "**ERROR in Install, You need to remove the Distribution and reload it**",! S XPDQUIT=1 Q
  1. S XPDT(P1)=P2_U_%,(XPDT("DA",P2),XPDT("NM",%))=P1 W:$X>64 ! W $J(%,15)
  1. Q
  1. ;
  1. QUES(XPDA) ;install questions; XPDA=ien in file 9.7
  1. N XPDANS,XPDFIL,XPDFILN,XPDFILO,XPDFLG,XPDNM,XPDQUES,X,Y
  1. S XPDNM=$P(^XPD(9.7,XPDA,0),U) W !!,"Install Questions for ",XPDNM,!
  1. ;pre-init questions
  1. D DIR^XPDIQ("PRE") I $D(XPDQUIT) D ASKABRT^XPDI Q
  1. ;file install questions
  1. S (XPDFIL,XPDFLG)=0
  1. F S XPDFIL=$O(^XTMP("XPDI",XPDA,"FIA",XPDFIL)) Q:'XPDFIL S X=^(XPDFIL),X(0)=^(XPDFIL,0),X(1)=^(XPDFIL),XPDFILO=^(0,1) D Q:$D(XPDQUIT)
  1. .;check for DD screening logic
  1. .I $G(^(10))]"" N XPDSCR S XPDSCR=^(10) ;^(10) is ref to ^XTMP("XPDI",XPDA,"FIA",XPDFIL,0,10) from prev line
  1. .;XPDFILN=file name^global ref^partial DD
  1. .;XPDANS=new file^DD screen failed^Data exists^update file name^user
  1. .;doesn't want to update data 1=yes,0=no
  1. .S XPDFILN=X_X(0)_U_X(1),XPDANS='($D(^DIC(XPDFIL,0))#2)_"^^"_''$O(@(X(0)_"0)"))
  1. .I 'XPDFLG W !,"Incoming Files:" S XPDFLG=1
  1. .W ! D DIR^XPDIQ("XPF",XPDFIL_"#") Q:$D(XPDQUIT)
  1. .S:$G(XPDQUES("XPF"_XPDFIL_"#2"))=0 $P(XPDANS,U,5)=1
  1. .S ^XTMP("XPDI",XPDA,"FIA",XPDFIL,0,2)=XPDANS
  1. .;kill the answers so we can re-ask for next file
  1. .F I=1:1:2 K XPDQUES("XPF"_XPDFIL_"#"_I)
  1. ;XPDQUIT is by file questions in previous do loop, set in XPDIQ
  1. I $D(XPDQUIT) D ASKABRT^XPDI Q
  1. ;ask for coordinators to incoming mail groups
  1. S (XPDFIL,XPDFLG)=0
  1. F S XPDFIL=$O(^XTMP("XPDI",XPDA,"KRN",3.8,XPDFIL)) Q:'XPDFIL S X=^(XPDFIL,0),Y=$G(^(-1)) D Q:$D(XPDQUIT)
  1. .;XPDANS=Mail Group name
  1. .Q:$P(Y,U)=1 ;Don't ask if deleting
  1. .S XPDANS=$P(X,U)
  1. .I 'XPDFLG W !!,"Incoming Mail Groups:" S XPDFLG=1
  1. .W ! D DIR^XPDIQ("XPM",XPDFIL_"#") Q:$D(XPDQUIT)
  1. .;kill the answers so we can re-ask for next MG
  1. .K XPDQUES("XPM"_XPDFIL_"#1")
  1. .Q
  1. I $D(XPDQUIT) D ASKABRT^XPDI Q
  1. ;ask to rebuild menus if Option is added
  1. S (XPDFIL,XPDFLG)=0
  1. S XPDFIL=$O(^XTMP("XPDI",XPDA,"KRN",19,XPDFIL)) D:XPDFIL
  1. .S X=^XTMP("XPDI",XPDA,"KRN",19,XPDFIL,0)
  1. .;XPDANS=Menu Rebuild Answer
  1. .S XPDANS=$P(X,U)
  1. .W ! D DIR^XPDIQ("XPO") Q:$D(XPDQUIT)
  1. I $D(XPDQUIT) D ASKABRT^XPDI Q
  1. ;post-init questions
  1. W ! D DIR^XPDIQ("POS") I $D(DIRUT)!$D(XPDQUIT) D ASKABRT^XPDI Q
  1. Q
  1. ;
  1. XQSET(XPDA) ;get options & protocols to disable
  1. ;put in ^TMP($J,"XQOO",starting build name)
  1. N A,I,X,Y
  1. S I=0 F S I=$O(^XTMP("XPDI",XPDA,"KRN",19,I)) Q:'I S X=^(I,0),A=^(-1) D
  1. .S Y=$O(^DIC(19,"B",$P(X,U),0))
  1. .;check that option exist and 0=send,1=delete,3=merge or 5=disable
  1. .I Y,$D(^DIC(19,Y,0)),$S('A:1,1:A#2) S ^TMP($J,"XQOO",XPDSET,19,Y)=$P(^(0),U,1,2)
  1. S I=0 F S I=$O(^XTMP("XPDI",XPDA,"KRN",101,I)) Q:'I S X=^(I,0),A=^(-1) D
  1. .S Y=$O(^ORD(101,"B",$P(X,U),0))
  1. .I Y,$D(^ORD(101,Y,0)),$S(A=3:1,A=5:1,1:'A) S ^TMP($J,"XQOO",XPDSET,101,Y)=$P(^(0),U,1,2)
  1. Q
  1. ;XPDIJ need to install XPDIJ now & set routine flag to skip
  1. XPDIJ N DIE,XPDA,XCM,XCN,XCS,X
  1. S XPDA=XPDIJ,DIE="^XTMP(""XPDI"",XPDIJ,""RTN"",""XPDIJ"",",XCN=0,X="XPDIJ"
  1. X ^%ZOSF("SAVE") D RTNLOG^XPDUTL("XPDIJ") ;Save and update ROUTINE file
  1. S XCN=$$RTNUP^XPDUTL("XPDIJ",2)
  1. Q