Changes between Version 4 and Version 5 of Future/RESTfulWebServices
- Timestamp:
- 03/19/08 22:06:29 (17 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Future/RESTfulWebServices
v4 v5 11 11 = Conventions = 12 12 13 For now lets assume the URI: !http://example.org/mapguide/rest is the root of the !MapGuide RESTful web services. All subsequent URIs below will leave this part off and focus on resources and their representations.13 All of the calls here assume a HOST header similar to "HOST: example.org". As well, all requests would be located under /mapguide/rest but in this document we will assume that they start from the document root. 14 14 15 15 Unless otherwise stated, you can assume that a GET returns the content of the resource, a POST creates a new resource from the HTTP body contents, a PUT replaces the contents of an existing resource with the contents of the HTTP body, and a DELETE removes the resource. The HTTP contents returned for these requests is variable depending on what is requested, but proper HTTP response codes (200, 404, and many other relevant codes) must be issued to ensure correct behaviour of the clients. … … 73 73 74 74 {{{ 75 http://example.org/library/PathTo/Resource.FeatureSource 76 }}} 77 78 Or, in an actual installation, as: 79 80 {{{ 75 81 http://example.org/mapguide/rest/library/PathTo/Resource.FeatureSource 76 82 }}} 77 83 84 78 85 It is important to note that these will always be provided without hints to content type. 79 86 … … 91 98 92 99 {{{ 93 GET 94 .../library/MyStuff/Parcels.FeatureSource/content 100 GET /library/MyStuff/Parcels.FeatureSource/content 95 101 }}} 96 102 … … 101 107 102 108 {{{ 103 PUT 104 .../library/MyStuff/Parcels.FeatureSource/header 109 PUT /library/MyStuff/Parcels.FeatureSource/header 105 110 }}} 106 111 … … 108 113 109 114 {{{ 110 POST 111 .../library/MyStuff/Parcels.FeatureSource/data/<dataname>.<datatype> 115 POST /library/MyStuff/Parcels.FeatureSource/data/<dataname>.<datatype> 112 116 }}} 113 117 … … 117 121 118 122 {{{ 119 GET 120 .../library/MyStuff?depth=<depth>&type=<resourcetype> 123 GET /library/MyStuff?depth=<depth>&type=<resourcetype> 121 124 }}} 122 125 … … 124 127 125 128 {{{ 126 GET 127 .../library/MyStuff/Parcels.FeatureSource/data 129 GET /library/MyStuff/Parcels.FeatureSource/data 128 130 }}} 129 131 … … 131 133 132 134 {{{ 133 GET 134 .../session/<uglysessionid>/Parcels.LayerDefinition 135 GET /session/<uglysessionid>/Parcels.LayerDefinition 135 136 }}} 136 137 … … 140 141 141 142 {{{ 142 POST 143 .../services/CopyResource 143 POST /services/CopyResource 144 144 Source=http://example.com/mapguide/rest/library/MyStuff/Parcels.FeatureSource 145 145 Destination=http://example.com/mapguide/rest/library/MyStuff/ParcelsCopy.FeatureSource … … 150 150 Now this is where things start to get interesting. What alternate representations do we expose for Feature Sources to support the Feature Services API? 151 151 152 153 152 ''' (jb) QUESTION: Again, I am somewhat concerned that we are introducing elements (schema, spatialcontexts, features) that the client has to just know about. Is there any way that we can return an enumeration of these endpoints when the MyData.FeatureSource is requested?.''' 154 153 … … 156 155 157 156 {{{ 158 GET 159 .../library/MyStuff/MyData.FeatureSource/schema 157 GET /library/MyStuff/MyData.FeatureSource/schema 160 158 }}} 161 159 … … 163 161 164 162 {{{ 165 GET 166 .../library/MyStuff/MyData.FeatureSource/schema/<schemaname> 167 }}} 168 169 {{{ 170 GET 171 .../library/MyStuff/MyData.FeatureSource/schema/<schemaname>/<classname> 163 GET /library/MyStuff/MyData.FeatureSource/schema/<schemaname> 164 }}} 165 166 {{{ 167 GET /library/MyStuff/MyData.FeatureSource/schema/<schemaname>/<classname> 172 168 }}} 173 169 … … 175 171 176 172 {{{ 177 GET 178 .../library/MyStuff/MyData.FeatureSource/spatialcontexts 173 GET /library/MyStuff/MyData.FeatureSource/spatialcontexts 179 174 }}} 180 175 … … 182 177 183 178 {{{ 184 GET 185 .../library/MyStuff/MyData.FeatureSource/features/<schemaname>/<classname> 179 GET /library/MyStuff/MyData.FeatureSource/features/<schemaname>/<classname> 186 180 187 181 Optional Parameters: … … 197 191 198 192 {{{ 199 GET 200 .../library/MyStuff/MyData.FeatureSource/features/<schemaname>/<classname>/<id> 193 GET /library/MyStuff/MyData.FeatureSource/features/<schemaname>/<classname>/<id> 201 194 }}} 202 195 … … 204 197 205 198 {{{ 206 DELETE 207 .../library/MyStuff/MyData.FeatureSource/features/<schemaname>/<classname>/<id> 199 DELETE /library/MyStuff/MyData.FeatureSource/features/<schemaname>/<classname>/<id> 208 200 }}} 209 201 … … 211 203 212 204 {{{ 213 DELETE 214 .../library/MyStuff/MyData.FeatureSource/features/<schemaname>/<classname> 205 DELETE /library/MyStuff/MyData.FeatureSource/features/<schemaname>/<classname> 215 206 216 207 Required Parameter: … … 223 214 224 215 {{{ 225 POST 226 .../library/MyStuff/MyData.FeatureSource/features/<schemaname>/<classname> 216 POST /library/MyStuff/MyData.FeatureSource/features/<schemaname>/<classname> 227 217 }}} 228 218 … … 230 220 231 221 {{{ 232 PUT 233 .../library/MyStuff/MyData.FeatureSource/features/<schemaname>/<classname> 222 PUT /library/MyStuff/MyData.FeatureSource/features/<schemaname>/<classname> 234 223 235 224 Required Parameter: … … 237 226 }}} 238 227 239 In both cases the HTTP request envelope must contain a property value collection that defines either the properties of the newly created feature or the properties to be updated and their new values. The collection could be in either JSON or XML format and an open question whether the URI should specify the expected type? 240 241 ''' (jb) QUESTION: Say what?''' 242 243 [[BR]] 244 [[BR]] 228 In both cases the HTTP request envelope must contain a property value collection that defines either the properties of the newly created feature or the properties to be updated and their new values. The collection could be in either JSON or XML format. 229 230 ''' (rb) QUESTION: whether the URI should specify the expected type? ''' 231 232 ''' (jb) QUESTION: Say what?''' 233 234 245 235 '''TBD''' - Still need to think about how to support other Feature Service operations 246 [[BR]] 247 [[BR]] 248 [[BR]] 236 249 237 250 238 == Alternate Representations for Maps, Map Definitions, and Layer Definitions == … … 255 243 256 244 {{{ 257 POST 258 .../session/<uglysesssionid>/MyMap.Map 245 POST /session/<uglysesssionid>/MyMap.Map 259 246 260 247 Required Parameters: … … 263 250 264 251 {{{ 265 POST 266 .../session/<uglysesssionid>/MyMap.Map 252 POST /session/<uglysesssionid>/MyMap.Map 267 253 268 254 Required Parameters: … … 274 260 275 261 {{{ 276 POST 277 .../services/createmap 262 POST /services/createmap 278 263 Required Parameters: 279 264 session=<uglysesssionid> … … 290 275 291 276 {{{ 292 GET 293 .../session/<uglysesssionid>/MyMap.Map/image 277 GET /session/<uglysesssionid>/MyMap.Map/image 294 278 295 279 Optional Parameters: … … 298 282 299 283 {{{ 300 POST 301 .../session/<uglysesssionid>/MyMap.Map/image 284 POST /session/<uglysesssionid>/MyMap.Map/image 302 285 303 286 Optional Parameters: … … 311 294 312 295 {{{ 313 GET 314 .../session/<uglysesssionid>/MyMap.Map/overlayimage 296 GET /session/<uglysesssionid>/MyMap.Map/overlayimage 315 297 316 298 Optional Parameters: … … 319 301 320 302 {{{ 321 POST 322 .../session/<uglysesssionid>/MyMap.Map/overlayimage 303 POST /session/<uglysesssionid>/MyMap.Map/overlayimage 323 304 324 305 Optional Parameters: … … 327 308 328 309 {{{ 329 GET 330 .../library/MyStuff/MyMap.MapDefinition/basetileimage/<baselayergroupname>/<scaleindex>/<tilecolumn>,<tilerow> 331 310 GET /library/MyStuff/MyMap.MapDefinition/basetileimage/<baselayergroupname>/<scaleindex>/<tilecolumn>,<tilerow> 332 311 }}} 333 312 … … 336 315 ''' (jb) COMMENT: For the /basetileimage calls, it is critical that we support all standard HTTP caching headers. This means checking state of the underlying tile; does this require new APIs for the tile service to return properties of the existing tile when not generating fresh? ''' 337 316 338 339 317 To build a cool client application, we need information about the map, the layers, the layer groups, etc. The next set of operations is designed to return an informational representation of map that can be used to create a compelling user interface. These could be in JSON or XML. 340 318 341 319 {{{ 342 GET 343 .../session/<uglysesssionid>/MyMap.Map 344 345 GET 346 .../session/<uglysesssionid>/MyMap.Map/layers 347 348 GET 349 .../session/<uglysesssionid>/MyMap.Map/layers/<layername> 350 351 GET 352 .../session/<uglysesssionid>/MyMap.Map/layergroups 353 354 GET 355 .../session/<uglysesssionid>/MyMap.Map/layergroups/<layergroupname> 320 GET /session/<uglysesssionid>/MyMap.Map 321 322 GET /session/<uglysesssionid>/MyMap.Map/layers 323 324 GET /session/<uglysesssionid>/MyMap.Map/layers/<layername> 325 326 GET /session/<uglysesssionid>/MyMap.Map/layergroups 327 328 GET /session/<uglysesssionid>/MyMap.Map/layergroups/<layergroupname> 356 329 }}} 357 330 … … 359 332 360 333 {{{ 361 GET 362 .../library/MyStuff/MyLayer.LayerDefinition/legendicon/<mapscale>/<geomtype>/<themecat> 334 GET /library/MyStuff/MyLayer.LayerDefinition/legendicon/<mapscale>/<geomtype>/<themecat> 363 335 364 336 Optional Parameters: … … 370 342 371 343 {{{ 372 GET 373 .../session/<uglysesssionid>/MyMap.Map/features 344 GET /session/<uglysesssionid>/MyMap.Map/features 374 345 375 346 Optional (but highly recommended) Parameters: … … 384 355 ''' (jb) COMMENT: Some services have suggested storing the spatial filter feature as its own resource, and just refering to it in the GET. This would prevent problems with overflowing the GET max size''' 385 356 386 [[BR]] 387 [[BR]] 357 388 358 '''TBD''' - Still need more stuff for adding layers dynamically, plotting to DWF, etc. 389 [[BR]] 390 [[BR]] 359 360 391 361 ''' (rb) Note: Within all of this the handling of selection is bugging me. We need to think about that some more and figure out what is the right way of handling selection RESTfully. ''' 392 [[BR]] 362 393 363 394 364 == Other Necessary Stuff == … … 396 366 397 367 {{{ 398 POST 399 .../session 368 POST /session 400 369 }}} 401 370 402 403 404 371 There is no required HTTP request envelope and the return envelope would simply contain the newly created session URI, e.g. http://somemgsite.org/mapguide/rest/session/<newuglysessionid>/ along with a 201 header. 405 372