Package org.apache.jackrabbit.spi

Examples of org.apache.jackrabbit.spi.NodeId


        /**
         * @inheritDoc
         * @see OperationVisitor#visit(RemoveVersion)
         */
        public void visit(RemoveVersion operation) throws VersionException, AccessDeniedException, ReferentialIntegrityException, RepositoryException {
            NodeId versionId = (NodeId) operation.getRemoveId();
            NodeState vhState = operation.getParentState();
            service.removeVersion(sessionInfo, (NodeId) vhState.getWorkspaceId(), versionId);
        }
View Full Code Here


        /**
         * @see OperationVisitor#visit(CreateActivity)
         */
        public void visit(CreateActivity operation) throws RepositoryException {
            NodeId activityId = service.createActivity(sessionInfo, operation.getTitle());
            operation.setNewActivityId(activityId);
        }
View Full Code Here

        /**
         * @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

        boolean progress = true;
        while (!addEvents.isEmpty() && progress) {
            progress = false;
            for (Iterator<Event> it = addEvents.iterator(); it.hasNext();) {
                Event ev = it.next();
                NodeId parentId = ev.getParentId();
                HierarchyEntry parent = null;
                if (parentId != null) {
                    parent = hierarchyMgr.lookup(parentId);
                    if (parent == null && ev.getPath() != null && parentId.getUniqueID() != null) {
                        // parentID contains a uniqueID part -> try to lookup
                        // the parent by path.
                        try {
                            Path parentPath = ev.getPath().getAncestor(1);
                            parent = hierarchyMgr.lookup(parentPath);
                        } catch (RepositoryException e) {
                            // should not occur
                            log.debug(e.getMessage());
                        }
                    }
                }
                if (parent != null && parent.denotesNode()) {
                    ((NodeEntry) parent).refresh(ev);
                    it.remove();
                    progress = true;
                }
            }
        }

        /* process all other events (removal, property changed) */
        for (Event event : events) {
            int type = event.getType();

            NodeId parentId = event.getParentId();
            NodeEntry parent = (parentId != null) ? (NodeEntry) hierarchyMgr.lookup(parentId) : null;
            switch (type) {
                case Event.NODE_REMOVED:
                case Event.PROPERTY_REMOVED:
                    // notify parent about removal if its child-entry.
View Full Code Here

                    if (v != null) {
                        score = v.getDouble();
                    }
                    scores.put(this.selectorNames[i], score);
                } else if (jcrPath.equals(names[i])) {
                    NodeId id = null;
                    if (v != null) {
                        id = idFactory.createNodeId((String) null, v.getPath());
                    }
                    nodeIds.put(this.selectorNames[i], id);
                }
View Full Code Here

            }
        }
    }

    public NodeId getNodeId(Name selectorName) {
        NodeId id = nodeIds.get(selectorName);
        if (id == null) {
            if (nodeIds.size() == 1) {
                return nodeIds.values().iterator().next();
            } else {
                throw new IllegalArgumentException(selectorName + " is not a valid selectorName");
View Full Code Here

    NodeId buildNodeId(NodeId parentId, MultiStatusResponse response,
                       String workspaceName, NamePathResolver resolver) throws RepositoryException {
        IdURICache cache = getCache(workspaceName);
       
        NodeId nodeId;
        DavPropertySet propSet = response.getProperties(DavServletResponse.SC_OK);

        String uniqueID = service.getUniqueID(propSet);
        if (uniqueID != null) {
            nodeId = service.getIdFactory().createNodeId(uniqueID);
View Full Code Here

                return (NodeId) id;
            }
        }

        // retrieve parentId from cache or by recursive calls
        NodeId parentId;
        if (isSameURI(uri, getRootItemUri(sessionInfo.getWorkspaceName()))) {
            parentId = null;
        } else {
            String parentUri = Text.getRelativeParent(uri, 1, true);
            parentId = getNodeId(parentUri, sessionInfo);
View Full Code Here

        // separate parent uri and property JCRName
        String parentUri = Text.getRelativeParent(uri, 1, true);
        // make sure propName is unescaped
        String propName = Text.unescape(Text.getName(uri, true));
        // retrieve parent node id
        NodeId parentId = getNodeId(parentUri, sessionInfo);
        // build property id
        try {
            Name name = service.getNamePathResolver(sessionInfo).getQName(propName);
            PropertyId propertyId = service.getIdFactory().createPropertyId(parentId, name);
            cache.add(uri, propertyId);
View Full Code Here

                throw new IllegalStateException("Type not set");
            }
            else {
                stale = true;

                NodeId parentId = parent.getId();
                Name propertyName = NameFactoryImpl.getInstance().create(Name.NS_DEFAULT_URI, this.name);
                Path path = PathFactoryImpl.getInstance().create(parentId.getPath(), propertyName, true);
                PropertyId id = IdFactoryImpl.getInstance().createPropertyId(parentId, propertyName);

                propertyInfo = new PropertyInfoImpl(path, id, type, isMultivalued,
                        values.toArray(new QValue[values.size()]));
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.