source: EWD/archive/C0CE001I.m@ 1306

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

old version of EWD fileman file and sample applications

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