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

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


        return headers;
    }

    private void fillSpreadSheet(final Spreadsheet spreadsheet, final AcademicInterval academicInterval) {
        for (final ExecutionCourse executionCourse : ExecutionCourse.filterByAcademicInterval(academicInterval)) {
            final Row row = spreadsheet.addRow();

            row.setCell(executionCourse.getNome());

            final StringBuilder responsibleForStringBuilder = new StringBuilder();
            final StringBuilder responsibleForEmailsStringBuilder = new StringBuilder();
            boolean isFirstResp = true;
            for (final Professorship professorship : executionCourse.getProfessorshipsSet()) {
                if (professorship.getResponsibleFor().booleanValue()) {
                    if (isFirstResp) {
                        isFirstResp = false;
                    } else {
                        responsibleForStringBuilder.append("; ");
                        responsibleForEmailsStringBuilder.append("; ");
                    }

                    final Teacher teacher = professorship.getTeacher();
                    responsibleForStringBuilder.append(teacher.getPerson().getUsername());

                    responsibleForStringBuilder.append(" ");

                    final Person person = teacher.getPerson();
                    responsibleForStringBuilder.append(person.getName());
                    responsibleForEmailsStringBuilder.append(person.getEmail());
                }
            }
            row.setCell(responsibleForStringBuilder.toString());

            final Map<Degree, Set<Integer>> degreeOccurenceMap = constructDegreeOccurenceMap(academicInterval, executionCourse);

            row.setCell(Integer.toString(degreeOccurenceMap.size()));

            final StringBuilder degreeStringBuilder = new StringBuilder();
            boolean isFirst = true;
            for (final Degree degree : degreeOccurenceMap.keySet()) {
                if (isFirst) {
                    isFirst = false;
                } else {
                    degreeStringBuilder.append("; ");
                }

                degreeStringBuilder.append(degree.getSigla());
            }
            row.setCell(degreeStringBuilder.toString());

            final StringBuilder degreeCurricularYearStringBuilder = new StringBuilder();
            isFirst = true;
            for (final Entry<Degree, Set<Integer>> entry : degreeOccurenceMap.entrySet()) {
                if (isFirst) {
                    isFirst = false;
                } else {
                    degreeCurricularYearStringBuilder.append("; ");
                }

                final Degree degree = entry.getKey();
                degreeCurricularYearStringBuilder.append(degree.getSigla());
                degreeCurricularYearStringBuilder.append('(');
                boolean isFirstYear = true;
                for (final Integer curricularYearInteger : entry.getValue()) {
                    if (isFirstYear) {
                        isFirstYear = false;
                    } else {
                        degreeCurricularYearStringBuilder.append(", ");
                    }
                    degreeCurricularYearStringBuilder.append(curricularYearInteger.toString());
                }
                degreeCurricularYearStringBuilder.append(')');
            }
            row.setCell(degreeCurricularYearStringBuilder.toString());

            final StringBuilder degreeTypeStringBuilder = new StringBuilder();
            final Set<DegreeType> degreeTypes = new TreeSet<DegreeType>();
            for (final Degree degree : degreeOccurenceMap.keySet()) {
                degreeTypes.add(degree.getDegreeType());
            }
            for (final DegreeType degreeType : degreeTypes) {
                if (degreeTypeStringBuilder.length() > 0) {
                    degreeStringBuilder.append(", ");
                }
                degreeTypeStringBuilder.append(degreeType);
            }
            row.setCell(degreeTypeStringBuilder.toString());

            row.setCell(responsibleForEmailsStringBuilder.toString());

            int enrolmentCount = 0;
            for (final Attends attends : executionCourse.getAttendsSet()) {
                if (attends.getEnrolment() != null) {
                    enrolmentCount++;
                }
            }
            row.setCell(enrolmentCount);

            row.setCell(executionCourse.getAttendsSet().size());
        }
    }
