[
https://jira.jboss.org/jira/browse/DNA-363?page=com.atlassian.jira.plugin...
]
Brian Carothers updated DNA-363:
--------------------------------
Attachment: DNA-363_preliminary.patch
Added a rough patch that adds support for registering custom node types via CND files.
The patch:
- Cleans up a few places where the projection from CndImporter didn't match the JCR
built-in type definitions for nt:nodeType, nt:childNodeDefinition, etc.
- Adds a new abstract class GraphNodeTypeSource that returns the defined node types in the
same graph format that CndImporter uses
- Adds a new class CndNodeTypeSource that implements GraphNodeTypeSource and uses
CndImporter to parse one or more CND files
- Flipped RepositoryNodeTypeManager to expect a GraphNodeTypeSource as its input and
internally projects the graph nodes into JcrNodeTypes for validation
- Commented out TypeRegistrationTest since it depends on using (old) NodeTypeSources for
custom type registration. This contributed the majority of the changed lines for the
patch.
- Modified JcrNodeDefinition to lazily load the required primary types and default primary
type. This is important since nodes can define child nodes that have the parent node as a
required or default primary type (q.v., nt:unstructured)
- Added a test case to make sure that the CND registration was actually registering types
- Flipped the TCK test type source from InMemoryRepositoryStub to register its types from
a CND file
Remaining work to make the patch ready for committing:
- Add support for JSR-283-style typing (node type templates + finer-grained exceptions).
This is the easiest way to re-enable the TypeRegistrationTest, as I have an original
version based on NodeTypeTemplates that I could drop in. Converting 30-odd test cases to
30-odd CND files would be a mess.
- Convert JCR and DNA built-in types to CND format
- Delete old NodeTypeSource hierarchy and rename GraphNodeTypeSource to NodeTypeSource
- Clean up/add comments
- Review pass through the RNTM to make sure that there isn't any duplication of
effort
Future directions (separate bugs and not needed for 0.5, IMHO):
- Add support for type unregistration (-283 optional feature)
- Add support for type-reregistration (-283 optional feature)
- Add support for type swapping (as discussed prev. on IRC).
Define node types via CND files
-------------------------------
Key: DNA-363
URL:
https://jira.jboss.org/jira/browse/DNA-363
Project: DNA
Issue Type: Feature Request
Components: JCR
Affects Versions: 0.3
Reporter: Randall Hauch
Attachments: DNA-363_preliminary.patch
Our JCR implementation should allow users to define the node types (with their property
definitions and child node definitions) via CND files.
--
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