XMXAPIB ;ISC-SF/GMB-Mailbox and Mail Basket APIs ;04/17/2002 14:07
;;8.0;MailMan;;Jun 28, 2002
; All entry points covered by DBIA 2723.
; XMDUZ User's DUZ, or enough of user's name for a positive ID
; XMK Basket number, or enough of a name for a positive ID
; ***** Mailbox actions
CRE8MBOX(XMDUZ,XMDATE) ; Create a mailbox
; In: User
; User must be POSTMASTER or POSTMASTER surrogate and possess XMMGR key.
I '$D(XMV) N XMV,XMDISPI,XMDUN,XMNOSEND,XMPRIV
D CRE8MBOX^XMXPARMB(.XMDUZ,.XMDATE) Q:$D(XMERR)
D CRE8MBOX^XMXMBOX(XMDUZ,.XMDATE)
Q
FLTRMBOX(XMDUZ,XMMSG) ; Filter all messages in a user's mailbox
; In: User
I '$D(XMV) N XMV,XMDISPI,XMDUN,XMNOSEND,XMPRIV
D MBOX^XMXPARMB(.XMDUZ) Q:$D(XMERR)
D FLTRMBOX^XMXMBOX(XMDUZ,.XMMSG)
Q
QMBOX(XMDUZ,XMMSG) ; Query a mailbox
; # msgs^# new msgs^date/time last msg received^priority mail (0/1)
; In: User, Query type
I '$D(XMV) N XMV,XMDISPI,XMDUN,XMNOSEND,XMPRIV
D MBOX^XMXPARMB(.XMDUZ) Q:$D(XMERR)
D QMBOX^XMXMBOX(XMDUZ,.XMMSG)
Q
TERMMBOX(XMDUZ) ; Remove all traces of a user in MM globals
; In: User
; User must be POSTMASTER or POSTMASTER surrogate and possess XMMGR key.
I '$D(XMV) N XMV,XMDISPI,XMDUN,XMNOSEND,XMPRIV
D TERMMBOX^XMXPARMB(.XMDUZ) Q:$D(XMERR)
D TERMMBOX^XMXMBOX(XMDUZ)
Q
; ***** Basket actions
CRE8BSKT(XMDUZ,XMKN,XMK) ; Create a basket
; In: User, basket name
; Out: Basket number
I '$D(XMV) N XMV,XMDISPI,XMDUN,XMNOSEND,XMPRIV
D CRE8BSKT^XMXPARMB(.XMDUZ,.XMKN) Q:$D(XMERR)
D CRE8BSKT^XMXBSKT(XMDUZ,XMKN,.XMK)
Q
DELBSKT(XMDUZ,XMK,XMFLAGS) ; Delete basket
; In: User, basket
I '$D(XMV) N XMV,XMDISPI,XMDUN,XMNOSEND,XMPRIV
D DELBSKT^XMXPARMB(.XMDUZ,.XMK,.XMFLAGS) Q:$D(XMERR)
D DELBSKT^XMXBSKT(XMDUZ,XMK,.XMFLAGS)
Q
FLTRBSKT(XMDUZ,XMK,XMMSG) ; Filter all messages in a user's basket
; In: User
I '$D(XMV) N XMV,XMDISPI,XMDUN,XMNOSEND,XMPRIV
D BSKT^XMXPARMB(.XMDUZ,.XMK) Q:$D(XMERR)
D FLTRBSKT^XMXBSKT(XMDUZ,XMK,.XMMSG)
Q
LISTBSKT(XMDUZ,XMFLAGS,XMAMT,XMSTART,XMPART,XMTROOT) ;
I '$D(XMV) N XMV,XMDISPI,XMDUN,XMNOSEND,XMPRIV
D LISTBSKT^XMXPARMB(XMDUZ,.XMFLAGS,.XMAMT,.XMSTART,.XMPART,.XMTROOT) Q:$D(XMERR)
D LISTBSKT^XMXBSKT(XMDUZ,.XMFLAGS,.XMAMT,.XMSTART,.XMPART,.XMTROOT)
Q
LISTMSGS(XMDUZ,XMK,XMFLDS,XMFLAGS,XMAMT,XMSTART,XMCRIT,XMTROOT) ; List messages
I '$D(XMV) N XMV,XMDISPI,XMDUN,XMNOSEND,XMPRIV
D LISTMSGS^XMXPARMB(.XMDUZ,.XMK,.XMFLDS,.XMFLAGS,.XMAMT,.XMSTART,.XMCRIT,.XMTROOT) Q:$D(XMERR)
D LISTMSGS^XMXLIST(XMDUZ,.XMK,.XMFLDS,.XMFLAGS,.XMAMT,.XMSTART,.XMCRIT,.XMTROOT)
Q
NAMEBSKT(XMDUZ,XMK,XMKN) ; Change the name of a basket
; In: User, basket, new basket name (@ will delete)
I '$D(XMV) N XMV,XMDISPI,XMDUN,XMNOSEND,XMPRIV
D NAMEBSKT^XMXPARMB(.XMDUZ,.XMK,.XMKN) Q:$D(XMERR)
D NAMEBSKT^XMXBSKT(XMDUZ,XMK,XMKN)
Q
QBSKT(XMDUZ,XMK,XMMSG) ; Get info on a basket
; In: User, basket
; Out: basket ien^basket name^# msgs^# new msgs
I '$D(XMV) N XMV,XMDISPI,XMDUN,XMNOSEND,XMPRIV
D BSKT^XMXPARMB(.XMDUZ,.XMK) Q:$D(XMERR)
D QBSKT^XMXBSKT(XMDUZ,XMK,.XMMSG)
Q
RSEQBSKT(XMDUZ,XMK,XMMSG) ; Resequence msgs in a basket
; In: User, basket
I '$D(XMV) N XMV,XMDISPI,XMDUN,XMNOSEND,XMPRIV
D BSKT^XMXPARMB(.XMDUZ,.XMK) Q:$D(XMERR)
D RSEQBSKT^XMXBSKT(XMDUZ,XMK,.XMMSG)
Q
XMXAPIB ;ISC-SF/GMB-Mailbox and Mail Basket APIs ;04/17/2002 14:07
+1 ;;8.0;MailMan;;Jun 28, 2002
+2 ; All entry points covered by DBIA 2723.
+3 ; XMDUZ User's DUZ, or enough of user's name for a positive ID
+4 ; XMK Basket number, or enough of a name for a positive ID
+5 ; ***** Mailbox actions
CRE8MBOX(XMDUZ,XMDATE) ; Create a mailbox
+1 ; In: User
+2 ; User must be POSTMASTER or POSTMASTER surrogate and possess XMMGR key.
+3 IF '$DATA(XMV)
NEW XMV,XMDISPI,XMDUN,XMNOSEND,XMPRIV
+4 DO CRE8MBOX^XMXPARMB(.XMDUZ,.XMDATE)
IF $DATA(XMERR)
QUIT
+5 DO CRE8MBOX^XMXMBOX(XMDUZ,.XMDATE)
+6 QUIT
FLTRMBOX(XMDUZ,XMMSG) ; Filter all messages in a user's mailbox
+1 ; In: User
+2 IF '$DATA(XMV)
NEW XMV,XMDISPI,XMDUN,XMNOSEND,XMPRIV
+3 DO MBOX^XMXPARMB(.XMDUZ)
IF $DATA(XMERR)
QUIT
+4 DO FLTRMBOX^XMXMBOX(XMDUZ,.XMMSG)
+5 QUIT
QMBOX(XMDUZ,XMMSG) ; Query a mailbox
+1 ; # msgs^# new msgs^date/time last msg received^priority mail (0/1)
+2 ; In: User, Query type
+3 IF '$DATA(XMV)
NEW XMV,XMDISPI,XMDUN,XMNOSEND,XMPRIV
+4 DO MBOX^XMXPARMB(.XMDUZ)
IF $DATA(XMERR)
QUIT
+5 DO QMBOX^XMXMBOX(XMDUZ,.XMMSG)
+6 QUIT
TERMMBOX(XMDUZ) ; Remove all traces of a user in MM globals
+1 ; In: User
+2 ; User must be POSTMASTER or POSTMASTER surrogate and possess XMMGR key.
+3 IF '$DATA(XMV)
NEW XMV,XMDISPI,XMDUN,XMNOSEND,XMPRIV
+4 DO TERMMBOX^XMXPARMB(.XMDUZ)
IF $DATA(XMERR)
QUIT
+5 DO TERMMBOX^XMXMBOX(XMDUZ)
+6 QUIT
+7 ; ***** Basket actions
CRE8BSKT(XMDUZ,XMKN,XMK) ; Create a basket
+1 ; In: User, basket name
+2 ; Out: Basket number
+3 IF '$DATA(XMV)
NEW XMV,XMDISPI,XMDUN,XMNOSEND,XMPRIV
+4 DO CRE8BSKT^XMXPARMB(.XMDUZ,.XMKN)
IF $DATA(XMERR)
QUIT
+5 DO CRE8BSKT^XMXBSKT(XMDUZ,XMKN,.XMK)
+6 QUIT
DELBSKT(XMDUZ,XMK,XMFLAGS) ; Delete basket
+1 ; In: User, basket
+2 IF '$DATA(XMV)
NEW XMV,XMDISPI,XMDUN,XMNOSEND,XMPRIV
+3 DO DELBSKT^XMXPARMB(.XMDUZ,.XMK,.XMFLAGS)
IF $DATA(XMERR)
QUIT
+4 DO DELBSKT^XMXBSKT(XMDUZ,XMK,.XMFLAGS)
+5 QUIT
FLTRBSKT(XMDUZ,XMK,XMMSG) ; Filter all messages in a user's basket
+1 ; In: User
+2 IF '$DATA(XMV)
NEW XMV,XMDISPI,XMDUN,XMNOSEND,XMPRIV
+3 DO BSKT^XMXPARMB(.XMDUZ,.XMK)
IF $DATA(XMERR)
QUIT
+4 DO FLTRBSKT^XMXBSKT(XMDUZ,XMK,.XMMSG)
+5 QUIT
LISTBSKT(XMDUZ,XMFLAGS,XMAMT,XMSTART,XMPART,XMTROOT) ;
+1 IF '$DATA(XMV)
NEW XMV,XMDISPI,XMDUN,XMNOSEND,XMPRIV
+2 DO LISTBSKT^XMXPARMB(XMDUZ,.XMFLAGS,.XMAMT,.XMSTART,.XMPART,.XMTROOT)
IF $DATA(XMERR)
QUIT
+3 DO LISTBSKT^XMXBSKT(XMDUZ,.XMFLAGS,.XMAMT,.XMSTART,.XMPART,.XMTROOT)
+4 QUIT
LISTMSGS(XMDUZ,XMK,XMFLDS,XMFLAGS,XMAMT,XMSTART,XMCRIT,XMTROOT) ; List messages
+1 IF '$DATA(XMV)
NEW XMV,XMDISPI,XMDUN,XMNOSEND,XMPRIV
+2 DO LISTMSGS^XMXPARMB(.XMDUZ,.XMK,.XMFLDS,.XMFLAGS,.XMAMT,.XMSTART,.XMCRIT,.XMTROOT)
IF $DATA(XMERR)
QUIT
+3 DO LISTMSGS^XMXLIST(XMDUZ,.XMK,.XMFLDS,.XMFLAGS,.XMAMT,.XMSTART,.XMCRIT,.XMTROOT)
+4 QUIT
NAMEBSKT(XMDUZ,XMK,XMKN) ; Change the name of a basket
+1 ; In: User, basket, new basket name (@ will delete)
+2 IF '$DATA(XMV)
NEW XMV,XMDISPI,XMDUN,XMNOSEND,XMPRIV
+3 DO NAMEBSKT^XMXPARMB(.XMDUZ,.XMK,.XMKN)
IF $DATA(XMERR)
QUIT
+4 DO NAMEBSKT^XMXBSKT(XMDUZ,XMK,XMKN)
+5 QUIT
QBSKT(XMDUZ,XMK,XMMSG) ; Get info on a basket
+1 ; In: User, basket
+2 ; Out: basket ien^basket name^# msgs^# new msgs
+3 IF '$DATA(XMV)
NEW XMV,XMDISPI,XMDUN,XMNOSEND,XMPRIV
+4 DO BSKT^XMXPARMB(.XMDUZ,.XMK)
IF $DATA(XMERR)
QUIT
+5 DO QBSKT^XMXBSKT(XMDUZ,XMK,.XMMSG)
+6 QUIT
RSEQBSKT(XMDUZ,XMK,XMMSG) ; Resequence msgs in a basket
+1 ; In: User, basket
+2 IF '$DATA(XMV)
NEW XMV,XMDISPI,XMDUN,XMNOSEND,XMPRIV
+3 DO BSKT^XMXPARMB(.XMDUZ,.XMK)
IF $DATA(XMERR)
QUIT
+4 DO RSEQBSKT^XMXBSKT(XMDUZ,XMK,.XMMSG)
+5 QUIT