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

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


        Collections.sort(degreeCandidacies, DEGREE_CANDIDACIES_COMPARATOR);
        return degreeCandidacies;
    }

    public Spreadsheet export(final Set<Degree> allowedPrograms) {
        Spreadsheet spreadsheet;
        spreadsheet = new Spreadsheet(getCampus().getName());
        addHeaders(spreadsheet);

        List<StudentCandidacy> result = search(allowedPrograms);
        Collections.sort(result, DEGREE_CANDIDACIES_COMPARATOR);
View Full Code Here


        Collections.sort(result, RegisteredDegreeCandidaciesSelectionBean.DEGREE_CANDIDACIES_COMPARATOR);
        return result;
    }

    public Spreadsheet export(Set<Degree> allowedDegrees) {
        final Spreadsheet spreadsheet = new Spreadsheet("Candidatura a Residencia");
        addHeaders(spreadsheet);

        for (final StudentCandidacy candidacy : search(allowedDegrees)) {
            addRow(spreadsheet, candidacy);
        }
View Full Code Here

            response.setContentType("application/vnd.ms-excel");
            response.setHeader("Content-disposition", "attachment; filename=list.xls");

            final ServletOutputStream outputStream = response.getOutputStream();

            final Spreadsheet spreadsheet = new Spreadsheet("list");
            spreadsheet.setHeader(BundleUtil.getString(Bundle.BOLONHA, "competenceCourse"));
            spreadsheet.setHeader(BundleUtil.getString(Bundle.BOLONHA, "curricularPlan"));
            spreadsheet.setHeader(BundleUtil.getString(Bundle.BOLONHA, "curricularYear"));
            spreadsheet.setHeader(BundleUtil.getString(Bundle.BOLONHA, "label.semester"));

            for (final CompetenceCourse competenceCourse : competenceCourses) {
                if (competenceCourse.getCurricularStage() == CurricularStage.APPROVED) {
                    for (final CurricularCourse curricularCourse : competenceCourse.getAssociatedCurricularCoursesSet()) {
                        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());
                                }
                            }
                        }
                    }
                }
            }

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

        return null;
    }

    private void writeCandidaciesReport(HttpServletRequest request, final CandidacyProcess process,
            final ServletOutputStream writer) throws IOException {
        final Spreadsheet spreadsheet =
                new Spreadsheet(BundleUtil.getString(Bundle.CANDIDATE, "title.candidacies"), getCandidacyHeader());
        HideCancelledCandidaciesBean hideCancelledCandidacies = getHideCancelledCandidaciesValue(request);

        for (final IndividualCandidacyProcess individualProcess : process.getChildProcessesSet()) {
            if (hideCancelledCandidacies.getValue() && individualProcess.isCandidacyCancelled()) {
                continue;
View Full Code Here

        setMobilityApplicationProcess(applicationProcess);
    }

    @Override
    public QueueJobResult execute() throws Exception {
        Spreadsheet spreasheet = retrieveIndividualProcessesData();
        ByteArrayOutputStream byteArrayOS = new ByteArrayOutputStream();

        spreasheet.exportToXLSSheet(byteArrayOS);
        byteArrayOS.close();

        final QueueJobResult queueJobResult = new QueueJobResult();
        queueJobResult.setContentType("application/excel");
        queueJobResult.setContent(byteArrayOS.toByteArray());
View Full Code Here

        return null;
    }

    @SuppressWarnings("unused")
    private Spreadsheet retrieveIndividualProcessesData() {
        final Spreadsheet spreadsheet = new Spreadsheet("Sheet");
        Boolean photo;
        Boolean photocopy;
        Boolean agree;
        Boolean cv;
        Boolean transcript;
        Boolean englishLevel;
        spreadsheet.setHeaders(new String[] { "N.º Processo", "IST ID", "Nome", "Data Nascimento", "Nacionalidade",
                "Universidade", "Programa", "Email", "Curso", "Data de chegada", "Data de partida", "Estado",
                "Documentação Entregue Completa", "Foto", "Fotocópia do Passaporte ou do Cartão de Identificação", "Acordo",
                "CV", "Registo Académico", "Nível Inglês" });

        for (IndividualCandidacyProcess individualCandidacyProcess : getMobilityApplicationProcess().getChildProcessesSet()) {
            photo = false;
            photocopy = false;
            agree = false;
            cv = false;
            transcript = false;
            englishLevel = false;
            MobilityIndividualApplicationProcess erasmusIndividualCandidacyProcess =
                    (MobilityIndividualApplicationProcess) individualCandidacyProcess;
            if (individualCandidacyProcess.isCandidacyCancelled()) {
                continue;
            }

            if (individualCandidacyProcess.isCandidacyRejected()) {
                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 {
View Full Code Here

        response.setContentType("application/vnd.ms-excel");
        response.setHeader("Content-disposition", "attachment; filename=" + getReportFilename());

        final ServletOutputStream writer = response.getOutputStream();
        final Over23CandidacyProcess process = getProcess(request);
        final Spreadsheet spreadsheet = buildReport(process.getOver23IndividualCandidaciesThatCanBeSendToJury());

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

        return null;
    }
View Full Code Here

        return null;
    }

    private Spreadsheet buildReport(final List<Over23IndividualCandidacyProcess> over23IndividualCandidacies) {
        final Spreadsheet result = new CandidacyReport("candidacies");

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

                            curricularCourse.getName().replaceAll(" ", "_"));
            response.setContentType("application/vnd.ms-excel");
            response.setHeader("Content-disposition", "attachment; filename=" + filename);
            ServletOutputStream outputStream = response.getOutputStream();

            final Spreadsheet spreadsheet = new Spreadsheet("-", getStudentsEnroledListHeaders());
            reportInfo(spreadsheet, curricularCourse, executionYear);

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

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

        }
        new SpreadsheetXLSExporter().exportToXLSSheets(writer, spreadsheets);
    }

    private Spreadsheet buildReport(final Degree degree, final SortedSet<SecondCycleIndividualCandidacyProcess> name) {
        final Spreadsheet spreadsheet = new Spreadsheet(degree.getSigla(), getHeader());

        for (final SecondCycleIndividualCandidacyProcess process : name) {
            if (!process.canExecuteActivity(Authenticate.getUser())) {
                continue;
            }
            final Row row = spreadsheet.addRow();
            row.setCell(process.getPersonalDetails().getName());
            row.setCell(process.getPrecedentDegreeInformation().getConclusionGrade());
            row.setCell(process.getCandidacyProfessionalExperience());
            row.setCell(process.getPrecedentDegreeInformation().getDegreeAndInstitutionName());
            row.setCell(process.getCandidacyAffinity());
View Full Code Here

TOP

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

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.