Search in sources :

Example 6 with TestResult

use of org.asqatasun.webapp.dto.TestResult in project Asqatasun by Asqatasun.

the class AuditExportResultController method prepareSuccessfullAuditDataToExport.

/**
 * @param webResource
 * @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 = siteScope;
    if (webResource instanceof Page) {
        scope = pageScope;
    }
    List<TestResult> testResultList = testResultFactory.getTestResultList(webResource, scope, localeResolver.resolveLocale(request));
    AuditStatistics auditStatistics = getAuditStatistics(webResource, 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.getMessage());
    }
}
Also used : AuditStatistics(org.asqatasun.webapp.dto.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.dto.TestResult)

Aggregations

TestResult (org.asqatasun.webapp.dto.TestResult)6 Theme (org.asqatasun.entity.reference.Theme)3 ColumnBuilderException (ar.com.fdvs.dj.domain.builders.ColumnBuilderException)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.dto.AuditStatistics)1