Enable runtime substitutions using `class` level `validation` blocks #4600

Closed
wants to merge 4 commits into
from

Projects

None yet

2 participants

@homme
Contributor
homme commented Mar 5, 2013

This fixes mapserver/mapserver#4596. As well as now honouring
class level validation blocks a validation hierarchy is implemented
across web, layer and class level validation blocks. This
hierarchy only takes effect when identical validation keys appear in
web, layer or class such that keys in more specialised blocks
override those in more generalised blocks. i.e. class overrides
layer which overrides web.

In conjunction with the above, default class level substitutions are
also enabled and also implement the precedence rules above. i.e. a
default substitution in class overrides layer which overrides
web.

homme added some commits Mar 5, 2013
@homme homme Enable runtime substitutions using `class` level `validation` blocks
This fixes mapserver/mapserver#4596.  As well as now honouring
class level validation blocks a validation hierarchy is implemented
across `web`, `layer` and `class` level validation blocks.  This
hierarchy *only* takes effect when identical validation keys appear in
`web`, `layer` or `class` such that keys in more specialised blocks
override those in more generalised blocks. i.e. `class` overrides
`layer` which overrides `web`.

In conjunction with the above, default class level substitutions are
also enabled and also implement the precedence rules above. i.e. a
default substitution in `class` overrides `layer` which overrides
`web`.
285d165
@homme homme Fix validation checking logic
Previously the logic let through tags which didn't appear in the
validation blocks.
1287d51
@tbonfort
Member

@homme the CI server might not have mailed you, but your changes break 3 existing substitution testcases which should be checked given that adding CLASS substitutions is supposed to be backwards compatible.
http://ci.mapserver.org/job/mapserverpullrequests/82/console and navigate to the end of the log to see the diff.

@homme
Contributor
homme commented Mar 11, 2013

@tbonfort Thanks for the heads up. I've enabled msautotest on my local checkout and the relevant tests now pass except for misc/expected/runtime_sub_test003.txt: this is because there is a bug in the original code such that a validation failing for a name in a layer can drop through to the web validation for that same name and pass. I believe the output in misc/result/runtime_sub_test003.txt is correct which shows a msEvalRegex() and a msValidateParameter() error.

I also note there are no tests for class validation: I can look at adding some if required.

@tbonfort
Member

@mapserver-bot retest this please

@tbonfort tbonfort added a commit to mapserver/msautotest_DEPRECATED that referenced this pull request Mar 12, 2013
@tbonfort tbonfort modify for #4600 f6966cd
@tbonfort tbonfort added a commit that referenced this pull request Mar 12, 2013
@homme @tbonfort homme + tbonfort Enable runtime substitutions using `class` level `validation` blocks (#…
…4600)

 As well as now honouring
class level validation blocks a validation hierarchy is implemented
across `web`, `layer` and `class` level validation blocks.  This
hierarchy *only* takes effect when identical validation keys appear in
`web`, `layer` or `class` such that keys in more specialised blocks
override those in more generalised blocks. i.e. `class` overrides
`layer` which overrides `web`.

In conjunction with the above, default class level substitutions are
also enabled and also implement the precedence rules above. i.e. a
default substitution in `class` overrides `layer` which overrides
`web`.

Ensure validation *always* occurs when a substitution is requested
Fixes #4596
Fixes #4600
4e79097
@tbonfort tbonfort added a commit that closed this pull request Mar 12, 2013
@homme @tbonfort homme + tbonfort Enable runtime substitutions using `class` level `validation` blocks (#…
…4600)

 As well as now honouring
class level validation blocks a validation hierarchy is implemented
across `web`, `layer` and `class` level validation blocks.  This
hierarchy *only* takes effect when identical validation keys appear in
`web`, `layer` or `class` such that keys in more specialised blocks
override those in more generalised blocks. i.e. `class` overrides
`layer` which overrides `web`.

In conjunction with the above, default class level substitutions are
also enabled and also implement the precedence rules above. i.e. a
default substitution in `class` overrides `layer` which overrides
`web`.

Ensure validation *always* occurs when a substitution is requested
Fixes #4596
Fixes #4600
4e79097
@tbonfort tbonfort closed this in 4e79097 Mar 12, 2013
@tbonfort
Member

rebased and applied in 4e79097 , thanks @homme

@mkofahl mkofahl pushed a commit to faegi/mapserver that referenced this pull request Apr 9, 2013
@homme @tbonfort homme + tbonfort Enable runtime substitutions using `class` level `validation` blocks (#…
…4600)

 As well as now honouring
class level validation blocks a validation hierarchy is implemented
across `web`, `layer` and `class` level validation blocks.  This
hierarchy *only* takes effect when identical validation keys appear in
`web`, `layer` or `class` such that keys in more specialised blocks
override those in more generalised blocks. i.e. `class` overrides
`layer` which overrides `web`.

In conjunction with the above, default class level substitutions are
also enabled and also implement the precedence rules above. i.e. a
default substitution in `class` overrides `layer` which overrides
`web`.

Ensure validation *always* occurs when a substitution is requested
Fixes #4596
Fixes #4600
43b3fe8
@tbonfort tbonfort was assigned Apr 13, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment