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

XMCB.m

Go to the documentation of this file.
  1. XMCB ;ISC-SF/GMB- Batch Message Transmission ;08/28/2003 10:11
  1. ;;8.0;MailMan;**22**;Jun 28, 2002
  1. ; Was (WASH ISC)/THM
  1. ;
  1. ; Entry points used by MailMan options (not covered by DBIA):
  1. ; TAPEOUT XMS-SEQ-TRANSMIT (was BAT^XMS)
  1. ; TAPEIN XMR-SEQ-RECEIVE (was BAT^XMR)
  1. ; GLBOUT XMR-UCI-SEND (was TASKER^XMS)
  1. ; GLBIN XMR-UCI-RCV (was TASKER^XMR)
  1. Q
  1. TAPEOUT ; Write messages to tape.
  1. ; (Transmit them to another site via tape.)
  1. N XMC,XMCHAN,XMINST,XMSITE,XMABORT,ER
  1. S XMABORT=0,XMCHAN="TAPE",ER=0,XMC("BATCH")=1
  1. D ASKINST^XMCXU(.XMINST,.XMSITE,.XMABORT,"M") Q:XMABORT
  1. D OPEN^XML Q:$G(ER)!$G(POP)
  1. D OUTDO
  1. D KL^XMC
  1. Q
  1. TAPEIN ; Read messages from tape.
  1. ; (Receive them from another site via tape.)
  1. N XM,XMC,XMCHAN,ER
  1. S ER=0,(XMC("BATCH"),XMC("TURN"))=1,XMCHAN="T-IN"
  1. I $$NEWERR^%ZTER N $ETRAP,$ESTACK S $ETRAP="D R^XMCTRAP"
  1. E S X="R^XMCTRAP",@^%ZOSF("TRAP")
  1. D ENT^XMR
  1. U IO(0) D ^%ZISC
  1. W:'$D(ZTQUEUED) !,$$EZBLD^DIALOG(42257,+$G(XMC("R"))) ;Messages received: |1|
  1. G KL1^XMC
  1. Q
  1. GLBOUT ; Write messages to a global.
  1. ; (Transmit them to another UCI via the global.)
  1. W $C(7),!!
  1. I '$D(^%ZISL(4.281,0)) W !!,$$EZBLD^DIALOG(42250) Q ;File 4.281 is not set up properly.
  1. N XMTEXT
  1. D BLD^DIALOG(42251,"","","XMTEXT","F")
  1. D MSG^DIALOG("WM","","","","XMTEXT")
  1. ; ******* I M P O R T A N T *******"
  1. ;This option transmits messages from one UCI to another via ^%ZISL(4.281.
  1. ;Each UCI must be running MailMan, and file 4.281 must be translated and
  1. ;accessible from both UCIs. In the two-step process, the messages are
  1. ;written to the global from one UCI, and read from it in the other.
  1. ;
  1. ;Invoke this option on the sending UCI, and select the domain whose
  1. ;messages are to be transmitted. (The domain name must be the exact
  1. ;name of the domain of the receiving UCI - no synonyms.) The messages
  1. ;are written to file 4.281 and deleted from the transmit queue.
  1. ;
  1. ;Log on to the receiving UCI and invoke the receiver. It will read all
  1. ;messages in file 4.281 which were sent to it (it can't read any
  1. ;messages sent to any other domain), and queue them to be delivered.
  1. ;The messages will then be deleted from file 4.281.
  1. N XMC,XMCHAN,XMLINE,XMFDA,XMIEN,XMIENS,XMABORT,XMINST,XMSITE,XMTASK,ER,Y
  1. S XMCHAN="TASKER",(XMABORT,XMLINE)=0
  1. D ASKINST^XMCXU(.XMINST,.XMSITE,.XMABORT,"M") Q:XMABORT
  1. D GET^XML Q:$G(ER)!$G(POP)
  1. S XMFDA(4.281,"+1,",.01)=^XMB("NETNAME")
  1. D UPDATE^DIE("","XMFDA","XMIEN")
  1. S XMTASK=XMIEN(1)
  1. D OUTDO
  1. S XMIENS=XMTASK_","
  1. S XMFDA(4.281,XMIENS,1)=XMSITE
  1. D FILE^DIE("","XMFDA")
  1. D KL^XMC
  1. Q
  1. OUTDO ;
  1. N XM,XMDUZ
  1. U IO(0)
  1. S XM="",(XMC("BATCH"),XMC("TURN"))=1,XMREC="Q"
  1. D GET^XMCXT(0)
  1. W !,$$EZBLD^DIALOG(42252) ;Dumping messages now
  1. U IO
  1. D ENTER^XMS
  1. D XMTFINIS^XMTDR(XMINST)
  1. U IO(0)
  1. I $D(XMC("S")) W $C(7)," ... ",$$EZBLD^DIALOG(42253,XMC("S")) ;Messages dumped: |1|
  1. X XMCLOSE
  1. Q
  1. GLBIN ; Read messages from a global.
  1. ; (Receive them from another UCI via the global.)
  1. N XM,XMC,XMCHAN,XMDUZ,XMTASK,XMNETNAM,XMSITE,XMABORT,XMI,XMIREC,XMCNT,Y
  1. S XM=$S($D(ZTQUEUED):"",1:"D")
  1. S XMNETNAM=^XMB("NETNAME"),XMABORT=0,XMCHAN="TASK-IN"
  1. D GET^XML Q:$G(ER)
  1. I XM["D" D Q:XMABORT
  1. . D GET^XMCXT(0)
  1. . D DOTRAN^XMC1(42254,XMNETNAM) ;Receive messages for |1|
  1. . D PAGE^XMXUTIL(.XMABORT)
  1. S (XMI,XMCNT)=0
  1. F S XMI=$O(^%ZISL(4.281,"C",XMNETNAM,XMI)) Q:'XMI D Q:ER
  1. . S XMIREC=$G(^%ZISL(4.281,XMI,0)) Q:XMIREC=""
  1. . Q:$P(XMIREC,U,2)'=XMNETNAM
  1. . S XMSITE=$P(XMIREC,U,1)
  1. . S XMIREC=$G(^%ZISL(4.281,XMI,"T",1,0)) Q:XMIREC'?1"HELO ".E
  1. . S XMCNT=XMCNT+1
  1. . I XM["D" D DOTRAN^XMC1(42255,XMI,XMSITE) ;Loading entry #|1| from |2|
  1. . S XMTASK=XMI,ER=0,XMLINE=.999,(XMC("BATCH"),XMC("TURN"),XMQUIET)=1
  1. . D RECEIVE^XMR Q:ER
  1. . N DA,DIK
  1. . S DA=XMTASK,DIK="^%ZISL(4.281," D ^DIK
  1. I XM["D" D
  1. . I XMCNT D DOTRAN^XMC1(42257,XMC("R")) Q ;Messages received: |1|
  1. . D DOTRAN^XMC1(42256,XMNETNAM) ;No entries found in file 4.281 for |1|
  1. D KL^XMC
  1. Q