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:22:47 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.
+ The image below is a good picture of where spi2dav fits in. It was taken from the jackrabbit-spi
link below.
  
  [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]
+  * [https://svn.apache.org/repos/asf/jackrabbit/sandbox/spi/README.txt]
- [http://jackrabbit.apache.org/jackrabbit-jcr-server.html]
+  * [http://jackrabbit.apache.org/jackrabbit-jcr-server.html]
+  * [http://jackrabbit.apache.org/jackrabbit-spi.html]
  
  {{{
  Warning: this is only partially working for me, so there might be errors in the documentation.
@@ -19, +20 @@

   * 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:
+  * Based on the README.txt referenced above, the following configuration needs to be changed
in the web.xml for the webapp:
  {{{
      <init-param>
        <param-name>missing-auth-mapping</param-name>
@@ -28, +29 @@

  }}}
  
  == 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
+ This code was figured out based on org.apache.jackrabbit.jcr2spi.JCR2SPIRepositoryStub.java
located in https://svn.apache.org/repos/asf/jackrabbit/sandbox/spi/client
  
  {{{
+ import javax.jcr.Repository;
+ import javax.jcr.Session;
+ import javax.jcr.SimpleCredentials;
+ 
  import org.apache.jackrabbit.jcr2spi.RepositoryImpl;
  import org.apache.jackrabbit.jcr2spi.config.CacheBehaviour;
  import org.apache.jackrabbit.jcr2spi.config.RepositoryConfig;
@@ -47, +52 @@

  
  ...
  
- 	Repository repository = null;
-         try {
-             String url = "http://localhost:8080/jackrabbit/server";
+   String url = "http://localhost:8080/jackrabbit/server";
  
-             final IdFactory idFactory = IdFactoryImpl.getInstance();
+   final IdFactory idFactory = IdFactoryImpl.getInstance();
-             final NameFactory nFactory = NameFactoryImpl.getInstance();
+   final NameFactory nFactory = NameFactoryImpl.getInstance();
-             final PathFactory pFactory = PathFactoryImpl.getInstance();
+   final PathFactory pFactory = PathFactoryImpl.getInstance();
-             final QValueFactory vFactory = QValueFactoryImpl.getInstance();
+   final QValueFactory vFactory = QValueFactoryImpl.getInstance();
-             final RepositoryServiceImpl webdavRepoService = 
+   final RepositoryServiceImpl webdavRepoService = 
-                new RepositoryServiceImpl(url, idFactory, nFactory, pFactory, vFactory);
+      new RepositoryServiceImpl(url, idFactory, nFactory, pFactory, vFactory);
  
-             RepositoryConfig config = new RepositoryConfig() {
+   RepositoryConfig config = new RepositoryConfig() {
-                 public RepositoryService getRepositoryService() {
+     public RepositoryService getRepositoryService() {
-                     return webdavRepoService;
+       return webdavRepoService;
-                 }
+     }
  
-                 public String getDefaultWorkspaceName() {
+     public String getDefaultWorkspaceName() {
-                     return "default";
+       return "default";
-                 }
+     }
  
-                 public CacheBehaviour getCacheBehaviour() {
+     public CacheBehaviour getCacheBehaviour() {
-                     return CacheBehaviour.INVALIDATE;
+       return CacheBehaviour.INVALIDATE;
-                 }
-             };
+     }
+   };
  
-             repository = RepositoryImpl.create(config);
+   Repository repository = RepositoryImpl.create(config);
+   Session session = repository.login(new SimpleCredentials("user", "password".toCharArray()));
-         } catch (Exception e) {
-             e.printStackTrace();
-         }
  }}}
  

Mime
View raw message