source: EWD/archive/C0CE005.m@ 1631

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

old version of EWD fileman file and sample applications

File size: 8.3 KB
RevLine 
[721]1 ;GT.M version of page Second (patientportal application)
2 ;Compiled on Mon, 01 Mar 2010 17:10:44
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")=""
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")="Second"
28 s sessionArray("ewd_translationMode")="0"
29 s sessionArray("ewd_technology")="gtm"
30 s sessionArray("ewd_pageType")=""
31 s tokens("First")=$$setNextPageToken^%zewdGTMRuntime("First")
32 s tokens("session")=$$setNextPageToken^%zewdGTMRuntime("session")
33 s ebToken("setErrorClasses^%zewdAPI")=$$createEBToken^%zewdGTMRuntime("setErrorClasses^%zewdAPI",.sessionArray)
34 s ebToken("saveJSON^%zewdAPI")=$$createEBToken^%zewdGTMRuntime("saveJSON^%zewdAPI",.sessionArray)
35 s ebToken("getJSON^%zewdCompiler13")=$$createEBToken^%zewdGTMRuntime("getJSON^%zewdCompiler13",.sessionArray)
36 s ebToken("mergeToJSObject^%zewdAPI")=$$createEBToken^%zewdGTMRuntime("mergeToJSObject^%zewdAPI",.sessionArray)
37 s Error=$$startSession^%zewdPHP("Second",.%KEY,.%CGIEVAR,.sessionArray,.filesArray)
38 s sessid=$g(sessionArray("ewd_sessid"))
39 i Error["Enterprise Web Developer Error :",$g(sessionArray("ewd_pageType"))="ajax" d
40 . s Error=$p(Error,":",2,200)
41 . s Error=$$replaceAll^%zewdAPI(Error,"<br>",": ")
42 . s Error="EWD runtime error: "_Error
43 i $e(Error,1,32)="Enterprise Web Developer Error :" d QUIT 0
44 . n errorPage
45 . s errorPage=$g(sessionArray("ewd_errorPage"))
46 . i errorPage="" s errorPage="ewdError"
47 . i $g(sessionArray("ewd_pageType"))="ajax" s errorPage="ewdAjaxErrorRedirect"
48 . d writeHTTPHeader^%zewdGTMRuntime(sessionArray("ewd_appName"),errorPage,,,sessid,Error)
49 s stop=0
50 i Error="" d i stop QUIT 0
51 . n nextpage
52 . s nextpage=$$getSessionValue^%zewdAPI("ewd_nextPage",sessid)
53 . i nextpage'="" d
54 . . n x
55 . . d writeHTTPHeader^%zewdGTMRuntime(sessionArray("ewd_appName"),nextpage,$$getSessionValue^%zewdAPI("ewd_token",sessid),$$getSessionValue^%zewdAPI("ewd_pageToken",sessid))
56 . . s stop=1
57 i $$getSessionValue^%zewdAPI("ewd_warning",sessid)'="" d
58 . s Error=$$getSessionValue^%zewdAPI("ewd_warning",sessid)
59 . d deleteFromSession^%zewdAPI("ewd_warning",sessid)
60 w "HTTP/1.1 200 OK"_$c(13,10)
61 s ctype="text/html"
62 d mergeArrayFromSession^%zewdAPI(.headers,"ewd.header",sessid)
63 i $d(headers) d
64 . n lcname,name
65 . s name=""
66 . f s name=$o(headers(name)) q:name="" d
67 . . s lcname=$$zcvt^%zewdAPI(name,"l")
68 . . i lcname="content-type" s ctype=headers(name) q
69 . . w name_": "_headers(name)_$c(13,10)
70 w "Content-type: "_ctype_$c(13,10)
71 w $c(13,10)
72 QUIT 1
73 ;
74body ;
75 w "<html>"_$c(13,10)
76 w " <head>"_$c(13,10)
77 w " <link href=""/resources/ewd.css"" rel=""stylesheet"" type=""text/css"" />"_$c(13,10)
78 w " <script src=""/resources/ewdScripts.js"">"_$c(13,10)
79 w "</script>"_$c(13,10)
80 w " <title>"_$c(13,10)
81 w "The second EWD Page"_""
82 w " </title>"_$c(13,10)
83 w " <script language=""javascript"">"_$c(13,10)
84 w ""_$c(13,10)
85 w " function goBack() {"_$c(13,10)
86 w " document.location = '/ewd/patientportal/First.mgwsi?ewd_token="_$g(^%zewdSession("session",sessid,"ewd_token"))_"&n="_tokens("First")_"' ;"_$c(13,10)
87 w " }"_$c(13,10)
88 w " "_""
89 w " </script>"_$c(13,10)
90 w " <script language=""javascript"">"_$c(13,10)
91 w " EWD.page.confirmText='"_$$jsEscape^%zewdGTMRuntime(confirmText)_"' ;"_$c(13,10)
92 w " EWD.page.setOnSubmit = function(obj,confirmText) { "_$c(13,10)
93 w " str='return EWD.page.displayConfirm(""' + confirmText+ '"")' ;"_$c(13,10)
94 w " obj.form.onsubmit=new Function(str) ;"_$c(13,10)
95 w " } ;"_$c(13,10)
96 w " EWD.page.setErrorClass = function () { "_$c(13,10)
97 w " if ('"_$$getSessionValue^%zewdAPI("ewd_hasErrors",sessid)_"' == '1') {"_$c(13,10)
98 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)
99 w " }"_$c(13,10)
100 w " } ;"_$c(13,10)
101 w " EWD.utils.putObjectToSession = function (objName) { "_$c(13,10)
102 w " var json,x ;"_$c(13,10)
103 w " if (typeof(dojo) != ""undefined"") {"_$c(13,10)
104 w " x = ""json = dojo.toJson("" + objName + "")"" ;"_$c(13,10)
105 w " eval(x) ;"_$c(13,10)
106 w " }"_$c(13,10)
107 w " else {"_$c(13,10)
108 w " //x = ""json="" + objName + "".toJSONString()"" ;"_$c(13,10)
109 w " //eval(x) ;"_$c(13,10)
110 w " x = ""json=toJsonString("" + objName + "");"" ;"_$c(13,10)
111 w " eval(x) ;"_$c(13,10)
112 w " //json=toJsonString(objName);"_$c(13,10)
113 w " }"_$c(13,10)
114 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)
115 w " } ;"_$c(13,10)
116 w " EWD.utils.getObjectFromSession = function (objName, refresh, addRefCol) { "_$c(13,10)
117 w " if (refresh) {"_$c(13,10)
118 w " eval(""delete("" + objName + "") ;"") ;"_$c(13,10)
119 w " var objExists = ""undefined"" ;"_$c(13,10)
120 w " }"_$c(13,10)
121 w " else {"_$c(13,10)
122 w " var x = ""var objExists = typeof("" + objName + "");"" ;"_$c(13,10)
123 w " eval(x) ;"_$c(13,10)
124 w " }"_$c(13,10)
125 w " if (objExists == ""undefined"") {"_$c(13,10)
126 w " var addRef = 0 ;"_$c(13,10)
127 w " if (addRefCol) addRef = 1;"_$c(13,10)
128 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)
129 w ""_""
130 w " };"_$c(13,10)
131 w " } ;"_$c(13,10)
132 w " EWD.utils.mergeObjectFromSession = function (sessionName,JSObjName) { "_$c(13,10)
133 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)
134 w " } ;"_$c(13,10)
135 w ""_""
136 w " </script>"_$c(13,10)
137 w " </head>"_$c(13,10)
138 w " <body onload=""EWD.page.setErrorClass() ; EWD.page.errorMessage('"_$$htmlEscape^%zewdGTMRuntime($$jsEscape^%zewdGTMRuntime(Error))_"')"">"_$c(13,10)
139 w " <h3>"_$c(13,10)
140 w "This page is not a ""first"" page"_""
141 w " </h3>"_$c(13,10)
142 w " <div>"_$c(13,10)
143 w "It can only be accessed via a"_""
144 w " <a href='/ewd/patientportal/session.mgwsi?ewd_token="_$g(^%zewdSession("session",sessid,"ewd_token"))_"&n="_tokens("session")_"&ewd_urlNo=Second1'>"_$c(13,10)
145 w "tokenised link"_""
146 w " </a>"_$c(13,10)
147 w "generated by EWD"_""
148 w " </div>"_$c(13,10)
149 w " <div>"_$c(13,10)
150 w " <input back""='back""' id=""ewdUnnamed25"" onclick=""goBack()"" type=""button name="" value=""Go Back to First Page"" />"_$c(13,10)
151 w " </div>"_$c(13,10)
152 w " </body>"_$c(13,10)
153 w "</html>"_$c(13,10)
154 QUIT
Note: See TracBrowser for help on using the repository browser.