use of com.buschmais.jqassistant.core.plugin.schema.v1.ReportType in project midpoint by Evolveum.
the class ReportDto method getObject.
public PrismObject<ReportType> getObject() {
if (reportType == null) {
reportType = new ReportType();
//TODO FIXME temporary every new report will be set as parent report
reportType.setParent(Boolean.TRUE);
}
reportType.setName(new PolyStringType(name));
reportType.setExport(exportType);
reportType.setTemplate(jasperReportDto.getTemplate());
reportType.setTemplateStyle(templateStyle);
reportType.setDescription(description);
reportType.setVirtualizer(virtualizer);
reportType.setVirtualizerKickOn(virtualizerKickOn);
reportType.setMaxPages(maxPages);
reportType.setTimeout(timeout);
return reportType.asPrismObject();
}
use of com.buschmais.jqassistant.core.plugin.schema.v1.ReportType in project midpoint by Evolveum.
the class PageReport method onSavePerformed.
protected void onSavePerformed(AjaxRequestTarget target) {
Task task = createSimpleTask(OPERATION_SAVE_REPORT);
OperationResult result = task.getResult();
try {
//TODO TODO TODO
PrismObject<ReportType> newReport = model.getObject().getObject();
ObjectDelta<ReportType> delta = null;
if (newReport.getOid() == null) {
getPrismContext().adopt(newReport);
delta = ObjectDelta.createAddDelta(newReport);
delta.setPrismContext(getPrismContext());
} else {
PrismObject<ReportType> oldReport = WebModelServiceUtils.loadObject(ReportType.class, newReport.getOid(), this, task, result);
if (oldReport != null) {
delta = oldReport.diff(newReport);
}
}
if (delta != null) {
getPrismContext().adopt(delta);
getModelService().executeChanges(WebComponentUtil.createDeltaCollection(delta), null, task, result);
}
} catch (Exception e) {
result.recordFatalError("Couldn't save report.", e);
} finally {
result.computeStatusIfUnknown();
}
if (WebComponentUtil.isSuccessOrHandledError(result)) {
showResult(result);
redirectBack();
} else {
showResult(result);
target.add(getFeedbackPanel());
}
}
use of com.buschmais.jqassistant.core.plugin.schema.v1.ReportType in project jqa-core-framework by buschmais.
the class ReportPluginRepositoryImpl method getReportPlugins.
private Map<String, ReportPlugin> getReportPlugins(List<JqassistantPlugin> plugins) throws PluginRepositoryException {
Map<String, ReportPlugin> reportPlugins = new HashMap<>();
for (JqassistantPlugin plugin : plugins) {
ReportType reportType = plugin.getReport();
if (reportType != null) {
for (IdClassType classType : reportType.getClazz()) {
ReportPlugin reportPlugin = createInstance(classType.getValue());
if (reportPlugin != null) {
try {
reportPlugin.initialize();
} catch (ReportException e) {
throw new PluginRepositoryException("Cannot initialize report plugin " + reportPlugin, e);
}
String id = classType.getId();
if (id == null) {
id = reportPlugin.getClass().getSimpleName();
}
reportPlugins.put(id, reportPlugin);
}
}
}
}
return reportPlugins;
}
use of com.buschmais.jqassistant.core.plugin.schema.v1.ReportType in project midpoint by Evolveum.
the class TestCsvReportMultiNode method test102ExportAuditRecordsInsideTwoTimestamps.
@Test
public void test102ExportAuditRecordsInsideTwoTimestamps() throws Exception {
List<AuditEventRecordType> auditRecords = getAllAuditRecords(getTestTask(), getTestTask().getResult());
SearchFilterType filter = PrismContext.get().getQueryConverter().createSearchFilterType(PrismContext.get().queryFor(AuditEventRecordType.class).item(AuditEventRecordType.F_TIMESTAMP).ge(auditRecords.get(500).getTimestamp()).and().item(AuditEventRecordType.F_TIMESTAMP).le(auditRecords.get(1300).getTimestamp()).buildFilter());
modifyObjectReplaceProperty(ObjectCollectionType.class, OBJECT_COLLECTION_ALL_AUDIT_RECORDS.oid, ObjectCollectionType.F_FILTER, getTestTask(), getTestTask().getResult(), filter);
auditTest();
PrismObject<ReportType> report = getObject(ReportType.class, REPORT_AUDIT_COLLECTION_WITH_DEFAULT_COLUMN.oid);
List<String> rows = basicCheckOutputFile(report, -1, 8, null);
assertTrue(rows.size() > 800 && rows.size() <= 810, "Unexpected number of rows in report. Expected:800-810, Actual:" + rows.size());
}
Aggregations