String parentKey = documentIdToNodeKeyString(sourceName, parentId);
parentKeys.add(parentKey);
}
// replace the id of each block (if they exist)
EditableDocument childrenInfo = writer.document().getDocument(DocumentTranslator.CHILDREN_INFO);
if (childrenInfo != null) {
String nextBlockKey = childrenInfo.getString(DocumentTranslator.NEXT_BLOCK);
if (!StringUtil.isBlank(nextBlockKey)) {
childrenInfo.setString(DocumentTranslator.NEXT_BLOCK, documentIdToNodeKeyString(sourceName, nextBlockKey));
}
String lastBlockKey = childrenInfo.getString(DocumentTranslator.LAST_BLOCK);
if (!StringUtil.isBlank(lastBlockKey)) {
childrenInfo.setString(DocumentTranslator.LAST_BLOCK, documentIdToNodeKeyString(sourceName, lastBlockKey));
}
}
// create the federated node key - external project back reference
if (externalDocumentKey != null) {
String projectedNodeKey = connectors.getProjectedNodeKey(externalDocumentKey);
if (!StringUtil.isBlank(projectedNodeKey)) {
parentKeys.add(projectedNodeKey);
}
}
writer.setParents(parentKeys);
// process each child in the same way
List<Document> updatedChildren = new ArrayList<Document>();
for (Document child : reader.getChildren()) {
EditableDocument childWithReplacedIds = replaceConnectorIdsWithNodeKeys(child, sourceName);
updatedChildren.add(childWithReplacedIds);
}
writer.setChildren(updatedChildren);
// process the properties to look for **INTERNAL** references ...