You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Scott Cytacki (JIRA)" <ji...@apache.org> on 2008/05/19 23:43:55 UTC

[jira] Created: (JCR-1614) uuid of newly added node

uuid of newly added node
------------------------

                 Key: JCR-1614
                 URL: https://issues.apache.org/jira/browse/JCR-1614
             Project: Jackrabbit
          Issue Type: Bug
          Components: jackrabbit-jcr2spi
            Reporter: Scott Cytacki
             Fix For: 1.5


I'm using jcr2spi with spi2dav.

When I add a new child node.  And add the "mix:referenceable" mixin.  
and I don't  "save" the node.
Calling node.getUUID();
causes a repository exception.

My reading of the JCR spec section 4.9.1.1
is that a node should at least have a dummy UUID even if it hasn't been saved yet.  

The jcr2spi.NodeImpl.createNode method has the comment:
// NOTE: uuid is generated while creating new state.
But I cannot find where that is happening.

I can submit a test case for this if that would help.

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


[jira] Issue Comment Edited: (JCR-1614) uuid of newly added node

Posted by "Scott Cytacki (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-1614?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12598378#action_12598378 ] 

scytacki edited comment on JCR-1614 at 5/20/08 12:11 PM:
--------------------------------------------------------------

More info on this:

After digging through the code more it seems the real issue is that when a mixin is added to a node the system generated properties for that mixing are not also added to the node.  

Notes:

I found another reference to how uuid's are handled during add in the method:
org.apache.jackrabbit.jcr2spi.state.SessionItemStateManager.addNodeState(NodeState, Name, Name, String, QNodeDefinition, int)
It has this comment:
        // create new nodeState. NOTE, that the uniqueID is not added to the
        // state for consistency between 'addNode' and importXML // TODO review

I also found the code which automatically adds the uuid if the node type is mix:referencable.  this code is located in:
org.apache.jackrabbit.spi.commons.value.QValueFactoryImpl.computeAutoValues(QPropertyDefinition)
which is called through this stack:
org.apache.jackrabbit.spi.commons.value.QValueFactoryImpl.computeAutoValues(QPropertyDefinition)
org.apache.jackrabbit.jcr2spi.state.SessionItemStateManager.computeSystemGeneratedPropertyValues(NodeState, QPropertyDefinition)
org.apache.jackrabbit.jcr2spi.state.SessionItemStateManager.addNodeState(NodeState, Name, Name, String, QNodeDefinition, int)

So it seems if the mix:referenceable is part of the node definition when the node is created then a uuid will be generated.  But if the mix:referenceable is added after the node is created then the uuid is not generated.

      was (Author: scytacki):
    I found another reference to how uuid's are handled during add in the method:
org.apache.jackrabbit.jcr2spi.state.SessionItemStateManager.addNodeState(NodeState, Name, Name, String, QNodeDefinition, int)
It has this comment:
        // create new nodeState. NOTE, that the uniqueID is not added to the
        // state for consistency between 'addNode' and importXML // TODO review

  
> uuid of newly added node
> ------------------------
>
>                 Key: JCR-1614
>                 URL: https://issues.apache.org/jira/browse/JCR-1614
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: jackrabbit-jcr2spi
>            Reporter: Scott Cytacki
>             Fix For: 1.5
>
>
> I'm using jcr2spi with spi2dav.
> When I add a new child node.  And add the "mix:referenceable" mixin.  
> and I don't  "save" the node.
> Calling node.getUUID();
> causes a repository exception.
> My reading of the JCR spec section 4.9.1.1
> is that a node should at least have a dummy UUID even if it hasn't been saved yet.  
> The jcr2spi.NodeImpl.createNode method has the comment:
> // NOTE: uuid is generated while creating new state.
> But I cannot find where that is happening.
> I can submit a test case for this if that would help.

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


[jira] Issue Comment Edited: (JCR-1614) uuid of newly added node

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

anchela edited comment on JCR-1614 at 5/20/08 11:36 PM:
-------------------------------------------------------

the node does have a dummy uuid in the jcr:uuid property.
BUT: the node is not referenceable unless save is called (this is legal according to the spec) and therefore Node.getUUID() must throw.

therefore i think the behaviour is according to the spec. 
the reason for not have the mixin type take effect upon the transient modification is, that mixins such as mix:versionable, mix:referenceable have semantic meanings that cannot be fulfilled by the jcr2spi before the underlying store is informed (this is done by the save call).

      was (Author: anchela):
    the node does have a dummy uuid in the jcr:uuid property.
