Package org.fenixedu.academic.ui.struts.action.teacher.siteArchive

Examples of org.fenixedu.academic.ui.struts.action.teacher.siteArchive.Archive


        final Project project = getProject(request);
        final List<ProjectSubmission> projectSubmissions =
                new ArrayList<ProjectSubmission>(project.getLastProjectSubmissionForEachStudentGroup());

        Archive archive = new DiskZipArchive(response, project.getName());
        Fetcher fetcher = new Fetcher(archive, request, response);

        for (ProjectSubmission submission : projectSubmissions) {
            StudentGroup group = submission.getStudentGroup();

            fetcher.queue(new Resource(group.getGroupNumber() + getStudentsISTID(group) + "/"
                    + submission.getProjectSubmissionFile().getFilename(), submission.getProjectSubmissionFile().getDownloadUrl()));
        }

        fetcher.process();
        archive.finish();

        return null;
    }
View Full Code Here


        Collections.sort(projectSubmissions, ProjectSubmission.COMPARATOR_BY_MOST_RECENT_SUBMISSION_DATE);
        Integer finishIndex = Math.min(projectSubmissions.size(), startIndex + pageSize);

        final List<ProjectSubmission> subList = projectSubmissions.subList(startIndex, finishIndex);

        Archive archive = new DiskZipArchive(response, project.getName() + "-" + (startIndex + 1) + "-" + finishIndex);
        Fetcher fetcher = new Fetcher(archive, request, response);

        for (ProjectSubmission submission : subList) {
            StudentGroup group = submission.getStudentGroup();

            fetcher.queue(new Resource(group.getGroupNumber() + getStudentsISTID(group) + "/"
                    + submission.getProjectSubmissionFile().getFilename(), submission.getProjectSubmissionFile().getDownloadUrl()));
        }

        fetcher.process();
        archive.finish();

        return null;
    }
View Full Code Here

TOP

Related Classes of org.fenixedu.academic.ui.struts.action.teacher.siteArchive.Archive

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.