public ActionForward prepareStudentEnrolmentPostback(
      ActionMapping mapping,
      ActionForm actionForm,
      HttpServletRequest request,
      HttpServletResponse response) {
    ActionForward forward = prepareStudentEnrolment(mapping, actionForm, request, response);

    RenderUtils.invalidateViewState("student.enrolment.bean");
    RenderUtils.invalidateViewState("student.enrolment.bean.execution.semester");

    return forward;
  }
  public ActionForward createNewExportationCandidaciesForPasswordGenerationProcess(
      ActionMapping mapping,
      ActionForm form,
      HttpServletRequest request,
      HttpServletResponse response) {
    DgesBaseProcessBean bean = getRenderedBean();
    RenderUtils.invalidateViewState("importation.bean");
    RenderUtils.invalidateViewState("importation.bean.edit");

    DgesBaseProcessLauncher.launchExportationCandidaciesForPasswordGeneration(
        bean.getExecutionYear(), bean.getPhase());

    return list(mapping, form, request, response);
  }
  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 setEvaluations(
      ActionMapping mapping,
      ActionForm actionForm,
      HttpServletRequest request,
      HttpServletResponse response) {
    List<List<MarkSheetEnrolmentEvaluationBean>> evaluationsList = getCurriculumEntries();

    StudentCurricularPlan studentCurricularPlan = readStudentCurricularPlan(request);
    ExecutionSemester selectedSemester = readExecutionSemester(request);

    try {
      studentCurricularPlan.setEvaluationsForCurriculumValidation(evaluationsList);

      for (int i = 0; i < evaluationsList.size(); i++) {
        RenderUtils.invalidateViewState("set.evaluations.form." + i);
      }

    } catch (DomainException e) {
      if ("error.grade.invalid.grade".equals(e.getMessage())) {
        addActionMessage("grade-messages", request, "error.invalid.grade");
      } else {
        throw e;
      }
    }

    return prepareSetEvaluations(mapping, actionForm, request, response);
  }
  public ActionForward fillPrecedentInformationPostback(
      ActionMapping mapping,
      ActionForm actionForm,
      HttpServletRequest request,
      HttpServletResponse response) {

    // assuming that when using this method each individual candidacy bean
    // extends IndividualCandidacyProcessWithPrecedentDegreeInformationBean
    final IndividualCandidacyProcessWithPrecedentDegreeInformationBean bean =
        (IndividualCandidacyProcessWithPrecedentDegreeInformationBean)
            getIndividualCandidacyProcessBean();
    request.setAttribute(getIndividualCandidacyProcessBeanName(), bean);
    RenderUtils.invalidateViewState();

    if (bean.hasPrecedentDegreeType()) {
      if (bean.isExternalPrecedentDegreeType()) {
        bean.setPrecedentDegreeInformation(new PrecedentDegreeInformationBean());
      } else if (bean.hasPrecedentStudentCurricularPlan()) {
        createCandidacyPrecedentDegreeInformation(bean, bean.getPrecedentStudentCurricularPlan());
      } else {
        final List<StudentCurricularPlan> scps = bean.getPrecedentStudentCurricularPlans();
        if (scps.size() == 1) {
          createCandidacyPrecedentDegreeInformation(bean, scps.get(0));
          bean.setPrecedentStudentCurricularPlan(scps.get(0));
        }
      }
    }

    return mapping.findForward("fill-candidacy-information");
  }
Exemplo n.º 6
0
  @SuppressWarnings("unused")
  public ActionForward selectDegreeType(
      ActionMapping mapping,
      ActionForm actionForm,
      HttpServletRequest request,
      HttpServletResponse response) {
    ReportBean reportBean = getRenderedObject();

    DegreeType degreeType;
    ExecutionYear executionYear;
    if (reportBean == null) {
      degreeType = getDegreeType(request);
      executionYear = getExecutionYear(request);
      reportBean = new ReportBean();
      reportBean.setDegreeType(degreeType);
      reportBean.setExecutionYear(executionYear);
    } else {
      degreeType = reportBean.getDegreeType();
      executionYear = reportBean.getExecutionYear();
    }
    RenderUtils.invalidateViewState();

    request.setAttribute("reportBean", reportBean);
    request.setAttribute("queueJobList", getLatestJobs());
    countReports(request, degreeType, executionYear);
    return mapping.findForward("selectDegreeType");
  }
