Use jackrabbit as webdav server
authorMathieu Baudier <mbaudier@argeo.org>
Thu, 19 Nov 2009 22:38:53 +0000 (22:38 +0000)
committerMathieu Baudier <mbaudier@argeo.org>
Thu, 19 Nov 2009 22:38:53 +0000 (22:38 +0000)
git-svn-id: https://svn.argeo.org/commons/trunk@3130 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc

13 files changed:
sandbox/runtime/org.argeo.sandbox.jackrabbit/pom.xml
sandbox/runtime/org.argeo.sandbox.jackrabbit/src/main/java/webdav/WebDavTest.java
server/demo/org.argeo.server.demo.log4j/log4j.properties
server/dep/org.argeo.server.dep.jackrabbit.server/pom.xml [new file with mode: 0644]
server/dep/pom.xml
server/modules/org.argeo.server.jackrabbit.repo/META-INF/spring/jackrabbit-osgi.xml
server/modules/org.argeo.server.jackrabbit.repo/repository.xml
server/modules/org.argeo.server.jackrabbit.webapp/META-INF/MANIFEST.MF
server/modules/org.argeo.server.jackrabbit.webapp/WEB-INF/applicationContext.xml
server/modules/org.argeo.server.jackrabbit.webapp/WEB-INF/config.xml [new file with mode: 0644]
server/modules/org.argeo.server.jackrabbit.webapp/WEB-INF/web.xml
server/modules/org.argeo.server.jackrabbit.webapp/WEB-INF/webdav-servlet.xml [new file with mode: 0644]
server/modules/pom.xml

index ba650560966a8ca4ae75b251e20cd8fe248d45a8..428f79044f9aecd7f0f4d869d68ff9c6905dd8ba 100644 (file)
        </build>
        <dependencies>
                <dependency>
-                       <groupId>org.argeo.dep.osgi</groupId>
-                       <artifactId>org.argeo.dep.osgi.jackrabbit</artifactId>
+                       <groupId>org.argeo.commons.server</groupId>
+                       <artifactId>org.argeo.server.dep.jackrabbit.server</artifactId>
+                       <version>0.1.2-SNAPSHOT</version>
+                       <type>pom</type>
                </dependency>
                <dependency>
                        <groupId>org.argeo.commons.basic</groupId>
index 6ef840b884d08ad14ecd8a70d35979f622249cc9..cb8a97ad2456b0dfac1d29903b689648153f042a 100644 (file)
@@ -1,5 +1,7 @@
 package webdav;
 
+import java.io.FileInputStream;
+
 import org.apache.commons.httpclient.Credentials;
 import org.apache.commons.httpclient.HostConfiguration;
 import org.apache.commons.httpclient.HttpClient;
@@ -7,6 +9,8 @@ import org.apache.commons.httpclient.HttpConnectionManager;
 import org.apache.commons.httpclient.MultiThreadedHttpConnectionManager;
 import org.apache.commons.httpclient.UsernamePasswordCredentials;
 import org.apache.commons.httpclient.auth.AuthScope;
+import org.apache.commons.httpclient.methods.InputStreamRequestEntity;
+import org.apache.commons.httpclient.methods.RequestEntity;
 import org.apache.commons.httpclient.params.HttpConnectionManagerParams;
 import org.apache.jackrabbit.webdav.client.methods.PutMethod;
 
