You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by Apache Wiki <wi...@apache.org> on 2010/01/08 12:20:41 UTC
[Jackrabbit Wiki] Update of "RemoteAccess" by JukkaZitting
Dear Wiki user,
You have subscribed to a wiki page or wiki category on "Jackrabbit Wiki" for change notification.
The "RemoteAccess" page has been changed by JukkaZitting.
The comment on this change is: Document remote access with jcr2dav.
http://wiki.apache.org/jackrabbit/RemoteAccess?action=diff&rev1=4&rev2=5
--------------------------------------------------
== Overview ==
- Jackrabbit supports remote access using Dav``Ex (since Jackrabbit 2.0) and using RMI.
+ Jackrabbit supports remote access using !DavEx (WebDAV with JCR extensions, since Jackrabbit 2.0) and an RMI layer called JCR-RMI.
+
+ The easiest way to access a remote repository is to use the {{{org.apache.jackrabbit.commons.JcrUtils.getRepository(String uri)}}} method from the jackrabbit-jcr-commons component. This method takes a repository URI, connects to it and returns a local {{{javax.jcr.Repository}}} instance that you can use to access the repository through the standard JCR API. Note that the {{{JcrUtils}}} class is only available starting with Jackrabbit 2.0.
== DavEx ==
- Jackrabbit 2 supports the Dav``Ex protocol.
+ Jackrabbit 2.0 supports the !DavEx protocol through the Jackrabbit WebDAV server included in the Jackrabbit web application and the [[http://jackrabbit.apache.org/standalone-server.html|Standalone Server]]. The web application exposes the !DavEx interface at http://<server>/<context>/server and the standalone server by default at http://localhost:8080/server.
+ On the client side, you need the following Maven dependencies (note that jackrabbit-jcr2dav is not yet available in an official Jackrabbit release, but it will be included in Jackrabbit 2.0.0):
- On the server side, you need to start the Jackrabbit Web``DAV server, which is included in the
- [[http://jackrabbit.apache.org/standalone-server.html|Standalone Server]].
-
- On the client side, you need the following libraries:
-
- * jackrabbit-jcr-commons (for Jcr``Utils.getRepository)
- * jackrabbit-jcr2spi
- * jackrabbit-spi2dav (Spi2davex``Repository``Service``Factory needs to be on the classpath)
-
- Assuming the server is running at localhost port 8080, connect to the server using:
{{{
- HashMap<String, String> params = new HashMap<String, String>();
- params.put(GenericRepositoryFactory.URI,"http://localhost:8080/jackrabbit/server");
+ <!-- JCR API -->
+ <dependency>
+ <groupId>javax.jcr</groupId>
+ <artifactId>jcr</artifactId>
+ <version>2.0</version>
+ </dependency>
+ <!-- All the Jackrabbit libraries needed for DavEx, plus JcrUtils -->
+ <dependency>
+ <groupId>org.apache.jackrabbit</groupId>
+ <artifactId>jackrabbit-jcr2dav</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ <!-- The SFL4J logging implementation you prefer -->
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
+ <version>1.5.8</version>
+ </dependency>
+ }}}
+
+ Assuming you have the Jackrabbit standalone server running with default settings, you can then connect to it with the following code:
+
+ {{{
+ import javax.jcr.Repository;
+ import org.apache.jackrabbit.commons.JcrUtils;
+
- Repository repository = JcrUtils.getRepository(params);
+ Repository repository = JcrUtils.getRepository("http://localhost:8080/server");
}}}
See also org.apache.jackrabbit.commons.Jcr``Utils#get``Repository(String), org.apache.jackrabbit.commons.Jcr``Utils#get``Repository(java.util.Map) and