You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by kw...@apache.org on 2021/01/01 19:25:25 UTC

[jackrabbit-filevault] branch feature/JCRVLT-489-ignore-system-props created (now 584f704)

This is an automated email from the ASF dual-hosted git repository.

kwin pushed a change to branch feature/JCRVLT-489-ignore-system-props
in repository https://gitbox.apache.org/repos/asf/jackrabbit-filevault.git.


      at 584f704  JCRVLT-489 ignore properties "jcr:isCheckedOut" and "oak:counter"

This branch includes the following new commits:

     new 584f704  JCRVLT-489 ignore properties "jcr:isCheckedOut" and "oak:counter"

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[jackrabbit-filevault] 01/01: JCRVLT-489 ignore properties "jcr:isCheckedOut" and "oak:counter"

Posted by kw...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

kwin pushed a commit to branch feature/JCRVLT-489-ignore-system-props
in repository https://gitbox.apache.org/repos/asf/jackrabbit-filevault.git

commit 584f704029a447c48b38592817de9664414799d7
Author: Konrad Windszus <kw...@apache.org>
AuthorDate: Fri Jan 1 20:25:08 2021 +0100

    JCRVLT-489 ignore properties "jcr:isCheckedOut" and "oak:counter"
---
 .../validation/spi/impl/nodetype/JcrNodeTypeMetaDataImpl.java     | 8 +++++---
 .../vault/validation/spi/impl/nodetype/NodeTypeValidatorTest.java | 6 +++++-
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/vault-validation/src/main/java/org/apache/jackrabbit/vault/validation/spi/impl/nodetype/JcrNodeTypeMetaDataImpl.java b/vault-validation/src/main/java/org/apache/jackrabbit/vault/validation/spi/impl/nodetype/JcrNodeTypeMetaDataImpl.java
index 9961fc0..65158f6 100644
--- a/vault-validation/src/main/java/org/apache/jackrabbit/vault/validation/spi/impl/nodetype/JcrNodeTypeMetaDataImpl.java
+++ b/vault-validation/src/main/java/org/apache/jackrabbit/vault/validation/spi/impl/nodetype/JcrNodeTypeMetaDataImpl.java
@@ -87,11 +87,13 @@ public class JcrNodeTypeMetaDataImpl implements JcrNodeTypeMetaData {
     static final String MESSAGE_MANDATORY_PROPERTY_MISSING = "Mandatory property '%s' missing in node with types [%s] at %s";
     static final String MESSAGE_MANDATORY_PROPERTY_WITH_WRONG_TYPE = "Mandatory property '%s' has type '%s' while it should have '%s' in node with types [%s] at %s";
 
-    // do not validate protected/mandatory for JCR system properties that are handled by FileVault specially 
-    // (https://github.com/apache/jackrabbit-filevault/blob/f785fcb24d4cbd01c734e9273310a925c29ae15b/vault-core/src/main/java/org/apache/jackrabbit/vault/fs/impl/io/DocViewSAXImporter.java#L921)
+    // do not validate protected JCR system properties that are handled by FileVault specially in https://github.com/apache/jackrabbit-filevault/blob/f785fcb24d4cbd01c734e9273310a925c29ae15b/vault-core/src/main/java/org/apache/jackrabbit/vault/fs/impl/io/DocViewSAXImporter.java#L123 and 
+    // https://github.com/apache/jackrabbit-filevault/blob/f785fcb24d4cbd01c734e9273310a925c29ae15b/vault-core/src/main/java/org/apache/jackrabbit/vault/fs/impl/io/DocViewSAXImporter.java#L140
     private static final Collection<Name> JCR_SYSTEM_PROPERTIES = Arrays.asList(
             NameConstants.JCR_PRIMARYTYPE, NameConstants.JCR_MIXINTYPES, NameConstants.JCR_UUID,
-            NameConstants.JCR_BASEVERSION, NameConstants.JCR_PREDECESSORS, NameConstants.JCR_SUCCESSORS, NameConstants.JCR_VERSIONHISTORY);
+            NameConstants.JCR_BASEVERSION, NameConstants.JCR_PREDECESSORS, NameConstants.JCR_SUCCESSORS, 
+            NameConstants.JCR_VERSIONHISTORY, NameConstants.JCR_ISCHECKEDOUT, 
+            NameFactoryImpl.getInstance().create("http://jackrabbit.apache.org/oak/ns/1.0", "counter"));
 
     private static final Name NT_REP_POLICY = NameFactoryImpl.getInstance().create(Name.NS_REP_URI, "Policy");
     private static final Name NT_REP_AUTHORIZABLE = NameFactoryImpl.getInstance().create(Name.NS_REP_URI, "Authorizable");
diff --git a/vault-validation/src/test/java/org/apache/jackrabbit/vault/validation/spi/impl/nodetype/NodeTypeValidatorTest.java b/vault-validation/src/test/java/org/apache/jackrabbit/vault/validation/spi/impl/nodetype/NodeTypeValidatorTest.java
index f5843db..a42ec09 100644
--- a/vault-validation/src/test/java/org/apache/jackrabbit/vault/validation/spi/impl/nodetype/NodeTypeValidatorTest.java
+++ b/vault-validation/src/test/java/org/apache/jackrabbit/vault/validation/spi/impl/nodetype/NodeTypeValidatorTest.java
@@ -293,13 +293,17 @@ public class NodeTypeValidatorTest {
     }
 
     @Test
-    public void testMandatoryVersioningProperties() throws IOException, RepositoryException, ParseException {
+    public void testVersioningProperties() throws IOException, RepositoryException, ParseException {
         validator = createValidator(filter, NameConstants.NT_UNSTRUCTURED, "tccl:test-nodetypes.cnd");
         NodeContext nodeContext = new NodeContextImpl("/apps/test/node4", Paths.get("node4"), Paths.get(""));
 
         Map<String, DocViewProperty> props = new HashMap<>();
         props.put(NameConstants.JCR_PRIMARYTYPE.toString(), new DocViewProperty(NameConstants.JCR_PRIMARYTYPE.toString(),
                 new String[] { "WorkflowModel" }, false, PropertyType.STRING));
+        props.put(NameConstants.JCR_UUID.toString(), new DocViewProperty(NameConstants.JCR_UUID.toString(),
+                new String[] { "41699399-95fd-444d-ab8c-b9f8e614607e" }, false, PropertyType.STRING));
+        props.put(NameConstants.JCR_ISCHECKEDOUT.toString(), new DocViewProperty(NameConstants.JCR_ISCHECKEDOUT.toString(),
+                new String[] { "true" }, false, PropertyType.BOOLEAN));
         DocViewNode node = new DocViewNode("jcr:root", "jcr:root", null, props, new String[] { NameConstants.MIX_VERSIONABLE.toString() }, "WorkflowModel");
         Assert.assertThat(validator.validate(node, nodeContext, false),
                 AnyValidationMessageMatcher.noValidationInCollection());