[Geoserver-devel] [jira] Created: (GEOS-4753) RESTConfig doesn't calculate Coverage grid/dimensions

RESTConfig doesn't calculate Coverage grid/dimensions
-----------------------------------------------------

                 Key: GEOS-4753
                 URL: https://jira.codehaus.org/browse/GEOS-4753
             Project: GeoServer
          Issue Type: Improvement
          Components: Configuration, REST
    Affects Versions: 2.1.1
            Reporter: Robert Coup
            Assignee: Justin Deoliveira
         Attachments: rest_coverageinfo.contentOnly.patch, rest_coverageinfo.patch

Expanding on GEOS-4596, 'grid' and 'dimensions' are also not calculated for Coverages created via the REST API. And WCS DescribeCoverage/etc all explode when grid/dimensions/etc aren't set.

Collections like supportedFormats/dimensions/etc are set to null rather than the default empty List from CoverageInfoImpl if they're not specified in the POST data. This happens because XStreamPersister doesn't run the constructor when unmarshalling - the object gets magicked up with no attributes setup.

The attached patch:

* makes ResourceInfoConverter, FeatureTypeInfoConverter, and CoverageInfoConverter setup empty lists on unmarshalling the same way the default implementation constructors do. So not specifying eg. supportedFormats will leave your coverageInfo object with an empty list rather than null - the same as if you instantiated a CoverageInfoImpl object directly.
* move most of the logic from CatalogBuiler.buildCoverage() (called via the Web UI) to CatalogBuilder.initCoverage() (was called by REST after GEOS-4596, now by both). Wrap the calculations/derivations so they only happen if the values aren't set already. This allows you to override via REST, but the defaults will now be sensible - the same as if you created the coverage via the Web UI.
* enable CoverageTest.testPostAsJSON() again, and set it up to use the same data as testPostAsXML() - but auto-specify nothing so it's all calculated automatically, then assert against the calculated values.

rest_coverageinfo.contentOnly.patch has no whitespace changes included for easier reviewing, and rest_coverageinfo.patch has everything formatted with the GeoTools style.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira