You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by an...@apache.org on 2009/02/05 19:08:11 UTC

svn commit: r741213 - in /jackrabbit/trunk/jackrabbit-webapp/src/main/webapp: WEB-INF/batchread.properties WEB-INF/web.xml header.jsp webdav-jcr.jsp webdav-remoting.jsp welcome.jsp

Author: angela
Date: Thu Feb  5 18:08:11 2009
New Revision: 741213

URL: http://svn.apache.org/viewvc?rev=741213&view=rev
Log:
- JCR-1958: Enhanced JCR remoting (work in progress)

> web.xml: change jcr remoting server to use the new JcrRemotingServlet by default.
> web.xml: add new init params
> add example batchread config
> webapp:
  try to clarify the difference between standard WebDAV servlet and the JCR remoting over WebDAV.
  and change the corresp. page title from "JCR WebDAV Server" to "JCR Remoting Server".
> webapp:
  add extra page for the extended remoting ((currently referring to JavaDoc as no doc available yet))

Added:
    jackrabbit/trunk/jackrabbit-webapp/src/main/webapp/WEB-INF/batchread.properties   (with props)
    jackrabbit/trunk/jackrabbit-webapp/src/main/webapp/webdav-remoting.jsp   (with props)
Modified:
    jackrabbit/trunk/jackrabbit-webapp/src/main/webapp/WEB-INF/web.xml
    jackrabbit/trunk/jackrabbit-webapp/src/main/webapp/header.jsp
    jackrabbit/trunk/jackrabbit-webapp/src/main/webapp/webdav-jcr.jsp
    jackrabbit/trunk/jackrabbit-webapp/src/main/webapp/welcome.jsp

Added: jackrabbit/trunk/jackrabbit-webapp/src/main/webapp/WEB-INF/batchread.properties
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-webapp/src/main/webapp/WEB-INF/batchread.properties?rev=741213&view=auto
==============================================================================
--- jackrabbit/trunk/jackrabbit-webapp/src/main/webapp/WEB-INF/batchread.properties (added)
+++ jackrabbit/trunk/jackrabbit-webapp/src/main/webapp/WEB-INF/batchread.properties Thu Feb  5 18:08:11 2009
@@ -0,0 +1,27 @@
+#  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.
+
+# This file contains an example batch read configuration used by
+# JcrRemotingServlet according to the 'batchread-config' init-param.
+#
+# key = node type name
+# value = desired depth for any node having the node type as primary type.
+#
+# - Use 'default' to set the default depth
+# - Depth may be any int >= -1.
+# - Depth -1 indicates infinite depth.
+
+default=5
+nt\:file=-1
\ No newline at end of file

Propchange: jackrabbit/trunk/jackrabbit-webapp/src/main/webapp/WEB-INF/batchread.properties
------------------------------------------------------------------------------
    svn = 

Propchange: jackrabbit/trunk/jackrabbit-webapp/src/main/webapp/WEB-INF/batchread.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: jackrabbit/trunk/jackrabbit-webapp/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-webapp/src/main/webapp/WEB-INF/web.xml?rev=741213&r1=741212&r2=741213&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-webapp/src/main/webapp/WEB-INF/web.xml (original)
+++ jackrabbit/trunk/jackrabbit-webapp/src/main/webapp/WEB-INF/web.xml Thu Feb  5 18:08:11 2009
@@ -16,7 +16,7 @@
    limitations under the License.
   -->
 
-<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
+<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
 <web-app>
     <display-name>Jackrabbit JCR Server</display-name>
 
@@ -258,33 +258,30 @@
     </servlet>
 
     <!-- ====================================================================== -->
-    <!-- W E B D A V  S E R V E R  S E R V L E T                                  -->
+    <!-- J C R  R E M O T I N G  S E R V L E T                                  -->
     <!-- ====================================================================== -->
     <servlet>
         <servlet-name>JCRWebdavServer</servlet-name>
         <description>
             The webdav servlet that connects HTTP request to the repository.
         </description>