Exemplo n.º 7
0
  public ActionForward uploadFile(
      ActionMapping mapping,
      ActionForm form,
      HttpServletRequest request,
      HttpServletResponse response)
      throws Exception {

    IViewState viewState = RenderUtils.getViewState("upload");
    if (viewState == null) {
      return prepareFileUpload(mapping, form, request, response);
    }

    UnitFileUploadBean bean = (UnitFileUploadBean) viewState.getMetaObject().getObject();
    RenderUtils.invalidateViewState();

    if (!bean.getUnit().getAllowedPeopleToUploadFilesSet().contains(AccessControl.getPerson())) {
      return manageFiles(mapping, form, request, response);
    }

    try (InputStream stream = bean.getUploadFile()) {
      CreateUnitFile.run(
          ByteStreams.toByteArray(stream),
          bean.getFileName(),
          bean.getName(),
          bean.getDescription(),
          bean.getTags(),
          bean.getGroup(),
          getUnit(request),
          getLoggedPerson(request));
    } catch (DomainException | IOException e) {
      addActionMessage(request, e.getMessage());
    }
    return manageFiles(mapping, form, request, response);
  }
  public ActionForward prepareCreateNewImportationProcess(
      ActionMapping mapping,
      ActionForm form,
      HttpServletRequest request,
      HttpServletResponse response) {
    DgesBaseProcessBean bean = getRenderedBean();
    if (bean == null) {
      bean = new DgesBaseProcessBean(ExecutionYear.readCurrentExecutionYear());
    }

    RenderUtils.invalidateViewState("importation.bean");
    RenderUtils.invalidateViewState("importation.bean.edit");

    request.setAttribute("importationBean", bean);

    return mapping.findForward("prepare-create-new-process");
  }
  public ActionForward prepareCreateNewExportationCandidaciesForPasswordGenerationJob(
      ActionMapping mapping,
      ActionForm form,
      HttpServletRequest request,
      HttpServletResponse response) {
    DgesBaseProcessBean bean = getRenderedBean();
    if (bean == null) {
      bean = new DgesBaseProcessBean(ExecutionYear.readCurrentExecutionYear());
    }

    RenderUtils.invalidateViewState("importation.bean");
    RenderUtils.invalidateViewState("importation.bean.edit");

    request.setAttribute("importationBean", bean);

    return mapping.findForward(
        "prepare-create-new-exportation-candidacies-for-password-generation-job");
  }
 public ActionForward chooseServiceRequestTypePostBack(
     ActionMapping mapping,
     ActionForm actionForm,
     HttpServletRequest request,
     HttpServletResponse response) {
   request.setAttribute(
       "academicServiceRequestCreateBean", getRenderedObject("academicServiceRequestCreateBean"));
   RenderUtils.invalidateViewState();
   return mapping.findForward("prepareCreateServiceRequest");
 }
