[dna-issues] [JBoss JIRA] Resolved: (DNA-539) AbstractJcrNode.location.getUuid() Returns Null for Referenceable Nodes

Brian Carothers (JIRA) jira-events at lists.jboss.org
Tue Oct 20 11:42:05 EDT 2009


     [ https://jira.jboss.org/jira/browse/DNA-539?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Brian Carothers resolved DNA-539.
---------------------------------

    Fix Version/s: 0.7
       Resolution: Won't Fix
         Assignee: Brian Carothers


The original design that needed this was refactored and the resulting code ended up being pushed outside of AbstractJcrNode anyway (into WorkspaceLockManager.uuidFor(AbstractJcrNode), for the curious).  Unless/until some other code needs this, I'm withdrawing my defect.

> AbstractJcrNode.location.getUuid() Returns Null for Referenceable Nodes
> -----------------------------------------------------------------------
>
>                 Key: DNA-539
>                 URL: https://jira.jboss.org/jira/browse/DNA-539
>             Project: DNA
>          Issue Type: Feature Request
>          Components: JCR
>    Affects Versions: 0.6
>            Reporter: Brian Carothers
>            Assignee: Brian Carothers
>            Priority: Trivial
>             Fix For: 0.7
>
>
> For non-referenceable nodes, AbstractJcrNode.location.getUuid() returns the node's UUID if the node has a UUID (which is really a function of which connector the node maps to).  For referenceable nodes, AbstractJcrNode.location.getUuid() returns null but AbstractJcrNode.location.getIdProperty(JcrLexicon.UUID) returns a non-null value.
> Put another way:
> AbstractJcrNode.location has dna:uuid but not jcr:uuid if the node is not referenceable.
> AbstractJcrNode.location has jcr:uuid but not dna:uuid if the node is referenceable
> This means that the only safe way to get the corresponding UUID for a node (if one exists) is to run a code snippet like this:
>         if (location.getUuid() != null) return location.getUuid();
>         org.jboss.dna.graph.property.Property uuidProp = location.getIdProperty(JcrLexicon.UUID);
>         if (uuidProp == null) return null;
>         return this.cache.factories().getUuidFactory().create(uuidProp.getFirstValue());
> It would be nice if referenceable nodes still have dna:uuid set in their location field.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the dna-issues mailing list