[
https://jira.jboss.org/jira/browse/DNA-337?page=com.atlassian.jira.plugin...
]
Brian Carothers updated DNA-337:
--------------------------------
Attachment: DNA-337.patch
The problem is that the namespace registry implementations project the namespace mappings
into the graph as nodes with name of the mapping prefix located under the
/jcr:system/dna:namespaces node. For example, the built-in mapping from "jcr"
to "http://www.jcp.org/jcr/1.0" causes the creation of a node at
/jcr:system/dna:namespaces/jcr. This is eminently sensible.
Except for the trivial mapping from the empty prefix to the empty namespace (""
-> ""). This causes a node to be added at
"/jcr:system/dna:namespaces/", which our path factory helpfully converts to
"/jcr:system/dna:namespaces". In and of itself, this was actually helpful as
the trivial mapping seemed to always occur first and actually served to create the
"/jcr:system/dna:namespaces" node, which had to exist so that the other mappings
had a location under which to store their nodes.
BUT, we have two layers of namespace registries, the persistent-scoped registry and the
session-scoped registry. Each is currently projecting their mappings onto the system view
at JCR session initialization (which is probably wrong). This is innocuous at the moment
since both have the exact same set of mappings at JCR session intiialization time and the
net effect is to overwrite each mapping with the same data.
EXCEPT for the /jcr:system/dna:namespaces node, which got created twice - once by the
persistent registry and once by the transient registry.
The attached patch works around this problem by not storing the trivial mapping in the
system view and adding code to explicitly create the dna:namespaces node if it is not
already there. My thinking is that the presence of the trivial mapping in the namespace
mappings is simply an optimization that DNA performs so that it can always look up the URI
by prefix (and vice versa) without adding a separate check to see if the prefix is even
set on the given Name. There may well be a better approach.
I have added test cases for this as well, but they are too hard to separate from the other
stuff that I'm working on to extract at this time. They'll be included in the
type projection patch.
Namespace Registries Create Two Nodes at /jcr:system/dna:namespaces
-------------------------------------------------------------------
Key: DNA-337
URL:
https://jira.jboss.org/jira/browse/DNA-337
Project: DNA
Issue Type: Bug
Components: JCR
Affects Versions: 0.4
Reporter: Brian Carothers
Priority: Minor
Attachments: DNA-337.patch
After initializing a repository and creating a session, the system creates two nodes
(same name siblings) at /jcr:system/dna:namespaces. This confounds the
RepositoryNodeTypeManagers attempts to assign a primary type to either dna:namespaces node
as the definition of the dna:system type (the primary type for /jcr:system) does not allow
SNS for the dna:namespaces node.
--
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