Return-Path: Delivered-To: apmail-jackrabbit-commits-archive@www.apache.org Received: (qmail 79001 invoked from network); 20 May 2008 15:23:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 20 May 2008 15:23:11 -0000 Received: (qmail 80169 invoked by uid 500); 20 May 2008 15:23:12 -0000 Delivered-To: apmail-jackrabbit-commits-archive@jackrabbit.apache.org Received: (qmail 80136 invoked by uid 500); 20 May 2008 15:23:12 -0000 Mailing-List: contact commits-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@jackrabbit.apache.org Delivered-To: mailing list commits@jackrabbit.apache.org Received: (qmail 80127 invoked by uid 99); 20 May 2008 15:23:12 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 May 2008 08:23:12 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.130] (HELO eos.apache.org) (140.211.11.130) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 May 2008 15:22:26 +0000 Received: from eos.apache.org (localhost [127.0.0.1]) by eos.apache.org (Postfix) with ESMTP id E43B4D2EA for ; Tue, 20 May 2008 15:22:47 +0000 (GMT) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Apache Wiki To: commits@jackrabbit.apache.org Date: Tue, 20 May 2008 15:22:47 -0000 Message-ID: <20080520152247.16140.2470@eos.apache.org> Subject: [Jackrabbit Wiki] Update of "HowtoSpi2Dav" by ScottCytacki X-Virus-Checked: Checked by ClamAV on apache.org 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: {{{ missing-auth-mapping @@ -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(); - } }}}