use of org.apache.syncope.common.lib.to.ReportTO in project syncope by apache.
the class ReportITCase method issueSYNCOPE43.
@Test
public void issueSYNCOPE43() {
ReportTO reportTO = new ReportTO();
reportTO.setName("issueSYNCOPE43" + getUUIDString());
reportTO.setActive(true);
reportTO.setTemplate("sample");
reportTO = createReport(reportTO);
assertNotNull(reportTO);
ExecTO execution = reportService.execute(new ExecuteQuery.Builder().key(reportTO.getKey()).build());
assertNotNull(execution);
int maxit = 50;
do {
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
}
reportTO = reportService.read(reportTO.getKey());
maxit--;
} while (reportTO.getExecutions().isEmpty() && maxit > 0);
assertEquals(1, reportTO.getExecutions().size());
}
use of org.apache.syncope.common.lib.to.ReportTO in project syncope by apache.
the class ReportITCase method issueSYNCOPE102.
@Test
public void issueSYNCOPE102() throws IOException {
// Create
ReportTO reportTO = reportService.read("0062ea9c-924d-4ecf-9961-4492a8cc6d1b");
reportTO.setKey(null);
reportTO.setName("issueSYNCOPE102" + getUUIDString());
reportTO = createReport(reportTO);
assertNotNull(reportTO);
// Execute (multiple requests)
for (int i = 0; i < 10; i++) {
ExecTO execution = reportService.execute(new ExecuteQuery.Builder().key(reportTO.getKey()).build());
assertNotNull(execution);
}
// Wait for one execution
int maxit = 50;
do {
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
}
reportTO = reportService.read(reportTO.getKey());
maxit--;
} while (reportTO.getExecutions().isEmpty() && maxit > 0);
assertFalse(reportTO.getExecutions().isEmpty());
}
use of org.apache.syncope.common.lib.to.ReportTO in project syncope by apache.
the class ReportITCase method executeAndExport.
@Test
public void executeAndExport() throws IOException {
ReportTO reportTO = reportService.read("0062ea9c-924d-4ecf-9961-4492a8cc6d1b");
reportTO.setKey(null);
reportTO.setName("executeAndExport" + getUUIDString());
reportTO.setActive(false);
reportTO.getExecutions().clear();
reportTO = createReport(reportTO);
assertNotNull(reportTO);
try {
execReport(reportTO.getKey());
fail("This should not happen");
} catch (SyncopeClientException e) {
assertEquals(ClientExceptionType.Scheduling, e.getType());
assertTrue(e.getElements().iterator().next().contains("active"));
}
reportTO.setActive(true);
reportService.update(reportTO);
String execKey = execReport(reportTO.getKey());
checkExport(execKey, ReportExecExportFormat.XML);
checkExport(execKey, ReportExecExportFormat.HTML);
checkExport(execKey, ReportExecExportFormat.PDF);
checkExport(execKey, ReportExecExportFormat.RTF);
checkExport(execKey, ReportExecExportFormat.CSV);
}
use of org.apache.syncope.common.lib.to.ReportTO in project syncope by apache.
the class Reports method buildTabList.
private List<ITab> buildTabList() {
final List<ITab> tabs = new ArrayList<>();
tabs.add(new AbstractTab(new ResourceModel("reports")) {
private static final long serialVersionUID = -6815067322125799251L;
@Override
public Panel getPanel(final String panelId) {
final MultilevelPanel mlp = new MultilevelPanel(panelId);
mlp.setFirstLevel(new ReportDirectoryPanel(mlp, getPageReference()) {
private static final long serialVersionUID = -2195387360323687302L;
@Override
protected void viewTask(final ReportTO reportTO, final AjaxRequestTarget target) {
mlp.next(new StringResourceModel("report.view", this, new Model<>(reportTO)).getObject(), new ReportExecutionDetails(reportTO, getPageReference()), target);
}
});
return mlp;
}
});
tabs.add(new AbstractTab(new ResourceModel("report.templates")) {
private static final long serialVersionUID = -6815067322125799251L;
@Override
public Panel getPanel(final String panelId) {
return new ReportTemplateDirectoryPanel(panelId, getPageReference());
}
});
return tabs;
}
use of org.apache.syncope.common.lib.to.ReportTO in project syncope by apache.
the class ReportServiceImpl method create.
@Override
public Response create(final ReportTO reportTO) {
ReportTO createdReportTO = logic.create(reportTO);
URI location = uriInfo.getAbsolutePathBuilder().path(createdReportTO.getKey()).build();
return Response.created(location).header(RESTHeaders.RESOURCE_KEY, createdReportTO.getKey()).build();
}
Aggregations