Package org.fenixedu.academic.dto.resourceAllocationManager

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


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


        return mapping.findForward("showForm");
    }

    public ActionForward chooseStudent(ActionMapping mapping, ActionForm form, HttpServletRequest request,
            HttpServletResponse response) throws Exception {
        final StudentContextSelectionBean studentContextSelectionBean = getRenderedObject();

        final String number = studentContextSelectionBean.getNumber();
        if (number != null && !number.isEmpty()) {
            final AcademicInterval academicInterval = studentContextSelectionBean.getAcademicInterval();
            final ExecutionInterval executionInterval = ExecutionInterval.getExecutionInterval(academicInterval);

            final SearchParameters searchParameters = new SearchParameters();
            if (StringUtils.isNumeric(number)) {
                searchParameters.setStudentNumber(Integer.valueOf(number));
            } else {
                searchParameters.setUsername(number);
            }
            final CollectionPager<Person> people =
                    new SearchPerson().run(searchParameters, new SearchPerson.SearchPersonPredicate(searchParameters));
            final Collection<Registration> registrations = new ArrayList<Registration>();
            for (final Person person : people.getCollection()) {
                if (person.getStudent() != null) {
                    for (final Registration registration : person.getStudent().getRegistrationsSet()) {
                        if (registration.hasAnyActiveState((ExecutionSemester) executionInterval)) {
                            registrations.add(registration);
                        }
                    }
                }
            }

            if (studentContextSelectionBean.getToEdit()) {
                request.setAttribute("toEditScheduleRegistrations", registrations);
            } else {
                request.setAttribute("registrations", registrations);
                request.setAttribute("timeTableExecutionSemester", executionInterval);
            }
View Full Code Here

TOP

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

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.