source: EWD/archive/C0CE000R.m@ 1586

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

old version of EWD fileman file and sample applications

File size: 7.3 KB
Line 
1 ;GT.M version of page ewdErrorRedirect (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")="ajaxErrorRedirect^%zewdAPI"
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")="ewdErrorRedirect"
28 s sessionArray("ewd_translationMode")="0"
29 s sessionArray("ewd_technology")="gtm"
30 s sessionArray("ewd_pageType")=""
31 s ebToken("setErrorClasses^%zewdAPI")=$$createEBToken^%zewdGTMRuntime("setErrorClasses^%zewdAPI",.sessionArray)
32 s ebToken("saveJSON^%zewdAPI")=$$createEBToken^%zewdGTMRuntime("saveJSON^%zewdAPI",.sessionArray)
33 s ebToken("getJSON^%zewdCompiler13")=$$createEBToken^%zewdGTMRuntime("getJSON^%zewdCompiler13",.sessionArray)
34 s ebToken("mergeToJSObject^%zewdAPI")=$$createEBToken^%zewdGTMRuntime("mergeToJSObject^%zewdAPI",.sessionArray)
35 s Error=$$startSession^%zewdPHP("ewdErrorRedirect",.%KEY,.%CGIEVAR,.sessionArray,.filesArray)
36 s sessid=$g(sessionArray("ewd_sessid"))
37 i Error["Enterprise Web Developer Error :",$g(sessionArray("ewd_pageType"))="ajax" d
38 . s Error=$p(Error,":",2,200)
39 . s Error=$$replaceAll^%zewdAPI(Error,"<br>",": ")
40 . s Error="EWD runtime error: "_Error
41 i $e(Error,1,32)="Enterprise Web Developer Error :" d QUIT 0
42 . n errorPage
43 . s errorPage=$g(sessionArray("ewd_errorPage"))
44 . i errorPage="" s errorPage="ewdError"
45 . i $g(sessionArray("ewd_pageType"))="ajax" s errorPage="ewdAjaxErrorRedirect"
46 . d writeHTTPHeader^%zewdGTMRuntime(sessionArray("ewd_appName"),errorPage,,,sessid,Error)
47 s stop=0
48 i Error="" d i stop QUIT 0
49 . n nextpage
50 . s nextpage=$$getSessionValue^%zewdAPI("ewd_nextPage",sessid)
51 . i nextpage'="" d
52 . . n x
53 . . d writeHTTPHeader^%zewdGTMRuntime(sessionArray("ewd_appName"),nextpage,$$getSessionValue^%zewdAPI("ewd_token",sessid),$$getSessionValue^%zewdAPI("ewd_pageToken",sessid))
54 . . s stop=1
55 i $$getSessionValue^%zewdAPI("ewd_warning",sessid)'="" d
56 . s Error=$$getSessionValue^%zewdAPI("ewd_warning",sessid)
57 . d deleteFromSession^%zewdAPI("ewd_warning",sessid)
58 w "HTTP/1.1 200 OK"_$c(13,10)
59 s ctype="text/html"
60 d mergeArrayFromSession^%zewdAPI(.headers,"ewd.header",sessid)
61 i $d(headers) d
62 . n lcname,name
63 . s name=""
64 . f s name=$o(headers(name)) q:name="" d
65 . . s lcname=$$zcvt^%zewdAPI(name,"l")
66 . . i lcname="content-type" s ctype=headers(name) q
67 . . w name_": "_headers(name)_$c(13,10)
68 w "Content-type: "_ctype_$c(13,10)
69 w $c(13,10)
70 QUIT 1
71 ;
72body ;
73 w "<html>"_$c(13,10)
74 w " <head>"_$c(13,10)
75 w " <link href=""/resources/ewd.css"" rel=""stylesheet"" type=""text/css"" />"_$c(13,10)
76 w " <script src=""/resources/ewdScripts.js"">"_$c(13,10)
77 w "</script>"_$c(13,10)
78 w " <title>"_$c(13,10)
79 w "Ajax Error Redirect page"_""
80 w " </title>"_$c(13,10)
81 w " <head>"_$c(13,10)
82 w " <body onload=""EWD.page.setErrorClass() ; EWD.page.errorMessage('"_$$htmlEscape^%zewdGTMRuntime($$jsEscape^%zewdGTMRuntime(Error))_"')"">"_$c(13,10)
83 w "Please wait...."_""
84 w " </body>"_$c(13,10)
85 w " </head>"_$c(13,10)
86 w " <script language=""javascript"">"_$c(13,10)
87 w " EWD.page.confirmText='"_$$jsEscape^%zewdGTMRuntime(confirmText)_"' ;"_$c(13,10)
88 w " EWD.page.setOnSubmit = function(obj,confirmText) { "_$c(13,10)
89 w " str='return EWD.page.displayConfirm(""' + confirmText+ '"")' ;"_$c(13,10)
90 w " obj.form.onsubmit=new Function(str) ;"_$c(13,10)
91 w " } ;"_$c(13,10)
92 w " EWD.page.setErrorClass = function () { "_$c(13,10)
93 w " if ('"_$$getSessionValue^%zewdAPI("ewd_hasErrors",sessid)_"' == '1') {"_$c(13,10)
94 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)
95 w " }"_$c(13,10)
96 w " } ;"_$c(13,10)
97 w " EWD.utils.putObjectToSession = function (objName) { "_$c(13,10)
98 w " var json,x ;"_$c(13,10)
99 w " if (typeof(dojo) != ""undefined"") {"_$c(13,10)
100 w " x = ""json = dojo.toJson("" + objName + "")"" ;"_$c(13,10)
101 w " eval(x) ;"_$c(13,10)
102 w " }"_$c(13,10)
103 w " else {"_$c(13,10)
104 w " //x = ""json="" + objName + "".toJSONString()"" ;"_$c(13,10)
105 w " //eval(x) ;"_$c(13,10)
106 w " x = ""json=toJsonString("" + objName + "");"" ;"_$c(13,10)
107 w " eval(x) ;"_$c(13,10)
108 w " //json=toJsonString(objName);"_$c(13,10)
109 w " }"_$c(13,10)
110 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)
111 w " } ;"_$c(13,10)
112 w " EWD.utils.getObjectFromSession = function (objName, refresh, addRefCol) { "_$c(13,10)
113 w " if (refresh) {"_$c(13,10)
114 w " eval(""delete("" + objName + "") ;"") ;"_$c(13,10)
115 w " var objExists = ""undefined"" ;"_$c(13,10)
116 w " }"_$c(13,10)
117 w " else {"_$c(13,10)
118 w " var x = ""var objExists = typeof("" + objName + "");"" ;"_$c(13,10)
119 w " eval(x) ;"_$c(13,10)
120 w " }"_$c(13,10)
121 w " if (objExists == ""undefined"") {"_$c(13,10)
122 w " var addRef = 0 ;"_$c(13,10)
123 w " if (addRefCol) addRef = 1;"_$c(13,10)
124 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)
125 w ""_""
126 w " };"_$c(13,10)
127 w " } ;"_$c(13,10)
128 w " EWD.utils.mergeObjectFromSession = function (sessionName,JSObjName) { "_$c(13,10)
129 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)
130 w " } ;"_$c(13,10)
131 w ""_""
132 w " </script>"_$c(13,10)
133 w " </head>"_$c(13,10)
134 w "</html>"_$c(13,10)
135 QUIT
Note: See TracBrowser for help on using the repository browser.