コード例 #1
0
  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);
  }
コード例 #2
0
  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);
    }
  }