Hi,
I am trying to rename a feature-type using the rest configuration tool and
when I do the link to the datastore becomes invalid (a slash missing). Here
is the request sent to change the feature-type's name from
united_kingdom_administrative to TestA:
PUT
/geoserver/rest/workspaces/SCAMBS/datastores/TestA/featuretypes/united_kingdom_administrative.xml
HTTP/1.1
Host: localhost
Content-Type: text/xml
Content-Length: 61
Authorization: Basic YWRtaW46Z2Vvc2VydmVy
Connection: Close
<featureType> <name>TestA</name> </featureType>
and here is the store tag from the new feature-type
/geoserver/rest/workspaces/SCAMBS/datastores/TestA/featuretypes/TestA.xml:
<store class="dataStore">
<name>TestA</name>
<atom:link rel="alternate"
href="http://localhost:8080/geoserver/rest/workspaces/SCAMBS/datastoresTestA.xml"
type="application/xml"/>
</store>
The end of the URL should be "datastores/TestA.xml". Is my PUT request
incorrect? or is this an error in the rest configuration tool?
--
View this message in context: http://www.nabble.com/Renaming-feature-type-via-rest-provides-invalid-URL-tp23136321p23136321.html
Sent from the GeoServer - User mailing list archive at Nabble.com.
Hmmm... interesting. Actually you should have got an exception when you tried to change the name. But looking at the code it seems there is not a check for it.
The reasoning for not allowing name changes is two fold. 1) is that the name is more less equal to the identifier, and changing the identifier will throw other things off.
2) is that it not technically RESTful since changing the name means changing the resource URI or location.
So what I would try doing if you want to move a resource is
1) do a GET to gets its representation
2) do a DELETE to remove it
3) change the name in its representation
3) do a POST to add the newly named resource
-Justin
dk80 wrote:
Hi,
I am trying to rename a feature-type using the rest configuration tool and
when I do the link to the datastore becomes invalid (a slash missing). Here
is the request sent to change the feature-type's name from
united_kingdom_administrative to TestA:
PUT
/geoserver/rest/workspaces/SCAMBS/datastores/TestA/featuretypes/united_kingdom_administrative.xml
HTTP/1.1
Host: localhost Content-Type: text/xml Content-Length: 61 Authorization: Basic YWRtaW46Z2Vvc2VydmVy Connection: Close
<featureType> <name>TestA</name> </featureType>
and here is the store tag from the new feature-type
/geoserver/rest/workspaces/SCAMBS/datastores/TestA/featuretypes/TestA.xml:
<store class="dataStore">
<name>TestA</name>
<atom:link rel="alternate"
href="http://localhost:8080/geoserver/rest/workspaces/SCAMBS/datastoresTestA.xml"
type="application/xml"/>
</store>
The end of the URL should be "datastores/TestA.xml". Is my PUT request
incorrect? or is this an error in the rest configuration tool?
--
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.