« Return to Thread: Changing featuretype datastore using REST

Re: Changing featuretype datastore using REST

by ajayr :: Rate this Message:

Reply to Author | View in Thread

Hey Justin

Thanks for the information, yeah I have decided to make my implementation more RESTful based on ur suggestion.

Another question, do you know if the 1.7.5 version of geoserver's REST supports having multiple featuretypes for a single shapefile datastore. I know we can kinda do it through the admin GUI interface, any idea if the same can be done using REST interface?

Thanks

Ajay
Justin Deoliveira-6 wrote:
Hi Ajay,

ajayr wrote:
> Hi
>
> I am looking for examples to allow me to change the datastore associated
> with a featuretype  using REST API for geoserver
>
> One solution is to do a GET on an existing featuretype , extract the XML,
> modify the <store> tag and POST it back to the same layer
While this might work but it would not be considered good practice from
a REST perspective, because you are changing a resources location based
on its representation. ie you would do a PUT against the feature type,
but then it would move to another location....

A more RESTful (although less convenient) solution would be to:

1. Do a GET on the feature type, saving its representation
2. Do a DELETE on the feature type
3. Do a POST to the new datastore

-Justin
>
> Is there any other alternative and easier way to do this?
>
> Thanks
>
> Ajay
>
>


--
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.

------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

 « Return to Thread: Changing featuretype datastore using REST