Package org.fao.geonet.repository

Examples of org.fao.geonet.repository.LanguageRepository


                    .setDescription(description)
                    .setEmail(email)
                    .setLogo(logoUUID)
                    .setWebsite(website);

            final LanguageRepository langRepository = context.getBean(LanguageRepository.class);
            java.util.List<Language> allLanguages = langRepository.findAll();
            for (Language l : allLanguages) {
                group.getLabelTranslations().put(l.getId(), name);
            }

            groupRepository.save(group);
View Full Code Here


            // INSPIRE: Use language parameter if available, otherwise use default (using context.getLanguage())           
            if (inspireEnabled) {
                String isoLangParamValue = request.getAttributeValue("language");


                final LanguageRepository languageRepository = context.getBean(LanguageRepository.class);
                List<Language> languageList = languageRepository.findAllByInspireFlag(true);

                List<String> langCodes = Lists.transform(languageList, new Function<Language, String>() {
                    @Nullable
                    @Override
                    public String apply(@Nonnull Language input) {
                        return input.getId();
                    }
                });

                if (isoLangParamValue != null) {
                    // Retrieve GN language id from Iso language id
                    if (langCodes.contains(isoLangParamValue)) {
                        currentLanguage = isoLangParamValue;
                    }
                }


                Language defaultLanguage = languageRepository.findOneByDefaultLanguage();

                if (StringUtils.isEmpty(currentLanguage)) {
                    currentLanguage = defaultLanguage.getId();
                }
View Full Code Here

TOP

Related Classes of org.fao.geonet.repository.LanguageRepository

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.