Examples of toJCRPath()


Examples of org.apache.jackrabbit.name.Path.toJCRPath()

                }

            case PropertyType.PATH:
                Path path = (Path) value.internalValue();
                try {
                    return path.toJCRPath(session.getNamespaceResolver()).length();
                } catch (NoPrefixDeclaredException npde) {
                    // should never happen...
                    String msg = safeGetJCRPath()
                            + ": the value represents an invalid path";
                    log.debug(msg);
View Full Code Here

Examples of org.apache.jackrabbit.name.Path.toJCRPath()

                throw new ItemExistsException(absPath);
            }
            if (!session.itemExists(p.getAncestor(1).toJCRPath(resolver))) {
                throw new PathNotFoundException(p.getAncestor(1).toJCRPath(resolver));
            }
            String relPath = p.toJCRPath(resolver).substring(1);
            Node queryNode = session.getRootNode().addNode(relPath,
                    QName.NT_QUERY.toJCRName(resolver));
            // set properties
            queryNode.setProperty(QName.JCR_LANGUAGE.toJCRName(resolver), language);
            queryNode.setProperty(QName.JCR_STATEMENT.toJCRName(resolver), statement);
View Full Code Here

Examples of org.apache.jackrabbit.name.Path.toJCRPath()

                p = Path.create(eventState.getParentPath(), eventState.getChildRelPath().getName(),
                        eventState.getChildRelPath().getIndex(), false);
            } else {
                p = Path.create(eventState.getParentPath(), eventState.getChildRelPath().getName(), false);
            }
            return p.toJCRPath(session.getNamespaceResolver());
        } catch (MalformedPathException e) {
            String msg = "internal error: malformed path for event";
            log.debug(msg);
            throw new RepositoryException(msg, e);
        } catch (NoPrefixDeclaredException e) {
View Full Code Here

Examples of org.apache.jackrabbit.name.Path.toJCRPath()

            String relPath;
            try {
                Path p = m1.getPrimaryPath().computeRelativePath(getPrimaryPath());
                // use prefix mappings of srcSession
                relPath = p.toJCRPath(srcSession.getNamespaceResolver());
            } catch (BaseException be) {
                // should never get here...
                String msg = "internal error: failed to determine relative path";
                log.error(msg, be);
                throw new RepositoryException(msg, be);
View Full Code Here

Examples of org.apache.jackrabbit.name.Path.toJCRPath()

                node = (NodeImpl) session.getNodeByUUID(fn.getFrozenUUID());
                if (removeExisting) {
                    try {
                        Path dstPath = Path.create(getPrimaryPath(), relPath, session.getNamespaceResolver(), true);
                        // move to respective location
                        session.move(node.getPath(), dstPath.toJCRPath(session.getNamespaceResolver()));
                        // need to refetch ?
                        node = (NodeImpl) session.getNodeByUUID(fn.getFrozenUUID());
                    } catch (MalformedPathException e) {
                        throw new RepositoryException(e);
                    } catch (NoPrefixDeclaredException e) {
View Full Code Here

Examples of org.apache.jackrabbit.name.Path.toJCRPath()

            String relPath;
            try {
                Path p = m1.getPrimaryPath().computeRelativePath(getPrimaryPath());
                // use prefix mappings of srcSession
                relPath = p.toJCRPath(srcSession.getNamespaceResolver());
            } catch (BaseException be) {
                // should never get here...
                String msg = "internal error: failed to determine relative path";
                log.error(msg, be);
                throw new RepositoryException(msg, be);
View Full Code Here

Examples of org.apache.jackrabbit.name.Path.toJCRPath()

                    break;
                case PropertyType.PATH:
                    // try to translate path
                    try {
                        Path p = Path.create(literal, session.getNamespaceResolver(), false);
                        values.add(p.toJCRPath(nsMappings));
                        log.debug("Coerced " + literal + " into PATH.");
                    } catch (MalformedPathException e) {
                        log.warn("Unable to coerce '" + literal + "' into a PATH: " + e.toString());
                    } catch (NoPrefixDeclaredException e) {
                        log.warn("Unable to coerce '" + literal + "' into a PATH: " + e.toString());
View Full Code Here

Examples of org.apache.jackrabbit.name.Path.toJCRPath()

     */
    protected void addPathValue(Document doc, String fieldName, Object internalValue) {
        Path path = (Path) internalValue;
        String pathString = path.toString();
        try {
            pathString = path.toJCRPath(mappings);
        } catch (NoPrefixDeclaredException e) {
            // will never happen
        }
        doc.add(new Field(FieldNames.PROPERTIES,
                FieldNames.createNamedValue(fieldName, pathString),
View Full Code Here

Examples of org.apache.jackrabbit.name.Path.toJCRPath()

                p = Path.create(eventState.getParentPath(), eventState.getChildRelPath().getName(),
                        eventState.getChildRelPath().getIndex(), false);
            } else {
                p = Path.create(eventState.getParentPath(), eventState.getChildRelPath().getName(), false);
            }
            return p.toJCRPath(session.getNamespaceResolver());
        } catch (MalformedPathException e) {
            String msg = "internal error: malformed path for event";
            log.debug(msg);
            throw new RepositoryException(msg, e);
        } catch (NoPrefixDeclaredException e) {
View Full Code Here

Examples of org.apache.jackrabbit.name.Path.toJCRPath()

            String relPath;
            try {
                Path p = m1.getPrimaryPath().computeRelativePath(getPrimaryPath());
                // use prefix mappings of srcSession
                relPath = p.toJCRPath(srcSession.getNamespaceResolver());
            } catch (NameException be) {
                // should never get here...
                String msg = "internal error: failed to determine relative path";
                log.error(msg, be);
                throw new RepositoryException(msg, be);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.