Examples of ReferenceChangeTracker


Examples of org.apache.jackrabbit.core.util.ReferenceChangeTracker

        itemOps.verifyCanWrite(parentPath);
        importTarget = itemOps.getNodeState(parentPath);

        aborted = false;

        refTracker = new ReferenceChangeTracker();

        parents = new Stack();
        parents.push(importTarget);
    }
View Full Code Here

Examples of org.apache.jackrabbit.core.util.ReferenceChangeTracker

            throw new RepositoryException(msg, infe);
        }

        // 3. do copy operation (modify and store affected states)

        ReferenceChangeTracker refTracker = new ReferenceChangeTracker();

        // create deep copy of source node state
        NodeState newState = copyNodeState(srcState, srcPath, srcStateMgr, srcAccessMgr,
                destParentState.getNodeId(), flag, refTracker);

        // add to new parent
        destParentState.addChildNodeEntry(destName.getName(), newState.getNodeId());

        // adjust references that refer to uuid's which have been mapped to
        // newly generated uuid's on copy/clone
        Iterator<Object> iter = refTracker.getProcessedReferences();
        while (iter.hasNext()) {
            PropertyState prop = (PropertyState) iter.next();
            // being paranoid...
            if (prop.getType() != PropertyType.REFERENCE
                    && prop.getType() != PropertyType.WEAKREFERENCE) {
                continue;
            }
            boolean modified = false;
            InternalValue[] values = prop.getValues();
            InternalValue[] newVals = new InternalValue[values.length];
            for (int i = 0; i < values.length; i++) {
                NodeId adjusted = refTracker.getMappedId(values[i].getNodeId());
                if (adjusted != null) {
                    newVals[i] = InternalValue.create(adjusted);
                    modified = true;
                } else {
                    // reference doesn't need adjusting, just copy old value
                    newVals[i] = values[i];
                }
            }
            if (modified) {
                prop.setValues(newVals);
                stateMgr.store(prop);
            }
        }
        refTracker.clear();

        // store states
        stateMgr.store(newState);
        stateMgr.store(destParentState);
        return newState.getNodeId();
View Full Code Here

Examples of org.apache.jackrabbit.core.util.ReferenceChangeTracker

            throw new RepositoryException(msg, infe);
        }

        // 3. do copy operation (modify and store affected states)

        ReferenceChangeTracker refTracker = new ReferenceChangeTracker();

        // create deep copy of source node state
        NodeState newState = copyNodeState(srcState, srcPath, srcStateMgr, srcAccessMgr,
                destParentState.getNodeId(), flag, refTracker);

        // add to new parent
        destParentState.addChildNodeEntry(destName.getName(), newState.getNodeId());

        // change definition (id) of new node
        NodeDef newNodeDef =
                findApplicableNodeDefinition(destName.getName(),
                        srcState.getNodeTypeName(), destParentState);
        newState.setDefinitionId(newNodeDef.getId());

        // adjust references that refer to uuid's which have been mapped to
        // newly generated uuid's on copy/clone
        Iterator<Object> iter = refTracker.getProcessedReferences();
        while (iter.hasNext()) {
            PropertyState prop = (PropertyState) iter.next();
            // being paranoid...
            if (prop.getType() != PropertyType.REFERENCE
                    && prop.getType() != PropertyType.WEAKREFERENCE) {
                continue;
            }
            boolean modified = false;
            InternalValue[] values = prop.getValues();
            InternalValue[] newVals = new InternalValue[values.length];
            for (int i = 0; i < values.length; i++) {
                NodeId adjusted = refTracker.getMappedId(values[i].getNodeId());
                if (adjusted != null) {
                    newVals[i] = InternalValue.create(adjusted);
                    modified = true;
                } else {
                    // reference doesn't need adjusting, just copy old value
                    newVals[i] = values[i];
                }
            }
            if (modified) {
                prop.setValues(newVals);
                stateMgr.store(prop);
            }
        }
        refTracker.clear();

        // store states
        stateMgr.store(newState);
        stateMgr.store(destParentState);
        return newState.getNodeId();
