Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
156 additions
and
11 deletions.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
...i/src/main/java/com/evolveum/midpoint/gui/impl/component/AssignmentConstructionPanel.html
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,14 @@ | ||
<!-- | ||
~ Copyright (c) 2021 Evolveum | ||
~ | ||
~ This work is dual-licensed under the Apache License 2.0 | ||
~ and European Union Public License. See LICENSE file for details. | ||
--> | ||
|
||
<!DOCTYPE html> | ||
<html xmlns:wicket="http://wicket.apache.org"> | ||
<wicket:panel> | ||
<div wicket:id="basic" /> | ||
<div wicket:id="attributes" /> | ||
</wicket:panel> | ||
</html> |
87 changes: 87 additions & 0 deletions
87
...i/src/main/java/com/evolveum/midpoint/gui/impl/component/AssignmentConstructionPanel.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,87 @@ | ||
/* | ||
* Copyright (c) 2021 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.component; | ||
|
||
import com.evolveum.midpoint.gui.api.component.BasePanel; | ||
import com.evolveum.midpoint.gui.api.prism.wrapper.PrismContainerWrapper; | ||
import com.evolveum.midpoint.gui.impl.prism.panel.ResourceAttributePanel; | ||
import com.evolveum.midpoint.gui.impl.prism.panel.SingleContainerPanel; | ||
import com.evolveum.midpoint.prism.path.ItemPath; | ||
import com.evolveum.midpoint.web.component.prism.ItemVisibility; | ||
import com.evolveum.midpoint.web.model.PrismContainerWrapperModel; | ||
import com.evolveum.midpoint.xml.ns._public.common.common_3.AbstractRoleType; | ||
import com.evolveum.midpoint.xml.ns._public.common.common_3.AssignmentType; | ||
import com.evolveum.midpoint.xml.ns._public.common.common_3.ConstructionType; | ||
|
||
import com.evolveum.midpoint.xml.ns._public.common.common_3.FocusType; | ||
|
||
import org.apache.wicket.model.IModel; | ||
|
||
public class AssignmentConstructionPanel extends BasePanel<PrismContainerWrapper<ConstructionType>> { | ||
|
||
private static final String ID_BASIC = "basic"; | ||
private static final String ID_ATTRIBUTES = "attributes"; | ||
|
||
public AssignmentConstructionPanel(String id, IModel<PrismContainerWrapper<ConstructionType>> model) { | ||
super(id, model); | ||
} | ||
|
||
@Override | ||
protected void onInitialize() { | ||
super.onInitialize(); | ||
initLayout(); | ||
} | ||
|
||
private void initLayout() { | ||
|
||
SingleContainerPanel<ConstructionType> baseConstructionPanel = new SingleContainerPanel<>(ID_BASIC, getModel(), ConstructionType.COMPLEX_TYPE) { | ||
|
||
@Override | ||
protected ItemVisibility getVisibility(ItemPath itemPath) { | ||
if (isAssociation(itemPath)) { | ||
return ItemVisibility.HIDDEN; | ||
} | ||
|
||
if (isAttributePath(itemPath)) { | ||
return ItemVisibility.HIDDEN; | ||
} | ||
|
||
if (ConstructionType.F_KIND.equivalent(itemPath.lastName())) { | ||
return ItemVisibility.HIDDEN; | ||
} | ||
|
||
if (ConstructionType.F_INTENT.equivalent(itemPath.lastName())) { | ||
return ItemVisibility.HIDDEN; | ||
} | ||
|
||
if (ConstructionType.F_RESOURCE_REF.equivalent(itemPath.lastName())) { | ||
return ItemVisibility.HIDDEN; | ||
} | ||
return ItemVisibility.AUTO; | ||
} | ||
}; | ||
add(baseConstructionPanel); | ||
|
||
ResourceAttributePanel attrsPanel = new ResourceAttributePanel(ID_ATTRIBUTES, PrismContainerWrapperModel.fromContainerWrapper(getModel(), ConstructionType.F_ATTRIBUTE)); | ||
add(attrsPanel); | ||
|
||
} | ||
|
||
private boolean isAttributePath(ItemPath itemPath) { | ||
ItemPath assignmentAttribute = ItemPath.create(FocusType.F_ASSIGNMENT, AssignmentType.F_CONSTRUCTION, ConstructionType.F_ATTRIBUTE); | ||
ItemPath inducementAttribute = ItemPath.create(AbstractRoleType.F_INDUCEMENT, AssignmentType.F_CONSTRUCTION, ConstructionType.F_ATTRIBUTE); | ||
ItemPath pathWithoutIds = itemPath.namedSegmentsOnly(); | ||
return pathWithoutIds.equivalent(assignmentAttribute) || pathWithoutIds.equivalent(inducementAttribute); | ||
} | ||
|
||
private boolean isAssociation(ItemPath itemPath) { | ||
ItemPath assignmentAssociation = ItemPath.create(FocusType.F_ASSIGNMENT, AssignmentType.F_CONSTRUCTION, ConstructionType.F_ASSOCIATION); | ||
ItemPath inducementAssociation = ItemPath.create(AbstractRoleType.F_INDUCEMENT, AssignmentType.F_CONSTRUCTION, ConstructionType.F_ASSOCIATION); | ||
ItemPath pathWithoutIds = itemPath.namedSegmentsOnly(); | ||
return pathWithoutIds.equivalent(assignmentAssociation) || pathWithoutIds.equivalent(inducementAssociation); | ||
} | ||
} |
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
14 changes: 14 additions & 0 deletions
14
...-gui/src/main/java/com/evolveum/midpoint/gui/impl/prism/panel/ResourceAttributePanel.html
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,14 @@ | ||
<!-- | ||
~ Copyright (c) 2021 Evolveum | ||
~ | ||
~ This work is dual-licensed under the Apache License 2.0 | ||
~ and European Union Public License. See LICENSE file for details. | ||
--> | ||
|
||
<!DOCTYPE html> | ||
<html xmlns:wicket="http://wicket.apache.org"> | ||
<wicket:panel> | ||
<div wicket:id="table" /> | ||
|
||
</wicket:panel> | ||
</html> |
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
22 changes: 22 additions & 0 deletions
22
...main/java/com/evolveum/midpoint/web/page/admin/resources/ResourceSchemaHandlingPanel.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,22 @@ | ||
/* | ||
* Copyright (c) 2021 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.web.page.admin.resources; | ||
|
||
import com.evolveum.midpoint.gui.api.component.BasePanel; | ||
import com.evolveum.midpoint.gui.api.prism.wrapper.PrismContainerWrapper; | ||
import com.evolveum.midpoint.xml.ns._public.common.common_3.SchemaHandlingType; | ||
|
||
import org.apache.wicket.model.IModel; | ||
|
||
public class ResourceSchemaHandlingPanel extends BasePanel<PrismContainerWrapper<SchemaHandlingType>> { | ||
|
||
public ResourceSchemaHandlingPanel(String id, IModel<PrismContainerWrapper<SchemaHandlingType>> model) { | ||
super(id, model); | ||
} | ||
|
||
|
||
} |