Package org.apache.jackrabbit.oak.namepath

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


        }
    }

    @Test
    public void testGetOakPath() {
        NamePathMapper npMapper = new NamePathMapperImpl(new TestNameMapper());
        // map of jcr-path to oak path
        Map<String, String> paths = new HashMap<String, String>();
        paths.put(null, null);
        paths.put(getTestPath(), getTestPath());
        paths.put("/", "/");
View Full Code Here


        this.delegate = checkNotNull(delegate);
        SessionStats sessionStats = delegate.getSessionStats();
        sessionStats.setAttributes(attributes);

        this.namespaces = new SessionNamespaces(delegate.getRoot());
        this.namePathMapper = new NamePathMapperImpl(
                namespaces, delegate.getIdManager());
        this.valueFactory = new ValueFactoryImpl(
                delegate.getRoot(), namePathMapper);
    }
View Full Code Here


    //--------------------------------------------------------

    public NamePathMapper currentNamePathMapper() {
        return new NamePathMapperImpl(new LocalNameMapper(
                sessionContext.getSessionDelegate().getRoot(),
                documentPrefixMap));
    }
View Full Code Here

            protected Root getWriteRoot() {
                return root;
            }
        };

        this.vf = new ValueFactoryImpl(null, new NamePathMapperImpl(
                new GlobalNameMapper() {
                    @Override
                    protected Map<String, String> getNamespaceMap() {
                        return Namespaces.getNamespaceMap(root.getTree("/"));
                    }
View Full Code Here

    public void before() throws Exception {
        super.before();

        registerNamespace(TEST_PREFIX, TEST_URI);
        nameMapper = new GlobalNameMapper(root);
        npMapper = new NamePathMapperImpl(nameMapper);

        acMgr = getAccessControlManager(npMapper);
        valueFactory = new ValueFactoryImpl(root, npMapper);

        NodeUtil rootNode = new NodeUtil(root.getTree("/"), npMapper);
View Full Code Here

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

        AccessControlManager acMgr =
                getAccessControlManager(new NamePathMapperImpl(remapped));
        for (String path : testPaths) {
            Privilege[] supported = acMgr.getSupportedPrivileges(path);

            assertNotNull(supported);
            assertEquals(allPrivileges.size(), supported.length);
View Full Code Here

        this.session = new SessionImpl(this);
        this.root = contentSession.getLatestRoot();
        this.conflictHandler = new AnnotatingConflictHandler(contentSession.getCoreValueFactory());
        this.autoRefresh = autoRefresh;
        this.idManager = new IdentifierManager(contentSession.getQueryEngine(), root);
        this.namePathMapper = new NamePathMapperImpl(new SessionNameMapper(), idManager);
        this.valueFactory = new ValueFactoryImpl(contentSession.getCoreValueFactory(), namePathMapper);
    }
View Full Code Here

    private static Query parseQuery(
            String statement, String language, ExecutionContext context,
            Map<String, String> mappings) throws ParseException {
        LOG.debug("Parsing {} statement: {}", language, statement);

        NamePathMapper mapper = new NamePathMapperImpl(
                new LocalNameMapper(context.getRoot(), mappings));

        NodeState types = context.getBaseState()
                .getChildNode(JCR_SYSTEM)
                .getChildNode(JCR_NODE_TYPES);
View Full Code Here

    @Override
    public void contentChanged(@Nonnull NodeState root, @Nullable CommitInfo info) {
        try {
            if (previousRoot != null) {
                NamePathMapper namePathMapper = new NamePathMapperImpl(
                        new GlobalNameMapper(new ImmutableRoot(root)));

                Set<String> oakPropertyNames = Sets.newHashSet();
                for (String name : propertyNames) {
                    oakPropertyNames.add(namePathMapper.getJcrName(name));
                }
                NodeState before = previousRoot;
                NodeState after = root;
                EventHandler handler = new FilteredHandler(
                        new VisibleFilter(),
                        new NodeEventHandler("/", info, namePathMapper, oakPropertyNames));
                for (String name : PathUtils.elements(path)) {
                    String oakName = namePathMapper.getOakName(name);
                    before = before.getChildNode(oakName);
                    after = after.getChildNode(oakName);
                    handler = handler.getChildHandler(oakName, before, after);
                }
View Full Code Here

            @Override
            protected Map<String, String> getSessionLocalMappings() {
                return namespaces.getSessionLocalMappings();
            }
        };
        this.namePathMapper = new NamePathMapperImpl(
                nameMapper, delegate.getIdManager());
        this.valueFactory = new ValueFactoryImpl(
                delegate.getRoot(), namePathMapper);
    }
View Full Code Here

TOP

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

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.