Exemplo n.º 11
0
 public ActionForward postback(
     ActionMapping mapping,
     ActionForm actionForm,
     HttpServletRequest request,
     HttpServletResponse response)
     throws Exception {
   FindPersonBean bean = getRenderedObject();
   RenderUtils.invalidateViewState();
   request.setAttribute("bean", bean);
   return mapping.findForward("findPerson");
 }
 public ActionForward searchAgainPersonForCandidacy(
     ActionMapping mapping,
     ActionForm actionForm,
     HttpServletRequest request,
     HttpServletResponse response) {
   final IndividualCandidacyProcessBean bean = getIndividualCandidacyProcessBean();
   request.setAttribute(getIndividualCandidacyProcessBeanName(), bean);
   bean.getChoosePersonBean().setFirstTimeSearch(true);
   bean.getChoosePersonBean().setPerson(null);
   RenderUtils.invalidateViewState();
   return mapping.findForward("prepare-create-new-process");
 }
  public ActionForward prepareSetEvaluations(
      ActionMapping mapping,
      ActionForm actionForm,
      HttpServletRequest request,
      HttpServletResponse response) {
    StudentCurricularPlan studentCurricularPlan = readStudentCurricularPlan(request);
    ExecutionSemester executionSemester = readExecutionSemester(request);

    RenderUtils.invalidateViewState("student.enrolment.bean");
    RenderUtils.invalidateViewState("student.enrolment.bean.execution.semester");

    request.setAttribute(
        "bolonhaStudentEnrollmentBean",
        readBolonhaStudentEnrollmentBean(
            request,
            studentCurricularPlan,
            executionSemester,
            null,
            CurricularRuleLevel.ENROLMENT_NO_RULES,
            true));

    java.util.List<java.util.List<MarkSheetEnrolmentEvaluationBean>> enrolmentEvaluationBeanList =
        new java.util.ArrayList<java.util.List<MarkSheetEnrolmentEvaluationBean>>();
    java.util.List<java.util.List<MarkSheetEnrolmentEvaluationBean>>
        finalEnrolmentEvaluationBeanList =
            new java.util.ArrayList<java.util.List<MarkSheetEnrolmentEvaluationBean>>();

    createTreeCurriculumModules(
        studentCurricularPlan,
        executionSemester,
        enrolmentEvaluationBeanList,
        finalEnrolmentEvaluationBeanList,
        null,
        false);

    request.setAttribute("finalEntriesList", finalEnrolmentEvaluationBeanList);
    request.setAttribute("entriesList", enrolmentEvaluationBeanList);

    return mapping.findForward("show-set-evaluations-form");
  }
  private void fillRequest(HttpServletRequest request, Candidacy candidacy) {
    if (RenderUtils.getViewState("candidacyDocuments") != null) {
      RenderUtils.invalidateViewState("candidacyDocuments");
    }
    List<CandidacyDocumentUploadBean> candidacyDocuments =
        new ArrayList<CandidacyDocumentUploadBean>();
    for (CandidacyDocument candidacyDocument : candidacy.getCandidacyDocuments()) {
      candidacyDocuments.add(new CandidacyDocumentUploadBean(candidacyDocument));
    }

    request.setAttribute("candidacyDocuments", candidacyDocuments);
    request.setAttribute("candidacy", candidacy);
  }
  public ActionForward prepareRegistrationConclusionProcess(
      ActionMapping mapping,
      ActionForm actionForm,
      HttpServletRequest request,
      HttpServletResponse response) {
    RenderUtils.invalidateViewState();

    final Registration registration = readRegistration(request);

    request.setAttribute(
        "registrationConclusionBean", buildRegistrationConclusionBean(registration));
    return mapping.findForward("registrationConclusion");
  }
Exemplo n.º 16
0
 public ActionForward deleteInquiryAnswer(
     ActionMapping mapping,
     ActionForm form,
     HttpServletRequest request,
     HttpServletResponse response)
     throws Exception {
   final CerimonyInquiryAnswer cerimonyInquiryAnswer =
       getDomainObject(request, "cerimonyInquiryAnswerId");
   final CerimonyInquiry cerimonyInquiry = cerimonyInquiryAnswer.getCerimonyInquiry();
   cerimonyInquiryAnswer.delete();
   RenderUtils.invalidateViewState();
   return forwardToInquiry(mapping, request, "viewAlumniCerimonyInquiry", cerimonyInquiry);
 }
 protected void invalidateDocumentFileRelatedViewStates() {
   List<IViewState> viewStates =
       new ArrayList<IViewState>(
           (List<IViewState>)
               RenderersRequestProcessorImpl.getCurrentRequest()
                   .getAttribute(LifeCycleConstants.VIEWSTATE_PARAM_NAME));
   if (viewStates != null) {
     for (IViewState state : viewStates) {
       if (state.getId().indexOf("individualCandidacyProcessBean.document.file") > -1) {
         RenderUtils.invalidateViewState(state.getId());
       }
     }
   }
 }
