Package org.fenixedu.academic.service.services.exceptions

Examples of org.fenixedu.academic.service.services.exceptions.NonExistingServiceException


            throw new FenixServiceException("nullCurricularCourse");
        }

        final CurricularCourse curricularCourse = (CurricularCourse) FenixFramework.getDomainObject(curricularCourseCode);
        if (curricularCourse == null) {
            throw new NonExistingServiceException();
        }

        final Curriculum curriculum = curricularCourse.findLatestCurriculum();
        final InfoCurriculum infoCurriculum =
                (curriculum != null) ? InfoCurriculum.newInfoFromDomain(curriculum) : new InfoCurriculum();
View Full Code Here


public class ReadBranchesByDegreeCurricularPlan {

    public static List<InfoBranch> run(String idDegreeCurricularPlan) throws FenixServiceException {
        DegreeCurricularPlan degreeCurricularPlan = FenixFramework.getDomainObject(idDegreeCurricularPlan);
        if (degreeCurricularPlan == null) {
            throw new NonExistingServiceException();
        }

        Collection<Branch> allBranches = degreeCurricularPlan.getAreasSet();
        if (allBranches == null || allBranches.isEmpty()) {
            return null;
View Full Code Here

public class ReadExecutionCourseByID {

    protected InfoExecutionCourse run(String externalId) throws FenixServiceException {
        ExecutionCourse executionCourse = FenixFramework.getDomainObject(externalId);
        if (executionCourse == null) {
            throw new NonExistingServiceException();
        }

        return InfoExecutionCourse.newInfoFromDomain(executionCourse);
    }
View Full Code Here

    @Atomic
    public static InfoCurricularCourse run(String curricularCourseID) throws FenixServiceException {
        CurricularCourse curricularCourse = (CurricularCourse) FenixFramework.getDomainObject(curricularCourseID);

        if (curricularCourse == null) {
            throw new NonExistingServiceException();
        }

        return InfoCurricularCourse.newInfoFromDomain(curricularCourse);
    }
View Full Code Here

    protected List run(String executionDegreeCode, String studentCurricularPlanID) throws FenixServiceException {

        final StudentCurricularPlan studentCurricularPlan = FenixFramework.getDomainObject(studentCurricularPlanID);
        if (studentCurricularPlan == null) {
            throw new NonExistingServiceException("error.readStudentCurriculum.noStudentCurricularPlan");
        }

        final List<InfoEnrolment> result = new ArrayList<InfoEnrolment>(studentCurricularPlan.getEnrolmentsCount());
        for (final Enrolment enrolment : studentCurricularPlan.getEnrolmentsSet()) {
            result.add(InfoEnrolment.newInfoFromDomain(enrolment));
View Full Code Here

        DegreeCurricularPlan degreeCurricularPlan = FenixFramework.getDomainObject(degreeCurricularPlanID);

        Collection students = degreeCurricularPlan.getStudentCurricularPlansSet();

        if ((students == null) || (students.isEmpty())) {
            throw new NonExistingServiceException();
        }

        return (List) CollectionUtils.collect(students, new Transformer() {
            @Override
            public Object transform(Object arg0) {
View Full Code Here

    @Atomic
    public static List run(Integer studentNumber, DegreeType degreeType) throws ExcepcaoInexistente, FenixServiceException {

        Registration registration = Registration.readStudentByNumberAndDegreeType(studentNumber, degreeType);
        if (registration == null) {
            throw new NonExistingServiceException("student does not exist");
        }
        Collection<StudentCurricularPlan> studentCurricularPlans = registration.getStudentCurricularPlansSet();

        if ((studentCurricularPlans == null) || (studentCurricularPlans.size() == 0)) {
            throw new NonExistingServiceException();
        }

        Iterator iterator = studentCurricularPlans.iterator();
        List result = new ArrayList();

        // FIXME: There's a problem with data of the Graduation Students
        // For now only Master Degree Students can view their Curriculum

        while (iterator.hasNext()) {
            StudentCurricularPlan studentCurricularPlan = (StudentCurricularPlan) iterator.next();

            result.add(InfoStudentCurricularPlan.newInfoFromDomain(studentCurricularPlan));
        }

        if (result.size() == 0) {
            throw new NonExistingServiceException();
        }

        return result;
    }
View Full Code Here

    }

    private List cleanList(final List<Enrolment> enrolmentList) throws FenixServiceException {

        if (enrolmentList.isEmpty()) {
            throw new NonExistingServiceException();
        }

        Integer studentNumber = null;
        final List<InfoEnrolment> result = new ArrayList<InfoEnrolment>();
        for (final Enrolment enrolment : enrolmentList) {
View Full Code Here

                }
            }

            studentCurricularPlan.delete();
        } else {
            throw new NonExistingServiceException();
        }
    }
View Full Code Here

    protected void run(final String executionCourseId, final String teacherId, final Boolean responsibleFor, final Double hours)
            throws FenixServiceException {

        final ExecutionCourse executionCourse = FenixFramework.getDomainObject(executionCourseId);
        if (executionCourse == null) {
            throw new NonExistingServiceException("message.nonExisting.executionCourse", null);
        }

        final Teacher teacher = Teacher.readByIstId(teacherId);
        if (teacher == null) {
            throw new NonExistingServiceException("message.non.existing.teacher", null);
        }
        Professorship.create(responsibleFor, executionCourse, teacher, hours);
    }
View Full Code Here

TOP

Related Classes of org.fenixedu.academic.service.services.exceptions.NonExistingServiceException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.