@Override public List<ExecutionCourse> getExecutionCourses() { SortedSet<ExecutionCourse> result = new TreeSet<ExecutionCourse>( ExecutionCourse.EXECUTION_COURSE_COMPARATOR_BY_EXECUTION_PERIOD_AND_NAME); Integer semester = getSemesterNumber(); for (ExecutionCourse executionCourse : getParentExecutionCourses()) { if (executionCourse.getExecutionPeriod().getSemester().equals(semester)) { result.add(executionCourse); } } return new ArrayList<ExecutionCourse>(result); }
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; }
public InfoExecutionPeriod run(Integer executionCourseCode) throws FenixServiceException { ExecutionCourse executionCourse = rootDomainObject.readExecutionCourseByOID(executionCourseCode); ExecutionSemester executionSemester = executionCourse.getExecutionPeriod(); return InfoExecutionPeriod.newInfoFromDomain(executionSemester); }
private String getTeachersAndTeachingHours(CurricularCourse course, boolean responsibleTeacher) { Map<Teacher, Double> responsiblesMap = new HashMap<Teacher, Double>(); List<ExecutionSemester> executionSemesters = getSelectedExecutionSemesters(); for (final ExecutionCourse executionCourse : course.getAssociatedExecutionCourses()) { if (executionSemesters.contains(executionCourse.getExecutionPeriod())) { for (Professorship professorhip : executionCourse.getProfessorshipsSet()) { if (professorhip.isResponsibleFor() == responsibleTeacher && professorhip .getPerson() .getTeacher() .isActiveOrHasAuthorizationForSemester(executionCourse.getExecutionPeriod())) { Double hours = responsiblesMap.get(professorhip.getTeacher()); if (hours == null) { hours = 0.0; } hours = hours + getHours(professorhip); responsiblesMap.put(professorhip.getTeacher(), hours); } } } } int counter = 1000; List<String> responsibles = new ArrayList<String>(); for (Teacher teacher : responsiblesMap.keySet()) { String responsible = teacher.getPerson().getName() + " (" + responsiblesMap.get(teacher) + ")"; counter -= JSONObject.escape(responsible + ", ").getBytes().length; responsibles.add(responsible); } if (!responsibleTeacher && course.isDissertation()) { Set<Teacher> teachers = new HashSet<Teacher>(); for (ExecutionCourse executionCourse : course.getAssociatedExecutionCoursesSet()) { if (executionCourse .getExecutionPeriod() .getExecutionYear() .equals(executionSemester.getExecutionYear().getPreviousExecutionYear())) { 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()); } } } } } } for (Teacher teacher : teachers) { String responsible = teacher.getPerson().getName() + " (0.0)"; if (counter - JSONObject.escape(responsible).getBytes().length < 0) { break; } if (!responsiblesMap.containsKey(teacher)) { counter -= JSONObject.escape(responsible + ", ").getBytes().length; responsibles.add(responsible); } } } return StringUtils.join(responsibles, ", "); }