public ActionForward createParticipator( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws FenixServiceException { ResearchResult result = getResultFromRequest(request); ResultParticipationCreationBean bean = (ResultParticipationCreationBean) RenderUtils.getViewState("beanForExternalPerson").getMetaObject().getObject(); if (bean.getOrganization() != null) { ExternalContract contract = InsertExternalPerson.run( new InsertExternalPerson.ServiceArguments( bean.getParticipatorName(), bean.getOrganization())); bean.setParticipator(contract.getPerson().getPersonName()); createParticipation(bean); } else { request.setAttribute("createUnit", true); request.setAttribute("duringCreation", true); request.setAttribute("bean", bean); setResParticipationRequestAttributes(request, result, bean); RenderUtils.invalidateViewState(); return mapping.findForward("editParticipation"); } return prepareEdit(mapping, form, request, response); }
public ActionForward unitWrapper( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws FenixServiceException { ResultParticipationCreationBean bean = (ResultParticipationCreationBean) RenderUtils.getViewState("beanForExternalPerson").getMetaObject().getObject(); if (bean.getOrganization() == null) { return createUnit(mapping, form, request, response); } else { return createParticipator(mapping, form, request, response); } }