You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "chris meadows (JIRA)" <ji...@apache.org> on 2007/04/19 13:05:16 UTC

[jira] Created: (JCR-854) allowSameNameSiblings not honoured for nt:file Node Type

allowSameNameSiblings not honoured for nt:file Node Type
--------------------------------------------------------

                 Key: JCR-854
                 URL: https://issues.apache.org/jira/browse/JCR-854
             Project: Jackrabbit
          Issue Type: Bug
          Components: core
    Affects Versions: 1.2.3
            Reporter: chris meadows
            Priority: Critical


It is possible to create mutiple nt:file sibling Node Types at the root of a repository:

  public void testUniqueFolders() {
    Node root = null;
    Node folder1 = null;
    Node folder2 = null;
    Session session = null;    
    try {
      Repository repository = new TransientRepository();
      session = repository.login(
            new SimpleCredentials("username", "password".toCharArray())); 
      root = session.getRootNode();
      System.out.println("root allows same name siblings: " + root.getDefinition().allowsSameNameSiblings());
      folder1 = root.addNode("myfolder",  "nt:folder");
      folder2 = root.addNode("myfolder",  "nt:folder");
      System.out.println("folder allows same name siblings: " + folder1.getDefinition().allowsSameNameSiblings());
      session.save();
      assertFalse( folder1.isSame(folder2) );
      fail("Expected ItemExistsException");
    }
    catch (Exception e) {
      e.printStackTrace(System.err);
      fail(e.getMessage());
    }
    finally {
      try {
        folder1.remove();
        folder2.remove();
        session.save();
      }
      catch (RepositoryException e) {
        e.printStackTrace(System.err);
        fail(e.getMessage());
      }
      
    }
    
  }  


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (JCR-854) allowSameNameSiblings not honoured for nt:file Node Type

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

Stefan Guggisberg reassigned JCR-854:
-------------------------------------

    Assignee: Stefan Guggisberg

> allowSameNameSiblings not honoured for nt:file Node Type
> --------------------------------------------------------
>
>                 Key: JCR-854
>                 URL: https://issues.apache.org/jira/browse/JCR-854
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.2.3
>            Reporter: chris meadows
>         Assigned To: Stefan Guggisberg
>            Priority: Critical
>         Attachments: FirstHop.java
>
>
> It is possible to create mutiple nt:file sibling Node Types at the root of a repository. 
> This should not be possible according the jcr spec section 6.7.22.8 (SameNameSiblings false)
> See attached snippet

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (JCR-854) allowSameNameSiblings not honoured for nt:file Node Type

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

chris meadows updated JCR-854:
------------------------------

    Description: 
It is possible to create mutiple nt:file sibling Node Types at the root of a repository. See attached snippet



  was:
It is possible to create mutiple nt:file sibling Node Types at the root of a repository:

  public void testUniqueFolders() {
    Node root = null;
    Node folder1 = null;
    Node folder2 = null;
    Session session = null;    
    try {
      Repository repository = new TransientRepository();
      session = repository.login(
            new SimpleCredentials("username", "password".toCharArray())); 
      root = session.getRootNode();
      System.out.println("root allows same name siblings: " + root.getDefinition().allowsSameNameSiblings());
      folder1 = root.addNode("myfolder",  "nt:folder");
      folder2 = root.addNode("myfolder",  "nt:folder");
      System.out.println("folder allows same name siblings: " + folder1.getDefinition().allowsSameNameSiblings());
      session.save();
      assertFalse( folder1.isSame(folder2) );
      fail("Expected ItemExistsException");
    }
    catch (Exception e) {
      e.printStackTrace(System.err);
      fail(e.getMessage());
    }
    finally {
      try {
        folder1.remove();
        folder2.remove();
        session.save();
      }
      catch (RepositoryException e) {
        e.printStackTrace(System.err);
        fail(e.getMessage());
      }
      
    }
    
  }  



