[
https://jira.jboss.org/jira/browse/DNA-357?page=com.atlassian.jira.plugin...
]
Randall Hauch commented on DNA-357:
-----------------------------------
Applied both patches. The first hides the "dna:nodeDefinition" property from
the JCR layer (meaning it might exist in the graph layer, but won't appear as
properties of JCR nodes). The second patch adds to "nt:base" a property
definition for a "dna:nodeDefinition" property that is protected and not
mandatory (nor autocreated). The spec is not clear as to whether a JCR implementation can
add properties to "nt:base" (the required supertype of all node types), the spec
is clear that an implementation can add properties to any of the built-in node types
through mixins. Therefore, the second patch actually adds this new definition to
"nt:base" by having "nt:base" extend the new "dna:defined"
mixin, which has the new "dna:nodeDefinition" property definition.
Because the "dna:nodeDefinition" is protected, JCR clients will not be allowed
to define another property with this name, nor will they be able to set the property
(using a residual definition) to any value. All this validation is done through the
normal process, requiring no code specific to "dna:nodeDefinition".
Nicely done! This is a great demonstration on how node types, node definitions, and
property definitions can be used to enforce a structure while having no additional
validation code.
Hide dna:nodeDefinition Property from Users
-------------------------------------------
Key: DNA-357
URL:
https://jira.jboss.org/jira/browse/DNA-357
Project: DNA
Issue Type: Feature Request
Components: JCR
Reporter: Brian Carothers
Priority: Minor
Fix For: 0.4
Attachments: DNA-357.patch, DNA-357_new_mixin.patch
dna:nodeDefinition is a bit of an odd duck. It is set on every property but doesn't
always have a valid JCR definition. This breaks an export-import round trip as the
property cannot be set during import. It also breaks a few TCK tests that assume a
jcr:xmltext node only has two properties (jcr:primaryType and jcr:xmlcharacters), but
that's really a TCK defect.
Can we just suppress this property at the JCR layer? It would still be available for
internal use but would not appear to end users. Alternatively, we should modify our
definition for nt:base to include it as a protected property - this solution may violate
the spec.
--
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