Package pt.utl.ist.fenix.tools.util.excel.Spreadsheet

Examples of pt.utl.ist.fenix.tools.util.excel.Spreadsheet.Row


                        ThesisPresentationState.getThesisPresentationState(thesis);

                final Degree degree = enrolment.getStudentCurricularPlan().getDegree();
                final DegreeType degreeType = degree.getDegreeType();

                final Row row = spreadsheet.addRow();
                row.setCell(thesis.getStudent().getNumber().toString());
                row.setCell(thesis.getStudent().getPerson().getName());
                row.setCell(degreeType.getLocalizedName());
                row.setCell(degree.getPresentationName(executionYear));
                row.setCell(degree.getSigla());
                row.setCell(thesis.getTitle().getContent());
                row.setCell(thesisPresentationState.getName());

                if (thesis.getDiscussed() != null) {
                    row.setCell(thesis.getDiscussed().toDate().toString());
                }

                row.setCell(thesis.getThesisAbstractPt());
                row.setCell(thesis.getThesisAbstractEn());

                addTeacherRows(thesis, row, ThesisParticipationType.ORIENTATOR);
                addTeacherRows(thesis, row, ThesisParticipationType.COORIENTATOR);
                addTeacherRows(thesis, row, ThesisParticipationType.PRESIDENT);

                row.setCell(thesis.getMark());
            }
        }
        spreadsheet.exportToXLSSheet(writer);
    }
View Full Code Here


        result.setHeaders(new String[] { BundleUtil.getString(Bundle.APPLICATION, "label.name"),
                BundleUtil.getString(Bundle.APPLICATION, "label.identificationNumber"),
                BundleUtil.getString(Bundle.APPLICATION, "label.degrees") });

        for (final Over23IndividualCandidacyProcess candidacy : over23IndividualCandidacies) {
            final Row row = result.addRow();
            row.setCell(candidacy.getPersonalDetails().getName());
            row.setCell(candidacy.getPersonalDetails().getDocumentIdNumber());

            int count = 1;
            String degrees = "";
            for (final Degree degree : candidacy.getSelectedDegreesSortedByOrder()) {
                degrees += count++ + " - " + degree.getNameFor(candidacy.getCandidacyExecutionInterval()) + "\n";
            }
            row.setCell(degrees);
        }

        return result;
    }
View Full Code Here

        spreadsheet.setHeader("Estimativa total de trabalho");
    }

    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());
        row.setCell(curricular.getName(executionSemester));
        row.setCell(curricular.getNameEn(executionSemester));
        final CompetenceCourse competenceCourse = curricular.getCompetenceCourse();
        if (competenceCourse != null) {
            row.setCell(competenceCourse.getAcronym(executionSemester));
        } else {
            row.setCell("");
        }

        row.setCell(context.getCurricularYear());
        setSemesterAndDuration(row, context);
        row.setCell(curricular.hasCompetenceCourseLevel() ? curricular.getCompetenceCourseLevel().getLocalizedName() : "");
        row.setCell(curricular.getEctsCredits(executionSemester));

        row.setCell(getLanguage(curricular));
        row.setCell(getTeachers(curricular, executionSemester));
        row.setCell(curricular.getContactLoad(context.getCurricularPeriod(), executionSemester));

        row.setCell(normalize(curricular.getObjectives(executionSemester)));
        row.setCell(normalize(curricular.getObjectivesEn(executionSemester)));
        row.setCell(normalize(curricular.getProgram(executionSemester)));
        row.setCell(normalize(curricular.getProgramEn(executionSemester)));

        final BibliographicReferences references = getBibliographicReferences(curricular, executionSemester);
        if (references == null) {
            row.setCell(" ");
            row.setCell(" ");
        } else {
            row.setCell(normalize(getBibliographicReferences(references.getMainBibliographicReferences())));
            row.setCell(normalize(getBibliographicReferences(references.getSecondaryBibliographicReferences())));
        }

        row.setCell(normalize(curricular.getEvaluationMethod(executionSemester)));
        row.setCell(normalize(curricular.getEvaluationMethodEn(executionSemester)));

        row.setCell(curricular.getTotalLoad(context.getCurricularPeriod(), executionSemester));
    }
View Full Code Here

        for (final Degree degree : Degree.readNotEmptyDegrees()) {
            if (checkDegreeType(getDegreeType(), degree)) {
                if (isActive(degree)) {
                    for (final Registration registration : degree.getRegistrationsSet()) {
                        if (registration.isRegistered(getExecutionYear())) {
                            final Row row = spreadsheet.addRow();
                            row.setCell(registration.getNumber());
                            setDegreeCells(row, degree);

                            reportIngression(row, registration);

                            final Registration firstRegistration = findFirstRegistration(registration.getStudent());
                            reportIngression(row, firstRegistration);

                            if (registration.getRegistrationProtocol() != null) {
                                row.setCell(registration.getRegistrationProtocol().getCode());
                            } else {
                                row.setCell("");
                            }
                            row.setCell(Integer.toString(registration.getCurricularYear(getExecutionYear())));
                        }
                    }
                }
            }
        }
