Package org.fenixedu.academic.domain

Examples of org.fenixedu.academic.domain.Department


    public ActionForward remove(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
            throws FenixActionException, FenixServiceException {
        final String departmentString = request.getParameter("departmentID");
        final String degreeString = request.getParameter("degreeID");
        final Department department = FenixFramework.getDomainObject(departmentString);
        final Degree degree = FenixFramework.getDomainObject(degreeString);
        RemoveDegreeFromDepartment.run(department, degree);
        final DepartmentDegreeBean departmentDegreeBean = new DepartmentDegreeBean();
        departmentDegreeBean.setDepartment(department);
        return forwardToPage(mapping, request, departmentDegreeBean);
View Full Code Here


            this.degree = degree;
        }

        @Override
        public Object execute() {
            final Department department = getDepartment();
            final Degree degree = getDegree();
            if (department != null && degree != null) {
                department.getDegreesSet().add(degree);
            }
            return null;
        }
View Full Code Here

        return list(mapping, form, request, response);
    }

    @Atomic
    private void createDepartment(AssociatedObjectsBean bean) {
        Department department = new Department();
        department.setCompetenceCourseMembersGroup(RoleType.MANAGER.actualGroup());
        department.setActive(bean.isActive());
        department.setCode(bean.getCode());
        department.setName(bean.getName());
        department.setRealName(bean.getRealName());
        department.setName(bean.getName());
        department.setRealNameEn(bean.getRealNameEn());
        department.setRootDomainObject(Bennu.getInstance());
        DepartmentUnit.createNewInternalDepartmentUnit(department.getNameI18n(), null, null, department.getCode(),
                new YearMonthDay(), null, Bennu.getInstance().getInstitutionUnit().getSubUnits().stream()
                        .filter(x -> ((AggregateUnit) x).getName().equals("Departments")).findAny()
                        .orElse(Bennu.getInstance().getInstitutionUnit()),
                AccountabilityType.readByType(AccountabilityTypeEnum.ACADEMIC_STRUCTURE), null, department, null, false, null);
View Full Code Here

    }

    public ActionForward prepareEditDepartment(ActionMapping mapping, ActionForm form, HttpServletRequest request,
            HttpServletResponse response) throws Exception {
        AssociatedObjectsBean associatedObjectsBean = new AssociatedObjectsBean();
        Department d = FenixFramework.getDomainObject(request.getParameter("oid"));
        associatedObjectsBean.setDepartment(d);
        associatedObjectsBean.setCode(d.getCode());
        associatedObjectsBean.setName(d.getName());
        associatedObjectsBean.setRealName(d.getRealName());
        associatedObjectsBean.setRealNameEn(d.getRealNameEn());
        associatedObjectsBean.setUsername(d.getCompetenceCourseMembersGroup().getExpression());

        request.setAttribute("bean", associatedObjectsBean);

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

    }

    public ActionForward editDepartment(ActionMapping mapping, ActionForm form, HttpServletRequest request,
            HttpServletResponse response) throws Exception {
        AssociatedObjectsBean bean = getRenderedObject("admOffice");
        Department d = bean.getDepartment();

        d.setCode(d.getCode());
        d.setName(d.getName());
        d.setRealName(d.getRealName());
        d.setRealNameEn(d.getRealNameEn());
        d.setCompetenceCourseMembersGroup(Group.parse(bean.getUsername()));

        return list(mapping, form, request, response);
    }
View Full Code Here

        if ((requester == null) || !requester.hasRole(RoleType.DEPARTMENT_CREDITS_MANAGER)) {
            throw new NotAuthorizedException();
        }
        if (person.getTeacher() != null) {
            final Person requesterPerson = requester;
            Department teacherDepartment = person.getTeacher().getDepartment();
            Collection departmentsWithAccessGranted = requesterPerson.getManageableDepartmentCreditsSet();
            if (!departmentsWithAccessGranted.contains(teacherDepartment)) {
                throw new NotAuthorizedException();
            }
        }
View Full Code Here

                createDepartment(departmentUnits, i);
            }
        }

        private void createDepartment(final AggregateUnit departmentUnits, final int i) {
            final Department department = new Department();
            department.setCode(getDepartmentCode(i));
            final String departmentName = getDepartmentName(i);
            department.setName(departmentName);
            department.setRealName(departmentName);
            department.setCompetenceCourseMembersGroup(getCompetenceCourseMembersGroup());

            final DepartmentUnit departmentUnit = createDepartmentUnut(departmentUnits, 3020 + i, department);
            department.setDepartmentUnit(departmentUnit);

            createCompetenceCourseGroupUnit(departmentUnit);
        }
View Full Code Here

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

        String departmentID = request.getParameter("departmentID");
        Department department = (Department) FenixFramework.getDomainObject(departmentID);
        putChangeRequestInRequest(request, department);

        return mapping.findForward("listRequests");

    }
View Full Code Here

                    final TeacherCategory teacherCategory = TeacherCategory.find(parts[1].trim());
                    final String i = parts[2].trim();
                    final Double lessonHours =
                            StringUtils.isNumeric(i.replace(".", " ").replace(',', ' ').replace(" ", "")) ? Double.valueOf(i
                                    .replace(',', '.')) : null;
                    final Department department = Department.find(parts[3].trim());

                    if (username == null || username.isEmpty() || User.findByUsername(username) == null) {
                        messages.add(BundleUtil.getString(Bundle.SCIENTIFIC, "label.message.username.invalid",
                                Integer.toString(lineCount), parts[0].trim()));
                        continue;
View Full Code Here

    public boolean isMember(User user) {
        if (user == null || user.getPerson().getTeacher() == null) {
            return false;
        }
        final Teacher teacher = user.getPerson().getTeacher();
        final Department department = teacher.getDepartment();
        if (department != null) {
            return project.getDeparmentsSet().contains(department);
        }
        return false;
    }
View Full Code Here

TOP

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

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.