}
@Override
public ActionForward uploadDocuments(ActionMapping mapping, ActionForm form, HttpServletRequest request,
HttpServletResponse response) {
final PhdProgramCandidacyProcess process = getProcess(request);
if (!RenderUtils.getViewState("documentByType").isValid()) {
return uploadDocumentsInvalid(mapping, form, request, response);
}
final PhdProgramDocumentUploadBean uploadBean = getUploadBean();
if (!uploadBean.hasAnyInformation()) {
addErrorMessage(request, "message.no.documents.to.upload");
return uploadDocumentsInvalid(mapping, form, request, response);
}
try {
ExecuteProcessActivity.run(process.getIndividualProgramProcess(), UploadDocuments.class,
Collections.singletonList(uploadBean));
addSuccessMessage(request, "message.documents.uploaded.with.success");
} catch (final DomainException e) {
addErrorMessage(request, "message.no.documents.to.upload");