use of com.evolveum.midpoint.web.component.prism.ItemVisibility in project midpoint by Evolveum.
the class ReportMainPanel method getTabs.
private List<ITab> getTabs(PageAdminObjectDetails<ReportType> parentPage) {
List<ITab> tabs = new ArrayList<>();
tabs.add(new PanelTab(parentPage.createStringResource("pageReport.basic.title")) {
private static final long serialVersionUID = 1L;
@Override
public WebMarkupContainer createPanel(String panelId) {
return new ObjectBasicPanel<ReportType>(panelId, getObjectModel()) {
@Override
protected QName getType() {
return ReportType.COMPLEX_TYPE;
}
@Override
protected ItemVisibility getBasicTabVisibility(ItemWrapper<?, ?> itemWrapper) {
if (itemWrapper.getPath().isSubPathOrEquivalent(ItemPath.create(ItemPath.EMPTY_PATH, ReportType.F_LIFECYCLE_STATE)) || itemWrapper.getPath().isSubPathOrEquivalent(ItemPath.create(ItemPath.EMPTY_PATH, ReportType.F_DIAGNOSTIC_INFORMATION)) || itemWrapper.getPath().isSubPathOrEquivalent(ItemPath.create(ItemPath.EMPTY_PATH, ReportType.F_DEFAULT_SCRIPT_CONFIGURATION)) || itemWrapper.getPath().isSubPathOrEquivalent(ItemPath.create(ItemPath.EMPTY_PATH, ReportType.F_POST_REPORT_SCRIPT))) {
return ItemVisibility.HIDDEN;
}
return ItemVisibility.AUTO;
}
};
}
});
tabs.add(new PanelTab(parentPage.createStringResource("pageReport.engine.title")) {
private static final long serialVersionUID = 1L;
@Override
public WebMarkupContainer createPanel(String panelId) {
return new EngineReportTabPanel(panelId, getObjectModel());
}
@Override
public boolean isVisible() {
return hasDefinitionFor(ReportType.F_OBJECT_COLLECTION) || hasDefinitionFor(ReportType.F_DASHBOARD);
}
});
tabs.addAll(createTabsForCollectionReports(parentPage));
tabs.addAll(createTabsForDashboardReports(parentPage));
tabs.add(new PanelTab(parentPage.createStringResource("pageReport.export.title")) {
private static final long serialVersionUID = 1L;
@Override
public WebMarkupContainer createPanel(String panelId) {
PrismContainerWrapperModel<ReportType, Containerable> model = PrismContainerWrapperModel.fromContainerWrapper(getObjectModel(), ReportType.F_FILE_FORMAT);
return new SingleContainerPanel(panelId, model, FileFormatConfigurationType.COMPLEX_TYPE) {
@Override
protected ItemVisibility getVisibility(ItemWrapper itemWrapper) {
if (itemWrapper.getPath().isSubPathOrEquivalent(ItemPath.create(ReportType.F_FILE_FORMAT, FileFormatConfigurationType.F_HTML))) {
return ItemVisibility.HIDDEN;
}
return ItemVisibility.AUTO;
}
};
}
});
return tabs;
}
use of com.evolveum.midpoint.web.component.prism.ItemVisibility in project midpoint by Evolveum.
the class ReportCollectionParameterPanel method createDetailsPanelForParameter.
private MultivalueContainerDetailsPanel<SearchFilterParameterType> createDetailsPanelForParameter(ListItem<PrismContainerValueWrapper<SearchFilterParameterType>> item) {
return new MultivalueContainerDetailsPanel<>(MultivalueContainerListPanelWithDetailsPanel.ID_ITEM_DETAILS, item.getModel(), true) {
@Override
protected DisplayNamePanel<SearchFilterParameterType> createDisplayNamePanel(String displayNamePanelId) {
return new DisplayNamePanel<>(displayNamePanelId, new ItemRealValueModel<>(getModel())) {
@Override
protected IModel<String> createHeaderModel() {
return () -> {
SearchFilterParameterType parameter = getModelObject();
String name = parameter.getName();
if (parameter.getDisplay() != null && parameter.getDisplay().getLabel() != null) {
name = WebComponentUtil.getTranslatedPolyString(parameter.getDisplay().getLabel());
}
return name;
};
}
@Override
protected String createImageModel() {
return "fa fa-sliders";
}
};
}
@Override
protected ItemVisibility getBasicTabVisibity(ItemWrapper<?, ?> itemWrapper) {
if (ItemPath.create(itemWrapper.getParent().getPath(), SearchFilterParameterType.F_DISPLAY).equivalent(itemWrapper.getPath())) {
return ItemVisibility.HIDDEN;
}
return super.getBasicTabVisibity(itemWrapper);
}
@Override
@NotNull
protected List<ITab> createTabs() {
List<ITab> tabs = new ArrayList<>();
tabs.add(new PanelTab(createStringResource("SearchFilterParameterType.display")) {
@Override
public WebMarkupContainer createPanel(String panelId) {
return new SingleContainerPanel<>(panelId, PrismContainerWrapperModel.fromContainerValueWrapper(getModel(), SearchFilterParameterType.F_DISPLAY), DisplayType.COMPLEX_TYPE) {
@Override
protected ItemVisibility getVisibility(ItemWrapper itemWrapper) {
if (ItemPath.create(itemWrapper.getParent().getPath(), DisplayType.F_LABEL).equivalent(itemWrapper.getPath()) || ItemPath.create(itemWrapper.getParent().getPath(), DisplayType.F_HELP).equivalent(itemWrapper.getPath())) {
return super.getVisibility(itemWrapper);
}
return ItemVisibility.HIDDEN;
}
};
}
});
return tabs;
}
};
}
use of com.evolveum.midpoint.web.component.prism.ItemVisibility in project midpoint by Evolveum.
the class ReportMainPanel method createDetailsPanelForParameter.
private MultivalueContainerDetailsPanel<SearchFilterParameterType> createDetailsPanelForParameter(String panelId, ListItem<PrismContainerValueWrapper<SearchFilterParameterType>> item) {
return new MultivalueContainerDetailsPanel<>(panelId, item.getModel(), true) {
@Override
protected DisplayNamePanel<SearchFilterParameterType> createDisplayNamePanel(String displayNamePanelId) {
return new DisplayNamePanel<>(displayNamePanelId, new ItemRealValueModel<>(getModel())) {
@Override
protected IModel<String> createHeaderModel() {
return () -> {
SearchFilterParameterType parameter = getModelObject();
String name = parameter.getName();
if (parameter.getDisplay() != null && parameter.getDisplay().getLabel() != null) {
name = WebComponentUtil.getTranslatedPolyString(parameter.getDisplay().getLabel());
}
return name;
};
}
@Override
protected String createImageModel() {
return "fa fa-sliders";
}
};
}
@Override
protected ItemVisibility getBasicTabVisibity(ItemWrapper<?, ?> itemWrapper) {
if (ItemPath.create(itemWrapper.getParent().getPath(), SearchFilterParameterType.F_DISPLAY).equivalent(itemWrapper.getPath())) {
return ItemVisibility.HIDDEN;
}
return super.getBasicTabVisibity(itemWrapper);
}
@Override
@NotNull
protected List<ITab> createTabs() {
List<ITab> tabs = new ArrayList<>();
tabs.add(new PanelTab(createStringResource("SearchFilterParameterType.display")) {
@Override
public WebMarkupContainer createPanel(String panelId) {
return new SingleContainerPanel<>(panelId, PrismContainerWrapperModel.fromContainerValueWrapper(getModel(), SearchFilterParameterType.F_DISPLAY), DisplayType.COMPLEX_TYPE) {
@Override
protected ItemVisibility getVisibility(ItemWrapper itemWrapper) {
if (ItemPath.create(itemWrapper.getParent().getPath(), DisplayType.F_LABEL).equivalent(itemWrapper.getPath()) || ItemPath.create(itemWrapper.getParent().getPath(), DisplayType.F_HELP).equivalent(itemWrapper.getPath())) {
return super.getVisibility(itemWrapper);
}
return ItemVisibility.HIDDEN;
}
};
}
});
return tabs;
}
};
}
use of com.evolveum.midpoint.web.component.prism.ItemVisibility in project midpoint by Evolveum.
the class EngineReportTabPanel method initLayout.
@Override
protected void initLayout() {
RepeatingView panel = new RepeatingView(ID_PANEL);
add(panel);
if (hasDefinition(ReportType.F_DASHBOARD)) {
panel.add(new SingleContainerPanel(panel.newChildId(), PrismContainerWrapperModel.fromContainerWrapper(getModel(), ItemPath.create(ReportType.F_DASHBOARD)), DashboardReportEngineConfigurationType.COMPLEX_TYPE) {
@Override
protected ItemVisibility getVisibility(ItemWrapper itemWrapper) {
if (!ItemPath.create(ReportType.F_DASHBOARD, DashboardReportEngineConfigurationType.F_DASHBOARD_REF).equivalent(itemWrapper.getPath()) && !ItemPath.create(ReportType.F_DASHBOARD, DashboardReportEngineConfigurationType.F_SHOW_ONLY_WIDGETS_TABLE).equivalent(itemWrapper.getPath())) {
return ItemVisibility.HIDDEN;
}
return super.getVisibility(itemWrapper);
}
});
}
if (hasDefinition(ReportType.F_OBJECT_COLLECTION)) {
panel.add(new SingleContainerPanel(panel.newChildId(), PrismContainerWrapperModel.fromContainerWrapper(getModel(), ItemPath.create(ReportType.F_OBJECT_COLLECTION)), ObjectCollectionReportEngineConfigurationType.COMPLEX_TYPE) {
@Override
protected ItemVisibility getVisibility(ItemWrapper itemWrapper) {
if (!ItemPath.create(ReportType.F_OBJECT_COLLECTION, ObjectCollectionReportEngineConfigurationType.F_CONDITION).equivalent(itemWrapper.getPath()) && !ItemPath.create(ReportType.F_OBJECT_COLLECTION, ObjectCollectionReportEngineConfigurationType.F_USE_ONLY_REPORT_VIEW).equivalent(itemWrapper.getPath())) {
return ItemVisibility.HIDDEN;
}
return super.getVisibility(itemWrapper);
}
});
}
}
use of com.evolveum.midpoint.web.component.prism.ItemVisibility in project midpoint by Evolveum.
the class PageObjectTemplate method getTabs.
private List<ITab> getTabs() {
List<ITab> tabs = new ArrayList<>();
tabs.add(new PanelTab(createStringResource("pageObjectTemplate.basic.title")) {
private static final long serialVersionUID = 1L;
@Override
public WebMarkupContainer createPanel(String panelId) {
return new ObjectBasicPanel<ObjectTemplateType>(panelId, getObjectModel()) {
@Override
protected QName getType() {
return ObjectTemplateType.COMPLEX_TYPE;
}
@Override
protected ItemVisibility getBasicTabVisibility(ItemWrapper<?, ?> itemWrapper) {
if (itemWrapper.getPath().isSubPathOrEquivalent(ItemPath.create(ItemPath.EMPTY_PATH, ObjectTemplateType.F_SUBTYPE)) || itemWrapper.getPath().isSubPathOrEquivalent(ItemPath.create(ItemPath.EMPTY_PATH, ObjectTemplateType.F_DIAGNOSTIC_INFORMATION)) || itemWrapper.getPath().isSubPathOrEquivalent(ItemPath.create(ItemPath.EMPTY_PATH, ObjectTemplateType.F_LIFECYCLE_STATE))) {
return ItemVisibility.HIDDEN;
}
return ItemVisibility.AUTO;
}
};
}
});
tabs.add(new PanelTab(createStringResource("pageObjectTemplate.iterationSpecification.title")) {
private static final long serialVersionUID = 1L;
@Override
public WebMarkupContainer createPanel(String panelId) {
return new SingleContainerPanel<IterationSpecificationType>(panelId, createModel(getObjectModel(), ObjectTemplateType.F_ITERATION_SPECIFICATION), IterationSpecificationType.COMPLEX_TYPE);
}
});
tabs.add(new PanelTab(createStringResource("pageObjectTemplate.item.title")) {
private static final long serialVersionUID = 1L;
@Override
public WebMarkupContainer createPanel(String panelId) {
return new ObjectTemplateItemPanel(panelId, PrismContainerWrapperModel.fromContainerWrapper(getObjectModel(), ObjectTemplateType.F_ITEM));
}
});
tabs.add(new PanelTab(createStringResource("pageObjectTemplate.mapping.title")) {
private static final long serialVersionUID = 1L;
@Override
public WebMarkupContainer createPanel(String panelId) {
return new ListMappingPanel(panelId, PrismContainerWrapperModel.fromContainerWrapper(getObjectModel(), ObjectTemplateType.F_MAPPING));
}
});
return tabs;
}
Aggregations