Package org.fenixedu.bennu.core.domain

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


    private InfoExecutionPeriod setExecutionContext(HttpServletRequest request) throws Exception {
        InfoExecutionPeriod infoExecutionPeriod =
                (InfoExecutionPeriod) request.getAttribute(PresentationConstants.INFO_EXECUTION_PERIOD_KEY);
        if (infoExecutionPeriod == null) {
            User userView = Authenticate.getUser();
            infoExecutionPeriod = ReadCurrentExecutionPeriod.run();
            request.setAttribute(PresentationConstants.INFO_EXECUTION_PERIOD_KEY, infoExecutionPeriod);
        }
        return infoExecutionPeriod;
    }
View Full Code Here


    public ActionForward nextPage(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
            throws Exception {
        DynaActionForm escolherContextoForm = (DynaActionForm) form;

        User userView = Authenticate.getUser();

        String nextPage = (String) request.getAttribute(PresentationConstants.NEXT_PAGE);
        if (nextPage == null) {
            nextPage = request.getParameter(PresentationConstants.NEXT_PAGE);
        }
View Full Code Here

public class ShowStudentStatutesDA extends FenixDispatchAction {

    @EntryPoint
    @Override
    public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) {
        User userView = getUserView(request);
        Student student = userView.getPerson().getStudent();
        ArrayList<StudentStatute> studentStatutes = new ArrayList<StudentStatute>(student.getStudentStatutesSet());
        Collections.sort(studentStatutes, new BeanComparator("beginExecutionPeriod.beginDateYearMonthDay"));
        request.setAttribute("studentStatutes", studentStatutes);
        return mapping.findForward("studentStatutes");
    }
View Full Code Here

public class UnEnrollStudentInGroupDispatchAction extends FenixDispatchAction {

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

        User userView = getUserView(request);

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

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

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

        } catch (NotAuthorizedException e) {
            ActionErrors actionErrors = new ActionErrors();
            ActionError error = null;
            error = new ActionError("errors.noStudentInAttendsSetToDelete");
View Full Code Here

    }

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

        User userView = getUserView(request);
        String userName = userView.getUsername();

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

        Boolean shiftWithGroups;
        try {
View Full Code Here

        request.setAttribute("emergencyContactBean", emergencyContactBean);
        return super.execute(mapping, form, request, response);
    }

    private Person getLoggedUser() {
        User user = Authenticate.getUser();
        return (user == null) ? null : user.getPerson();
    }
View Full Code Here

        return null;
    }

    public ActionForward retrieveOwnPhoto(ActionMapping mapping, ActionForm form, HttpServletRequest request,
            HttpServletResponse response) {
        final User userView = Authenticate.getUser();
        final Photograph personalPhoto = userView.getPerson().getPersonalPhotoEvenIfPending();
        if (personalPhoto != null) {
            writePhoto(response, personalPhoto);
            return null;
        }
        writeUnavailablePhoto(response);
View Full Code Here

                        continue;
                    }
                }
                Party party = accountability.getChildParty();
                if (party instanceof Person) {
                    User user = ((Person) party).getUser();
                    if (user != null) {
                        users.add(user);
                    }
                }
            }
View Full Code Here

            }
        } else if (!StringUtils.isEmpty(getName())) {
            students.addAll(Person.findPersonStream(getName(), Integer.MAX_VALUE).map(p -> p.getStudent())
                    .filter(Objects::nonNull).collect(Collectors.toSet()));
        } else if (!StringUtils.isEmpty(getUsername())) {
            User user = User.findByUsername(getUsername());
            if (user != null && user.getPerson().getStudent() != null) {
                students.add(user.getPerson().getStudent());
            }
        }

        return students;
    }
View Full Code Here

public class EditWrittenEvaluationAuthorization extends Filtro {

    public static final EditWrittenEvaluationAuthorization instance = new EditWrittenEvaluationAuthorization();

    public void execute(String writtenEvaluationId) throws NotAuthorizedException {
        final User userView = Authenticate.getUser();

        if (!userView.getPerson().hasRole(RoleType.RESOURCE_ALLOCATION_MANAGER)) {

            final WrittenEvaluation writtenEvaluation = readWrittenEvaluation(writtenEvaluationId);

            if (writtenEvaluation.getWrittenEvaluationSpaceOccupationsSet().size() > 0) {
                throw new NotAuthorizedException("written.evaluation.has.allocated.rooms");
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.