use of com.evolveum.midpoint.web.model.PrismPropertyWrapperModel in project midpoint by Evolveum.
the class ReportMainPanel method createTabsForCollectionReports.
private List<ITab> createTabsForCollectionReports(PageAdminObjectDetails<ReportType> parentPage) {
List<ITab> tabs = new ArrayList<>();
tabs.add(new PanelTab(parentPage.createStringResource("ObjectCollectionReportEngineConfigurationType.collection")) {
@Override
public WebMarkupContainer createPanel(String panelId) {
return new SingleContainerPanel(panelId, PrismContainerWrapperModel.fromContainerWrapper(getObjectModel(), ItemPath.create(ReportType.F_OBJECT_COLLECTION, ObjectCollectionReportEngineConfigurationType.F_COLLECTION)), GuiObjectListViewType.COMPLEX_TYPE);
}
@Override
public boolean isVisible() {
return hasDefinitionFor(ItemPath.create(ReportType.F_OBJECT_COLLECTION, ObjectCollectionReportEngineConfigurationType.F_COLLECTION));
}
});
tabs.add(new PanelTab(parentPage.createStringResource("ObjectCollectionReportEngineConfigurationType.view")) {
@Override
public WebMarkupContainer createPanel(String panelId) {
RepeatingView panel = new RepeatingView(panelId);
PrismPropertyWrapperModel<ReportType, Object> propertyModel = PrismPropertyWrapperModel.fromContainerWrapper(getObjectModel(), ItemPath.create(ReportType.F_OBJECT_COLLECTION, ObjectCollectionReportEngineConfigurationType.F_VIEW, GuiObjectListViewType.F_TYPE));
try {
Panel propertyPanel = parentPage.initItemPanel(panel.newChildId(), propertyModel.getObject().getTypeName(), propertyModel, null);
panel.add(propertyPanel);
} catch (SchemaException e) {
LOGGER.error("Couldn't create panel for type element in view");
}
panel.add(createObjectListForColumns(panel.newChildId(), parentPage));
return panel;
}
@Override
public boolean isVisible() {
return hasDefinitionFor(ItemPath.create(ReportType.F_OBJECT_COLLECTION, ObjectCollectionReportEngineConfigurationType.F_VIEW));
}
});
tabs.add(new PanelTab(parentPage.createStringResource("ObjectCollectionReportEngineConfigurationType.parameter")) {
@Override
public WebMarkupContainer createPanel(String panelId) {
return createObjectListForParameters(panelId, parentPage);
}
@Override
public boolean isVisible() {
return hasDefinitionFor(ItemPath.create(ReportType.F_OBJECT_COLLECTION, ObjectCollectionReportEngineConfigurationType.F_PARAMETER));
}
});
tabs.add(new PanelTab(parentPage.createStringResource("ObjectCollectionReportEngineConfigurationType.subreport")) {
@Override
public WebMarkupContainer createPanel(String panelId) {
return createObjectListForSubreports(panelId, parentPage);
}
@Override
public boolean isVisible() {
return hasDefinitionFor(ItemPath.create(ReportType.F_OBJECT_COLLECTION, ObjectCollectionReportEngineConfigurationType.F_SUBREPORT));
}
});
return tabs;
}
Aggregations