1
- <?xml version =" 1.0" encoding =" UTF-8" ?>
2
- <Export generator =" Cache" version =" 25" >
3
- <Class name =" SQLKPI.AbstractREST" >
4
- <Super >%CSP.REST</Super >
5
- <TimeCreated >64244,40123.382009</TimeCreated >
1
+ Class SQLKPI .AbstractREST Extends %CSP .REST
2
+ {
6
3
7
- <Parameter name =" HandleCorsRequest" >
8
- <Default >1</Default >
9
- </Parameter >
4
+ Parameter HandleCorsRequest = 1 ;
10
5
11
- <Parameter name =" UseSession" >
12
- <Type >Integer</Type >
13
- <Default >1</Default >
14
- </Parameter >
6
+ Parameter UseSession As Integer = 1 ;
15
7
16
- <Method name =" outputStatus" >
17
- <Description >
18
- This method takes a status, renders it as jason (if requested) and outputs the result</Description >
19
- <Internal >1</Internal >
20
- <ClassMethod >1</ClassMethod >
21
- <FormalSpec >pSC:%Status</FormalSpec >
22
- <ReturnType >%Status</ReturnType >
23
- <Implementation ><![CDATA[
8
+ /// This method takes a status, renders it as jason (if requested) and outputs the result
9
+ ClassMethod outputStatus (pSC As %Status ) As %Status [ Internal ]
10
+ {
24
11
#dim tSC As %Status = $$$OK
25
12
#dim e As %Exception.AbstractException
26
13
@@ -56,13 +43,10 @@ This method takes a status, renders it as jason (if requested) and outputs the r
56
43
Set tSC = e .AsStatus ()
57
44
}
58
45
Quit $$$OK
59
- ]]> </Implementation >
60
- </Method >
46
+ }
61
47
62
- <Method name =" getDebugInfo" >
63
- <ClassMethod >1</ClassMethod >
64
- <ReturnType >%ZEN.proxyObject</ReturnType >
65
- <Implementation ><![CDATA[
48
+ ClassMethod getDebugInfo () As %ZEN .proxyObject
49
+ {
66
50
set obj = ##class (%ZEN.proxyObject ).%New ()
67
51
set obj .stack = ..getStackInfo ()
68
52
set obj .objlasterror = $system .Status .GetErrorText ($get (%objlasterror ))
@@ -72,13 +56,10 @@ This method takes a status, renders it as jason (if requested) and outputs the r
72
56
set obj .user = $username
73
57
74
58
return obj
75
- ]]> </Implementation >
76
- </Method >
59
+ }
77
60
78
- <Method name =" getStackInfo" >
79
- <ClassMethod >1</ClassMethod >
80
- <ReturnType >%ListOfDataTypes</ReturnType >
81
- <Implementation ><![CDATA[
61
+ ClassMethod getStackInfo () As %ListOfDataTypes
62
+ {
82
63
83
64
set ex = ##class (%Exception.SystemException ).%New ()
84
65
do ex .StackAsArray (.stack )
@@ -92,28 +73,20 @@ This method takes a status, renders it as jason (if requested) and outputs the r
92
73
}
93
74
94
75
return list
95
- ]]> </Implementation >
96
- </Method >
76
+ }
97
77
98
- <Method name =" OnPreDispatch" >
99
- <Description >
100
- This method Gets called prior to dispatch of the request. Put any common code here
101
- that you want to be executed for EVERY request. If pContinue is set to 0, the
102
- request will NOT be dispatched according to the UrlMap. If this case it's the
103
- responsibility of the user to return a response.</Description >
104
- <ClassMethod >1</ClassMethod >
105
- <FormalSpec ><![CDATA[ pUrl:%String,pMethod:%String,&pContinue:%Boolean]]> </FormalSpec >
106
- <ReturnType >%Status</ReturnType >
107
- <Implementation ><![CDATA[ Quit ..convertRequestBody()
108
- ]]> </Implementation >
109
- </Method >
78
+ /// This method Gets called prior to dispatch of the request. Put any common code here
79
+ /// that you want to be executed for EVERY request. If pContinue is set to 0, the
80
+ /// request will NOT be dispatched according to the UrlMap. If this case it's the
81
+ /// responsibility of the user to return a response.
82
+ ClassMethod OnPreDispatch (pUrl As %String , pMethod As %String , ByRef pContinue As %Boolean ) As %Status
83
+ {
84
+ Quit ..convertRequestBody ()
85
+ }
110
86
111
- <Method name =" convertRequestBody" >
112
- <Description >
113
- Конвертируем %request.Content в UTF8 и в объект класса %ZEN.proxyObject</Description >
114
- <ClassMethod >1</ClassMethod >
115
- <ReturnType >%Status</ReturnType >
116
- <Implementation ><![CDATA[
87
+ /// Конвертируем %request.Content в UTF8 и в объект класса %ZEN.proxyObject
88
+ ClassMethod convertRequestBody () As %Status
89
+ {
117
90
#dim %request As %CSP.Request
118
91
#dim obj As %ZEN.proxyObject
119
92
@@ -129,7 +102,7 @@ responsibility of the user to return a response.</Description>
129
102
130
103
set %request .Content = obj // obj это валидный UTF8 %ZEN.proxyObject
131
104
return $$$OK
132
- ]]> </ Implementation >
133
- </ Method >
134
- </ Class >
135
- </ Export >
105
+ }
106
+
107
+ }
108
+
0 commit comments