View Full Code Here

Examples of org.apache.jackrabbit.core.util.ReferenceChangeTracker

        itemOps.verifyCanWrite(parentPath);
        importTarget = itemOps.getNodeState(parentPath);

        aborted = false;

        refTracker = new ReferenceChangeTracker();

        parents = new Stack<NodeState>();
        parents.push(importTarget);
    }
View Full Code Here

Examples of org.apache.jackrabbit.jcr2spi.util.ReferenceChangeTracker

            // check if import target is writable, not-locked and checked-out.
            int options = ItemStateValidator.CHECK_ACCESS | ItemStateValidator.CHECK_LOCK | ItemStateValidator.CHECK_VERSIONING;
            session.getValidator().checkIsWritable(importTarget, options);

            refTracker = new ReferenceChangeTracker();
            parents = new Stack();
            parents.push(importTarget);
        } catch (ItemNotFoundException e) {
            throw new PathNotFoundException(LogUtil.safeGetJCRPath(parentPath, session.getPathResolver()));
        }
View Full Code Here

Examples of org.apache.jackrabbit.jcr2spi.util.ReferenceChangeTracker

            // check if import target is writable, not-locked and checked-out.
            int options = ItemStateValidator.CHECK_ACCESS | ItemStateValidator.CHECK_LOCK | ItemStateValidator.CHECK_VERSIONING;
            session.getValidator().checkIsWritable(importTarget, options);

            refTracker = new ReferenceChangeTracker();
            parents = new Stack();
            parents.push(importTarget);
        } catch (ItemNotFoundException e) {
            throw new PathNotFoundException(LogUtil.safeGetJCRPath(parentPath, session.getPathResolver()));
        }
View Full Code Here

Examples of org.apache.jackrabbit.oak.spi.xml.ReferenceChangeTracker

        currentStateIdManager = new IdentifierManager(root);
        effectiveNodeTypeProvider = sessionContext.getWorkspace().getNodeTypeManager();
        definitionProvider = sessionContext.getWorkspace().getNodeTypeManager();
        // TODO: end

        refTracker = new ReferenceChangeTracker();

        parents = new Stack<Tree>();
        parents.push(importTargetTree);

        pItemImporters.clear();
View Full Code Here

Examples of org.apache.jackrabbit.oak.spi.xml.ReferenceChangeTracker

        currentStateIdManager = new IdentifierManager(root);
        effectiveNodeTypeProvider = sessionContext.getWorkspace().getNodeTypeManager();
        definitionProvider = sessionContext.getWorkspace().getNodeTypeManager();
        // TODO: end

        refTracker = new ReferenceChangeTracker();

        parents = new Stack<Tree>();
        parents.push(importTargetTree);

        pItemImporters.clear();
View Full Code Here

Examples of org.apache.jackrabbit.oak.spi.xml.ReferenceChangeTracker

        currentStateIdManager = new IdentifierManager(root);
        effectiveNodeTypeProvider = sessionContext.getWorkspace().getNodeTypeManager();
        definitionProvider = sessionContext.getWorkspace().getNodeTypeManager();
        // TODO: end

        refTracker = new ReferenceChangeTracker();

        parents = new Stack<Tree>();
        parents.push(importTargetTree);

        pItemImporters.clear();
View Full Code Here

Examples of org.apache.jackrabbit.oak.spi.xml.ReferenceChangeTracker

        accessManager = sessionContext.getAccessManager();

        currentStateIdManager = new IdentifierManager(root);
        baseStateIdManager = new IdentifierManager(sd.getContentSession().getLatestRoot());

        refTracker = new ReferenceChangeTracker();

        parents = new Stack<Tree>();
        parents.push(importTargetTree);

        pItemImporters.clear();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.