View Full Code Here

            }
        }
    }

    private void reportGraduate(final Spreadsheet sheet, final ConclusionProcess conclusionProcess) {
        final Row row = sheet.addRow();

        final Registration registration = conclusionProcess.getRegistration();
        final ExecutionYear ingression = conclusionProcess.getIngressionYear();
        final ExecutionYear conclusion = conclusionProcess.getConclusionYear();
        final LocalDate conclusionDate = conclusionProcess.getConclusionDate();

        row.setCell(registration.getNumber());
        row.setCell(registration.getName());
        setDegreeCells(row, registration.getDegree());
        if (conclusionProcess.isCycleConclusionProcess()) {
            row.setCell(((CycleConclusionProcess) conclusionProcess).getCycleType().getDescription());
        } else {
            row.setCell(StringUtils.EMPTY);
        }
        row.setCell(registration.getPrecedentDegreeConclusionGrade(SchoolLevelType.SECOND_CYCLE_BASIC_SCHOOL));
        row.setCell(registration.getEntryGrade() != null ? registration.getEntryGrade().toString() : StringUtils.EMPTY);
        row.setCell(ingression.getYear());
        row.setCell(conclusion == null ? StringUtils.EMPTY : conclusion.getYear());
        row.setCell(conclusionDate == null ? StringUtils.EMPTY : conclusionDate.toString("yyyy-MM-dd"));
        row.setCell(conclusion == null ? StringUtils.EMPTY : String.valueOf(ingression.getDistanceInCivilYears(conclusion) + 1));
        row.setCell(conclusionProcess.getFinalAverage());

        setPersonCells(registration, row);
    }
View Full Code Here

            final String identification = space.getName();
            final Space building = SpaceUtils.getSpaceBuilding(space);
            final String buildingName = building == null ? "" : building.getPresentationName();
            final boolean[][] slots = entry.getValue();

            final Row row = spreadsheet.addRow();
            row.setCell(buildingName);
            row.setCell(identification == null ? " " : identification);
            final String blueprintNumber = findClosestBlueprintNumber(space);
            row.setCell(blueprintNumber);
            if (SpaceUtils.isRoom(space)) {
                Optional<String> doorNumber = space.getMetadata("doorNumber");
                Optional<String> description = space.getMetadata("description");
                row.setCell(doorNumber.isPresent() ? doorNumber.get() : " ");
                row.setCell(description.isPresent() ? description.get() : " ");
            } else if (SpaceUtils.isRoomSubdivision(space)) {
                final Space room = findSurroundingRoom(space);
                if (room == null) {
                    row.setCell(" ");
                    row.setCell(" ");
                } else {
                    Optional<String> doorNumber = space.getMetadata("doorNumber");
                    Optional<String> description = space.getMetadata("description");
                    row.setCell(doorNumber.isPresent() ? doorNumber.get() : " ");
                    row.setCell(description.isPresent() ? description.get() : " ");
                }
            } else {
                row.setCell(" ");
                row.setCell(" ");
            }
            SpaceClassification classification = space.getClassification();
            if (classification == null) {
                row.setCell(" ");
            } else {
                row.setCell(classification.getAbsoluteCode() + " " + classification.getName().getContent());
            }

            for (int i = 0; i < WEEKDAY_COUNT; i++) {
                for (int j = 0; j < HOUR_COUNT; j++) {
                    row.setCell(Boolean.toString(slots[i][j]));
                }
            }
        }

        final ServletOutputStream writer = response.getOutputStream();
View Full Code Here

                        if (!shift.hasSchoolClassForDegreeType(getDegreeType())) {
                            continue;
                        }

                        Row row = spreadsheet.addRow();
                        row.setCell(executionSemester.getSemester());
                        row.setCell(executionCourse.getExternalId());
                        row.setCell(shift.getExternalId());
                        row.setCell(shift.getNome());
                        row.setCell(courseLoad.getType().name());
                        row.setCell(courseLoad.getTotalQuantity() != null ? courseLoad.getTotalQuantity().toPlainString()
                                .replace('.', ',') : StringUtils.EMPTY);
                        row.setCell(shift.getTotalHours() != null ? shift.getTotalHours().toPlainString().replace('.', ',') : StringUtils.EMPTY);
                        row.setCell(courseLoad.getShiftsSet().size());
                        row.setCell(String.valueOf(executionCourse.getOid()));

                    }
                }
            }
        }
View Full Code Here

                            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");
View Full Code Here

                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");
View Full Code Here

                        if (curricularCourse.getDegreeType().equals(getDegreeType())) {
                            for (ExecutionSemester semester : getExecutionYear().getExecutionPeriodsSet()) {
                                if (curricularCourse.isActive(semester)) {
                                    for (ExecutionCourse executionCourse : curricularCourse
                                            .getExecutionCoursesByExecutionPeriod(semester)) {
                                        final Row row = spreadsheet.addRow();
                                        investigate(curricularCourse, semester, row, executionCourse);
                                    }
                                } else {
                                    final Row row = spreadsheet.addRow();
                                    investigate(curricularCourse, semester, row, null);
                                }
                            }
                        }
                    }
View Full Code Here

TOP

Related Classes of pt.utl.ist.fenix.tools.util.excel.Spreadsheet.Row

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.