-        <servlet-class>org.apache.jackrabbit.j2ee.JCRWebdavServerServlet</servlet-class>
-        <!--
-         <init-param>
-             <param-name>missing-auth-mapping</param-name>
-             <param-value>anonymous:anonymous</param-value>
-             <description>
-                 Defines how a missing authorization header should be handled.
-                 1) If this init-param is missing, a 401 response is generated.
-                    This is suiteable for clients (eg. webdav clients) for which
-                    sending a proper authorization header is not possible if the
-                    server never sent a 401.
-                 2) If this init-param is present with an empty value,
-                    null-credentials are returned, thus forcing an null login
-                    on the repository.
-                 3) If this init-param has a 'user:password' value, the respective
-                    simple credentials are generated.
-             </description>
-         </init-param>
-         -->
-
+        <servlet-class>org.apache.jackrabbit.j2ee.JcrRemotingServlet</servlet-class>
+        <init-param>
+            <param-name>missing-auth-mapping</param-name>
+            <param-value></param-value>
+            <description>
+                Defines how a missing authorization header should be handled.
+                1) If this init-param is missing, a 401 response is generated.
+                This is suiteable for clients (eg. webdav clients) for which
+                sending a proper authorization header is not possible if the
+                server never sent a 401.
+                2) If this init-param is present with an empty value,
+                null-credentials are returned, thus forcing an null login
+                on the repository.
+                3) If this init-param has a 'user:password' value, the respective
+                simple credentials are generated.
+            </description>
+        </init-param>
         <!--
             Optional parameter to define the value of the 'WWW-Authenticate' header
         -->
@@ -297,7 +294,6 @@
             </description>
         </init-param>
         -->
-
         <init-param>
             <param-name>resource-path-prefix</param-name>
             <param-value>/server</param-value>
@@ -305,6 +301,26 @@
                 defines the prefix for spooling resources out of the repository.
             </description>
         </init-param>
+        <!--
+            Init parameters specific for JcrRemotingServlet
+        -->
+        <!--
+        <init-param>
+            <param-name>home</param-name>
+            <param-value></param-value>
+            <description>JcrRemotingServlet: Optional home directory for JcrRemotingServlet temporary files (default: "jackrabbit")</description>
+        </init-param>
+        <init-param>
+            <param-name>temp-directory</param-name>
+            <param-value></param-value>
+            <description>JcrRemotingServlet: Optional temporary directory name (under home, default: "tmp")</description>
+        </init-param>
+        -->
+        <init-param>
+            <param-name>batchread-config</param-name>
+            <param-value>/WEB-INF/batchread.properties</param-value>
+            <description>JcrRemotingServlet: Optional mapping from node type names to default depth.</description>
+        </init-param>        
         <load-on-startup>5</load-on-startup>
     </servlet>
 
@@ -351,5 +367,5 @@
         <exception-type>javax.jcr.RepositoryException</exception-type>
         <location>/error/repository.jsp</location>
     </error-page>
-
+    
 </web-app>

Modified: jackrabbit/trunk/jackrabbit-webapp/src/main/webapp/header.jsp
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-webapp/src/main/webapp/header.jsp?rev=741213&r1=741212&r2=741213&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-webapp/src/main/webapp/header.jsp (original)
+++ jackrabbit/trunk/jackrabbit-webapp/src/main/webapp/header.jsp Thu Feb  5 18:08:11 2009
@@ -55,7 +55,7 @@
             <ul>
               <li><a href="<%= context %>/">Welcome</a></li>
               <li><a href="<%= context %>/webdav-simple.jsp">Standard WebDAV</a></li>
-              <li><a href="<%= context %>/webdav-jcr.jsp">JCR WebDAV</a></li>
+              <li><a href="<%= context %>/webdav-jcr.jsp">JCR Remoting</a></li>
               <li><a href="<%= context %>/remote.jsp">Remote access</a></li>
               <li><a href="<%= context %>/local.jsp">Local access</a></li>
               <li><a href="<%= context %>/troubleshooting.jsp">Troubleshooting</a></li>

Modified: jackrabbit/trunk/jackrabbit-webapp/src/main/webapp/webdav-jcr.jsp
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-webapp/src/main/webapp/webdav-jcr.jsp?rev=741213&r1=741212&r2=741213&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-webapp/src/main/webapp/webdav-jcr.jsp (original)
+++ jackrabbit/trunk/jackrabbit-webapp/src/main/webapp/webdav-jcr.jsp Thu Feb  5 18:08:11 2009
@@ -1,8 +1,5 @@
 <%@ page import="org.apache.jackrabbit.j2ee.JCRWebdavServerServlet,
