Package org.fao.geonet.repository

Examples of org.fao.geonet.repository.CswCapabilitiesInfo


        assertEquals("ok", results.getText());

        assertEquals("false", _settingsRepository.findOne("system/csw/enable").getValue());
        assertEquals("2", _settingsRepository.findOne("system/csw/contactId").getValue());

        final CswCapabilitiesInfo eng = _infoRepository.findCswCapabilitiesInfo("eng");
        final CswCapabilitiesInfo fre = _infoRepository.findCswCapabilitiesInfo("fre");
        final CswCapabilitiesInfo ger = _infoRepository.findCswCapabilitiesInfo("ger");
        final CswCapabilitiesInfo ita = _infoRepository.findCswCapabilitiesInfo("ita");

        assertEquals("en ti", eng.getTitle());
        assertEquals("fr ti", fre.getTitle());
        assertEquals("ge ti", ger.getTitle());
        assertEquals("", ita.getTitle());

        assertEquals("en ab", eng.getAbstract());
        assertEquals("fr ab", fre.getAbstract());
        assertEquals("ge ab", ger.getAbstract());
View Full Code Here


    private void saveCswCapabilitiesInfo(MultiValueMap parameters) throws Exception {

        final List<Language> langs = languageRepository.findAll();

        for (Language lang : langs) {
            CswCapabilitiesInfo cswCapInfo = cswCapabilitiesInfoFieldRepository.findCswCapabilitiesInfo(lang.getId());

            String langId = lang.getId();
            if (parameters.get("csw.title_" + langId) != null) {
                String title = (String)((LinkedList) parameters.get("csw.title_" + langId)).get(0);
                if (StringUtils.isNotEmpty(title)) {
                    cswCapInfo.setTitle(title);
                }
            }
            if (parameters.get("csw.abstract_" + langId) != null) {
                String abs = (String)((LinkedList) parameters.get("csw.abstract_" + langId)).get(0);
                if (StringUtils.isNotEmpty(abs)) {
                    cswCapInfo.setAbstract(abs);
                }
            }

            if (parameters.get("csw.fees_" + langId) != null) {
                String fees = (String)((LinkedList) parameters.get("csw.fees_" + langId)).get(0);
                if (StringUtils.isNotEmpty(fees)) {
                    cswCapInfo.setFees(fees);
                }
            }
            if (parameters.get("csw.accessConstraints_" + langId) != null) {
                String accessConstraints = (String)((LinkedList) parameters.get("csw.accessConstraints_" + langId)).get(0);
                if (StringUtils.isNotEmpty(accessConstraints)) {
                    cswCapInfo.setAccessConstraints(accessConstraints);
                }
            }


            // Save item
View Full Code Here

        List<CswCapabilitiesInfoField> toSave = new ArrayList<CswCapabilitiesInfoField>();

        final CswCapabilitiesInfoFieldRepository capabilitiesInfoFieldRepository = serviceContext.getBean(CswCapabilitiesInfoFieldRepository.class);
        for (Language language : languages) {
            CswCapabilitiesInfo cswCapInfo = capabilitiesInfoFieldRepository.findCswCapabilitiesInfo(language.getId());

            final String langId = language.getId();
            cswCapInfo.setTitle(getValue(params, "csw.title_" + langId));
            cswCapInfo.setAbstract(getValue(params, "csw.abstract_" + langId));
            cswCapInfo.setFees(getValue(params, "csw.fees_" + langId));
            cswCapInfo.setAccessConstraints(getValue(params, "csw.accessConstraints_" + langId));

            toSave.addAll(cswCapInfo.getFields());
        }

        capabilitiesInfoFieldRepository.save(toSave);
    }
View Full Code Here

            } else {
                currentLanguage = context.getLanguage();
            }

            final CswCapabilitiesInfoFieldRepository infoRepository = context.getBean(CswCapabilitiesInfoFieldRepository.class);
            CswCapabilitiesInfo cswCapabilitiesInfo = infoRepository.findCswCapabilitiesInfo(currentLanguage);

            // Retrieve contact data from users table
            String contactId = gc.getBean(SettingManager.class).getValue("system/csw/contactId");
            if ((contactId == null) || (contactId.equals(""))) {
                contactId = "-1";
View Full Code Here

TOP

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

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.