Changes for page ERRest In Depth

Last modified by Pascal Robert on 2012/06/10 16:01

From version 45.1
edited by Pascal Robert
on 2012/06/10 16:01
Change comment: There is no comment for this version
To version 46.1
edited by Pascal Robert
on 2012/06/10 16:01
Change comment: Migrated to Confluence 4.0

Summary

Details

Page properties
Content
... ... @@ -1,20 +1,20 @@
1 1  General architecture
2 -Same Origin policy
3 -Transactions
4 -HTML vs other formats
5 -Response representation
6 -Missing route
7 -Missing object
8 -POJO objects
9 -Headers
10 -Caching
11 -Adding new format
12 -Security
13 -strictMode
14 -Workflow
15 -Query arguments and RXRestFetchSpecification
16 -ERXRestNameRegistry
17 -MapClassDescription / NSDictionaryClassDescription
2 + Same Origin policy
3 + Transactions
4 + HTML vs other formats
5 + Response representation
6 + Missing route
7 + Missing object
8 + POJO objects
9 + Headers
10 + Caching
11 + Adding new format
12 + Security
13 + strictMode
14 + Workflow
15 + Query arguments and RXRestFetchSpecification
16 + ERXRestNameRegistry
17 + MapClassDescription / NSDictionaryClassDescription
18 18  
19 19  Calling an action goes like this:
20 20  
... ... @@ -79,7 +79,6 @@
79 79  ERXRouteController.performHtmlActionNamed
80 80  
81 81  {{code}}
82 -
83 83   protected WOActionResults performHtmlActionNamed(String actionName) throws Exception {
84 84   WOActionResults results = null;
85 85  
... ... @@ -107,17 +107,14 @@
107 107  
108 108   return results;
109 109   }
109 +{{/code}}
110 110  
111 -{{/code}}
112 -
113 113  {{code}}
114 -
115 115   protected String pageNameForAction(String actionName) {
116 116   return entityName() + ERXStringUtilities.capitalize(actionName) + "Page";
117 117   }
115 +{{/code}}
118 118  
119 -{{/code}}
120 -
121 121  {{code}}
122 122  
123 123   protected boolean shouldFailOnMissingHtmlPage() {
... ... @@ -128,7 +128,7 @@
128 128  
129 129  ERXRestUtils
130 130  
131 -request > route
127 +request -> route
132 132  
133 133  {{code}}
134 134  
... ... @@ -153,10 +153,8 @@
153 153  * ERXRestContext
154 154  ** contains the editing context and an userInfo dictionnary
155 155  ** will be populated with er.rest.dateFormat, er.rest.timestampFormatter and er.rest.timestampFormat (read only for non-HTML responses)
156 -*** want to change the time format for a specific controller?
157 -
158 -{{code}}
159 -
152 +*** want to change the time format for a specific controller?
153 +** {{code}}
160 160  protected ERXRestContext createRestContext() {
161 161   ERXRestContext restContext = new ERXRestContext(editingContext());
162 162   restContext.setUserInfoForKey("yyyy-MM-dd", "er.rest.dateFormat");
... ... @@ -163,14 +163,10 @@
163 163   restContext.setUserInfoForKey("yyyy-MM-dd", "er.rest.timestampFormat");
164 164   return restContext;
165 165   }
166 -
167 -{{/code}}
168 -
169 -*
170 -** you just need to override createRestContext() in your controller if you want to add other stuff to the context (a user, etc.)
160 +{{/code}}you just need to override createRestContext() in your controller if you want to add other stuff to the context (a user, etc.)
171 171  * Properties
172 172  ** ERXRest.idKey (ERXRestFormatDelegate)
173 -*** (default "id") Override this property if you want to use a different key for the 'id' attribute** ERXRest.typeKey**
163 +*** (default "id") Override this property if you want to use a different key for the 'id' attribute~*~* ERXRest.typeKey
174 174  ** ERXRest.nilKey (ERXRestFormatDelegate)
175 175  ** ERXRest.writeNilKey (ERXRestFormatDelegate)
176 176  ** ERXRest.pluralEntityNames (ERXRestFormatDelegate)
... ... @@ -207,11 +207,14 @@
207 207  *** (default "xml") Allow you to set the default format for all of your REST controllers
208 208  ** ERXRest.allowWindowNameCrossDomainTransport (ERXRouteController)
209 209  ** ERXRest.accessControlMaxAge (ERXRouteController)
210 -*** (default 1728000) This header indicates how long the results of a preflight request can be cached. For an example of a preflight request, see the above examples.
200 +*** (default 1728000) This header indicates how long the results of a preflight request can be cached. For an example of a preflight request, see the above examples.
211 211  ** ERXRest.accessControlAllowOrigin (ERXRouteController)
212 -*** Set the value to '**' to enable all origins. See [[https://developer.mozilla.org/En/HTTP_access_control#Access-Control-Allow-Origin]]**
202 +*** Set the value to '*' to enable all origins. See [[https:~~/~~/developer.mozilla.org/En/HTTP_access_control#Access-Control-Allow-Origin>>url:https://developer.mozilla.org/En/HTTP_access_control#Access-Control-Allow-Origin||shape="rect"]]
213 213  * JSON Schema
214 -** {{code}}
204 +**
205 +
206 +{{code}}
207 +
215 215  /something?schema=true
216 216  
217 217  public WOActionResults indexAction() {
... ... @@ -221,36 +221,66 @@
221 221  protected boolean isSchemaRequest() {
222 222   return request().stringFormValueForKey("schema") != null;
223 223  }
217 +
224 224  {{/code}}
225 225  
226 226  Application(ERXApplication).dispatchRequest(WORequest) line: 2051
227 -ERXRouteRequestHandler(WOActionRequestHandler).//handleRequest(WORequest) line: 221
228 -ERXRouteRequestHandler.getRequestHandlerPathForRequest(WORequest) line: 782//
221 + ERXRouteRequestHandler(WOActionRequestHandler)._handleRequest(WORequest) line: 221
222 + ERXRouteRequestHandler.getRequestHandlerPathForRequest(WORequest) line: 782
229 229  
230 -ERXRouteRequestHandler(WOActionRequestHandler).//handleRequest(WORequest) line: 259
231 -PagesController(ERXRouteController).performActionNamed(String) line: 1328
232 -PagesController(ERXRouteController).performActionNamed(String, boolean) line: 1385
233 -PagesController(ERXRouteController).performRouteActionNamed(String) line: 1510
234 -PagesController(ERXRouteController).performActionWithArguments(Method, Object...) line: 1559
235 -...
236 -PagesController.mainPageAction() line: 20//
224 +ERXRouteRequestHandler(WOActionRequestHandler)._handleRequest(WORequest) line: 259
225 + PagesController(ERXRouteController).performActionNamed(String) line: 1328
226 + PagesController(ERXRouteController).performActionNamed(String, boolean) line: 1385
227 + PagesController(ERXRouteController).performRouteActionNamed(String) line: 1510
228 + PagesController(ERXRouteController).performActionWithArguments(Method, Object...) line: 1559
229 + ...
230 + PagesController.mainPageAction() line: 20
237 237  
238 238  == ERXRouteRequestHandler ==
239 239  
240 -| **Properties**
241 -| ERXRest.missingControllerName | (default "ERXMissingRouteController")
242 -\\          
243 -| ERXRest.parseUnknownExtensions | ERXRest.parseUnknownExtensions
244 -\\          
245 -| ERXRest.pluralEntityNames | ERXRest.pluralEntityNames
246 -\\          
247 -| ERXRest.routeCase | ERXRest.routeCase
248 -\\          
249 -| ERXRest.lowercaseEntityNames | ERXRest.lowercaseEntityNames
234 +|(((
235 +**Properties**
236 +)))
237 +|(((
238 +ERXRest.missingControllerName
239 +)))|(((
240 +(default "ERXMissingRouteController")
241 +
242 +)))
243 +|(((
244 +ERXRest.parseUnknownExtensions
245 +)))|(((
246 +ERXRest.parseUnknownExtensions
247 +
248 +)))
249 +|(((
250 +ERXRest.pluralEntityNames
251 +)))|(((
252 +ERXRest.pluralEntityNames
253 +
254 +)))
255 +|(((
256 +ERXRest.routeCase
257 +)))|(((
258 +ERXRest.routeCase
259 +
260 +)))
261 +|(((
262 +ERXRest.lowercaseEntityNames
263 +)))|(((
264 +ERXRest.lowercaseEntityNames
265 +)))
250 250  
251 251  ERXMissingRouteController is the controller that is used when no route can be found. It's "missing" action is loaded.
252 252  
253 -| **Properties**
254 -| ERXRest.strictMode | ERXRest.strictMode
255 -\\          |
269 +|(((
270 +**Properties**
271 +)))
272 +|(((
273 +ERXRest.strictMode
274 +)))|(((
275 +ERXRest.strictMode
276 +
277 +)))
278 +
256 256  ERXRouteController