[dna-issues] [JBoss JIRA] Created: (DNA-539) AbstractJcrNode.location.getUuid() Returns Null for Referenceable Nodes
Brian Carothers (JIRA)
jira-events at lists.jboss.org
Fri Oct 9 13:37:05 EDT 2009
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
Priority: Trivial
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