source: EWD/archive/C0CE006.m@ 1286

Last change on this file since 1286 was 1265, checked in by George Lilly, 13 years ago

old version of EWD fileman file and sample applications

File size: 8.1 KB
RevLine 
[721]1 ;GT.M version of page session (patientportal application)
2 ;Compiled on Sun, 28 Feb 2010 21:40:03
3 ;using Enterprise Web Developer (Build 790)
4 QUIT
5 ;
6run ;
7 n confirmText,ebToken,Error,formInfo,ok,sessid,sessionArray,tokens
8 s ok=$$pre()
9 i ok d body
10 QUIT
11 ;
12pre() ;
13 ;
14 n ctype,ewdAction,headers,jump,quitStatus,pageTitle,stop,urlNo
15 ;
16 s confirmText="Click OK if you're sure you want to delete this record"
17 s sessionArray("ewd_isFirstPage")="0"
18 s sessionArray("ewd_sessid_timeout")="1200"
19 s sessionArray("ewd_prePageScript")="TEST^RICHEWDTEST"
20 s sessionArray("ewd_default_timeout")="1200"
21 s sessionArray("ewd_persistRequest")="true"
22 s sessionArray("ewd_pageTitle")=""
23 s sessionArray("ewd_errorPage")="ewdError"
24 s sessionArray("ewd_templatePrePageScript")=""
25 s sessionArray("ewd_onErrorScript")=""
26 s sessionArray("ewd_appName")="patientportal"
27 s sessionArray("ewd_pageName")="session"
28 s sessionArray("ewd_translationMode")="0"
29 s sessionArray("ewd_technology")="gtm"
30 s sessionArray("ewd_pageType")=""
31 s tokens("login")=$$setNextPageToken^%zewdGTMRuntime("login")
32 s ebToken("setErrorClasses^%zewdAPI")=$$createEBToken^%zewdGTMRuntime("setErrorClasses^%zewdAPI",.sessionArray)
33 s ebToken("saveJSON^%zewdAPI")=$$createEBToken^%zewdGTMRuntime("saveJSON^%zewdAPI",.sessionArray)
34 s ebToken("getJSON^%zewdCompiler13")=$$createEBToken^%zewdGTMRuntime("getJSON^%zewdCompiler13",.sessionArray)
35 s ebToken("mergeToJSObject^%zewdAPI")=$$createEBToken^%zewdGTMRuntime("mergeToJSObject^%zewdAPI",.sessionArray)
36 s Error=$$startSession^%zewdPHP("session",.%KEY,.%CGIEVAR,.sessionArray,.filesArray)
37 s sessid=$g(sessionArray("ewd_sessid"))
38 i Error["Enterprise Web Developer Error :",$g(sessionArray("ewd_pageType"))="ajax" d
39 . s Error=$p(Error,":",2,200)
40 . s Error=$$replaceAll^%zewdAPI(Error,"<br>",": ")
41 . s Error="EWD runtime error: "_Error
42 i $e(Error,1,32)="Enterprise Web Developer Error :" d QUIT 0
43 . n errorPage
44 . s errorPage=$g(sessionArray("ewd_errorPage"))
45 . i errorPage="" s errorPage="ewdError"
46 . i $g(sessionArray("ewd_pageType"))="ajax" s errorPage="ewdAjaxErrorRedirect"
47 . d writeHTTPHeader^%zewdGTMRuntime(sessionArray("ewd_appName"),errorPage,,,sessid,Error)
48 s stop=0
49 i Error="" d i stop QUIT 0
50 . n nextpage
51 . s nextpage=$$getSessionValue^%zewdAPI("ewd_nextPage",sessid)
52 . i nextpage'="" d
53 . . n x
54 . . d writeHTTPHeader^%zewdGTMRuntime(sessionArray("ewd_appName"),nextpage,$$getSessionValue^%zewdAPI("ewd_token",sessid),$$getSessionValue^%zewdAPI("ewd_pageToken",sessid))
55 . . s stop=1
56 i $$getSessionValue^%zewdAPI("ewd_warning",sessid)'="" d
57 . s Error=$$getSessionValue^%zewdAPI("ewd_warning",sessid)
58 . d deleteFromSession^%zewdAPI("ewd_warning",sessid)
59 w "HTTP/1.1 200 OK"_$c(13,10)
60 s ctype="text/html"
61 d mergeArrayFromSession^%zewdAPI(.headers,"ewd.header",sessid)
62 i $d(headers) d
63 . n lcname,name
64 . s name=""
65 . f s name=$o(headers(name)) q:name="" d
66 . . s lcname=$$zcvt^%zewdAPI(name,"l")
67 . . i lcname="content-type" s ctype=headers(name) q
68 . . w name_": "_headers(name)_$c(13,10)
69 w "Content-type: "_ctype_$c(13,10)
70 w $c(13,10)
71 QUIT 1
72 ;
73body ;
74 w "<html>"_$c(13,10)
75 w " <head>"_$c(13,10)
76 w " <link href=""/resources/ewd.css"" rel=""stylesheet"" type=""text/css"" />"_$c(13,10)
77 w " <script src=""/resources/ewdScripts.js"">"_$c(13,10)
78 w "</script>"_$c(13,10)
79 w " <title>"_$c(13,10)
80 w "EWD Page using Session Variables and a PrePage Script"_""
81 w " </title>"_$c(13,10)
82 w " <script language=""javascript"">"_$c(13,10)
83 w ""_$c(13,10)
84 w " eval('"_$$getSessionValue^%zewdAPI("json",sessid)_"');"_$c(13,10)
85 w " //eval('"_$$getSessionValue^%zewdAPI("json",sessid)_"') ;"_$c(13,10)
86 w " alert('hello ' + person.Address.Name) ;"_$c(13,10)
87 w " "_""
88 w " </script>"_$c(13,10)
89 w " <script language=""javascript"">"_$c(13,10)
90 w " EWD.page.confirmText='"_$$jsEscape^%zewdGTMRuntime(confirmText)_"' ;"_$c(13,10)
91 w " EWD.page.setOnSubmit = function(obj,confirmText) { "_$c(13,10)
92 w " str='return EWD.page.displayConfirm(""' + confirmText+ '"")' ;"_$c(13,10)
93 w " obj.form.onsubmit=new Function(str) ;"_$c(13,10)
94 w " } ;"_$c(13,10)
95 w " EWD.page.setErrorClass = function () { "_$c(13,10)
96 w " if ('"_$$getSessionValue^%zewdAPI("ewd_hasErrors",sessid)_"' == '1') {"_$c(13,10)
97 w " EWD.ajax.makeRequest('"_$$getRootURL^%zewdCompiler("gtm")_"ewdeb/eb.mgwsi?ewd_token="_$$getSessionValue^%zewdAPI("ewd_token",sessid)_"&eb="_ebToken("setErrorClasses^%zewdAPI")_"','','synch','','') ;"_$c(13,10)
98 w " }"_$c(13,10)
99 w " } ;"_$c(13,10)
100 w " EWD.utils.putObjectToSession = function (objName) { "_$c(13,10)
101 w " var json,x ;"_$c(13,10)
102 w " if (typeof(dojo) != ""undefined"") {"_$c(13,10)
103 w " x = ""json = dojo.toJson("" + objName + "")"" ;"_$c(13,10)
104 w " eval(x) ;"_$c(13,10)
105 w " }"_$c(13,10)
106 w " else {"_$c(13,10)
107 w " //x = ""json="" + objName + "".toJSONString()"" ;"_$c(13,10)
108 w " //eval(x) ;"_$c(13,10)
109 w " x = ""json=toJsonString("" + objName + "");"" ;"_$c(13,10)
110 w " eval(x) ;"_$c(13,10)
111 w " //json=toJsonString(objName);"_$c(13,10)
112 w " }"_$c(13,10)
113 w " EWD.ajax.makeRequest('"_$$getRootURL^%zewdCompiler("gtm")_"ewdeb/eb.mgwsi?ewd_token="_$$getSessionValue^%zewdAPI("ewd_token",sessid)_"&eb="_ebToken("saveJSON^%zewdAPI")_"&px1=' + objName + '&px2=' + json + '','','synch','','') ;"_$c(13,10)
114 w " } ;"_$c(13,10)
115 w " EWD.utils.getObjectFromSession = function (objName, refresh, addRefCol) { "_$c(13,10)
116 w " if (refresh) {"_$c(13,10)
117 w " eval(""delete("" + objName + "") ;"") ;"_$c(13,10)
118 w " var objExists = ""undefined"" ;"_$c(13,10)
119 w " }"_$c(13,10)
120 w " else {"_$c(13,10)
121 w " var x = ""var objExists = typeof("" + objName + "");"" ;"_$c(13,10)
122 w " eval(x) ;"_$c(13,10)
123 w " }"_$c(13,10)
124 w " if (objExists == ""undefined"") {"_$c(13,10)
125 w " var addRef = 0 ;"_$c(13,10)
126 w " if (addRefCol) addRef = 1;"_$c(13,10)
127 w " EWD.ajax.makeRequest('"_$$getRootURL^%zewdCompiler("gtm")_"ewdeb/eb.mgwsi?ewd_token="_$$getSessionValue^%zewdAPI("ewd_token",sessid)_"&eb="_ebToken("getJSON^%zewdCompiler13")_"&px1=' + objName + '&px2=' + addRef + '','','synch','','') ;"_$c(13,10)
128 w ""_""
129 w " };"_$c(13,10)
130 w " } ;"_$c(13,10)
131 w " EWD.utils.mergeObjectFromSession = function (sessionName,JSObjName) { "_$c(13,10)
132 w " EWD.ajax.makeRequest('"_$$getRootURL^%zewdCompiler("gtm")_"ewdeb/eb.mgwsi?ewd_token="_$$getSessionValue^%zewdAPI("ewd_token",sessid)_"&eb="_ebToken("mergeToJSObject^%zewdAPI")_"&px1=' + sessionName + '&px2=' + JSObjName + '','','synch','','') ;"_$c(13,10)
133 w " } ;"_$c(13,10)
134 w ""_""
135 w " </script>"_$c(13,10)
136 w " </head>"_$c(13,10)
137 w " <body onload=""EWD.page.setErrorClass() ; EWD.page.errorMessage('"_$$htmlEscape^%zewdGTMRuntime($$jsEscape^%zewdGTMRuntime(Error))_"')"">"_$c(13,10)
138 w " <h3>"_$c(13,10)
139 w "This page accesses EWD Session Variables"_""
140 w " </h3>"_$c(13,10)
141 w " <div>"_$c(13,10)
142 w "Name: "_$$getSessionValue^%zewdAPI("person.Name",sessid)
143 w " </div>"_$c(13,10)
144 w " <div>"_$c(13,10)
145 w "Goto"_""
146 w " <a href='/ewd/patientportal/login.mgwsi?ewd_token="_$g(^%zewdSession("session",sessid,"ewd_token"))_"&n="_tokens("login")_"&ewd_urlNo=session1'>"_$c(13,10)
147 w "next page"_""
148 w " </a>"_$c(13,10)
149 w " </div>"_$c(13,10)
150 w " </body>"_$c(13,10)
151 w "</html>"_$c(13,10)
152 QUIT
Note: See TracBrowser for help on using the repository browser.