Hi Babi, I ran into similar difficulties when setting up raster coverages on GeoServer 2.0.2 via the REST API and found the following to solve the problem. Try adding '<enabled>true</enabled>' to the style update command, so that it looks like this:
"curl -u admin:geoserver -XPUT -H 'Content-type: text/xml' -d '<layer><defaultStyle><name>roads_style</name></defaultStyle><enabled>true</enabled></layer>' http://localhost:9090/geoserver/rest/layers/acme:roads" Hope that helps you out! Regards, Paula *************************************** Paula Perkola Trainee Research Scientist VTT Technical Research Centre of Finland ________________________________ From: Jody Garnett [mailto:[email protected]] Sent: 19. elokuuta 2010 3:55 To: Barbara Cintoli Cc: [email protected] Subject: [Geoserver-users] REST not able to edit style? (rest config example incorrect) Next suggestion is to title the message so that it gets the attention of REST developers :-) Barbara I have not personally used the REST api so I am going to drop out of the conversation at this point. Jody On 18/08/2010, at 10:13 PM, Barbara Cintoli wrote: Hello, I am trying to change the style associated with a Shapefile. I created a new style using graphical interface and I entered it in the list of styles. The steps to add a new style in Geoserver, using graphics interface are: - Select "Style"; - "Add new style"; - Insert name and its text; - Press "Submit". Now the new style is in the style list. Then, if I join the style to my layer directly through interface of Geoserver 2.02 I am able to visualize it. In particular, the steps are: - Select "Layers"; - Choose a layer and click on its name; - Select "Publishing" and change "Default Style" to the new style. If instead, I use the example in the documentation layer becomes "not enabled" and then I can not see it. Precisely, the example is this: http://docs.geoserver.org/stable/en/user/extensions/rest/rest-config-examples-curl.html (section Changing a feature type style) and the command used is: "curl -u admin:geoserver -XPUT -H 'Content-type: text/xml' -d '<layer><defaultStyle><name>roads_style</name></defaultStyle></layer>' http://localhost:9090/geoserver/rest/layers/acme:roads" where: roads_style is created style; acme is the workspace and roads is the layer name. I think that it's an issue related to the update of the layer but currently I don't know how I can resolve it. I also have another question: in Geoserver 2.02 to change the style to layer I must necessarily create layer first and then change its default style? Precisely, I have to create the layer with this command: curl -u admin:geoserver -XPOST -H 'Content-type: text/xml' \ -d '<featureType><name>buildings</name></featureType>' \ http://localhost:8080/geoserver/rest/workspaces/acme/datastores/nyc/featuretypes and the I change the style (with curl) as above. Furthermore, I have the same problem with Raster; I can publish them but I can not change them style. Do you have any suggestions? Thank you. Babi 2010/8/18 Jody Garnett <[email protected]<mailto:[email protected]>> You may wish to report a bug; it would help if you list the steps to show the problem with the default geoserver dataset (allowing a developer to confirm your actions). It also helps to keep to one question per email; there are a couple of good guides with respect to asking questions online. Cheers, Jody On 06/08/2010, at 7:14 PM, Barbara Cintoli wrote: Hello, I am trying to change the style associated with a Shapefile. I created a new style using graphical interface and I entered it in the list of styles. If I join the style to my layer directly through interface of Geoserver 2.02 I am able to visualize it. If instead, I use the example in the documentation layer becomes "not enabled" and then I can not see it. The command used is: "curl -u admin:geoserver -XPUT -H 'Content-type: text/xml' -d '<layer><defaultStyle><name>roads_style</name></defaultStyle></layer>' http://localhost:9090/geoserver/rest/layers/acme:roads<http://www.google.com/url?sa=D&q=http://localhost:9090/geoserver/rest/layers/acme:roads&usg=AFQjCNGU51B9i4ZGYgbdqcWwWF3xXUzuFg>" where: roads_style is created style; acme is the workspace and roads is the layer name. I think that it's an issue related to the update of the layer but currently I don't know how I can resolve it. I also have another question: in Geoserver 2.02 to change the style to layer I must necessarily create layer first and then change its default style? Furthermore, I have the same problem with Raster; I can publish them but I can not change them style. Do you have any suggestions? Thank you. Babi Devo utilizzare Rest per far comunicare la web application con Geoserver 2.02! Ho lo stesso problema con i Raster; riesco a fare l'upload ma non riesco a settargli lo style. Avete qualche suggerimento? Grazie -- Barbara Cintoli ------------------------------------------------------------------------------ This SF.net<http://SF.net/> email is sponsored by Make an app they can't live without Enter the BlackBerry Developer Challenge http://p.sf.net/sfu/RIM-dev2dev _______________________________________________ Geoserver-users mailing list [email protected]<mailto:[email protected]> https://lists.sourceforge.net/lists/listinfo/geoserver-users -- Barbara Cintoli
------------------------------------------------------------------------------ This SF.net email is sponsored by Make an app they can't live without Enter the BlackBerry Developer Challenge http://p.sf.net/sfu/RIM-dev2dev
_______________________________________________ Geoserver-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/geoserver-users
