REST API PUT featuretype request disables layer

Description

When doing a PUT request against a feature type to change the cqlFilter, any layers backed by that featureType get disabled.

It looks like this occurs because GeoServer is constructing a new FeatureTypeInfo object from the request parameters, then copying all non-null values to the FeatureTypeInfo object in the catalog. Since enabled is a boolean primitive, it is initialized to false and copied, casing the FeatureTypeInfo object to become disabled.

Environment

None

Activity

Show:
Torben Barsballe
March 10, 2016, 7:04 PM

Thanks Andrea, I thought this is the sort of thing that already would have been found, but my JIRA search didn't turn up anything.

Torben Barsballe
March 10, 2016, 9:36 PM

To follow up my last message, there does appear to be some precedent for
Boolean (object) value with a bolean (primitive) getter setter:

In ResourceInfoImpl, we have advertised as a Boolean object with
isAdvertised and setAdvertised returning/accepting a boolean primitive.

This appears to interact with the MetadataMap for backwards compatibility
with 2.1.x series.

Torben

On Thu, Mar 10, 2016 at 1:29 PM, Torben Barsballe <

------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Torben Barsballe
March 10, 2016, 9:53 PM

There are two things happening here - Xstream is making a new object from
the request (using reflection), then we are using CatalogBuilder to copy
all the non-null values to the catalog object. CatalogBuilder uses
reflection/direct field access (via OwsUtils.copy).

So making the underlying object a Boolean but keeping the getters/setters
primitive would work, but I agree it is a bit ugly.

Torben

On Thu, Mar 10, 2016 at 12:01 PM, Andrea Aime <andrea.aime@geo-solutions.it>
wrote:

------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Andrea Aime
March 12, 2016, 11:19 AM

Closing as duplicate, please refer to the other in an eventual commit message

Torben Barsballe
March 21, 2016, 4:00 PM

I am mostly waiting on spare time to actually do it. I should be able to
get it done sometime this week.

Torben

On Sun, Mar 20, 2016 at 7:27 AM, Andrea Aime <andrea.aime@geo-solutions.it>

------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Assignee

Torben Barsballe

Reporter

Torben Barsballe

Triage

None

Fix versions

None

Affects versions

Components

Priority

Medium
Configure