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

XMXAPI.m

Go to the documentation of this file.
  1. XMXAPI ;ISC-SF/GMB-Message APIs ; 4/2/09 10:11am
  1. ;;8.0;MailMan;**15,41**;Jun 28, 2002;Build 4
  1. ; All entry points covered by DBIA 2729.
  1. ; Variables input:
  1. ; XMATTACH Imaging system BLOB attachment array
  1. ; XMBODY Message text (MUST NOT BE "XMBODY")
  1. ; (must be closed root, passed by value. See WP_ROOT
  1. ; definition for WP^DIE(), FM word processing filer)
  1. ; XMDUZ User's DUZ, or enough of user's name for a positive ID
  1. ; eg: 1301 or "lastname,firs"
  1. ; XMK Basket number, or enough of a name for a positive ID
  1. ; eg: 1 or "IN"
  1. ; XMKZ Message number in basket XMK
  1. ; OR
  1. ; if $G(XMK)="", Message number in ^XMB(3.9
  1. ; XMKZA Message number list or list array in basket XMK
  1. ; eg: "1,3,5-7" or ARRAY("1,3")=""
  1. ; ARRAY("5-7")=""
  1. ; (list may end in comma)
  1. ; (ARRAY must be passed by reference)
  1. ; OR
  1. ; if $G(XMK)="", Message number list or list array in ^XMB(3.9
  1. ; (same rules, but number ranges are NOT allowed)
  1. ; XMSUBJ Message subject
  1. ; XMTO Addressee or addressee array
  1. ; (array must be passed by reference)
  1. ; User's DUZ, or enough of user's name for a positive ID
  1. ; eg: 1301 or "lastname,firs" or ARRAY(1301)=""
  1. ; ARRAY("lastname,firs")=""
  1. ; G.group name (enough for positive ID)
  1. ; S.server name (enough for positive ID)
  1. ; D.device name (enough for positive ID)
  1. ; prefix above (except devices and servers) by:
  1. ; I: for 'information only' recipient (may not reply)
  1. ; eg: "I:1301" or "I:lastname,firs"
  1. ; C: for 'copy' recipient (not expected to reply)
  1. ; eg: "C:1301" or "C:lastname,firs"
  1. ; L@datetime: for when (in future) to send to this recipient
  1. ; (datetime may be anything accepted by FM)
  1. ; eg: "L@25 DEC@0500:1301" or "L@1 JAN:lastname,firs"
  1. ; or "L@2981225.05:1301"
  1. ; (may combine IL@datetime: or CL@datetime:)
  1. ; To delete recipient, prefix by -
  1. ; eg: -1301 or "-lastname,firs"
  1. ; XMZ message number in ^XMB(3.9,
  1. ;
  1. ; Variables output (must be passed by reference):
  1. ; XMFULL expanded address of last addressee
  1. ; XMMSG simple message telling how many messages were acted on
  1. ; XMZ message number created in ^XMB(3.9,
  1. ;
  1. ; Errors
  1. ; XMERR if there's any errors, then XMERR is set to the number of
  1. ; errors, otherwise XMERR is undefined.
  1. ; ^TMP("XMERR",$J,error number,"TEXT",line number)=error text
  1. ANSRMSG(XMDUZ,XMK,XMKZ,XMSUBJ,XMBODY,XMTO,XMINSTR,XMZR) ; Answer a msg (Send new msg with copy of original msg inside)
  1. ; In: User, basket, msg #
  1. ; Out: XMZR (message number of answer)
  1. N DIERR ; ADDED IN PATCH XM*8.0*41 JDG
  1. I '$D(XMV) N XMV,XMDISPI,XMDUN,XMNOSEND,XMPRIV
  1. D ANSRMSG^XMXPARM(.XMDUZ,.XMK,.XMKZ,.XMSUBJ,.XMBODY,.XMTO,.XMINSTR) Q:$D(XMERR)
  1. D ANSRMSG^XMXANSER(XMDUZ,.XMK,XMKZ,.XMSUBJ,XMBODY,.XMTO,.XMINSTR,.XMZR)
  1. Q
  1. DELMSG(XMDUZ,XMK,XMKZA,XMMSG) ; Delete msgs from a basket
  1. N DIERR ; ADDED IN PATCH XM*8.0*41 JDG
  1. I '$D(XMV) N XMV,XMDISPI,XMDUN,XMNOSEND,XMPRIV
  1. D ACTMSGS^XMXPARM(.XMDUZ,.XMK,.XMKZA) Q:$D(XMERR)
  1. D DELMSG^XMXMSGS(XMDUZ,.XMK,.XMKZA,.XMMSG)
  1. Q
  1. FLTRMSG(XMDUZ,XMK,XMKZA,XMMSG) ; Filters msgs in a basket
  1. N DIERR ; ADDED IN PATCH XM*8.0*41 JDG
  1. I '$D(XMV) N XMV,XMDISPI,XMDUN,XMNOSEND,XMPRIV
  1. D ACTMSGS^XMXPARM(.XMDUZ,.XMK,.XMKZA) Q:$D(XMERR)
  1. D FLTRMSG^XMXMSGS(XMDUZ,.XMK,.XMKZA,.XMMSG)
  1. Q
  1. FWDMSG(XMDUZ,XMK,XMKZA,XMTO,XMINSTR,XMMSG) ; Forward msgs
  1. ; XMINSTR("SHARE DATE")
  1. ; XMINSTR("SHARE BSKT")
  1. ; XMINSTR("SELF BSKT")
  1. ; XMINSTR("FWD BY") substitute any string instead of XMDUZ name
  1. N DIERR ; ADDED IN PATCH XM*8.0*41 JDG
  1. I '$D(XMV) N XMV,XMDISPI,XMDUN,XMNOSEND,XMPRIV
  1. D FWDMSG^XMXPARM(.XMDUZ,.XMK,.XMKZA,.XMTO,.XMINSTR) Q:$D(XMERR)
  1. D FWDMSG^XMXMSGS(XMDUZ,.XMK,.XMKZA,.XMTO,.XMINSTR,.XMMSG)
  1. Q
  1. LATERMSG(XMDUZ,XMK,XMKZA,XMINSTR,XMMSG) ; Later msgs
  1. ; XMINSTR("LATER")
  1. N DIERR ; ADDED IN PATCH XM*8.0*41 JDG
  1. I '$D(XMV) N XMV,XMDISPI,XMDUN,XMNOSEND,XMPRIV
  1. D LATERMSG^XMXPARM(.XMDUZ,.XMK,.XMKZA,.XMINSTR) Q:$D(XMERR)
  1. D LATERMSG^XMXMSGS(XMDUZ,.XMK,.XMKZA,.XMINSTR,.XMMSG)
  1. Q
  1. MOVEMSG(XMDUZ,XMK,XMKZA,XMKTO,XMMSG) ; Move msgs from one basket to another
  1. ; XMKTO Basket number, or enough of a name for a positive ID.
  1. ; Identifies basket to move to
  1. N DIERR ; ADDED IN PATCH XM*8.0*41 JDG
  1. I '$D(XMV) N XMV,XMDISPI,XMDUN,XMNOSEND,XMPRIV
  1. D MOVEMSG^XMXPARM(.XMDUZ,.XMK,.XMKZA,.XMKTO) Q:$D(XMERR)
  1. D MOVEMSG^XMXMSGS(XMDUZ,.XMK,.XMKZA,XMKTO,.XMMSG)
  1. Q
  1. NTOGLMSG(XMDUZ,XMK,XMKZA,XMMSG) ; New Toggle msgs
  1. N DIERR ; ADDED IN PATCH XM*8.0*41 JDG
  1. I '$D(XMV) N XMV,XMDISPI,XMDUN,XMNOSEND,XMPRIV
  1. D ACTMSGS^XMXPARM(.XMDUZ,.XMK,.XMKZA) Q:$D(XMERR)
  1. D NTOGLMSG^XMXMSGS(XMDUZ,.XMK,.XMKZA,.XMMSG)
  1. Q
  1. PRTMSG(XMDUZ,XMK,XMKZA,XMPRTTO,XMINSTR,XMMSG,XMTASK,XMSUBJ,XMTO) ; Print msgs
  1. ; XMINSTR("HDR"), "RESPS", "RECIPS", "WHEN"
  1. ; XMPRTTO Printer name
  1. ; XMSUBJ & XMTO used only if XMPRTTO is a P-MESSAGE device. Even then, they're optional.
  1. N DIERR ; ADDED IN PATCH XM*8.0*41 JDG
  1. I '$D(XMV) N XMV,XMDISPI,XMDUN,XMNOSEND,XMPRIV
  1. D PRTMSG^XMXPARM(.XMDUZ,.XMK,.XMKZA,.XMPRTTO,.XMINSTR,.XMSUBJ,.XMTO) Q:$D(XMERR)
  1. D PRTMSG^XMXMSGS(XMDUZ,.XMK,.XMKZA,XMPRTTO,.XMINSTR,.XMMSG,.XMTASK,.XMSUBJ,.XMTO)
  1. Q
  1. PUTSERV(XMKN,XMZ) ; Put a message in a server basket
  1. ; XMKN full server name, including "S."
  1. N DIERR ; ADDED IN PATCH XM*8.0*41 JDG
  1. D SERV^XMXPARMB(.XMKN,.XMZ) Q:$D(XMERR)
  1. D PUTSERV^XMXMSGS1(XMKN,XMZ)
  1. Q
  1. REPLYMSG(XMDUZ,XMK,XMKZ,XMBODY,XMINSTR,XMZR) ; Reply to msg (Attach reply to original msg)
  1. ; XMINSTR("NET REPLY") 1=send over the network; 0=don't (default)
  1. ; XMINSTR("NET SUBJ") Network Reply subject (see XMSUBJ)
  1. ; Out: XMZR (message number of answer)
  1. N DIERR ; ADDED IN PATCH XM*8.0*41 JDG
  1. I '$D(XMV) N XMV,XMDISPI,XMDUN,XMNOSEND,XMPRIV
  1. D REPLYMSG^XMXPARM(.XMDUZ,.XMK,.XMKZ,.XMBODY,.XMINSTR) Q:$D(XMERR)
  1. D REPLYMSG^XMXREPLY(XMDUZ,.XMK,XMKZ,XMBODY,.XMINSTR,.XMZR)
  1. Q
  1. SENDBULL(XMDUZ,XMBN,XMPARM,XMBODY,XMTO,XMINSTR,XMZ,XMATTACH) ; Send a bulletin (returns XMZ)
  1. ; In: User, bulletin name, bulletin parameters, add'l text,
  1. ; add'l recipients, send now or later (when?), opt'l BLOB
  1. N DIERR ; ADDED IN PATCH XM*8.0*41 JDG
  1. I '$D(XMV) N XMV,XMDISPI,XMDUN,XMNOSEND,XMPRIV
  1. D BULLETIN^XMXPARM(.XMDUZ,.XMBN,.XMPARM,.XMBODY,.XMTO,.XMINSTR,.XMATTACH) Q:$D(XMERR)
  1. D SENDBULL^XMXBULL(XMDUZ,XMBN,.XMPARM,.XMBODY,.XMTO,.XMINSTR,.XMZ,.XMATTACH)
  1. Q
  1. SENDMSG(XMDUZ,XMSUBJ,XMBODY,XMTO,XMINSTR,XMZ,XMATTACH) ; Send a msg
  1. ; In: User, basket (if you are recipient), all msg parts,
  1. ; priority?, closed?, (info?,cc?), send now or later (when?),
  1. ; (KIDS,MIME,text,PackMan), delete date (if to shared,mail)
  1. ; XMINSTR("RCPT BSKT")
  1. N DIERR ; ADDED IN PATCH XM*8.0*41 JDG
  1. I '$D(XMV) N XMV,XMDISPI,XMDUN,XMNOSEND,XMPRIV
  1. D SENDMSG^XMXPARM(.XMDUZ,.XMSUBJ,.XMBODY,.XMTO,.XMINSTR,.XMATTACH) Q:$D(XMERR)
  1. D SENDMSG^XMXSEND(XMDUZ,XMSUBJ,XMBODY,.XMTO,.XMINSTR,.XMZ,.XMATTACH)
  1. Q
  1. TASKBULL(XMDUZ,XMBN,XMPARM,XMBODY,XMTO,XMINSTR,XMTASK,XMATTACH) ; Send a bulletin (Task it - does not return XMZ)
  1. ; XMBN Bulletin name (must be full name)
  1. ; XMPARM Array of parameters necessary for bulletin
  1. ; ARRAY(1)="parameter 1"
  1. ; ARRAY(2)="parameter 2"
  1. ; XMBODY Additional text to append to the bulletin text
  1. ; (must be closed root, passed by value. See WP_ROOT
  1. ; definition for WP^DIE(), FM word processing filer)
  1. ; XMTO Additional addressee(s)
  1. ; XMINSTR("SELF BSKT")
  1. ; ***ETC.***
  1. ; In: User, bulletin name, bulletin parameters, add'l text,
  1. ; add'l recipients, send now or later (when?), opt'l BLOB
  1. ; Out: XMTASK (task number)
  1. N DIERR ; ADDED IN PATCH XM*8.0*41 JDG
  1. I '$D(XMV) N XMV,XMDISPI,XMDUN,XMNOSEND,XMPRIV
  1. D BULLETIN^XMXPARM(.XMDUZ,.XMBN,.XMPARM,.XMBODY,.XMTO,.XMINSTR,.XMATTACH) Q:$D(XMERR)
  1. D TASKBULL^XMXBULL(XMDUZ,XMBN,.XMPARM,.XMBODY,.XMTO,.XMINSTR,.XMTASK,.XMATTACH)
  1. Q
  1. TERMMSG(XMDUZ,XMK,XMKZA,XMMSG) ; Terminate msgs
  1. N DIERR ; ADDED IN PATCH XM*8.0*41 JDG
  1. I '$D(XMV) N XMV,XMDISPI,XMDUN,XMNOSEND,XMPRIV
  1. D ACTMSGS^XMXPARM(.XMDUZ,.XMK,.XMKZA) Q:$D(XMERR)
  1. D TERMMSG^XMXMSGS(XMDUZ,.XMK,.XMKZA,.XMMSG)
  1. Q
  1. VAPORMSG(XMDUZ,XMK,XMKZA,XMINSTR,XMMSG) ; Set vaporize date for msgs in a basket
  1. ; XMINSTR("VAPOR")
  1. N DIERR ; ADDED IN PATCH XM*8.0*41 JDG
  1. I '$D(XMV) N XMV,XMDISPI,XMDUN,XMNOSEND,XMPRIV
  1. D VAPORMSG^XMXPARM(.XMDUZ,.XMK,.XMKZA,.XMINSTR) Q:$D(XMERR)
  1. D VAPORMSG^XMXMSGS(XMDUZ,.XMK,.XMKZA,.XMINSTR,.XMMSG)
  1. Q
  1. ZAPSERV(XMKN,XMZ) ; Delete a message from a server basket
  1. ; XMKN full server name, including "S."
  1. N DIERR ; ADDED IN PATCH XM*8.0*41 JDG
  1. D SERV^XMXPARMB(.XMKN,.XMZ) Q:$D(XMERR)
  1. D ZAPSERV^XMXMSGS1(XMKN,XMZ)
  1. Q
  1. ; ***** other actions
  1. ADDRNSND(XMDUZ,XMZ,XMTO,XMINSTR) ; Build a message part 2 (address and send)
  1. ; XMZ (in)
  1. N DIERR ; ADDED IN PATCH XM*8.0*41 JDG
  1. I '$D(XMV) N XMV,XMDISPI,XMDUN,XMNOSEND,XMPRIV
  1. D ADDRNSND^XMXPARM(.XMDUZ,.XMZ,.XMTO,.XMINSTR) Q:$D(XMERR)
  1. D ADDRNSND^XMXSEND(XMDUZ,XMZ,.XMTO,.XMINSTR)
  1. Q
  1. CRE8XMZ(XMSUBJ,XMZ) ; Build a message part 1 (create)
  1. ; In: subject
  1. ; Out: XMZ
  1. N DIERR ; ADDED IN PATCH XM*8.0*41 JDG
  1. D VSUBJ^XMXPARM(.XMSUBJ) Q:$D(XMERR)
  1. D CRE8XMZ^XMXSEND(XMSUBJ,.XMZ)
  1. Q
  1. MOVEBODY(XMZ,XMBODY) ; Move text to the message
  1. N DIERR ; ADDED IN PATCH XM*8.0*41 JDG
  1. D MOVEBODY^XMXPARM(.XMZ,.XMBODY) Q:$D(XMERR)
  1. D MOVEBODY^XMXSEND(XMZ,XMBODY)
  1. Q
  1. TOWHOM(XMDUZ,XMZ,XMTYPE,XMTO,XMINSTR,XMFULL) ; Check ONE msg addressee
  1. ; XMFULL Expanded address of the addressee
  1. N DIERR ; ADDED IN PATCH XM*8.0*41 JDG
  1. I '$D(XMV) N XMV,XMDISPI,XMDUN,XMNOSEND,XMPRIV
  1. D TOWHOM^XMXPARM(.XMDUZ,.XMZ,.XMTYPE,XMTO,.XMINSTR) Q:$D(XMERR)
  1. D TOWHOM^XMXTO(XMDUZ,.XMZ,XMTYPE,XMTO,.XMINSTR,.XMFULL)
  1. Q
  1. VSUBJ(XMSUBJ) ; Validate a subject
  1. N DIERR ; ADDED IN PATCH XM*8.0*41 JDG
  1. D VSUBJ^XMXPARM(.XMSUBJ)
  1. Q