Changes for page ERRest In Depth

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

From version 22.1
edited by Pascal Robert
on 2012/05/02 16:16
Change comment: There is no comment for this version
To version 31.1
edited by Pascal Robert
on 2012/06/10 12:21
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -1,3 +1,45 @@
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
18 +
19 +ERXRestUtils
20 +
21 +request > route
22 +
23 +{{code}}
24 +
25 + /**
26 + * A NameFormat that behaves like Rails -- plural entities, plural routes, lowercase underscore names
27 + * (names_like_this).
28 + */
29 + public static NameFormat RAILS = new NameFormat(true, true, NameFormat.Case.LowercaseUnderscore);
30 +
31 + /**
32 + * A NameFormat that behaves like WO -- singular entities, singular routes, camel names (NamesLikeThis).
33 + */
34 + public static NameFormat WO = new NameFormat(false, false, NameFormat.Case.CamelCase);
35 +
36 + /**
37 + * A NameFormat that behaves like WO -- singular entities, singular routes, lowercase camel names (namesLikeThis).
38 + */
39 + public static NameFormat WO_LOWER = new NameFormat(false, false, NameFormat.Case.LowerCamelCase);
40 +
41 +{{/code}}
42 +
1 1  * ERXRestContext
2 2  ** contains the editing context and an userInfo dictionnary
3 3  ** will be populated with er.rest.dateFormat, er.rest.timestampFormatter and er.rest.timestampFormat (read only for non-HTML responses)
... ... @@ -17,14 +17,18 @@
17 17  *
18 18  ** you just need to override createRestContext() in your controller if you want to add other stuff to the context (a user, etc.)
19 19  * Properties
20 -** ERXRest.idKey
21 -** ERXRest.typeKey
22 -** ERXRest.nilKey
23 -** ERXRest.writeNilKey
24 -** ERXRest.pluralEntityNames
25 -** ERXRest.writeTypeKey
26 -** ERXRest.suppressTypeAttributesForSimpleTypes
62 +** ERXRest.idKey (ERXRestFormatDelegate)
63 +*** (default "id") Override this property if you want to use a different key for the 'id' attribute** ERXRest.typeKey**
64 +** ERXRest.nilKey (ERXRestFormatDelegate)
65 +** ERXRest.writeNilKey (ERXRestFormatDelegate)
66 +** ERXRest.pluralEntityNames (ERXRestFormatDelegate)
67 +** ERXRest.writeTypeKey (ERXRestFormatDelegate)
68 +** ERXRest.suppressTypeAttributesForSimpleTypes (ERXXmlRestWriter)
69 +*** (default "false") If set to true, primitive types, like type = "datetime", won't be added to the output
27 27  ** ERXRest.strictMode
71 +*** In ERXMissingRouteController: (default "true") If set to true, status code in the response will be 405 Not Allowed, if set to false, status code will be 404 Not Found
72 +*** In ERXRouteController: (default "true") If set to true, status code in the response will be 405 Not Allowed, if set to false, status code will be 404 Not Found
73 +*** ERXRouteResults: (default "true") If set to true, creating a ressource will return status code 201 Created, if set to false, will return 200 OK
28 28  ** ERXRest.pluralEntityNames (ERXRouteRequestHandler)
29 29  ** ERXRest.routeCase (ERXRouteRequestHandler)
30 30  ** ERXRest.lowercaseEntityNames (ERXRouteRequestHandler)
... ... @@ -42,8 +42,18 @@
42 42  ** er.rest.timestampFormat.secondary
43 43  ** er.rest.timestampFormatter
44 44  ** er.rest.rfcDateFormat
45 -** ERXRest.transactionsEnabled
46 -** ERXRest.maxEventsPerTransaction
91 +** er.rest.jodaTime
92 +** ERXRest.transactionsEnabled (default 'false') ERXRestTransactionRequestAdaptor
93 +** ERXRest.maxEventsPerTransaction (default '50') ERXRestTransactionRequestAdaptor
94 +** ERXRest.accessControlAllowRequestHeaders (ERXRouteController)
95 +** ERXRest.accessControlAllowRequestMethods (ERXRouteController)
96 +** ERXRest.defaultFormat (ERXRouteController)
97 +*** (default "xml") Allow you to set the default format for all of your REST controllers
98 +** ERXRest.allowWindowNameCrossDomainTransport (ERXRouteController)
99 +** ERXRest.accessControlMaxAge (ERXRouteController)
100 +*** (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.
101 +** ERXRest.accessControlAllowOrigin (ERXRouteController)
102 +*** Set the value to '**' to enable all origins. See [[https://developer.mozilla.org/En/HTTP_access_control#Access-Control-Allow-Origin]]**
47 47  * JSON Schema
48 48  ** {{code}}
49 49  /something?schema=true
... ... @@ -56,31 +56,7 @@
56 56   return request().stringFormValueForKey("schema") != null;
57 57  }
58 58  {{/code}}
59 -* Same Origin policy
60 -Transactions
61 -HTML vs other formats
62 -Response representation
63 -Missing route
64 -Missing object
65 -POJO objects
66 -Headers
67 -Caching
68 -Adding new format
69 -Security
70 -strictMode
71 -Workflow
72 -Query arguments and RXRestFetchSpecification
73 -ERXRestNameRegistry
74 -MapClassDescription / NSDictionaryClassDescription
75 75  
76 -ERXRestUtils
77 -Properties
78 -er.rest.dateFormat
79 -er.rest.timestampFormat
80 -er.rest.rfcDateFormat
81 -
82 -request > route
83 -
84 84  Application(ERXApplication).dispatchRequest(WORequest) line: 2051
85 85  ERXRouteRequestHandler(WOActionRequestHandler).//handleRequest(WORequest) line: 221
86 86  ERXRouteRequestHandler.getRequestHandlerPathForRequest(WORequest) line: 782//
... ... @@ -112,13 +112,3 @@
112 112  | ERXRest.strictMode | ERXRest.strictMode
113 113  \\          |
114 114  ERXRouteController
115 -
116 -Properties
117 -
118 -ERXRest.accessControlAllowRequestHeaders
119 -ERXRest.accessControlAllowRequestMethods
120 -ERXRest.defaultFormat
121 -ERXRest.strictMode
122 -ERXRest.allowWindowNameCrossDomainTransport
123 -ERXRest.accessControlMaxAge
124 -ERXRest.accessControlAllowOrigin