Search in sources :

Example 6 with LanguageSpecificText

use of org.openforis.idm.metamodel.LanguageSpecificText in project collect by openforis.

the class CodeListLine method addLocalizedText.

private void addLocalizedText(Map<Integer, List<LanguageSpecificText>> levelToLocalizedTexts, int levelIdx, String lang, String label) {
    List<LanguageSpecificText> labelItems = levelToLocalizedTexts.get(levelIdx);
    LanguageSpecificText item = new LanguageSpecificText(lang, label);
    if (labelItems == null) {
        labelItems = new ArrayList<LanguageSpecificText>();
        levelToLocalizedTexts.put(levelIdx, labelItems);
    }
    labelItems.add(item);
}
Also used : LanguageSpecificText(org.openforis.idm.metamodel.LanguageSpecificText)

Example 7 with LanguageSpecificText

use of org.openforis.idm.metamodel.LanguageSpecificText in project collect by openforis.

the class LanguageSpecificTextXS method marshal.

protected void marshal(List<? extends LanguageSpecificText> txts, String defaultLanguage) throws IOException {
    if (txts == null || txts.isEmpty()) {
        super.marshal(txts);
    } else {
        startList();
        for (LanguageSpecificText txt : txts) {
            // do not include default language in marshalled XML
            boolean includeLang = txt.getLanguage() != null && !txt.getLanguage().equals(defaultLanguage);
            marshal(txt, includeLang);
        }
        endList();
    }
}
Also used : LanguageSpecificText(org.openforis.idm.metamodel.LanguageSpecificText)

Aggregations

LanguageSpecificText (org.openforis.idm.metamodel.LanguageSpecificText)7 CodeListItem (org.openforis.idm.metamodel.CodeListItem)2 UITab (org.openforis.collect.metamodel.ui.UITab)1