use of com.buschmais.jqassistant.core.plugin.schema.v1.ReportType in project midpoint by Evolveum.
the class PageReport method loadReport.
private ReportDto loadReport() {
StringValue reportOid = getPageParameters().get(OnePageParameterEncoder.PARAMETER);
Task task = createSimpleTask(OPERATION_LOAD_REPORT);
OperationResult result = task.getResult();
PrismObject<ReportType> prismReport = WebModelServiceUtils.loadObject(ReportType.class, reportOid.toString(), this, task, result);
if (prismReport == null) {
LOGGER.error("Couldn't load report.");
throw new RestartResponseException(PageReports.class);
}
return new ReportDto(prismReport.asObjectable());
// return prismReport;
}
use of com.buschmais.jqassistant.core.plugin.schema.v1.ReportType in project midpoint by Evolveum.
the class PageReports method initColumns.
private List<IColumn<ReportType, String>> initColumns() {
List<IColumn<ReportType, String>> columns = new ArrayList<IColumn<ReportType, String>>();
IColumn column;
column = new LinkColumn<SelectableBean<ReportType>>(createStringResource("PageReports.table.name"), ReportType.F_NAME.getLocalPart(), "value.name") {
@Override
public void onClick(AjaxRequestTarget target, IModel<SelectableBean<ReportType>> rowModel) {
ReportType report = rowModel.getObject().getValue();
if (report != null) {
reportTypeFilterPerformed(target, report.getOid());
}
}
@Override
public boolean isEnabled(IModel<SelectableBean<ReportType>> rowModel) {
return rowModel.getObject().getValue() != null && rowModel.getObject().getValue().isParent();
}
};
columns.add(column);
column = new PropertyColumn(createStringResource("PageReports.table.description"), "value.description");
columns.add(column);
column = new DoubleButtonColumn<SelectableBean<ReportType>>(new Model(), null) {
@Override
public String getFirstCap() {
return PageReports.this.createStringResource("PageReports.button.run").getString();
}
@Override
public String getSecondCap() {
return PageReports.this.createStringResource("PageReports.button.configure").getString();
}
@Override
public String getFirstColorCssClass() {
if (getRowModel().getObject().getValue() != null && getRowModel().getObject().getValue().isParent()) {
return BUTTON_COLOR_CLASS.PRIMARY.toString();
} else {
return BUTTON_COLOR_CLASS.PRIMARY.toString() + " " + BUTTON_DISABLED;
}
}
@Override
public void firstClicked(AjaxRequestTarget target, IModel<SelectableBean<ReportType>> model) {
runReportPerformed(target, model.getObject().getValue());
}
@Override
public void secondClicked(AjaxRequestTarget target, IModel<SelectableBean<ReportType>> model) {
configurePerformed(target, model.getObject().getValue());
}
@Override
public boolean isFirstButtonEnabled(IModel<SelectableBean<ReportType>> rowModel) {
return getRowModel().getObject().getValue() != null && rowModel.getObject().getValue().isParent();
}
};
columns.add(column);
return columns;
}
use of com.buschmais.jqassistant.core.plugin.schema.v1.ReportType in project midpoint by Evolveum.
the class PageReports method runReportPerformed.
protected void runReportPerformed(AjaxRequestTarget target, ReportType report) {
RunReportPopupPanel runReportPopupPanel = new RunReportPopupPanel(getMainPopupBodyId(), report) {
private static final long serialVersionUID = 1L;
protected void runConfirmPerformed(AjaxRequestTarget target, ReportType reportType, PrismContainer<ReportParameterType> reportParam) {
OperationResult result = new OperationResult(OPERATION_RUN_REPORT);
try {
Task task = createSimpleTask(OPERATION_RUN_REPORT);
getReportManager().runReport(reportType.asPrismObject(), reportParam, task, result);
} catch (Exception ex) {
result.recordFatalError(ex);
} finally {
result.computeStatusIfUnknown();
}
showResult(result);
target.add(getFeedbackPanel(), get(createComponentPath(ID_MAIN_FORM)));
hideMainPopup(target);
}
;
};
showMainPopup(runReportPopupPanel, target);
}
use of com.buschmais.jqassistant.core.plugin.schema.v1.ReportType in project midpoint by Evolveum.
the class RReport method toJAXB.
@Override
public ReportType toJAXB(PrismContext prismContext, Collection<SelectorOptions<GetOperationOptions>> options) throws DtoTranslationException {
ReportType object = new ReportType();
RUtil.revive(object, prismContext);
RReport.copyToJAXB(this, object, prismContext, options);
return object;
}
use of com.buschmais.jqassistant.core.plugin.schema.v1.ReportType in project midpoint by Evolveum.
the class ReportCreateTaskHandler method getSubreportParameters.
private Map<String, Object> getSubreportParameters(SubreportType subreportType, Task task, OperationResult subResult) throws SchemaException, ObjectNotFoundException {
Map<String, Object> reportParams = new HashMap<String, Object>();
ReportType reportType = objectResolver.resolve(subreportType.getReportRef(), ReportType.class, null, "resolve subreport", task, subResult);
Map<String, Object> parameters = prepareReportParameters(reportType, subResult);
reportParams.putAll(parameters);
JasperReport jasperReport = ReportTypeUtil.loadJasperReport(reportType);
reportParams.put(subreportType.getName(), jasperReport);
Map<String, Object> subReportParams = processSubreportParameters(reportType, task, subResult);
reportParams.putAll(subReportParams);
return reportParams;
}
Aggregations