« Return to Thread: Changing featuretype datastore using REST

Re: Changing featuretype datastore using REST

by Justin Deoliveira-6 :: Rate this Message:

Reply to Author | View in Thread

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@...
https://lists.sourceforge.net/lists/listinfo/geoserver-users

 « Return to Thread: Changing featuretype datastore using REST