[Geoserver-devel] [jira] Created: (GEOS-3271) grouplayer can not be added by REST API when using namespaces

grouplayer can not be added by REST API when using namespaces
-------------------------------------------------------------

                 Key: GEOS-3271
                 URL: http://jira.codehaus.org/browse/GEOS-3271
             Project: GeoServer
          Issue Type: Bug
          Components: Configuration, REST
    Affects Versions: 1.7.5, 1.7.4
            Reporter: Piebe
            Assignee: Justin Deoliveira

When I add a layergroup using the Rest API (Geoserver 1.7.4) the server response with "HTTP/1.1 201 Created". However, when checking the layergroup is not there.

A quick (however less than ideal) workaround is to remove the namespace prefix from your layer names.

Example of the problem:

ADDING A LAYERGROUP:
curl -v -u admin:xxxx -XPOST -H "Content-type: text/xml" -d
"<layerGroup><name>test</name><layers><layer>test:datatransport_ma_p</layer><layer>test:datatransport_ma_l</layer><layer>test:datatransport_ma_v</layer></layers><styles><style>maatvoering_punt</style><style>maatvoering_lijn</style><style>maatvoering_vlak</style></styles><bounds><minx>3.0</minx><maxx>6.0</maxx><miny>51.0</miny><maxy>54.0</maxy><crs
class='projected'>EPSG:28992</crs></bounds></layerGroup>"
http://test:8083/geoserver-test/rest/layergroups

* About to connect() to wion-test port 8083 (#0)
* Trying 192.168.3.69... connected
* Connected to test (192.168.3.69) port 8083 (#0)
* Server auth using Basic with user 'admin'
> POST /geoserver-test/rest/layergroups HTTP/1.1
> Authorization: Basic YWRtaW46bWFuYWdlcg==
> User-Agent: curl/7.19.5 (i586-pc-mingw32msvc) libcurl/7.19.5 zlib/1.2.3
> Host: test:8083
> Accept: */*
> Content-type: text/xml
> Content-Length: 438
>
< HTTP/1.1 201 Created
< Server: Apache-Coyote/1.1
< Date: Mon, 13 Jul 2009 13:04:42 GMT
< Location: http://test:8083/geoserver-test/rest/layergroups/test
< Server: Noelios-Restlet-Engine/1.0..8
< Transfer-Encoding: chunked
<
* Connection #0 to host test left intact
* Closing connection #0

NOW CHECKING IF IT IS THERE:

curl -v -u admin:xxx -XGET -H "Content-type: text/xml"
http://test:8083/geoserver-test/rest/layergroups
* About to connect() to wion-test port 8083 (#0)
* Trying 192.168.3.69... connected
* Connected to test (192.168.3.69) port 8083 (#0)
* Server auth using Basic with user 'admin'
> GET /geoserver-test/rest/layergroups HTTP/1.1
> Authorization: Basic YWRtaW46bWFuYWdlcg==
> User-Agent: curl/7.19.5 (i586-pc-mingw32msvc) libcurl/7.19.5 zlib/1.2.3
> Host: wion-test:8083
> Accept: */*
> Content-type: text/xml
>
< HTTP/1.1 200 OK
< Server: Apache-Coyote/1.1
< Date: Mon, 13 Jul 2009 13:05:29 GMT
< Server: Noelios-Restlet-Engine/1.0..8
< Content-Type: text/html
< Transfer-Encoding: chunked
<
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
<html xmlns="http://www.w3.org/1999/xhtml&quot; xml:lang="en" lang="en">
<head>
    <title>GeoServer Configuration</title>
</head>
<body>

Layers:
<ul>
  <li><a
href="http://test:8083/geoserver-test/rest/layergroups/test:datatransport_an.html&quot;&gt;test:datatransport\_an&lt;/a&gt;&lt;/li&gt;
  <li><a
href="http://test:8083/geoserver-test/rest/layergroups/test:eigentopo.html&quot;&gt;test:eigentopo&lt;/a&gt;&lt;/li&gt;
</ul>
</body>
</html>
* Connection #0 to host test left intact
* Closing connection #0

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira