Skip to content

Commit

Permalink
MID-7451 password container
Browse files Browse the repository at this point in the history
(cherry picked from commit 4bf6b7d)
  • Loading branch information
1azyman committed Mar 4, 2022
1 parent 31cc34f commit 9282835
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,38 @@
package com.evolveum.midpoint.gui.impl.page.admin.focus.component;

import com.evolveum.midpoint.gui.api.GuiStyleConstants;

import org.apache.wicket.model.IModel;

import com.evolveum.midpoint.gui.api.prism.wrapper.PrismObjectWrapper;
import com.evolveum.midpoint.gui.impl.page.admin.AbstractObjectMainPanel;
import com.evolveum.midpoint.gui.impl.page.admin.assignmentholder.FocusDetailsModels;
import com.evolveum.midpoint.gui.impl.prism.panel.SingleContainerPanel;
import com.evolveum.midpoint.prism.Containerable;
import com.evolveum.midpoint.prism.path.ItemName;
import com.evolveum.midpoint.prism.path.ItemPath;
import com.evolveum.midpoint.util.logging.Trace;
import com.evolveum.midpoint.util.logging.TraceManager;
import com.evolveum.midpoint.web.application.PanelDisplay;
import com.evolveum.midpoint.web.application.PanelInstance;
import com.evolveum.midpoint.web.application.PanelType;
import com.evolveum.midpoint.web.model.PrismContainerWrapperModel;
import com.evolveum.midpoint.xml.ns._public.common.common_3.*;
import com.evolveum.midpoint.xml.ns._public.common.common_3.ContainerPanelConfigurationType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.FocusType;

@PanelType(name = "activation")
@PanelInstance(identifier = "activation",
@PanelInstance(
identifier = "activation",
applicableForType = FocusType.class,
display = @PanelDisplay(label = "ActivationType.title", icon = GuiStyleConstants.CLASS_LIFECYCLE_ICON, order = 40))
display = @PanelDisplay(
label = "ActivationType.title",
icon = GuiStyleConstants.CLASS_LIFECYCLE_ICON,
order = 40
),
containerPath = "activation",
type = "ActivationType",
expanded = true
)
public class FocusActivationPanel<F extends FocusType, FDM extends FocusDetailsModels<F>> extends AbstractObjectMainPanel<F, FDM> {

private static final long serialVersionUID = 1L;

private static final Trace LOGGER = TraceManager.getTrace(FocusActivationPanel.class);

private static final String ID_PANEL = "panel";

private static final String DOT_CLASS = FocusActivationPanel.class.getName() + ".";
Expand All @@ -43,10 +49,11 @@ public FocusActivationPanel(String id, FDM model, ContainerPanelConfigurationTyp

@Override
protected void initLayout() {
// path is defined via PanelInstance -> an therefore via panelConfiguration (virtual container)
SingleContainerPanel panel =
new SingleContainerPanel<>(ID_PANEL,
PrismContainerWrapperModel.fromContainerWrapper(getObjectWrapperModel(), FocusType.F_ACTIVATION),
PasswordType.COMPLEX_TYPE);
PrismContainerWrapperModel.fromContainerWrapper(getObjectWrapperModel(), ItemPath.EMPTY_PATH),
getPanelConfiguration());
add(panel);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,38 @@
package com.evolveum.midpoint.gui.impl.page.admin.focus.component;

import com.evolveum.midpoint.gui.api.GuiStyleConstants;
import com.evolveum.midpoint.gui.api.prism.wrapper.PrismObjectWrapper;
import com.evolveum.midpoint.gui.impl.page.admin.AbstractObjectMainPanel;
import com.evolveum.midpoint.gui.impl.page.admin.assignmentholder.FocusDetailsModels;
import com.evolveum.midpoint.gui.impl.prism.panel.SingleContainerPanel;
import com.evolveum.midpoint.prism.Containerable;
import com.evolveum.midpoint.prism.path.ItemName;
import com.evolveum.midpoint.prism.path.ItemPath;
import com.evolveum.midpoint.util.logging.Trace;
import com.evolveum.midpoint.util.logging.TraceManager;
import com.evolveum.midpoint.web.application.PanelDisplay;
import com.evolveum.midpoint.web.application.PanelInstance;
import com.evolveum.midpoint.web.application.PanelType;
import com.evolveum.midpoint.web.model.PrismContainerWrapperModel;
import com.evolveum.midpoint.xml.ns._public.common.common_3.*;

import org.apache.wicket.model.IModel;
import com.evolveum.midpoint.xml.ns._public.common.common_3.ContainerPanelConfigurationType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.FocusType;

@PanelType(name = "password")
@PanelInstance(identifier = "password",
@PanelInstance(
identifier = "password",
applicableForType = FocusType.class,
display = @PanelDisplay(label = "prismPropertyPanel.name.credentials.password", icon = GuiStyleConstants.CLASS_PASSWORD_ICON, order = 50))
display = @PanelDisplay(
label = "prismPropertyPanel.name.credentials.password",
icon = GuiStyleConstants.CLASS_PASSWORD_ICON,
order = 50
),
containerPath = "credentials/password",
type = "PasswordType",
expanded = true
)
public class FocusPasswordPanel<F extends FocusType, FDM extends FocusDetailsModels<F>> extends AbstractObjectMainPanel<F, FDM> {

private static final long serialVersionUID = 1L;

private static final Trace LOGGER = TraceManager.getTrace(FocusPasswordPanel.class);

private static final String ID_PANEL = "panel";

private static final String DOT_CLASS = FocusPasswordPanel.class.getName() + ".";
Expand All @@ -42,10 +49,11 @@ public FocusPasswordPanel(String id, FDM model, ContainerPanelConfigurationType

@Override
protected void initLayout() {
// path is defined via PanelInstance -> an therefore via panelConfiguration (virtual container)
SingleContainerPanel panel =
new SingleContainerPanel<>(ID_PANEL,
PrismContainerWrapperModel.fromContainerWrapper(getObjectWrapperModel(), ItemPath.create(FocusType.F_CREDENTIALS, CredentialsType.F_PASSWORD)),
PasswordType.COMPLEX_TYPE);
PrismContainerWrapperModel.fromContainerWrapper(getObjectWrapperModel(), ItemPath.EMPTY_PATH),
getPanelConfiguration());
add(panel);
}
}

0 comments on commit 9282835

Please sign in to comment.