jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Jackrabbit Wiki] Update of "HowtoSpi2Dav" by ScottCytacki
Date Tue, 20 May 2008 15:09:33 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Jackrabbit Wiki" for change notification.

The following page has been changed by ScottCytacki:
http://wiki.apache.org/jackrabbit/HowtoSpi2Dav

------------------------------------------------------------------------------
+ == Context ==
  The image below is a good picture of where spi2dav fits in.
+ 
  [http://jackrabbit.apache.org/jackrabbit-spi.data/jackrabbit-spi-overview.gif]
  
+ I could not find much documentation on getting it setup.  
+ Here is what I've found so far:
+ [https://svn.apache.org/repos/asf/jackrabbit/sandbox/spi/README.txt]
+ [http://jackrabbit.apache.org/jackrabbit-jcr-server.html]
+ 
+ {{{
+ Warning: this is only partially working for me, so there might be errors in the documentation.
+ }}}
+ 
+ == Get jcr-server running ==
+ To use spi2dav you need to have the [http://jackrabbit.apache.org/jackrabbit-jcr-server.html
"jcr server component"] running.
+  * Download the jcr-server war
+  * create a folder in your servlet container's (tomcat, jetty, ...) webapps folder.  I used
jackrabbit.
+  * uncompress the war into that folder
+  * Based on the README.txt inside of the sandbox/spi folder, the following configuration
needs to be changed in the web.xml for the webapp:
+ {{{
+     <init-param>
+       <param-name>missing-auth-mapping</param-name>
+       <param-value></param-value>
+     </init-param>
+ }}}
+ 
+ == Access the remote server from a client ==
+ This code was taken was figured out based on org.apache.jackrabbit.jcr2spi.JCR2SPIRepositoryStub.java
located in https://svn.apache.org/repos/asf/jackrabbit/sandbox/spi/client
+ 
+ {{{
+ import org.apache.jackrabbit.jcr2spi.RepositoryImpl;
+ import org.apache.jackrabbit.jcr2spi.config.CacheBehaviour;
+ import org.apache.jackrabbit.jcr2spi.config.RepositoryConfig;
+ import org.apache.jackrabbit.spi.IdFactory;
+ import org.apache.jackrabbit.spi.NameFactory;
+ import org.apache.jackrabbit.spi.PathFactory;
+ import org.apache.jackrabbit.spi.QValueFactory;
+ import org.apache.jackrabbit.spi.RepositoryService;
+ import org.apache.jackrabbit.spi.commons.identifier.IdFactoryImpl;
+ import org.apache.jackrabbit.spi.commons.name.NameFactoryImpl;
+ import org.apache.jackrabbit.spi.commons.name.PathFactoryImpl;
+ import org.apache.jackrabbit.spi.commons.value.QValueFactoryImpl;
+ import org.apache.jackrabbit.spi2dav.RepositoryServiceImpl;
+ 
+ ...
+ 
+ 	Repository repository = null;
+         try {
+             String url = "http://localhost:8080/jackrabbit/server";
+ 
+             final IdFactory idFactory = IdFactoryImpl.getInstance();
+             final NameFactory nFactory = NameFactoryImpl.getInstance();
+             final PathFactory pFactory = PathFactoryImpl.getInstance();
+             final QValueFactory vFactory = QValueFactoryImpl.getInstance();
+             final RepositoryServiceImpl webdavRepoService = 
+                new RepositoryServiceImpl(url, idFactory, nFactory, pFactory, vFactory);
+ 
+             RepositoryConfig config = new RepositoryConfig() {
+                 public RepositoryService getRepositoryService() {
+                     return webdavRepoService;
+                 }
+ 
+                 public String getDefaultWorkspaceName() {
+                     return "default";
+                 }
+ 
+                 public CacheBehaviour getCacheBehaviour() {
+                     return CacheBehaviour.INVALIDATE;
+                 }
+             };
+ 
+             repository = RepositoryImpl.create(config);
+         } catch (Exception e) {
+             e.printStackTrace();
+         }
+ }}}
+ 

Mime
View raw message