use of org.apache.jackrabbit.jcr2spi.state.PropertyState in project jackrabbit by apache.
the class VersionManagerImpl method getVersionableNodeEntry.
public NodeEntry getVersionableNodeEntry(NodeState versionState) throws RepositoryException {
NodeState ns = versionState.getChildNodeState(NameConstants.JCR_FROZENNODE, Path.INDEX_DEFAULT);
PropertyState ps = ns.getPropertyState(NameConstants.JCR_FROZENUUID);
String uniqueID = ps.getValue().getString();
NodeId versionableId = workspaceManager.getIdFactory().createNodeId(uniqueID);
return workspaceManager.getHierarchyManager().getNodeEntry(versionableId);
}
use of org.apache.jackrabbit.jcr2spi.state.PropertyState in project jackrabbit by apache.
the class VersionManagerImpl method resolveMergeConflict.
public void resolveMergeConflict(NodeState nodeState, NodeState versionState, boolean done) throws RepositoryException {
NodeId vId = versionState.getNodeId();
PropertyState mergeFailedState = nodeState.getPropertyState(NameConstants.JCR_MERGEFAILED);
QValue[] vs = mergeFailedState.getValues();
NodeId[] mergeFailedIds = new NodeId[vs.length - 1];
for (int i = 0, j = 0; i < vs.length; i++) {
NodeId id = workspaceManager.getIdFactory().createNodeId(vs[i].getString());
if (!id.equals(vId)) {
mergeFailedIds[j] = id;
j++;
}
// else: the version id is being solved by this call and not
// part of 'jcr:mergefailed' any more
}
PropertyState predecessorState = nodeState.getPropertyState(NameConstants.JCR_PREDECESSORS);
vs = predecessorState.getValues();
int noOfPredecessors = (done) ? vs.length + 1 : vs.length;
NodeId[] predecessorIds = new NodeId[noOfPredecessors];
int i = 0;
while (i < vs.length) {
predecessorIds[i] = workspaceManager.getIdFactory().createNodeId(vs[i].getString());
i++;
}
if (done) {
predecessorIds[i] = vId;
}
Operation op = ResolveMergeConflict.create(nodeState, mergeFailedIds, predecessorIds, done);
workspaceManager.execute(op);
}
Aggregations