@@ -18,7 +22,7 @@ public class WebDavTest {
        public static void main(String[] args) {
                try {
                        HostConfiguration hostConfig = new HostConfiguration();
-                       hostConfig.setHost("localhost", 8082);
+                       hostConfig.setHost("localhost", 7070);
                        // hostConfig.
                        HttpConnectionManager connectionManager = new MultiThreadedHttpConnectionManager();
                        HttpConnectionManagerParams params = new HttpConnectionManagerParams();
@@ -26,17 +30,22 @@ public class WebDavTest {
                        params.setMaxConnectionsPerHost(hostConfig, maxHostConnections);
                        connectionManager.setParams(params);
                        HttpClient client = new HttpClient(connectionManager);
-                       Credentials creds = new UsernamePasswordCredentials("scanner1",
-                                       "scanner1");
+                       Credentials creds = new UsernamePasswordCredentials("demo", "demo");
                        client.getState().setCredentials(AuthScope.ANY, creds);
                        client.setHostConfiguration(hostConfig);
                        // return client;
 
+                       String fileName = "test.xml";
                        PutMethod pm = new PutMethod(
-                                       "http://localhost:8082/webdav/scanner1_queque/uploader/image_"
-                                                       + ".txt");
-                       String text = "this is the document content";
-                       pm.setRequestBody(text);
+                                       "http://localhost:7070/org.argeo.server.jackrabbit.webapp/default/"
+                                                       + fileName);
+                       // String text = "this is the document content";
+                       RequestEntity requestEntity = new InputStreamRequestEntity(
+                                       new FileInputStream(fileName));
+                       // pm.setRequestEntity(new StringRequestEntity(text, "text/plain",
+                       // null));
+                       // pm.setRequestBody(text);
+                       pm.setRequestEntity(requestEntity);
                        client.executeMethod(pm);
                } catch (Exception e) {
                        e.printStackTrace();
index b33daa9db7747a1b628d1ce14ba993dbce72e66a..7e796332529184f5aedc401b3a21819076f39605 100644 (file)
@@ -6,10 +6,12 @@ log4j.logger.org.argeo=DEBUG
 log4j.logger.org.hibernate=WARN
 
 log4j.logger.org.springframework=WARN
-#log4j.logger.org.springframework.web=DEBUG
+#log4j.logger.org.springframework.web=TRACE
 #log4j.logger.org.springframework.jms=WARN
 #log4j.logger.org.springframework.security=WARN
 
+#log4j.logger.org.apache.jackrabbit=DEBUG
+
 log4j.logger.org.apache.activemq=WARN
 log4j.logger.org.apache.activemq.transport=WARN
 log4j.logger.org.apache.activemq.ActiveMQMessageConsumer=INFO
diff --git a/server/dep/org.argeo.server.dep.jackrabbit.server/pom.xml b/server/dep/org.argeo.server.dep.jackrabbit.server/pom.xml
new file mode 100644 (file)
index 0000000..3483f23
--- /dev/null
@@ -0,0 +1,23 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+       <modelVersion>4.0.0</modelVersion>
+       <parent>
+               <groupId>org.argeo.commons.server</groupId>
+               <version>0.1.2-SNAPSHOT</version>
+               <artifactId>dep</artifactId>
+               <relativePath>..</relativePath>
+       </parent>
+       <artifactId>org.argeo.server.dep.jackrabbit.server</artifactId>
+       <packaging>pom</packaging>
+       <name>Dep Jack Rabbit Server</name>
+       <dependencies>
+               <dependency>
+                       <groupId>org.argeo.dep.osgi</groupId>
+                       <artifactId>org.argeo.dep.osgi.jackrabbit</artifactId>
+               </dependency>
+               <dependency>
+                       <groupId>org.springframework</groupId>
+                       <artifactId>org.springframework.web.servlet</artifactId>
+               </dependency>
+       </dependencies>
+</project>
\ No newline at end of file
index be4529c8e64ca2b8611eddc47f53de8ab2deb733..4b00416acf3957d99036ef01b7dd8476daa3a989 100644 (file)
@@ -15,5 +15,6 @@
                <module>org.argeo.server.dep.tomcat</module>
                <module>org.argeo.server.dep.ads</module>
                <module>org.argeo.server.dep.hibernate</module>
+               <module>org.argeo.server.dep.jackrabbit.server</module>
        </modules>
 </project>
\ No newline at end of file
index 5eccb05092a29853ccee22f66ab44849cbb7886a..796c32dc54e53374f1b2277e8ebb4fb2a917f18d 100644 (file)
@@ -6,6 +6,7 @@
        http://www.springframework.org/schema/beans   \r
        http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">\r
 \r
-       <service ref="repository" interface="javax.jcr.Repository" />\r
+       <service ref="repository" interface="javax.jcr.Repository"\r
+               context-class-loader="service-provider" />\r
 \r
 </beans:beans>
\ No newline at end of file
index 666919d280d83da7496a21cb0e799630a93f4cb8..abc40bba22b34ef1326f85bffc382a5d995cec25 100644 (file)
 <?xml version="1.0"?>
-<!--
-   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
+       <!--
+               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.
--->
+               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.
+       -->
 <!DOCTYPE Repository PUBLIC "-//The Apache Software Foundation//DTD Jackrabbit 1.6//EN"
                             "http://jackrabbit.apache.org/dtd/repository-1.6.dtd">
-<!-- Example Repository Configuration File
-     Used by
-     - org.apache.jackrabbit.core.config.RepositoryConfigTest.java
-     -
--->
+       <!--
+               Example Repository Configuration File Used by -
+               org.apache.jackrabbit.core.config.RepositoryConfigTest.java -
+       -->
 <Repository>
-    <!--
-        virtual file system where the repository stores global state
-        (e.g. registered namespaces, custom node types, etc.)
-    -->
-    <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
-        <param name="path" value="${rep.home}/repository"/>
-    </FileSystem>
+       <!--
+               virtual file system where the repository stores global state (e.g.
+               registered namespaces, custom node types, etc.)
+       -->
+       <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
+               <param name="path" value="${rep.home}/repository" />
+       </FileSystem>
 
-    <!--
+       <!--
         security configuration
     -->
-    <Security appName="Jackrabbit">
-        <!--
-            security manager:
-            class: FQN of class implementing the JackrabbitSecurityManager interface
-        -->
-        <SecurityManager class="org.apache.jackrabbit.core.security.simple.SimpleSecurityManager" workspaceName="security">
-            <!--
-            workspace access:
-            class: FQN of class implementing the WorkspaceAccessManager interface
-            -->
-            <!-- <WorkspaceAccessManager class="..."/> -->
-            <!-- <param name="config" value="${rep.home}/security.xml"/> -->
-        </SecurityManager>
+       <Security appName="Jackrabbit">
+               <!--
+                       security manager: class: FQN of class implementing the
+                       JackrabbitSecurityManager interface
+               -->
+               <SecurityManager
+                       class="org.apache.jackrabbit.core.security.simple.SimpleSecurityManager"
+                       workspaceName="security">
+                       <!--
+                               workspace access: class: FQN of class implementing the
+                               WorkspaceAccessManager interface
+                       -->
+                       <!-- <WorkspaceAccessManager class="..."/> -->
+                       <!-- <param name="config" value="${rep.home}/security.xml"/> -->
+               </SecurityManager>
 
-        <!--
-            access manager:
-            class: FQN of class implementing the AccessManager interface
-        -->
-        <AccessManager class="org.apache.jackrabbit.core.security.simple.SimpleAccessManager">
-            <!-- <param name="config" value="${rep.home}/access.xml"/> -->
-        </AccessManager>
+               <!--
+                       access manager: class: FQN of class implementing the AccessManager
+                       interface
+               -->
+               <AccessManager
+                       class="org.apache.jackrabbit.core.security.simple.SimpleAccessManager">
+                       <!-- <param name="config" value="${rep.home}/access.xml"/> -->
+               </AccessManager>
 
-        <LoginModule class="org.apache.jackrabbit.core.security.simple.SimpleLoginModule">
-           <!-- 
-              anonymous user name ('anonymous' is the default value)
-            -->
-           <param name="anonymousId" value="anonymous"/>
-           <!--
-              administrator user id (default value if param is missing is 'admin')
-            -->
-           <param name="adminId" value="admin"/>
-        </LoginModule>
-    </Security>
+               <LoginModule
+                       class="org.apache.jackrabbit.core.security.simple.SimpleLoginModule">
+                       <!--
+                               anonymous user name ('anonymous' is the default value)
+                       -->
+                       <param name="anonymousId" value="anonymous" />
+                       <!--
+                               administrator user id (default value if param is missing is 'admin')
+                       -->
+                       <param name="adminId" value="admin" />
+               </LoginModule>
+       </Security>
 
-    <!--
-        location of workspaces root directory and name of default workspace
-    -->
-    <Workspaces rootPath="${rep.home}/workspaces" defaultWorkspace="default"/>
-    <!--
-        workspace configuration template:
-        used to create the initial workspace if there's no workspace yet
-    -->
-    <Workspace name="${wsp.name}">
-        <!--
-            virtual file system of the workspace:
-            class: FQN of class implementing the FileSystem interface
-        -->
-        <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
-            <param name="path" value="${wsp.home}"/>
-        </FileSystem>
-        <!--
-            persistence manager of the workspace:
-            class: FQN of class implementing the PersistenceManager interface
-        -->
-        <PersistenceManager class="org.apache.jackrabbit.core.persistence.bundle.DerbyPersistenceManager">
-          <param name="url" value="jdbc:derby:${wsp.home}/db;create=true"/>
-          <param name="schemaObjectPrefix" value="${wsp.name}_"/>
-        </PersistenceManager>
-        <!--
-            Search index and the file system it uses.
-            class: FQN of class implementing the QueryHandler interface
-        -->
-        <SearchIndex class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
-            <param name="path" value="${wsp.home}/index"/>
-            <param name="extractorPoolSize" value="2"/>
-            <param name="supportHighlighting" value="true"/>
-        </SearchIndex>
-    </Workspace>
+       <!--
+               location of workspaces root directory and name of default workspace
+       -->
+       <Workspaces rootPath="${rep.home}/workspaces"
+               defaultWorkspace="default" />
+       <!--
+               workspace configuration template: used to create the initial workspace
+               if there's no workspace yet
+       -->
+       <Workspace name="${wsp.name}">
+               <!--
+                       virtual file system of the workspace: class: FQN of class
+                       implementing the FileSystem interface
+               -->
+               <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
+                       <param name="path" value="${wsp.home}" />
+               </FileSystem>
+               <!--
+                       persistence manager of the workspace: class: FQN of class
+                       implementing the PersistenceManager interface
+               -->
+               
+                       <PersistenceManager
+                       class="org.apache.jackrabbit.core.persistence.bundle.DerbyPersistenceManager">
+                       <param name="url" value="jdbc:derby:${wsp.home}/db;create=true"/>
+                       <param name="schemaObjectPrefix" value="${wsp.name}_"/>
+                       </PersistenceManager>
+               <!-- 
+               <PersistenceManager
+                       class="org.apache.jackrabbit.core.persistence.bundle.BundleDbPersistenceManager">
+                       <param name="url" value="jdbc:hsqldb:mem:db;create=true" />
+                       <param name="driver" value="org.hsqldb.jdbcDriver" />
+                       <param name="user" value="sa" />
+                       <param name="password" value="password" />
+                       <param name="schemaObjectPrefix" value="${wsp.name}_" />
+               </PersistenceManager>
+                -->
+               <!--
+                       Search index and the file system it uses. class: FQN of class
+                       implementing the QueryHandler interface
+               -->
+               <SearchIndex class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
+                       <param name="path" value="${wsp.home}/index" />
+                       <param name="extractorPoolSize" value="2" />
+                       <param name="supportHighlighting" value="true" />
+               </SearchIndex>
+       </Workspace>
 
-    <!--
+       <!--
         Configures the versioning
     -->
-    <Versioning rootPath="${rep.home}/version">
-        <!--
-            Configures the filesystem to use for versioning for the respective
-            persistence manager
-        -->
-        <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
-            <param name="path" value="${rep.home}/version" />
-        </FileSystem>
+       <Versioning rootPath="${rep.home}/version">
+               <!--
+                       Configures the filesystem to use for versioning for the respective
+                       persistence manager
+               -->
+               <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
+                       <param name="path" value="${rep.home}/version" />
+               </FileSystem>
 
-        <!--
-            Configures the persistence manager to be used for persisting version state.
-            Please note that the current versioning implementation is based on
-            a 'normal' persistence manager, but this could change in future
-            implementations.
-        -->
-        <PersistenceManager class="org.apache.jackrabbit.core.persistence.bundle.DerbyPersistenceManager">
-          <param name="url" value="jdbc:derby:${rep.home}/version/db;create=true"/>
-          <param name="schemaObjectPrefix" value="version_"/>
-        </PersistenceManager>
-    </Versioning>
+               <!--
+                       Configures the persistence manager to be used for persisting version
+                       state. Please note that the current versioning implementation is
+                       based on a 'normal' persistence manager, but this could change in
+                       future implementations.
+               -->
+               
+                       <PersistenceManager
+                       class="org.apache.jackrabbit.core.persistence.bundle.DerbyPersistenceManager">
+                       <param name="url"
+                       value="jdbc:derby:${rep.home}/version/db;create=true"/> <param
+                       name="schemaObjectPrefix" value="version_"/> </PersistenceManager>
+               
+               <!-- 
+               <PersistenceManager
+                       class="org.apache.jackrabbit.core.persistence.bundle.BundleDbPersistenceManager">
+                       <param name="url" value="jdbc:hsqldb:mem:versions;create=true" />
+                       <param name="driver" value="org.hsqldb.jdbcDriver" />
+                       <param name="user" value="sa" />
+                       <param name="password" value="password" />
+                       <param name="schemaObjectPrefix" value="version_" />
+               </PersistenceManager>
+                -->
+       </Versioning>
 
-    <!--
-        Search index for content that is shared repository wide
-        (/jcr:system tree, contains mainly versions)
-    -->
-    <SearchIndex class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
-        <param name="path" value="${rep.home}/repository/index"/>
-        <param name="extractorPoolSize" value="2"/>
-        <param name="supportHighlighting" value="true"/>
-    </SearchIndex>
+       <!--
+               Search index for content that is shared repository wide (/jcr:system
+               tree, contains mainly versions)
+       -->
+       <SearchIndex class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
+               <param name="path" value="${rep.home}/repository/index" />
+               <param name="extractorPoolSize" value="2" />
+               <param name="supportHighlighting" value="true" />
+       </SearchIndex>
 </Repository>
index 70710eaf4ccff41fc13389827f7877e5cb9827a1..4be6e7f47af4d7129670059f498fd5ac9ae57657 100644 (file)
@@ -5,4 +5,8 @@ Import-Package: javax.jcr,
  javax.servlet,
  javax.servlet.http,
  javax.servlet.resources,
- org.apache.jackrabbit.j2ee
+ org.apache.jackrabbit.j2ee,
+ org.springframework.osgi.web.context.support,
+ org.springframework.web.context,
+ org.springframework.web.servlet.handler,
+ org.springframework.web.servlet
index d2403d92beeac3f36f6d9cefe16506e6fb890fdb..c0a2d6f7a763601895a142345726b1c301880352 100644 (file)
@@ -8,6 +8,4 @@
        http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd">
 
        <import resource="osgi.xml" />
-
-       <bean class="org.apache.jackrabbit.j2ee.SimpleWebdavServlet"></bean>
 </beans>
\ No newline at end of file
diff --git a/server/modules/org.argeo.server.jackrabbit.webapp/WEB-INF/config.xml b/server/modules/org.argeo.server.jackrabbit.webapp/WEB-INF/config.xml
new file mode 100644 (file)
index 0000000..f562d76
--- /dev/null
@@ -0,0 +1,197 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+   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.
+  -->
+<!--
+<!DOCTYPE config [
+        <!ELEMENT config (iomanager , propertymanager, (collection | noncollection)? , filter?, mimetypeproperties?) >
+
+        <!ELEMENT iomanager (class, iohandler*) >
+        <!ELEMENT iohandler (class) >
+
+        <!ELEMENT propertymanager (class, propertyhandler*) >
+        <!ELEMENT propertyhandler (class) >
+
+        <!ELEMENT collection (nodetypes) >
+        <!ELEMENT noncollection (nodetypes) >
+
+        <!ELEMENT filter (class, namespaces?, nodetypes?) >
+
+        <!ELEMENT class >
+        <!ATTLIST class
+            name  CDATA #REQUIRED
+        >
+        <!ELEMENT namespaces (prefix | uri)* >
+        <!ELEMENT prefix (CDATA) >
+        <!ELEMENT uri (CDATA) >
+
+        <!ELEMENT nodetypes (nodetype)* >
+        <!ELEMENT nodetype (CDATA) >
+
+        <!ELEMENT mimetypeproperties (mimemapping*, defaultmimetype) >
+
+        <!ELEMENT mimemapping >
+        <!ATTLIST mimemapping
+            extension  CDATA #REQUIRED
+            mimetype  CDATA #REQUIRED
+        >
+
+        <!ELEMENT defaultmimetype (CDATA) >
+]>
+-->
+
+<config>
+    <!--
+     Defines the IOManager implementation that is responsible for passing
+     import/export request to the individual IO-handlers.
+    -->
+    <iomanager>
+        <!-- class element defines the manager to be used. The specified class
+             must implement the IOManager interface.
+             Note, that the handlers are being added and called in the order
+             they appear in the configuration.
+        -->
+        <class name="org.apache.jackrabbit.server.io.IOManagerImpl" />
+        <iohandler>
+            <class name="org.apache.jackrabbit.server.io.VersionHandler" />
+        </iohandler>
+        <iohandler>
+            <class name="org.apache.jackrabbit.server.io.VersionHistoryHandler" />
+        </iohandler>
+        <iohandler>
+            <class name="org.apache.jackrabbit.server.io.ZipHandler" />
+        </iohandler>
+        <iohandler>
+            <class name="org.apache.jackrabbit.server.io.XmlHandler" />
+        </iohandler>
+        <iohandler>
+            <class name="org.apache.jackrabbit.server.io.DirListingExportHandler" />
+        </iohandler>
+        <iohandler>
+            <class name="org.apache.jackrabbit.server.io.DefaultHandler" />
+        </iohandler>
+    </iomanager>
+    <!--
+     Example config for iomanager that populates its list of handlers with
+     default values. Therefore the 'iohandler' elements are omited.
+    -->
+    <!--
+    <iomanager>
+        <class name="org.apache.jackrabbit.server.io.DefaultIOManager" />
+    </iomanager>
+    -->
+    <!--
+     Defines the PropertyManager implementation that is responsible for export
+     and import of resource properties.
+    -->
+    <propertymanager>
+        <!-- class element defines the manager to be used. The specified class
+             must implement the PropertyManager interface.
+             Note, that the handlers are being added and called in the order
+             they appear in the configuration.
+        -->
+        <class name="org.apache.jackrabbit.server.io.PropertyManagerImpl" />
+        <propertyhandler>
+            <class name="org.apache.jackrabbit.server.io.VersionHandler" />
+        </propertyhandler>
+        <propertyhandler>
+            <class name="org.apache.jackrabbit.server.io.VersionHistoryHandler" />
+        </propertyhandler>
+        <propertyhandler>
+            <class name="org.apache.jackrabbit.server.io.ZipHandler" />
+        </propertyhandler>
+        <propertyhandler>
+            <class name="org.apache.jackrabbit.server.io.XmlHandler" />
+        </propertyhandler>
+        <propertyhandler>
+            <class name="org.apache.jackrabbit.server.io.DefaultHandler" />
+        </propertyhandler>
+    </propertymanager>
+    <!--
+     Define nodetypes, that should never by displayed as 'collection'
+    -->
+    <noncollection>
+        <nodetypes>
+            <nodetype>nt:file</nodetype>
+            <nodetype>nt:resource</nodetype>
+        </nodetypes>
+    </noncollection>
+    <!--
+     Example: Defines nodetypes, that should always be displayed as 'collection'.
+    -->
+    <!--
+    <collection>
+        <nodetypes>
+            <nodetype>nt:folder</nodetype>
+            <nodetype>rep:root</nodetype>
+        </nodetypes>
+    </collection>
+    -->
+    <!--
+     Filter that allows to prevent certain items from being displayed.
+     Please note, that this has an effect on PROPFIND calls only and does not
+     provide limited access to those items matching any of the filters.
+
+     However specifying a filter may cause problems with PUT or MKCOL if the
+     resource to be created is being filtered out, thus resulting in inconsistent
+     responses (e.g. PUT followed by PROPFIND on parent).
+     -->
+    <filter>
+        <!-- class element defines the resource filter to be used. The specified class
+             must implement the ItemFilter interface -->
+        <class name="org.apache.jackrabbit.webdav.simple.DefaultItemFilter" />
+        <!--
+         Nodetype names to be used to filter child nodes.
+         A child node can be filtered if the declaring nodetype of its definition
+         is one of the nodetype names specified in the nodetypes Element.
+         E.g. defining 'rep:root' as filtered nodetype whould result in jcr:system
+         being hidden but no other child node of the root node, since those
+         are defined by the nodetype nt:unstructered.
+        -->
+        <!--
+        <nodetypes>
+            <nodetype>rep:root</nodetype>
+        </nodetypes>
+        -->
+        <!--
+         Namespace prefixes or uris. Items having a name that matches any of the
+         entries will be filtered.
+        -->
+        <namespaces>
+            <prefix>rep</prefix>
+            <prefix>jcr</prefix>
+            <!--
+            <uri>internal</uri>
+            <uri>http://www.jcp.org/jcr/1.0</uri>
+            -->
+        </namespaces>
+    </filter>
+    
+    <!--
+     Optional 'mimetypeproperties' element.
+     It defines additional or replaces existing mappings for the MimeResolver
+     instance created by the ResourceConfig.
+     The default mappings are defined in org.apache.jackrabbit.server.io.mimetypes.properties.
+     If the default mime type defined by MimeResolver is 'application/octet-stream'.
+    -->
+    <!--
+    <mimetypeproperties>
+        <mimemapping extension="rtf" mimetype="application/rtf" />
+        <mimemapping extension="ott" mimetype="application/vnd.oasis.opendocument.text-template" />
+        <defaultmimetype>text/html</defaultmimetype>
+    </mimetypeproperties>
+    -->
+</config>
index 058c18ce479771612692f7c18996a41af0e88a8b..ab22d2cc4abf25ca79f6e1f572cb9bc59226c67c 100644 (file)
@@ -22,7 +22,7 @@
 
        <!-- Simple Webdav -->
        <servlet>
-               <servlet-name>Webdav</servlet-name>
+               <servlet-name>webdav</servlet-name>
                <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
                <init-param>
                        <param-name>contextClass</param-name>
@@ -32,8 +32,8 @@
        </servlet>
 
     <servlet-mapping>
-        <servlet-name>Webdav</servlet-name>
-        <url-pattern>/repository/*</url-pattern>
+        <servlet-name>webdav</servlet-name>
+        <url-pattern>/default/*</url-pattern>
     </servlet-mapping>
 
 </web-app>
diff --git a/server/modules/org.argeo.server.jackrabbit.webapp/WEB-INF/webdav-servlet.xml b/server/modules/org.argeo.server.jackrabbit.webapp/WEB-INF/webdav-servlet.xml
new file mode 100644 (file)
index 0000000..dfc0897
--- /dev/null
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop"
+       xmlns:tx="http://www.springframework.org/schema/tx"
+       xsi:schemaLocation="
+       http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
+       http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
+       http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd">
+
+       <bean id="webdavServlet" class="org.apache.jackrabbit.j2ee.SimpleWebdavServlet">
+               <property name="repository" ref="repository" />
+       </bean>
+
+       <bean
+               class="org.springframework.web.servlet.handler.SimpleServletPostProcessor" />
+
+       <bean id="servletHandler"
+               class="org.springframework.web.servlet.handler.SimpleServletHandlerAdapter" />
+
+       <bean id="urlMapping"
+               class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
+               <property name="mappings">
+                       <props>
+                               <prop key="**">webdavServlet</prop>
+                       </props>
+               </property>
+       </bean>
+
+</beans>
\ No newline at end of file
index 52149289a496f79127327788c478a2bd37f0912b..24c752354d0b0fd939b83b679466593f9814c942 100644 (file)
@@ -1,4 +1,5 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
        <modelVersion>4.0.0</modelVersion>
        <parent>
                <groupId>org.argeo.commons</groupId>
                        </plugin>
                </plugins>
        </build>
+       <dependencies>
+               <dependency>
+                       <groupId>org.argeo.commons.server</groupId>
+                       <artifactId>org.argeo.server.dep.jackrabbit.server</artifactId>
+                       <version>0.1.2-SNAPSHOT</version>
+                       <type>pom</type>
+               </dependency>
+       </dependencies>
 </project>
\ No newline at end of file