jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r1345075 - /jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/nodetype/
Date Fri, 01 Jun 2012 11:38:34 GMT
Author: jukka
Date: Fri Jun  1 11:38:34 2012
New Revision: 1345075

URL: http://svn.apache.org/viewvc?rev=1345075&view=rev
Log:
OAK-66: JCR Node Type Management

Add dummy node type template classes and fake registerNodeTypes() methods

Added:
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/nodetype/ItemDefinitionTemplateImpl.java
  (with props)
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/nodetype/NodeDefinitionTemplateImpl.java
  (with props)
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/nodetype/NodeTypeTemplateImpl.java
  (with props)
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/nodetype/PropertyDefinitionTemplateImpl.java
  (with props)
Modified:
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/nodetype/NodeTypeManagerImpl.java

Added: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/nodetype/ItemDefinitionTemplateImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/nodetype/ItemDefinitionTemplateImpl.java?rev=1345075&view=auto
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/nodetype/ItemDefinitionTemplateImpl.java
(added)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/nodetype/ItemDefinitionTemplateImpl.java
Fri Jun  1 11:38:34 2012
@@ -0,0 +1,85 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.oak.jcr.nodetype;
+
+import javax.jcr.nodetype.ItemDefinition;
+import javax.jcr.nodetype.NodeType;
+import javax.jcr.version.OnParentVersionAction;
+
+class ItemDefinitionTemplateImpl implements ItemDefinition {
+
+    private String name = null;
+
+    private boolean isAutoCreated = false;
+
+    private boolean isMandatory = false;
+
+    private boolean isProtected = false;
+
+    private int onParentVersion = OnParentVersionAction.COPY;
+
+    @Override
+    public NodeType getDeclaringNodeType() {
+        return null;
+    }
+
+    @Override
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    @Override
+    public boolean isAutoCreated() {
+        return isAutoCreated;
+    }
+
+    public void setAutoCreated(boolean isAutoCreated) {
+        this.isAutoCreated = isAutoCreated;
+    }
+
+    @Override
+    public boolean isMandatory() {
+        return isMandatory;
+    }
+
+    public void setMandatory(boolean isMandatory) {
+        this.isMandatory = isMandatory;
+    }
+
+    @Override
+    public boolean isProtected() {
+        return isProtected;
+    }
+
+    public void setProtected(boolean isProtected) {
+        this.isProtected = isProtected;
+    }
+
+    @Override
+    public int getOnParentVersion() {
+        return onParentVersion;
+    }
+
+    public void setOnParentVersion(int opv) {
+        onParentVersion = opv;
+    }
+
+}
\ No newline at end of file

Propchange: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/nodetype/ItemDefinitionTemplateImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/nodetype/NodeDefinitionTemplateImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/nodetype/NodeDefinitionTemplateImpl.java?rev=1345075&view=auto
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/nodetype/NodeDefinitionTemplateImpl.java
(added)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/nodetype/NodeDefinitionTemplateImpl.java
Fri Jun  1 11:38:34 2012
@@ -0,0 +1,71 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.oak.jcr.nodetype;
+
+import javax.jcr.nodetype.NodeDefinitionTemplate;
+import javax.jcr.nodetype.NodeType;
+
+class NodeDefinitionTemplateImpl extends ItemDefinitionTemplateImpl
+        implements NodeDefinitionTemplate {
+
+    private String defaultPrimaryTypeName = null;
+
+    private String[] requiredPrimaryTypeNames = null;
+
+    private boolean allowSameNameSiblings = false;
+
+    @Override
+    public String getDefaultPrimaryTypeName() {
+        return defaultPrimaryTypeName;
+    }
+
+    @Override
+    public void setDefaultPrimaryTypeName(String name) {
+        this.defaultPrimaryTypeName  = name;
+    }
+
+    @Override
+    public NodeType getDefaultPrimaryType() {
+        return null;
+    }
+
+    @Override
+    public String[] getRequiredPrimaryTypeNames() {
+        return requiredPrimaryTypeNames;
+    }
+
+    @Override
+    public void setRequiredPrimaryTypeNames(String[] names) {
+        this.requiredPrimaryTypeNames = names;
+    }
+
+    @Override
+    public NodeType[] getRequiredPrimaryTypes() {
+        return null;
+    }
+
+    @Override
+    public boolean allowsSameNameSiblings() {
+        return allowSameNameSiblings;
+    }
+
+    @Override
+    public void setSameNameSiblings(boolean allowSameNameSiblings) {
+        this.allowSameNameSiblings = allowSameNameSiblings;
+    }
+
+}
\ No newline at end of file