Exemplo n.º 18
0
  private void prepareNewJobResponse(HttpServletRequest request, GepReportFile job) {

    ReportBean reportBean = getRenderedObject();
    if (reportBean == null) {
      reportBean = new ReportBean();
      reportBean.setDegreeType(job.getDegreeType());
      reportBean.setExecutionYear(job.getExecutionYear());
    }
    RenderUtils.invalidateViewState();

    request.setAttribute("job", job);
    request.setAttribute("reportBean", reportBean);
    request.setAttribute("queueJobList", getLatestJobs());
  }
  public ActionForward prepareExecuteEditDocuments(
      ActionMapping mapping,
      ActionForm actionForm,
      HttpServletRequest request,
      HttpServletResponse response) {
    final IndividualCandidacyProcess process = getProcess(request);
    request.setAttribute(getIndividualCandidacyProcessBeanName(), process);
    CandidacyProcessDocumentUploadBean uploadBean = new CandidacyProcessDocumentUploadBean();
    uploadBean.setIndividualCandidacyProcess(process);
    request.setAttribute("candidacyDocumentUploadBean", uploadBean);

    RenderUtils.invalidateViewState("individualCandidacyProcessBean.document");

    return mapping.findForward("prepare-edit-candidacy-documents");
  }
 public ActionForward changeUnitType(
     ActionMapping mapping,
     ActionForm form,
     HttpServletRequest request,
     HttpServletResponse response)
     throws FenixServiceException {
   final ResultParticipationCreationBean bean = getRenderedObject("bean");
   ResearchResult result = bean.getResult();
   request.setAttribute("bean", bean);
   request.setAttribute("result", result);
   schemasStateAutomaton(request, result, bean, true);
   checkRolesInCreation(request);
   RenderUtils.invalidateViewState("bean");
   return mapping.findForward("editParticipation");
 }
  public ActionForward createNewImportationProcess(
      ActionMapping mapping,
      ActionForm form,
      HttpServletRequest request,
      HttpServletResponse response)
      throws Exception {
    DgesBaseProcessBean bean = getRenderedBean();
    RenderUtils.invalidateViewState("importation.bean");
    RenderUtils.invalidateViewState("importation.bean.edit");

    byte[] contents = bean.consumeStream();

    DgesStudentImportationFile file =
        DgesStudentImportationFile.create(
            contents,
            bean.getFilename(),
            bean.getExecutionYear(),
            bean.getCampus(),
            bean.getPhase());
    DgesBaseProcessLauncher.launchImportation(
        bean.getExecutionYear(), bean.getCampus(), bean.getPhase(), file);

    return list(mapping, form, request, response);
  }
 public ActionForward postbackSetPublic(
     ActionMapping mapping,
     ActionForm actionForm,
     HttpServletRequest request,
     HttpServletResponse response) {
   PartyContactBean contact = getRenderedObject("edit-contact");
   RenderUtils.invalidateViewState();
   if (contact.getVisibleToPublic().booleanValue()) {
     contact.setVisibleToStudents(Boolean.TRUE);
     contact.setVisibleToStaff(Boolean.TRUE);
   }
   contact.setVisibleToManagement(Boolean.TRUE);
   request.setAttribute("partyContact", contact);
   request.setAttribute("partyContactClass", contact.getContactName());
   return backToEditOrCreate(mapping, actionForm, request, response);
 }
