Пример #1
0
  @Checked("RolePredicates.MASTER_DEGREE_ADMINISTRATIVE_OFFICE_PREDICATE")
  @Service
  public static List run(
      InfoStudent infoStudent, Specialization specialization, StudentCurricularPlanState state)
      throws Exception {

    List infoStudentCurricularPlanList = new ArrayList();

    Registration registration =
        Registration.readStudentByNumberAndDegreeType(
            infoStudent.getNumber(), infoStudent.getDegreeType());
    if (registration == null) {
      return null;
    }
    List studentCurricularPlanList =
        registration.getStudentCurricularPlansBySpecialization(specialization);

    if (studentCurricularPlanList == null || studentCurricularPlanList.isEmpty()) {
      return null;
    }

    for (Iterator iter = studentCurricularPlanList.iterator(); iter.hasNext(); ) {
      StudentCurricularPlan studentCurricularPlan = (StudentCurricularPlan) iter.next();

      if (studentCurricularPlan != null && studentCurricularPlan.getIdInternal() != null) {
        infoStudentCurricularPlanList.add(
            InfoStudentCurricularPlan.newInfoFromDomain(studentCurricularPlan));
      }
    }

    return infoStudentCurricularPlanList;
  }
Пример #2
0
 private static InfoCandidateRegistration createNewInfoCandidateRegistration(
     MasterDegreeCandidate masterDegreeCandidate, StudentCurricularPlan studentCurricularPlan) {
   InfoCandidateRegistration infoCandidateRegistration = new InfoCandidateRegistration();
   infoCandidateRegistration.setInfoMasterDegreeCandidate(
       InfoMasterDegreeCandidateWithInfoPerson.newInfoFromDomain(masterDegreeCandidate));
   infoCandidateRegistration.setInfoStudentCurricularPlan(
       InfoStudentCurricularPlan.newInfoFromDomain(studentCurricularPlan));
   infoCandidateRegistration.setEnrolments(new ArrayList<InfoEnrolment>());
   Iterator<Enrolment> iteratorSCPs = studentCurricularPlan.getEnrolmentsSet().iterator();
   while (iteratorSCPs.hasNext()) {
     Enrolment enrolment = iteratorSCPs.next();
     infoCandidateRegistration.getEnrolments().add(InfoEnrolment.newInfoFromDomain(enrolment));
   }
   return infoCandidateRegistration;
 }