02-20-2015 11:11 AM
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;
}
02-20-2015 01:40 PM
02-24-2015 10:30 AM
02-24-2015 11:20 AM
02-26-2015 02:31 AM
03-03-2015 05:37 AM
03-11-2015 06:27 AM
cmisDocument.addToFolder(cmisTargetObj, false);
cmisDocument.removeFromFolder(cmisTargetObj);
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.