jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r374608 - in /incubator/jackrabbit/trunk/contrib/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr: AbstractItemResource.java ItemResourceConstants.java nodetype/ItemDefinitionImpl.java nodetype/NodeTypeConstants.java
Date Fri, 03 Feb 2006 09:07:06 GMT
Author: angela
Date: Fri Feb  3 01:07:01 2006
New Revision: 374608

URL: http://svn.apache.org/viewcvs?rev=374608&view=rev
Log:
- protected property 'definition' reflecting the item definition
- extending xml representation of item definition by declaring nodetype.

Modified:
    incubator/jackrabbit/trunk/contrib/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/AbstractItemResource.java
    incubator/jackrabbit/trunk/contrib/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/ItemResourceConstants.java
    incubator/jackrabbit/trunk/contrib/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/nodetype/ItemDefinitionImpl.java
    incubator/jackrabbit/trunk/contrib/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/nodetype/NodeTypeConstants.java

Modified: incubator/jackrabbit/trunk/contrib/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/AbstractItemResource.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/AbstractItemResource.java?rev=374608&r1=374607&r2=374608&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/AbstractItemResource.java
(original)
+++ incubator/jackrabbit/trunk/contrib/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/AbstractItemResource.java
Fri Feb  3 01:07:01 2006
@@ -31,12 +31,17 @@
 import org.apache.jackrabbit.webdav.jcr.version.report.LocateByUuidReport;
 import org.apache.jackrabbit.webdav.jcr.version.report.RegisteredNamespacesReport;
 import org.apache.jackrabbit.webdav.jcr.version.report.RepositoryDescriptorsReport;
+import org.apache.jackrabbit.webdav.jcr.nodetype.ItemDefinitionImpl;
+import org.apache.jackrabbit.webdav.jcr.nodetype.NodeDefinitionImpl;
+import org.apache.jackrabbit.webdav.jcr.nodetype.PropertyDefinitionImpl;
 import org.apache.jackrabbit.util.Text;
 
 import javax.jcr.Item;
 import javax.jcr.PathNotFoundException;
 import javax.jcr.RepositoryException;
 import javax.jcr.Workspace;
+import javax.jcr.Node;
+import javax.jcr.Property;
 
 /**
  * <code>AbstractItemResource</code> covers common functionality for the various
@@ -261,6 +266,14 @@
                     String parentHref = getLocatorFromItem(item.getParent()).getHref(true);
                     properties.add(new HrefProperty(JCR_PARENT, parentHref, false));
                 }
+                // protected 'definition' property revealing the item definition
+                ItemDefinitionImpl val;
+                if (item.isNode()) {
+                    val = NodeDefinitionImpl.create(((Node)item).getDefinition());
+                } else {
+                    val = PropertyDefinitionImpl.create(((Property)item).getDefinition());
+                }
+                properties.add(new DefaultDavProperty(JCR_DEFINITION, val, true));
             } catch (RepositoryException e) {
                 // should not get here
                 log.error("Error while accessing jcr properties: " + e.getMessage());

Modified: incubator/jackrabbit/trunk/contrib/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/ItemResourceConstants.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/ItemResourceConstants.java?rev=374608&r1=374607&r2=374608&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/ItemResourceConstants.java
(original)
+++ incubator/jackrabbit/trunk/contrib/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/ItemResourceConstants.java
Fri Feb  3 01:07:01 2006
@@ -108,6 +108,8 @@
     public static final DavPropertyName JCR_PARENT = DavPropertyName.create("parent", NAMESPACE);
     public static final DavPropertyName JCR_ISNEW = DavPropertyName.create("isnew", NAMESPACE);
     public static final DavPropertyName JCR_ISMODIFIED = DavPropertyName.create("ismodified",
NAMESPACE);
+    public static final DavPropertyName JCR_DEFINITION = DavPropertyName.create("definition",
NAMESPACE);
+
 
     // property names used for resources representing jcr-nodes
     public static final DavPropertyName JCR_PRIMARYNODETYPE = DavPropertyName.create(XML_PRIMARYNODETYPE,
NAMESPACE);

Modified: incubator/jackrabbit/trunk/contrib/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/nodetype/ItemDefinitionImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/nodetype/ItemDefinitionImpl.java?rev=374608&r1=374607&r2=374608&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/nodetype/ItemDefinitionImpl.java
(original)
+++ incubator/jackrabbit/trunk/contrib/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/nodetype/ItemDefinitionImpl.java
Fri Feb  3 01:07:01 2006
@@ -102,6 +102,7 @@
      */
     public Element toXml(Document document) {
 	Element elem = document.createElement(getElementName());
+        elem.setAttribute(DECLARINGNODETYPE_ATTRIBUTE, getDeclaringNodeType().getName());
         elem.setAttribute(NAME_ATTRIBUTE, getName());
         elem.setAttribute(AUTOCREATED_ATTRIBUTE, Boolean.toString(isAutoCreated()));
         elem.setAttribute(MANDATORY_ATTRIBUTE, Boolean.toString(isMandatory()));

Modified: incubator/jackrabbit/trunk/contrib/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/nodetype/NodeTypeConstants.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/nodetype/NodeTypeConstants.java?rev=374608&r1=374607&r2=374608&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/nodetype/NodeTypeConstants.java
(original)
+++ incubator/jackrabbit/trunk/contrib/jcr-server/server/src/java/org/apache/jackrabbit/webdav/jcr/nodetype/NodeTypeConstants.java
Fri Feb  3 01:07:01 2006
@@ -111,4 +111,12 @@
     /** Name of the <code>sameNameSiblings</code> attribute. */
     String SAMENAMESIBLINGS_ATTRIBUTE = "sameNameSiblings";
 
+    //----------< attr. not defined by copied from o.a.j.core.n.x.Constants >---
+    /**
+     * Name of the declaring nodetype. This value is not needed during
+     * discovery of nodetype definitions. However if the definition of an item is
+     * retrieved (instead of being calculated on the client), this information is
+     * needed
+     */
+    String DECLARINGNODETYPE_ATTRIBUTE = "declaringNodeType";
 }



Mime
View raw message