Package org.fenixedu.academic.domain

Examples of org.fenixedu.academic.domain.ExecutionSemester


        return null;
    }

    public ActionForward downloadShiftAttendence(ActionMapping mapping, ActionForm form, HttpServletRequest request,
            HttpServletResponse response) throws IOException {
        final ExecutionSemester executionSemester = getExecutionSemester(request);
        final String executionYear = executionSemester.getExecutionYear().getYear();

        final Spreadsheet spreadsheet = new Spreadsheet("ShiftAttendenceMap");
        spreadsheet.setHeader(BundleUtil.getString(Bundle.APPLICATION, "label.shift"));
        spreadsheet.setHeader(BundleUtil.getString(Bundle.APPLICATION, "label.executionCourse"));
        spreadsheet.setHeader(BundleUtil.getString(Bundle.APPLICATION, "label.executionDegree"));
        spreadsheet.setHeader(BundleUtil.getString(Bundle.APPLICATION, "label.shift.schedule"));
        spreadsheet.setHeader(BundleUtil.getString(Bundle.APPLICATION, "label.lesson.room"));
        spreadsheet.setHeader(BundleUtil.getString(Bundle.APPLICATION, "label.number.students.enrolled"));

        for (final ExecutionCourse executionCourse : executionSemester.getAssociatedExecutionCoursesSet()) {
            final StringBuilder executionDegreeBuilder = new StringBuilder();
            for (final ExecutionDegree executionDegree : executionCourse.getExecutionDegrees()) {
                if (executionDegreeBuilder.length() > 0) {
                    executionDegreeBuilder.append("\n");
                }
                executionDegreeBuilder.append(executionDegree.getDegree().getSigla());
            }
            final StringBuilder emailBuilder = new StringBuilder();
            for (final Professorship professorship : executionCourse.getProfessorshipsSet()) {
                if (emailBuilder.length() > 0) {
                    emailBuilder.append("\n");
                }
                emailBuilder.append(professorship.getPerson().getEmailForSendingEmails());
            }

            for (final CourseLoad courseLoad : executionCourse.getCourseLoadsSet()) {
                for (final Shift shift : courseLoad.getShiftsSet()) {
                    final Row row = spreadsheet.addRow();
                    final StringBuilder roomBuilder = new StringBuilder();
                    final StringBuilder scheduleBuilder = new StringBuilder();
                    if (!shift.getAssociatedLessonsSet().isEmpty()) {
                        for (Iterator<Lesson> iterator = shift.getAssociatedLessonsSet().iterator(); iterator.hasNext();) {
                            Lesson lesson = iterator.next();
                            scheduleBuilder.append(WeekDay.getWeekDay(lesson.getDiaSemana()).getLabelShort());
                            scheduleBuilder.append(" ");
                            scheduleBuilder.append(lesson.getBeginHourMinuteSecond().toString("HH:mm"));
                            scheduleBuilder.append(" - ");
                            scheduleBuilder.append(lesson.getEndHourMinuteSecond().toString("HH:mm"));
                            if (lesson.hasSala()) {
                                roomBuilder.append(lesson.getSala().getName());
                            }
                            if (iterator.hasNext()) {
                                scheduleBuilder.append(" ; ");
                                roomBuilder.append(" ; ");
                            }
                        }
                    }

                    row.setCell(shift.getNome());
                    row.setCell(executionCourse.getName());
                    row.setCell(executionDegreeBuilder.toString());
                    row.setCell(scheduleBuilder.toString().replace(';', '\n'));
                    row.setCell(roomBuilder.toString().replace(';', '\n'));
                    row.setCell(shift.getStudentsSet().size());
                }
            }
        }

        response.setContentType("application/vnd.ms-excel");
        response.setHeader("Content-disposition", "attachment; filename=shiftAttendenceMap" + executionYear.replace('/', '_')
                + "_" + executionSemester.getSemester() + ".xls");

        final ServletOutputStream writer = response.getOutputStream();
        spreadsheet.exportToXLSSheet(writer);
        writer.flush();
        response.flushBuffer();
View Full Code Here


        if (rule.allowCredits(totalEctsCredits)) {
            return RuleResult.createTrue(sourceDegreeModuleToEvaluate.getDegreeModule());
        }

        final ExecutionSemester previousExecutionPeriod = enrolmentContext.getExecutionPeriod().getPreviousExecutionPeriod();
        totalEctsCredits =
                Double.valueOf(totalEctsCredits.doubleValue()
                        + curriculumGroup.getEnroledEctsCredits(previousExecutionPeriod).doubleValue());

        if (rule.allowCredits(totalEctsCredits)) {
View Full Code Here

        final DegreeModule degreeModule = rule.getExclusiveDegreeModule();

        if (degreeModule.isLeaf()) {
            final CurricularCourse curricularCourse = (CurricularCourse) degreeModule;
            final ExecutionSemester previousExecutionPeriod = enrolmentContext.getExecutionPeriod().getPreviousExecutionPeriod();

            if (isApproved(enrolmentContext, curricularCourse)
                    || hasEnrolmentWithEnroledState(enrolmentContext, curricularCourse, previousExecutionPeriod)) {

                if (isEnroled(enrolmentContext, (CurricularCourse) rule.getDegreeModuleToApplyRule(),
View Full Code Here

                    return createImpossibleRuleResult(rule, sourceDegreeModuleToEvaluate);
                }
                return createFalseRuleResult(rule, sourceDegreeModuleToEvaluate);
            }

            final ExecutionSemester previousExecutionPeriod = enrolmentContext.getExecutionPeriod().getPreviousExecutionPeriod();
            if (hasEnrolmentWithEnroledState(enrolmentContext, curricularCourse, previousExecutionPeriod)) {
                return RuleResult.createTrue(EnrolmentResultType.TEMPORARY, sourceDegreeModuleToEvaluate.getDegreeModule());
            }
        }
View Full Code Here

        spreadsheet.setHeader("Afiliação Presidente");
        spreadsheet.setHeader("Nota Dissertação");

        for (final Thesis thesis : rootDomainObject.getThesesSet()) {
            final Enrolment enrolment = thesis.getEnrolment();
            final ExecutionSemester executionSemester = enrolment.getExecutionPeriod();
            if (executionSemester.getExecutionYear() == executionYear) {
                final ThesisPresentationState thesisPresentationState =
                        ThesisPresentationState.getThesisPresentationState(thesis);

                final Degree degree = enrolment.getStudentCurricularPlan().getDegree();
                final DegreeType degreeType = degree.getDegreeType();
View Full Code Here

        if (classID != null) {
            request.setAttribute("classId", classID);
            return mapping.findForward("showEnrollmentPage");
        }

        final ExecutionSemester executionSemester = ExecutionSemester.readActualExecutionSemester();
        if (readAndSetSelectCoursesParameter(request) == null) {
            return prepareShiftEnrolmentInformation(mapping, request, registration, executionSemester);
        } else {
            return prepareSelectCoursesInformation(mapping, actionForm, request, registration, executionSemester);
        }
View Full Code Here

    @Override
    public YearMonthDay calculateConclusionDate() {
        YearMonthDay result = super.calculateConclusionDate();

        if (getRegistration().getWasTransition()) {
            final ExecutionSemester firstBolonhaTransitionExecutionPeriod =
                    ExecutionSemester.readFirstBolonhaTransitionExecutionPeriod();
            final YearMonthDay begin = firstBolonhaTransitionExecutionPeriod.getBeginDateYearMonthDay();

            if (result == null || result.isBefore(begin)) {
                result = begin;
            }
        }
View Full Code Here

        final DismissalBean dismissalBean = getRenderedObject("dismissalBean");
        dismissalBean.setDismissalType(DismissalType.CURRICULAR_COURSE_CREDITS);

        final DegreeCurricularPlan dcp = dismissalBean.getStudentCurricularPlan().getDegreeCurricularPlan();
        final ExecutionSemester actualEP = ExecutionSemester.readActualExecutionSemester();

        dismissalBean.setExecutionPeriod(dcp.hasExecutionDegreeFor(actualEP.getExecutionYear()) ? actualEP : dcp
                .getMostRecentExecutionYear().getFirstExecutionPeriod());

        request.setAttribute("dismissalBean", dismissalBean);

        return mapping.findForward("chooseEquivalents");
View Full Code Here

    private ActionForward getActionForwardForRegistration(ActionMapping mapping, HttpServletRequest request,
            final Registration registration) {

        final StudentCurricularPlan studentCurricularPlan = registration.getLastStudentCurricularPlan();
        final ExecutionSemester executionSemester = ExecutionSemester.readActualExecutionSemester();

        // ----------------------------------------------------------------------
        // ---------------------------------------------
        // TODO: refactor this code, should be more generic
        // ----------------------------------------------------------------------
View Full Code Here

    public ActionForward checkPermission(ActionMapping mapping, ActionForm form, HttpServletRequest request,
            HttpServletResponse response) {

        StudentCurricularPlan studentCurricularPlan = getStudentCurricularPlan(request);
        ExecutionSemester executionSemester = getExecutionPeriod(request);

        if (!hasStatute(studentCurricularPlan.getRegistration().getStudent(), executionSemester,
                studentCurricularPlan.getRegistration())) {
            if (!studentCurricularPlan.getRegistration().isSeniorStatuteApplicable(executionSemester.getExecutionYear())) {
                addActionMessage(request, "error.special.season.not.granted");
                request.setAttribute("studentCurricularPlan", studentCurricularPlan);
                request.setAttribute("executionPeriod", executionSemester);

                return mapping.findForward("showStudentEnrollmentMenu");
            }
            studentCurricularPlan.getRegistration().grantSeniorStatute(executionSemester.getExecutionYear());
        }

        request.setAttribute("action", getAction());
        request.setAttribute("bolonhaStudentEnrollmentBean", new SpecialSeasonBolonhaStudentEnrolmentBean(studentCurricularPlan,
                executionSemester));
View Full Code Here

TOP

Related Classes of org.fenixedu.academic.domain.ExecutionSemester

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.