You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-commits@jackrabbit.apache.org by md...@apache.org on 2012/08/31 22:36:28 UTC
svn commit: r1379593 - in
/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/type:
NodeTypeImpl.java NodeTypeManagerImpl.java
Author: mduerig
Date: Fri Aug 31 20:36:28 2012
New Revision: 1379593
URL: http://svn.apache.org/viewvc?rev=1379593&view=rev
Log:
OAK-66: JCR Node Type Management
TODO distinguish between additive and overriding item definitions. See 3.7.6.8 Item Definitions in Subtypes
TODO fail if not orderable but a supertype is orderable. See 3.7.6.7 Node Type Attribute Subtyping Rules
TODO fail if a supertype specifies a different primary item. See 3.7.6.7 Node Type Attribute Subtyping Rules
TODO fail on invalid item definitions. See 3.7.6.8 Item Definitions in Subtypes
Modified:
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/type/NodeTypeImpl.java
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/type/NodeTypeManagerImpl.java
Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/type/NodeTypeImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/type/NodeTypeImpl.java?rev=1379593&r1=1379592&r2=1379593&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/type/NodeTypeImpl.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/type/NodeTypeImpl.java Fri Aug 31 20:36:28 2012
@@ -235,6 +235,7 @@ class NodeTypeImpl implements NodeType {
@Override
public PropertyDefinition[] getPropertyDefinitions() {
+ // TODO distinguish between additive and overriding property definitions. See 3.7.6.8 Item Definitions in Subtypes
Collection<PropertyDefinition> definitions =
new ArrayList<PropertyDefinition>();
for (NodeType type : getSupertypes()) {
@@ -247,6 +248,7 @@ class NodeTypeImpl implements NodeType {
@Override
public NodeDefinition[] getChildNodeDefinitions() {
+ // TODO distinguish between additive and overriding node definitions. See 3.7.6.8 Item Definitions in Subtypes
Collection<NodeDefinition> definitions =
new ArrayList<NodeDefinition>();
for (NodeType type : getSupertypes()) {
Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/type/NodeTypeManagerImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/type/NodeTypeManagerImpl.java?rev=1379593&r1=1379592&r2=1379593&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/type/NodeTypeManagerImpl.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/type/NodeTypeManagerImpl.java Fri Aug 31 20:36:28 2012
@@ -244,12 +244,17 @@ public class NodeTypeManagerImpl extends
node.setBoolean(JCR_IS_ABSTRACT, ntd.isAbstract());
node.setBoolean(JCR_IS_QUERYABLE, ntd.isQueryable());
node.setBoolean(JCR_ISMIXIN, ntd.isMixin());
+
+ // TODO fail if not orderable but a supertype is orderable. See 3.7.6.7 Node Type Attribute Subtyping Rules
node.setBoolean(JCR_HASORDERABLECHILDNODES, ntd.hasOrderableChildNodes());
String primaryItemName = ntd.getPrimaryItemName();
+
+ // TODO fail if a supertype specifies a different primary item. See 3.7.6.7 Node Type Attribute Subtyping Rules
if (primaryItemName != null) {
node.setName(JCR_PRIMARYITEMNAME, primaryItemName);
}
+ // TODO fail on invalid item definitions. See 3.7.6.8 Item Definitions in Subtypes
int pdn = 1;
for (PropertyDefinition pd : ntd.getDeclaredPropertyDefinitions()) {
NodeUtil def = node.addChild(JCR_PROPERTYDEFINITION + pdn++, NT_PROPERTYDEFINITION);