[
https://jira.jboss.org/jira/browse/DNA-295?page=com.atlassian.jira.plugin...
]
Randall Hauch commented on DNA-295:
-----------------------------------
We had an IRC discussion about whether to use the a "dna:xmltext" node type.
Section 6.4.2.3 of the JSR-170 specification says nothing about a required node type, but
instead states that the node must be named "jcr:xmltext" and must have a
single-valued property "jcr:xmlcharacters". The TCK tests do check that when
this structure appears, the "jcr:xmlcharacters" property is single-valued.
Currently, our implementation returns the NodeDefinition for a node based upon the most
appropriate node definition for the parent, and the PropertyDefinition for each property
in the node based upon the property definitions for the primary type and mixins. The
question is, therefore, how to get the PropertyDefinition for the
"jcr:xmlcharacters" node to be single-valued.
To my understanding, there are several options:
1) Continue to use a custom DNA-specific type (e.g., "dna:xmltext") for the
nodes named "jcr:xmltext", and this node type would contain one single-valued
property definition for the "jcr:xmlcharacters" property. In reality, these
"jcr:xmltext" nodes may exist in the JCR repository, so we should probably have
real node types for them.
2) Allow the use of any node type (e.g., "nt:unstructured"), but instead look in
the JcrSession code that loads nodes to look for the
"jcr:xmltext/jcr:xmlcharacters" pattern, and assign a property definition that
is single-valued. This is kind of a hack, especially if the PropertyDefinition is not in
the NodeTypeManager. Also, this checking would be done on every node loaded by the
JcrSession.
Generally speaking, option #1 is simply more attractive. Plus, I think we're actually
going to need a node type that defines the "jcr:xmltext/jcr:xmlcharacters"
structure. Section 7.2.4 of the spec defines how Document View importing may choose the
primary node type for the imported nodes. The implementation may use
"nt:unstructured" for the node (representing each XML element), or it may
dynamically create node types per the structure or per an XML Schema. In the case were
we're dynamically creating node types, one effective way would be to define a mixin
called called "dna:xmlcontent" that defines that the node has one or more (per
section 4.2.3) child nodes called "jcr:xmltext", each with a single-valued
property called "jcr:xmlcharacters". In order to property define this mixin (or
any other node type that is similar), it needs to reference another node type for the
"jcr:xmltext" node. This is because the "jcr:xmltext" node has
restrictions on its properties, yet a child definition cannot place restrictions on the
properties of the child; instead, a child definition can only refer to the required or
allowed node types for its children.
So, to do anything interesting with Document View import and primary node types and mixin
types, we'll want a node type for "jcr:xmltext" with a property property
type for "jcr:xmlcharacters". And I think this offers more support for option
#1.
Therefore, I think we should continue along the lines that Brian provided with the
namespace patch added to the "final" patch. More to follow shortly after those
are evaluated.
TCK Tests for Session.export* Methods Fail
------------------------------------------
Key: DNA-295
URL:
https://jira.jboss.org/jira/browse/DNA-295
Project: DNA
Issue Type: Bug
Components: JCR
Affects Versions: 0.4
Reporter: Brian Carothers
Attachments: DNA-295.patch, DNA-295.patch, DNA-295_final.patch,
DNA-295_namespace.patch
The TCK tests for Session.exportSystemView and Session.exportDocumentView fail as these
methods have not yet been implemented as per sections 6.4.1 and 6.4.2 of the JCR 1.0
Specification.
--
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