View Full Code Here


        }
    }

    private void addRow(Spreadsheet spreadsheet, Entry<Shift, Map<DegreeCurricularPlan, Integer>> shiftEntry,
            List<DegreeCurricularPlan> sorted) {
        final Row row = spreadsheet.addRow();

        int i = 0;
        row.setCell(i, shiftEntry.getKey().getNome());

        for (final DegreeCurricularPlan degreeCurricularPlan : sorted) {
            Integer count = shiftEntry.getValue().get(degreeCurricularPlan);
            count = (count != null) ? count : Integer.valueOf(0);
            row.setCell(++i, count.toString());
        }
    }
View Full Code Here

        spreadsheet.setHeader("Deslocado da residencia");
        spreadsheet.setHeader("Turnos");
    }

    private void addRow(final Spreadsheet spreadsheet, final StudentCandidacy candidacy) {
        final Row row = spreadsheet.addRow();
        final Person person = candidacy.getPerson();
        final ExecutionYear executionYear = ExecutionYear.readCurrentExecutionYear();

        row.setCell(candidacy.getActiveCandidacySituation().getSituationDate().toString("dd/MM/yyyy HH:mm"));
        row.setCell(candidacy.getRegistration().getIngression().getName());
        row.setCell(candidacy.getExecutionDegree().getDegree().getNameFor(executionYear).getContent());
        row.setCell(candidacy.getRegistration().getNumber().toString());
        row.setCell(person.getName());
        row.setCell(person.getDocumentIdNumber());

        row.setCell(candidacy.getDislocatedFromPermanentResidence() != null
                && candidacy.getDislocatedFromPermanentResidence().booleanValue() ? "Sim" : "Nao");
        row.setCell(person.getArea());
        row.setCell(person.getInstitutionalEmailAddressValue());
        row.setCell(getPersonalEmailAddress(person));
        row.setCell(getPhone(person));
        row.setCell(getMobilePhone(person));
        row.setCell(candidacy.getDislocatedFromPermanentResidence() != null
                && candidacy.getDislocatedFromPermanentResidence().booleanValue() ? "Sim" : "Nao");
        row.setCell(getShiftNames(candidacy));
    }
View Full Code Here

    }

    private void reportRaides(final Spreadsheet sheet, final Registration registration, List<Registration> registrationPath,
            ExecutionYear executionYear, final CycleType cycleType, final boolean concluded, final YearMonthDay conclusionDate) {

        final Row row =
                RaidesCommonReportFieldsWrapper.reportRaidesFields(sheet, registration, registrationPath, executionYear,
                        cycleType, concluded, conclusionDate, null, false);

        // Total de ECTS concluídos até ao fim do ano lectivo anterior ao que se referem os dados  no curso actual
        double totalEctsConcludedUntilPreviousYear = 0d;
        for (final CycleCurriculumGroup cycleCurriculumGroup : registration.getLastStudentCurricularPlan()
                .getInternalCycleCurriculumGrops()) {
            totalEctsConcludedUntilPreviousYear +=
                    cycleCurriculumGroup.getCreditsConcluded(executionYear.getPreviousExecutionYear());
        }

        // Total de ECTS necessários para a conclusão
        if (concluded) {
            row.setCell(0);
        } else {
            row.setCell(registration.getLastStudentCurricularPlan().getRoot().getDefaultEcts(executionYear)
                    - totalEctsConcludedUntilPreviousYear);
        }
    }
View Full Code Here

    }

    private void addRow(Spreadsheet spreadsheet, StudentCandidacy candidacy) {

        final Person person = candidacy.getPerson();
        final Row row = spreadsheet.addRow();

        row.setCell(candidacy.getActiveCandidacySituation().getSituationDate().toString("dd/MM/yyyy HH:mm"));
        row.setCell(candidacy.getExecutionDegree().getDegree().getNameFor(ExecutionYear.readCurrentExecutionYear()).getContent());
        row.setCell(candidacy.getRegistration().getStudent().getNumber());
        row.setCell(person.getName());
        row.setCell(getEntryGrade(candidacy));
        row.setCell(person.getArea());
        row.setCell(person.getDistrictSubdivisionOfResidence());
        row.setCell(person.getDistrictOfResidence());
        row.setCell(person.getInstitutionalEmailAddressValue());
        row.setCell(getPersonalEmailAddress(person));
        row.setCell(getPhone(person));
        row.setCell(getMobilePhone(person));
        row.setCell(BundleUtil.getString(Bundle.ACADEMIC, candidacy.getApplyForResidence() ? "label.yes" : "label.no"));
        row.setCell(candidacy.getNotesAboutResidenceAppliance().replaceAll("\n", " ").replaceAll("\r", " "));
    }
