public ActionForward createCandidacyIdentification(ActionMapping mapping, ActionForm actionForm, HttpServletRequest request,
HttpServletResponse response) {
final PhdProgramCandidacyProcessBean bean = getCandidacyBean();
final PhdProgramPublicCandidacyHashCode hashCode =
PhdProgramPublicCandidacyHashCode.getOrCreatePhdProgramCandidacyHashCode(bean.getEmail());
if (hashCode.hasCandidacyProcess()) {
addErrorMessage(request, "error.PhdProgramPublicCandidacyHashCode.already.has.candidacy");
return prepareCreateCandidacyIdentification(mapping, actionForm, request, response);
}
sendSubmissionEmailForCandidacy(hashCode, request);
String url =
String.format("%s?hash=%s", EPFLPhdCandidacyProcessProperties.getConfiguration()
.getPublicCandidacySubmissionLink(), hashCode.getValue());
request.setAttribute("processLink", url);
return mapping.findForward("createCandidacyIdentificationSuccess");
}