[mapguide-internals] RESTful Ramblings of a Restless Lunatic

Robert Bray rbray at robertbray.net
Thu Oct 4 00:46:38 EDT 2007


Answers inline below...

Paul Spencer wrote:
> I haven't had time to read this in detail, nor do I understand how to 
> craft RESTful interfaces yet.  I have a specific question about 
> enumeration, please feel free to tell me I don't know what the hell I'm 
> talking about :)
> 
> 1) I don't understand how the url gets built with parameters in a 
> RESTful approach, can you provide an example of what the url would look 
> like?

It looks just like any other parameterized URI:

http://somemgsite.org/library.json?depth=0&type=LayerDefinition

The library.json bugs the heck out of me, but that is the expected syntax.

> 
> 2) Is it RESTful to craft the numerate resources as follows:
> 
> GET /Library/
> 
> returns all resources at all depths below /Library
> 
> GET /Libary/n
> 
> returns the content n levels deep
> 
> GET /Libary/FeatureSource
> GET /Library/FeatureSource/n ... or GET /Library/n/FeatureSource
> 
> returns only feature sources?
> 
> Um, if the above is useful then how do we request the enumeration to 
> come back in .xml, .json etc?  By just appending /<content type> to the 
> end?

Not really. A / typically denotes that you are navigating a hierarchy. 
It is possible to do what you propose, but it seems really weird from my 
  perspective even though I think I saw an example of that somewhere.

> 
> Next question:  Is it possible to have two different resource types with 
> the same name in the same folder?  IE
> 
> /Library/Parks.FeatureSource
> /Library/Parks.LayerDefinition

Yes this is possible, so I don't think we can drop the type suffix.

> 
> If not, then what would the impact be of changing the various calls to 
> drop the type specifier?
> 
> Cheers
> 
> Paul
> 
> On 3-Oct-07, at 3:55 PM, Robert Bray wrote:
> 
>> All,
>>
>> I left FOSS4G last week somewhat pumped after seeing the talk Haris 
>> gave demonstrating his RESTful Web Service client. So I went out this 
>> weekend  purchased the O'Reilly RESTful Web Services book and read it 
>> mostly from cover to cover. That of course left me pondering what a 
>> RESTful interface to MapGuide should look like, so I spent a couple of 
>> hours hacking the following (still incomplete) proposal together:
>>
>> http://trac.osgeo.org/mapguide/wiki/RESTfulWebServices
>>
>> I approached this somewhat differently than Haris did, at this point 
>> it is up to you to decide whether that is bad or good. However I think 
>> my approach is pretty clean while exposing all of the capabilities of 
>> MapGuide in a RESTful manner.
>>
>> Feel free to either discuss this here on the list or add your comments 
>> to the Wiki page (or both).
>>
>> Bob
>> _______________________________________________
>> mapguide-internals mailing list
>> mapguide-internals at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/mapguide-internals
> 
> +-----------------------------------------------------------------+
> |Paul Spencer                          pspencer at dmsolutions.ca    |
> +-----------------------------------------------------------------+
> |Chief Technology Officer                                         |
> |DM Solutions Group Inc                http://www.dmsolutions.ca/ |
> +-----------------------------------------------------------------+
> 
> 
> 
> 
> 
> _______________________________________________
> mapguide-internals mailing list
> mapguide-internals at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapguide-internals
> 


More information about the mapguide-internals mailing list