[Geoserver-users] Struggling to assign the 'defaultStyle' of a Layer by editing the XML config file

Hi all,

I am struggling to change the 'defaultStyle' of a layer by directly editing the layer.xml file.

I take the style style id

<style>
   <id>StyleInfoImpl--1f4a60a3:13d3b0cb42e:-7eb1</id>

from the style file

geoserver/data/workspaces/<workspace>/styles/<styleName>.xml

And set it as a defaultStyle of the layer

<layer>
   ...
   <defaultStyle>
     <id>StyleInfoImpl--1f4a60a3:13d3b0cb42e:-7eb1</id>

in the layer file

geoserver/data/workspaces/<workspace>/<store>/<layerName>/layer.xml

And I still see the old style assigned in both rest and web interface.

Am I missing somethig?

(I would rather use the REST PUT Layer request, but that does not currently work as discussed here:
http://osgeo-org.1560.x6.nabble.com/Cannot-change-the-defaultStyle-of-a-layer-with-REST-td5045304.html )

Thank you very much,

Michal

Okay, looks like I need to reload the configuration:

http://docs.geoserver.org/stable/en/user/rest/api/reload.html

Dne 15.04.2013 11:57, sredl@anonymised.com napsal:

Hi all,

I am struggling to change the 'defaultStyle' of a layer by directly
editing the layer.xml file.

I take the style style id

<style>
  <id>StyleInfoImpl--1f4a60a3:13d3b0cb42e:-7eb1</id>

from the style file

geoserver/data/workspaces/<workspace>/styles/<styleName>.xml

And set it as a defaultStyle of the layer

<layer>
  ...
  <defaultStyle>
    <id>StyleInfoImpl--1f4a60a3:13d3b0cb42e:-7eb1</id>

in the layer file

geoserver/data/workspaces/<workspace>/<store>/<layerName>/layer.xml

And I still see the old style assigned in both rest and web interface.

Am I missing somethig?

(I would rather use the REST PUT Layer request, but that does not
currently work as discussed here:

http://osgeo-org.1560.x6.nabble.com/Cannot-change-the-defaultStyle-of-a-layer-with-REST-td5045304.html
)

Thank you very much,

Michal