use of com.evolveum.midpoint.xml.ns._public.common.common_3.VirtualContainersSpecificationType in project midpoint by Evolveum.
the class SingleContainerPanel method initLayout.
private void initLayout() {
try {
ItemPanelSettingsBuilder builder = new ItemPanelSettingsBuilder().visibilityHandler(wrapper -> getVisibility(wrapper)).editabilityHandler(getEditabilityHandler()).mandatoryHandler(getMandatoryHandler());
if (config == null) {
Panel panel = getPageBase().initItemPanel(ID_CONTAINER, getTypeName(), getModel(), builder.build());
add(panel);
} else {
RepeatingView view = new RepeatingView(ID_CONTAINER);
List<VirtualContainersSpecificationType> virtualContainers = config.getContainer();
for (VirtualContainersSpecificationType virtualContainer : virtualContainers) {
if (!WebComponentUtil.getElementVisibility(virtualContainer.getVisibility())) {
continue;
}
IModel<PrismContainerWrapper<C>> virtualContainerModel = createVirtualContainerModel(virtualContainer);
if (virtualContainerModel == null) {
continue;
}
ItemPanelSettings settings = builder.build();
Panel virtualPanel = new PrismContainerPanel<>(view.newChildId(), virtualContainerModel, settings);
view.add(virtualPanel);
}
QName typeName = getTypeName();
if (typeName != null) {
Panel panel = getPageBase().initItemPanel(view.newChildId(), typeName, getModel(), builder.build());
view.add(panel);
}
add(view);
}
} catch (SchemaException e) {
LOGGER.error("Cannot create panel for {}, {}", getTypeName(), e.getMessage(), e);
// TODO opertion result? localization?
getSession().error("Cannot create panel for " + getTypeName());
}
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.VirtualContainersSpecificationType in project midpoint by Evolveum.
the class TaskBasicPanel method initLayout.
protected void initLayout() {
SingleContainerPanel mainPanel = new SingleContainerPanel(ID_MAIN_PANEL, getObjectWrapperModel(), getPanelConfiguration()) {
@Override
protected ItemVisibility getVisibility(ItemWrapper itemWrapper) {
return getBasicTabVisibility(itemWrapper.getPath());
}
@Override
protected ItemEditabilityHandler getEditabilityHandler() {
return wrapper -> getBasicTabEditability(wrapper.getPath());
}
@Override
protected IModel<PrismContainerWrapper> createVirtualContainerModel(VirtualContainersSpecificationType virtualContainer) {
if (isDeprecatedVirtualContainer(virtualContainer)) {
return null;
}
return super.createVirtualContainerModel(virtualContainer);
}
};
add(mainPanel);
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.VirtualContainersSpecificationType in project midpoint by Evolveum.
the class UserInterfaceFeatureFinder method getLabel.
// private RA find(Predicate<F> filter) {
// List<VirtualContainersSpecificationType> foundVirtualContainers = virtualContainersAsserter.getVirtualContainers()
// .stream()
// .filter(filter)
// .collect(Collectors.toList());
// Assertions.assertThat(foundVirtualContainers).hasSize(1);
// return new VirtualContainerSpecificationAsserter<>(foundVirtualContainers.iterator().next(), virtualContainersAsserter, "from list of virtual containers " + virtualContainersAsserter.getVirtualContainers());
// }
private PolyString getLabel(F container) {
DisplayType display = container.getDisplay();
if (display == null) {
return null;
}
PolyStringType label = display.getLabel();
if (label == null) {
return null;
}
return label.toPolyString();
}
Aggregations