You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-issues@jackrabbit.apache.org by "angela (JIRA)" <ji...@apache.org> on 2013/04/05 11:58:18 UTC

[jira] [Comment Edited] (OAK-753) TreeImpl exposes hidden child trees

    [ https://issues.apache.org/jira/browse/OAK-753?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13623489#comment-13623489 ] 

angela edited comment on OAK-753 at 4/5/13 9:57 AM:
----------------------------------------------------

agreed... and i had that in the very beginning but it doesn't work as the Tree impl needs to have access to
hidden items such as for example the OAK_CHILD_ORDER. if we hide that below the nodestate level
we have to move the child-order handing as well and further extend the NodeState interface
with 'getOrderedChildNames()' and 'setOrderedChildNames'... i don't have any preference but
with the current setup where treeImpl takes care of the child ordering it doesn't work.
                
      was (Author: anchela):
    i had that in the very beginning but it doesn't work as the Tree impl needs to have access to
hidden items such as for example the OAK_CHILD_ORDER. if we hide that below the nodestate level
we have to move the child-order handing as well and further extend the NodeState interface
with 'getOrderedChildNames()' and 'setOrderedChildNames'... i don't have any preference but
with the current setup where treeImpl takes care of the child ordering it doesn't work.
                  
> TreeImpl exposes hidden child trees
> -----------------------------------
>
>                 Key: OAK-753
>                 URL: https://issues.apache.org/jira/browse/OAK-753
>             Project: Jackrabbit Oak
>          Issue Type: Task
>          Components: core
>            Reporter: angela
>
> while we are having an extra test to prevent hidden property states
> from being exposed on the oak-api, we forgot to add the same check for
> child trees.
> while adding the test is pretty straight forward it would have an impact
> not only on #getChild(String) but also on
> - #getChildren
> - #getChildrenCount
> - #getOrderedChildNames
> - ...
> the simple check without addressing the other methods (already taking OAK-709 into account):
> {code}
> private boolean canRead(TreeImpl tree) {
>         return tree.getNodeState().exists() && !NodeStateUtils.isHidden(tree.getName());
>     }
> {code}
> adding this test will cause the following tests to fail
> - o.a.j.test.nodetype.NodeTypeTest#testGetPrimaryItemName which traverses the
>   repository instead of using a configured node type to setup an appropriate test and fails with the short-cut for childcnt being 1 in NodeDelegate
> - TypeEditorTest#ignoreHidden which tries to create hidden nodes using
>   the oak api (see also OAK-695)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira