public static List<ExecutionDegree> getAllByDegree(final Degree degree) { List<ExecutionDegree> result = new ArrayList<ExecutionDegree>(); for (ExecutionDegree executionDegree : Bennu.getInstance().getExecutionDegreesSet()) { if (executionDegree.getDegree() == degree) { result.add(executionDegree); } } return result; }
@Atomic public static InfoCandidateRegistration run( String candidateID, String branchID, Integer studentNumber, User userView) throws FenixServiceException { check(RolePredicates.MASTER_DEGREE_ADMINISTRATIVE_OFFICE_PREDICATE); MasterDegreeCandidate masterDegreeCandidate = FenixFramework.getDomainObject(candidateID); Person person = masterDegreeCandidate.getPerson(); checkCandidateSituation(masterDegreeCandidate.getActiveCandidateSituation()); // remove master degree candidate role person.removeRoleByType(RoleType.MASTER_DEGREE_CANDIDATE); // check if old student number is free checkOldStudentNumber(studentNumber, person); // create new student final ExecutionDegree executionDegree = masterDegreeCandidate.getExecutionDegree(); Registration registration = createNewRegistration(person, studentNumber, executionDegree.getDegree()); // person.addPersonRoles(Role.getRoleByRoleType(RoleType.STUDENT)); StudentCurricularPlan studentCurricularPlan = createNewStudentCurricularPlan(registration, branchID, masterDegreeCandidate); // person.addPersonRoles(Role.getRoleByRoleType(RoleType.STUDENT)); createEnrolments(userView, masterDegreeCandidate, studentCurricularPlan); updateCandidateSituation(masterDegreeCandidate); copyQualifications(masterDegreeCandidate, person); createGratuitySituation(masterDegreeCandidate, studentCurricularPlan); return createNewInfoCandidateRegistration(masterDegreeCandidate, studentCurricularPlan); }
@Override public int compare(ExecutionDegree o1, ExecutionDegree o2) { return o1.getDegree().getName().compareTo(o2.getDegree().getName()); }
@Override public int compare(ExecutionDegree o1, ExecutionDegree o2) { final int dcc = o1.getDegree().getSigla().compareTo(o2.getDegree().getSigla()); return dcc == 0 ? o1.getExternalId().compareTo(o2.getExternalId()) : dcc; }
@Override public int compare(ExecutionDegree o1, ExecutionDegree o2) { return Degree.COMPARATOR_BY_DEGREE_TYPE_AND_NAME_AND_ID.compare( o1.getDegree(), o2.getDegree()); }