-                 org.apache.jackrabbit.j2ee.RepositoryAccessServlet,
-                 org.apache.jackrabbit.j2ee.SimpleWebdavServlet,
-                 java.net.URI,
-                 javax.jcr.Repository"
+                 java.net.URI"
 %><%--
   Licensed to the Apache Software Foundation (ASF) under one or more
   contributor license agreements.  See the NOTICE file distributed with
@@ -19,7 +16,7 @@
   See the License for the specific language governing permissions and
   limitations under the License.
 --%><%@page import="org.apache.jackrabbit.util.Text"%><%
-request.setAttribute("title", "JCR WebDAV Server");
+request.setAttribute("title", "JCR Remoting Server");
 
 URI uri = new URI(request.getRequestURL().toString());
 String href =
@@ -30,20 +27,25 @@
 String shref = href + "/default/jcr:root";
 %><jsp:include page="header.jsp"/>
 <p>
-  The JCR WebDAV server provides an item-based WebDAV view to the
+  The JCR Remoting Server provides an item-based WebDAV view to the
   JCR repository, mapping the functionality provided by JSR 170 to the
   WebDAV protocol in order to allow remote content repository access
   via WebDAV.
 </p>
 <p>
   See the draft document
-  <a href="http://www.day.com/jsr170/server/JCR_Webdav_Protocol.zip">JCR_Webdav_Protocol.zip</a>
+  <a href="http://jackrabbit.apache.org/JCR_Webdav_Protocol.doc">JCR_Webdav_Protocol.zip</a>
   for more details regarding this remoting protocol.
 </p>
+<p>
+  Batch read and write as well as the missing functionality (cross workspace
+  copy and clone) has been addressed with a <a href="webdav-remoting.jsp">extension</a>
+  to the remoting server.
+</p>
 
 <h3>Access the content repository</h3>
 <p>
-  Use the following URLs to access the content repository in your WebDAV client:
+  Use the following URLs to access the content repository in your remoting client:
 </p>
 <dl>
 <dt><a href="<%= href %>"><%= href %></a></dt>
@@ -67,9 +69,11 @@
   <li><a href="http://www.ietf.org/rfc/rfc3648.txt">RFC 3648</a> (Ordering)</li>
   <li><a href="http://greenbytes.de/tech/webdav/draft-reschke-webdav-search-latest.html">Internet Draft WebDAV Search</a></li>
 </ul>
+
+<h3>JCR Remoting Client</h3>
 <p>
   For the client counterpart of this WebDAV servlet please take a look at the
-  <a href="https://svn.apache.org/repos/asf/jackrabbit/sandbox/spi/spi2dav">spi2dav</a>
+  <a href="http://svn.apache.org/repos/asf/jackrabbit/sandbox/spi/spi2dav">spi2dav</a>
   project in the Apache Jackrabbit sandbox.
 </p>
 

