Package org.fenixedu.academic.domain

Examples of org.fenixedu.academic.domain.Person


    protected ExecutionCourse getExecutionCourse(HttpServletRequest request) {
        return (ExecutionCourse) request.getAttribute("executionCourse");
    }

    private static Professorship findProfessorship(final HttpServletRequest request, final String executionCourseID) {
        final Person person = AccessControl.getPerson();
        if (person != null) {
            for (final Professorship professorship : person.getProfessorshipsSet()) {
                final ExecutionCourse executionCourse = professorship.getExecutionCourse();
                if (executionCourse.getExternalId().equals(executionCourseID)) {
                    return professorship;
                }
            }
View Full Code Here


        if (isCancelled(request)) {
            RenderUtils.invalidateViewState();
            return prepareAssociateTeacher(mapping, form, request, response);
        }

        Person person = Person.readPersonByUsername(request.getParameter("teacherId"));

        if (person != null) {
            try {
                if (person.getTeacher().hasTeacherAuthorization()) {
                    Professorship professorship = Professorship.create(false, getExecutionCourse(request), person, 0.0);
                    request.setAttribute("teacherOID", professorship.getExternalId());
                } else {
                    final ActionMessages actionErrors = new ActionErrors();
                    actionErrors.add("error", new ActionMessage("label.invalid.teacher.without.auth"));
View Full Code Here

        return executionDegrees;
    }

    public Person getPerson(DynaActionForm personExecutionCourseForm) {
        String id = (String) personExecutionCourseForm.get("teacherId");
        Person person = Person.readPersonByUsername(id);
        return person;
    }
View Full Code Here

    public ActionForward showExecutionDegrees(ActionMapping mapping, ActionForm form, HttpServletRequest request,
            HttpServletResponse response) throws Exception {
        DynaValidatorForm personExecutionCourseForm = (DynaValidatorForm) form;

        String personId = (String) personExecutionCourseForm.get("teacherId");
        Person person = Person.readPersonByUsername(personId);
        setChoosedExecutionPeriod(request, ReadNotClosedExecutionPeriods.run(), personExecutionCourseForm);
        InfoExecutionPeriod infoExecutionPeriod = (InfoExecutionPeriod) request.getAttribute("infoExecutionPeriod");
        final ExecutionSemester executionPeriod = infoExecutionPeriod.getExecutionPeriod();
        if (executionPeriod.getSemester().intValue() == 2 && executionPeriod.getExecutionYear().getYear().equals("2010/2011")) {
        } else {
            if (person.getTeacher() == null
                    || (!person.getTeacher().hasTeacherAuthorization(executionPeriod.getAcademicInterval()) && !person
                            .hasRole(RoleType.TEACHER))) {
                request.setAttribute("notAuth", true);
                return showExecutionYearExecutionPeriods(mapping, personExecutionCourseForm, request, response);
            }
        }
View Full Code Here

    }

    static void createManagerUser(AdminUserSection adminSection, SchoolSetupSection schoolSetupSection) {
        User adminUser = User.findByUsername(adminSection.getAdminUsername());
        final Person person = new Person(adminUser.getProfile());
        RoleType.grant(RoleType.SCIENTIFIC_COUNCIL, adminUser);
        RoleType.grant(RoleType.PERSONNEL_SECTION, adminUser);
        RoleType.grant(RoleType.DEPARTMENT_ADMINISTRATIVE_OFFICE, adminUser);
        RoleType.grant(RoleType.SPACE_MANAGER, adminUser);
        RoleType.grant(RoleType.SPACE_MANAGER_SUPER_USER, adminUser);
        RoleType.grant(RoleType.ACADEMIC_ADMINISTRATIVE_OFFICE, adminUser);
        RoleType.grant(RoleType.BOLONHA_MANAGER, adminUser);
        person.setCountry(Country.readDefault());
        person.setCountryOfBirth(Country.readDefault());

        EmailAddress.createEmailAddress(person, adminSection.getAdminUserEmail(), PartyContactType.PERSONAL, true, true, true,
                true);
        for (PartyContact partyContact : person.getPartyContactsSet()) {
            partyContact.setValid();
            partyContact.getPartyContactValidation().setState(PartyContactValidationState.VALID);
        }
        Authenticate.mock(adminUser);
        AcademicOperationType.MANAGE_AUTHORIZATIONS.grant(adminUser);
View Full Code Here

            for (final IndividualCandidacyDocumentFile file : candidacy.getDocumentsSet()) {
                final IndividualCandidacyDocumentFileType type = file.getCandidacyFileType();
                if (type == IndividualCandidacyDocumentFileType.PHOTO) {
                    final Registration registration = candidacy.getRegistration();
                    if (registration != null) {
                        final Person person = registration.getPerson();
                        final Photograph personalPhotoEvenIfPending = person.getPersonalPhotoEvenIfPending();
                        if (personalPhotoEvenIfPending == null) {
                            missing++;
                            final byte[] content = file.getContent();
                            if (content != null && content.length > 0) {
                                withContent++;
                                final ContentType contentType = ContentType.getContentType(file.getContentType());
                                if (contentType != null) {
                                    withContentType++;
                                    if (chew(content)) {
                                        final Photograph p = new Photograph(PhotoType.INSTITUTIONAL, contentType, content);
                                        p.setState(PhotoState.APPROVED);
                                        person.setPersonalPhoto(p);
                                        fixed++;
                                    } else {
                                        unableToProcessImage++;
                                    }
                                }
View Full Code Here

public class ExemptionsManagementDispatchAction extends PaymentsManagementDispatchAction {

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

        final Person person = getPerson(request);
        request.setAttribute("person", person);
        request.setAttribute("eventsToApplyExemption", person.getEventsWithExemptionAppliable());

        return mapping.findForward("showEventsToApplyExemption");
    }
View Full Code Here

    public ActionForward prepareEditPersonalData(ActionMapping mapping, ActionForm form, HttpServletRequest request,
            HttpServletResponse response) {
        final PhdProgramCandidacyProcess process = getProcess(request);
        final PhdProgramCandidacyProcessBean bean = new PhdProgramCandidacyProcessBean(process);
        Person person = process.getPerson();
        PersonBean personBean = new PersonBean(person);
        bean.setPersonBean(personBean);

        /* TODO: UGLY HACK DUE TO PENDING VALIDATION DATA FOR PERSON */
        initPersonBeanUglyHack(personBean, person);
View Full Code Here

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

        final PhdProgramCandidacyProcessBean bean = getCandidacyBean();
        final PhdIndividualProgramProcess individualProgramProcess = bean.getCandidacyHashCode().getIndividualProgramProcess();
        final Person person = individualProgramProcess.getPerson();

        canEditPersonalInformation(request, person);
        bean.setPersonBean(new PersonBean(person));

        /* TODO: UGLY HACK DUE TO PENDING VALIDATION DATA FOR PERSON */
 
View Full Code Here

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

        final PhdProgramCandidacyProcessBean bean = getCandidacyBean();
        final PhdIndividualProgramProcess individualProgramProcess = bean.getCandidacyHashCode().getIndividualProgramProcess();
        final Person person = individualProgramProcess.getPerson();
        canEditPersonalInformation(request, person);

        PersonBean personBean = bean.getPersonBean();
        final String familyName = personBean.getFamilyNames();
        final String composedName =
View Full Code Here

TOP

Related Classes of org.fenixedu.academic.domain.Person

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.