jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r705197 - /jackrabbit/sandbox/spi/spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/RepositoryServiceImpl.java
Date Thu, 16 Oct 2008 10:13:20 GMT
Author: angela
Date: Thu Oct 16 03:13:19 2008
New Revision: 705197

URL: http://svn.apache.org/viewvc?rev=705197&view=rev
Log:
always retrieve the complete set of node type definitions from the server, even if the client
requested just a limited number of node types (avoid extra round trips).

Modified:
    jackrabbit/sandbox/spi/spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/RepositoryServiceImpl.java

Modified: jackrabbit/sandbox/spi/spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/RepositoryServiceImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/spi/spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/RepositoryServiceImpl.java?rev=705197&r1=705196&r2=705197&view=diff
==============================================================================
--- jackrabbit/sandbox/spi/spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/RepositoryServiceImpl.java
(original)
+++ jackrabbit/sandbox/spi/spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/RepositoryServiceImpl.java
Thu Oct 16 03:13:19 2008
@@ -151,7 +151,6 @@
 import org.slf4j.LoggerFactory;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
-import org.xml.sax.SAXException;
 
 import javax.jcr.AccessDeniedException;
 import javax.jcr.Credentials;
@@ -199,7 +198,6 @@
 
     private static Logger log = LoggerFactory.getLogger(RepositoryServiceImpl.class);
 
-
     private static final EventType[] ALL_EVENTS = new EventType[5];
     static {
         ALL_EVENTS[0] = SubscriptionImpl.getEventType(javax.jcr.observation.Event.NODE_ADDED);
@@ -1906,34 +1904,9 @@
      * {@inheritDoc}
      */
     public Iterator getQNodeTypeDefinitions(SessionInfo sessionInfo, Name[] nodetypeNames)
throws RepositoryException {
-        ReportMethod method = null;
-        try {
-            NamePathResolver resolver = getNamePathResolver(sessionInfo);
-
-            ReportInfo info = new ReportInfo(NodeTypesReport.NODETYPES_REPORT, DEPTH_0);
-            for (int i = 0; i < nodetypeNames.length; i++) {
-                Element el = DomUtil.createElement(domFactory, NodeTypeConstants.XML_NODETYPE,
NodeTypeConstants.NAMESPACE);
-                String jcrName = resolver.getJCRName(nodetypeNames[i]);
-                DomUtil.addChildElement(el, NodeTypeConstants.XML_NODETYPENAME, NodeTypeConstants.NAMESPACE,
jcrName);
-                info.setContentElement(el);
-            }
-
-            String workspaceUri = uriResolver.getWorkspaceUri(sessionInfo.getWorkspaceName());
-            method = new ReportMethod(workspaceUri, info);
-            getClient(sessionInfo).executeMethod(method);
-            method.checkSuccess();
-
-            Document reportDoc = method.getResponseBodyAsDocument();
-            return retrieveQNodeTypeDefinitions(sessionInfo, reportDoc);
-        } catch (IOException e) {
-            throw new RepositoryException(e);
-        } catch (DavException e) {
-            throw ExceptionConverter.generate(e);
-        } finally {
-            if (method != null) {
-                method.releaseConnection();
-            }
-        }
+        // in order to avoid individual calls for every nodetype, retrieve
+        // the complete set from the server (again).
+        return getQNodeTypeDefinitions(sessionInfo);
     }
 
     /**



Mime
View raw message