Added: jackrabbit/trunk/jackrabbit-webapp/src/main/webapp/webdav-remoting.jsp
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-webapp/src/main/webapp/webdav-remoting.jsp?rev=741213&view=auto
==============================================================================
--- jackrabbit/trunk/jackrabbit-webapp/src/main/webapp/webdav-remoting.jsp (added)
+++ jackrabbit/trunk/jackrabbit-webapp/src/main/webapp/webdav-remoting.jsp Thu Feb  5 18:08:11 2009
@@ -0,0 +1,90 @@
+<%@ page import="org.apache.jackrabbit.j2ee.JCRWebdavServerServlet,
+                 java.net.URI"
+%><%--
+  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.
+--%><%@page import="org.apache.jackrabbit.util.Text"%>
+<%@ page import="org.apache.jackrabbit.j2ee.JcrRemotingServlet" %>
+<%
+request.setAttribute("title", "JCR Remoting Server (incl. Batch Read/Write)");
+
+URI uri = new URI(request.getRequestURL().toString());
+String href =
+    uri.getScheme() + "://" + uri.getHost() + ":" + uri.getPort()
+    + request.getContextPath()
+    + JCRWebdavServerServlet.getPathPrefix(pageContext.getServletContext());
+href = Text.encodeIllegalXMLCharacters(href);
+String shref = href + "/default/jcr:root";
+%><jsp:include page="header.jsp"/>
+<p>
+  The JCR Remoting Server provides an item-based WebDAV view to the
+  JCR repository, mapping the functionality provided by JSR 170 to the
+  WebDAV protocol in order to allow remote content repository access
+  via WebDAV.
+</p>
+<p>
+  This implementation variant adds batch read and write functionality to the initial
+  <a href="webdav-jcr.jsp">JCR Remoting Server</a>. In addition it supports
+  copy across workspaces and clone.
+</p>
+
+<h3>Access the content repository</h3>
+<p>
+  Use the following URLs to access the content repository in the remoting client:
+</p>
+<dl>
+<dt><a href="<%= href %>"><%= href %></a></dt>
+<dd>to access all workspaces of your JCR repository</dd>
+<dt><a href="<%= shref %>"><%= shref %></a></dt>
+<dd>to access a single workspace (example with workspace named 'default')</dd>
+</dl>
+
+<h3>Supported WebDAV functionality</h3>
+<p>
+  See <a href="webdav-jcr.jsp">JCR Remoting Server</a>.
+</p>
+
+<h3>Batch Read</h3>
+<p>
+Composes a JSON object for a node (and its child items) up to a explicitely
+specified or configuration determined depth.
+<br>
+See <a href ="http://svn.apache.org/repos/asf/jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/remoting/davex/JcrRemotingServlet.java">JavaDoc</a> for details.
+</p>
+
+<h3>Batch Write</h3>
+<p>
+In contrast to the default JCR remoting this extended version allows to send
+a block of modifications (SPI Batch) within a single POST request containing a
+custom ":diff" parameter.
+<br>
+See the <a href ="http://svn.apache.org/repos/asf/jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/remoting/davex/JcrRemotingServlet.java">JavaDoc</a> for details.
+</p>
+
+<h3>JCR Remoting Client</h3>
+<p>
+  For the client counterpart of this WebDAV servlet please take a look at the
+  <a href="http://svn.apache.org/repos/asf/jackrabbit/sandbox/spi/spi2davex">spi2davex</a>
+  project in the Apache Jackrabbit sandbox.
+</p>
+
+<h3>Configuration</h3>
+<ul>
+  <li>Context Path: <%= Text.encodeIllegalXMLCharacters(request.getContextPath()) %></li>
+  <li>Resource Path Prefix: <%= Text.encodeIllegalXMLCharacters(JcrRemotingServlet.getPathPrefix(pageContext.getServletContext())) %></li>
+  <li>Workspace Name: <i>optional</i> (available workspaces are mapped as resources)</li>
+  <li>Additional servlet configuration: see <i>/WEB-INF/web.xml</i></li>
+</ul>
+<jsp:include page="footer.jsp"/>

Propchange: jackrabbit/trunk/jackrabbit-webapp/src/main/webapp/webdav-remoting.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/trunk/jackrabbit-webapp/src/main/webapp/webdav-remoting.jsp
------------------------------------------------------------------------------
    svn:keywords = author date id revision

Modified: jackrabbit/trunk/jackrabbit-webapp/src/main/webapp/welcome.jsp
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-webapp/src/main/webapp/welcome.jsp?rev=741213&r1=741212&r2=741213&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-webapp/src/main/webapp/welcome.jsp (original)
+++ jackrabbit/trunk/jackrabbit-webapp/src/main/webapp/welcome.jsp Thu Feb  5 18:08:11 2009
@@ -1,7 +1,4 @@
-<%@ page import="org.apache.jackrabbit.j2ee.JCRWebdavServerServlet,
-                 org.apache.jackrabbit.j2ee.RepositoryAccessServlet,
-                 org.apache.jackrabbit.j2ee.SimpleWebdavServlet,
-                 java.net.URI,
+<%@ page import="org.apache.jackrabbit.j2ee.RepositoryAccessServlet,
                  javax.jcr.Repository"
 %><%--
   Licensed to the Apache Software Foundation (ASF) under one or more
@@ -35,12 +32,18 @@
   through WebDAV and other means.
 </p>
 <p>
-  The following two WebDAV views are provided for accessing the
+  The following WebDAV view is provided for accessing the
   content in the JCR content repository.
 </p>
 <ul>
   <li><a href="webdav-simple.jsp">Standard WebDAV</a></li>
-  <li><a href="webdav-jcr.jsp">JCR WebDAV</a></li>
+</ul>
+<p>
+  In addition the JCR Server project provides means for JCR remoting over HTTP:
+</p>
+<ul>
+  <li><a href="webdav-jcr.jsp">JCR remoting over WebDAV</a></li>
+  <li><a href="webdav-remoting.jsp">JCR remoting over WebDAV (including Batch Read/Write)</a></li>
 </ul>
 <p>
   Clients can also access the repository using the JCR API. Both local