Skip to content

Commit 5758188

Browse files
Merge branch 'master' of https://github.com/Evolveum/midpoint
2 parents ba6f5b7 + 644c432 commit 5758188

File tree

51 files changed

+1066
-2680
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+1066
-2680
lines changed

gui/admin-gui/src/main/java/com/evolveum/midpoint/gui/impl/page/admin/connector/development/component/wizard/scimrest/objectclass/schema/WaitingObjectClassDetailsConnectorStepPanel.java

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,10 @@
77
package com.evolveum.midpoint.gui.impl.page.admin.connector.development.component.wizard.scimrest.objectclass.schema;
88

99
import com.evolveum.midpoint.gui.api.prism.wrapper.PrismContainerValueWrapper;
10-
import com.evolveum.midpoint.gui.api.prism.wrapper.PrismContainerWrapper;
11-
import com.evolveum.midpoint.gui.api.util.WebPrismUtil;
1210
import com.evolveum.midpoint.gui.impl.page.admin.connector.development.component.wizard.ConnectorDevelopmentWizardUtil;
13-
import com.evolveum.midpoint.prism.PrismContainerValue;
1411
import com.evolveum.midpoint.prism.path.ItemName;
15-
import com.evolveum.midpoint.prism.path.ItemPath;
1612
import com.evolveum.midpoint.xml.ns._public.common.common_3.*;
1713

18-
import org.apache.commons.lang3.Strings;
1914
import org.apache.wicket.model.IModel;
2015

2116
import com.evolveum.midpoint.gui.impl.component.wizard.WizardPanelHelper;
@@ -31,8 +26,6 @@
3126
import com.evolveum.midpoint.web.application.PanelInstance;
3227
import com.evolveum.midpoint.web.application.PanelType;
3328

