use of org.jaffa.components.attachment.apis.data.AttachmentUpdateResponse in project jaffa-framework by jaffa-projects.
the class AttachmentService method cloneAttachment.
public static AttachmentUpdateResponse cloneAttachment(UOW uow, String oldSerializedKey, String newSerializedKey) throws FrameworkException, ApplicationExceptions {
AttachmentService service = new AttachmentService();
AttachmentCriteria attachmentCriteria = new AttachmentCriteria();
attachmentCriteria.setSerializedKey(StringCriteriaField.getStringCriteriaField(CriteriaField.RELATIONAL_EQUALS, oldSerializedKey, null));
AttachmentGraph attachmentGraph = new AttachmentGraph();
attachmentGraph.setSerializedKey(newSerializedKey);
AttachmentUpdateResponse[] attachmentUpdateResponses = service.localCloneOrMassUpdate(attachmentCriteria, attachmentGraph, true, uow);
return attachmentUpdateResponses != null ? attachmentUpdateResponses[0] : null;
}
Aggregations