geoserver/geoserver — pull request #72 by svzdvd (2012-11-22 09:41:17+00:00)
Title: GEOS-4982: LayerGroup visibility issue

Hi,

I've tried to fix GEOS-4982: "LayerGroup does not show up in capabilities if one of its layers is non-advertised".

Now SecureCatalogImpl hides a LayerGroup if one of its Layers is hidden because not readable by the user or not advertised.

I've changed SecureCatalogImpl so that it will not hide LayerGroups.
Then I've created a new AdvertisedCatalog, which can be used as a SecureCatalogImpl wrapper.
AdvertisedCatalog replaces AdvertisedResourceFilter, it filters not advertised Layers and Resources.

AdvertisedCatalog delegates the decision to hide or not a LayerGroup to a LayerGroupVisibilityPolicy object. There are 3 LayerGroupVisibilityPolicy implementation:
* never hide a LayerGroup
* hide a LayerGroup if it's empty
* hide a LayerGroup if all its Layers have been filtered (LayerGroup appears empty to the user)