Package org.fenixedu.bennu.core.domain

Examples of org.fenixedu.bennu.core.domain.User


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

        User userView = getUserView(request);

        String executionCourseCodeString = request.getParameter("executionCourseCode");

        if (executionCourseCodeString == null || executionCourseCodeString.equals("")) {
            ActionErrors actionErrors1 = new ActionErrors();
            ActionError error1 = null;
            // Create an ACTION_ERROR
            error1 = new ActionError("errors.notSelected.executionCourse");
            actionErrors1.add("errors.notSelected.executionCourse", error1);
            saveErrors(request, actionErrors1);
            return mapping.findForward("insucess");
        }

        InfoSiteProjects viewProjectsComponent =
                ReadExecutionCourseProjects.run(executionCourseCodeString, userView.getUsername());

        InfoExecutionCourse infoExecutionCourse = ReadExecutionCourseByOID.run(executionCourseCodeString);
        request.setAttribute("infoExecutionCourse", infoExecutionCourse);

        InfoSiteProjects infoSiteProjects = viewProjectsComponent;
View Full Code Here


public class GroupEnrolmentDispatchAction extends FenixDispatchAction {

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

        User userView = getUserView(request);

        String groupPropertiesCodeString = request.getParameter("groupPropertiesCode");

        String shiftCodeString = request.getParameter("shiftCode");

        try {

            VerifyStudentGroupAtributes.run(groupPropertiesCodeString, shiftCodeString, null, userView.getUsername(),
                    new Integer(2));

        } catch (NotAuthorizedException e) {
            ActionErrors actionErrors2 = new ActionErrors();
            ActionError error2 = null;
            error2 = new ActionError("errors.noStudentInAttendsSet");
            actionErrors2.add("errors.noStudentInAttendsSet", error2);
            saveErrors(request, actionErrors2);
            return mapping.findForward("insucess");
        } catch (InvalidChangeServiceException e) {
            ActionErrors actionErrors2 = new ActionErrors();
            ActionError error2 = null;
            error2 = new ActionError("error.noProject");
            actionErrors2.add("error.noProject", error2);
            saveErrors(request, actionErrors2);
            return mapping.findForward("viewExecutionCourseProjects");
        } catch (InvalidArgumentsServiceException e) {
            ActionErrors actionErrors2 = new ActionErrors();
            ActionError error2 = null;
            error2 = new ActionError("errors.impossible.nrOfGroups.groupEnrolment");
            actionErrors2.add("errors.impossible.nrOfGroups.groupEnrolment", error2);
            saveErrors(request, actionErrors2);
            return mapping.findForward("viewShiftsAndGroups");
        } catch (InvalidSituationServiceException e) {
            ActionErrors actionErrors2 = new ActionErrors();
            ActionError error2 = null;
            error2 = new ActionError("errors.existing.groupStudentEnrolment");
            actionErrors2.add("errors.existing.groupStudentEnrolment", error2);
            saveErrors(request, actionErrors2);
            return mapping.findForward("viewShiftsAndGroups");

        } catch (FenixServiceException e) {
            throw new FenixActionException(e);

        }

        InfoSiteStudentsWithoutGroup studentsNotEnroled = null;

