[Geoserver-devel] WFSConfiguration's SchemaBuilder catching up disabled feature types

Hi,

Just found out that FeatureTypeSchemaBuilder$GML3.addApplicationTypes is creating schemas for disabled types because it's checking on FeatureTypeInfo.isEnabled() instead of the derived property FeatureTypeInfo.enabled() which also checks if the parent StoreInfo is enabled.

This may cause a number of problems, mine being I've a disabled DirectoryDataStore because there's no way to tell it not to build a spatial index for shapefiles, leading to OOM.

Now, I suppose you'll agree to change the call to enabled() instead. Remining question being I also found other uses of isEnabled() where it seems enabled() should be rather used:

- <org.geoserver.wcs.response.WCSCapsTransformer.handleContents()>
- <org.geoserver.wfs.CapabilitiesTransformer$WFS1_0$CapabilitiesTranslator1_0.handleFeatureTypes()>
- <org.geoserver.wfs.CapabilitiesTransformer$WFS1_1$CapabilitiesTranslator1_1.featureTypeList()>
- <org.geoserver.wfs.DescribeFeatureType.run()>
- <org.geoserver.wfs.xml.v1_0_0.WFSConfiguration.configureContext()>
- <org.geoserver.wfs.xml.v1_1_0.WFSConfiguration.configureContext()>
- <org.geoserver.wcs.response.WCSCapsTransformer.WCSCapsTranslator.handleMetadataLink()>

Could someone verify and tell if I should go and change those by .enabled()?

Cheers,
Gabriel
--
Gabriel Roldan
OpenGeo - http://opengeo.org
Expert service straight from the developers.

I would say a batch replacement of isEnabled() with enabled() makes sense. I guess the only place there it might not is in persistence code where the actual raw value is written to and read from.

Gabriel Roldan wrote:

Hi,

Just found out that FeatureTypeSchemaBuilder$GML3.addApplicationTypes is creating schemas for disabled types because it's checking on FeatureTypeInfo.isEnabled() instead of the derived property FeatureTypeInfo.enabled() which also checks if the parent StoreInfo is enabled.

This may cause a number of problems, mine being I've a disabled DirectoryDataStore because there's no way to tell it not to build a spatial index for shapefiles, leading to OOM.

Now, I suppose you'll agree to change the call to enabled() instead. Remining question being I also found other uses of isEnabled() where it seems enabled() should be rather used:

- <org.geoserver.wcs.response.WCSCapsTransformer.handleContents()>
- <org.geoserver.wfs.CapabilitiesTransformer$WFS1_0$CapabilitiesTranslator1_0.handleFeatureTypes()>
- <org.geoserver.wfs.CapabilitiesTransformer$WFS1_1$CapabilitiesTranslator1_1.featureTypeList()>
- <org.geoserver.wfs.DescribeFeatureType.run()>
- <org.geoserver.wfs.xml.v1_0_0.WFSConfiguration.configureContext()>
- <org.geoserver.wfs.xml.v1_1_0.WFSConfiguration.configureContext()>
- <org.geoserver.wcs.response.WCSCapsTransformer.WCSCapsTranslator.handleMetadataLink()>

Could someone verify and tell if I should go and change those by .enabled()?

Cheers,
Gabriel

--
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.