Package org.fenixedu.academic.dto.serviceRequests

Examples of org.fenixedu.academic.dto.serviceRequests.DocumentRequestCreateBean$CycleTypeProvider


    }

    public ActionForward documentRequestTypeInvalid(ActionMapping mapping, ActionForm form, HttpServletRequest request,
            HttpServletResponse response) {

        final DocumentRequestCreateBean requestCreateBean = getRenderedObject();

        if (requestCreateBean.getChosenDocumentRequestType() != null) {
            getAndSetSpecialEnrolments(request, requestCreateBean);
        }
        setAdditionalInformationSchemaName(request, requestCreateBean);
        request.setAttribute("documentRequestCreateBean", requestCreateBean);
        return mapping.findForward("createDocumentRequests");
View Full Code Here


            HttpServletResponse response) {
        return createDocumentRequestPostback(mapping, request);
    }

    private ActionForward createDocumentRequestPostback(ActionMapping mapping, HttpServletRequest request) {
        final DocumentRequestCreateBean requestCreateBean =
                (DocumentRequestCreateBean) RenderUtils.getViewState().getMetaObject().getObject();
        RenderUtils.invalidateViewState();

        if (requestCreateBean.getChosenDocumentRequestType() != null) {
            getAndSetSpecialEnrolments(request, requestCreateBean);
        }
        setAdditionalInformationSchemaName(request, requestCreateBean);
        request.setAttribute("documentRequestCreateBean", requestCreateBean);
        return mapping.findForward("createDocumentRequests");
View Full Code Here

    }

    public ActionForward viewDocumentRequestToCreate(ActionMapping mapping, ActionForm actionForm, HttpServletRequest request,
            HttpServletResponse response) {

        final DocumentRequestCreateBean requestCreateBean =
                (DocumentRequestCreateBean) RenderUtils.getViewState().getMetaObject().getObject();

        if (requestCreateBean.getChosenDocumentRequestType() == DocumentRequestType.EXAM_DATE_CERTIFICATE) {
            return prepareChooseExamsToCreateExamDateCertificateRequest(mapping, actionForm, request, response, requestCreateBean);
        }

        setAdditionalInformationSchemaName(request, requestCreateBean);
        request.setAttribute("documentRequestCreateBean", requestCreateBean);
View Full Code Here

    }

    public ActionForward chooseExamsToCreateExamDateCertificateRequest(ActionMapping mapping, ActionForm form,
            HttpServletRequest request, HttpServletResponse response) {

        final DocumentRequestCreateBean requestCreateBean = getRenderedObject("documentRequestCreateBean");
        requestCreateBean.setExams(getSelectedExams(request));

        setAdditionalInformationSchemaName(request, requestCreateBean);
        request.setAttribute("documentRequestCreateBean", requestCreateBean);
        return mapping.findForward("viewDocumentRequestsToCreate");
    }
