Package org.fenixedu.academic.domain

Examples of org.fenixedu.academic.domain.Project


public class EditProject {

    protected void run(String executionCourseID, String projectID, String name, Date begin, Date end, String description,
            Boolean onlineSubmissionsAllowed, Integer maxSubmissionsToKeep, String groupingID, GradeScale gradeScale,
            List<Department> departments) throws FenixServiceException {
        final Project project = (Project) FenixFramework.getDomainObject(projectID);
        if (project == null) {
            throw new FenixServiceException("error.noEvaluation");
        }

        final Grouping grouping = (groupingID != null) ? FenixFramework.<Grouping> getDomainObject(groupingID) : null;

        project.edit(name, begin, end, description, onlineSubmissionsAllowed, maxSubmissionsToKeep, grouping, gradeScale,
                departments);
    }
View Full Code Here


            throw new FenixServiceException("error.noExecutionCourse");
        }

        final Grouping grouping = (groupingID != null) ? FenixFramework.<Grouping> getDomainObject(groupingID) : null;

        final Project project =
                new Project(name, begin, end, description, onlineSubmissionsAllowed, maxSubmissionsToKeep, grouping,
                        executionCourse, gradeScale);
        project.getDeparmentsSet().addAll(departments);
    }
View Full Code Here

    public ActionForward viewProjectSubmissions(ActionMapping mapping, ActionForm form, HttpServletRequest request,
            HttpServletResponse response) throws FenixActionException, FenixServiceException {

        final Attends attends = getAttends(request);
        final Project project = getProject(request);
        final StudentGroup studentGroup = project.getGrouping().getStudentGroupByAttends(attends);

        request.setAttribute("project", project);

        if (studentGroup != null) {
            final List<ProjectSubmission> projectSubmissionsSortedByMostRecent =
View Full Code Here

        ProjectSubmission submission = getProjectSubmission(request);

        if (submission != null && submission.getStudentGroup().isPersonInStudentGroup(getLoggedPerson(request))) {
            Attends attends = getAttends(request);
            Project project = getProject(request);
            StudentGroup studentGroup = project.getGrouping().getStudentGroupByAttends(attends);
            String rowClasses = "";
            for (ProjectSubmission oneSubmission : getProjectSubmissionsForStudentGroupSortedByMostRecent(project, studentGroup)) {
                if (oneSubmission.equals(submission)) {
                    rowClasses += "selected,";
                } else {
View Full Code Here

    public ActionForward prepareProjectSubmission(ActionMapping mapping, ActionForm form, HttpServletRequest request,
            HttpServletResponse response) throws FenixActionException, FenixServiceException {

        Attends attends = getAttends(request);
        Project project = getProject(request);
        StudentGroup studentGroup = project.getGrouping().getStudentGroupByAttends(attends);

        request.setAttribute("attends", attends);
        request.setAttribute("project", getProject(request));
        request.setAttribute("studentGroup", studentGroup);
        request.setAttribute("person", getUserView(request).getPerson());
View Full Code Here

    }

    public ActionForward viewLastProjectSubmissionForEachGroup(ActionMapping mapping, ActionForm form,
            HttpServletRequest request, HttpServletResponse response) throws FenixActionException {

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

        final List<ProjectSubmission> deletedGroupsProjectSubmissions =
                new ArrayList<ProjectSubmission>(project.getLastProjectSubmissionForEachDeletedStudentGroup());

        Collections.sort(projectSubmissions, ProjectSubmission.COMPARATOR_BY_GROUP_NUMBER_AND_MOST_RECENT_SUBMISSION_DATE);
        Collections.sort(deletedGroupsProjectSubmissions,
                ProjectSubmission.COMPARATOR_BY_GROUP_NUMBER_AND_MOST_RECENT_SUBMISSION_DATE);
View Full Code Here

    }

    public ActionForward viewProjectSubmissionsByGroup(ActionMapping mapping, ActionForm form, HttpServletRequest request,
            HttpServletResponse response) throws FenixActionException {

        final Project project = getProject(request);
        final List<ProjectSubmission> projectSubmissions =
                new ArrayList<ProjectSubmission>(project.getProjectSubmissionsByStudentGroup(getStudentGroup(request)));
        Collections.sort(projectSubmissions, ProjectSubmission.COMPARATOR_BY_MOST_RECENT_SUBMISSION_DATE);

        final List<ProjectSubmissionLog> projectSubmissionLogs =
                new ArrayList<ProjectSubmissionLog>(project.getProjectSubmissionLogsByStudentGroup(getStudentGroup(request)));
        Collections.sort(projectSubmissionLogs, ProjectSubmissionLog.COMPARATOR_BY_MOST_RECENT_SUBMISSION_DATE);

        setRequestParameters(request, project, projectSubmissions, projectSubmissionLogs);

        return doForward(request, "/teacher/evaluation/viewProjectSubmissionsByGroup.jsp");
View Full Code Here

    }

    public ActionForward downloadProjectsInZipFormat(ActionMapping mapping, ActionForm form, HttpServletRequest request,
            HttpServletResponse response) throws FenixActionException, IOException, ServletException {

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

        IViewState viewState = RenderUtils.getViewState("selectiveDownload");
        Integer value = (viewState != null) ? (Integer) viewState.getMetaObject().getObject() : null;
        VariantBean bean = new VariantBean();
        bean.setInteger(value);
        final Project project = getProject(request);
        if (bean.getInteger() != null) {
            final List<ProjectSubmission> projectSubmissions =
                    new ArrayList<ProjectSubmission>(project.getLastProjectSubmissionForEachStudentGroup());
            Collections.sort(projectSubmissions, ProjectSubmission.COMPARATOR_BY_MOST_RECENT_SUBMISSION_DATE);
            setRequestParameters(request, project, projectSubmissions, null);
        } else {
            setRequestParameters(request, project, null, null);
        }
View Full Code Here

    }

    public ActionForward selectiveDownload(ActionMapping mapping, ActionForm form, HttpServletRequest request,
            HttpServletResponse response) throws FenixActionException, IOException, ServletException {

        final Project project = getProject(request);
        final Integer startIndex = Integer.valueOf(request.getParameter("startIndex"));
        final Integer pageSize = Integer.valueOf(request.getParameter("size"));
        final List<ProjectSubmission> projectSubmissions =
                new ArrayList<ProjectSubmission>(project.getLastProjectSubmissionForEachStudentGroup());
        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();
View Full Code Here

TOP

Related Classes of org.fenixedu.academic.domain.Project

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.