Package org.fenixedu.academic.domain

Examples of org.fenixedu.academic.domain.ExecutionSemester


    public Object provide(Object source, Object obj) {
        final ManageEnrolmentsBean bean = (ManageEnrolmentsBean) source;

        final List<ExecutionSemester> result = new ArrayList<ExecutionSemester>();

        ExecutionSemester each = bean.getProcess().getExecutionYear().getFirstExecutionPeriod();
        while (each != null) {
            result.add(each);
            each = each.getNextExecutionPeriod();
        }

        Collections.sort(result, new ReverseComparator(ExecutionSemester.COMPARATOR_BY_SEMESTER_AND_YEAR));

        return result;
View Full Code Here


    @Override
    protected RuleResult executeEnrolmentVerificationWithRules(ICurricularRule curricularRule,
            IDegreeModuleToEvaluate sourceDegreeModuleToEvaluate, EnrolmentContext enrolmentContext) {

        final CurricularCourse curricularCourse = (CurricularCourse) curricularRule.getDegreeModuleToApplyRule();
        final ExecutionSemester executionSemester = enrolmentContext.getExecutionPeriod();

        if (!curricularCourse.hasAnyActiveContext(enrolmentContext.getExecutionPeriod())) {
            return RuleResult.createNA(sourceDegreeModuleToEvaluate.getDegreeModule());
        }

        if (isApproved(enrolmentContext, curricularCourse, executionSemester.getPreviousExecutionPeriod())) {
            if (sourceDegreeModuleToEvaluate.isEnroled()) {
                return RuleResult.createImpossible(sourceDegreeModuleToEvaluate.getDegreeModule(),
                        "curricularRules.ruleExecutors.AssertUniqueApprovalInCurricularCourseContextsExecutor.already.approved",
                        curricularCourse.getName());
            } else {
View Full Code Here

    @Override
    protected RuleResult executeEnrolmentWithRulesAndTemporaryEnrolment(final ICurricularRule curricularRule,
            final IDegreeModuleToEvaluate sourceDegreeModuleToEvaluate, final EnrolmentContext enrolmentContext) {
        final CurricularCourse curricularCourse = (CurricularCourse) curricularRule.getDegreeModuleToApplyRule();
        final ExecutionSemester executionSemester = enrolmentContext.getExecutionPeriod();

        if (!curricularCourse.hasAnyActiveContext(enrolmentContext.getExecutionPeriod())) {
            return RuleResult.createNA(sourceDegreeModuleToEvaluate.getDegreeModule());
        }

        if (isApproved(enrolmentContext, curricularCourse, executionSemester.getPreviousExecutionPeriod())) {
            if (sourceDegreeModuleToEvaluate.isEnroled()) {
                return RuleResult.createImpossible(sourceDegreeModuleToEvaluate.getDegreeModule(),
                        "curricularRules.ruleExecutors.AssertUniqueApprovalInCurricularCourseContextsExecutor.already.approved",
                        curricularCourse.getName());
            } else {
                return RuleResult.createFalse(sourceDegreeModuleToEvaluate.getDegreeModule(),
                        "curricularRules.ruleExecutors.AssertUniqueApprovalInCurricularCourseContextsExecutor.already.approved",
                        curricularCourse.getName());
            }

        } else if (hasEnrolmentWithEnroledState(enrolmentContext, curricularCourse,
                executionSemester.getPreviousExecutionPeriod())) {
            return RuleResult.createTrue(EnrolmentResultType.TEMPORARY, sourceDegreeModuleToEvaluate.getDegreeModule());

        } else {
            return RuleResult.createTrue(sourceDegreeModuleToEvaluate.getDegreeModule());
        }
View Full Code Here

        return accumulated;
    }

    private double calculateApprovedEcts(final EnrolmentContext enrolmentContext) {

        final ExecutionSemester executionSemester = enrolmentContext.getExecutionPeriod();
        final StandaloneCurriculumGroup group = enrolmentContext.getStudentCurricularPlan().getStandaloneCurriculumGroup();

        double approved = 0d;

        for (final CurriculumLine line : group.getChildCurriculumLines()) {
View Full Code Here

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

            final ExecutionSemester executionSemester = enrolmentContext.getExecutionPeriod();
            ectsCredits =
                    Double.valueOf(ectsCredits.doubleValue()
                            + curriculumModule.getEnroledEctsCredits(executionSemester.getPreviousExecutionPeriod())
                                    .doubleValue());

            if (rule.allowCredits(ectsCredits)) {
                return RuleResult.createTrue(EnrolmentResultType.TEMPORARY, sourceDegreeModuleToEvaluate.getDegreeModule());
View Full Code Here

        markSheet.editNormal(empty, getStudentEvalutionBean(), empty);
    }

    protected MarkSheet createMarkSheet() {
        CurricularCourse curricularCourse = getEnrolment().getCurricularCourse();
        ExecutionSemester executionSemester = getEnrolment().getExecutionPeriod();
        Teacher responsible = getExecutionCourseTeacher();
        Date evaluationDate = getDiscussed().toDate();
        MarkSheetType type = MarkSheetType.SPECIAL_AUTHORIZATION;

        if (responsible == null) {
View Full Code Here

    }

    protected boolean hasFutureEnrolment() {
        final Enrolment enrolment = getEnrolment();
        if (enrolment != null) {
            final ExecutionSemester executionSemester = enrolment.getExecutionPeriod();
            final CurricularCourse curricularCourse = enrolment.getCurricularCourse();
            final StudentCurricularPlan studentCurricularPlan = enrolment.getStudentCurricularPlan();
            for (final Enrolment otherEnrolment : studentCurricularPlan.getEnrolments(curricularCourse)) {
                if (otherEnrolment.getExecutionPeriod().isAfter(executionSemester)) {
                    return true;
View Full Code Here

    }

    private ExecutionSemester getExecutionSemester(HttpServletRequest request) {
        String academicIntervalString = (String) getFromRequest(request, "academicIntervalString");
        AcademicInterval academicInterval = AcademicInterval.getAcademicIntervalFromString(academicIntervalString);
        final ExecutionSemester executionSemester = (ExecutionSemester) ExecutionInterval.getExecutionInterval(academicInterval);
        return executionSemester;
    }
View Full Code Here

        return suroundingSpace == null ? null : SpaceUtils.isRoom(space) ? suroundingSpace : findSurroundingRoom(suroundingSpace);
    }

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

        final Spreadsheet spreadsheet = new Spreadsheet("ScheduleMap");
        spreadsheet.setHeader(BundleUtil.getString(Bundle.APPLICATION, "label.executionPeriod"));
        spreadsheet.setHeader(BundleUtil.getString(Bundle.APPLICATION, "label.executionYear"));
        spreadsheet.setHeader(BundleUtil.getString(Bundle.APPLICATION, "label.executionCourse"));
        spreadsheet.setHeader(BundleUtil.getString(Bundle.APPLICATION, "label.executionDegree"));
        spreadsheet.setHeader(BundleUtil.getString(Bundle.APPLICATION, "label.curricular.year"));
        spreadsheet.setHeader(BundleUtil.getString(Bundle.APPLICATION, "label.shift"));
        spreadsheet.setHeader(BundleUtil.getString(Bundle.APPLICATION, "label.shift.schedule"));
        spreadsheet.setHeader(BundleUtil.getString(Bundle.APPLICATION, "label.shift.schedule.hasAllocatedRooms"));
        spreadsheet.setHeader(BundleUtil.getString(Bundle.APPLICATION, "label.teacher.emails"));
        spreadsheet.setHeader(BundleUtil.getString(Bundle.APPLICATION, "label.comments"));

        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 Set<Integer> curricularYears = new TreeSet<Integer>();
                    for (final SchoolClass schoolClass : shift.getAssociatedClassesSet()) {
                        curricularYears.add(schoolClass.getAnoCurricular());
                    }
                    final StringBuilder curricularYearBuilder = new StringBuilder();
                    for (final Integer curricularYear : curricularYears) {
                        if (curricularYearBuilder.length() > 0) {
                            curricularYearBuilder.append(", ");
                        }
                        curricularYearBuilder.append(curricularYear);
                    }

                    final Row row = spreadsheet.addRow();
                    row.setCell(semester);
                    row.setCell(executionYear);
                    row.setCell(executionCourse.getName());
                    row.setCell(executionDegreeBuilder.toString());
                    row.setCell(curricularYearBuilder.toString());
                    row.setCell(shift.getNome());
                    row.setCell(shift.getLessonPresentationString().replace(';', '\n'));
                    row.setCell(hasRoomsAttributed(shift));
                    row.setCell(emailBuilder.toString());
                    row.setCell(shift.getComment() == null ? "" : shift.getComment());
                }
            }
        }

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

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

    }

    private void addEctsLabelContextRow(final Spreadsheet spreadsheet, final Context context, final ExecutionYear executionYear) {

        final Row row = spreadsheet.addRow();
        final ExecutionSemester executionSemester = getExecutionSemester(context, executionYear);
        final CurricularCourse curricular = (CurricularCourse) context.getChildDegreeModule();

        row.setCell(curricular.getDegree().getDegreeType().getLocalizedName());
        row.setCell(curricular.getDegree().getNameFor(executionSemester).getContent());
        row.setCell(curricular.getDegree().getSigla());
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.