View Full Code Here

                        for (final ExecutionCourse executionCourse : curricularCourse.getAssociatedExecutionCoursesSet()) {
                            final ExecutionSemester executionSemester = executionCourse.getExecutionPeriod();
                            for (final DegreeModuleScope degreeModuleScope : curricularCourse.getDegreeModuleScopes()) {
                                if (degreeModuleScope.isActiveForExecutionPeriod(executionSemester)) {
                                    final DegreeCurricularPlan degreeCurricularPlan = curricularCourse.getDegreeCurricularPlan();
                                    final Row row = spreadsheet.addRow();

                                    row.setCell(competenceCourse.getName(executionSemester));
                                    row.setCell(degreeCurricularPlan.getName());
                                    row.setCell(degreeModuleScope.getCurricularYear());
                                    row.setCell(degreeModuleScope.getCurricularSemester());
                                }
                            }
                        }
                    }
                }
View Full Code Here

    protected Spreadsheet buildIndividualCandidacyReport(final Spreadsheet spreadsheet,
            final IndividualCandidacyProcess individualCandidacyProcess) {
        DegreeTransferIndividualCandidacyProcess degreeTransferIndividualCandidacyProcess =
                (DegreeTransferIndividualCandidacyProcess) individualCandidacyProcess;

        final Row row = spreadsheet.addRow();
        row.setCell(degreeTransferIndividualCandidacyProcess.getProcessCode());
        row.setCell(degreeTransferIndividualCandidacyProcess.getPersonalDetails().getName());
        row.setCell(degreeTransferIndividualCandidacyProcess.getPersonalDetails().getIdDocumentType().getLocalizedName());
        row.setCell(degreeTransferIndividualCandidacyProcess.getPersonalDetails().getDocumentIdNumber());
        row.setCell(degreeTransferIndividualCandidacyProcess.getPersonalDetails().getCountry().getCountryNationality()
                .getContent());
        row.setCell(degreeTransferIndividualCandidacyProcess.getPrecedentDegreeInformation().getPrecedentInstitution().getName());
        row.setCell(degreeTransferIndividualCandidacyProcess.getPrecedentDegreeInformation().getPrecedentDegreeDesignation());
        row.setCell(degreeTransferIndividualCandidacyProcess.getCandidacy().getSelectedDegree().getName());
        row.setCell(BundleUtil.getString(Bundle.ENUMERATION, individualCandidacyProcess.getCandidacyState().getQualifiedName()));
        row.setCell(BundleUtil.getString(Bundle.CANDIDATE, degreeTransferIndividualCandidacyProcess.getProcessChecked() != null
                && degreeTransferIndividualCandidacyProcess.getProcessChecked() ? MESSAGE_YES : MESSAGE_NO));
        return spreadsheet;
    }
