private EntityCollection createMergeFailed(Map<String, String> failed, SessionChangesLog changes)
throws RepositoryException
{
EntityCollection res = new EntityCollection();
TransientPropertyData mergeFailed =
(TransientPropertyData)dataManager.getItemData(nodeData(), new QPathEntry(Constants.JCR_MERGEFAILED, 0),
ItemType.PROPERTY);
List<ValueData> mergeFailedRefs = new ArrayList<ValueData>();
int state = 0;
try
{
if (mergeFailed != null)
{
for (ValueData mfvd : mergeFailed.getValues())
{
mergeFailedRefs.add(new TransientValueData(mfvd.getAsByteArray()));
}
mergeFailed =
new TransientPropertyData(mergeFailed.getQPath(), mergeFailed.getIdentifier(),
mergeFailed.getPersistedVersion(), mergeFailed.getType(), mergeFailed.getParentIdentifier(),
mergeFailed.isMultiValued(), mergeFailedRefs);
state = ItemState.UPDATED;
}
else
{
mergeFailed =
TransientPropertyData.createPropertyData((NodeData)getData(), Constants.JCR_MERGEFAILED,
PropertyType.REFERENCE, true, mergeFailedRefs);
state = ItemState.ADDED;
}
nextFail : for (String identifier : failed.keySet())
{
NodeImpl versionable = (NodeImpl)session.getNodeByUUID(identifier);
res.add(versionable);
String offendingIdentifier = failed.get(identifier);
for (ValueData vd : mergeFailedRefs)
{
String mfIdentifier = new String(vd.getAsByteArray());