-
Notifications
You must be signed in to change notification settings - Fork 188
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve attribute analysis role-mining
1. Implement new selector for attribute analysis 2. Change on schema level
- Loading branch information
1 parent
1535d25
commit a8440fe
Showing
37 changed files
with
1,824 additions
and
970 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 0 additions & 58 deletions
58
...java/com/evolveum/midpoint/gui/impl/factory/panel/mining/AttributeWeightPanelFactory.java
This file was deleted.
Oops, something went wrong.
82 changes: 82 additions & 0 deletions
82
.../java/com/evolveum/midpoint/gui/impl/factory/panel/mining/ClusteringAttributeFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
/* | ||
* Copyright (C) 2010-2024 Evolveum and contributors | ||
* | ||
* This work is dual-licensed under the Apache License 2.0 | ||
* and European Union Public License. See LICENSE file for details. | ||
*/ | ||
|
||
package com.evolveum.midpoint.gui.impl.factory.panel.mining; | ||
|
||
import com.evolveum.midpoint.gui.api.prism.wrapper.ItemWrapper; | ||
import com.evolveum.midpoint.gui.api.prism.wrapper.PrismContainerValueWrapper; | ||
import com.evolveum.midpoint.gui.api.prism.wrapper.PrismPropertyWrapper; | ||
import com.evolveum.midpoint.gui.api.prism.wrapper.PrismValueWrapper; | ||
import com.evolveum.midpoint.gui.impl.factory.panel.AbstractInputGuiComponentFactory; | ||
import com.evolveum.midpoint.gui.impl.factory.panel.PrismPropertyPanelContext; | ||
import com.evolveum.midpoint.gui.impl.page.admin.role.mining.page.panel.session.ClusteringAttributeSelectorPanel; | ||
import com.evolveum.midpoint.web.component.prism.InputPanel; | ||
import com.evolveum.midpoint.xml.ns._public.common.common_3.*; | ||
|
||
import jakarta.annotation.PostConstruct; | ||
import org.apache.wicket.model.IModel; | ||
import org.apache.wicket.model.PropertyModel; | ||
import org.jetbrains.annotations.NotNull; | ||
import org.springframework.stereotype.Component; | ||
|
||
@Component | ||
public class ClusteringAttributeFactory extends AbstractInputGuiComponentFactory<ClusteringAttributeSettingType> { | ||
|
||
@PostConstruct | ||
public void register() { | ||
getRegistry().addToRegistry(this); | ||
} | ||
|
||
@Override | ||
public <IW extends ItemWrapper<?, ?>, VW extends PrismValueWrapper<?>> boolean match(IW wrapper, VW valueWrapper) { | ||
return RoleAnalysisSessionOptionType.F_CLUSTERING_ATTRIBUTE_SETTING.equals(wrapper.getItemName()); | ||
} | ||
|
||
@Override | ||
protected InputPanel getPanel(PrismPropertyPanelContext<ClusteringAttributeSettingType> panelCtx) { | ||
ClusteringAttributeSelectorPanel clusteringAttributeSelectorPanel = new ClusteringAttributeSelectorPanel(panelCtx.getComponentId(), | ||
new PropertyModel<>(panelCtx.getItemWrapperModel(), "value"), getProcessMode(panelCtx)); | ||
clusteringAttributeSelectorPanel.setOutputMarkupId(true); | ||
return clusteringAttributeSelectorPanel; | ||
} | ||
|
||
@Override | ||
public Integer getOrder() { | ||
return 100; | ||
} | ||
|
||
@Override | ||
public void configure(PrismPropertyPanelContext<ClusteringAttributeSettingType> panelCtx, org.apache.wicket.Component | ||
component) { | ||
component.setEnabled(panelCtx.getVisibleEnableBehavior().isEnabled()); | ||
} | ||
|
||
public RoleAnalysisProcessModeType getProcessMode | ||
(@NotNull PrismPropertyPanelContext<ClusteringAttributeSettingType> panelCtx) { | ||
IModel<PrismPropertyWrapper<ClusteringAttributeSettingType>> itemWrapperModel = panelCtx.getItemWrapperModel(); | ||
|
||
if (itemWrapperModel != null) { | ||
PrismPropertyWrapper<ClusteringAttributeSettingType> object = itemWrapperModel.getObject(); | ||
if (object != null) { | ||
PrismContainerValueWrapper<?> parent = object.getParent(); | ||
if (parent != null) { | ||
if (parent.getParent() != null) { | ||
if (parent.getParent().getParent() != null) { | ||
Object realValue = parent.getParent().getParent().getRealValue(); | ||
if (realValue instanceof RoleAnalysisSessionType session) { | ||
RoleAnalysisOptionType analysisOption = session.getAnalysisOption(); | ||
return analysisOption.getProcessMode(); | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
return RoleAnalysisProcessModeType.USER; | ||
} | ||
} |
Oops, something went wrong.