Package org.fenixedu.bennu.core.domain

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


    public ActionForward rectifyMarkSheetStepTwo(ActionMapping mapping, ActionForm actionForm, HttpServletRequest request,
            HttpServletResponse response) throws FenixServiceException {
        MarkSheetRectifyBean rectifyBean = (MarkSheetRectifyBean) RenderUtils.getViewState().getMetaObject().getObject();

        ActionMessages actionMessages = new ActionMessages();
        User userView = getUserView(request);
        try {
            CreateRectificationMarkSheet.run(rectifyBean.getMarkSheet(), rectifyBean.getEnrolmentEvaluation(),
                    rectifyBean.getRectifiedGrade(), rectifyBean.getEvaluationDate(), rectifyBean.getReason(),
                    userView.getPerson());
            return mapping.findForward("searchMarkSheetFilled");
        } catch (DomainException e) {
            addMessage(request, actionMessages, e.getMessage(), e.getArgs());
            return rectifyMarkSheetStepOne(mapping, actionForm, request, response, rectifyBean,
                    rectifyBean.getEnrolmentEvaluation());
View Full Code Here


    }

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

        User userView = getUserView(request);

        String degreeCurricularPlanID = null;
        if (request.getParameter("degreeCurricularPlanID") != null) {
            degreeCurricularPlanID = request.getParameter("degreeCurricularPlanID");
            request.setAttribute("degreeCurricularPlanID", degreeCurricularPlanID);
View Full Code Here

    }

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

        User userView = Authenticate.getUser();

        DynaActionForm dynaActionForm = (DynaActionForm) form;

        String oldShiftId = (String) dynaActionForm.get("oldShiftId");
        final String newShiftIdString = (String) dynaActionForm.get("newShiftId");
View Full Code Here

    protected static User getUserView(HttpServletRequest request) {
        return Authenticate.getUser();
    }

    protected Person getLoggedPerson(HttpServletRequest request) {
        final User userView = getUserView(request);
        return (userView == null) ? null : userView.getPerson();
    }
View Full Code Here

            users.addAll(semester.getTeacherAuthorizationStream().filter(a -> !a.isContracted())
                    .map(a -> a.getTeacher().getPerson().getUser()).collect(Collectors.toSet()));
        } else {
            for (final ExecutionCourse executionCourse : semester.getAssociatedExecutionCoursesSet()) {
                for (final Professorship professorship : executionCourse.getProfessorshipsSet()) {
                    User user = professorship.getPerson().getUser();
                    if (user != null) {
                        users.add(user);
                    }
                }
            }
View Full Code Here

    @Override
    public Set<User> getMembers() {
        Set<User> users = new HashSet<>();
        for (Attends attends : studentGroup.getAttendsSet()) {
            User user = attends.getRegistration().getPerson().getUser();
            if (user != null) {
                users.add(user);
            }
        }
        return users;
View Full Code Here

        return residencePersonsManagement(mapping, actionForm, request, response);
    }

    public ActionForward removeResidenceRoleManagemenToPerson(ActionMapping mapping, ActionForm actionForm,
            HttpServletRequest request, HttpServletResponse response) throws Exception {
        User user = User.findByUsername(request.getParameter("userToRemove"));
        DynamicGroup group = getResidenceRoleManagement();
        group.changeGroup(group.underlyingGroup().revoke(user));
        return residencePersonsManagement(mapping, actionForm, request, response);
    }
View Full Code Here

            degrees.add(curricularCourse.getDegree());
        }
        // students of any degree containing the given execution course
        for (Degree degree : degrees) {
            for (Registration registration : degree.getActiveRegistrations()) {
                User user = registration.getPerson().getUser();
                if (user != null) {
                    users.add(user);
                }
            }
        }
        // students attending the given execution course (most will be in the previous case but some may not)
        for (Attends attends : executionCourse.getAttendsSet()) {
            User user = attends.getRegistration().getPerson().getUser();
            if (user != null) {
                users.add(user);
            }
        }
        return users;
View Full Code Here

    }

    private static Set<User> registrationsToUsers(Set<Registration> registrations) {
        Set<User> users = new HashSet<>();
        for (Registration registration : registrations) {
            User user = registration.getPerson().getUser();
            if (user != null) {
                users.add(user);
            }
        }
        return users;
View Full Code Here

            throw new FenixActionException("error.expecting.parameter.not.found");
        }

        final DomainObject object = FenixFramework.getDomainObject(regId);
        if (object instanceof Registration) {
            User user = User.findByUsername(userId);
            Registration registration = (Registration) object;

            if (user.getPrivateKey() != null && user.getPrivateKey().getPrivateKeyValidity() != null) {
                if (payload.equals(ICalStudentTimeTable.calculatePayload(method, registration, user))) {
                    if (user.getPrivateKey().getPrivateKeyValidity().isBeforeNow()) {
                        returnError(httpServletResponse, "private.key.validity.expired");
                    } else {
                        if (user.getPerson().hasRole(RoleType.STUDENT)) {

                            encodeAndTransmitResponse(httpServletResponse,
                                    getCalendar(method, user, user.getPrivateKey().getPrivateKeyValidity(), request));

                        } else {
                            returnError(httpServletResponse, "user.is.not.student");
                        }
                    }
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.