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

XMAPBLOB.m

Go to the documentation of this file.
  1. XMAPBLOB ;(WASH ISC)/CAP-DISPLAY BLOBs ;04/18/2002 07:22
  1. ;;8.0;MailMan;;Jun 28, 2002
  1. ;BLOB display
  1. BLOB Q:'$O(^XMB(3.9,XMZ,2005,0))
  1. N %,I,XMA0,XMB0,MAGFILE2,MAGFILE
  1. S XMA0=0,XMB0=0 I '$D(XMAPBLOB) S XMAPBLOB=1
  1. B S XMA0=$O(^XMB(3.9,XMZ,2005,XMA0)) G BQ:'XMA0 S %=+^(XMA0,0)
  1. S XMB0=XMB0+1,XMA0(XMB0)=%,MAGXX=%
  1. I $L($T(IMPORT^MAGBAPI)) S %=$$IMPORT^MAGBAPI("MAIL^"_MAGXX)
  1. D ^MAGFILE
  1. S XMA0(XMB0)=XMA0(XMB0)_U_MAGFILE1(.01)_"^^^^^^^"_MAGFILE
  1. G B
  1. BQ S X=$O(XMA0(0)) I X,'$O(XMA0(X)) Q:$G(XMAPBLOB("DISPDONE"))
  1. S XMAPBLOB("DISPDONE")=1
  1. I XMB0=1 G CLRQ:$$ASK()="",PRTQ:$G(XMAPBLOB)>99 S (X,XMA0)=+XMA0(1) I 1
  1. E I $S($G(IOT)="IMPC":1,1:0) S X=$$BLIST() G CLRQ:X="" S XMA0=X
  1. D ^MAGOBJ(X,"DISPLAY","")
  1. I $S(XMB0=1:1,$O(XMA0(XMA0))=""&$O(XMA0(0))="":1,1:0) Q
  1. G BQ
  1. CLRQ I $G(XMAPBLOB)>99 Q
  1. G ERASE^MAGAPI
  1. ;
  1. BLIST() ;List BLOBS in the message
  1. I $G(IOT)="IMPC",$G(XMAPBLOB)>99 Q ""
  1. N X,Y,DIR,DIRUT,DUOUT
  1. I '$G(XMAPBLOB("D")),$Y>(IOSL-4) K DIR S DIR(0)="E" D ^DIR:$G(XMAPBLOB)<100 K DIR,DIRUT
  1. I '$G(XMAPBLOB("D")) W !,"============================================================="
  1. I W !!,"There are non-textual parts (BLOBs) included on this message"
  1. S XMAPBLOB("D")=1 W !!,"Object Name",?70,"Filename"
  1. F I=0:0 S I=$O(XMA0(I)) Q:'I W !,I_". "_$E($P(XMA0(I),U,2),1,68),?70,$E($P(XMA0(I),U,9),1,9)
  1. A I $G(XMAPBLOB)>99 Q ""
  1. W !!,"Pick a BLOB you wish to display from the above list (1-"_XMB0_"): NONE// " R X:DTIME
  1. S X=$TR(X,"none","NONE") I $E("NONE",1,$L(X))=X!("^"[X) Q ""
  1. I +X'=X W !!,"Choose the index number of the BLOB you wish to display or accept the default.",! G A
  1. I '$D(XMA0(X)) W !!,"Please choose a listed item by typing in its index number." G A
  1. Q +XMA0(X)
  1. ;Ask if user wants to display single BLOB
  1. ASK() I $G(XMAPBLOB)>99 Q 2
  1. N DIR,DIRUT,DUOUT
  1. S DIR(0)="Y",DIR("A")="Execute Other Message Part ("_$P(XMA0(1),U,2)_") Attached ",DIR("B")="NO"
  1. D ^DIR K DIRUT I 'Y!$D(DIRUT) Q ""
  1. Q 1
  1. NODISP ;If not proper terminal
  1. Q:$G(XMAPBLOB("D")) S XMAPBLOB("D")=1 Q:'$D(^XMB(3.9,XMZ,2005))
  1. W !!,"================================================================="
  1. W !,"There are non-textual body parts (BLOBs) attached to this"
  1. W !,"message. You may not execute them (display...) because you"
  1. W !,"are not using the proper terminal."
  1. W !!,"Query the message to see the list of BLOBs attached."
  1. W !,"================================================================="
  1. Q
  1. PRT ;Print BLOB list
  1. N MAGOBJ,MAGFILE,MAGFILE1,MAGROU,X,XMAPBLOB S XMAPBLOB=100
  1. D BLOB Q
  1. PRTQ S X=$$BLIST() Q