use of ar.com.fdvs.dj.domain.builders.ColumnBuilderException in project Asqatasun by Asqatasun.
the class ElementColumnBuilderImpl method getElementColumn.
@Override
public AbstractColumn getElementColumn(Locale locale) {
ColumnBuilder columnBuilder = ColumnBuilder.getNew();
columnBuilder.setWidth(columnWidth);
if (propertyName != null && valueClassName != null) {
columnBuilder.setColumnProperty(propertyName, valueClassName);
}
if (customExpressionBuilder != null) {
columnBuilder.setCustomExpression(customExpressionBuilder.build(locale));
}
if (style != null) {
columnBuilder.setStyle(style);
}
if (headerStyle != null) {
columnBuilder.setHeaderStyle(headerStyle);
}
if (columnTitleBundleName != null) {
ResourceBundle bundle = ResourceBundle.getBundle(columnTitleBundleName, locale);
if (columnTitleKey != null) {
columnBuilder.setTitle(StringEscapeUtils.unescapeHtml4(bundle.getString(columnTitleKey)));
}
}
if (conditionalStyleBuilderList != null && !conditionalStyleBuilderList.isEmpty()) {
columnBuilder.addConditionalStyles(buildConditionStyleList(locale));
}
AbstractColumn elementColumn = null;
try {
elementColumn = columnBuilder.build();
} catch (ColumnBuilderException ex) {
LOGGER.error(ex);
}
return elementColumn;
}
use of ar.com.fdvs.dj.domain.builders.ColumnBuilderException in project Asqatasun by Asqatasun.
the class AuditExportResultController method prepareSuccessfullAuditDataToExport.
/**
*
* @param page
* @param model
* @param locale
* @param exportFormat
* @param request
* @param response
* @return
* @throws IOException
*/
private void prepareSuccessfullAuditDataToExport(WebResource webResource, Model model, Locale locale, String exportFormat, HttpServletRequest request, HttpServletResponse response) throws NotSupportedExportFormatException {
model.addAttribute(TgolKeyStore.LOCALE_KEY, locale);
Scope scope = getSiteScope();
if (webResource instanceof Page) {
scope = getPageScope();
}
List<TestResult> testResultList = TestResultFactory.getInstance().getTestResultList(webResource, scope, getLocaleResolver().resolveLocale(request));
AuditStatistics auditStatistics = getAuditStatistics(webResource, model, TgolKeyStore.TEST_DISPLAY_SCOPE_VALUE, //TODO a revoir dans le cas manuel
false);
model.addAttribute(TgolKeyStore.STATISTICS_KEY, auditStatistics);
try {
exportService.export(response, webResource.getId(), auditStatistics, testResultList, locale, exportFormat);
} catch (ColumnBuilderException | ClassNotFoundException | JRException ex) {
LOGGER.error(ex);
}
}
Aggregations