Esempio n. 1
0
  private void fillParticipant(
      String guiderRole,
      final PhdIndividualProgramProcess process,
      PhdParticipant phdParticipant,
      HSSFRow row) {
    String processNumber = process.getProcessNumber();
    String studentNumber =
        process.getStudent() != null ? process.getStudent().getNumber().toString() : "";
    String studentName = process.getPerson().getName();

    String participantName = phdParticipant.getName();
    String institution = phdParticipant.getWorkLocation();

    addCellValue(row, onNullEmptyString(processNumber), 0);
    addCellValue(row, onNullEmptyString(studentNumber), 1);
    addCellValue(row, onNullEmptyString(studentName), 2);
    addCellValue(row, onNullEmptyString(participantName), 3);
    addCellValue(row, onNullEmptyString(guiderRole), 4);
    addCellValue(row, onNullEmptyString(institution), 5);

    if (!phdParticipant.isTeacher()) {
      addCellValue(row, onNullEmptyString(null), 6);
      addCellValue(row, onNullEmptyString(null), 7);
      addCellValue(row, onNullEmptyString(null), 8);
    } else {
      InternalPhdParticipant internalPhdParticipant = (InternalPhdParticipant) phdParticipant;
      Teacher teacher = internalPhdParticipant.getTeacher();

      addCellValue(row, onNullEmptyString(teacher.getTeacherId()), 6);
      Department department = internalPhdParticipant.getDepartment();

      addCellValue(row, onNullEmptyString(department != null ? department.getCode() : ""), 7);
      addCellValue(row, onNullEmptyString(department != null ? department.getName() : ""), 8);
    }
  }
Esempio n. 2
0
  protected Set<Teacher> getTeachers(List<ExecutionSemester> executionSemesters) {
    Set<Teacher> teachers = new HashSet<Teacher>();
    ExecutionYear previousExecutionYear =
        executionSemester.getExecutionYear().getPreviousExecutionYear();
    for (final DegreeCurricularPlan degreeCurricularPlan : degree.getDegreeCurricularPlansSet()) {
      for (final CurricularCourse course : degreeCurricularPlan.getCurricularCourses()) {
        for (final ExecutionCourse executionCourse : course.getAssociatedExecutionCourses()) {
          if (executionSemesters.contains(executionCourse.getExecutionPeriod())) {
            for (Professorship professorhip : executionCourse.getProfessorshipsSet()) {
              if (professorhip
                  .getPerson()
                  .getTeacher()
                  .isActiveOrHasAuthorizationForSemester(executionCourse.getExecutionPeriod())) {
                teachers.add(professorhip.getPerson().getTeacher());
              }
            }
          }
          if (previousExecutionYear.equals(
              executionCourse.getExecutionPeriod().getExecutionYear())) {
            if (executionCourse.isDissertation()) {
              for (Attends attends : executionCourse.getAttends()) {
                if (attends.hasEnrolment() && attends.getEnrolment().getThesis() != null) {
                  for (ThesisEvaluationParticipant thesisEvaluationParticipant :
                      attends.getEnrolment().getThesis().getOrientation()) {
                    if (thesisEvaluationParticipant.getPerson().getTeacher() != null
                        && thesisEvaluationParticipant
                            .getPerson()
                            .getTeacher()
                            .isActiveOrHasAuthorizationForSemester(
                                executionCourse.getExecutionPeriod())) {
                      teachers.add(thesisEvaluationParticipant.getPerson().getTeacher());
                    }
                  }
                }
              }
            }
          }
        }
      }
    }

    PhdProgram phdProgram = degree.getPhdProgram();
    if (phdProgram != null) {
      for (PhdIndividualProgramProcess phdIndividualProgramProcess :
          phdProgram.getIndividualProgramProcesses()) {
        for (ExecutionSemester executionSemester : executionSemesters) {
          if (phdIndividualProgramProcess.isActive(
              executionSemester.getAcademicInterval().toInterval())) {
            for (PhdParticipant phdParticipant : phdIndividualProgramProcess.getParticipants()) {
              if (phdParticipant instanceof InternalPhdParticipant) {
                InternalPhdParticipant internalPhdParticipant =
                    (InternalPhdParticipant) phdParticipant;
                if (internalPhdParticipant.isGuidingOrAssistantGuiding()
                    && internalPhdParticipant.getPerson().getTeacher() != null
                    && internalPhdParticipant
                        .getPerson()
                        .getTeacher()
                        .isActiveOrHasAuthorizationForSemester(executionSemester)) {
                  teachers.add(internalPhdParticipant.getPerson().getTeacher());
                }
              }
            }
          }
        }
      }
    }
    return teachers;
  }