Package org.fenixedu.academic.domain

Examples of org.fenixedu.academic.domain.Degree$ComparatorByDegreeTypeAndNameAndId


    @Override
    public Object provide(Object source, Object currentValue) {

        final DegreesMergeBean degreeBean = (DegreesMergeBean) source;

        Degree destinationDegree = degreeBean.getDestinationDegree();

        List<ExecutionCourse> destinationExecutionCourses =
                destinationDegree.getExecutionCourses(degreeBean.getAcademicInterval());

        Collections.sort(destinationExecutionCourses, DomainObjectUtil.COMPARATOR_BY_ID);

        removeDuplicates(destinationExecutionCourses);
View Full Code Here


    @Override
    public Object provide(Object source, Object currentValue) {

        final DegreesMergeBean degreeBean = (DegreesMergeBean) source;

        Degree sourceDegree = degreeBean.getSourceDegree();

        List<ExecutionCourse> sourceExecutionCourses = sourceDegree.getExecutionCourses(degreeBean.getAcademicInterval());

        Collections.sort(sourceExecutionCourses, DomainObjectUtil.COMPARATOR_BY_ID);

        removeDuplicates(sourceExecutionCourses);
View Full Code Here

        return getDegree() == bean.getDegree();
    }

    @Override
    public int hashCode() {
        Degree degree = getDegree();
        if (degree != null) {
            return getDegree().hashCode();
        } else {
            return 0;
        }
View Full Code Here

        final String searchValue = StringNormalizer.normalize(value);

        final List<ExecutionDegree> result = new ArrayList<ExecutionDegree>();
        for (final ExecutionDegree executionDegree : executionYear.getExecutionDegreesSet()) {
            final DegreeCurricularPlan degreeCurricularPlan = executionDegree.getDegreeCurricularPlan();
            final Degree degree = degreeCurricularPlan.getDegree();
            if (match(searchValue, degreeCurricularPlan.getName())
                    || match(searchValue, degree.getNameI18N(executionYear).getContent())
                    || match(searchValue, degree.getSigla())) {
                result.add(executionDegree);
                if (result.size() >= maxCount) {
                    break;
                }
            }
View Full Code Here

            Collections.sort(result, Degree.COMPARATOR_BY_NAME);
        } else {
            result = Collections.EMPTY_LIST;
        }

        final Degree currentSelectedDegree = (Degree) currentValue;
        if (!result.contains(currentSelectedDegree)) {
            optionalEnrollmentBean.setDegree(null);
        }

        return result;
View Full Code Here

            return;
        }

        final Map attributes = getAttributes();

        final Degree degree = (Degree) attributes.get("degree");
        final String trailingCrumb = (String) attributes.get("trailingCrumb");

        final ResponseWriter responseWriter = context.getResponseWriter();

        final String institutionUrl = Installation.getInstance().getInstituitionURL();
        final String institutionNameAbbreviation = Unit.getInstitutionAcronym();
        final String linkInstitution = BundleUtil.getString(Bundle.GLOBAL, "link.institution");
        final String labelEducation = BundleUtil.getString(Bundle.DEGREE, "public.degree.information.label.education").toString();

        writeLink(responseWriter, institutionUrl, institutionNameAbbreviation);
        responseWriter.write(CRUMB_SEPERATOR);
        writeLink(responseWriter, institutionUrl + linkInstitution, labelEducation);
        responseWriter.write(CRUMB_SEPERATOR);
        if (degree != null) {
            writeLink(responseWriter,
                    context.getExternalContext().getRequestContextPath() + DEGREE_SITE_LINK + degree.getExternalId(),
                    degree.getSigla());
            responseWriter.write(CRUMB_SEPERATOR);
            responseWriter.write(trailingCrumb);
        }
        // writeBR(responseWriter);
        // writeBR(responseWriter);
View Full Code Here

                    && degree.getDegreeType().equals(degreeType)) {
                throw new FenixServiceException("error.existing.degree.name.and.type");
            }
        }

        new Degree(name, nameEn, acronym, degreeType, ectsCredits, gradeScale, prevailingScientificArea, administrativeOffice);
    }
View Full Code Here

        final Person creator = AccessControl.getPerson();
        if (creator == null) {
            throw new FenixServiceException("error.degreeCurricularPlan.non.existing.creator");
        }

        final Degree degree = FenixFramework.getDomainObject(degreeId);
        if (degree == null) {
            throw new FenixServiceException("error.degreeCurricularPlan.non.existing.degree");
        }

        degree.createBolonhaDegreeCurricularPlan(name, gradeScale, creator);
    }
View Full Code Here

        check(RolePredicates.SCIENTIFIC_COUNCIL_PREDICATE);
        if (externalId == null) {
            throw new InvalidArgumentsServiceException();
        }

        final Degree degreeToDelete = FenixFramework.getDomainObject(externalId);

        if (degreeToDelete == null) {
            throw new NonExistingServiceException();
        } else {
            degreeToDelete.delete();
        }
    }
View Full Code Here

        check(RolePredicates.SCIENTIFIC_COUNCIL_PREDICATE);
        if (externalId == null || name == null || nameEn == null || acronym == null || degreeType == null || ectsCredits == null) {
            throw new InvalidArgumentsServiceException();
        }

        final Degree degreeToEdit = FenixFramework.getDomainObject(externalId);

        if (degreeToEdit == null) {
            throw new NonExistingServiceException();
        } else if (!degreeToEdit.getSigla().equalsIgnoreCase(acronym)
                || !degreeToEdit.getNameFor(executionYear).getContent(MultiLanguageString.pt).equalsIgnoreCase(name)
                || !degreeToEdit.getDegreeType().equals(degreeType)) {

            final List<Degree> degrees = Degree.readNotEmptyDegrees();

            // assert unique degree code and unique pair name/type
            for (Degree degree : degrees) {
                if (degree != degreeToEdit) {
                    if (degree.getSigla().equalsIgnoreCase(acronym)) {
                        throw new FenixServiceException("error.existing.degree.acronym");
                    }
                    if ((degree.getNameFor(executionYear).getContent(MultiLanguageString.pt).equalsIgnoreCase(name) || degree
                            .getNameFor(executionYear).getContent(MultiLanguageString.en).equalsIgnoreCase(nameEn))
                            && degree.getDegreeType().equals(degreeType)) {
                        throw new FenixServiceException("error.existing.degree.name.and.type");
                    }
                }
            }
        }

        degreeToEdit.edit(name, nameEn, acronym, degreeType, ectsCredits, gradeScale, prevailingScientificArea, executionYear);
    }
View Full Code Here

TOP

Related Classes of org.fenixedu.academic.domain.Degree$ComparatorByDegreeTypeAndNameAndId

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.