Search in sources :

Example 1 with VirtualContainersSpecificationType

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());
    }
}
Also used : Panel(org.apache.wicket.markup.html.panel.Panel) BasePanel(com.evolveum.midpoint.gui.api.component.BasePanel) SchemaException(com.evolveum.midpoint.util.exception.SchemaException) QName(javax.xml.namespace.QName) RepeatingView(org.apache.wicket.markup.repeater.RepeatingView) PrismContainerWrapper(com.evolveum.midpoint.gui.api.prism.wrapper.PrismContainerWrapper) VirtualContainersSpecificationType(com.evolveum.midpoint.xml.ns._public.common.common_3.VirtualContainersSpecificationType)

Example 2 with VirtualContainersSpecificationType

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);
}
Also used : ItemWrapper(com.evolveum.midpoint.gui.api.prism.wrapper.ItemWrapper) AbstractObjectMainPanel(com.evolveum.midpoint.gui.impl.page.admin.AbstractObjectMainPanel) SingleContainerPanel(com.evolveum.midpoint.gui.impl.prism.panel.SingleContainerPanel) PanelDisplay(com.evolveum.midpoint.web.application.PanelDisplay) Arrays(java.util.Arrays) ItemEditabilityHandler(com.evolveum.midpoint.gui.api.prism.wrapper.ItemEditabilityHandler) PanelType(com.evolveum.midpoint.web.application.PanelType) PrismContainerWrapper(com.evolveum.midpoint.gui.api.prism.wrapper.PrismContainerWrapper) Collection(java.util.Collection) VirtualContainersSpecificationType(com.evolveum.midpoint.xml.ns._public.common.common_3.VirtualContainersSpecificationType) Component(org.apache.wicket.Component) WebComponentUtil(com.evolveum.midpoint.gui.api.util.WebComponentUtil) ItemVisibility(com.evolveum.midpoint.web.component.prism.ItemVisibility) ItemPath(com.evolveum.midpoint.prism.path.ItemPath) TaskType(com.evolveum.midpoint.xml.ns._public.common.common_3.TaskType) TaskDetailsModel(com.evolveum.midpoint.gui.impl.page.admin.task.TaskDetailsModel) List(java.util.List) ContainerPanelConfigurationType(com.evolveum.midpoint.xml.ns._public.common.common_3.ContainerPanelConfigurationType) RefreshableTabPanel(com.evolveum.midpoint.web.page.admin.server.RefreshableTabPanel) ItemWrapper(com.evolveum.midpoint.gui.api.prism.wrapper.ItemWrapper) IModel(org.apache.wicket.model.IModel) Collections(java.util.Collections) PanelInstance(com.evolveum.midpoint.web.application.PanelInstance) PrismContainerWrapper(com.evolveum.midpoint.gui.api.prism.wrapper.PrismContainerWrapper) SingleContainerPanel(com.evolveum.midpoint.gui.impl.prism.panel.SingleContainerPanel) VirtualContainersSpecificationType(com.evolveum.midpoint.xml.ns._public.common.common_3.VirtualContainersSpecificationType)

Example 3 with VirtualContainersSpecificationType

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();
}
Also used : PolyStringType(com.evolveum.prism.xml.ns._public.types_3.PolyStringType) DisplayType(com.evolveum.midpoint.xml.ns._public.common.common_3.DisplayType)

Aggregations

PrismContainerWrapper (com.evolveum.midpoint.gui.api.prism.wrapper.PrismContainerWrapper)2 VirtualContainersSpecificationType (com.evolveum.midpoint.xml.ns._public.common.common_3.VirtualContainersSpecificationType)2 BasePanel (com.evolveum.midpoint.gui.api.component.BasePanel)1 ItemEditabilityHandler (com.evolveum.midpoint.gui.api.prism.wrapper.ItemEditabilityHandler)1 ItemWrapper (com.evolveum.midpoint.gui.api.prism.wrapper.ItemWrapper)1 WebComponentUtil (com.evolveum.midpoint.gui.api.util.WebComponentUtil)1 AbstractObjectMainPanel (com.evolveum.midpoint.gui.impl.page.admin.AbstractObjectMainPanel)1 TaskDetailsModel (com.evolveum.midpoint.gui.impl.page.admin.task.TaskDetailsModel)1 SingleContainerPanel (com.evolveum.midpoint.gui.impl.prism.panel.SingleContainerPanel)1 ItemPath (com.evolveum.midpoint.prism.path.ItemPath)1 SchemaException (com.evolveum.midpoint.util.exception.SchemaException)1 PanelDisplay (com.evolveum.midpoint.web.application.PanelDisplay)1 PanelInstance (com.evolveum.midpoint.web.application.PanelInstance)1 PanelType (com.evolveum.midpoint.web.application.PanelType)1 ItemVisibility (com.evolveum.midpoint.web.component.prism.ItemVisibility)1 RefreshableTabPanel (com.evolveum.midpoint.web.page.admin.server.RefreshableTabPanel)1 ContainerPanelConfigurationType (com.evolveum.midpoint.xml.ns._public.common.common_3.ContainerPanelConfigurationType)1 DisplayType (com.evolveum.midpoint.xml.ns._public.common.common_3.DisplayType)1 TaskType (com.evolveum.midpoint.xml.ns._public.common.common_3.TaskType)1 PolyStringType (com.evolveum.prism.xml.ns._public.types_3.PolyStringType)1