Package org.apache.jackrabbit.spi

Examples of org.apache.jackrabbit.spi.NodeId


        /**
         * @see OperationVisitor#visit(CreateConfiguration)
         */
        public void visit(CreateConfiguration operation) throws RepositoryException {
            NodeId configId = service.createConfiguration(sessionInfo, operation.getNodeId());
            operation.setNewConfigurationId(configId);
        }
View Full Code Here


        return parentUri + "/" + Text.escape(resolver.getJCRName(childName));
    }

    private NodeId getParentId(DavPropertySet propSet, SessionInfo sessionInfo)
        throws RepositoryException {
        NodeId parentId = null;
        DavProperty<?> p = propSet.get(JcrRemotingConstants.JCR_PARENT_LN, ItemResourceConstants.NAMESPACE);
        if (p != null) {
            HrefProperty parentProp = new HrefProperty(p);
            String parentHref = parentProp.getHrefs().get(0);
            if (parentHref != null && parentHref.length() > 0) {
View Full Code Here

                // the given id points to a Property instead of a Node
                throw new ItemNotFoundException("No node for id " + saveGetIdString(nodeId, sessionInfo));
            }

            NamePathResolver resolver = getNamePathResolver(sessionInfo);
            NodeId parentId = getParentId(propSet, sessionInfo);

            NodeInfoImpl nInfo = buildNodeInfo(nodeResponse, parentId, propSet, sessionInfo, resolver);

            for (MultiStatusResponse resp : childResponses) {
                DavPropertySet childProps = resp.getProperties(DavServletResponse.SC_OK);
View Full Code Here

    private NodeInfoImpl buildNodeInfo(MultiStatusResponse nodeResponse,
                                       NodeId parentId, DavPropertySet propSet,
                                       SessionInfo sessionInfo,
                                       NamePathResolver resolver) throws NameException, RepositoryException {
        NodeId id = uriResolver.buildNodeId(parentId, nodeResponse, sessionInfo.getWorkspaceName(), getNamePathResolver(sessionInfo));
        NodeInfoImpl nInfo = new NodeInfoImpl(id, propSet, resolver);
        DavProperty p = propSet.get(JcrRemotingConstants.JCR_REFERENCES_LN, ItemResourceConstants.NAMESPACE);
        if (p != null) {
            HrefProperty refProp = new HrefProperty(p);
            for (String propertyHref : refProp.getHrefs()) {
View Full Code Here

        return nInfo;
    }

    private List<PropertyInfo> buildPropertyInfos(NodeInfo nInfo) throws RepositoryException {
        List<PropertyInfo> l = new ArrayList<PropertyInfo>(3);
        NodeId nid = nInfo.getId();
        Path nPath = nInfo.getPath();

        if (nid.getPath() == null) {
            PropertyId id = getIdFactory().createPropertyId(nid, NameConstants.JCR_UUID);
            QValue[] vs = new QValue[] {getQValueFactory().create(nid.getUniqueID(), PropertyType.STRING)};
            Path p = getPathFactory().create(nPath, NameConstants.JCR_UUID, true);
            PropertyInfo pi = new PropertyInfoImpl(id, p, PropertyType.STRING, false, vs);
            l.add(pi);
        }
View Full Code Here

            DavPropertySet ps = responses[0].getProperties(DavServletResponse.SC_OK);
            if (ps.contains(DavPropertyName.LOCKDISCOVERY)) {
                DavProperty<?> p = ps.get(DavPropertyName.LOCKDISCOVERY);
                LockDiscovery ld = LockDiscovery.createFromXml(p.toXml(domFactory));
                NodeId parentId = getParentId(ps, sessionInfo);
                return retrieveLockInfo(ld, sessionInfo, nodeId, parentId);
            else {
                // no lock present
                log.debug("No Lock present on node with id " + saveGetIdString(nodeId, sessionInfo));
                return null;
View Full Code Here

    /**
     * @see RepositoryService#checkpoint(SessionInfo, NodeId)
     */
    public NodeId checkpoint(SessionInfo sessionInfo, NodeId nodeId) throws UnsupportedRepositoryOperationException, RepositoryException {
        // TODO review again.
        NodeId vID = checkin(sessionInfo, nodeId);
        checkout(sessionInfo, nodeId);
        return vID;
    }
View Full Code Here

                relPath = (path.isAbsolute()) ? getPathFactory().getRootPath().computeRelativePath(path) : path;
            } else {
                int degree = 0;
                while (degree < path.getLength()) {
                    Path ancestorPath = path.getAncestor(degree);
                    NodeId parentId = idFactory.createNodeId(nodeId.getUniqueID(), ancestorPath);
                    if (exists(sessionInfo, getItemUri(parentId, sessionInfo))) {
                        uri = getItemUri(parentId, sessionInfo);
                        relPath = ancestorPath.computeRelativePath(path);
                        break;
                    }
View Full Code Here

                }
            } catch (RepositoryException e) {
                log.warn("Unable to build event itemId: ", e.getMessage());
            }
            String parentHref = Text.getRelativeParent(href, 1, true);
            NodeId parentId = null;
            try {
                parentId = uriResolver.getNodeId(parentHref, sessionInfo);
            } catch (RepositoryException e) {
                log.warn("Unable to build event parentId: ", e.getMessage());
            }
View Full Code Here

                        relPath = (path.isAbsolute()) ? getPathFactory().getRootPath().computeRelativePath(nodeId.getPath()) : path;
                    } else {
                        int degree = 0;
                        while (degree < path.getLength()) {
                            Path ancestorPath = path.getAncestor(degree);
                            NodeId parentId = idFactory.createNodeId(nodeId.getUniqueID(), ancestorPath);
                            if (hasNode(sessionInfo, parentId)) {
                                n = getNode(parentId, sInfo);
                                relPath = ancestorPath.computeRelativePath(path);
                            }
                            degree++;
View Full Code Here

TOP

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

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.