Exemplo n.º 23
0
  public ActionForward chooseScientificJournal(
      ActionMapping mapping,
      ActionForm form,
      HttpServletRequest request,
      HttpServletResponse response) {
    MergeScientificJournalPageContainerBean researchActivityPageContainerBean =
        getRenderedObject("mergeList");
    ScientificJournal scientificJournal =
        (ScientificJournal) researchActivityPageContainerBean.getSelected();
    researchActivityPageContainerBean.setSelected(null);

    copyProperties(scientificJournal, researchActivityPageContainerBean);

    RenderUtils.invalidateViewState();
    request.setAttribute("mergeList", researchActivityPageContainerBean);
    return mapping.findForward("show-research-activity-merge-list");
  }
  public ActionForward preparePaymentUsingContributorPartyPostback(
      ActionMapping mapping,
      ActionForm form,
      HttpServletRequest request,
      HttpServletResponse response) {
    final PaymentsManagementDTO paymentsManagementDTO =
        (PaymentsManagementDTO) getObjectFromViewState("paymentsManagementDTO-edit");

    RenderUtils.invalidateViewState("paymentsManagementDTO-edit");

    paymentsManagementDTO.setContributorParty(null);
    paymentsManagementDTO.setContributorNumber(null);
    paymentsManagementDTO.setContributorName(null);

    request.setAttribute("paymentsManagementDTO", paymentsManagementDTO);

    return mapping.findForward("preparePayment");
  }
  public ActionForward list(
      ActionMapping mapping,
      ActionForm form,
      HttpServletRequest request,
      HttpServletResponse response) {

    DgesBaseProcessBean bean = getRenderedBean();
    if (bean == null) {
      bean = new DgesBaseProcessBean(ExecutionYear.readCurrentExecutionYear());
    }

    RenderUtils.invalidateViewState("importation.bean");
    request.setAttribute("importationBean", bean);

    request.setAttribute(
        "importationJobsDone", DgesStudentImportationProcess.readDoneJobs(bean.getExecutionYear()));
    request.setAttribute(
        "importationJobsPending",
        DgesStudentImportationProcess.readUndoneJobs(bean.getExecutionYear()));
    request.setAttribute(
        "exportationPasswordsDone",
        ExportDegreeCandidaciesByDegreeForPasswordGeneration.readDoneJobs(bean.getExecutionYear()));
    request.setAttribute(
        "exportationPasswordsPending",
        ExportDegreeCandidaciesByDegreeForPasswordGeneration.readUndoneJobs(
            bean.getExecutionYear()));
    request.setAttribute(
        "exportationAlreadyStudentsDone",
        ExportExistingStudentsFromImportationProcess.readDoneJobs(bean.getExecutionYear()));
    request.setAttribute(
        "exportionAlreadyStudentsPending",
        ExportExistingStudentsFromImportationProcess.readUndoneJobs(bean.getExecutionYear()));

    request.setAttribute(
        "canRequestJobImportationProcess", DgesStudentImportationProcess.canRequestJob());
    request.setAttribute(
        "canRequestJobExportationPasswords",
        ExportDegreeCandidaciesByDegreeForPasswordGeneration.canRequestJob());
    request.setAttribute(
        "canRequestJobExportationAlreadyStudents",
        ExportExistingStudentsFromImportationProcess.canRequestJob());

    return mapping.findForward("list");
  }
 public ActionForward prepareExecuteIntroduceCandidacyResult(
     ActionMapping mapping,
     ActionForm actionForm,
     HttpServletRequest request,
     HttpServletResponse response) {
   DegreeCandidacyForGraduatedPersonIndividualCandidacyResultBean bean = getRenderedObject();
   RenderUtils.invalidateViewState();
   if (bean == null || bean.getDegree() == null) {
     request.setAttribute(
         "individualCandidacyResultBean",
         new DegreeCandidacyForGraduatedPersonIndividualCandidacyResultBean(getProcess(request)));
   } else {
     request.setAttribute(
         "individualCandidacyResultBean",
         new DegreeCandidacyForGraduatedPersonIndividualCandidacyResultBean(
             getProcess(request), bean.getDegree()));
   }
   return mapping.findForward("introduce-candidacy-result");
 }
  public ActionForward enrolInDegreeModules(
      ActionMapping mapping,
      ActionForm form,
      HttpServletRequest request,
      HttpServletResponse response)
      throws FenixServiceException {

    final BolonhaStudentEnrollmentBean bolonhaStudentEnrollmentBean =
        getBolonhaStudentEnrollmentBeanFromViewState();
    try {
      final RuleResult ruleResults =
          EnrolBolonhaStudentInCurriculumValidationContext.run(
              bolonhaStudentEnrollmentBean.getStudentCurricularPlan(),
              bolonhaStudentEnrollmentBean.getExecutionPeriod(),
              bolonhaStudentEnrollmentBean.getDegreeModulesToEvaluate(),
              bolonhaStudentEnrollmentBean.getCurriculumModulesToRemove(),
              bolonhaStudentEnrollmentBean.getCurricularRuleLevel());

      if (!bolonhaStudentEnrollmentBean.getDegreeModulesToEvaluate().isEmpty()
          || !bolonhaStudentEnrollmentBean.getCurriculumModulesToRemove().isEmpty()) {
        addActionMessage("success", request, "label.save.success");
      }

      if (ruleResults.isWarning()) {
        addRuleResultMessagesToActionMessages("warning", request, ruleResults);
      }

    } catch (EnrollmentDomainException ex) {
      addRuleResultMessagesToActionMessages("error", request, ex.getFalseResult());

      return prepareStudentEnrolment(mapping, form, request, response);

    } catch (DomainException ex) {
      addActionMessage("error", request, ex.getKey(), ex.getArgs());

      return prepareStudentEnrolment(mapping, form, request, response);
    }

    RenderUtils.invalidateViewState();

    return prepareStudentEnrolment(mapping, form, request, response);
  }
 public ActionForward selectYear(
     ActionMapping mapping,
     ActionForm actionForm,
     HttpServletRequest request,
     HttpServletResponse response) {
   YearSelection yearSelection = getYearSelection(request);
   DegreeCurricularPlan dcp = getDegreeCurricularPlan(request);
   List<TutorshipIntentionSelector> selector = new ArrayList<TutorshipIntentionSelector>();
   for (Department department : dcp.getDegree().getDepartmentsSet()) {
     for (Teacher teacher : department.getAllTeachers(yearSelection.getExecutionYear())) {
       selector.add(
           new TutorshipIntentionSelector(
               teacher, department, dcp, yearSelection.getExecutionYear()));
     }
   }
   RenderUtils.invalidateViewState();
   request.setAttribute("yearSelection", yearSelection);
   request.setAttribute("selector", selector);
   return mapping.findForward("manage");
 }
