Package org.fenixedu.academic.domain

Examples of org.fenixedu.academic.domain.Country


        new CurricularYear(Integer.valueOf(4), 2);
        new CurricularYear(Integer.valueOf(5), 2);
    }

    private static Country createCountries(SchoolSetupSection schoolSection) {
        Country defaultCountry = null;
        for (pt.ist.standards.geographic.Country metaData : Planet.getEarth().getPlaces()) {
            String localizedNamePT = null;
            try {
                localizedNamePT = metaData.getLocalizedName(PT);
            } catch (MissingResourceException e) {
            }

            String localizedNameEN = null;
            try {
                localizedNameEN = metaData.getLocalizedName(EN);
            } catch (MissingResourceException e) {
            }

            if (localizedNameEN == null && localizedNamePT == null) {
                continue;
            }

            if (localizedNamePT == null) {
                localizedNamePT = localizedNameEN;
            }

            if (localizedNameEN == null) {
                localizedNameEN = localizedNamePT;
            }
            String nationalityPT = null;
            try {
                nationalityPT = metaData.getNationality(PT);
            } catch (MissingResourceException e) {
            }

            String nationalityEN = null;
            try {
                nationalityEN = metaData.getNationality(EN);
            } catch (MissingResourceException e) {
            }

            if (nationalityPT == null) {
                if (nationalityEN == null) {
                    nationalityPT = localizedNamePT;
                } else {
                    nationalityPT = nationalityEN;
                }
            }

            if (nationalityEN == null) {
                if (nationalityPT == null) {
                    nationalityEN = localizedNameEN;
                } else {
                    nationalityEN = nationalityPT;
                }
            }

            final MultiLanguageString countryName = new MultiLanguageString(MultiLanguageString.pt, localizedNamePT);
            countryName.append(new MultiLanguageString(MultiLanguageString.en, localizedNameEN));

            final String code = metaData.alpha2;
            final String threeLetterCode = metaData.alpha3;

            final Country country =
                    new Country(countryName,
                            new MultiLanguageString(MultiLanguageString.pt, nationalityPT).append(new MultiLanguageString(
                                    MultiLanguageString.en, nationalityEN)), code, threeLetterCode);
            if (StringUtils.equals(threeLetterCode, schoolSection.getCountryCode().toUpperCase())) {
                defaultCountry = country;
            }
View Full Code Here


    public FiliationForm() {
        super();
    }

    public static FiliationForm createFromPerson(final Person person) {
        final Country nationality = person.getCountry() != null ? person.getCountry() : Country.readDefault();
        final Country countryOfBirth = person.getCountryOfBirth() != null ? person.getCountryOfBirth() : Country.readDefault();

        return new FiliationForm(person.getDateOfBirthYearMonthDay(), person.getDistrictOfBirth(),
                person.getDistrictSubdivisionOfBirth(), person.getNameOfFather(), person.getNameOfMother(), nationality,
                person.getParishOfBirth(), countryOfBirth);
    }
View Full Code Here

    }

    public static ResidenceInformationForm createFromPerson(final Person person) {
        if (person.hasDefaultPhysicalAddress()) {
            final PhysicalAddress physicalAddress = person.getDefaultPhysicalAddress();
            final Country country = getCountryOfResidenceFromPhysicalAddress(physicalAddress);
            final District districtOfResidence =
                    physicalAddress.getDistrictOfResidence() != null ? District.readByName(physicalAddress
                            .getDistrictOfResidence()) : null;

            final DistrictSubdivision districtSubdivisionOfResidence;
View Full Code Here

        if (!isValid()) {
            generateToken();
            final String number = getNumber();
            final String token = getToken();
            final Person person = (Person) getPartyContact().getParty();
            final Country country = person.getCountry();
            final String language = Country.isCPLPCountry(country) ? "pt" : "en";

            if (PhoneUtil.isFixedNumber(number) || !PhoneUtil.isPortugueseNumber(number)) {
                PhoneValidationUtils.getInstance().makeCall(PhoneUtil.getInternacionalFormatNumber(number), token, language);
            } else if (PhoneUtil.isMobileNumber(number)) {
View Full Code Here

    }

    @Override
    public Object provide(Object source, Object currentValue) {
        MobilityStudentDataBean bean = (MobilityStudentDataBean) source;
        Country selectedCountry = bean.getSelectedCountry();
        MobilityApplicationPeriod period = (MobilityApplicationPeriod) bean.getParentProcess().getCandidacyPeriod();

        List<UniversityUnit> universityUnitList = period.getUniversityUnitsAssociatedToCountry(selectedCountry);
        Collections.sort(universityUnitList, new BeanComparator("nameI18n"));
View Full Code Here

        }
        return edc;
    }

    private int compareCountries(final OutboundMobilityCandidacyContest o) {
        final Country c1 = getMobilityAgreement().getUniversityUnit().getCountry();
        final Country c2 = o.getMobilityAgreement().getUniversityUnit().getCountry();
        return c1 == c2 ? 0 : (c1 != null && c2 != null ? c1.getName().compareTo(c2.getName()) : (c1 == null ? -1 : 1));
    }
View Full Code Here

                final OutboundMobilityCandidacyContestGroup group = contest.getOutboundMobilityCandidacyContestGroup();
                final MobilityAgreement mobilityAgreement = contest.getMobilityAgreement();
                final MobilityProgram mobilityProgram = mobilityAgreement.getMobilityProgram();
                final RegistrationProtocol registrationProtocol = mobilityProgram.getRegistrationProtocol();
                final UniversityUnit universityUnit = mobilityAgreement.getUniversityUnit();
                final Country country = universityUnit.getCountry();

                final Row candidacyRow = spreadsheetCandidates.addRow();
                candidacyRow.setCell(getString("label.mobility.program"), registrationProtocol.getDescription().getContent());
                candidacyRow.setCell(getString("label.country"), country == null ? "" : country.getLocalizedName().toString());
                candidacyRow.setCell(getString("label.university"), universityUnit.getPresentationName());
                candidacyRow.setCell(getString("label.degrees"), group.getDescription());
                candidacyRow.setCell(getString("label.vacancies"), contest.getVacancies());
                candidacyRow.setCell(getString("label.username"), person.getUsername());
                candidacyRow.setCell(getString("label.name"), person.getName());
View Full Code Here

                    for (final OutboundMobilityCandidacy c : submission.getSortedOutboundMobilityCandidacySet()) {
                        final OutboundMobilityCandidacyContest contestFromCandidacy = c.getOutboundMobilityCandidacyContest();
                        final MobilityAgreement mobilityAgreement = contestFromCandidacy.getMobilityAgreement();
                        final UniversityUnit unit = mobilityAgreement.getUniversityUnit();
                        final Country country = unit.getCountry();

                        final Row row2 = spreadsheetOptions.addRow();
                        row2.setCell(getString("label.username"), person.getUsername());
                        row2.setCell(getString("label.preference.order"), c.getPreferenceOrder());
                        row2.setCell(getString("label.degrees"), contestFromCandidacy.getOutboundMobilityCandidacyContestGroup()
                                .getDescription());
                        row2.setCell(getString("label.mobility.program"), mobilityAgreement.getMobilityProgram()
                                .getRegistrationProtocol().getDescription().getContent());
                        row2.setCell(getString("label.country"), country == null ? "" : country.getName());
                        row2.setCell(getString("label.university"), unit.getPresentationName());
                    }

                    final Row contactRow = spreadsheetContactInformation.addRow();
                    contactRow.setCell(getString("label.username"), person.getUsername());
View Full Code Here

    public Country getCountry() {
        if (super.getCountry() != null) {
            return super.getCountry();
        }
        for (final Unit unit : getParentUnits()) {
            final Country country = unit.getCountry();
            if (country != null) {
                return country;
            }
        }
        return null;
View Full Code Here

TOP

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

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.