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());
}
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);
}
}
Aggregations