Return-Path: Delivered-To: apmail-jackrabbit-users-archive@locus.apache.org Received: (qmail 5618 invoked from network); 21 Jun 2008 13:00:26 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 21 Jun 2008 13:00:26 -0000 Received: (qmail 3003 invoked by uid 500); 21 Jun 2008 13:00:28 -0000 Delivered-To: apmail-jackrabbit-users-archive@jackrabbit.apache.org Received: (qmail 2544 invoked by uid 500); 21 Jun 2008 13:00:27 -0000 Mailing-List: contact users-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@jackrabbit.apache.org Delivered-To: mailing list users@jackrabbit.apache.org Received: (qmail 2533 invoked by uid 99); 21 Jun 2008 13:00:27 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 21 Jun 2008 06:00:27 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of caleb7@gmx.net designates 213.165.64.20 as permitted sender) Received: from [213.165.64.20] (HELO mail.gmx.net) (213.165.64.20) by apache.org (qpsmtpd/0.29) with SMTP; Sat, 21 Jun 2008 12:59:36 +0000 Received: (qmail invoked by alias); 21 Jun 2008 12:59:53 -0000 Received: from pD9E5B5D9.dip0.t-ipconnect.de (EHLO krischkems) [217.229.181.217] by mail.gmx.net (mp006) with SMTP; 21 Jun 2008 14:59:53 +0200 X-Authenticated: #860249 X-Provags-ID: V01U2FsdGVkX1/wb915fG7wS76eGWQaFuYZ9WEVnRI815pL1PP6/N xV080kYCpvuHsp From: "Markus" To: References: <001c01c8d39c$85998990$29b2a8c0@spiritlink.de> Subject: RE: Jackrabit and webdav Date: Sat, 21 Jun 2008 14:59:46 +0200 Message-ID: <002101c8d39e$aedb24b0$29b2a8c0@spiritlink.de> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 In-Reply-To: <001c01c8d39c$85998990$29b2a8c0@spiritlink.de> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198 Thread-Index: AcjTmEcEZxHQwoMzSgetHfb4DU79dwAAUIggAAEptyA= X-Y-GMX-Trusted: 0 X-Virus-Checked: Checked by ClamAV on apache.org Sorry, I forgot the probably most obvious possibility: 3. Accessing the repository with RMI (needs jackrabbit-jcr-rmi in client classpath): With running tomcat try the following code in your application (running on the same machine as the tomcat server): package test; import org.apache.jackrabbit.rmi.repository.RMIRemoteRepository; import javax.jcr.*; public class RMITest { public static void main(String[] args) throws RepositoryException { Repository repository = new RMIRemoteRepository("//localhost/jackrabbit.repository"); Session session = repository.login(new SimpleCredentials("admin", "admin".toCharArray())); NodeIterator nodeIterator = session.getRootNode().getNodes(); while(nodeIterator.hasNext()) { System.out.println(nodeIterator.nextNode().getName()); } session.logout(); } } Regards, Markus -----Original Message----- From: Markus [mailto:caleb7@gmx.net] Sent: Saturday, June 21, 2008 2:44 PM To: users@jackrabbit.apache.org Subject: RE: Jackrabit and webdav Hi Paulo, I think there are two approaches for a simple access to the repository running in your default Jackrabbit-Tomcat installation: 1. Access the repository over the TransientRepository class from your client application: - String configLocation = ; - String repositoryLocation = ; - Repository repository = new TransientRepository(configLocation, repositoryLocation); - Session session = repository.login("admin", "admin"); Please note, that with this approach you can access the repository only with either your client OR the web application. Which means, tomcat must not be running while you access it with your application. 2. Access the repository over JNDI within another webapplication: - This needs a little extra Tomcat configuration and is briefly described in http://localhost:8080/jackrabbit-webapp-1.4/local.jsp Regards, Markus -----Original Message----- From: Paulo Sergio [mailto:pauloslf@gmail.com] Sent: Saturday, June 21, 2008 2:13 PM To: users@jackrabbit.apache.org Subject: Re: Jackrabit and webdav Hi guys, thanks for all the answers, i gues i have a problem i have to fix before these one, as i said i pretty new to jcr and i seem to have missed a point. when i run the client it creates a new repository and does not use the one running on tomcat (i assumes it was using localhost as default) so first problem is making the client program "talk " with the repository in tomcat.. any directions in order to achive this? thanks for helping.. paulo f. On Sat, Jun 21, 2008 at 10:09 AM, Bertrand Delacretaz < bdelacretaz@apache.org> wrote: > Hi Paulo, > > On Sat, Jun 21, 2008 at 9:49 AM, Paulo Sergio wrote: > > ...is there any place where i can get examples of that code?... > > There's an example in Sling's Loader class [1], look at the createFile() > method. > > (there are also examples in Jackrabbit but I'm less familiar with that > code). > > -Bertrand > > [1] > http://svn.eu.apache.org/repos/asf/incubator/sling/trunk/jcr/contentloader/s rc/main/java/org/apache/sling/jcr/contentloader/internal/Loader.java >