Package org.fenixedu.academic.dto.resourceAllocationManager

Examples of org.fenixedu.academic.dto.resourceAllocationManager.ContextSelectionBean


    }

    @EntryPoint
    public ActionForward prepare(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
            throws Exception {
        ContextSelectionBean contextSelectionBean =
                (ContextSelectionBean) request.getAttribute(PresentationConstants.CONTEXT_SELECTION_BEAN);

        final StudentContextSelectionBean studentContextSelectionBean =
                new StudentContextSelectionBean(contextSelectionBean.getAcademicInterval());
        request.setAttribute("studentContextSelectionBean", studentContextSelectionBean);

        final List<ExecutionDegree> executionDegrees =
                new ArrayList<ExecutionDegree>(ExecutionDegree.filterByAcademicInterval(contextSelectionBean
                        .getAcademicInterval()));
        Collections.sort(executionDegrees, executionDegreeComparator);
        request.setAttribute("executionDegrees", executionDegrees);
        ExecutionSemester executionSemester =
                (ExecutionSemester) ExecutionInterval.getExecutionInterval(contextSelectionBean.getAcademicInterval());
        request.setAttribute("executionSemester", executionSemester);

        AcademicCalendarEntry academicCalendarEntry = contextSelectionBean.getAcademicInterval().getAcademicCalendarEntry();
        while (!(academicCalendarEntry instanceof AcademicCalendarRootEntry)) {
            if (academicCalendarEntry instanceof AcademicYearCE) {
                ExecutionYear year = ExecutionYear.getExecutionYear((AcademicYearCE) academicCalendarEntry);
                request.setAttribute("executionYear", year);
                break;
View Full Code Here


public class MainExamsDA extends FenixDispatchAction {

    @EntryPoint
    public ActionForward prepare(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
            throws Exception {
        ContextSelectionBean contextSelectionBean = getRenderedObject();
        if (contextSelectionBean == null) {
            contextSelectionBean = new ContextSelectionBean();
            AcademicInterval fromAttribute = (AcademicInterval) request.getAttribute("academicInterval");
            if (fromAttribute != null) {
                contextSelectionBean.setAcademicInterval(fromAttribute);
            }
        }
        RenderUtils.invalidateViewState();
        request.setAttribute("bean", contextSelectionBean);
        final List<ExecutionDegree> executionDegrees =
                new ArrayList<ExecutionDegree>(ExecutionDegree.filterByAcademicInterval(contextSelectionBean
                        .getAcademicInterval()));
        Collections.sort(executionDegrees, ExecutionDegree.EXECUTION_DEGREE_COMPARATORY_BY_DEGREE_TYPE_AND_NAME);
        request.setAttribute("executionDegrees", executionDegrees);
        request.setAttribute("executionInterval",
                ExecutionInterval.getExecutionInterval(contextSelectionBean.getAcademicInterval()));
        return mapping.findForward("showForm");
    }
View Full Code Here

        return mapping.findForward("ShowSearchForm");
    }

    public ActionForward search(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
            throws Exception {
        ContextSelectionBean contextSelectionBean =
                (ContextSelectionBean) request.getAttribute(PresentationConstants.CONTEXT_SELECTION_BEAN);

        request.setAttribute(
                PresentationConstants.CURRICULAR_YEAR_OID,
                contextSelectionBean.getCurricularYear() != null ? contextSelectionBean.getCurricularYear().getExternalId() : null);
        request.setAttribute(PresentationConstants.EXECUTION_DEGREE_OID, contextSelectionBean.getExecutionDegree()
                .getExternalId());

        request.setAttribute("execution_course_name", contextSelectionBean.getCourseName().replaceAll("%", "%25"));

        List<InfoExecutionCourse> infoExecutionCourses = null;

        if (contextSelectionBean.getCurricularYear() == null) {
            infoExecutionCourses =
                    SearchExecutionCourses.runSearchExecutionCourses(contextSelectionBean.getAcademicInterval(),
                            contextSelectionBean.getExecutionDegree(), contextSelectionBean.getCourseName());
        } else {
            infoExecutionCourses =
                    SearchExecutionCourses.runSearchExecutionCourses(contextSelectionBean.getAcademicInterval(),
                            contextSelectionBean.getExecutionDegree(), contextSelectionBean.getCurricularYear(),
                            contextSelectionBean.getCourseName());
        }

        if (infoExecutionCourses != null) {

            sortList(request, infoExecutionCourses);
View Full Code Here

public class ListExecutionCourseGroupingsDA extends FenixDispatchAction {

    public ActionForward prepare(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
            throws Exception {

        request.setAttribute(PresentationConstants.CONTEXT_SELECTION_BEAN, new ContextSelectionBean());
        return mapping.findForward("show-choose-execution-period-page");
    }
View Full Code Here

    @EntryPoint
    public ActionForward selectExecutionPeriod(ActionMapping mapping, ActionForm form, HttpServletRequest request,
            HttpServletResponse response) throws Exception {

        ContextSelectionBean contextSelectionBean = getRenderedObject();
        RenderUtils.invalidateViewState();

        if (contextSelectionBean == null) {
            request.setAttribute(PresentationConstants.CONTEXT_SELECTION_BEAN, new ContextSelectionBean());
            return mapping.findForward("show-choose-execution-period-page");
        }

        request.setAttribute(PresentationConstants.CONTEXT_SELECTION_BEAN, contextSelectionBean);
        return mapping.findForward("show-choose-execution-period-page");
View Full Code Here

        return mapping.findForward("EditShift");
    }

    private void readAndSetInfoToManageShifts(HttpServletRequest request) throws FenixServiceException, Exception {
        ContextSelectionBean context = (ContextSelectionBean) request.getAttribute(PresentationConstants.CONTEXT_SELECTION_BEAN);
        List<InfoShift> infoShifts =
                ReadShiftsByExecutionPeriodAndExecutionDegreeAndCurricularYear.run(context.getAcademicInterval(),
                        new InfoExecutionDegree(context.getExecutionDegree()),
                        new InfoCurricularYear(context.getCurricularYear()));

        Collections.sort(infoShifts, InfoShift.SHIFT_COMPARATOR_BY_TYPE_AND_ORDERED_LESSONS);

        if (infoShifts != null && !infoShifts.isEmpty()) {
            request.setAttribute(PresentationConstants.SHIFTS, infoShifts);
View Full Code Here

        labelListOfCurricularYears.add(new LabelValueBean("5 ยบ", "5"));
        return labelListOfCurricularYears;
    }

    public static void setContextSelectionBean(HttpServletRequest request, Object renderedObject) {
        ContextSelectionBean context = null;
        if (renderedObject != null && renderedObject instanceof ContextSelectionBean) {
            RenderUtils.invalidateViewState();
            context = (ContextSelectionBean) renderedObject;
        } else if (request.getAttribute(PresentationConstants.CONTEXT_SELECTION_BEAN) != null) {
            context = (ContextSelectionBean) request.getAttribute(PresentationConstants.CONTEXT_SELECTION_BEAN);
        } else {
            AcademicInterval academicInterval = null;
            ExecutionDegree executionDegree = null;
            CurricularYear curricularYear = null;
            String courseName = null;
            if (request.getAttribute(PresentationConstants.ACADEMIC_INTERVAL) != null) {
                String academicIntervalStr = (String) request.getAttribute(PresentationConstants.ACADEMIC_INTERVAL);
                academicInterval = AcademicInterval.getAcademicIntervalFromResumedString(academicIntervalStr);
            } else if (request.getParameter(PresentationConstants.ACADEMIC_INTERVAL) != null) {
                String academicIntervalStr = request.getParameter(PresentationConstants.ACADEMIC_INTERVAL);
                if (academicIntervalStr != null && !academicIntervalStr.equals("null")) {
                    academicInterval = AcademicInterval.getAcademicIntervalFromResumedString(academicIntervalStr);
                }
            }
            if (academicInterval == null) {
                academicInterval = AcademicInterval.readDefaultAcademicInterval(AcademicPeriod.SEMESTER);
            }
            if (request.getAttribute(PresentationConstants.EXECUTION_DEGREE_OID) != null) {
                executionDegree =
                        FenixFramework.getDomainObject((String) request.getAttribute(PresentationConstants.EXECUTION_DEGREE_OID));
            } else if (request.getParameter(PresentationConstants.EXECUTION_DEGREE_OID) != null) {
                executionDegree =
                        FenixFramework.getDomainObject(request.getParameter(PresentationConstants.EXECUTION_DEGREE_OID));
            }
            if (request.getAttribute(PresentationConstants.CURRICULAR_YEAR_OID) != null
                    && !request.getParameter(PresentationConstants.CURRICULAR_YEAR_OID).equals("null")) {
                curricularYear =
                        FenixFramework.getDomainObject((String) request.getAttribute(PresentationConstants.CURRICULAR_YEAR_OID));
            } else if (request.getParameter(PresentationConstants.CURRICULAR_YEAR_OID) != null
                    && !request.getParameter(PresentationConstants.CURRICULAR_YEAR_OID).equals("null")) {
                curricularYear = FenixFramework.getDomainObject(request.getParameter(PresentationConstants.CURRICULAR_YEAR_OID));
            }
            if (request.getAttribute("execution_course_name") != null) {
                courseName = (String) request.getAttribute("execution_course_name");
            } else if (request.getParameter("execution_course_name") != null) {
                courseName = request.getParameter("execution_course_name");
            }

            context = new ContextSelectionBean(academicInterval, executionDegree, curricularYear);
            context.setCourseName(courseName);
        }
        request.setAttribute(PresentationConstants.CONTEXT_SELECTION_BEAN, context);
        request.setAttribute(PresentationConstants.ACADEMIC_INTERVAL, context.getAcademicInterval()
                .getResumedRepresentationInStringFormat());

        if (context.getExecutionDegree() != null) {
            request.setAttribute(PresentationConstants.EXECUTION_DEGREE, new InfoExecutionDegree(context.getExecutionDegree()));
        }

        request.setAttribute(PresentationConstants.CURRICULAR_YEAR, new InfoCurricularYear(context.getCurricularYear()));
    }
View Full Code Here

public class ExecutionDegreeForAcademicSemesterSelectionBeanProvider implements DataProvider {

    @Override
    public Object provide(Object source, Object currentValue) {

        ContextSelectionBean contextSelectionBean = (ContextSelectionBean) source;
        List<ExecutionDegree> executionDegrees =
                ExecutionDegree.filterByAcademicInterval(contextSelectionBean.getAcademicInterval());

        Collections.sort(executionDegrees, ExecutionDegree.EXECUTION_DEGREE_COMPARATORY_BY_DEGREE_TYPE_AND_NAME);

        return executionDegrees;
    }
View Full Code Here

public class CurricularYearForExecutionDegreeProvider implements DataProvider {

    @Override
    public Object provide(Object source, Object currentValue) {

        ContextSelectionBean contextSelectionBean = (ContextSelectionBean) source;
        List<CurricularYear> result = new ArrayList<CurricularYear>();
        ExecutionDegree executionDegree = contextSelectionBean.getExecutionDegree();

        if (executionDegree != null) {
            Integer index = executionDegree.getDegreeCurricularPlan().getDegreeDuration();

            result.addAll(Bennu.getInstance().getCurricularYearsSet());
View Full Code Here

TOP

Related Classes of org.fenixedu.academic.dto.resourceAllocationManager.ContextSelectionBean

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.