jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From k...@apache.org
Subject svn commit: r1870705 - in /jackrabbit/commons/filevault/trunk: vault-doc/src/site/markdown/validation.md vault-validation/src/main/java/org/apache/jackrabbit/vault/validation/spi/impl/AdvancedFilterValidatorFactory.java
Date Mon, 02 Dec 2019 11:05:32 GMT
Author: kwin
Date: Mon Dec  2 11:05:31 2019
New Revision: 1870705

URL: http://svn.apache.org/viewvc?rev=1870705&view=rev
Log:
JCRVLT-345 allow to overwrite severity for uncovered filter roots even
in case of packageType=application

Modified:
    jackrabbit/commons/filevault/trunk/vault-doc/src/site/markdown/validation.md
    jackrabbit/commons/filevault/trunk/vault-validation/src/main/java/org/apache/jackrabbit/vault/validation/spi/impl/AdvancedFilterValidatorFactory.java

Modified: jackrabbit/commons/filevault/trunk/vault-doc/src/site/markdown/validation.md
URL: http://svn.apache.org/viewvc/jackrabbit/commons/filevault/trunk/vault-doc/src/site/markdown/validation.md?rev=1870705&r1=1870704&r2=1870705&view=diff
==============================================================================
--- jackrabbit/commons/filevault/trunk/vault-doc/src/site/markdown/validation.md (original)
+++ jackrabbit/commons/filevault/trunk/vault-doc/src/site/markdown/validation.md Mon Dec 
2 11:05:31 2019
@@ -45,14 +45,14 @@ Each validator settings are set for a sp
 
 ID  |  Description | Options
 --- | --- | ---
-`jackrabbit-filter` |  Checks for validity of the [filter.xml](./filter.html) (according
to a predefined  XML schema). In addition checks that every [docview xml node](./docview.html)
is contained in the filter. It also makes sure that all filter root's ancestors are either
known/valid roots or are contained in the package dependencies. For ancestor nodes which are
not covered by a filter at least a `warn` is emitted. Also it makes sure that `pattern` values
for includes/excludes as well as `root` values for each filter entry are valid. Orphaned filter
rules (i.e. ones not being necessary) lead to validation issues as well. | *severityForUncoveredAncestorNodes*:
severity of validation messages for uncovered ancestor nodes.<br/>*severityForUncoveredFilterRootAncestors*:
severity of validation messages for uncovered filter root ancestors. Only relevant for package
type != application (default = warn)<br/>*severityForOrphanedFilterRules*: severity
of validation messages for orphaned fi
 lter rules (default = info)<br/>*validRoots*: comma-separated list of valid roots (default
= `"/,/libs,/apps,/etc,/var,/tmp,/content"`)
+`jackrabbit-filter` |  Checks for validity of the [filter.xml](./filter.html) (according
to a predefined  XML schema). In addition checks that every [docview xml node](./docview.html)
is contained in the filter. It also makes sure that all filter root's ancestors are either
known/valid roots or are contained in the package dependencies. For ancestor nodes which are
not covered by a filter at least a `warn` is emitted. Also it makes sure that `pattern` values
for includes/excludes as well as `root` values for each filter entry are valid. Orphaned filter
rules (i.e. ones not being necessary) lead to validation issues as well. | *severityForUncoveredAncestorNodes*:
severity of validation messages for uncovered ancestor nodes.<br/>*severityForUncoveredFilterRootAncestors*:
severity of validation messages for uncovered filter root ancestors. (default = `error`, for
package type=application or `warn` for all other package types)<br/>*severityForOrphanedFilterRules*:
severity of validation
  messages for orphaned filter rules (default = `info`)<br/>*validRoots*: comma-separated
list of valid roots (default = `"/,/libs,/apps,/etc,/var,/tmp,/content"`)
 `jackrabbit-properties ` | Checks for validity of the  [properties.xml](./properties.html)
| none
-`jackrabbit-dependencies` | Checks for overlapping filter roots of the referenced package
dependencies as well as for valid package dependency references (i.e. references which can
be resolved). | *severityForUnresolvedDependencies*: severity of validation messages for unresolved
dependencies (default = warn)
+`jackrabbit-dependencies` | Checks for overlapping filter roots of the referenced package
dependencies as well as for valid package dependency references (i.e. references which can
be resolved). | *severityForUnresolvedDependencies*: severity of validation messages for unresolved
dependencies (default = `warn`)
 `jackrabbit-docviewparser` | Checks if all docview files in the package are compliant with
the [(extended) Document View Format](docview.html). This involves checking for XML validity
as well as checking for correct property types. | none
 `jackrabbit-emptyelements` | Check for empty elements within DocView files (used for ordering
purposes, compare with  [(extended) Document View Format](docview.html)) which are included
in the filter with import=replace as those are actually not replaced! | none
 `jackrabbit-mergelimitations` | Checks for the limitation of import mode=merge outlined at
[JCRVLT-255][jcrvlt-255]. | none
 `jackrabbit-oakindex` |  Checks if the package (potentially) modifies/creates an OakIndexDefinition.
