Package javax.jcr

Examples of javax.jcr.Repository


    @Test
    public void shouldProvideUserSuppliedDescriptors() {
        Map<String, String> descriptors = new HashMap<String, String>();
        descriptors.put("property", "value");
        Repository repository = new JcrRepository(context, connectionFactory, sourceName, descriptors, null);
        testDescriptorKeys(repository);
        testDescriptorValues(repository);
        assertThat(repository.getDescriptor("property"), is("value"));
    }
View Full Code Here


        JcrSession jcrSession2 = mock(JcrSession.class);
        stub(jcrSession2.nodeTypeManager()).toReturn(nodeTypes);
        SessionCache cache2 = new SessionCache(jcrSession2, store2.getCurrentWorkspaceName(), context, nodeTypes, store2);

        Workspace workspace2 = mock(Workspace.class);
        Repository repository2 = mock(Repository.class);
        stub(jcrSession2.getWorkspace()).toReturn(workspace2);
        stub(jcrSession2.getRepository()).toReturn(repository2);
        stub(workspace2.getName()).toReturn("workspace1");

        // Use the same id and location ...
View Full Code Here

        JcrSession jcrSession2 = mock(JcrSession.class);
        stub(jcrSession2.nodeTypeManager()).toReturn(nodeTypes);
        SessionCache cache2 = new SessionCache(jcrSession2, store2.getCurrentWorkspaceName(), context, nodeTypes, store2);

        Workspace workspace2 = mock(Workspace.class);
        Repository repository2 = mock(Repository.class);
        stub(jcrSession2.getWorkspace()).toReturn(workspace2);
        stub(jcrSession2.getRepository()).toReturn(repository2);
        stub(workspace2.getName()).toReturn("workspace2");

        // Use the same id and location; use 'Toyota Prius'
View Full Code Here

        JcrSession jcrSession2 = mock(JcrSession.class);
        stub(jcrSession2.nodeTypeManager()).toReturn(nodeTypes);
        SessionCache cache2 = new SessionCache(jcrSession2, store2.getCurrentWorkspaceName(), context, nodeTypes, store2);

        Workspace workspace2 = mock(Workspace.class);
        Repository repository2 = mock(Repository.class);
        stub(jcrSession2.getWorkspace()).toReturn(workspace2);
        stub(jcrSession2.getRepository()).toReturn(repository2);
        stub(workspace2.getName()).toReturn("workspace1");

        // Use the same id and location; use 'Nissan Altima'
View Full Code Here

        JcrSession jcrSession2 = mock(JcrSession.class);
        stub(jcrSession2.nodeTypeManager()).toReturn(nodeTypes);
        SessionCache cache2 = new SessionCache(jcrSession2, store2.getCurrentWorkspaceName(), context, nodeTypes, store2);

        Workspace workspace2 = mock(Workspace.class);
        Repository repository2 = mock(Repository.class);
        stub(jcrSession2.getWorkspace()).toReturn(workspace2);
        stub(jcrSession2.getRepository()).toReturn(repository2);
        stub(workspace2.getName()).toReturn("workspace1");

        // Use the same id and location ...
View Full Code Here

        JcrSession jcrSession2 = mock(JcrSession.class);
        stub(jcrSession2.nodeTypeManager()).toReturn(nodeTypes);
        SessionCache cache2 = new SessionCache(jcrSession2, store2.getCurrentWorkspaceName(), context, nodeTypes, store2);

        Workspace workspace2 = mock(Workspace.class);
        Repository repository2 = mock(Repository.class);
        stub(jcrSession2.getWorkspace()).toReturn(workspace2);
        stub(jcrSession2.getRepository()).toReturn(repository2);
        stub(workspace2.getName()).toReturn("workspace2");

        // Use the same id and location; use 'Toyota Prius'
View Full Code Here

        JcrSession jcrSession2 = mock(JcrSession.class);
        stub(jcrSession2.nodeTypeManager()).toReturn(nodeTypes);
        SessionCache cache2 = new SessionCache(jcrSession2, store2.getCurrentWorkspaceName(), context, nodeTypes, store2);

        Workspace workspace2 = mock(Workspace.class);
        Repository repository2 = mock(Repository.class);
        stub(jcrSession2.getWorkspace()).toReturn(workspace2);
        stub(jcrSession2.getRepository()).toReturn(repository2);
        stub(workspace2.getName()).toReturn("workspace1");

        // Use the same id and location; use 'Nissan Altima'
View Full Code Here

     * @see AbstractWebdavServlet#getDavSessionProvider()
     */
    @Override
    public DavSessionProvider getDavSessionProvider() {
        if (server == null) {
            Repository repository = getRepository();
            server = new JCRWebdavServer(repository, new SessionProviderImpl(getCredentialsProvider()));
        }
        return server;
    }
View Full Code Here

     * @throws IOException
     */
    public void spool(OutputContext outputContext) throws IOException {
        if (outputContext.hasStream()) {
            Session session = getRepositorySession();
            Repository rep = session.getRepository();
            String repName = rep.getDescriptor(Repository.REP_NAME_DESC);
            String repURL = rep.getDescriptor(Repository.REP_VENDOR_URL_DESC);
            String repVersion = rep.getDescriptor(Repository.REP_VERSION_DESC);
            String repostr = repName + " " + repVersion;

            StringBuffer sb = new StringBuffer();
            sb.append("<html><head><title>");
            sb.append(repostr);
View Full Code Here

     * @see AbstractWebdavServlet#getDavSessionProvider()
     */
    @Override
    public DavSessionProvider getDavSessionProvider() {
        if (server == null) {
            Repository repository = getRepository();
            server = new JCRWebdavServer(repository, getSessionProvider());
        }
        return server;
    }
View Full Code Here

TOP

Related Classes of javax.jcr.Repository

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.