use of org.obiba.mica.micaConfig.service.helper.AggregationMetaDataProvider in project mica2 by obiba.
the class AggregationMetaDataResolver method getMetaData.
public AggregationMetaDataProvider.MetaData getMetaData(String aggregation, String termKey, String locale) {
if (!aggregationProviderMap.containsKey(aggregation)) {
boolean found = false;
for (AggregationMetaDataProvider provider : providers) {
if (provider.containsAggregation(aggregation)) {
aggregationProviderMap.put(aggregation, provider);
found = true;
break;
}
}
if (!found)
aggregationProviderMap.put(aggregation, null);
}
AggregationMetaDataProvider provider = aggregationProviderMap.get(aggregation);
if (provider == null)
return defaultAggregationTitleProvider.getMetadata(aggregation, termKey, locale);
AggregationMetaDataProvider.MetaData md = provider.getMetadata(aggregation, termKey, locale);
return md != null ? md : defaultAggregationTitleProvider.getMetadata(aggregation, termKey, locale);
}
Aggregations