Arne Kepp wrote:
Andrea Aime wrote:
David Winslow ha scritto:
Hello all,
Arne and I are working on a new RESTful configuration API for geoserver datastores and featuretypes. We've added a page to the wiki at http://docs.codehaus.org/display/GEOS/RESTful+Configuration+API so please take a look and let us know of any concerns or questions you may have.
I've read the proposal, looks good. Some considerations:
* there is no specification on the resource representation. As Justin
said elsewhere, the content of the resource really depends on what
the actual configuration is supposed to look like, so it's bound
to change when we change the the config subsystem, and every time
we change the configuration options as well.
I would also like to point out the current feature type
config is not made only of info.xml, but may also contain another file
for an overridden feature type schema, see the citewfs-1.1
configuration for an example (it's just a type override, does not
really remodels the schema).
Thanks, and yes, we're very open to suggestions on how the feature
should be described. As a first approximation we intended to mimic the
configuration files, but we'll be happy to change that if people come up
with suggestions.
The other thing we have in there, that people may want pretty soon, is the templates for KML description and time stuff.
Though it's overkill for now, I wonder if eventually we might want the concept of a 'parent' feature type that things could inherit from, like it'd use their metadata and kml templates and the like.
* for feature types configuration it seems from the api you have to
"put" the info.xml file into the right path. So how do you know
what are the avaialble feature types? Maybe it's better to list
all of them and have a "active" flag to differentiate those that
are actually configured, or have a separate path that lists all
available feature types (and their structure), something like:
/api/datastore/{datastore}/availablefeaturetype/
/api/datastore/{datastore}/configuredfeaturetype/
(don't like the name but you get the idea)
If you go to api/datastore/{datastore} you should see a list of links to
information associated with the datastore, and if you click the link to
api/datastore/{datastore}/featuretype you see a list of the feature
types. I am not sure whether we should offer additional views based on
namespaces. These pages are rendered in XHTML, so that it can easily be
inspected with a normal browser. However, we haven't considered the
distinction between active and available feature types, so we need to
learn more about that.
Yeah, this distinction was one of the things I was thinking about as well. So right now, by default in the UI, if you configure a datastore none of its featureTypes are published. You have to go to the featureType page and make a default style, get the SRS and bounds. And hopefully you also fill out other metadata, like actual information about the data - abstract, keywords, ect, that crawlers can use and search on.
As for a separate path vs a flag, I think it depends on if 'active' is just a property, or if it's a different resources.
One way to handle it, which hits on something that I'd like to see, is a resource that's just:
/api/data/
And it would list all the configured featureTypes and Coverages. Though perhaps we should wait until we get the AtomPub implementation, since that should also have the ability to list such things, and then to get at the actual data.
So I'm leaning to just having an 'active' flag. I think it'd also be helpful to be able to create a new datastore and have it by default make all its feature types active (or at least all that it could). Perhaps at that step we could make the user supply metadata that they'd all inherit. But in general we can derive enough automatically in most cases that we shouldn't need to require doing lots of stuff to activate.
In turn if a featureType is missing a CRS or has something that really does prevent us from activating it we should have the REST interface reject turning it active unless they configure it.
* there is no mention of coverages over there?
That will come very soon, we omitted them so that people could start
discussing our proposal, but it will be there from the start.
* style editing is ok, but I think it could be a bit more ambitious
to support editing from javascript clients. You know, stuff like
exposing the structure of a style as a tree and have each part
be modifiable at will. As far as I remember Andrea Cappugi was
looking for something like this.
I am not sure this makes sense, or maybe the SLD files I wrote were just
poor. It seems to me that in many case you will want to modify every
branch of the SLD? Like when you change the color of a feature, you
probably want this to happen at every resolution.
I'd like to see what code he came up with. For now I think it'll be a big win just to be able to put and get styles.
One question that wasn't clear from the api - is listing and putting styles based on their filename? Or the actual 'name' of the SLD? Or an arbitrary name? I guess the current thing is an arbitrary name, but it should be noted that SLD's have a 'name' parameter.
I suppose now's not the time to rearrange the messy styling backend.
But I think what I might recommend is to also allow a post to api/style/ that then derives the name of the style from the 'name' portion of the SLD.
One last question - singular vs. plural for lists?
I was thinking it'd be /api/datastores/ and /api/styles/ instead of /api/datastore/ and /api/style/ Thoughts?
But yeah, this is looking quite nice, I'm excited.
Chris