jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r774680 - in /jackrabbit/trunk: jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/nodetype/ jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/version/report/ jackrabbit-spi2dav/src/main/java/org/apache/...
Date Thu, 14 May 2009 08:24:34 GMT
Author: angela
Date: Thu May 14 08:24:34 2009
New Revision: 774680

URL: http://svn.apache.org/viewvc?rev=774680&view=rev
Log:
JCR-2105: JSR 283 NodeType Management (work in progress)

- resolve TODO in spi2dav (client)
- add jcr 2.0 nodetype definition extensions to the node types report (server)

Modified:
    jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/nodetype/NodeTypeConstants.java
    jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/version/report/NodeTypesReport.java
    jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/QNodeTypeDefinitionImpl.java

Modified: jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/nodetype/NodeTypeConstants.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/nodetype/NodeTypeConstants.java?rev=774680&r1=774679&r2=774680&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/nodetype/NodeTypeConstants.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/nodetype/NodeTypeConstants.java
Thu May 14 08:24:34 2009
@@ -26,7 +26,6 @@
  * @see javax.jcr.nodetype.NodeType
  */
 public interface NodeTypeConstants {
-    //todo: intercaps only for consistency with jackrabbit... webdav rfcs never use intercaps.
 
     public static final Namespace NAMESPACE = ItemResourceConstants.NAMESPACE;
 
@@ -58,6 +57,18 @@
     /** Name of the <code>hasOrderableChildNodes</code> attribute. */
     String HASORDERABLECHILDNODES_ATTRIBUTE = "hasOrderableChildNodes";
 
+    /**
+     * Name of the <code>isAbstract</code> attribute.
+     * @since JCR 2.0
+     */
+    String ISABSTRACT_ATTRIBUTE = "isAbstract";
+
+    /**
+     * Name of the <code>isQueryable</code> attribute.
+     * @since JCR 2.0
+     */
+    String ISQUERYABLE_ATTRIBUTE = "isQueryable";
+
     /** Name of the primary item name attribute. */
     String PRIMARYITEMNAME_ATTRIBUTE = "primaryItemName";
 

Modified: jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/version/report/NodeTypesReport.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/version/report/NodeTypesReport.java?rev=774680&r1=774679&r2=774680&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/version/report/NodeTypesReport.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/version/report/NodeTypesReport.java
Thu May 14 08:24:34 2009
@@ -127,6 +127,10 @@
             ntDef.setAttribute(NAME_ATTRIBUTE, nt.getName());
             ntDef.setAttribute(ISMIXIN_ATTRIBUTE, Boolean.toString(nt.isMixin()));
             ntDef.setAttribute(HASORDERABLECHILDNODES_ATTRIBUTE, Boolean.toString(nt.hasOrderableChildNodes()));
+            // JCR 2.0 extension
+            ntDef.setAttribute(ISABSTRACT_ATTRIBUTE, Boolean.toString(nt.isAbstract()));
+            // JCR 2.0 extension
+            ntDef.setAttribute(ISQUERYABLE_ATTRIBUTE, Boolean.toString(nt.isQueryable()));
 
             // declared supertypes
             NodeType[] snts = nt.getDeclaredSupertypes();

Modified: jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/QNodeTypeDefinitionImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/QNodeTypeDefinitionImpl.java?rev=774680&r1=774679&r2=774680&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/QNodeTypeDefinitionImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/QNodeTypeDefinitionImpl.java
Thu May 14 08:24:34 2009
@@ -57,11 +57,8 @@
     private final QNodeDefinition[] nodeDefs;
     private Set dependencies;
 
-    /**
-     * TODO
-     */
-    private final boolean isAbstract = false;
-    private final boolean isQueryable = false;
+    private final boolean isAbstract;
+    private final boolean isQueryable;
 
     /**
      * Default constructor.
@@ -106,6 +103,16 @@
         } else {
             orderableChildNodes = false;
         }
+        if (ntdElement.hasAttribute(ISABSTRACT_ATTRIBUTE)) {
+            isAbstract = Boolean.valueOf(ntdElement.getAttribute(ISABSTRACT_ATTRIBUTE)).booleanValue();
+        } else {
+            isAbstract = false;
+        }
+        if (ntdElement.hasAttribute(ISQUERYABLE_ATTRIBUTE)) {
+            isQueryable = Boolean.valueOf(ntdElement.getAttribute(ISQUERYABLE_ATTRIBUTE)).booleanValue();
+        } else {
+            isQueryable = false;
+        }
 
         // nodeDefinitions
         ElementIterator it = DomUtil.getChildren(ntdElement, CHILDNODEDEFINITION_ELEMENT,
null);
@@ -168,16 +175,14 @@
      * @see QNodeTypeDefinition#isAbstract()
      */
     public boolean isAbstract() {
-        // TODO
-        throw new UnsupportedOperationException("JCR-2003 Add support for JCR 2.0. Implementation
missing");
+        return isAbstract;
     }
 
     /**
      * @see QNodeTypeDefinition#isQueryable()
      */
     public boolean isQueryable() {
-        // TODO
-        throw new UnsupportedOperationException("JCR-2003 Add support for JCR 2.0. Implementation
missing");
+        return isQueryable;
     }
 
     /**



Mime
View raw message