Search in sources :

Example 1 with AttachmentUpdateResponse

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;
}
Also used : AttachmentCriteria(org.jaffa.components.attachment.apis.data.AttachmentCriteria) AttachmentGraph(org.jaffa.components.attachment.apis.data.AttachmentGraph) AttachmentUpdateResponse(org.jaffa.components.attachment.apis.data.AttachmentUpdateResponse)

Aggregations

AttachmentCriteria (org.jaffa.components.attachment.apis.data.AttachmentCriteria)1 AttachmentGraph (org.jaffa.components.attachment.apis.data.AttachmentGraph)1 AttachmentUpdateResponse (org.jaffa.components.attachment.apis.data.AttachmentUpdateResponse)1