34-
import java.util.Optional;
35-
3629
/**
3730
* @author lskublik
3831
*/
@@ -56,7 +49,7 @@ public WaitingObjectClassDetailsConnectorStepPanel(
5649

5750
@Override
5851
protected StatusInfo<?> obtainResult(String token, Task task, OperationResult result) throws SchemaException, ObjectNotFoundException {
59-
return getDetailsModel().getServiceLocator().getConnectorService().getDiscoverObjectClassDetailsStatus(token, task, result);
52+
return getDetailsModel().getServiceLocator().getConnectorService().getDiscoverObjectClassAttributesStatus(token, task, result);
6053
}
6154

6255
@Override
@@ -92,7 +85,7 @@ protected IModel<String> getSubTextModel() {
9285

9386
@Override
9487
protected ItemName getActivityType() {
95-
return WorkDefinitionsType.F_DISCOVER_OBJECT_CLASS_DETAILS;
88+
return WorkDefinitionsType.F_DISCOVER_OBJECT_CLASS_ATTRIBUTES;
9689
}
9790

9891
@Override

gui/admin-gui/src/main/java/com/evolveum/midpoint/gui/impl/page/admin/resource/PageResource.java

Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,9 @@
1010
import java.util.List;
1111

1212
import com.evolveum.midpoint.gui.api.prism.wrapper.PrismContainerValueWrapper;
13-
import com.evolveum.midpoint.gui.api.util.LocalizationUtil;
1413
import com.evolveum.midpoint.gui.impl.page.admin.DetailsFragment;
1514
import com.evolveum.midpoint.gui.impl.page.admin.resource.component.wizard.schema.ResourceSchemaWizardPanel;
1615
import com.evolveum.midpoint.gui.impl.page.admin.resource.component.wizard.schemaHandling.associationType.ResourceAssociationTypeWizardPanel;
17-
import com.evolveum.midpoint.gui.impl.page.admin.resource.component.wizard.schemaHandling.associationType.subject.mappingContainer.inbound.AssociationInboundEvaluatorWizardPanel;
18-
import com.evolveum.midpoint.gui.impl.page.admin.resource.component.wizard.schemaHandling.associationType.subject.mappingContainer.inbound.AssociationInboundMappingContainerWizardPanel;
19-
import com.evolveum.midpoint.gui.impl.page.admin.resource.component.wizard.schemaHandling.associationType.subject.mappingContainer.outbound.AssociationOutboundEvaluatorWizardPanel;
20-
import com.evolveum.midpoint.gui.impl.page.admin.resource.component.wizard.schemaHandling.associationType.subject.mappingContainer.outbound.AssociationOutboundMappingContainerWizardPanel;
2116
import com.evolveum.midpoint.gui.impl.page.admin.resource.component.wizard.schemaHandling.objectType.policies.PoliciesObjectTypeWizardPanel;
2217
import com.evolveum.midpoint.gui.impl.page.admin.resource.component.wizard.schemaHandling.objectType.smart.page.SmartObjectTypeSuggestionWizardPanel;
2318
import com.evolveum.midpoint.prism.Containerable;
@@ -289,56 +284,6 @@ public void showPoliciesWizard(AjaxRequestTarget target, ItemPath pathToValue) {
289284
showContainerWizardForObjectType(target, pathToValue, PoliciesObjectTypeWizardPanel.class);
290285
}
291286

292-
public void showAssociationInboundsWizard(
293-
AjaxRequestTarget target,
294-
ItemPath pathToValue,
295-
ShadowAssociationTypeDefinitionType association,
296-
IModel<String> exitLabel) {
297-
showWizard(target, pathToValue, AssociationInboundMappingContainerWizardPanel.class, exitLabel);
298-
addWizardBreadcrumbsForAssociationType(
299-
association, LocalizationUtil.translate("PageResource.association.wizard.inbound"));
300-
}
301-
302-
public void showAssociationInboundWizard(
303-
AjaxRequestTarget target,
304-
ItemPath pathToValue,
305-
ShadowAssociationTypeDefinitionType association,
306-
IModel<String> exitLabel) {
307-
AssociationInboundEvaluatorWizardPanel panel = showWizard(
308-
target,
309-
pathToValue,
310-
AssociationInboundEvaluatorWizardPanel.class,
311-
exitLabel);
312-
panel.setShowChoicePanel(true);
313-
addWizardBreadcrumbsForAssociationType(
314-
association, LocalizationUtil.translate("PageResource.association.wizard.inbound"));
315-
}
316-
317-
public void showAssociationOutboundsWizard(
318-
AjaxRequestTarget target,
319-
ItemPath pathToValue,
320-
ShadowAssociationTypeDefinitionType association,
321-
IModel<String> exitLabel) {
322-
showWizard(target, pathToValue, AssociationOutboundMappingContainerWizardPanel.class, exitLabel);
323-
addWizardBreadcrumbsForAssociationType(
324-
association, LocalizationUtil.translate("PageResource.association.wizard.outbound"));
325-
}
326-
327-
public void showAssociationOutboundWizard(
328-
AjaxRequestTarget target,
329-
ItemPath pathToValue,
330-
ShadowAssociationTypeDefinitionType association,
331-
IModel<String> exitLabel) {
332-
AssociationOutboundEvaluatorWizardPanel panel = showWizard(
333-
target,
334-
pathToValue,
335-
AssociationOutboundEvaluatorWizardPanel.class,
336-
exitLabel);
337-
panel.setShowChoicePanel(true);
338-
addWizardBreadcrumbsForAssociationType(
339-
association, LocalizationUtil.translate("PageResource.association.wizard.outbound"));
340-
}
341-
342287
public void showComplexOrEnumerationTypeWizard(AjaxRequestTarget target) {
343288
showWizard(
344289
target,

gui/admin-gui/src/main/java/com/evolveum/midpoint/gui/impl/page/admin/resource/component/ResourceObjectsPanel.java

Lines changed: 11 additions & 104 deletions
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ public CompositedIconBuilder getIconCompositedBuilder() {
421421
items.add(menu);
422422

423423
menu = new ButtonInlineMenuItem(
424-
createStringResource("ResourceObjectsPanel.button.association.inbound")) {
424+
createStringResource("ResourceObjectsPanel.button.association")) {
425425
@Serial private static final long serialVersionUID = 1L;
426426

427427
@Override
@@ -447,15 +447,17 @@ public void onClick(AjaxRequestTarget target) {
447447
}
448448

449449
if (associations.size() == 1) {
450-
showAssociationInboundWizard(associations.iterator().next(), target);
450+
showAssociationWizard(associations.iterator().next(), target);
451451
} else {
452452
ChoiceAssociationPopupPanel popup = new ChoiceAssociationPopupPanel(
453453
getPageBase().getMainPopupBodyId(),
454454
getObjectDetailsModels(),
455455
associations) {
456456
@Override
457457
protected void onTileClickPerformed(AssociationDefinitionWrapper value, AjaxRequestTarget target) {
458-
showAssociationInboundWizard(value.getSourceValue(), target);
458+
if (value != null && value.getSourceValue() != null) {
459+
showAssociationWizard(value.getSourceValue(), target);
460+
}
459461
}
460462
};
461463
getPageBase().showMainPopup(popup, target);
@@ -475,65 +477,9 @@ public CompositedIconBuilder getIconCompositedBuilder() {
475477
};
476478
menu.setVisible(createAssociationMenuItemVisibilityModel());
477479
items.add(menu);
478-
479-
menu = new ButtonInlineMenuItem(
480-
createStringResource("ResourceObjectsPanel.button.association.outbound")) {
481-
@Serial private static final long serialVersionUID = 1L;
482-
483-
@Override
484-
public InlineMenuItemAction initAction() {
485-
return new ColumnMenuAction<>() {
486-
@Serial private static final long serialVersionUID = 1L;
487-
488-
@Override
489-
public void onClick(AjaxRequestTarget target) {
490-
ResourceObjectTypeDefinition selectedObjectType = getSelectedObjectTypeDefinition();
491-
if (selectedObjectType == null) {
492-
getPageBase().warn(LocalizationUtil.translate("PageResource.objectTypeIsNullForAssociation"));
493-
target.add(getPageBase().getFeedbackPanel());
494-
return;
495-
}
496-
497-
try {
498-
List<PrismContainerValueWrapper<ShadowAssociationTypeDefinitionType>> associations =
499-
AssociationChildWrapperUtil.findAssociationDefinitions(getObjectWrapper(), selectedObjectType);
500-
501-
if (associations.isEmpty()) {
502-
return;
503-
}
504-
505-
if (associations.size() == 1) {
506-
showAssociationOutboundWizard(associations.iterator().next(), target);
507-
} else {
508-
ChoiceAssociationPopupPanel popup = new ChoiceAssociationPopupPanel(
509-
getPageBase().getMainPopupBodyId(),
510-
getObjectDetailsModels(),
511-
associations) {
512-
@Override
513-
protected void onTileClickPerformed(AssociationDefinitionWrapper value, AjaxRequestTarget target) {
514-
showAssociationOutboundWizard(value.getSourceValue(), target);
515-
}
516-
};
517-
getPageBase().showMainPopup(popup, target);
518-
}
519-
520-
} catch (SchemaException e) {
521-
LOGGER.error("Couldn't load association for " + selectedObjectType);
522-
}
523-
}
524-
};
525-
}
526-
527-
@Override
528-
public CompositedIconBuilder getIconCompositedBuilder() {
529-
return getDefaultCompositedIconBuilder("fa fa-arrow-right-from-bracket");
530-
}
531-
};
532-
menu.setVisible(createAssociationMenuItemVisibilityModel());
533-
items.add(menu);
534480
}
535481

536-
private IModel<Boolean> createAssociationMenuItemVisibilityModel() {
482+
private @NotNull IModel<Boolean> createAssociationMenuItemVisibilityModel() {
537483
return () -> {
538484
ResourceObjectTypeDefinition selectedObjectType = getSelectedObjectTypeDefinition();
539485
if (selectedObjectType == null) {
@@ -550,56 +496,17 @@ private IModel<Boolean> createAssociationMenuItemVisibilityModel() {
550496
};
551497
}
552498

553-
private void showAssociationInboundWizard(@NotNull PrismContainerValueWrapper<ShadowAssociationTypeDefinitionType> associationWrapper, AjaxRequestTarget target) {
554-
ShadowAssociationTypeDefinitionType association = associationWrapper.getRealValue();
555-
if (association == null) {
556-
return;
557-
}
558-
559-
if (association.getSubject() == null || association.getSubject().getAssociation() == null) {
560-
return;
561-
}
562-
499+
private void showAssociationWizard(
500+
@NotNull PrismContainerValueWrapper<ShadowAssociationTypeDefinitionType> associationWrapper,
501+
AjaxRequestTarget target) {
563502
PageResource page = getObjectDetailsModels().getPageResource();
564-
if (association.getSubject().getAssociation().getInbound().size() == 1) {
565-
ItemPath path = association.getSubject().getAssociation().getInbound().iterator().next().asPrismContainerValue().getPath();
566-
567-
page.showAssociationInboundWizard(target, path, association, createExitLabelModel());
568-
} else {
569-
ItemPath path = association.asPrismContainerValue().getPath()
570-
.append(ShadowAssociationTypeDefinitionType.F_SUBJECT)
571-
.append(ShadowAssociationTypeSubjectDefinitionType.F_ASSOCIATION);
572-
573-
page.showAssociationInboundsWizard(target, path, association, createExitLabelModel());
574-
}
575-
}
576-
577-
private IModel<String> createExitLabelModel() {
578-
return new StringResourceModel("ResourceObjectsPanel.associationWizard.exitLabel." + getKind());
579-
}
580-
581-
private void showAssociationOutboundWizard(PrismContainerValueWrapper<ShadowAssociationTypeDefinitionType> associationWrapper, AjaxRequestTarget target) {
582503
ShadowAssociationTypeDefinitionType association = associationWrapper.getRealValue();
583504
if (association == null) {
584505
return;
585506
}
586507

587-
if (association.getSubject() == null || association.getSubject().getAssociation() == null) {
588-
return;
589-
}
590-
591-
PageResource page = getObjectDetailsModels().getPageResource();
592-
if (association.getSubject().getAssociation().getOutbound().size() == 1) {
593-
ItemPath path = association.getSubject().getAssociation().getOutbound().iterator().next().asPrismContainerValue().getPath();
594-
595-
page.showAssociationOutboundWizard(target, path, association, createExitLabelModel());
596-
} else {
597-
ItemPath path = association.asPrismContainerValue().getPath()
598-
.append(ShadowAssociationTypeDefinitionType.F_SUBJECT)
599-
.append(ShadowAssociationTypeSubjectDefinitionType.F_ASSOCIATION);
600-
601-
page.showAssociationOutboundsWizard(target, path, association, createExitLabelModel());
602-
}
508+
ItemPath path = association.asPrismContainerValue().getPath();
509+
page.showResourceAssociationTypePreviewWizard(target, path);
603510
}
604511

605512
private ButtonInlineMenuItem createWizardItemPanel(
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<!--
2+
~ Copyright (c) 2010-2026 Evolveum and contributors
3+
~
4+
~ Licensed under the EUPL-1.2 or later.
5+
-->
6+
7+
<!DOCTYPE html>
8+
<html xmlns="http://www.w3.org/1999/xhtml"
9+
xmlns:wicket="http://wicket.apache.org">
10+
<body>
11+
<wicket:panel>
12+
13+
<div class="col-12 d-flex justify-content-center">
14+
<div class="col-8 alert info-light-alert d-flex justify-content-between align-items-center mt-3" wicket:id="infoPanel">
15+
<div class="d-flex align-items-center gap-2">
16+
<i class="fa fa-info-circle"></i>
17+
<span wicket:id="infoText"></span>
18+
</div>
19+
20+
<a wicket:id="close" class="text-muted ms-2" style="cursor:pointer;">
21+
<i class="fa fa-times"></i>
22+
</a>
23+
</div>
24+
</div>
25+
26+
<div wicket:id="fragment"></div>
27+
28+
<wicket:fragment wicket:id="choiceFragment">
29+
<div wicket:id="choicePanel"></div>
30+
</wicket:fragment>
31+
32+
<wicket:fragment wicket:id="wizardFragment">
33+
<form wicket:id="mainForm">
34+
<div wicket:id="wizard"></div>
35+
</form>
36+
</wicket:fragment>
37+
</wicket:panel>
38+
</body>
39+
</html>

0 commit comments

Comments
 (0)