diff --git a/hidden_layer.patch b/hidden_layer.patch new file mode 100644 index 0000000..a53eed7 --- /dev/null +++ b/hidden_layer.patch @@ -0,0 +1,107 @@ +diff -urNad mapserver-5.6.3~/mapogcsos.c mapserver-5.6.3/mapogcsos.c +--- mapserver-5.6.3~/mapogcsos.c 2009-10-20 15:38:46.000000000 +0200 ++++ mapserver-5.6.3/mapogcsos.c 2010-04-30 15:02:22.828247103 +0200 +@@ -1379,7 +1379,7 @@ + { + lp = (GET_LAYER(map, i)); + +- if (lp->status == MS_DELETE) ++ if (lp->status == MS_DELETE || msIsLayerHidden(lp) == MS_TRUE) + continue; + + value = msOWSLookupMetadata(&(lp->metadata), "S", "offering_id"); +diff -urNad mapserver-5.6.3~/mapserver.h mapserver-5.6.3/mapserver.h +--- mapserver-5.6.3~/mapserver.h 2010-03-22 19:50:43.000000000 +0100 ++++ mapserver-5.6.3/mapserver.h 2010-04-30 15:02:22.832247199 +0200 +@@ -2206,6 +2206,8 @@ + + MS_DLL_EXPORT int msCheckParentPointer(void* p, char* objname); + ++MS_DLL_EXPORT int msIsLayerHidden( layerObj *lp ); ++ + MS_DLL_EXPORT int *msAllocateValidClassGroups(layerObj *lp, int *nclasses); + /* ==================================================================== */ + /* End of prototypes for functions in maputil.c */ +diff -urNad mapserver-5.6.3~/maputil.c mapserver-5.6.3/maputil.c +--- mapserver-5.6.3~/maputil.c 2009-10-16 20:17:05.000000000 +0200 ++++ mapserver-5.6.3/maputil.c 2010-04-30 15:02:22.832247199 +0200 +@@ -1965,3 +1965,18 @@ + #endif + + } ++ ++/* ++ Ticket #1952, #2582, #337: check if layer is marked as hidden ++*/ ++int msIsLayerHidden( layerObj *lp ) { ++ const char *value; ++ int bIsLayerHidden = MS_FALSE; /* Layer is enable by default */ ++ ++ if( (value = msOWSLookupMetadata(&(lp->metadata), "MO", "hidden_layer")) ) { ++ if( strcasecmp("true", value) == 0 ) ++ bIsLayerHidden = MS_TRUE; ++ } ++ ++ return( bIsLayerHidden ); ++} +diff -urNad mapserver-5.6.3~/mapwcs.c mapserver-5.6.3/mapwcs.c +--- mapserver-5.6.3~/mapwcs.c 2009-10-19 16:55:32.000000000 +0200 ++++ mapserver-5.6.3/mapwcs.c 2010-04-30 15:02:22.832247199 +0200 +@@ -681,7 +681,7 @@ + coverageMetadataObj cm; + int status; + +- if((layer->status == MS_DELETE) || !msWCSIsLayerSupported(layer)) return MS_SUCCESS; /* not an error, this layer cannot be served via WCS */ ++ if((layer->status == MS_DELETE) || msIsLayerHidden(layer) == MS_TRUE || !msWCSIsLayerSupported(layer)) return MS_SUCCESS; /* not an error, this layer cannot be served via WCS */ + + status = msWCSGetCoverageMetadata(layer, &cm); + if(status != MS_SUCCESS) return MS_FAILURE; +diff -urNad mapserver-5.6.3~/mapwfs.c mapserver-5.6.3/mapwfs.c +--- mapserver-5.6.3~/mapwfs.c 2010-02-23 20:30:57.000000000 +0100 ++++ mapserver-5.6.3/mapwfs.c 2010-04-30 15:02:22.832247199 +0200 +@@ -452,7 +452,7 @@ + layerObj *lp; + lp = GET_LAYER(map, i); + +- if (lp->status == MS_DELETE) ++ if (lp->status == MS_DELETE || msIsLayerHidden(lp) == MS_TRUE) + continue; + + /* List only vector layers in which DUMP=TRUE */ +diff -urNad mapserver-5.6.3~/mapwms.c mapserver-5.6.3/mapwms.c +--- mapserver-5.6.3~/mapwms.c 2010-02-22 01:20:06.000000000 +0100 ++++ mapserver-5.6.3/mapwms.c 2010-04-30 15:02:22.836247296 +0200 +@@ -1890,7 +1890,10 @@ + if (numNestedGroups[index] <= level) /* no more subgroups */ + { + /* we are at the deepest level of the group branchings, so add layer now. */ +- msDumpLayer(map, GET_LAYER(map, index), nVersion, script_url_encoded, ""); ++ /* if it is not marked as hidden */ ++ if (!msIsLayerHidden( GET_LAYER(map, index) )) ++ msDumpLayer(map, GET_LAYER(map, index), nVersion, script_url_encoded, ""); ++ + pabLayerProcessed[index] = 1; /* done */ + } + else /* not yet there, we have to deal with this group and possible subgroups and layers. */ +@@ -2419,6 +2422,9 @@ + layerObj *lp; + lp = (GET_LAYER(map, i)); + ++ if (msIsLayerHidden(lp) == MS_TRUE) ++ pabLayerProcessed[i] = 1; /* Hide layer from capabilities */ ++ + if (pabLayerProcessed[i] || (lp->status == MS_DELETE)) + continue; /* Layer has already been handled */ + +@@ -2463,7 +2469,9 @@ + GET_LAYER(map, j)->group && + strcmp(lp->group, GET_LAYER(map, j)->group) == 0 ) + { +- msDumpLayer(map, (GET_LAYER(map, j)), nVersion, script_url_encoded, " "); ++ if (!msIsLayerHidden( GET_LAYER(map, j) )) /* Don't dump hidden layers */ ++ msDumpLayer(map, (GET_LAYER(map, j)), nVersion, script_url_encoded, " "); ++ + pabLayerProcessed[j] = 1; + } + } + diff --git a/mapserver.spec b/mapserver.spec index c2b5c59..1696366 100644 --- a/mapserver.spec +++ b/mapserver.spec @@ -56,7 +56,8 @@ BuildRequires: krb5-devel %endif BuildRequires: libgcj-devel BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) -Patch: mapserver-5.4.1_buildchecks.patch +Patch0: mapserver-5.4.1_buildchecks.patch +Patch1: hidden_layer.patch #%define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)") %define _cgibindir /srv/www/cgi-bin @@ -106,7 +107,9 @@ within the Java programming language. %prep %setup -q -%patch -p1 +%patch0 -p1 +%patch1 -p1 + # fix spurious perm bits chmod -x tests/home.png chmod -x mappluginlayer.c @@ -280,6 +283,9 @@ rm -rf %{buildroot} %{_javadir}/*.jar %changelog +* Wed Oct 13 2010 Stephan Holl 5.6.5 +- added a patch to hide layers from GetCapabilitites-Output. Use + Metadataentry 'OWS_HIDDEN_LAYER' 'true' inside your layer * Tue Aug 10 2010 Stephan Holl 5.6.5 - updated to new upstream version of mapserver 5.6.5(see http://trac.osgeo.org/mapserver/browser/tags/rel-5-6-5/mapserver/HISTORY.TXT