> allowSameNameSiblings not honoured for nt:file Node Type
> --------------------------------------------------------
>
>                 Key: JCR-854
>                 URL: https://issues.apache.org/jira/browse/JCR-854
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.2.3
>            Reporter: chris meadows
>            Priority: Critical
>
> It is possible to create mutiple nt:file sibling Node Types at the root of a repository. See attached snippet

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (JCR-854) allowSameNameSiblings not honoured for nt:file Node Type

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

chris meadows updated JCR-854:
------------------------------

    Attachment: FirstHop.java

> allowSameNameSiblings not honoured for nt:file Node Type
> --------------------------------------------------------
>
>                 Key: JCR-854
>                 URL: https://issues.apache.org/jira/browse/JCR-854
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.2.3
>            Reporter: chris meadows
>            Priority: Critical
>         Attachments: FirstHop.java
>
>
> It is possible to create mutiple nt:file sibling Node Types at the root of a repository. See attached snippet

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JCR-854) allowSameNameSiblings not honoured for nt:file Node Type

Posted by "Stefan Guggisberg (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-854?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12490046 ] 

Stefan Guggisberg commented on JCR-854:
---------------------------------------

according to 6.7.22.8 *child* nodes of a node of type nt:folder cannot have same name siblings (sameNameSiblings=false).

the 'allowSameNameSibling' attribute applies to the child node definition of nt:folder.

while i think that the spec is clear in that respect (see 6.7.14 NodeDefition, allowsSameNameSiblings()) i agree that it's 
relatively easy to misinterpret the semantics of the allowSameNameSibling attribute at first.

> allowSameNameSiblings not honoured for nt:file Node Type
> --------------------------------------------------------
>
>                 Key: JCR-854
>                 URL: https://issues.apache.org/jira/browse/JCR-854
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.2.3
>            Reporter: chris meadows
>         Assigned To: Stefan Guggisberg
>            Priority: Critical
>         Attachments: FirstHop.java
>
>
> It is possible to create mutiple nt:file sibling Node Types at the root of a repository. 
> This should not be possible according the jcr spec section 6.7.22.8 (SameNameSiblings false)
> See attached snippet

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (JCR-854) allowSameNameSiblings not honoured for nt:file Node Type

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

chris meadows closed JCR-854.
-----------------------------

    Resolution: Invalid

My mistake. 
Spec isn't clear IMHO.
allowSameNameSiblings refers to a property of the _parent_, so calling folder.getDefinition().allowsSameNameSiblings()) is dependent on what the parent node is. If the parent is root, this will return true. If it is another folder node, it will return false.



> allowSameNameSiblings not honoured for nt:file Node Type
> --------------------------------------------------------
>
>                 Key: JCR-854
>                 URL: https://issues.apache.org/jira/browse/JCR-854
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.2.3
>            Reporter: chris meadows
>         Assigned To: Stefan Guggisberg
>            Priority: Critical
>         Attachments: FirstHop.java
>
>
> It is possible to create mutiple nt:file sibling Node Types at the root of a repository. 
> This should not be possible according the jcr spec section 6.7.22.8 (SameNameSiblings false)
> See attached snippet

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (JCR-854) allowSameNameSiblings not honoured for nt:file Node Type

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

chris meadows updated JCR-854:
------------------------------

    Description: 
It is possible to create mutiple nt:file sibling Node Types at the root of a repository. 
This should not be possible according the jcr spec section 6.7.22.8 (SameNameSiblings false)

See attached snippet



  was:
It is possible to create mutiple nt:file sibling Node Types at the root of a repository. See attached snippet




> allowSameNameSiblings not honoured for nt:file Node Type
> --------------------------------------------------------
>
>                 Key: JCR-854
>                 URL: https://issues.apache.org/jira/browse/JCR-854
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.2.3
>            Reporter: chris meadows
>            Priority: Critical
>         Attachments: FirstHop.java
>
>
> It is possible to create mutiple nt:file sibling Node Types at the root of a repository. 
> This should not be possible according the jcr spec section 6.7.22.8 (SameNameSiblings false)
> See attached snippet

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.