Package org.fenixedu.academic.domain

Examples of org.fenixedu.academic.domain.Teacher


            return false;
        }

        boolean result = false;
        final BibliographicReference bibliographicReference = FenixFramework.getDomainObject(bibliographicReferenceID);
        final Teacher teacher = Teacher.readTeacherByUsername(id.getUsername());

        if (bibliographicReference != null && teacher != null) {
            final ExecutionCourse executionCourse = bibliographicReference.getExecutionCourse();
            final Iterator associatedProfessorships = teacher.getProfessorshipsIterator();
            // Check if Teacher has a professorship to ExecutionCourse
            // BibliographicReference
            while (associatedProfessorships.hasNext()) {
                Professorship professorship = (Professorship) associatedProfessorships.next();
                if (professorship.getExecutionCourse().equals(executionCourse)) {
View Full Code Here


    private boolean lecturesExecutionCourse(User id, String executionCourseID) {
        if (executionCourseID == null) {
            return false;
        }
        try {
            Teacher teacher = Teacher.readTeacherByUsername(id.getUsername());
            Professorship professorship = null;
            if (teacher != null) {
                ExecutionCourse executionCourse = FenixFramework.getDomainObject(executionCourseID);
                professorship = teacher.getProfessorshipByExecutionCourse(executionCourse);
            }
            return professorship != null;

        } catch (Exception e) {
            return false;
View Full Code Here

        if (executionCourseID == null) {
            return false;
        }
        try {

            Teacher teacher = Teacher.readTeacherByUsername(id.getUsername());
            Professorship professorship = null;
            if (teacher != null) {
                ExecutionCourse executionCourse = FenixFramework.getDomainObject(executionCourseID);
                teacher.getProfessorshipByExecutionCourse(executionCourse);
            }
            return professorship != null;

        } catch (Exception e) {
            return false;
View Full Code Here

        final List<String> auxProfessorshipTeacherIDs = new ArrayList<String>(professorShipTeachersIds);

        final List<Professorship> professorships = new ArrayList<Professorship>(executionCourse.getProfessorshipsSet());
        for (Professorship professorship : professorships) {
            final Teacher teacher = professorship.getTeacher();
            final String teacherID = teacher.getExternalId();
            if (auxProfessorshipTeacherIDs.contains(teacherID)) {
                if (responsibleTeachersIds.contains(teacherID) && !professorship.getResponsibleFor()) {
                    professorship.setResponsibleFor(Boolean.TRUE);
                } else if (!responsibleTeachersIds.contains(teacherID) && professorship.getResponsibleFor()) {
                    professorship.setResponsibleFor(Boolean.FALSE);
                }
                auxProfessorshipTeacherIDs.remove(teacherID);
            } else {
                professorship.delete();
            }
        }

        for (final String teacherID : auxProfessorshipTeacherIDs) {
            final Teacher teacher = FenixFramework.getDomainObject(teacherID);
            final Boolean isResponsible = Boolean.valueOf(responsibleTeachersIds.contains(teacherID));
            Professorship.create(isResponsible, executionCourse, teacher, null);
        }

        return Boolean.TRUE;
View Full Code Here

        final ExecutionCourse executionCourse = FenixFramework.getDomainObject(executionCourseId);
        if (executionCourse == null) {
            throw new NonExistingServiceException("message.nonExisting.executionCourse", null);
        }

        final Teacher teacher = Teacher.readByIstId(teacherId);
        if (teacher == null) {
            throw new NonExistingServiceException("message.non.existing.teacher", null);
        }
        Professorship.create(responsibleFor, executionCourse, teacher, hours);
    }
View Full Code Here

    }

    @Override
    protected boolean verifyCondition(User id, String degreeCurricularPlanID) {
        final Person person = id.getPerson();
        final Teacher teacher = person == null ? null : person.getTeacher();

        for (final Coordinator coordinator : person.getCoordinatorsSet()) {
            if (coordinator.getExecutionDegree().getDegreeCurricularPlan().getExternalId().equals(degreeCurricularPlanID)) {
                return true;
            }
View Full Code Here

    public static List<EnrolmentEvaluation> run(MarkSheetTeacherGradeSubmissionBean submissionBean)
            throws InvalidArgumentsServiceException {
        check(RolePredicates.TEACHER_PREDICATE);

        ExecutionCourse executionCourse = submissionBean.getExecutionCourse();
        Teacher teacher = submissionBean.getResponsibleTeacher();

        checkIfTeacherLecturesExecutionCourse(teacher, executionCourse);

        Map<CurricularCourse, Map<MarkSheetType, Collection<MarkSheetEnrolmentEvaluationBean>>> markSheetsInformation =
                new HashMap<CurricularCourse, Map<MarkSheetType, Collection<MarkSheetEnrolmentEvaluationBean>>>();
View Full Code Here

    public static List run(String id) throws FenixServiceException {

        final List<InfoExecutionCourse> infoExecutionCourses = new ArrayList<InfoExecutionCourse>();
        Person person = Person.readPersonByUsername(id);
        if (person.getTeacher() != null) {
            Teacher teacher = person.getTeacher();

            final List<Professorship> responsibilities = teacher.responsibleFors();

            if (responsibilities != null) {
                for (final Professorship professorship : responsibilities) {
                    infoExecutionCourses.add(InfoExecutionCourse.newInfoFromDomain(professorship.getExecutionCourse()));
                }
View Full Code Here

    }

    private Department getPersonDepartment() {
        final User userView = getUserView();
        final Person person = userView == null ? null : userView.getPerson();
        final Teacher teacher = person == null ? null : person.getTeacher();
        return teacher == null ? null : teacher.getDepartment();
    }
View Full Code Here

    }

    public Department getPersonDepartment() {
        final User userView = getUserView();
        final Person person = userView == null ? null : userView.getPerson();
        final Teacher teacher = person == null ? null : person.getTeacher();
        return teacher == null ? null : teacher.getDepartment();
    }
View Full Code Here

TOP

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

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.