Package org.apache.jackrabbit.core.id

Examples of org.apache.jackrabbit.core.id.PropertyId


                if (stateMgr.inEditMode()) {
                    throw new RepositoryException("Unable to remove lock properties.");
                }
                stateMgr.edit();
                if (nodeState.hasPropertyName(NameConstants.JCR_LOCKOWNER)) {
                    PropertyState propState = (PropertyState) stateMgr.getItemState(new PropertyId(nodeId, NameConstants.JCR_LOCKOWNER));
                    nodeState.removePropertyName(NameConstants.JCR_LOCKOWNER);
                    stateMgr.destroy(propState);
                    stateMgr.store(nodeState);
                }

                if (nodeState.hasPropertyName(NameConstants.JCR_LOCKISDEEP)) {
                    PropertyState propState = (PropertyState) stateMgr.getItemState(new PropertyId(nodeId, NameConstants.JCR_LOCKISDEEP));
                    nodeState.removePropertyName(NameConstants.JCR_LOCKISDEEP);
                    stateMgr.destroy(propState);
                    stateMgr.store(nodeState);
                }
View Full Code Here


     * @throws ItemStateException
     */
    public PropertyState createTransientPropertyState(NodeId parentId, Name propName, int initialStatus)
            throws ItemStateException {

        PropertyId id = new PropertyId(parentId, propName);

        // check map; synchronized to ensure an entry is not created twice.
        synchronized (transientStore) {
            if (transientStore.containsKey(id)) {
                String msg = "there's already a property state instance with id " + id;
View Full Code Here

     * @throws ItemStateException
     */
    public PropertyState createTransientPropertyState(PropertyState overlayedState, int initialStatus)
            throws ItemStateException {

        PropertyId id = overlayedState.getPropertyId();

        // check map; synchronized to ensure an entry is not created twice.
        synchronized (transientStore) {
            if (transientStore.containsKey(id)) {
                String msg = "there's already a property state instance with id " + id;
View Full Code Here

                        continue;
                    }
                    if (!current.hasPropertyName(propertyName)) {
                        continue;
                    }
                    PropertyId propId = new PropertyId(
                            current.getNodeId(), propertyName);
                    PropertyState propState =
                            (PropertyState) ism.getItemState(propId);
                    InternalValue[] values = propState.getValues();
                    for (InternalValue value : values) {
View Full Code Here

            changes.added(targetNode);
        }

        // Copy all associated property states
        for (Name name : sourceNode.getPropertyNames()) {
            PropertyId id = new PropertyId(sourceNode.getNodeId(), name);
            PropertyState sourceState = source.load(id);
            PropertyState targetState = target.createNew(id);
            targetState.setDefinitionId(sourceState.getDefinitionId());
            targetState.setType(sourceState.getType());
            targetState.setMultiValued(sourceState.isMultiValued());
View Full Code Here

    public VirtualPropertyState createPropertyState(VirtualNodeState parent,
                                                    Name name, int type,
                                                    boolean multiValued)
            throws RepositoryException {
        PropDef def = getApplicablePropertyDef(parent, name, type, multiValued);
        PropertyId id = new PropertyId(parent.getNodeId(), name);
        VirtualPropertyState prop = new VirtualPropertyState(id);
        prop.setType(type);
        prop.setMultiValued(multiValued);
        prop.setDefinitionId(def.getId());
        return prop;
View Full Code Here

                    propState = stateMgr.createNew(NameConstants.JCR_LOCKOWNER, nodeId);
                    propState.setDefinitionId(def.getId());
                    propState.setType(PropertyType.STRING);
                    propState.setMultiValued(false);
                } else {
                    propState = (PropertyState) stateMgr.getItemState(new PropertyId(nodeId, NameConstants.JCR_LOCKOWNER));
                }
                propState.setValues(new InternalValue[] { InternalValue.create(lockOwner) });
                nodeState.addPropertyName(NameConstants.JCR_LOCKOWNER);
                stateMgr.store(nodeState);

                if (!nodeState.hasPropertyName(NameConstants.JCR_LOCKISDEEP)) {
                    PropDef def = helper.findApplicablePropertyDefinition(NameConstants.JCR_LOCKISDEEP, PropertyType.BOOLEAN, false, nodeState);
                    propState = stateMgr.createNew(NameConstants.JCR_LOCKISDEEP, nodeId);
                    propState.setDefinitionId(def.getId());
                    propState.setType(PropertyType.BOOLEAN);
                    propState.setMultiValued(false);
                } else {
                    propState = (PropertyState) stateMgr.getItemState(new PropertyId(nodeId, NameConstants.JCR_LOCKISDEEP));
                }
                propState.setValues(new InternalValue[] { InternalValue.create(isDeep) });
                nodeState.addPropertyName(NameConstants.JCR_LOCKISDEEP);
                stateMgr.store(nodeState);
View Full Code Here

                if (stateMgr.inEditMode()) {
                    throw new RepositoryException("Unable to remove lock properties.");
                }
                stateMgr.edit();
                if (nodeState.hasPropertyName(NameConstants.JCR_LOCKOWNER)) {
                    PropertyState propState = (PropertyState) stateMgr.getItemState(new PropertyId(nodeId, NameConstants.JCR_LOCKOWNER));
                    nodeState.removePropertyName(NameConstants.JCR_LOCKOWNER);
                    stateMgr.destroy(propState);
                    stateMgr.store(nodeState);
                }

                if (nodeState.hasPropertyName(NameConstants.JCR_LOCKISDEEP)) {
                    PropertyState propState = (PropertyState) stateMgr.getItemState(new PropertyId(nodeId, NameConstants.JCR_LOCKISDEEP));
                    nodeState.removePropertyName(NameConstants.JCR_LOCKISDEEP);
                    stateMgr.destroy(propState);
                    stateMgr.store(nodeState);
                }
View Full Code Here

        // references
        Collection<PropertyId> c = refs.getReferences();
        out.writeInt(c.size()); // count
        for (Iterator<PropertyId> iter = c.iterator(); iter.hasNext();) {
            PropertyId propId = iter.next();
            out.writeUTF(propId.toString());   // propertyId
        }
    }
View Full Code Here

                writer.write("<" + NODEREFERENCES_ELEMENT + " "
                        + TARGETID_ATTRIBUTE + "=\"" + refs.getId() + "\">\n");
                // write references (i.e. the id's of the REFERENCE properties)
                Iterator iter = refs.getReferences().iterator();
                while (iter.hasNext()) {
                    PropertyId propId = (PropertyId) iter.next();
                    writer.write("\t<" + NODEREFERENCE_ELEMENT + " "
                            + PROPERTYID_ATTRIBUTE + "=\"" + propId + "\"/>\n");
                }
                writer.write("</" + NODEREFERENCES_ELEMENT + ">\n");
            } finally {
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.core.id.PropertyId

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.