Search in sources :

Example 1 with ColumnBuilderException

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;
}
Also used : ColumnBuilderException(ar.com.fdvs.dj.domain.builders.ColumnBuilderException) ResourceBundle(java.util.ResourceBundle) ColumnBuilder(ar.com.fdvs.dj.domain.builders.ColumnBuilder) AbstractColumn(ar.com.fdvs.dj.domain.entities.columns.AbstractColumn)

Example 2 with ColumnBuilderException

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);
    }
}
Also used : AuditStatistics(org.asqatasun.webapp.presentation.data.AuditStatistics) ColumnBuilderException(ar.com.fdvs.dj.domain.builders.ColumnBuilderException) Scope(org.asqatasun.entity.reference.Scope) JRException(net.sf.jasperreports.engine.JRException) Page(org.asqatasun.entity.subject.Page) TestResult(org.asqatasun.webapp.presentation.data.TestResult)

Aggregations

ColumnBuilderException (ar.com.fdvs.dj.domain.builders.ColumnBuilderException)2 ColumnBuilder (ar.com.fdvs.dj.domain.builders.ColumnBuilder)1 AbstractColumn (ar.com.fdvs.dj.domain.entities.columns.AbstractColumn)1 ResourceBundle (java.util.ResourceBundle)1 JRException (net.sf.jasperreports.engine.JRException)1 Scope (org.asqatasun.entity.reference.Scope)1 Page (org.asqatasun.entity.subject.Page)1 AuditStatistics (org.asqatasun.webapp.presentation.data.AuditStatistics)1 TestResult (org.asqatasun.webapp.presentation.data.TestResult)1