Package org.apache.jackrabbit.core.id

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


            if (versionable && flag == COPY) {
                NodeId copiedFrom = null;
                if (fullVersionable) {
                    // base version of copied versionable node is reference value of
                    // the histories jcr:copiedFrom property
                    PropertyId propId = new PropertyId(srcState.getNodeId(), NameConstants.JCR_BASEVERSION);
                    PropertyState prop = (PropertyState) srcStateMgr.getItemState(propId);
                    copiedFrom = prop.getValues()[0].getNodeId();
                }
                VersionManager manager = session.getVersionManager();
                history = manager.getVersionHistory(session, newState, copiedFrom);
            }
            // copy properties
            for (Name propName : srcState.getPropertyNames()) {
                Path propPath = PathFactoryImpl.getInstance().create(srcPath, propName, true);
                if (!srcAccessMgr.canRead(propPath)) {
                    continue;
                }
                PropertyId propId = new PropertyId(srcState.getNodeId(), propName);
                PropertyState srcChildState =
                        (PropertyState) srcStateMgr.getItemState(propId);

                /**
                 * special handling required for properties with special semantics
View Full Code Here


        Set set = nodeState.getPropertyNames();
        PropertyState[] props = new PropertyState[set.size()];
        int i = 0;
        for (Iterator iter = set.iterator(); iter.hasNext();) {
            Name propName = (Name) iter.next();
            PropertyId propId = new PropertyId(nodeState.getNodeId(), propName);
            props[i++] = (PropertyState) stateMgr.getItemState(propId);
        }
        return props;
    }
View Full Code Here

     *
     * @param name
     * @return <code>true</code> if the given property exists.
     */
    public boolean hasProperty(Name name) {
        PropertyId propId = new PropertyId(nodeState.getNodeId(), name);
        return stateMgr.hasItemState(propId);
    }
View Full Code Here

     *
     * @param name
     * @return the values of the given property.
     */
    public InternalValue[] getPropertyValues(Name name) {
        PropertyId propId = new PropertyId(nodeState.getNodeId(), name);
        try {
            PropertyState ps = (PropertyState) stateMgr.getItemState(propId);
            return ps.getValues();
        } catch (ItemStateException e) {
            return null;
View Full Code Here

     *
     * @param name
     * @return the value of the given property.
     */
    public InternalValue getPropertyValue(Name name) {
        PropertyId propId = new PropertyId(nodeState.getNodeId(), name);
        try {
            PropertyState ps = (PropertyState) stateMgr.getItemState(propId);
            return ps.getValues()[0];
        } catch (ItemStateException e) {
            return null;
View Full Code Here

     * @throws RepositoryException
     */
    private PropertyState getOrCreatePropertyState(Name name, int type, boolean multiValued)
            throws RepositoryException {

        PropertyId propId = new PropertyId(nodeState.getNodeId(), name);
        if (stateMgr.hasItemState(propId)) {
            try {
                PropertyState propState = (PropertyState) stateMgr.getItemState(propId);
                // someone calling this method will always alter the property state, so set status to modified
                if (propState.getStatus() == ItemState.STATUS_EXISTING) {
View Full Code Here

        // remove properties
        Iterator iter = state.getPropertyNames().iterator();
        while (iter.hasNext()) {
            Name name = (Name) iter.next();
            PropertyId propId = new PropertyId(id, name);
            PropertyState propState = (PropertyState) stateMgr.getItemState(propId);
            stateMgr.destroy(propState);
        }
        state.removeAllPropertyNames();
View Full Code Here

    public boolean removeProperty(Name name) throws RepositoryException {
        try {
            if (!nodeState.hasPropertyName(name)) {
                return false;
            } else {
                PropertyId propId = new PropertyId(nodeState.getNodeId(), name);
                ItemState state = stateMgr.getItemState(propId);
                stateMgr.destroy(state);
                nodeState.removePropertyName(name);
                nodeState.setStatus(ItemState.STATUS_EXISTING_MODIFIED);
                return true;
View Full Code Here

            // first store all transient properties
            Set props = state.getPropertyNames();
            for (Iterator iter = props.iterator(); iter.hasNext();) {
                Name propName = (Name) iter.next();
                PropertyState pstate = (PropertyState) stateMgr.getItemState(
                        new PropertyId(state.getNodeId(), propName));
                if (pstate.getStatus() != ItemState.STATUS_EXISTING) {
                    stateMgr.store(pstate);
                }
            }
            // now store all child node entries
View Full Code Here

            // first discard all all transient properties
            Set props = state.getPropertyNames();
            for (Iterator iter = props.iterator(); iter.hasNext();) {
                Name propName = (Name) iter.next();
                PropertyState pstate = (PropertyState) stateMgr.getItemState(
                        new PropertyId(state.getNodeId(), propName));
                if (pstate.getStatus() != ItemState.STATUS_EXISTING) {
                    pstate.discard();
                }
            }
            // now reload all child node entries
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.