Package org.apache.jackrabbit.oak.namepath

Examples of org.apache.jackrabbit.oak.namepath.NameMapper


    private AccessControlManagerImpl getTestAccessControlManager() throws Exception {
        return new AccessControlManagerImpl(getTestRoot(), getNamePathMapper(), getSecurityProvider());
    }

    private NamePathMapper getLocalNamePathMapper() {
        NameMapper remapped = new TestNameMapper(nameMapper, TestNameMapper.LOCAL_MAPPING);
        return new NamePathMapperImpl(remapped);
    }
View Full Code Here


        return aggr.toArray(new Privilege[aggr.size()]);
    }

    @Test
    public void testGetPath() {
        NameMapper nameMapper = new GlobalNameMapper() {
            @Override
            protected Map<String, String> getNamespaceMap() {
                return Collections.singletonMap("jr", "http://jackrabbit.apache.org");
            }
        };
View Full Code Here

    private AccessControlManagerImpl getTestAccessControlManager() throws Exception {
        return new AccessControlManagerImpl(getTestRoot(), getNamePathMapper(), getSecurityProvider());
    }

    private NamePathMapper getLocalNamePathMapper() {
        NameMapper remapped = new TestNameMapper(nameMapper, TestNameMapper.LOCAL_MAPPING);
        return new NamePathMapperImpl(remapped);
    }
View Full Code Here

        return aggr.toArray(new Privilege[aggr.size()]);
    }

    @Test
    public void testGetPath() {
        NameMapper nameMapper = new TestGlobalNameMapper(Collections.singletonMap("jr", "http://jackrabbit.apache.org"));
        NamePathMapper npMapper = new NamePathMapperImpl(nameMapper);

        // map of jcr-path to standard jcr-path
        Map<String, String> paths = new HashMap<String, String>();
        paths.put(null, null);
View Full Code Here

    private AccessControlManagerImpl getTestAccessControlManager() throws Exception {
        return new AccessControlManagerImpl(getTestRoot(), getNamePathMapper(), getSecurityProvider());
    }

    private NamePathMapper getLocalNamePathMapper() {
        NameMapper remapped = new TestNameMapper(nameMapper, TestNameMapper.LOCAL_MAPPING);
        return new NamePathMapperImpl(remapped);
    }
View Full Code Here

        return aggr.toArray(new Privilege[aggr.size()]);
    }

    @Test
    public void testGetPath() {
        NameMapper nameMapper = new GlobalNameMapper() {
            @Override
            protected Map<String, String> getNamespaceMap() {
                return Collections.singletonMap("jr", "http://jackrabbit.apache.org");
            }
        };
View Full Code Here

    @Override
    public boolean isNodeType(String nodeTypeName) throws RepositoryException {
        checkStatus();

        // TODO: might be expanded, need a better way for this
        NameMapper mapper = sessionDelegate.getNamePathMapper();
        String oakName = mapper.getOakName(nodeTypeName);
        if (oakName == null) {
            return false; // An unknown name can't belong to a valid type
        }
        String jcrName = mapper.getJcrName(oakName);

        // TODO: figure out the right place for this check
        NodeTypeManager ntm = sessionDelegate.getNodeTypeManager();
        NodeType ntToCheck = ntm.getNodeType(jcrName); // throws on not found
        String nameToCheck = ntToCheck.getName();
View Full Code Here

        return sessionDelegate.perform(new SessionOperation<Boolean>() {
            @Override
            public Boolean perform() throws RepositoryException {
                // TODO: might be expanded, need a better way for this
                NameMapper mapper = sessionDelegate.getNamePathMapper();
                String oakName = mapper.getOakName(nodeTypeName);
                if (oakName == null) {
                    return false; // An unknown name can't belong to a valid type
                }
                String jcrName = mapper.getJcrName(oakName);

                // TODO: figure out the right place for this check
                NodeTypeManager ntm = sessionDelegate.getNodeTypeManager();
                NodeType ntToCheck = ntm.getNodeType(jcrName); // throws on not found
                String nameToCheck = ntToCheck.getName();
View Full Code Here

        List<String> testPaths = new ArrayList<String>();
        testPaths.add('/' + TEST_LOCAL_PREFIX + ":testRoot");
        testPaths.add("/{" + TEST_URI + "}testRoot");

        NameMapper remapped = new LocalNameMapper(
                root, singletonMap(TEST_LOCAL_PREFIX, TEST_URI));

        AccessControlManager acMgr =
                getAccessControlManager(new NamePathMapperImpl(remapped));
        for (String path : testPaths) {
View Full Code Here

        List<String> testPaths = new ArrayList<String>();
        testPaths.add('/' + TEST_LOCAL_PREFIX + ":testRoot");
        testPaths.add("/{" + TEST_URI + "}testRoot");

        NameMapper remapped = new LocalNameMapper(
                root, singletonMap(TEST_LOCAL_PREFIX, TEST_URI));

        AccessControlManager acMgr =
                getAccessControlManager(new NamePathMapperImpl(remapped));
        for (String path : testPaths) {
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.oak.namepath.NameMapper

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.