Ejemplo n.º 1
0
  private void notifyJuryElements(PhdThesisProcess process) {

    for (final ThesisJuryElement juryElement : process.getThesisJuryElementsSet()) {

      if (juryElement.isDocumentValidated()) {
        continue;
      }

      if (!juryElement.isInternal()) {
        createExternalAccess(juryElement);
      }

      if (juryElement.getReporter().booleanValue()) {
        sendInitialAlertToReporter(process.getIndividualProgramProcess(), juryElement);
      } else {
        sendAlertToJuryElement(
            process.getIndividualProgramProcess(),
            juryElement,
            "message.phd.request.jury.reviews.external.access.jury.body");
      }
    }

    for (final ThesisJuryElement juryElement : process.getThesisJuryElementsSet()) {
      final PhdParticipant participant = juryElement.getParticipant();
      if (!juryElement.getReporter().booleanValue()) {
        continue;
      }

      new PhdReporterReviewAlert(process.getIndividualProgramProcess(), participant);
    }
  }
Ejemplo n.º 2
0
  @Override
  protected PhdThesisProcess executeActivity(
      PhdThesisProcess process, User userView, Object object) {

    final PhdThesisProcessBean bean = (PhdThesisProcessBean) object;

    if (bean.isToNotify()) {
      notifyJuryElements(process);
      sendAlertToJuryElement(
          process.getIndividualProgramProcess(),
          process.getPresidentJuryElement(),
          "message.phd.request.jury.reviews.external.access.jury.president.body");
    }

    if (process.getActiveState() != PhdThesisProcessStateType.WAITING_FOR_JURY_REPORTER_FEEDBACK) {
      process.createState(
          PhdThesisProcessStateType.WAITING_FOR_JURY_REPORTER_FEEDBACK, userView.getPerson(), "");
    }

    bean.setThesisProcess(process);
    if (process.getMeetingProcess() == null) {
      Process.createNewProcess(userView, PhdMeetingSchedulingProcess.class, bean);
    }

    return process;
  }
Ejemplo n.º 3
0
  @Override
  protected void activityPreConditions(PhdThesisProcess process, User userView) {

    if (!process.isJuryValidated()) {
      throw new PreConditionNotValidException();
    }

    if (process.hasState(PhdThesisProcessStateType.WAITING_FOR_JURY_REPORTER_FEEDBACK)) {
      throw new PreConditionNotValidException();
    }

    if (!process.isAllowedToManageProcess(userView)) {
      throw new PreConditionNotValidException();
    }
  }
Ejemplo n.º 4
0
  @Override
  protected void activityPreConditions(PhdThesisProcess process, IUserView userView) {

    if (!process.isJuryValidated()) {
      throw new PreConditionNotValidException();
    }

    if (process.getActiveState() != PhdThesisProcessStateType.WAITING_FOR_FINAL_GRADE) {
      throw new PreConditionNotValidException();
    }

    if (!process.isAllowedToManageProcess(userView)) {
      throw new PreConditionNotValidException();
    }
  }
Ejemplo n.º 5
0
 private int getDaysLeftForReview(PhdThesisProcess process) {
   return Days.daysBetween(
           process
               .getWhenJuryValidated()
               .plusDays(PhdReporterReviewAlert.getReporterReviewDeadlineDays()),
           new LocalDate())
       .getDays();
 }
Ejemplo n.º 6
0
  @Override
  protected void activityPreConditions(PhdThesisProcess process, IUserView userView) {

    if (!process.isJuryValidated()) {
      throw new PreConditionNotValidException();
    }

    if (!process.hasState(PhdThesisProcessStateType.WAITING_FOR_JURY_REPORTER_FEEDBACK)) {
      throw new PreConditionNotValidException();
    }

    if (process.isAllowedToManageProcess(userView)) {
      return;
    }

    if (!process.isParticipant(userView.getPerson())) {
      throw new PreConditionNotValidException();
    }

    final ThesisJuryElement element = process.getThesisJuryElement(userView.getPerson());
    if (element == null || !element.getReporter().booleanValue()) {
      throw new PreConditionNotValidException();
    }
  }
Ejemplo n.º 7
0
  @Override
  protected PhdThesisProcess executeActivity(
      PhdThesisProcess process, IUserView userView, Object object) {
    final PhdThesisProcessBean bean = (PhdThesisProcessBean) object;

    for (final PhdProgramDocumentUploadBean each : bean.getDocuments()) {
      if (each.hasAnyInformation()) {
        process.addDocument(each, userView.getPerson());
      }
    }

    checkParameters(bean);

    LocalDate conclusionDate = bean.getConclusionDate();
    process.setConclusionDate(conclusionDate);
    process.setFinalGrade(bean.getFinalGrade());

    if (!process.hasState(PhdThesisProcessStateType.CONCLUDED)) {
      process.createState(
          PhdThesisProcessStateType.CONCLUDED, userView.getPerson(), bean.getRemarks());
    }

    return process;
  }