View Full Code Here

                continue;
            }

            IndividualCandidacyPersonalDetails personalDetails = erasmusIndividualCandidacyProcess.getPersonalDetails();

            Row row = spreadsheet.addRow();

            row.setCell(0, erasmusIndividualCandidacyProcess.getProcessCode());
            if (personalDetails.getPerson() != null && personalDetails.getPerson().getUsername() != null) {
                row.setCell(1, personalDetails.getPerson().getUsername());
            } else {
                row.setCell(1, "");
            }
            row.setCell(2, erasmusIndividualCandidacyProcess.getPersonalDetails().getName());
            row.setCell(3, personalDetails.getDateOfBirthYearMonthDay() != null ? personalDetails.getDateOfBirthYearMonthDay()
                    .toString("dd/MM/yyyy") : "N/A");
            row.setCell(4, erasmusIndividualCandidacyProcess.getPersonalDetails().getCountry().getCountryNationality()
                    .getContent());
            row.setCell(5, erasmusIndividualCandidacyProcess.getCandidacy().getMobilityStudentData().getSelectedOpening()
                    .getMobilityAgreement().getUniversityUnit().getName());
            row.setCell(6, erasmusIndividualCandidacyProcess.getMobilityProgram().getRegistrationProtocol().getDescription()
                    .getContent());
            row.setCell(7, erasmusIndividualCandidacyProcess.getCandidacyHashCode().getEmail());
            row.setCell(8, erasmusIndividualCandidacyProcess.getCandidacy().getSelectedDegree().getNameI18N().getContent());
            row.setCell(
                    9,
                    erasmusIndividualCandidacyProcess.getCandidacy().getMobilityStudentData().getDateOfArrival()
                            .toString("dd/MM/yyyy"));
            row.setCell(10, erasmusIndividualCandidacyProcess.getCandidacy().getMobilityStudentData().getDateOfDeparture()
                    .toString("dd/MM/yyyy"));
            row.setCell(11, erasmusIndividualCandidacyProcess.getErasmusCandidacyStateDescription());
            if (erasmusIndividualCandidacyProcess.getPhoto() != null) {
                row.setCell(13, "Sim");
                photo = true;
            } else {
                row.setCell(13, "Não");
            }
            if (getUploadedDocumentByType(erasmusIndividualCandidacyProcess.getCandidacy().getDocumentsSet(),
                    IndividualCandidacyDocumentFileType.DOCUMENT_IDENTIFICATION) != null) {
                row.setCell(14, "Sim");
                photocopy = true;
            } else {
                row.setCell(14, "Não");
            }
            if (getUploadedDocumentByType(erasmusIndividualCandidacyProcess.getCandidacy().getDocumentsSet(),
                    IndividualCandidacyDocumentFileType.LEARNING_AGREEMENT) != null) {
                row.setCell(15, "Sim");
                agree = true;
            } else {
                row.setCell(15, "Não");
            }
            if (getUploadedDocumentByType(erasmusIndividualCandidacyProcess.getCandidacy().getDocumentsSet(),
                    IndividualCandidacyDocumentFileType.CV_DOCUMENT) != null) {
                row.setCell(16, "Sim");
                cv = true;
            } else {
                row.setCell(16, "Não");
            }
            if (getUploadedDocumentByType(erasmusIndividualCandidacyProcess.getCandidacy().getDocumentsSet(),
                    IndividualCandidacyDocumentFileType.TRANSCRIPT_OF_RECORDS) != null) {
                row.setCell(17, "Sim");
                transcript = true;
            } else {
                row.setCell(17, "Não");
            }
            if (getUploadedDocumentByType(erasmusIndividualCandidacyProcess.getCandidacy().getDocumentsSet(),
                    IndividualCandidacyDocumentFileType.ENGLISH_LEVEL_DECLARATION) != null) {
                row.setCell(18, "Sim");
                englishLevel = true;
            } else {
                row.setCell(18, "Não");
            }
            if (photo && photocopy && agree && cv && transcript && englishLevel) {
                row.setCell(12, "Sim");
            } else {
                row.setCell(12, "Não");
            }
        }

        return spreadsheet;
View Full Code Here

        for (final Over23IndividualCandidacyProcess candidacy : over23IndividualCandidacies) {
            if (!candidacy.canExecuteActivity(Authenticate.getUser())) {
                continue;
            }
            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

            if (!enrolment.isValid(executionYear)) {
                continue;
            }

            final Row row = spreadsheet.addRow();

            row.setCell(enrolment.getStudent().getNumber());
            row.setCell(enrolment.getDegreeCurricularPlanOfStudent().getDegree().getPresentationName());
            row.setCell(enrolment.getName().getContent());
            row.setCell(enrolment.getExecutionYear().getName());

            final CycleCurriculumGroup cycle = enrolment.getParentCycleCurriculumGroup();

            final BranchCurriculumGroup major = cycle == null ? null : cycle.getMajorBranchCurriculumGroup();
            row.setCell(major != null ? major.getName().getContent() : "");

            final BranchCurriculumGroup minor = cycle == null ? null : cycle.getMinorBranchCurriculumGroup();
            row.setCell(minor != null ? minor.getName().getContent() : "");

            row.setCell(getNumberOfEnrolments(enrolment));
        }
    }
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.