Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master'
- Loading branch information
Showing
17 changed files
with
673 additions
and
546 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
14 changes: 14 additions & 0 deletions
14
...ain/java/com/evolveum/midpoint/gui/impl/component/VariableBindingDefinitionTypePanel.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) 2020 Evolveum | ||
~ | ||
~ This work is dual-licensed under the Apache License 2.0 | ||
~ and European Union Public License. See LICENSE file for details. | ||
--> | ||
<html xmlns="http://www.w3.org/1999/xhtml" | ||
xmlns:wicket="http://wicket.apache.org"> | ||
<body> | ||
<wicket:panel> | ||
<div wicket:id="pathPanel"></div> | ||
</wicket:panel> | ||
</body> | ||
</html> |
61 changes: 61 additions & 0 deletions
61
...ain/java/com/evolveum/midpoint/gui/impl/component/VariableBindingDefinitionTypePanel.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,61 @@ | ||
/* | ||
* Copyright (c) 2020 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.component.path.ItemPathDto; | ||
import com.evolveum.midpoint.gui.api.component.path.ItemPathPanel; | ||
import com.evolveum.midpoint.prism.path.ItemPath; | ||
import com.evolveum.midpoint.xml.ns._public.common.common_3.VariableBindingDefinitionType; | ||
|
||
import com.evolveum.prism.xml.ns._public.types_3.ItemPathType; | ||
|
||
import org.apache.wicket.markup.html.basic.Label; | ||
import org.apache.wicket.model.IModel; | ||
|
||
public class VariableBindingDefinitionTypePanel extends BasePanel<VariableBindingDefinitionType> { | ||
|
||
private static final String ID_PATH_LABEL = "pathLabel"; | ||
private static final String ID_PATH_PANEL = "pathPanel"; | ||
|
||
public VariableBindingDefinitionTypePanel(String id, IModel<VariableBindingDefinitionType> model) { | ||
super(id, model); | ||
} | ||
|
||
@Override | ||
protected void onInitialize() { | ||
super.onInitialize(); | ||
initLayout(); | ||
} | ||
|
||
private void initLayout() { | ||
ItemPathPanel pathPanel = new ItemPathPanel(ID_PATH_PANEL, createPathModel()) { | ||
|
||
@Override | ||
protected void onUpdate(ItemPathDto itemPathDto) { | ||
ItemPath newPath = getModelObject().toItemPath(); | ||
ItemPathType newPathtype = null; | ||
if (newPath != null) { | ||
newPathtype = new ItemPathType(newPath); | ||
} | ||
|
||
VariableBindingDefinitionTypePanel.this.getModelObject().setPath(newPathtype); | ||
} | ||
}; | ||
pathPanel.setOutputMarkupId(true); | ||
add(pathPanel); | ||
|
||
} | ||
|
||
private ItemPathDto createPathModel() { | ||
VariableBindingDefinitionType variable = getModelObject(); | ||
if (variable == null) { | ||
return new ItemPathDto(); | ||
} | ||
return new ItemPathDto(variable.getPath()); | ||
} | ||
} |
110 changes: 50 additions & 60 deletions
110
...admin-gui/src/main/java/com/evolveum/midpoint/gui/impl/factory/ConditionPanelFactory.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 |
---|---|---|
@@ -1,60 +1,50 @@ | ||
/* | ||
* Copyright (c) 2020 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; | ||
|
||
import com.evolveum.midpoint.gui.api.factory.AbstractGuiComponentFactory; | ||
import com.evolveum.midpoint.gui.api.prism.ItemWrapper; | ||
import com.evolveum.midpoint.gui.impl.prism.PrismPropertyWrapper; | ||
import com.evolveum.midpoint.prism.path.ItemPath; | ||
import com.evolveum.midpoint.util.QNameUtil; | ||
import com.evolveum.midpoint.web.page.admin.configuration.component.EmptyOnBlurAjaxFormUpdatingBehaviour; | ||
import com.evolveum.midpoint.web.page.admin.configuration.component.EmptyOnChangeAjaxFormUpdatingBehavior; | ||
import com.evolveum.midpoint.web.page.admin.reports.component.AceEditorPanel; | ||
import com.evolveum.midpoint.xml.ns._public.common.common_3.*; | ||
|
||
import org.apache.wicket.markup.html.panel.Panel; | ||
import org.springframework.stereotype.Component; | ||
|
||
import javax.annotation.PostConstruct; | ||
import java.io.Serializable; | ||
|
||
@Component | ||
public class ConditionPanelFactory extends AbstractGuiComponentFactory<ExpressionType> implements Serializable { | ||
|
||
@PostConstruct | ||
public void register() { | ||
getRegistry().addToRegistry(this); | ||
} | ||
|
||
@Override | ||
protected Panel getPanel(PrismPropertyPanelContext<ExpressionType> panelCtx) { | ||
AceEditorPanel conditionPanel = new AceEditorPanel(panelCtx.getComponentId(), null, new ExpressionModel(panelCtx.getRealValueModel(), panelCtx.getPageBase()), 200){ | ||
@Override | ||
protected boolean isResizeToMaxHeight() { | ||
return false; | ||
} | ||
}; | ||
// conditionPanel.getEditor().add(new OnChangeAjaxBehavior() { | ||
// @Override | ||
// protected void onUpdate(AjaxRequestTarget ajaxRequestTarget) { | ||
// | ||
// } | ||
// }); | ||
conditionPanel.getEditor().add(new EmptyOnBlurAjaxFormUpdatingBehaviour()); | ||
conditionPanel.getEditor().add(new EmptyOnChangeAjaxFormUpdatingBehavior()); | ||
return conditionPanel; | ||
} | ||
|
||
@Override | ||
public <IW extends ItemWrapper> boolean match(IW wrapper) { | ||
ItemPath assignmentConditionPath = ItemPath.create(AssignmentHolderType.F_ASSIGNMENT, AssignmentType.F_CONDITION, MappingType.F_EXPRESSION); | ||
ItemPath inducementConditionPath = ItemPath.create(AbstractRoleType.F_INDUCEMENT, AssignmentType.F_CONDITION, MappingType.F_EXPRESSION); | ||
|
||
ItemPath wrapperPath = wrapper.getPath().namedSegmentsOnly(); | ||
return wrapper instanceof PrismPropertyWrapper && (inducementConditionPath.isSubPathOrEquivalent(wrapperPath) || assignmentConditionPath.isSubPathOrEquivalent(wrapperPath) || QNameUtil.match(AssignmentType.F_CONDITION, wrapper.getItemName())); | ||
} | ||
} | ||
/* | ||
* Copyright (c) 2020 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; | ||
|
||
import com.evolveum.midpoint.gui.api.factory.AbstractGuiComponentFactory; | ||
import com.evolveum.midpoint.gui.api.prism.ItemWrapper; | ||
import com.evolveum.midpoint.gui.impl.prism.PrismPropertyWrapper; | ||
import com.evolveum.midpoint.prism.path.ItemPath; | ||
import com.evolveum.midpoint.util.QNameUtil; | ||
import com.evolveum.midpoint.web.page.admin.configuration.component.EmptyOnBlurAjaxFormUpdatingBehaviour; | ||
import com.evolveum.midpoint.web.page.admin.configuration.component.EmptyOnChangeAjaxFormUpdatingBehavior; | ||
import com.evolveum.midpoint.web.page.admin.reports.component.AceEditorPanel; | ||
import com.evolveum.midpoint.xml.ns._public.common.common_3.*; | ||
|
||
import org.apache.wicket.markup.html.panel.Panel; | ||
import org.springframework.stereotype.Component; | ||
|
||
import javax.annotation.PostConstruct; | ||
import java.io.Serializable; | ||
|
||
@Component | ||
public class ConditionPanelFactory extends AbstractGuiComponentFactory<ExpressionType> implements Serializable { | ||
|
||
@PostConstruct | ||
public void register() { | ||
getRegistry().addToRegistry(this); | ||
} | ||
|
||
@Override | ||
protected Panel getPanel(PrismPropertyPanelContext<ExpressionType> panelCtx) { | ||
AceEditorPanel conditionPanel = new AceEditorPanel(panelCtx.getComponentId(), null, new ExpressionModel(panelCtx.getRealValueModel(), panelCtx.getPageBase()), 200){ | ||
@Override | ||
protected boolean isResizeToMaxHeight() { | ||
return false; | ||
} | ||
}; | ||
conditionPanel.getEditor().add(new EmptyOnBlurAjaxFormUpdatingBehaviour()); | ||
conditionPanel.getEditor().add(new EmptyOnChangeAjaxFormUpdatingBehavior()); | ||
return conditionPanel; | ||
} | ||
|
||
@Override | ||
public <IW extends ItemWrapper> boolean match(IW wrapper) { | ||
return QNameUtil.match(ExpressionType.COMPLEX_TYPE, wrapper.getTypeName()); | ||
} | ||
} |
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
38 changes: 38 additions & 0 deletions
38
...ava/com/evolveum/midpoint/gui/impl/factory/VariableBindingDefinitionTypePanelFactory.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,38 @@ | ||
/* | ||
* Copyright (c) 2020 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; | ||
|
||
import com.evolveum.midpoint.gui.api.factory.AbstractGuiComponentFactory; | ||
import com.evolveum.midpoint.gui.api.prism.ItemWrapper; | ||
import com.evolveum.midpoint.gui.impl.component.VariableBindingDefinitionTypePanel; | ||
import com.evolveum.midpoint.util.QNameUtil; | ||
import com.evolveum.midpoint.xml.ns._public.common.common_3.VariableBindingDefinitionType; | ||
|
||
import org.apache.wicket.markup.html.panel.Panel; | ||
import org.springframework.stereotype.Component; | ||
|
||
import javax.annotation.PostConstruct; | ||
|
||
@Component | ||
public class VariableBindingDefinitionTypePanelFactory extends AbstractGuiComponentFactory<VariableBindingDefinitionType> { | ||
|
||
|
||
@PostConstruct | ||
public void register() { | ||
getRegistry().addToRegistry(this); | ||
} | ||
|
||
@Override | ||
protected Panel getPanel(PrismPropertyPanelContext<VariableBindingDefinitionType> panelCtx) { | ||
return new VariableBindingDefinitionTypePanel(panelCtx.getComponentId(), panelCtx.getRealValueModel()); | ||
} | ||
|
||
@Override | ||
public <IW extends ItemWrapper> boolean match(IW wrapper) { | ||
return QNameUtil.match(VariableBindingDefinitionType.COMPLEX_TYPE, wrapper.getTypeName()); | ||
} | ||
} |
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
Oops, something went wrong.