        try {
            studentsNotEnroled = ReadStudentsWithoutGroup.run(groupPropertiesCodeString, userView.getUsername());

        } catch (ExistingServiceException e) {
            ActionErrors actionErrors1 = new ActionErrors();
            ActionError error1 = null;
            error1 = new ActionError("error.noProject");
View Full Code Here

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

        DynaActionForm enrolmentForm = (DynaActionForm) form;

        User userView = getUserView(request);

        String groupPropertiesCodeString = request.getParameter("groupPropertiesCode");

        String groupNumberString = request.getParameter("groupNumber");
        Integer groupNumber = new Integer(groupNumberString);
        String shiftCodeString = request.getParameter("shiftCode");

        List<String> studentUsernames = Arrays.asList((String[]) enrolmentForm.get("studentsNotEnroled"));

        try {
            GroupEnrolment.run(groupPropertiesCodeString, shiftCodeString, groupNumber, studentUsernames, userView.getUsername());

        } catch (NonExistingServiceException e) {
            ActionErrors actionErrors1 = new ActionErrors();
            ActionError error1 = null;
            error1 = new ActionError("error.noProject");
View Full Code Here

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

        User userView = getUserView(request);

        String groupPropertiesCodeString = request.getParameter("groupPropertiesCode");

        String username = userView.getUsername();

        List<InfoExportGrouping> infoExportGroupings = ReadExportGroupingsByGrouping.run(groupPropertiesCodeString);
        request.setAttribute("infoExportGroupings", infoExportGroupings);

        InfoSiteShiftsAndGroups infoSiteShiftsAndGroups;
View Full Code Here

    private ActionForward executeOperation(ActionMapping mapping, ActionForm form, HttpServletRequest request,
            HttpServletResponse response, CandidacyOperation candidacyOperation) throws FenixServiceException,
            FenixActionException {

        final User userView = getUserView(request);

        if (candidacyOperation == null) {
            // possible due to first-time candidacy summary generation link in manager portal
            candidacyOperation = new PrintAllDocumentsOperation(RoleType.STUDENT, getCandidacy(request));
        } else {
            ExecuteStateOperation.run(candidacyOperation, getLoggedPerson(request));
        }

        if (candidacyOperation.getType() == CandidacyOperationType.PRINT_SCHEDULE) {
            final List<InfoShowOccupation> infoLessons = ReadStudentTimeTable.run(getCandidacy(request).getRegistration(), null);
            request.setAttribute("person", getCandidacy(request).getPerson());
            request.setAttribute("infoLessons", infoLessons);
            return mapping.findForward("printSchedule");

        } else if (candidacyOperation.getType() == CandidacyOperationType.PRINT_REGISTRATION_DECLARATION) {
            request.setAttribute("registration", getCandidacy(request).getRegistration());
            request.setAttribute("executionYear", getCandidacy(request).getExecutionDegree().getExecutionYear());
            return mapping.findForward("printRegistrationDeclaration");

        } else if (candidacyOperation.getType() == CandidacyOperationType.PRINT_UNDER_23_TRANSPORTS_DECLARATION) {
            request.setAttribute("person", getCandidacy(request).getRegistration().getPerson());
            request.setAttribute("campus", getCandidacy(request).getRegistration().getCampus().getName());
            request.setAttribute("executionYear", getCandidacy(request).getExecutionDegree().getExecutionYear());
            return mapping.findForward("printUnder23TransportsDeclation");

        } else if (candidacyOperation.getType() == CandidacyOperationType.PRINT_MEASUREMENT_TEST_DATE) {
            request.setAttribute("registration", getCandidacy(request).getRegistration());
            return mapping.findForward("printMeasurementTestDate");

        } else if (candidacyOperation.getType() == CandidacyOperationType.PRINT_ALL_DOCUMENTS) {
            StudentCandidacy candidacy = getCandidacy(request);
            request.setAttribute("candidacy", candidacy);
            request.setAttribute("registration", candidacy.getRegistration());
            request.setAttribute("executionYear", candidacy.getExecutionDegree().getExecutionYear());
            request.setAttribute("person", candidacy.getRegistration().getPerson());
            request.setAttribute("campus", candidacy.getRegistration().getCampus().getName());
            request.setAttribute("administrativeOfficeFeeAndInsurancePaymentCode",
                    administrativeOfficeFeeAndInsurancePaymentCode(candidacy.getAvailablePaymentCodesSet()));
            request.setAttribute("installmentPaymentCodes", installmmentPaymentCodes(candidacy.getAvailablePaymentCodesSet()));
            request.setAttribute("totalGratuityPaymentCode", totalGratuityPaymentCode(candidacy.getAvailablePaymentCodesSet()));
            request.setAttribute(
                    "firstInstallmentEndDate",
                    calculateFirstInstallmentEndDate(candidacy.getRegistration(), getCandidacy(request)
                            .getAvailablePaymentCodesSet()));
            request.setAttribute("sibsEntityCode", FenixEduAcademicConfiguration.getConfiguration().getSibsEntityCode());

            final List<InfoShowOccupation> infoLessons = ReadStudentTimeTable.run(candidacy.getRegistration(), null);
            request.setAttribute("infoLessons", infoLessons);

//            FIXME: Cannot continue to be supported this way, tutorship is an optional dependency
//            List<Tutorship> activeTutorships = Tutorship.getActiveTutorships(candidacy.getRegistration().getStudent());
//            if (!activeTutorships.isEmpty()) {
//                Tutorship tutorship = activeTutorships.iterator().next();
//                request.setAttribute("tutor", tutorship.getTeacher().getPerson());
//            }

            return mapping.findForward("printAllDocuments");

        } else if (candidacyOperation.getType() == CandidacyOperationType.PRINT_SYSTEM_ACCESS_DATA) {
            request.setAttribute("person", userView.getPerson());
            return mapping.findForward("printSystemAccessData");

        } else if (candidacyOperation.getType() == CandidacyOperationType.FILL_PERSONAL_DATA) {
            request.setAttribute(
                    "aditionalInformation",
                    getResources(request).getMessage("label.candidacy.username.changed.message",
                            userView.getPerson().getUsername(), Unit.getInstitutionAcronym()));
        } else if (candidacyOperation.getType() == CandidacyOperationType.PRINT_GRATUITY_PAYMENT_CODES) {
            request.setAttribute("registration", getCandidacy(request).getRegistration());
            request.setAttribute("paymentCodes", getCandidacy(request).getAvailablePaymentCodesSet());
            request.setAttribute("sibsEntityCode", FenixEduAcademicConfiguration.getConfiguration().getSibsEntityCode());
            request.setAttribute("administrativeOfficeFeeAndInsurancePaymentCode",
View Full Code Here

    }

    @Override
    public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
            throws Exception {
        User userView = Authenticate.getUser();
        DynaActionForm dynaForm = (DynaActionForm) form;

        InfoPerson infoPerson = getInfoPerson(request, dynaForm);

        List detailedInfoProfessorshipList = getDetailedProfessorships(userView, infoPerson.getExternalId(), dynaForm, request);
View Full Code Here

    }

    protected InfoPerson getInfoPerson(HttpServletRequest request, DynaActionForm dynaForm) throws Exception {
        InfoPerson infoPerson = (InfoPerson) request.getAttribute("infoPerson");
        if (infoPerson == null) {
            final User userView = Authenticate.getUser();
            infoPerson = ReadPersonByID.run((String) dynaForm.get("externalId"));
            request.setAttribute("infoPerson", infoPerson);

        }
        return infoPerson;
View Full Code Here

public class EnrollStudentGroupShiftDispatchAction extends FenixDispatchAction {

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

        User userView = getUserView(request);

        String groupPropertiesCodeString = request.getParameter("groupPropertiesCode");
        String studentGroupCodeString = request.getParameter("studentGroupCode");

        try {
            VerifyStudentGroupAtributes.run(groupPropertiesCodeString, null, studentGroupCodeString, userView.getUsername(),
                    new Integer(5));

        } catch (NotAuthorizedException e) {
            ActionErrors actionErrors2 = new ActionErrors();
            ActionError error2 = null;
View Full Code Here

    public ActionForward enrollStudentGroupShift(ActionMapping mapping, ActionForm form, HttpServletRequest request,
            HttpServletResponse response) throws FenixActionException {
        DynaActionForm enrollStudentGroupForm = (DynaActionForm) form;

        User userView = getUserView(request);

        String studentGroupCodeString = request.getParameter("studentGroupCode");
        String groupPropertiesCodeString = request.getParameter("groupPropertiesCode");
        String newShiftString = (String) enrollStudentGroupForm.get("shift");

        if (newShiftString.equals("")) {
            ActionErrors actionErrors = new ActionErrors();
            ActionError error = null;
            error = new ActionError("errors.invalid.shift.groupEnrolment");
            actionErrors.add("errors.invalid.shift.groupEnrolment", error);
            saveErrors(request, actionErrors);
            return prepareEnrollStudentGroupShift(mapping, form, request, response);

        }

        try {
            EnrollGroupShift.run(studentGroupCodeString, groupPropertiesCodeString, newShiftString, userView.getUsername());
        } catch (NotAuthorizedException e) {
            ActionErrors actionErrors2 = new ActionErrors();
            ActionError error2 = null;
            error2 = new ActionError("errors.noStudentInAttendsSet");
            actionErrors2.add("errors.noStudentInAttendsSet", error2);
View Full Code Here

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

        User userView = getUserView(request);

        String studentGroupCodeString = request.getParameter("studentGroupCode");
        String shiftCodeString = request.getParameter("shiftCode");
        String groupPropertiesCodeString = request.getParameter("groupPropertiesCode");

        InfoSiteStudentGroup viewStudentGroup;
        try {
            Integer type =
                    VerifyGroupingAndStudentGroupWithoutShift.run(studentGroupCodeString, groupPropertiesCodeString,
                            shiftCodeString, userView.getUsername());
            viewStudentGroup = ReadStudentGroupInformation.run(studentGroupCodeString);
            request.setAttribute("ShiftType", type);
        } catch (ExistingServiceException e) {
            ActionErrors actionErrors = new ActionErrors();
            ActionError error = null;
View Full Code Here

TOP

Related Classes of org.fenixedu.bennu.core.domain.User

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.