Propchange: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/nodetype/NodeDefinitionTemplateImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/nodetype/NodeTypeManagerImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/nodetype/NodeTypeManagerImpl.java?rev=1345075&r1=1345074&r2=1345075&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/nodetype/NodeTypeManagerImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/nodetype/NodeTypeManagerImpl.java
Fri Jun  1 11:38:34 2012
@@ -138,37 +138,32 @@ public class NodeTypeManagerImpl impleme
 
     @Override
     public NodeTypeTemplate createNodeTypeTemplate() throws RepositoryException {
-        throw new UnsupportedRepositoryOperationException();
+        return new NodeTypeTemplateImpl();
     }
 
     @Override
     public NodeTypeTemplate createNodeTypeTemplate(NodeTypeDefinition ntd) throws RepositoryException
{
-
-        throw new UnsupportedRepositoryOperationException();
+        return new NodeTypeTemplateImpl(ntd);
     }
 
     @Override
-    public NodeDefinitionTemplate createNodeDefinitionTemplate() throws RepositoryException
{
-
-        throw new UnsupportedRepositoryOperationException();
+    public NodeDefinitionTemplate createNodeDefinitionTemplate() {
+        return new NodeDefinitionTemplateImpl();
     }
 
     @Override
-    public PropertyDefinitionTemplate createPropertyDefinitionTemplate() throws RepositoryException
{
-
-        throw new UnsupportedRepositoryOperationException();
+    public PropertyDefinitionTemplate createPropertyDefinitionTemplate() {
+        return new PropertyDefinitionTemplateImpl();
     }
 
     @Override
     public NodeType registerNodeType(NodeTypeDefinition ntd, boolean allowUpdate) throws
RepositoryException {
-
-        throw new UnsupportedRepositoryOperationException();
+        return getNodeType("nt:base"); // FIXME OAK-66
     }
 
     @Override
     public NodeTypeIterator registerNodeTypes(NodeTypeDefinition[] ntds, boolean allowUpdate)
throws RepositoryException {
-
-        throw new UnsupportedRepositoryOperationException();
+        return NodeTypeIteratorAdapter.EMPTY; // FIXME OAK-66
     }
 
     @Override

Added: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/nodetype/NodeTypeTemplateImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/nodetype/NodeTypeTemplateImpl.java?rev=1345075&view=auto
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/nodetype/NodeTypeTemplateImpl.java
(added)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/nodetype/NodeTypeTemplateImpl.java
Fri Jun  1 11:38:34 2012
@@ -0,0 +1,155 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.oak.jcr.nodetype;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.jcr.nodetype.NodeDefinition;
+import javax.jcr.nodetype.NodeDefinitionTemplate;
+import javax.jcr.nodetype.NodeTypeDefinition;
+import javax.jcr.nodetype.NodeTypeTemplate;
+import javax.jcr.nodetype.PropertyDefinition;
+import javax.jcr.nodetype.PropertyDefinitionTemplate;
+
+class NodeTypeTemplateImpl implements NodeTypeTemplate {
+
+    private String name = null;
+
+    private boolean isAbstract = false;
+
+    private boolean isMixin = false;
+
+    private boolean isOrderable = false;
+
+    private boolean isQueryable = true;
+
+    private String primaryItemName = null;
+
+    private String[] superTypeNames = new String[0];
+
+    private List<PropertyDefinitionTemplate> propertyDefinitionTemplates =
+            new ArrayList<PropertyDefinitionTemplate>();
+
+    private List<NodeDefinitionTemplate> nodeDefinitionTemplates =
+            new ArrayList<NodeDefinitionTemplate>();
+
+    public NodeTypeTemplateImpl() {
+    }
+
+    public NodeTypeTemplateImpl(NodeTypeDefinition ntd) {
+        this.name = ntd.getName();
+        this.isAbstract = ntd.isAbstract();
+        this.isMixin = ntd.isMixin();
+        this.isOrderable = ntd.hasOrderableChildNodes();
+        this.isQueryable = ntd.isQueryable();
+        this.primaryItemName = ntd.getPrimaryItemName();
+        this.superTypeNames = ntd.getDeclaredSupertypeNames();
+        // TODO: child item templates?
+    }
+
+    @Override
+    public String getName() {
+        return name;
+    }
+
+    @Override
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    @Override
+    public boolean isAbstract() {
+        return isAbstract;
+    }
+
+    @Override
+    public void setAbstract(boolean abstractStatus) {
+        this.isAbstract = abstractStatus;
+    }
+
+    @Override
+    public boolean isMixin() {
+        return isMixin;
+    }
+
+    @Override
+    public void setMixin(boolean mixin) {
+        this.isMixin = mixin;
+    }
+
+    @Override
+    public boolean hasOrderableChildNodes() {
+        return isOrderable ;
+    }
+
+    @Override
+    public void setOrderableChildNodes(boolean orderable) {
+        this.isOrderable = orderable;
+    }
+
+    @Override
+    public boolean isQueryable() {
+        return isQueryable;
+    }
+
+    @Override
+    public void setQueryable(boolean queryable) {
+        this.isQueryable = queryable;
+    }
+
+    @Override
+    public String getPrimaryItemName() {
+        return primaryItemName ;
+    }
+
+    @Override
+    public void setPrimaryItemName(String name) {
+        this.primaryItemName = name;
+    }
+
+    @Override
+    public String[] getDeclaredSupertypeNames() {
+        return superTypeNames;
+    }
+
+    @Override
+    public void setDeclaredSuperTypeNames(String[] names) {
+        this.superTypeNames = names;
+    }
+
+    @Override
+    public List<PropertyDefinitionTemplate> getPropertyDefinitionTemplates() {
+        return propertyDefinitionTemplates;
+    }
+
+    @Override
+    public List<NodeDefinitionTemplate> getNodeDefinitionTemplates() {
+        return nodeDefinitionTemplates;
+    }
+
+    @Override
+    public PropertyDefinition[] getDeclaredPropertyDefinitions() {
+        return null;
+    }
+
+    @Override
+    public NodeDefinition[] getDeclaredChildNodeDefinitions() {
+        return null;
+    }
+
+}
\ No newline at end of file

Propchange: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/nodetype/NodeTypeTemplateImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/nodetype/PropertyDefinitionTemplateImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/nodetype/PropertyDefinitionTemplateImpl.java?rev=1345075&view=auto
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/nodetype/PropertyDefinitionTemplateImpl.java
(added)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/nodetype/PropertyDefinitionTemplateImpl.java
Fri Jun  1 11:38:34 2012
@@ -0,0 +1,110 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.oak.jcr.nodetype;
+
+import javax.jcr.PropertyType;
+import javax.jcr.Value;
+import javax.jcr.nodetype.PropertyDefinitionTemplate;
+
+class PropertyDefinitionTemplateImpl extends ItemDefinitionTemplateImpl
+        implements PropertyDefinitionTemplate {
+
+    private boolean isMultiple = false;
+
+    private Value[] defaultValues = null;
+
+    private String[] availableQueryOperators = new String[0];
+
+    private int requiredType = PropertyType.STRING;
+
+    private boolean fullTextSearchable = true;
+
+    private boolean queryOrderable = true;
+
+    private String[] valueConstraints = null;
+
+    @Override
+    public boolean isMultiple() {
+        return isMultiple;
+    }
+
+    @Override
+    public void setMultiple(boolean isMultiple) {
+        this.isMultiple = isMultiple;
+    }
+
+    @Override
+    public String[] getValueConstraints() {
+        return valueConstraints ;
+    }
+
+    @Override
+    public void setValueConstraints(String[] constraints) {
+        this.valueConstraints = constraints;
+    }
+
+    @Override
+    public boolean isQueryOrderable() {
+        return queryOrderable ;
+    }
+
+    @Override
+    public void setQueryOrderable(boolean queryOrderable) {
+        this.queryOrderable = queryOrderable;
+    }
+
+    @Override
+    public boolean isFullTextSearchable() {
+        return fullTextSearchable;
+    }
+
+    @Override
+    public void setFullTextSearchable(boolean fullTextSearchable) {
+        this.fullTextSearchable = fullTextSearchable;
+    }
+
+    @Override
+    public int getRequiredType() {
+        return requiredType ;
+    }
+
+    @Override
+    public void setRequiredType(int type) {
+        this.requiredType = type;
+    }
+
+    @Override
+    public Value[] getDefaultValues() {
+        return defaultValues;
+    }
+
+    @Override
+    public void setDefaultValues(Value[] defaultValues) {
+        this.defaultValues = defaultValues;
+    }
+
+    @Override
+    public String[] getAvailableQueryOperators() {
+        return availableQueryOperators ;
+    }
+
+    @Override
+    public void setAvailableQueryOperators(String[] operators) {
+        this.availableQueryOperators = operators;
+    }
+
+}
\ No newline at end of file

Propchange: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/nodetype/PropertyDefinitionTemplateImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message