Exemplo n.º 29
0
 public ActionForward sendEmail(
     ActionMapping mapping,
     ActionForm actionForm,
     HttpServletRequest request,
     HttpServletResponse response) {
   EmailBean emailBean = getRenderedObject("emailBean");
   RenderUtils.invalidateViewState();
   String validate = emailBean.validate();
   if (validate != null) {
     final String noneSentString =
         BundleUtil.getString(Bundle.APPLICATION, "error.email.none.sent");
     request.setAttribute("errorMessage", noneSentString + " " + validate);
     request.setAttribute("emailBean", emailBean);
     return mapping.findForward("new.email");
   }
   final Message message = emailBean.send();
   request.setAttribute("created", Boolean.TRUE);
   return new FenixActionForward(
       request,
       new ActionForward(
           "/viewSentEmails.do?method=viewEmail&messagesId=" + message.getExternalId(), true));
 }
Exemplo n.º 30
0
 public ActionForward sessionPostback(
     ActionMapping mapping,
     ActionForm actionForm,
     HttpServletRequest request,
     HttpServletResponse response) {
   CandidateSearchBean search = getRenderedObject("search");
   RenderUtils.invalidateViewState();
   Interval interval = search.getSession().getCandidacyInterval();
   if (search.getCutStart() == null
       || !interval.contains(search.getCutStart().toDateTimeAtStartOfDay())) {
     search.setCutStart(interval.getStart().toLocalDate());
   }
   if (search.getCutEnd() == null
       || !interval.contains(search.getCutEnd().toDateTimeAtStartOfDay())) {
     search.setCutEnd(interval.getEnd().toLocalDate());
   }
   if (interval.contains(new LocalDate().minusDays(1).toDateMidnight())) {
     search.setCutEnd(new LocalDate().minusDays(1));
   }
   request.setAttribute("search", search);
   return mapping.findForward("candidates");
 }