Exemplo n.º 1
0
  @Override
  public ActionForward execute(
      ActionMapping mapping,
      ActionForm form,
      HttpServletRequest request,
      HttpServletResponse response)
      throws Exception {
    ActionForward actionForward = super.execute(mapping, form, request, response);
    // Following is for committee lookup - edit committee
    CommitteeFormBase committeeForm = ((CommitteeFormBase) form);
    String commandParam = request.getParameter(KRADConstants.PARAMETER_COMMAND);
    if (StringUtils.isNotBlank(commandParam)
        && commandParam.equals("initiate")
        && StringUtils.isNotBlank(request.getParameter(COMMITTEE_ID))) {
      CommitteeBase committee =
          getCommitteeService().getLightVersion(request.getParameter(COMMITTEE_ID));
      CommitteeDocumentBase committeeDocument = committeeForm.getCommitteeDocument();
      committeeDocument.setCommittee(committee);
      committee.setCommitteeDocument(committeeDocument);
    }

    committeeForm.getCommitteeHelper().prepareView();

    return actionForward;
  }
Exemplo n.º 2
0
  /**
   * Delete a Research Area from a CommitteeBase.
   *
   * @param mapping
   * @param form
   * @param request
   * @param response
   * @return
   * @throws Exception
   */
  public ActionForward deleteResearchArea(
      ActionMapping mapping,
      ActionForm form,
      HttpServletRequest request,
      HttpServletResponse response)
      throws Exception {

    CommitteeFormBase committeeForm = (CommitteeFormBase) form;
    CommitteeDocumentBase committeeDocument = committeeForm.getCommitteeDocument();
    CommitteeBase committee = committeeDocument.getCommittee();

    CommitteeTaskBase task = getNewCommitteeTaskInstanceHook(TaskName.MODIFY_COMMITTEE, committee);
    if (isAuthorized(task)) {
      committee.getCommitteeResearchAreas().remove(getLineToDelete(request));
    }
    // finally do validation and error reporting for inactive research areas
    getNewCommitteeDocumentRuleInstanceHook().validateCommitteeResearchAreas(committee);

    return mapping.findForward(Constants.MAPPING_BASIC);
  }