View Full Code Here

    }

    public ActionForward create(ActionMapping mapping, ActionForm actionForm, HttpServletRequest request,
            HttpServletResponse response) throws FenixServiceException {

        final DocumentRequestCreateBean documentRequestCreateBean = getRenderedObject();
        final Registration registration = documentRequestCreateBean.getRegistration();
        request.setAttribute("registration", registration);

        DocumentRequest documentRequest = null;
        try {
            documentRequest = (DocumentRequest) executeFactoryMethod();
        } catch (DomainException ex) {
            addActionMessage(request, ex.getKey(), ex.getArgs());
            return mapping.findForward("viewRegistrationDetails");
        } catch (ConsistencyException ce) {
            addActionMessage(request, "error." + ce.getMethodFullname());
            return mapping.findForward("viewRegistrationDetails");
        }

        if (documentRequestCreateBean.getChosenDocumentRequestType().isAllowedToQuickDeliver()) {
            request.setAttribute("academicServiceRequestId", documentRequest.getExternalId());
            return mapping.findForward("processNewAcademicServiceRequest");
        } else {
            addActionMessage(request, "document.request.created.with.success");
            return mapping.findForward("viewRegistrationDetails");
View Full Code Here

    }

    public ActionForward useAllPostBack(ActionMapping mapping, ActionForm actionForm, HttpServletRequest request,
            HttpServletResponse response) {

        final DocumentRequestCreateBean documentRequestCreateBean = getRenderedObject();
        if (documentRequestCreateBean.isToUseAll()) {
            Set<Degree> degrees =
                    AcademicAccessRule.getDegreesAccessibleToFunction(AcademicOperationType.SERVICE_REQUESTS,
                            Authenticate.getUser()).collect(Collectors.toSet());
            Set<Enrolment> aprovedEnrolments = new HashSet<Enrolment>();
            for (Degree degree : degrees) {
                for (final Registration registration : documentRequestCreateBean.getStudent().getRegistrationsFor(degree)) {
                    aprovedEnrolments.addAll(registration.getApprovedEnrolments());
                }
            }
            documentRequestCreateBean.setEnrolments(new ArrayList<Enrolment>(aprovedEnrolments));
        } else {
            documentRequestCreateBean.setEnrolments(new ArrayList<Enrolment>());
        }
        RenderUtils.invalidateViewState();
        request.setAttribute("documentRequestCreateBean", documentRequestCreateBean);
        setAdditionalInformationSchemaName(request, documentRequestCreateBean);
View Full Code Here

    }

    public ActionForward documentRequestTypeInvalid(ActionMapping mapping, ActionForm actionForm, HttpServletRequest request,
            HttpServletResponse response) {

        final DocumentRequestCreateBean requestCreateBean =
                (DocumentRequestCreateBean) RenderUtils.getViewState().getMetaObject().getObject();

        setAdditionalInformationSchemaName(request, requestCreateBean);
        request.setAttribute("documentRequestCreateBean", requestCreateBean);
        return mapping.findForward("createDocumentRequests");
View Full Code Here

    }

    public ActionForward documentRequestTypeChosenPostBack(ActionMapping mapping, ActionForm form, HttpServletRequest request,
            HttpServletResponse response) {

        final DocumentRequestCreateBean requestCreateBean =
                (DocumentRequestCreateBean) RenderUtils.getViewState().getMetaObject().getObject();
        RenderUtils.invalidateViewState();

        setAdditionalInformationSchemaName(request, requestCreateBean);
        request.setAttribute("documentRequestCreateBean", requestCreateBean);
View Full Code Here

    }

    public ActionForward viewDocumentRequestToCreate(ActionMapping mapping, ActionForm actionForm, HttpServletRequest request,
            HttpServletResponse response) {

        final DocumentRequestCreateBean requestCreateBean =
                (DocumentRequestCreateBean) RenderUtils.getViewState().getMetaObject().getObject();

        setAdditionalInformationSchemaName(request, requestCreateBean);
        request.setAttribute("documentRequestCreateBean", requestCreateBean);
        return mapping.findForward("viewDocumentRequestsToCreate");
View Full Code Here

        return new DomainObjectKeyArrayConverter();
    }

    @Override
    public Object provide(Object source, Object currentValue) {
        final DocumentRequestCreateBean documentRequestCreateBean = (DocumentRequestCreateBean) source;

        Set<Degree> degrees =
                AcademicAccessRule.getDegreesAccessibleToFunction(AcademicOperationType.SERVICE_REQUESTS, Authenticate.getUser())
                        .collect(Collectors.toSet());
        SortedSet<Enrolment> aprovedEnrolments = new TreeSet<Enrolment>(Enrolment.COMPARATOR_BY_NAME_AND_ID);
        for (Degree degree : degrees) {
            for (final Registration registration : documentRequestCreateBean.getStudent().getRegistrationsFor(degree)) {
                aprovedEnrolments.addAll(registration.getApprovedEnrolments());
            }
        }
        documentRequestCreateBean.setEnrolments(new ArrayList<Enrolment>(aprovedEnrolments));
        filter(aprovedEnrolments, documentRequestCreateBean);

        return aprovedEnrolments;
    }
View Full Code Here

TOP

Related Classes of org.fenixedu.academic.dto.serviceRequests.DocumentRequestCreateBean$CycleTypeProvider

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.