New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider extending substitution default definition to WEB metadata too... #4568

Closed
sdlime opened this Issue Jan 18, 2013 · 2 comments

Comments

Projects
None yet
1 participant
@sdlime
Member

sdlime commented Jan 18, 2013

Presently setting defaults for substitutions is done at the layer level only. In some cases it is advantageous to set these at the WEB level so that multiple layers could make use of the default. One use case is during development when multiple database environments need to be accessed across many layers (dev/test/prod). Changing from one environment to the other would be trivial if a default could be set at this higher level.

Steve

@sdlime

This comment has been minimized.

Show comment
Hide comment
@sdlime

sdlime Jan 18, 2013

Member
diff --git a/mapfile.c b/mapfile.c
index d543a4a..1842eb1 100644
--- a/mapfile.c
+++ b/mapfile.c
@@ -6400,8 +6400,10 @@ void msApplyDefaultSubstitutions(mapObj *map)

   for(i=0; i<map->numlayers; i++) {
     layerObj *layer = GET_LAYER(map, i);
-    applyLayerDefaultSubstitutions(layer, &(layer->validation));
+    applyLayerDefaultSubstitutions(layer, &(layer->validation)); /* layer settings take precedence */
     applyLayerDefaultSubstitutions(layer, &(layer->metadata));
+    applyLayerDefaultSubstitutions(layer, &(map->web.validation));
+    applyLayerDefaultSubstitutions(layer, &(map->web.metadata));
   }
 }
Member

sdlime commented Jan 18, 2013

diff --git a/mapfile.c b/mapfile.c
index d543a4a..1842eb1 100644
--- a/mapfile.c
+++ b/mapfile.c
@@ -6400,8 +6400,10 @@ void msApplyDefaultSubstitutions(mapObj *map)

   for(i=0; i<map->numlayers; i++) {
     layerObj *layer = GET_LAYER(map, i);
-    applyLayerDefaultSubstitutions(layer, &(layer->validation));
+    applyLayerDefaultSubstitutions(layer, &(layer->validation)); /* layer settings take precedence */
     applyLayerDefaultSubstitutions(layer, &(layer->metadata));
+    applyLayerDefaultSubstitutions(layer, &(map->web.validation));
+    applyLayerDefaultSubstitutions(layer, &(map->web.metadata));
   }
 }

sdlime added a commit that referenced this issue Jan 22, 2013

sdlime added a commit that referenced this issue Jan 22, 2013

@sdlime

This comment has been minimized.

Show comment
Hide comment
@sdlime

sdlime Jan 22, 2013

Member

Change is simple enough that I just went ahead and committed it to branch-6-2 and master. This fix provides a nice way to set variables even with included layers. Plus, if you don't set a validation pattern the default value is always used and cannot be overridden. --Steve

Member

sdlime commented Jan 22, 2013

Change is simple enough that I just went ahead and committed it to branch-6-2 and master. This fix provides a nice way to set variables even with included layers. Plus, if you don't set a validation pattern the default value is always used and cannot be overridden. --Steve

@sdlime sdlime closed this Jan 22, 2013

mkofahl pushed a commit to faegi/mapserver that referenced this issue Apr 9, 2013

mkofahl pushed a commit to faegi/mapserver that referenced this issue Apr 9, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment