Hi Robert, thank you for your answer! Hm, so it looks like a bug, or undocumented feature, at least. I am about to change the XML config files directly, until the issue is solved. Not nice, but hopefully it will work.
Kind regards, Michal Dne 08.04.2013 23:30, Robert Kulawik napsal: > Hi Michal, > > I discover this behavior in the last days too but I don't found a > solution to solve it yet. In the Geoserver version 2.2-beta2 it was > still possible to overwrite the defaultStyle after layer storage > using > the REST interface. In the versions 2.2.2 and newer it was no longer > possible. > > Maybe it helps to find a solution > > Best Regards > Robert > > Am 08.04.2013 22:02, schrieb [email protected]: > >> I am attaching the GeoServer log and my own log, where the requests >> and responses are recorded. My attention was caught by the following >> lines: >> >> 2013-04-08 19:35:24,358 DEBUG [catalog.impl] - Warning, some code is >> setting the LayerInfo name, but that will be ignored >> 2013-04-08 19:35:24,358 DEBUG [geoserver.config] - Persisting layer >> line_crs >> 2013-04-08 19:35:24,359 DEBUG [geoserver.config] - Persisted >> org.geoserver.catalog.impl.LayerInfoImpl to >> /data/geoserver/data/workspaces/dragouni/line_crs/line_crs/layer.xml >> 2013-04-08 19:35:24,359 DEBUG [gwc.layer] - Handling modify event >> for LayerInfoImpl[line_crs, resource:FeatureTypeInfoImpl >> [6][line_crs]] >> 2013-04-08 19:35:24,361 DEBUG [geoserver.config] - Persisted >> sun.proxy.$Proxy506 to /data/geoserver/data/global.xml >> 2013-04-08 19:35:24,361 INFO [catalog.rest] - PUT layer >> dragouni:line_crs >> >> But I am not sure, what exactly that means. >> >> I am aware, that I am not allowed to change the name or resource of >> the layer (in such a case I would expect status code 403), but should >> it be possible to change the defualtStyle? >> >> Michal >> >> Dne 08.04.2013 18:48, [email protected] napsal: >> >>> Dear all, >>> >>> I cannot change the default style of a layer using the REST API. >>> >>> I GET the Layer, change some values and PUT it back, get 200 OK. >>> Other >>> things are nicely changed, but the 'defaultStyle' is not. >>> >>> It goes like this: >>> >>> GET Layer: >>> >>> >>> {"layer":{"name":"line_crs","type":"VECTOR","defaultStyle":{"name":"line","href":"http://erra.ccss.cz:8080/geoserver/rest/styles/line.json" >>> >>> [1]},"resource":{"@class":"featureType","name":"line_crs","href":"http://erra.ccss.cz:8080/geoserver/rest/workspaces/dragouni/datastores/line_crs/featuretypes/line_crs.json" >>> >>> [2]},"enabled":true,"attribution":{"logoWidth":0,"logoHeight":0}}} >>> >>> PUT Layer: >>> >>> {"layer": {"resource": {"href": >>> >>> >>> "http://erra.ccss.cz:8080/geoserver/rest/workspaces/dragouni/datastores/line_crs/featuretypes/line_crs.json" >>> >>> [2], >>> >>> "name": "line_crs", "@class": "featureType"}, "name": "line_crs", >>> "enabled": "false", "defaultStyle": {"href": >>> >>> >>> "http://erra.ccss.cz:8080/geoserver/rest/workspaces/dragouni/styles/line_crs.json" >>> >>> [3], >>> >>> "name": "line_crs"}, "advertised": "false", "attribution": >>> {"logoWidth": "11", "logoHeight": "12"}, "type": "VECTOR", >>> "queryable": >>> "false"}} >>> >>> response: 200 OK >>> >>> GET Layer: >>> >>> >>> {"layer":{"name":"line_crs","type":"VECTOR","defaultStyle":{"name":"line","href":"http://erra.ccss.cz:8080/geoserver/rest/styles/line.json" >>> >>> [1]},"resource":{"@class":"featureType","name":"line_crs","href":"http://erra.ccss.cz:8080/geoserver/rest/workspaces/dragouni/datastores/line_crs/featuretypes/line_crs.json" >>> >>> [2]},"enabled":false,"advertised":false,"queryable":false,"attribution":{"logoWidth":11,"logoHeight":12}}} >>> >>> So enable, advertised, queryable, attribution logoWidth and >>> logoHeight >>> have changed, the default style has not. I have checked the >>> provided >>> style link in the browser, it works. I have assigned the style in >>> the >>> web interface a get the expected result: >>> >>> >>> {"layer":{"name":"line_crs","type":"VECTOR","defaultStyle":{"name":"line_crs","href":"http://erra.ccss.cz:8080/geoserver/rest/workspaces/dragouni/styles/line_crs.json" >>> >>> [3]},"resource":{"@class":"featureType","name":"line_crs","href":"http://erra.ccss.cz:8080/geoserver/rest/workspaces/dragouni/datastores/line_crs/featuretypes/line_crs.json" >>> >>> [2]},"enabled":false,"advertised":false,"queryable":false,"attribution":{"logoWidth":11,"logoHeight":12}}} >>> >>> I am using GeoServer 2.3-RC1. Any suggestions are welcome. >>> >>> Thank you in advance, >>> >>> Michal >>> >>> >>> ------------------------------------------------------------------------------ >>> Minimize network downtime and maximize team effectiveness. >>> Reduce network management and security costs.Learn how to hire >>> the most talented Cisco Certified professionals. Visit the >>> Employer Resources Portal >>> http://www.cisco.com/web/learning/employer_resources/index.html [4] >>> _______________________________________________ >>> Geoserver-users mailing list >>> [email protected] >>> https://lists.sourceforge.net/lists/listinfo/geoserver-users [5] >> >> >> ------------------------------------------------------------------------------ >> Minimize network downtime and maximize team effectiveness. >> Reduce network management and security costs.Learn how to hire >> the most talented Cisco Certified professionals. Visit the >> Employer Resources Portal >> http://www.cisco.com/web/learning/employer_resources/index.html [4] >> >> _______________________________________________ >> Geoserver-users mailing list >> [email protected] >> https://lists.sourceforge.net/lists/listinfo/geoserver-users [5] > > > > Links: > ------ > [1] http://erra.ccss.cz:8080/geoserver/rest/styles/line.json > [2] > > http://erra.ccss.cz:8080/geoserver/rest/workspaces/dragouni/datastores/line_crs/featuretypes/line_crs.json > [3] > > http://erra.ccss.cz:8080/geoserver/rest/workspaces/dragouni/styles/line_crs.json > [4] http://www.cisco.com/web/learning/employer_resources/index.html > [5] https://lists.sourceforge.net/lists/listinfo/geoserver-users > [6] resource:FeatureTypeInfoImpl > > > ------------------------------------------------------------------------------ > Minimize network downtime and maximize team effectiveness. > Reduce network management and security costs.Learn how to hire > the most talented Cisco Certified professionals. Visit the > Employer Resources Portal > http://www.cisco.com/web/learning/employer_resources/index.html > > _______________________________________________ > Geoserver-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/geoserver-users ------------------------------------------------------------------------------ Precog is a next-generation analytics platform capable of advanced analytics on semi-structured data. The platform includes APIs for building apps and a phenomenal toolset for data science. Developers can use our toolset for easy data analysis & visualization. Get a free account! http://www2.precog.com/precogplatform/slashdotnewsletter _______________________________________________ Geoserver-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/geoserver-users
