I got this error when I tried to create a new LayerGroup:

:Layer group within a workspace (testWS) can not contain resources from
other workspace: NAIP

Below is the command I used to create the LayerGroup:

curl -v -u $user:$password -XPOST -H "Content-type: text/xml" -d @$xmlFile 
http://$host:$port/geoserver/rest/workspaces/$workspace/layergroups

Where:
$workspace=testWS
$xmlFile:
<layerGroup>
<name>Test-Imagery</name>
<mode>SINGLE</mode>
<title>Collection of Test Imagery</title>
<workspace> <name>testWS</name> </workspace>
<publishables>
<published type="layer">
      <name>Sioux-Falls</name>
      <atom:link xmlns:atom="http://www.w3.org/2005/Atom"; rel="alternate"
href="http://'$host:$port'/geoserver/rest/layer/Sioux-Falls.xml"
type="application/xml"/>
    </published>
</publishables>
<styles>

</styles>
</layerGroup>

I am trying to create the LayerGroup for <testWS:Sioux-Falls> layer and the
error only occurs when I also have to the layer named "NAIP:Sioux-Falls" and
the order of the "NAIP:Sioux-Falls" comes before "testWS:Sioux-Falls" layer. 
I am not sure whether this is a bug or my XML is not specific enough.  It
seems to me that the code only tries to find the layer name and takes
whatever it finds first without considering the workspace.  Can someone let
me know how I can specify more specific so it finds the correct layers?

Many thanks.

Regards,
Tam





--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/Problem-with-creating-LayerGroup-using-REST-api-tp5138216.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.  Get 
unparalleled scalability from the best Selenium testing platform available.
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to