BUT: the node is not referenceable unless save is called (this is legal according to the spec) and therefore Node.getUUID() must throw.
  
> uuid of newly added node
> ------------------------
>
>                 Key: JCR-1614
>                 URL: https://issues.apache.org/jira/browse/JCR-1614
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: jackrabbit-jcr2spi
>            Reporter: Scott Cytacki
>             Fix For: 1.5
>
>
> I'm using jcr2spi with spi2dav.
> When I add a new child node.  And add the "mix:referenceable" mixin.  
> and I don't  "save" the node.
> Calling node.getUUID();
> causes a repository exception.
> My reading of the JCR spec section 4.9.1.1
> is that a node should at least have a dummy UUID even if it hasn't been saved yet.  
> The jcr2spi.NodeImpl.createNode method has the comment:
> // NOTE: uuid is generated while creating new state.
> But I cannot find where that is happening.
> I can submit a test case for this if that would help.

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


[jira] Commented: (JCR-1614) uuid of newly added node

Posted by "Scott Cytacki (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-1614?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12598378#action_12598378 ] 

Scott Cytacki commented on JCR-1614:
------------------------------------

I found another reference to how uuid's are handled during add in the method:
org.apache.jackrabbit.jcr2spi.state.SessionItemStateManager.addNodeState(NodeState, Name, Name, String, QNodeDefinition, int)
It has this comment:
        // create new nodeState. NOTE, that the uniqueID is not added to the
        // state for consistency between 'addNode' and importXML // TODO review


> uuid of newly added node
> ------------------------
>
>                 Key: JCR-1614
>                 URL: https://issues.apache.org/jira/browse/JCR-1614
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: jackrabbit-jcr2spi
>            Reporter: Scott Cytacki
>             Fix For: 1.5
>
>
> I'm using jcr2spi with spi2dav.
> When I add a new child node.  And add the "mix:referenceable" mixin.  
> and I don't  "save" the node.
> Calling node.getUUID();
> causes a repository exception.
> My reading of the JCR spec section 4.9.1.1
> is that a node should at least have a dummy UUID even if it hasn't been saved yet.  
> The jcr2spi.NodeImpl.createNode method has the comment:
> // NOTE: uuid is generated while creating new state.
> But I cannot find where that is happening.
> I can submit a test case for this if that would help.

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


[jira] Resolved: (JCR-1614) uuid of newly added node

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

angela resolved JCR-1614.
-------------------------

       Resolution: Invalid
    Fix Version/s:     (was: 1.5)

> uuid of newly added node
> ------------------------
>
>                 Key: JCR-1614
>                 URL: https://issues.apache.org/jira/browse/JCR-1614
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: jackrabbit-jcr2spi
>            Reporter: Scott Cytacki
>
> I'm using jcr2spi with spi2dav.
> When I add a new child node.  And add the "mix:referenceable" mixin.  
> and I don't  "save" the node.
> Calling node.getUUID();
> causes a repository exception.
> My reading of the JCR spec section 4.9.1.1
> is that a node should at least have a dummy UUID even if it hasn't been saved yet.  
> The jcr2spi.NodeImpl.createNode method has the comment:
> // NOTE: uuid is generated while creating new state.
> But I cannot find where that is happening.
> I can submit a test case for this if that would help.

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


[jira] Commented: (JCR-1614) uuid of newly added node

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

angela commented on JCR-1614:
-----------------------------

the node does have a dummy uuid in the jcr:uuid property.
BUT: the node is not referenceable unless save is called (this is legal according to the spec) and therefore Node.getUUID() must throw.

> uuid of newly added node
> ------------------------
>
>                 Key: JCR-1614
>                 URL: https://issues.apache.org/jira/browse/JCR-1614
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: jackrabbit-jcr2spi
>            Reporter: Scott Cytacki
>             Fix For: 1.5
>
>
> I'm using jcr2spi with spi2dav.
> When I add a new child node.  And add the "mix:referenceable" mixin.  
> and I don't  "save" the node.
> Calling node.getUUID();
> causes a repository exception.
> My reading of the JCR spec section 4.9.1.1
> is that a node should at least have a dummy UUID even if it hasn't been saved yet.  
> The jcr2spi.NodeImpl.createNode method has the comment:
> // NOTE: uuid is generated while creating new state.
> But I cannot find where that is happening.
> I can submit a test case for this if that would help.

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