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

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


            error = new ActionError(ex.getMessage());
            property = error.getKey();
        } else {
            String[] args = null;
            if (ex instanceof FenixServiceException) {
                final FenixServiceException fenixServiceException = (FenixServiceException) ex;
                args = fenixServiceException.getArgs();
            }
            if (args == null) {
                error = new ActionError(ae.getKey(), ex.getMessage());
            } else {
                error = new ActionError(ae.getKey(), args);
View Full Code Here


            writer.flush();
            response.flushBuffer();

        } catch (IOException e) {
            throw new FenixServiceException();
        }
        return null;
    }
View Full Code Here

            spreadsheet.exportToXLSSheet(outputStream);
            outputStream.flush();
            response.flushBuffer();
        } catch (final IOException e) {
            throw new FenixServiceException(e);
        }
        return null;
    }
View Full Code Here

            spreadsheet.exportToXLSSheet(outputStream);
            outputStream.flush();

            response.flushBuffer();
        } catch (IOException e) {
            throw new FenixServiceException();
        }
    }
View Full Code Here

            executionYear = FenixFramework.getDomainObject(executionYearID);
        }

        final ExecutionSemester executionSemester = executionYear.getExecutionSemesterFor(semester);
        if (semester.intValue() != 0 && executionSemester == null) {
            throw new FenixServiceException("error.noExecutionPeriod");
        }

        final Department department = FenixFramework.getDomainObject(departmentId);
        if (department == null) {
            throw new FenixServiceException("error.noDepartment");
        }

        final List<Teacher> teachers = department.getAllCurrentTeachers();

        Iterator iter = teachers.iterator();
View Full Code Here

            } else {

                final Student student = studentCurricularPlan.getRegistration().getStudent();
                if (student.hasActiveRegistrationFor(cycleCourseGroupToEnrol.getParentDegreeCurricularPlan())) {
                    throw new FenixServiceException("error");
                }

                final MDCandidacy candidacy = createMDCandidacy(student, cycleCourseGroupToEnrol, executionSemester);
                final Registration newRegistration =
                        new Registration(student.getPerson(), cycleCourseGroupToEnrol.getParentDegreeCurricularPlan(), candidacy,
View Full Code Here

        final EnrolmentPreConditionResult result =
                StudentCurricularPlanEnrolmentPreConditions.checkPreConditionsToEnrol(studentCurricularPlan, executionSemester);

        if (!result.isValid()) {
            throw new FenixServiceException(result.message(), result.args());
        }
    }
View Full Code Here

        if (activeStudentCurricularPlans.isEmpty()) {
            throw new NoActiveStudentCurricularPlanOfCorrectTypeException();
        }

        boolean hasOneOpen = false;
        FenixServiceException toThrow = null;
        for (final StudentCurricularPlan studentCurricularPlan : activeStudentCurricularPlans) {
            final FenixServiceException exception = verify(studentCurricularPlan);
            hasOneOpen = hasOneOpen || exception == null;
            toThrow = exception == null ? toThrow : exception;
        }
        if (!hasOneOpen) {
            throw toThrow;
View Full Code Here

        }
    }

    private FenixServiceException verify(StudentCurricularPlan studentCurricularPlan) {
        final DegreeCurricularPlan degreeCurricularPlan = studentCurricularPlan.getDegreeCurricularPlan();
        FenixServiceException result = verify(degreeCurricularPlan);
        if (result == null) {
            return null;
        }
        for (final DegreeCurricularPlanEquivalencePlan equivalencePlan : degreeCurricularPlan.getTargetEquivalencePlansSet()) {
            final DegreeCurricularPlan otherDegreeCurricularPlan = equivalencePlan.getDegreeCurricularPlan();
View Full Code Here

    @Atomic
    public static Boolean run(final String executionDegreeId, final String username) throws FenixServiceException {

        final Person person = Person.readPersonByUsername(username);
        if (person == null) {
            throw new FenixServiceException("error.noUserForUsername");
        }

        final ExecutionDegree executionDegree = FenixFramework.getDomainObject(executionDegreeId);
        if (executionDegree == null) {
            throw new FenixServiceException("error.noExecutionDegree");
        }

        final Coordinator coordinator = executionDegree.getCoordinatorByTeacher(person);
        if (coordinator == null) {
            Coordinator.createCoordinator(executionDegree, person, Boolean.FALSE);
View Full Code Here

TOP

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

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.