I almost posted this to the user list, but once I figured out the issue
this felt more appropriate in the developers' list ... so here I am ...
To use the REST interface to update the CoverageDimensionInfo details for a
coverage resource ... i.e. populate the Coverage Band Details for a
coverage layer ... it appears that you have to explicitly specify the
CoverageDimensionInfo class to get the dimensions list to be properly
unmarshalled, like so:
curl -v -u admin:xxxxxx -XPUT -H "Content-type: text/xml" -d
"<coverage><enabled>true</enabled><keywords><string>newword</string></keywords><dimensions><dimension
class='org.geoserver.catalog.CoverageDimensionInfo'><name>windspeed</name><unit>mps</unit></dimension></dimensions></coverage>"
http://localhost:8080/geoserver/rest/workspaces/arthur/coveragestores/wind/coverages/wind
Otherwise, you get
an com.thoughtworks.xstream.mapper.CannotResolveClassException: dimension
caused by <dimension>.
I believe this is handled with the @uml.property name="dimensions" in
https://github.com/geoserver/geoserver/blob/master/src/main/src/main/java/org/geoserver/catalog/CoverageInfo.java
and similarly in
https://github.com/geoserver/geoserver/blob/2.6.x/src/main/src/main/java/org/geoserver/catalog/CoverageDimensionInfo.java
Not sure, though, as it's late and I don't really see a setter for the
CoverageDimensionInfo list in CoverageInfo, just a getter.
Should this somehow be set to implicitly handle dimension as members of the
dimensions list? Am I just missing how to form the xml for this?
Also, the org.geotools.util.NumberRange is used for the range property, and
that seems potentially difficult to deserialize?
While I am on this topic, does anyone know if gsconfig python can handle
the coverage dimension settings? I don't see right away where it handles
it, and perhaps it is because of the needed explicit class specification??
Full debug from the request without explicitly specifying the class name:
< HTTP/1.1 500 Internal Server Error
* Server Apache-Coyote/1.1 is not blacklisted
< Server: Apache-Coyote/1.1
< Transfer-Encoding: chunked
< Date: Thu, 02 Apr 2015 04:14:41 GMT
< Connection: close
<
dimension : dimension
---- Debugging information ----
message : dimension
cause-exception :
com.thoughtworks.xstream.mapper.CannotResolveClassException
cause-message : dimension
class : java.util.ArrayList
required-type : java.util.ArrayList
converter-type : org.geoserver.config.util.LaxCollectionConverter
line number : 1
class[1] : org.geoserver.catalog.impl.CoverageInfoImpl
converter-type[1] :
org.geoserver.config.util.XStreamPersister$CoverageInfoConverter
version : 1.4.7
* Closing connection 0
Thanks as always,
Mike Grogan
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel