From 85565eb1d68822f102fdbfeaeece81112ea1c111 Mon Sep 17 00:00:00 2001 From: george Date: Thu, 6 Jan 2011 18:27:14 +0000 Subject: [PATCH] updates to EWD utilities for vistacom --- p/C0CEWD.m | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++ p/C0CEWD1.m | 9 ++++++++ 2 files changed, 72 insertions(+) create mode 100644 p/C0CEWD.m diff --git a/p/C0CEWD.m b/p/C0CEWD.m new file mode 100644 index 0000000..e617970 --- /dev/null +++ b/p/C0CEWD.m @@ -0,0 +1,63 @@ +C0CEWD ; CCDCCR/GPL - CCR EWD utilities; 1/6/11 + ;;0.1;CCDCCR;nopatch;noreleasedate + ;Copyright 2011 George Lilly. Licensed under the terms of the GNU + ;General Public License See attached copy of the License. + ; + ;This program is free software; you can redistribute it and/or modify + ;it under the terms of the GNU General Public License as published by + ;the Free Software Foundation; either version 2 of the License, or + ;(at your option) any later version. + ; + ;This program is distributed in the hope that it will be useful, + ;but WITHOUT ANY WARRANTY; without even the implied warranty of + ;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ;GNU General Public License for more details. + ; + ;You should have received a copy of the GNU General Public License along + ;with this program; if not, write to the Free Software Foundation, Inc., + ;51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + ; + Q + ; +TOKEN() ; EXTRINSIC WHICH RETURNS A NEW RANDOM TOKEN + Q $$UUID^C0CUTIL ; USE THE UUID FUNCTION IN THE CCR PACKAGE + ; +STORE(ZARY) ; STORE AN ARRAY OF VALUES INDEXED BY A NEW TOKEN + ; IN ^TMP("C0E","TOKEN") FOR LATER RETRIEVAL FROM INSIDE AN EWD SESSION + ; RETURNS THE TOKEN. ZARY IS PASSED BY NAME + N ZT + S ZT=$$TOKEN ; GET A NEW TOKEN + M ^TMP("C0E","TOKEN",ZT)=@ZARY ; + Q ZT + ; +GET(ZRTN,ZTOKEN,NOKILL) ; RETRIEVE A STORED ARRAY INDEXED BY ZTOKEN + ; KILL THE ARRAY AFTER RETRIEVAL UNLESS NOKILL=1 + ; ZRTN IS PASSED BY NAME + I '$D(^TMP("C0E","TOKEN",ZTOKEN)) D Q ; DOESN'T EXIST + . S @ZRTN="" ; PASS BACK NULL + M @ZRTN=^TMP("C0E","TOKEN",ZTOKEN) ; RETRIEVE + I $G(NOKILL)'=1 K ^TMP("C0E","TOKEN",ZTOKEN) ; DELETE + Q + ; +cbTestMethod(prefix,seedValue,lastSeedValue,optionNo,options) + ; + n maxNo,noFound + ; + s maxNo=50 + s noFound=0 + f s seedValue=$o(^DPT("B",seedValue)) q:seedValue="" q:noFound=maxNo d + . s lastSeedValue=seedValue + . i prefix'="",$e(seedValue,1,$l(prefix))'=prefix q + . s optionNo=optionNo+1 + . s noFound=noFound+1 + . s options(optionNo)=seedValue + QUIT + ; +set1 ; + s ^zewd("comboPlus","methodMap","test")="cbTestMethod^C0PEREW" + q + ; +test1(sessid) ; + d setSessionValue^%zewdAPI("testing","ZZ",sessid) + q 0 + ; diff --git a/p/C0CEWD1.m b/p/C0CEWD1.m index 2f64c81..8540bc6 100644 --- a/p/C0CEWD1.m +++ b/p/C0CEWD1.m @@ -56,3 +56,12 @@ Q(ZQ,ZD) ; SEND QUERY ZQ TO DOM ZD AND DIPLAY NODES RETURNED d displayNodes^%zewdXPath(.nodes) q ; +GET1URL0(URL) ; + s ok=$$httpGET^%zewdGTM(URL,.gpl) + D INDEX^C0CXPATH("gpl","gpl2") + W !,"S URL=""",URL,"""",! + S G="" + F S G=$O(gpl2(G)) Q:G="" D ; + . W " S VDX(""",G,""")=""",gpl2(G),"""",! + W ! + Q