}
for (Document source : coll) {
if (getTransactionRule() == TransactionRule.COMMIT_EVERY_SOURCE) {
txn = targetDb.startTransaction();
}
DateTime sourceLastMod = source.getLastModified();
// Object lookupKey = Factory.wrappedEvaluate(session, getSourceKeyFormula(), source);
Object lookupKey = getSourceKeyFormula().getValue(source);
DocumentCollection targetColl = targetView.getAllDocumentsByKey(lookupKey, true);
for (Document target : targetColl) {
// boolean targetDirty = false;
for (Map.Entry<Formula, String> entry : getSyncMap().entrySet()) {
String targetItemName = entry.getValue();
java.util.Vector<?> sourceValue = entry.getKey().getValue(source);
// Factory.wrappedEvaluate(session, entry.getKey(), source);
if (strategy == Strategy.CREATE_AND_REPLACE) {
target.replaceItemValue(targetItemName, sourceValue);
// targetDirty = true;
} else {
Item targetItem = target.getFirstItem(targetItemName);
if (strategy == Strategy.REPLACE_IF_NEWER) {
DateTime itemLastMod = targetItem.getLastModified();
if (sourceLastMod.isAfter(itemLastMod)) {
targetItem.setValues(sourceValue);
// targetDirty = true;
}
} else if (strategy == Strategy.REPLACE_ONLY) {