You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-dev@jackrabbit.apache.org by "Jukka Zitting (JIRA)" <ji...@apache.org> on 2012/07/12 14:09:34 UTC

[jira] [Created] (OAK-182) Support for "invisible" internal content

Jukka Zitting created OAK-182:
---------------------------------

             Summary: Support for "invisible" internal content
                 Key: OAK-182
                 URL: https://issues.apache.org/jira/browse/OAK-182
             Project: Jackrabbit Oak
          Issue Type: New Feature
          Components: core, jcr
            Reporter: Jukka Zitting


As discussed on the mailing list (http://markmail.org/message/kzt7csiz2bd5n3ww), it would be good to have a naming pattern line "{{:name}}" for internal content that we don't want to directly expose to JCR clients.

JCR-related functionality like the namespace and node type validators and the observation dispatcher (see also OAK-181) should know to ignore such content and the JCR binding in oak-jcr should automatically filter out such internal content. Such internal content should probably also not be indexed for search.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (OAK-182) Support for "invisible" internal content

Posted by "Thomas Mueller (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OAK-182?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13421344#comment-13421344 ] 

Thomas Mueller commented on OAK-182:
------------------------------------

I think I misunderstood how the ValidatingEditor and the MergingNodeStateDiff work internally. If they don't actually iterate over the hidden content, then it should be fine.
                
> Support for "invisible" internal content
> ----------------------------------------
>
>                 Key: OAK-182
>                 URL: https://issues.apache.org/jira/browse/OAK-182
>             Project: Jackrabbit Oak
>          Issue Type: New Feature
>          Components: core, jcr
>            Reporter: Jukka Zitting
>         Attachments: OAK-182-b.patch
>
>
> As discussed on the mailing list (http://markmail.org/message/kzt7csiz2bd5n3ww), it would be good to have a naming pattern line "{{:name}}" for internal content that we don't want to directly expose to JCR clients.
> JCR-related functionality like the namespace and node type validators and the observation dispatcher (see also OAK-181) should know to ignore such content and the JCR binding in oak-jcr should automatically filter out such internal content. Such internal content should probably also not be indexed for search.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (OAK-182) Support for "invisible" internal content

Posted by "Thomas Mueller (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OAK-182?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13414964#comment-13414964 ] 

Thomas Mueller commented on OAK-182:
------------------------------------

When enabling the IndexWrapper in the ContentRepositoryImpl default constructor, the org.apache.jackrabbit.oak.jcr.RepositoryTest.observation test fails with the exception stack trace below. I have a patch that fixed the issue, but I'm not familiar with the code and wonder if that is really the best way to fix it:

Index: src/main/java/org/apache/jackrabbit/oak/spi/state/AbstractNodeState.java
===================================================================
--- src/main/java/org/apache/jackrabbit/oak/spi/state/AbstractNodeState.java	(revision 1361947)
+++ src/main/java/org/apache/jackrabbit/oak/spi/state/AbstractNodeState.java	(working copy)
@@ -97,6 +97,10 @@
         Set<String> baseChildNodes = new HashSet<String>();
         for (ChildNodeEntry beforeCNE : base.getChildNodeEntries()) {
             String name = beforeCNE.getName();
+            if (name.startsWith(":")) {
+                // OAK-182: ignore invisible internal content
+                continue;
+            }
             NodeState beforeChild = beforeCNE.getNodeState();
             NodeState afterChild = getChildNode(name);
             if (afterChild == null) {
@@ -110,6 +114,10 @@
         }
         for (ChildNodeEntry afterChild : getChildNodeEntries()) {
             String name = afterChild.getName();
+            if (name.startsWith(":")) {
+                // OAK-182: ignore invisible internal content
+                continue;
+            }
             if (!baseChildNodes.contains(name)) {
                 diff.childNodeAdded(name, afterChild.getNodeState());
             }


Stack trace without the patch:

Exception in thread "Observation" java.lang.IllegalArgumentException: '/jcr:system/indexes/:data' is not a valid path. Prefix must not be empty
	at org.apache.jackrabbit.oak.namepath.NamePathMapperImpl$1.error(NamePathMapperImpl.java:108)
	at org.apache.jackrabbit.oak.namepath.JcrPathParser.parse(JcrPathParser.java:151)
	at org.apache.jackrabbit.oak.namepath.NamePathMapperImpl.getJcrPath(NamePathMapperImpl.java:122)
	at org.apache.jackrabbit.oak.jcr.observation.ChangeProcessor$EventGeneratingNodeStateDiff.jcrPath(ChangeProcessor.java:104)
	at org.apache.jackrabbit.oak.jcr.observation.ChangeProcessor$EventGeneratingNodeStateDiff.propertyChanged(ChangeProcessor.java:117)
	at org.apache.jackrabbit.oak.spi.state.AbstractNodeState.compareAgainstBaseState(AbstractNodeState.java:87)
	at org.apache.jackrabbit.oak.kernel.KernelNodeState.compareAgainstBaseState(KernelNodeState.java:214)
	at org.apache.jackrabbit.oak.jcr.observation.ChangeProcessor$EventGeneratingNodeStateDiff.childNodeChanged(ChangeProcessor.java:155)
	at org.apache.jackrabbit.oak.spi.state.AbstractNodeState.compareAgainstBaseState(AbstractNodeState.java:107)
	at org.apache.jackrabbit.oak.kernel.KernelNodeState.compareAgainstBaseState(KernelNodeState.java:214)
	at org.apache.jackrabbit.oak.jcr.observation.ChangeProcessor$EventGeneratingNodeStateDiff.childNodeChanged(ChangeProcessor.java:155)
	at org.apache.jackrabbit.oak.spi.state.AbstractNodeState.compareAgainstBaseState(AbstractNodeState.java:107)
	at org.apache.jackrabbit.oak.kernel.KernelNodeState.compareAgainstBaseState(KernelNodeState.java:214)
	at org.apache.jackrabbit.oak.jcr.observation.ChangeProcessor$EventGeneratingNodeStateDiff.childNodeChanged(ChangeProcessor.java:155)
	at org.apache.jackrabbit.oak.spi.state.AbstractNodeState.compareAgainstBaseState(AbstractNodeState.java:107)
	at org.apache.jackrabbit.oak.kernel.KernelNodeState.compareAgainstBaseState(KernelNodeState.java:214)
	at org.apache.jackrabbit.oak.core.RootImpl$1.getChanges(RootImpl.java:187)
	at org.apache.jackrabbit.oak.jcr.observation.ChangeProcessor.run(ChangeProcessor.java:70)
	at java.util.TimerThread.mainLoop(Timer.java:512)
	at java.util.TimerThread.run(Timer.java:462)

                
> Support for "invisible" internal content
> ----------------------------------------
>
>                 Key: OAK-182
>                 URL: https://issues.apache.org/jira/browse/OAK-182
>             Project: Jackrabbit Oak
>          Issue Type: New Feature
>          Components: core, jcr
>            Reporter: Jukka Zitting
>
> As discussed on the mailing list (http://markmail.org/message/kzt7csiz2bd5n3ww), it would be good to have a naming pattern line "{{:name}}" for internal content that we don't want to directly expose to JCR clients.
> JCR-related functionality like the namespace and node type validators and the observation dispatcher (see also OAK-181) should know to ignore such content and the JCR binding in oak-jcr should automatically filter out such internal content. Such internal content should probably also not be indexed for search.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (OAK-182) Support for "invisible" internal content

Posted by "Thomas Mueller (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OAK-182?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13413580#comment-13413580 ] 

Thomas Mueller commented on OAK-182:
------------------------------------

> Such internal content should probably also not be indexed for search.

That's certainly possible. Later on we can still allow indexing such 'hidden' properties once we have a use case.
                
> Support for "invisible" internal content
> ----------------------------------------
>
>                 Key: OAK-182
>                 URL: https://issues.apache.org/jira/browse/OAK-182
>             Project: Jackrabbit Oak
>          Issue Type: New Feature
>          Components: core, jcr
>            Reporter: Jukka Zitting
>
> As discussed on the mailing list (http://markmail.org/message/kzt7csiz2bd5n3ww), it would be good to have a naming pattern line "{{:name}}" for internal content that we don't want to directly expose to JCR clients.
> JCR-related functionality like the namespace and node type validators and the observation dispatcher (see also OAK-181) should know to ignore such content and the JCR binding in oak-jcr should automatically filter out such internal content. Such internal content should probably also not be indexed for search.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (OAK-182) Support for "invisible" internal content

Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OAK-182?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13414991#comment-13414991 ] 

Jukka Zitting commented on OAK-182:
-----------------------------------

It's better if you ignore the "invisible" content in the {{EventGeneratingNodeStateDiff}} class. Ignoring them inside the {{NodeState}} will prevent other code that needs to access such internal content from properly seeing it.
                
> Support for "invisible" internal content
> ----------------------------------------
>
>                 Key: OAK-182
>                 URL: https://issues.apache.org/jira/browse/OAK-182
>             Project: Jackrabbit Oak
>          Issue Type: New Feature
>          Components: core, jcr
>            Reporter: Jukka Zitting
>
> As discussed on the mailing list (http://markmail.org/message/kzt7csiz2bd5n3ww), it would be good to have a naming pattern line "{{:name}}" for internal content that we don't want to directly expose to JCR clients.
> JCR-related functionality like the namespace and node type validators and the observation dispatcher (see also OAK-181) should know to ignore such content and the JCR binding in oak-jcr should automatically filter out such internal content. Such internal content should probably also not be indexed for search.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (OAK-182) Support for "invisible" internal content

Posted by "angela (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OAK-182?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13416078#comment-13416078 ] 

angela commented on OAK-182:
----------------------------

i am not sure if it wise to expose such invisible content as "regular items" on the oak-api.
somehow it looks problematic to me that oak-jcr needs to deal with such internal stuff (and
thus any other implementation of the jcr-api would need to do the same...

wasn't it a valid alternative to really keep that as implementation detail in oak-core and
just expose the information using specific methods on the oak-api/spi?
                
> Support for "invisible" internal content
> ----------------------------------------
>
>                 Key: OAK-182
>                 URL: https://issues.apache.org/jira/browse/OAK-182
>             Project: Jackrabbit Oak
>          Issue Type: New Feature
>          Components: core, jcr
>            Reporter: Jukka Zitting
>
> As discussed on the mailing list (http://markmail.org/message/kzt7csiz2bd5n3ww), it would be good to have a naming pattern line "{{:name}}" for internal content that we don't want to directly expose to JCR clients.
> JCR-related functionality like the namespace and node type validators and the observation dispatcher (see also OAK-181) should know to ignore such content and the JCR binding in oak-jcr should automatically filter out such internal content. Such internal content should probably also not be indexed for search.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Comment Edited] (OAK-182) Support for "invisible" internal content

Posted by "Thomas Mueller (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OAK-182?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13414964#comment-13414964 ] 

Thomas Mueller edited comment on OAK-182 at 7/16/12 9:54 AM:
-------------------------------------------------------------

When enabling the IndexWrapper in the ContentRepositoryImpl default constructor, the org.apache.jackrabbit.oak.jcr.RepositoryTest.observation test fails with the exception stack trace below. I have a patch that fixed the issue, but I'm not familiar with the code and wonder if that is really the best way to fix it:

{code}
Index: src/main/java/org/apache/jackrabbit/oak/spi/state/AbstractNodeState.java
===================================================================
--- src/main/java/org/apache/jackrabbit/oak/spi/state/AbstractNodeState.java	(revision 1361947)
+++ src/main/java/org/apache/jackrabbit/oak/spi/state/AbstractNodeState.java	(working copy)
@@ -97,6 +97,10 @@
         Set<String> baseChildNodes = new HashSet<String>();
         for (ChildNodeEntry beforeCNE : base.getChildNodeEntries()) {
             String name = beforeCNE.getName();
+            if (name.startsWith(":")) {
+                // OAK-182: ignore invisible internal content
+                continue;
+            }
             NodeState beforeChild = beforeCNE.getNodeState();
             NodeState afterChild = getChildNode(name);
             if (afterChild == null) {
@@ -110,6 +114,10 @@
         }
         for (ChildNodeEntry afterChild : getChildNodeEntries()) {
             String name = afterChild.getName();
+            if (name.startsWith(":")) {
+                // OAK-182: ignore invisible internal content
+                continue;
+            }
             if (!baseChildNodes.contains(name)) {
                 diff.childNodeAdded(name, afterChild.getNodeState());
             }
{code}

Stack trace without the patch:

{code}
Exception in thread "Observation" java.lang.IllegalArgumentException: '/jcr:system/indexes/:data' is not a valid path. Prefix must not be empty
	at org.apache.jackrabbit.oak.namepath.NamePathMapperImpl$1.error(NamePathMapperImpl.java:108)
	at org.apache.jackrabbit.oak.namepath.JcrPathParser.parse(JcrPathParser.java:151)
	at org.apache.jackrabbit.oak.namepath.NamePathMapperImpl.getJcrPath(NamePathMapperImpl.java:122)
	at org.apache.jackrabbit.oak.jcr.observation.ChangeProcessor$EventGeneratingNodeStateDiff.jcrPath(ChangeProcessor.java:104)
	at org.apache.jackrabbit.oak.jcr.observation.ChangeProcessor$EventGeneratingNodeStateDiff.propertyChanged(ChangeProcessor.java:117)
	at org.apache.jackrabbit.oak.spi.state.AbstractNodeState.compareAgainstBaseState(AbstractNodeState.java:87)
	at org.apache.jackrabbit.oak.kernel.KernelNodeState.compareAgainstBaseState(KernelNodeState.java:214)
	at org.apache.jackrabbit.oak.jcr.observation.ChangeProcessor$EventGeneratingNodeStateDiff.childNodeChanged(ChangeProcessor.java:155)
	at org.apache.jackrabbit.oak.spi.state.AbstractNodeState.compareAgainstBaseState(AbstractNodeState.java:107)
	at org.apache.jackrabbit.oak.kernel.KernelNodeState.compareAgainstBaseState(KernelNodeState.java:214)
	at org.apache.jackrabbit.oak.jcr.observation.ChangeProcessor$EventGeneratingNodeStateDiff.childNodeChanged(ChangeProcessor.java:155)
	at org.apache.jackrabbit.oak.spi.state.AbstractNodeState.compareAgainstBaseState(AbstractNodeState.java:107)
	at org.apache.jackrabbit.oak.kernel.KernelNodeState.compareAgainstBaseState(KernelNodeState.java:214)
	at org.apache.jackrabbit.oak.jcr.observation.ChangeProcessor$EventGeneratingNodeStateDiff.childNodeChanged(ChangeProcessor.java:155)
	at org.apache.jackrabbit.oak.spi.state.AbstractNodeState.compareAgainstBaseState(AbstractNodeState.java:107)
	at org.apache.jackrabbit.oak.kernel.KernelNodeState.compareAgainstBaseState(KernelNodeState.java:214)
	at org.apache.jackrabbit.oak.core.RootImpl$1.getChanges(RootImpl.java:187)
	at org.apache.jackrabbit.oak.jcr.observation.ChangeProcessor.run(ChangeProcessor.java:70)
	at java.util.TimerThread.mainLoop(Timer.java:512)
	at java.util.TimerThread.run(Timer.java:462)
{code}
                
      was (Author: tmueller):
    When enabling the IndexWrapper in the ContentRepositoryImpl default constructor, the org.apache.jackrabbit.oak.jcr.RepositoryTest.observation test fails with the exception stack trace below. I have a patch that fixed the issue, but I'm not familiar with the code and wonder if that is really the best way to fix it:

{{
Index: src/main/java/org/apache/jackrabbit/oak/spi/state/AbstractNodeState.java
===================================================================
--- src/main/java/org/apache/jackrabbit/oak/spi/state/AbstractNodeState.java	(revision 1361947)
+++ src/main/java/org/apache/jackrabbit/oak/spi/state/AbstractNodeState.java	(working copy)
@@ -97,6 +97,10 @@
         Set<String> baseChildNodes = new HashSet<String>();
         for (ChildNodeEntry beforeCNE : base.getChildNodeEntries()) {
             String name = beforeCNE.getName();
+            if (name.startsWith(":")) {
+                // OAK-182: ignore invisible internal content
+                continue;
+            }
             NodeState beforeChild = beforeCNE.getNodeState();
             NodeState afterChild = getChildNode(name);
             if (afterChild == null) {
@@ -110,6 +114,10 @@
         }
         for (ChildNodeEntry afterChild : getChildNodeEntries()) {
             String name = afterChild.getName();
+            if (name.startsWith(":")) {
+                // OAK-182: ignore invisible internal content
+                continue;
+            }
             if (!baseChildNodes.contains(name)) {
                 diff.childNodeAdded(name, afterChild.getNodeState());
             }
}}

Stack trace without the patch:

{{
Exception in thread "Observation" java.lang.IllegalArgumentException: '/jcr:system/indexes/:data' is not a valid path. Prefix must not be empty
	at org.apache.jackrabbit.oak.namepath.NamePathMapperImpl$1.error(NamePathMapperImpl.java:108)
	at org.apache.jackrabbit.oak.namepath.JcrPathParser.parse(JcrPathParser.java:151)
	at org.apache.jackrabbit.oak.namepath.NamePathMapperImpl.getJcrPath(NamePathMapperImpl.java:122)
	at org.apache.jackrabbit.oak.jcr.observation.ChangeProcessor$EventGeneratingNodeStateDiff.jcrPath(ChangeProcessor.java:104)
	at org.apache.jackrabbit.oak.jcr.observation.ChangeProcessor$EventGeneratingNodeStateDiff.propertyChanged(ChangeProcessor.java:117)
	at org.apache.jackrabbit.oak.spi.state.AbstractNodeState.compareAgainstBaseState(AbstractNodeState.java:87)
	at org.apache.jackrabbit.oak.kernel.KernelNodeState.compareAgainstBaseState(KernelNodeState.java:214)
	at org.apache.jackrabbit.oak.jcr.observation.ChangeProcessor$EventGeneratingNodeStateDiff.childNodeChanged(ChangeProcessor.java:155)
	at org.apache.jackrabbit.oak.spi.state.AbstractNodeState.compareAgainstBaseState(AbstractNodeState.java:107)
	at org.apache.jackrabbit.oak.kernel.KernelNodeState.compareAgainstBaseState(KernelNodeState.java:214)
	at org.apache.jackrabbit.oak.jcr.observation.ChangeProcessor$EventGeneratingNodeStateDiff.childNodeChanged(ChangeProcessor.java:155)
	at org.apache.jackrabbit.oak.spi.state.AbstractNodeState.compareAgainstBaseState(AbstractNodeState.java:107)
	at org.apache.jackrabbit.oak.kernel.KernelNodeState.compareAgainstBaseState(KernelNodeState.java:214)
	at org.apache.jackrabbit.oak.jcr.observation.ChangeProcessor$EventGeneratingNodeStateDiff.childNodeChanged(ChangeProcessor.java:155)
	at org.apache.jackrabbit.oak.spi.state.AbstractNodeState.compareAgainstBaseState(AbstractNodeState.java:107)
	at org.apache.jackrabbit.oak.kernel.KernelNodeState.compareAgainstBaseState(KernelNodeState.java:214)
	at org.apache.jackrabbit.oak.core.RootImpl$1.getChanges(RootImpl.java:187)
	at org.apache.jackrabbit.oak.jcr.observation.ChangeProcessor.run(ChangeProcessor.java:70)
	at java.util.TimerThread.mainLoop(Timer.java:512)
	at java.util.TimerThread.run(Timer.java:462)
}}

                  
> Support for "invisible" internal content
> ----------------------------------------
>
>                 Key: OAK-182
>                 URL: https://issues.apache.org/jira/browse/OAK-182
>             Project: Jackrabbit Oak
>          Issue Type: New Feature
>          Components: core, jcr
>            Reporter: Jukka Zitting
>
> As discussed on the mailing list (http://markmail.org/message/kzt7csiz2bd5n3ww), it would be good to have a naming pattern line "{{:name}}" for internal content that we don't want to directly expose to JCR clients.
> JCR-related functionality like the namespace and node type validators and the observation dispatcher (see also OAK-181) should know to ignore such content and the JCR binding in oak-jcr should automatically filter out such internal content. Such internal content should probably also not be indexed for search.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (OAK-182) Support for "invisible" internal content

Posted by "Thomas Mueller (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OAK-182?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Thomas Mueller updated OAK-182:
-------------------------------

    Attachment: OAK-182-b.patch

This patch adds a class NodeStateUtils with a static function isHidden(String name). This method is used in the CommitEditor implementations so they ignore changes in hidden nodes.
                
> Support for "invisible" internal content
> ----------------------------------------
>
>                 Key: OAK-182
>                 URL: https://issues.apache.org/jira/browse/OAK-182
>             Project: Jackrabbit Oak
>          Issue Type: New Feature
>          Components: core, jcr
>            Reporter: Jukka Zitting
>         Attachments: OAK-182-b.patch
>
>
> As discussed on the mailing list (http://markmail.org/message/kzt7csiz2bd5n3ww), it would be good to have a naming pattern line "{{:name}}" for internal content that we don't want to directly expose to JCR clients.
> JCR-related functionality like the namespace and node type validators and the observation dispatcher (see also OAK-181) should know to ignore such content and the JCR binding in oak-jcr should automatically filter out such internal content. Such internal content should probably also not be indexed for search.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (OAK-182) Support for "invisible" internal content

Posted by "Thomas Mueller (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OAK-182?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Thomas Mueller resolved OAK-182.
--------------------------------

    Resolution: Fixed
    
> Support for "invisible" internal content
> ----------------------------------------
>
>                 Key: OAK-182
>                 URL: https://issues.apache.org/jira/browse/OAK-182
>             Project: Jackrabbit Oak
>          Issue Type: New Feature
>          Components: core, jcr
>            Reporter: Jukka Zitting
>         Attachments: OAK-182-b.patch
>
>
> As discussed on the mailing list (http://markmail.org/message/kzt7csiz2bd5n3ww), it would be good to have a naming pattern line "{{:name}}" for internal content that we don't want to directly expose to JCR clients.
> JCR-related functionality like the namespace and node type validators and the observation dispatcher (see also OAK-181) should know to ignore such content and the JCR binding in oak-jcr should automatically filter out such internal content. Such internal content should probably also not be indexed for search.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (OAK-182) Support for "invisible" internal content

Posted by "Thomas Mueller (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OAK-182?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13421322#comment-13421322 ] 

Thomas Mueller commented on OAK-182:
------------------------------------

> I think the ValidatingEditor shouldn't ignore hidden content... the MergingNodeStateDiff class probably shouldn't ignore hidden content.

For index content, I don't agree. I see no reason to validate or merge changes in the index. The only hidden content I aware of is index content.

But the tests seem to work now, so I will not change add the filtering to ValidatingEditor and MergingNodeStateDiff. I guess we will come back to this once it's a performance problem.

Also, I will change NodeStateUtils.isHidden() to support simple names only.


                
> Support for "invisible" internal content
> ----------------------------------------
>
>                 Key: OAK-182
>                 URL: https://issues.apache.org/jira/browse/OAK-182
>             Project: Jackrabbit Oak
>          Issue Type: New Feature
>          Components: core, jcr
>            Reporter: Jukka Zitting
>         Attachments: OAK-182-b.patch
>
>
> As discussed on the mailing list (http://markmail.org/message/kzt7csiz2bd5n3ww), it would be good to have a naming pattern line "{{:name}}" for internal content that we don't want to directly expose to JCR clients.
> JCR-related functionality like the namespace and node type validators and the observation dispatcher (see also OAK-181) should know to ignore such content and the JCR binding in oak-jcr should automatically filter out such internal content. Such internal content should probably also not be indexed for search.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Comment Edited] (OAK-182) Support for "invisible" internal content

Posted by "Thomas Mueller (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OAK-182?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13414964#comment-13414964 ] 

Thomas Mueller edited comment on OAK-182 at 7/16/12 9:52 AM:
-------------------------------------------------------------

When enabling the IndexWrapper in the ContentRepositoryImpl default constructor, the org.apache.jackrabbit.oak.jcr.RepositoryTest.observation test fails with the exception stack trace below. I have a patch that fixed the issue, but I'm not familiar with the code and wonder if that is really the best way to fix it:

{{
Index: src/main/java/org/apache/jackrabbit/oak/spi/state/AbstractNodeState.java
===================================================================
--- src/main/java/org/apache/jackrabbit/oak/spi/state/AbstractNodeState.java	(revision 1361947)
+++ src/main/java/org/apache/jackrabbit/oak/spi/state/AbstractNodeState.java	(working copy)
@@ -97,6 +97,10 @@
         Set<String> baseChildNodes = new HashSet<String>();
         for (ChildNodeEntry beforeCNE : base.getChildNodeEntries()) {
             String name = beforeCNE.getName();
+            if (name.startsWith(":")) {
+                // OAK-182: ignore invisible internal content
+                continue;
+            }
             NodeState beforeChild = beforeCNE.getNodeState();
             NodeState afterChild = getChildNode(name);
             if (afterChild == null) {
@@ -110,6 +114,10 @@
         }
         for (ChildNodeEntry afterChild : getChildNodeEntries()) {
             String name = afterChild.getName();
+            if (name.startsWith(":")) {
+                // OAK-182: ignore invisible internal content
+                continue;
+            }
             if (!baseChildNodes.contains(name)) {
                 diff.childNodeAdded(name, afterChild.getNodeState());
             }
}}

Stack trace without the patch:

{{
Exception in thread "Observation" java.lang.IllegalArgumentException: '/jcr:system/indexes/:data' is not a valid path. Prefix must not be empty
	at org.apache.jackrabbit.oak.namepath.NamePathMapperImpl$1.error(NamePathMapperImpl.java:108)
	at org.apache.jackrabbit.oak.namepath.JcrPathParser.parse(JcrPathParser.java:151)
	at org.apache.jackrabbit.oak.namepath.NamePathMapperImpl.getJcrPath(NamePathMapperImpl.java:122)
	at org.apache.jackrabbit.oak.jcr.observation.ChangeProcessor$EventGeneratingNodeStateDiff.jcrPath(ChangeProcessor.java:104)
	at org.apache.jackrabbit.oak.jcr.observation.ChangeProcessor$EventGeneratingNodeStateDiff.propertyChanged(ChangeProcessor.java:117)
	at org.apache.jackrabbit.oak.spi.state.AbstractNodeState.compareAgainstBaseState(AbstractNodeState.java:87)
	at org.apache.jackrabbit.oak.kernel.KernelNodeState.compareAgainstBaseState(KernelNodeState.java:214)
	at org.apache.jackrabbit.oak.jcr.observation.ChangeProcessor$EventGeneratingNodeStateDiff.childNodeChanged(ChangeProcessor.java:155)
	at org.apache.jackrabbit.oak.spi.state.AbstractNodeState.compareAgainstBaseState(AbstractNodeState.java:107)
	at org.apache.jackrabbit.oak.kernel.KernelNodeState.compareAgainstBaseState(KernelNodeState.java:214)
	at org.apache.jackrabbit.oak.jcr.observation.ChangeProcessor$EventGeneratingNodeStateDiff.childNodeChanged(ChangeProcessor.java:155)
	at org.apache.jackrabbit.oak.spi.state.AbstractNodeState.compareAgainstBaseState(AbstractNodeState.java:107)
	at org.apache.jackrabbit.oak.kernel.KernelNodeState.compareAgainstBaseState(KernelNodeState.java:214)
	at org.apache.jackrabbit.oak.jcr.observation.ChangeProcessor$EventGeneratingNodeStateDiff.childNodeChanged(ChangeProcessor.java:155)
	at org.apache.jackrabbit.oak.spi.state.AbstractNodeState.compareAgainstBaseState(AbstractNodeState.java:107)
	at org.apache.jackrabbit.oak.kernel.KernelNodeState.compareAgainstBaseState(KernelNodeState.java:214)
	at org.apache.jackrabbit.oak.core.RootImpl$1.getChanges(RootImpl.java:187)
	at org.apache.jackrabbit.oak.jcr.observation.ChangeProcessor.run(ChangeProcessor.java:70)
	at java.util.TimerThread.mainLoop(Timer.java:512)
	at java.util.TimerThread.run(Timer.java:462)
}}

                
      was (Author: tmueller):
    When enabling the IndexWrapper in the ContentRepositoryImpl default constructor, the org.apache.jackrabbit.oak.jcr.RepositoryTest.observation test fails with the exception stack trace below. I have a patch that fixed the issue, but I'm not familiar with the code and wonder if that is really the best way to fix it:

Index: src/main/java/org/apache/jackrabbit/oak/spi/state/AbstractNodeState.java
===================================================================
--- src/main/java/org/apache/jackrabbit/oak/spi/state/AbstractNodeState.java	(revision 1361947)
+++ src/main/java/org/apache/jackrabbit/oak/spi/state/AbstractNodeState.java	(working copy)
@@ -97,6 +97,10 @@
         Set<String> baseChildNodes = new HashSet<String>();
         for (ChildNodeEntry beforeCNE : base.getChildNodeEntries()) {
             String name = beforeCNE.getName();
+            if (name.startsWith(":")) {
+                // OAK-182: ignore invisible internal content
+                continue;
+            }
             NodeState beforeChild = beforeCNE.getNodeState();
             NodeState afterChild = getChildNode(name);
             if (afterChild == null) {
@@ -110,6 +114,10 @@
         }
         for (ChildNodeEntry afterChild : getChildNodeEntries()) {
             String name = afterChild.getName();
+            if (name.startsWith(":")) {
+                // OAK-182: ignore invisible internal content
+                continue;
+            }
             if (!baseChildNodes.contains(name)) {
                 diff.childNodeAdded(name, afterChild.getNodeState());
             }


Stack trace without the patch:

Exception in thread "Observation" java.lang.IllegalArgumentException: '/jcr:system/indexes/:data' is not a valid path. Prefix must not be empty
	at org.apache.jackrabbit.oak.namepath.NamePathMapperImpl$1.error(NamePathMapperImpl.java:108)
	at org.apache.jackrabbit.oak.namepath.JcrPathParser.parse(JcrPathParser.java:151)
	at org.apache.jackrabbit.oak.namepath.NamePathMapperImpl.getJcrPath(NamePathMapperImpl.java:122)
	at org.apache.jackrabbit.oak.jcr.observation.ChangeProcessor$EventGeneratingNodeStateDiff.jcrPath(ChangeProcessor.java:104)
	at org.apache.jackrabbit.oak.jcr.observation.ChangeProcessor$EventGeneratingNodeStateDiff.propertyChanged(ChangeProcessor.java:117)
	at org.apache.jackrabbit.oak.spi.state.AbstractNodeState.compareAgainstBaseState(AbstractNodeState.java:87)
	at org.apache.jackrabbit.oak.kernel.KernelNodeState.compareAgainstBaseState(KernelNodeState.java:214)
	at org.apache.jackrabbit.oak.jcr.observation.ChangeProcessor$EventGeneratingNodeStateDiff.childNodeChanged(ChangeProcessor.java:155)
	at org.apache.jackrabbit.oak.spi.state.AbstractNodeState.compareAgainstBaseState(AbstractNodeState.java:107)
	at org.apache.jackrabbit.oak.kernel.KernelNodeState.compareAgainstBaseState(KernelNodeState.java:214)
	at org.apache.jackrabbit.oak.jcr.observation.ChangeProcessor$EventGeneratingNodeStateDiff.childNodeChanged(ChangeProcessor.java:155)
	at org.apache.jackrabbit.oak.spi.state.AbstractNodeState.compareAgainstBaseState(AbstractNodeState.java:107)
	at org.apache.jackrabbit.oak.kernel.KernelNodeState.compareAgainstBaseState(KernelNodeState.java:214)
	at org.apache.jackrabbit.oak.jcr.observation.ChangeProcessor$EventGeneratingNodeStateDiff.childNodeChanged(ChangeProcessor.java:155)
	at org.apache.jackrabbit.oak.spi.state.AbstractNodeState.compareAgainstBaseState(AbstractNodeState.java:107)
	at org.apache.jackrabbit.oak.kernel.KernelNodeState.compareAgainstBaseState(KernelNodeState.java:214)
	at org.apache.jackrabbit.oak.core.RootImpl$1.getChanges(RootImpl.java:187)
	at org.apache.jackrabbit.oak.jcr.observation.ChangeProcessor.run(ChangeProcessor.java:70)
	at java.util.TimerThread.mainLoop(Timer.java:512)
	at java.util.TimerThread.run(Timer.java:462)

                  
> Support for "invisible" internal content
> ----------------------------------------
>
>                 Key: OAK-182
>                 URL: https://issues.apache.org/jira/browse/OAK-182
>             Project: Jackrabbit Oak
>          Issue Type: New Feature
>          Components: core, jcr
>            Reporter: Jukka Zitting
>
> As discussed on the mailing list (http://markmail.org/message/kzt7csiz2bd5n3ww), it would be good to have a naming pattern line "{{:name}}" for internal content that we don't want to directly expose to JCR clients.
> JCR-related functionality like the namespace and node type validators and the observation dispatcher (see also OAK-181) should know to ignore such content and the JCR binding in oak-jcr should automatically filter out such internal content. Such internal content should probably also not be indexed for search.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (OAK-182) Support for "invisible" internal content

Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OAK-182?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13421295#comment-13421295 ] 

Jukka Zitting commented on OAK-182:
-----------------------------------

Looks good, though note the following:

* No need to call {{PathUtils.getName()}} in {{NodeStateUtils.isHidden()}} as the given name is not a path.
* I think the {{ValidatingEditor}} shouldn't ignore hidden content. Individual {{Validator}} classes that the {{ValidatingEditor}} calls may or may not want to do so, but it should be up to them to decide.
* Similarly, the {{MergingNodeStateDiff}} class probably shouldn't ignore hidden content. We want to be able to properly merge also such content.
                
> Support for "invisible" internal content
> ----------------------------------------
>
>                 Key: OAK-182
>                 URL: https://issues.apache.org/jira/browse/OAK-182
>             Project: Jackrabbit Oak
>          Issue Type: New Feature
>          Components: core, jcr
>            Reporter: Jukka Zitting
>         Attachments: OAK-182-b.patch
>
>
> As discussed on the mailing list (http://markmail.org/message/kzt7csiz2bd5n3ww), it would be good to have a naming pattern line "{{:name}}" for internal content that we don't want to directly expose to JCR clients.
> JCR-related functionality like the namespace and node type validators and the observation dispatcher (see also OAK-181) should know to ignore such content and the JCR binding in oak-jcr should automatically filter out such internal content. Such internal content should probably also not be indexed for search.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira