Search in sources :

Example 1 with Scope

use of org.asqatasun.entity.reference.Scope in project Asqatasun by Asqatasun.

the class ProcessResultDAOImplTest method testGetResultByScopeList.

public void testGetResultByScopeList() {
    Scope scope1 = scopeDAO.read(Long.valueOf(1));
    Scope scope2 = scopeDAO.read(Long.valueOf(2));
    WebResource wa = webresourceDAO.read(Long.valueOf(1));
    assertEquals(1, processResultDAO.getResultByScopeList(wa, scope2).size());
    assertEquals(5, processResultDAO.getResultByScopeList(wa, scope1).size());
}
Also used : Scope(org.asqatasun.entity.reference.Scope) WebResource(org.asqatasun.entity.subject.WebResource)

Example 2 with Scope

use of org.asqatasun.entity.reference.Scope 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

Scope (org.asqatasun.entity.reference.Scope)2 ColumnBuilderException (ar.com.fdvs.dj.domain.builders.ColumnBuilderException)1 JRException (net.sf.jasperreports.engine.JRException)1 Page (org.asqatasun.entity.subject.Page)1 WebResource (org.asqatasun.entity.subject.WebResource)1 AuditStatistics (org.asqatasun.webapp.presentation.data.AuditStatistics)1 TestResult (org.asqatasun.webapp.presentation.data.TestResult)1