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 "Chetan Mehrotra (JIRA)" <ji...@apache.org> on 2012/08/16 08:56:37 UTC

[jira] [Created] (OAK-249) Add support for auto created properties

Chetan Mehrotra created OAK-249:
-----------------------------------

             Summary: Add support for auto created properties
                 Key: OAK-249
                 URL: https://issues.apache.org/jira/browse/OAK-249
             Project: Jackrabbit Oak
          Issue Type: Bug
          Components: jcr
    Affects Versions: 0.5
            Reporter: Chetan Mehrotra


While trying to run Sling with Oak PathNotFoundException are seen with  properties like jcr:createdBy, jcr:created etc while accessing a node of type nt:file. It appears that current node creation logic is not generating the default properties as defined in the nodetype.

{code:java}
  @Test
    public void testDefaultProperties() throws RepositoryException {
        Node testRootNode = getNode(TEST_PATH);
        Node fileNode = testRootNode.addNode("foo.png","nt:file");
        Binary b = testRootNode.getSession().getValueFactory().createBinary(new ByteArrayInputStream("abcdefgh".getBytes()));
        Node contentNode = fileNode.addNode("jcr:content","nt:resource");
        contentNode.setProperty("jcr:data",b);
        testRootNode.getSession().save();

        Node cn = testRootNode.getNode("foo.png");
        assertNotNull(cn.getProperty("jcr:createdBy"));
        assertNotNull(cn.getProperty("jcr:created"));
    }
{code}

Above testcase fails with oak but passes with Jackrabbit. Most probably the logic present in org.apache.jackrabbit.core.NodeTypeInstanceHandler#computeSystemGeneratedPropertyValues has to be ported to Oak



--
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-249) Add support for auto created properties

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

angela updated OAK-249:
-----------------------

    Issue Type: Sub-task  (was: Bug)
        Parent: OAK-66
    
> Add support for auto created properties
> ---------------------------------------
>
>                 Key: OAK-249
>                 URL: https://issues.apache.org/jira/browse/OAK-249
>             Project: Jackrabbit Oak
>          Issue Type: Sub-task
>          Components: jcr
>    Affects Versions: 0.5
>            Reporter: Chetan Mehrotra
>
> While trying to run Sling with Oak PathNotFoundException are seen with  properties like jcr:createdBy, jcr:created etc while accessing a node of type nt:file. It appears that current node creation logic is not generating the default properties as defined in the nodetype.
> {code:java}
>   @Test
>     public void testDefaultProperties() throws RepositoryException {
>         Node testRootNode = getNode(TEST_PATH);
>         Node fileNode = testRootNode.addNode("foo.png","nt:file");
>         Binary b = testRootNode.getSession().getValueFactory().createBinary(new ByteArrayInputStream("abcdefgh".getBytes()));
>         Node contentNode = fileNode.addNode("jcr:content","nt:resource");
>         contentNode.setProperty("jcr:data",b);
>         testRootNode.getSession().save();
>         Node cn = testRootNode.getNode("foo.png");
>         assertNotNull(cn.getProperty("jcr:createdBy"));
>         assertNotNull(cn.getProperty("jcr:created"));
>     }
> {code}
> Above testcase fails with oak but passes with Jackrabbit. Most probably the logic present in org.apache.jackrabbit.core.NodeTypeInstanceHandler#computeSystemGeneratedPropertyValues has to be ported to Oak

--
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-249) Add support for auto created properties

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

Michael Dürig commented on OAK-249:
-----------------------------------

Auto created non protected/protected items must/should be created in transient space [1]. So we need to think of a mechanism to hook this in before save. 

[1] http://www.day.com/maven/jsr170/javadocs/jcr-2.0/javax/jcr/nodetype/ItemDefinition.html#isAutoCreated%28%29
                
> Add support for auto created properties
> ---------------------------------------
>
>                 Key: OAK-249
>                 URL: https://issues.apache.org/jira/browse/OAK-249
>             Project: Jackrabbit Oak
>          Issue Type: Sub-task
>          Components: jcr
>    Affects Versions: 0.5
>            Reporter: Chetan Mehrotra
>
> While trying to run Sling with Oak PathNotFoundException are seen with  properties like jcr:createdBy, jcr:created etc while accessing a node of type nt:file. It appears that current node creation logic is not generating the default properties as defined in the nodetype.
> {code:java}
>   @Test
>     public void testDefaultProperties() throws RepositoryException {
>         Node testRootNode = getNode(TEST_PATH);
>         Node fileNode = testRootNode.addNode("foo.png","nt:file");
>         Binary b = testRootNode.getSession().getValueFactory().createBinary(new ByteArrayInputStream("abcdefgh".getBytes()));
>         Node contentNode = fileNode.addNode("jcr:content","nt:resource");
>         contentNode.setProperty("jcr:data",b);
>         testRootNode.getSession().save();
>         Node cn = testRootNode.getNode("foo.png");
>         assertNotNull(cn.getProperty("jcr:createdBy"));
>         assertNotNull(cn.getProperty("jcr:created"));
>     }
> {code}
> Above testcase fails with oak but passes with Jackrabbit. Most probably the logic present in org.apache.jackrabbit.core.NodeTypeInstanceHandler#computeSystemGeneratedPropertyValues has to be ported to Oak

--
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