Package org.apache.jackrabbit.spi.commons.conversion

Examples of org.apache.jackrabbit.spi.commons.conversion.PathResolver


        super(nResolver, pResolver);
    }

    public static NamePathResolver create(NamespaceMappings nsMappings) {
        NameResolver nResolver = new NameResolverImpl(nsMappings);
        PathResolver pResolver = new ParsingPathResolver(PATH_FACTORY, nResolver);
        return new NamePathResolverImpl(nResolver, pResolver);
    }
View Full Code Here


        if (excludedIDs.contains(id)) {
            return count;
        }
        executeAndLog(new AddNode(getTransactionId(), id));
        if (++count % 100 == 0) {
            PathResolver resolver = new DefaultNamePathResolver(
                    handler.getContext().getNamespaceRegistry());
            log.info("indexing... {} ({})", resolver.getJCRPath(path), count);
        }
        if (count % 10 == 0) {
            checkIndexingQueue(true);
        }
        checkVolatileCommit();
View Full Code Here

                // nop
            }
        };

        NameResolver nResolver = new ParsingNameResolver(NameFactoryImpl.getInstance(), new DummyNamespaceResolver());
        PathResolver pResolver = new ParsingPathResolver(PathFactoryImpl.getInstance(), nResolver, idResolver);
        resolver = new DefaultNamePathResolver(nResolver, pResolver);
        qvFactory = QValueFactoryImpl.getInstance();
        vFactory = new ValueFactoryQImpl(qvFactory, resolver);
    }
View Full Code Here

    private static void setupCachingPathResolver() {
        if (cachingPathResolver != null) {
            return;
        }

        PathResolver pathResolver = new ParsingPathResolver(PathFactoryImpl.getInstance(), new NameResolver() {
            public Name getQName(String name) throws IllegalNameException, NamespaceException {
                return null;
            }

            public String getJCRName(Name name) throws NamespaceException {
View Full Code Here

        if (excludedIDs.contains(id)) {
            return count;
        }
        executeAndLog(new AddNode(getTransactionId(), id));
        if (++count % 100 == 0) {
            PathResolver resolver = new DefaultNamePathResolver(
                    handler.getContext().getNamespaceRegistry());
            log.info("indexing... {} ({})", resolver.getJCRPath(path), count);
        }
        if (count % 10 == 0) {
            checkIndexingQueue(true);
        }
        checkVolatileCommit();
View Full Code Here

        }
        return fs;
    }
   
    public void testReadHoldFromFile() throws RepositoryException {
        PathResolver resolver = (SessionImpl) superuser;
        RetentionRegistryImpl re = new RetentionRegistryImpl((SessionImpl) superuser, createFileSystem());
        try {
            assertTrue(re.hasEffectiveHold(resolver.getQPath(childNPath), false));
            assertTrue(re.hasEffectiveHold(resolver.getQPath(childN3.getPath()), false));
            assertTrue(re.hasEffectiveHold(resolver.getQPath(childNPath + "/somechild"), false));
            assertTrue(re.hasEffectiveHold(resolver.getQPath(childNPath + "/hold/is/deep"), false));

            assertFalse(re.hasEffectiveHold(resolver.getQPath(testNodePath), false));
            assertFalse(re.hasEffectiveHold(resolver.getQPath(childN2.getPath()), false));

        } finally {
            re.close();
        }
    }
View Full Code Here

            s.logout();
        }
    }

    public void testWriteFile() throws RepositoryException {
        PathResolver resolver = (SessionImpl) superuser;
        FileSystem fs = createFileSystem();
        RetentionRegistryImpl re = new RetentionRegistryImpl((SessionImpl) superuser, fs);

        try {
            // write the changes to the fs
            re.close();

            // create a new dummy registry again.
            re = new RetentionRegistryImpl((SessionImpl) superuser, fs);

            // test holds
            assertTrue(re.hasEffectiveHold(resolver.getQPath(childNPath), false));
            assertTrue(re.hasEffectiveHold(resolver.getQPath(childN3.getPath()), false));
            assertTrue(re.hasEffectiveHold(resolver.getQPath(childNPath + "/somechild"), false));
            assertTrue(re.hasEffectiveHold(resolver.getQPath(childNPath + "/hold/is/deep"), false));

            // test policies
            assertTrue(re.hasEffectiveRetention(resolver.getQPath(childNPath), false));
            assertTrue(re.hasEffectiveRetention(resolver.getQPath(childNPath + "/somechild"), true));
        } finally {
            re.close();
        }
    }
View Full Code Here

            re.close();
        }
    }

    public void testWriteFileWithChanges() throws RepositoryException, NotExecutableException {
        PathResolver resolver = (SessionImpl) superuser;
        FileSystem fs = createFileSystem();
        RetentionRegistryImpl re = new RetentionRegistryImpl((SessionImpl) superuser, fs);
        String childN3Path = childN3.getPath();
        try {
            retentionMgr.removeRetentionPolicy(childNPath);
            retentionMgr.removeHold(childNPath, retentionMgr.getHolds(childNPath)[0]);
            superuser.save();
           
            retentionMgr.setRetentionPolicy(childN3Path, getApplicableRetentionPolicy("retentionOnChild2"));
            retentionMgr.addHold(childNPath, "holdOnChild", false);
            superuser.save();

            // write the changes to the fs
            re.close();

            // create a new dummy registry again.
            re = new RetentionRegistryImpl((SessionImpl) superuser, fs);

            // test holds
            assertTrue(re.hasEffectiveHold(resolver.getQPath(childNPath), false));
            assertTrue(re.hasEffectiveHold(resolver.getQPath(childNPath), true));
            assertTrue(re.hasEffectiveHold(resolver.getQPath(childN3Path), true));

            assertFalse(re.hasEffectiveHold(resolver.getQPath(childN3Path), false));
            assertFalse(re.hasEffectiveHold(resolver.getQPath(childN3Path + "/child"), false));
            assertFalse(re.hasEffectiveHold(resolver.getQPath(childN3Path + "/child"), true));

            // test policies
            assertTrue(re.hasEffectiveRetention(resolver.getQPath(childN3Path), false));
            assertTrue(re.hasEffectiveRetention(resolver.getQPath(childN3Path + "/child"), true));

            assertFalse(re.hasEffectiveRetention(resolver.getQPath(childN3Path + "/child/more"), true));
            assertFalse(re.hasEffectiveRetention(resolver.getQPath(childNPath), true));
            assertFalse(re.hasEffectiveRetention(resolver.getQPath(childNPath), false));
        } finally {
            re.close();
            // remove the extra policy that is not cleared upon teardown
            if (retentionMgr.getRetentionPolicy(childN3Path) != null) {
                retentionMgr.removeRetentionPolicy(childN3.getPath());
View Full Code Here

                }
            }
        };

        final NameResolver nResolver = new ParsingNameResolver(nameFactory, nsResolver);
        final PathResolver pResolver = new ParsingPathResolver(pathFactory, nResolver);

        this.resolver = new DefaultNamePathResolver(nResolver, pResolver);
    }
View Full Code Here

        super(nResolver, pResolver);
    }

    public static NamePathResolver create(NamespaceMappings nsMappings) {
        NameResolver nResolver = new NameResolverImpl(nsMappings);
        PathResolver pResolver = new ParsingPathResolver(PATH_FACTORY, nResolver);
        return new NamePathResolverImpl(nResolver, pResolver);
    }
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.spi.commons.conversion.PathResolver

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.