The current REST API already allows for the creation of an app-schema datastore: what is missing is the possibility to upload an app-schema mapping file to an already created app-schema datastore, or create a new datastore based on the uploaded mapping file.
There is already a REST endpoint to upload files to a datastore: /workspaces/<ws>/datastores/<ds>/[file|url|external][.<extension>]
The supported extensions so far are shape, properties, h2 and spatialite. I'm proposing to add a new extension, appschema, which will trigger the creation / update of an app-schema datastore.
For example:
where LandCoverVector.xml is an app-schema mapping file containing the mappings for two feature types, LandCoverDataset and LandCoverUnit, will result in the creation of a new app-schema datastore called LandCoverVector (the feature types in it will be automatically configured, thanks to the configure=all parameter).
In case the store already existed, the same request would have replaced the current mapping file with the uploaded file. However, the configure parameter should be set to none, to avoid configuring the same feature types twice.
Related discussion on the developer ML: http://sourceforge.net/p/geoserver/mailman/message/34194007/
Proposed implementation is here: https://github.com/geoserver/geoserver/pull/1106
|