Package org.apache.jackrabbit.oak.namepath

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


    @Override
    public NodeTypeIterator getAllNodeTypes() throws RepositoryException {
        List<NodeType> list = Lists.newArrayList();
        Tree types = getTypes();
        if (types != null) {
            NamePathMapper mapper = getNamePathMapper();
            for (Tree type : types.getChildren()) {
                list.add(new NodeTypeImpl(type, mapper));
            }
        }
        return new NodeTypeIteratorAdapter(list);
View Full Code Here


        }
        return true;
    }

    protected String getOakPath(String jcrPath) {
        NamePathMapper m = query.getNamePathMapper();
        if (m == null) {
            // to simplify testing, a getNamePathMapper isn't required
            return jcrPath;
        }
        String p = m.getOakPath(jcrPath);
        if (p == null) {
            throw new IllegalArgumentException("Not a valid JCR path: " + jcrPath);
        }
        return p;
    }
View Full Code Here

        defaultDepth = config.getConfigValue(UserManagerConfig.PARAM_DEFAULT_DEPTH, DEFAULT_DEPTH);

        groupPath = config.getConfigValue(UserManagerConfig.PARAM_GROUP_PATH, "/rep:security/rep:authorizables/rep:groups");
        userPath = config.getConfigValue(UserManagerConfig.PARAM_USER_PATH, "/rep:security/rep:authorizables/rep:users");

        NamePathMapper namePathMapper = sessionDelegate.getNamePathMapper();
        ntAuthorizableFolder = namePathMapper.getJcrName(UserConstants.NT_REP_AUTHORIZABLE_FOLDER);
    }
View Full Code Here

    public QueryResult executeQuery(String statement, String language,
            long limit, long offset, HashMap<String, Value> bindVariableMap) throws RepositoryException {
        try {
            HashMap<String, CoreValue> bindMap = convertMap(bindVariableMap);
            ContentSession s = sessionDelegate.getContentSession();
            NamePathMapper namePathMapper = sessionDelegate.getNamePathMapper();
            Result r = queryEngine.executeQuery(statement, language, s, limit, offset, bindMap, namePathMapper);
            return new QueryResultImpl(sessionDelegate, r);
        } catch (IllegalArgumentException e) {
            throw new InvalidQueryException(e);
        } catch (ParseException e) {
View Full Code Here

        }
        return true;
    }

    protected String getOakPath(String jcrPath) {
        NamePathMapper m = query.getNamePathMapper();
        if (m == null) {
            // to simplify testing, a getNamePathMapper isn't required
            return jcrPath;
        }
        String p = m.getOakPath(jcrPath);
        if (p == null) {
            throw new IllegalArgumentException("Not a valid JCR path: " + jcrPath);
        }
        return p;
    }
View Full Code Here

    public QueryResult executeQuery(String statement, String language,
            long limit, long offset, HashMap<String, Value> bindVariableMap) throws RepositoryException {
        try {
            HashMap<String, CoreValue> bindMap = convertMap(bindVariableMap);
            NamePathMapper namePathMapper = sessionDelegate.getNamePathMapper();
            Result r = queryEngine.executeQuery(statement, language, limit, offset,
                    bindMap, sessionDelegate.getRoot(), namePathMapper);
            return new QueryResultImpl(sessionDelegate, r);
        } catch (IllegalArgumentException e) {
            throw new InvalidQueryException(e);
View Full Code Here

            //        PropertyType.nameFromValue(targetType) + ">");
        }
    }

    public String getOakPath(String jcrPath) {
        NamePathMapper m = getNamePathMapper();
        if (m == null) {
            // to simplify testing, a getNamePathMapper isn't required
            return jcrPath;
        }
        String p = m.getOakPath(jcrPath);
        if (p == null) {
            throw new IllegalArgumentException("Not a valid JCR path: " + jcrPath);
        }
        return p;
    }
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
    public Principal getPrincipal() throws RepositoryException {
        Tree userTree = getTree();
        String principalName = getPrincipalName();
        NamePathMapper npMapper = getUserManager().getNamePathMapper();
        if (isAdmin()) {
            return new AdminPrincipalImpl(principalName, userTree, npMapper);
        } else {
            return new TreeBasedPrincipal(principalName, userTree, npMapper);
        }
View Full Code Here

TOP

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

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.