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

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


    private final PathResolver pathResolver;

    private JcrPath[] tests = JcrPath.getTests();

    public PathBuilderTest() {
        NameResolver nameResolver = new ParsingNameResolver(NameFactoryImpl.getInstance(), nsResolver);
        pathResolver = new ParsingPathResolver(factory, nameResolver);
    }
View Full Code Here


    public void testGetRestrictionNames() throws RepositoryException {
        List names = Arrays.asList(createEmptyTemplate(getTestPath()).getRestrictionNames());

        assertEquals(2, names.size());
        NameResolver resolver = (NameResolver) superuser;
        assertTrue(names.contains(resolver.getJCRName(ACLTemplate.P_NODE_PATH)));
        assertTrue(names.contains(resolver.getJCRName(ACLTemplate.P_GLOB)));
    }
View Full Code Here

    }

    public void testGetRestrictionTypes() throws RepositoryException {
        JackrabbitAccessControlList acl = createEmptyTemplate(getTestPath());

        NameResolver resolver = (NameResolver) superuser;
        assertEquals(PropertyType.PATH, acl.getRestrictionType(resolver.getJCRName(ACLTemplate.P_NODE_PATH)));
        assertEquals(PropertyType.STRING, acl.getRestrictionType(resolver.getJCRName(ACLTemplate.P_GLOB)));
    }
View Full Code Here

    protected void setUp() throws Exception {
        super.setUp();

        if (superuser instanceof NameResolver) {
            NameResolver resolver = (NameResolver) superuser;
            nodePath = resolver.getJCRName(ACLTemplate.P_NODE_PATH);
            glob = resolver.getJCRName(ACLTemplate.P_GLOB);
        } else {
            throw new NotExecutableException();
        }

        restrictions = new HashMap(2);
View Full Code Here

    protected void setUp() throws Exception {
        super.setUp();
        if (!(userMgr instanceof UserManagerImpl)) {
            throw new NotExecutableException("UserManagerImpl expected -> cannot perform test.");
        }
        NameResolver resolver = (SessionImpl) superuser;
        pPrincipalName = resolver.getJCRName(UserConstants.P_PRINCIPAL_NAME);
        pUserID = resolver.getJCRName(UserConstants.P_USERID);
    }
View Full Code Here

    protected void setUp() throws Exception {
        super.setUp();
        if (!(userMgr instanceof UserManagerImpl)) {
            throw new NotExecutableException("UserManagerImpl expected -> cannot perform test.");
        }
        NameResolver resolver = (SessionImpl) superuser;
        pPrincipalName = resolver.getJCRName(UserConstants.P_PRINCIPAL_NAME);
    }
View Full Code Here

    @Override
    protected void setUp() throws Exception {
        super.setUp();

        if (superuser instanceof SessionImpl) {
            NameResolver resolver = (SessionImpl) superuser;
            protectedUserProps.add(resolver.getJCRName(UserConstants.P_PASSWORD));
            protectedUserProps.add(resolver.getJCRName(UserConstants.P_IMPERSONATORS));
            protectedUserProps.add(resolver.getJCRName(UserConstants.P_PRINCIPAL_NAME));

            protectedUserProps.add(resolver.getJCRName(UserConstants.P_MEMBERS));
            protectedGroupProps.add(resolver.getJCRName(UserConstants.P_PRINCIPAL_NAME));
        } else {
            throw new NotExecutableException();
        }
    }
View Full Code Here

    protected void setUp() throws Exception {
        super.setUp();
        if (!(userMgr instanceof UserManagerImpl)) {
            throw new NotExecutableException("UserManagerImpl expected -> cannot perform test.");
        }
        NameResolver resolver = (SessionImpl) superuser;
        pPrincipalName = resolver.getJCRName(UserConstants.P_PRINCIPAL_NAME);
    }
View Full Code Here

     * @return a new <code>RetentionPolicy</code>
     * @throws RepositoryException If the jcr name isn't valid or if same other
     * error occurs.
     */
    public static RetentionPolicy createRetentionPolicy(String jcrName, Session session) throws RepositoryException {
        NameResolver resolver;
        if (session instanceof NameResolver) {
            resolver = (NameResolver) session;
        } else {
            resolver = new DefaultNamePathResolver(session);
        }
View Full Code Here

        this.userManager = systemUserManager;
        everyonePrincipal = EveryonePrincipal.getInstance();

        String[] ntNames = new String[1];
        if (systemSession instanceof SessionImpl) {
            NameResolver resolver = (NameResolver) systemSession;
            ntNames[0] = resolver.getJCRName(UserManagerImpl.NT_REP_AUTHORIZABLE_FOLDER);
            pPrincipalName = resolver.getJCRName(UserManagerImpl.P_PRINCIPAL_NAME);
        } else {
            ntNames[0] = "rep:AuthorizableFolder";
            pPrincipalName = "rep:principalName";
        }
View Full Code Here

TOP

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

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.