public CopyToFile copyDocuments(List<String> originNodeRefs, String targetNodeRef, VersioningState versioningState) {
CopyToFile result = new CopyToFile();
Map<String, Object> properties = new HashMap<>();
List<String> listCopiesNodes = new ArrayList<String>();
SimpleDateFormat sdf = new SimpleDateFormat(DateUtil.DDMMYYYYHHMMSS);
String modified = "";
Session session = getSession();
ObjectId targetObj = session.createObjectId(targetNodeRef);
Iterator<String> it = originNodeRefs.iterator();
while (it.hasNext()) {
String originNodeRef = (String) it.next();
AlfrescoDocument originAlfDoc = (AlfrescoDocument) getObject(originNodeRef);
properties.put(PropertyIds.NAME, originCmisDoc.getName());
Iterator<ObjectType> aspects = originAlfDoc.getAspects().iterator();
String aspectIds = "";
while (aspects.hasNext()) {
aspectIds += ',';
aspectIds += aspects.next().getId();
}
properties.put(PropertyIds.OBJECT_TYPE_ID, originAlfDoc.getBaseTypeId().value() + aspectIds);
Document targetDoc = originAlfDoc.copy(targetObj, properties, versioningState, null, null, null, session.createOperationContext());
listCopiesNodes.add(targetDoc.getId());
modified = sdf.format(targetDoc.getLastModificationDate().getTime());
}
result.setListCopiesNodes(listCopiesNodes);
result.setModified(modified);
return result;
}
cmisDocument.addToFolder(cmisTargetObj, false);
cmisDocument.removeFromFolder(cmisTargetObj);
Content from pre 2016 and from language groups that have been closed.
Content is read-only.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.