Using Devex ----- String url = System.getProperty( "test.server.url", "http://localhost:4502/"); URI uri = new URI(url).resolve("/crx/server"); Repository repository = JcrUtils.getRepository(uri.toASCIIString()); Session session = repository.login( new SimpleCredentials("admin", "admin".toCharArray())); ------ Using WebDav ------- Repository repository = JcrUtils.getRepository("http://localhost:7402/crx/server"); ----- Using JNDI ---- Repository repository = JcrUtils.getRepository("jndi://" + "crx" + "?org.apache.jackrabbit.repository.jndi.name=crx" + "&java.naming.factory.initial" + "=com.day.util.jndi.provider.MemoryInitialContextFactory" + "&java.naming.provider.url=http://jcr.day.com"); ---- Using RMI ----- Repository repository = JcrUtils.getRepository("rmi://localhost:1099/crx"); ---- Other resource: http://helpx.adobe.com/experience-manager/using/programmatically-accessing-cq-content-using.html IMPORTANT: To use the JCR API, add the jackrabbit-standalone-2.4.0.jar file to your Java application’s class path. You can obtain this JAR file from the Java JCR API web page at http://jackrabbit.apache.org/jcr-api.html |