use of org.obiba.opal.core.domain.taxonomy.Term in project mica2 by obiba.
the class TaxonomyAggregationMetaDataProvider method getAllLocalizedMetadata.
private Map<String, LocalizedMetaData> getAllLocalizedMetadata(String aggregation) {
Optional<Vocabulary> vocabulary = getVocabulary(aggregation);
if (vocabulary.isPresent()) {
Map<String, LocalizedMetaData> r = Maps.newHashMap();
for (Term t : vocabulary.get().getTerms()) {
LocalizedString title = new LocalizedString();
title.putAll(t.getTitle());
LocalizedString description = new LocalizedString();
description.putAll(t.getDescription());
String className = t.getAttributeValue("className");
if (Strings.isNullOrEmpty(className)) {
className = t.getClass().getSimpleName();
}
if (!r.containsKey(t.getName())) {
r.put(t.getName(), new LocalizedMetaData(title, description, className));
}
}
return r;
}
return null;
}
Aggregations