Package org.apache.jackrabbit.spi

Examples of org.apache.jackrabbit.spi.Path


                return m2.getPath();
            }

            String relPath;
            try {
                Path p = m1.getPrimaryPath().computeRelativePath(getPrimaryPath());
                // use prefix mappings of srcSession
                relPath = session.getJCRPath(p);
            } catch (NameException be) {
                // should never get here...
                String msg = "internal error: failed to determine relative path";
View Full Code Here


            return super.getPrimaryPath();
        }

        NodeId parentId = getParentId();
        NodeImpl parentNode = (NodeImpl) getParent();
        Path parentPath = parentNode.getPrimaryPath();
        PathBuilder builder = new PathBuilder(parentPath);

        ChildNodeEntry entry =
            parentNode.getNodeState().getChildNodeEntry(getNodeId());
        if (entry == null) {
View Full Code Here

        }
    }

    public Object visit(TextsearchQueryNode node, Object data) {
        try {
            Path relPath = node.getRelativePath();
            String fieldname;
            if (relPath == null || !node.getReferencesProperty()) {
                // fulltext on node
                fieldname = FieldNames.FULLTEXT;
            } else {
                // final path element is a property name
                Name propName = relPath.getName();
                StringBuffer tmp = new StringBuffer();
                tmp.append(nsMappings.getPrefix(propName.getNamespaceURI()));
                tmp.append(":").append(FieldNames.FULLTEXT_PREFIX);
                tmp.append(propName.getLocalName());
                fieldname = tmp.toString();
            }
            QueryParser parser = new JackrabbitQueryParser(
                    fieldname, analyzer, synonymProvider, cache);
            Query context = parser.parse(node.getQuery());
            if (relPath != null && (!node.getReferencesProperty() || relPath.getLength() > 1)) {
                // text search on some child axis
                Path.Element[] elements = relPath.getElements();
                for (int i = elements.length - 1; i >= 0; i--) {
                    Name name = null;
                    if (!elements[i].getName().equals(RelationQueryNode.STAR_NAME_TEST)) {
                        name = elements[i].getName();
                    }
View Full Code Here

                    }
                    break;
                case PropertyType.PATH:
                    // try to translate path
                    try {
                        Path p = session.getQPath(literal);
                        values.add(resolver.getJCRPath(p));
                        log.debug("Coerced " + literal + " into PATH.");
                    } catch (NameException e) {
                        log.debug("Unable to coerce '" + literal + "' into a PATH: " + e.toString());
                    } catch (NamespaceException e) {
View Full Code Here

        if (count % 10 == 0) {
            checkIndexingQueue(true);
        }
        checkVolatileCommit();
        for (ChildNodeEntry child : node.getChildNodeEntries()) {
            Path childPath = PATH_FACTORY.create(path, child.getName(),
                    child.getIndex(), false);
            NodeState childState = null;
            try {
                childState = (NodeState) stateMgr.getItemState(child.getId());
            } catch (NoSuchItemStateException e) {
View Full Code Here

        // 1. check paths & retrieve state
        NodeState srcState = getNodeState(srcPath);

        Path.Element destName = destPath.getNameElement();
        Path destParentPath = destPath.getAncestor(1);
        NodeState destParentState = getNodeState(destParentPath);
        int ind = destName.getIndex();
        if (ind > 0) {
            // subscript in name element
            String msg =
View Full Code Here

        // 1. check paths & retrieve state

        NodeState srcState = getNodeState(srcStateMgr, srcHierMgr, srcPath);

        Path.Element destName = destPath.getNameElement();
        Path destParentPath = destPath.getAncestor(1);
        NodeState destParentState = getNodeState(destParentPath);
        int ind = destName.getIndex();
        if (ind > 0) {
            // subscript in name element
            String msg =
View Full Code Here

            log.debug(msg);
            throw new RepositoryException(msg, mpe);
        }

        Path.Element srcName = srcPath.getNameElement();
        Path srcParentPath = srcPath.getAncestor(1);
        NodeState target = getNodeState(srcPath);
        NodeState srcParent = getNodeState(srcParentPath);

        Path.Element destName = destPath.getNameElement();
        Path destParentPath = destPath.getAncestor(1);
        NodeState destParent = getNodeState(destParentPath);

        int ind = destName.getIndex();
        if (ind > 0) {
            // subscript in name element
View Full Code Here

                             Name nodeTypeName, int options)
            throws ConstraintViolationException, AccessDeniedException,
            VersionException, LockException, ItemNotFoundException,
            ItemExistsException, RepositoryException {

        Path parentPath = hierMgr.getPath(parentState.getNodeId());

        // 1. locking status

        if ((options & CHECK_LOCK) == CHECK_LOCK) {
            // make sure there's no foreign lock on parent node
View Full Code Here

        if (targetState.getParentId() == null) {
            // root or orphaned node
            throw new ConstraintViolationException("cannot remove root node");
        }
        Path targetPath = hierMgr.getPath(targetState.getNodeId());
        NodeState parentState = getNodeState(parentId);
        Path parentPath = hierMgr.getPath(parentId);

        // 1. locking status

        if ((options & CHECK_LOCK) == CHECK_LOCK) {
            // make sure there's no foreign lock on parent node
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.spi.Path

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.