Changeset 1314


Ignore:
Timestamp:
Dec 8, 2011, 9:41:24 AM (13 years ago)
Author:
Sam Habiel
Message:

added vista:session custom tag implementation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • EWD/ewdapps/so/r/ewdu.m

    r1310 r1314  
    1111 d mergeArrayToSession^%zewdAPI(.IO,"IO",sessid)
    1212 d setSessionValue^%zewdAPI("U","^",sessid)
     13 quit
     14 ;
     15 ; Custom Tag
     16SS(nodeOID,attrValues,docOID,technology) ; <vista:session> to get VISTA Session Variables
     17 N attr
     18 S attr("method")="r^ewdu"
     19 S attr("param1")="#ewd_sessid"
     20 S attr("type")="procedure"
     21 N xOID s xOID=$$addElementToDOM^%zewdDOM("ewd:execute",nodeOID,"",.attr)
     22 D removeIntermediateNode^%zewdDOM(nodeOID)
    1323 quit
    1424 ;
     
    131141 q ""
    132142 ;
    133 
    134 FILES(sessid)  ; Get File of Files
    135  d clearList^%zewdAPI("file",sessid)                        ; Clean
    136  N FILE S FILE=""                                           ; Looper that is also the File Name
    137  FOR  S FILE=$O(^DIC("B",FILE)) QUIT:FILE=""  DO            ; ditto
    138  . N IEN S IEN=$O(^(FILE,""))                               ; IEN from 2nd subscript in B index
    139  . d appendToList^%zewdAPI("file",FILE,IEN,sessid)          ; Add to session
    140  Q ""
    141 ENTRY(sessid)  ; Get Entries in a specific file
    142  d clearList^%zewdAPI("entry",sessid)                       ; Clean
    143  n file s file=$$getSessionValue^%zewdAPI("file",sessid)    ; Get select file from combo box
    144  n glo s glo=^DIC(file,0,"GL")                              ; Get File Global
    145  s glo=$$CREF^DILF(glo)                                     ; Get the closed root reference
    146  N ENTRY S ENTRY=""                                         ; Looper that is also the Entry
    147  FOR  S ENTRY=$O(@glo@("B",ENTRY)) QUIT:ENTRY=""  DO        ; ditto
    148  . N IEN S IEN=$O(^(ENTRY,""))                              ; IEN
    149  . d appendToList^%zewdAPI("entry",ENTRY,IEN,sessid)        ; Add to session
    150  Q ""
    151 CAPOPTS(sessid) ; Nothing much
    152  K ^SAMOPTS
    153  ZSHOW "V":^SAMOPTS
    154  Q ""
    155 INQ(sessid) ; DIINQUIRE Application Pre-Page Script
    156  ;
    157  ; First, get the options
    158  n outopt   ; Output Options checkbox values
    159  d getCheckboxValues^%zewdAPI("outopt",.outopt,sessid)
    160  n capopts s capopts=""  ; Caption Options to get from checkbox values
    161  n i s i=""
    162  for  set i=$order(outopt(i)) q:i=""  s capopts=capopts_i
    163  ;
    164  ; Get File and Entry
    165  n file s file=$$getSessionValue^%zewdAPI("file",sessid)
    166  n entry s entry=$$getRequestValue^%zewdAPI("entry",sessid)
    167  ;
    168  ; dbug dbug
    169  k ^ZZSAM
    170  ZSHOW "V":^ZZSAM
    171  ;
    172  ; Now actual VISTA work--write out the output to a file
    173  S IOP="HFS" D ^%ZIS    ; Open HFS Device
    174  U IO                   ; USE HFS Device
    175  ; D CAPTION^DIQ(file,entry,capopts)      ; Write Out Report
    176  D CAPTION^DIQ(file,1,"ARC")      ; Temp until Russian Doll is fixed :-(
    177  D ^%ZISC               ; Close Device
    178  ; done
    179  ;
    180  ; This code doesn't work, and my debugger couldn't go through it.
    181  ; something is wrong--and I have an old version of GT.M--why is this happening?
    182  ; N PATH S PATH=$$PATH^MXMLPRSE(IO("CLOSE"))
    183  ; N FILE S FILE=$P(IO("CLOSE"),PATH,2)
    184  ; N RESULT S RESULT=$$FTG^%ZISH(PATH,FILE,$NAME(^TMP("EWDU",$J)),3) ; Doesn't work!!!
    185  ;
    186  ; ------------------> Read the File Back
    187  OPEN IO("CLOSE"):(READONLY:rewind)       ; Open Again for reading
    188  USE IO("CLOSE")        ; Use
    189  N CNT S CNT=1          ; Counter
    190  KILL ^TMP("EWDU",$J)   ; Kill TMP Global
    191  FOR  DO  Q:$ZEOF       ; Read the file
    192  . N % R %
    193  . S ^TMP("EWDU",$J,CNT)=%
    194  . S CNT=CNT+1
    195  C IO("CLOSE"):(delete) ; Close and delete
    196  ; <------------------ Close the File
    197  ;
    198  ; Move to EWD Session
    199  d clearSessionArray^%zewdAPI("DIINQUIRE",sessid)
    200  d mergeGlobalToSession^%zewdAPI($NAME(^TMP("EWDU",$J)),"DIINQUIRE",sessid)
    201  QUIT ""
Note: See TracChangeset for help on using the changeset viewer.