This is done by evaluating both the filter.xml for potential matches as well as the actual
content for nodes with jcr:primaryType  `oak:indexDefinition`. | none
-`jackrabbit-packagetype` | Checks if the package type is correctly set for this package,
i.e. is compliant with all rules outlined at [JCRVLT-170][jcrvlt-170]. | *jcrInstallerNodePathRegex*:
the regex of the node paths which all OSGi bundles and configurations within packages must
match ([JCR Installer](https://sling.apache.org/documentation/bundles/jcr-installer-provider.html))
(default=`/([^/]*/){0,4}?(install|config)(\\.[^/]*)*/(\\d{1,3}/)?.+?\\.(jar|config|cfg|cfg\\.json|xml)$`).<br/>*legacyTypeSeverity*:
the severity of the validation message for package type `mixed` (default = warn).<br/>*noTypeSeverity*:
the severity of the validation message when package type is not set at all (default = warn).<br/>*prohibitMutableContent*:
boolean flag determining whether package type `content` or `mixed` (mutable content) leads
to a validation message with severity error (default = false). Useful when used with [Oak
Composite NodeStore](https://jackrabbit.apache.org/oak/docs/nodestore/comp
 ositens.html).<br/>*prohibitImmutableContent*: boolean flag determining whether package
type `app`, `container` or `mixed` (immutable content) leads to a valdation message with severity
error (default = false). Useful when used with [Oak Composite NodeStore](https://jackrabbit.apache.org/oak/docs/nodestore/compositens.html).
+`jackrabbit-packagetype` | Checks if the package type is correctly set for this package,
i.e. is compliant with all rules outlined at [JCRVLT-170][jcrvlt-170]. | *jcrInstallerNodePathRegex*:
the regex of the node paths which all OSGi bundles and configurations within packages must
match ([JCR Installer](https://sling.apache.org/documentation/bundles/jcr-installer-provider.html))
(default=`/([^/]*/){0,4}?(install|config)(\\.[^/]*)*/(\\d{1,3}/)?.+?\\.(jar|config|cfg|cfg\\.json|xml)$`).<br/>*legacyTypeSeverity*:
the severity of the validation message for package type `mixed` (default = `warn`).<br/>*noTypeSeverity*:
the severity of the validation message when package type is not set at all (default = `warn`).<br/>*prohibitMutableContent*:
boolean flag determining whether package type `content` or `mixed` (mutable content) leads
to a validation message with severity error (default = `false`). Useful when used with [Oak
Composite NodeStore](https://jackrabbit.apache.org/oak/docs/nodestor
 e/compositens.html).<br/>*prohibitImmutableContent*: boolean flag determining whether
package type `app`, `container` or `mixed` (immutable content) leads to a validation message
with severity error (default = `false`). Useful when used with [Oak Composite NodeStore](https://jackrabbit.apache.org/oak/docs/nodestore/compositens.html).
 `jackrabbit-primarynodetype` | Checks if all non empty elements within [DocView files](docview.html)
have the mandatory property `jcr:primaryType` set. | none
 
 

Modified: jackrabbit/commons/filevault/trunk/vault-validation/src/main/java/org/apache/jackrabbit/vault/validation/spi/impl/AdvancedFilterValidatorFactory.java
URL: http://svn.apache.org/viewvc/jackrabbit/commons/filevault/trunk/vault-validation/src/main/java/org/apache/jackrabbit/vault/validation/spi/impl/AdvancedFilterValidatorFactory.java?rev=1870705&r1=1870704&r2=1870705&view=diff
==============================================================================
--- jackrabbit/commons/filevault/trunk/vault-validation/src/main/java/org/apache/jackrabbit/vault/validation/spi/impl/AdvancedFilterValidatorFactory.java
(original)
+++ jackrabbit/commons/filevault/trunk/vault-validation/src/main/java/org/apache/jackrabbit/vault/validation/spi/impl/AdvancedFilterValidatorFactory.java
Mon Dec  2 11:05:31 2019
@@ -65,16 +65,13 @@ public final class AdvancedFilterValidat
         }
         // severity for ancestor of filter rules
         final ValidationMessageSeverity severityForUncoveredFilterRootAncestors;
-        if (PackageType.APPLICATION.equals(context.getProperties().getPackageType())) {
-            log.debug("Due to package type 'application' emit error for every uncovered filter
root ancestor");
-            severityForUncoveredFilterRootAncestors = ValidationMessageSeverity.ERROR;
-            if (settings.getOptions().containsKey(OPTION_SEVERITY_FOR_UNCOVERED_FILTER_ROOT_ANCESTORS))
{
-                log.warn("Disregard option '{}' as package type is application which sets
this violation to severity 'error'", OPTION_SEVERITY_FOR_UNCOVERED_FILTER_ROOT_ANCESTORS);
-            }
+        if (settings.getOptions().containsKey(OPTION_SEVERITY_FOR_UNCOVERED_FILTER_ROOT_ANCESTORS))
{
+            String optionValue = settings.getOptions().get(OPTION_SEVERITY_FOR_UNCOVERED_FILTER_ROOT_ANCESTORS);
+            severityForUncoveredFilterRootAncestors = ValidationMessageSeverity.valueOf(optionValue.toUpperCase());
         } else {
-            if (settings.getOptions().containsKey(OPTION_SEVERITY_FOR_UNCOVERED_FILTER_ROOT_ANCESTORS))
{
-                String optionValue = settings.getOptions().get(OPTION_SEVERITY_FOR_UNCOVERED_FILTER_ROOT_ANCESTORS);
-                severityForUncoveredFilterRootAncestors = ValidationMessageSeverity.valueOf(optionValue.toUpperCase());
+            if (PackageType.APPLICATION.equals(context.getProperties().getPackageType()))
{
+                log.debug("Due to package type 'application' emit error for every uncovered
filter root ancestor");
+                severityForUncoveredFilterRootAncestors = ValidationMessageSeverity.ERROR;
             } else {
                 severityForUncoveredFilterRootAncestors = DEFAULT_SEVERITY_FOR_UNCOVERED_FILTER_ROOT_ANCESTORS;
             }



Mime
View raw message