Return-Path: X-Original-To: apmail-jackrabbit-oak-dev-archive@minotaur.apache.org Delivered-To: apmail-jackrabbit-oak-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D818EDA33 for ; Mon, 16 Jul 2012 09:52:41 +0000 (UTC) Received: (qmail 95986 invoked by uid 500); 16 Jul 2012 09:52:40 -0000 Delivered-To: apmail-jackrabbit-oak-dev-archive@jackrabbit.apache.org Received: (qmail 95593 invoked by uid 500); 16 Jul 2012 09:52:39 -0000 Mailing-List: contact oak-dev-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: oak-dev@jackrabbit.apache.org Delivered-To: mailing list oak-dev@jackrabbit.apache.org Received: (qmail 95480 invoked by uid 99); 16 Jul 2012 09:52:35 -0000 Received: from issues-vm.apache.org (HELO issues-vm) (140.211.11.160) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 16 Jul 2012 09:52:35 +0000 Received: from isssues-vm.apache.org (localhost [127.0.0.1]) by issues-vm (Postfix) with ESMTP id 78118142860 for ; Mon, 16 Jul 2012 09:52:35 +0000 (UTC) Date: Mon, 16 Jul 2012 09:52:35 +0000 (UTC) From: "Thomas Mueller (JIRA)" To: oak-dev@jackrabbit.apache.org Message-ID: <1503776077.57083.1342432355494.JavaMail.jiratomcat@issues-vm> In-Reply-To: <1731976185.41399.1342094974438.JavaMail.jiratomcat@issues-vm> Subject: [jira] [Comment Edited] (OAK-182) Support for "invisible" internal content MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ 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 baseChildNodes = new HashSet(); 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 baseChildNodes = new HashSet(); 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