Last week I sent out an email about some feedback I got on the geo-web-rest mailing list. So I set out to implement a "discovery document" as specified here:
http://xrds-simple.net/core/1.0/
My first thought was to more or less do what the IndexRestlet does, generate the document from registered routes, however I am finding it a bit lacking for what I need. While I could apply the same heuristic of only including routes that do not contain any variables, I think it might be useful to have something a bit more explicit. Especially if we adopt the URI template stuff that the opensocial stuff uses:
http://bitworking.org/news/URI_Templates
Also with the above approach there is no great way to figure out what the accepted media types of formats are.
So my thought is to instead add a sort of marker interface called "Discoverable". It would look something like this:
interface Discoverable {
String getType();
String getURI();
List<MediaType> getMediaTypes();
}
The uri property may be unnecessary as it could be derived from the route mapping. But the idea is that restlets that are "discoverable" would implement this interface.
Thoughts?
--
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.