String dataProviderName;
try {
if (property.isStaticProperty())
dataProviderName = getBundle().getString(DashboardFilterHandler.I18N_PREFFIX + "staticProperty");
else {
DataProvider provider = getDashboardFilterHandler().getDashboard().getDataProviderByCode(property.getDataProviderCode());
dataProviderName = provider.getDescription(getLocale());
}
} catch (Exception e) {
log.error("Cannot get data provider with code " + property.getDataProviderCode());
continue;
}
setAttribute("index",new Integer(i));
setAttribute("dataProviderCode",property.getDataProviderCode());
setAttribute("propertyId",property.getPropertyId());
setAttribute("visibleChecked",Boolean.valueOf(property.isVisible()));
setAttribute("drillDownChecked",Boolean.valueOf(property.isDrillDownEnabled()));
setAttribute("sectionId",property.getSectionId());
// Drill down page title.
String currentSectionTitle = "-- " + getBundle().getString(DashboardFilterHandler.I18N_PREFFIX + "select") + " --";
Section section = property.getDrillDownPage();
if (section != null) currentSectionTitle = getLocalizedValue(section.getTitle());
setAttribute("currentSectionTitle", StringEscapeUtils.escapeHtml(currentSectionTitle));
setAttribute("dataProviderName", StringEscapeUtils.escapeHtml(dataProviderName));
setAttribute("propertyName",StringEscapeUtils.escapeHtml(property.getPropertyName(getLocale())));
renderFragment("outputTableElement");
}
}
// Render not allowed proeprties.
List notAllowedProps = getDashboardFilterHandler().getNotAllowedProperties();
if (!notAllowedProps.isEmpty()) {
renderFragment("outputNotAllowedPropertiesStart");
Iterator it = notAllowedProps.iterator();
while (it.hasNext()) {
DashboardFilterProperty dashboardFilterProperty = (DashboardFilterProperty) it.next();
DataProvider provider = getDashboardFilterHandler().getDashboard().getDataProviderByCode(dashboardFilterProperty.getDataProviderCode());
String dataProviderName = StringEscapeUtils.escapeHtml(provider.getDescription(getLocale()));
setAttribute("dataProviderName", dataProviderName);
setAttribute("propertyName", StringEscapeUtils.escapeHtml(dashboardFilterProperty.getPropertyName(getLocale())));
renderFragment("outputNotAllowedProperty");
}
renderFragment("outputNotAllowedPropertiesEnd");