Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
skublik committed Oct 29, 2021
2 parents c8f6ba7 + adeb3af commit 0010345
Show file tree
Hide file tree
Showing 353 changed files with 4,436 additions and 5,165 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@
import com.evolveum.midpoint.repo.api.CacheDispatcher;
import com.evolveum.midpoint.repo.api.RepositoryService;
import com.evolveum.midpoint.repo.common.ObjectResolver;
import com.evolveum.midpoint.repo.common.activity.CounterManager;
import com.evolveum.midpoint.repo.common.expression.Expression;
import com.evolveum.midpoint.repo.common.expression.ExpressionEvaluationContext;
import com.evolveum.midpoint.repo.common.expression.ExpressionFactory;
Expand Down Expand Up @@ -290,8 +289,6 @@ public abstract class PageBase extends WebPage implements ModelServiceLocator {
@SpringBean private GuiComponentRegistry registry;
@SpringBean private DefaultGuiConfigurationCompiler guiConfigurationRegistry;

@SpringBean private CounterManager counterManager;

@SpringBean private ClusterExecutionHelper clusterExecutionHelper;

@SpringBean private AdminGuiConfigurationMergeManager adminGuiConfigurationMergeManager;
Expand Down Expand Up @@ -398,10 +395,6 @@ public LocalizationService getLocalizationService() {
return localizationService;
}

public CounterManager getCounterManager() {
return counterManager;
}

@Contract(pure = true)
public PrismContext getPrismContext() {
return getMidpointApplication().getPrismContext();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5026,6 +5026,17 @@ public static int countLinkForNonDeadShadows(Collection<ObjectReferenceType> ref
return count;
}

public static int countLinkForDeadShadows(Collection<ObjectReferenceType> refs) {
int count = 0;
for (ObjectReferenceType ref : refs) {
if (QNameUtil.match(ref.getRelation(), SchemaConstants.ORG_RELATED)) {
count++;
}
continue;
}
return count;
}

public static List<DisplayableValue<?>> getAllowedValues(SearchFilterParameterType parameter, PageBase pageBase) {
List<DisplayableValue<?>> allowedValues = new ArrayList<>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,11 @@ boolean skipCreateWrapper(ItemDefinition<?> def, ItemStatus status, WrapperConte

}

if (ObjectType.F_LENS_CONTEXT.equivalent(def.getItemName())) {
LOGGER.trace("Skipping creating wrapper for lensContext.");
return true;
}

if (ItemStatus.ADDED == status && TaskType.F_SUBTASK_REF.equivalent(def.getItemName())) {
LOGGER.trace("Skipping creating wrapper for new subtaskRef, this is not supported. Only wrapper for existing subtaskRef should be created");
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,15 @@ protected ResourceAttributeWrapper<T> createWrapperInternal(PrismContainerValueW
@Override
public void registerWrapperPanel(ResourceAttributeWrapper<T> wrapper) {
getRegistry().registerWrapperPanel(new QName("ResourceAttributeDefinition"), ResourceAttributeDefinitionPanel.class);
}

@Override
protected boolean canCreateWrapper(ItemDefinition<?> def, ItemStatus status, WrapperContext context, boolean isEmptyValue) {
if (!super.canCreateWrapper(def, status, context, isEmptyValue)) {
return false;
}

return isEmptyValue ? context.isCreateIfEmpty() : true;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ private List<ShadowWrapper> loadShadowWrappers() {
long timestampWrapperStart = System.currentTimeMillis();
try {

ShadowWrapper wrapper = loadShadowWrapper(projection, task, subResult);
ShadowWrapper wrapper = loadShadowWrapper(projection, true, task, subResult);
wrapper.setLoadWithNoFetch(true);
list.add(wrapper);

Expand All @@ -128,10 +128,10 @@ private Collection<SelectorOptions<GetOperationOptions>> createLoadOptionForShad
}

@NotNull
public ShadowWrapper loadShadowWrapper(PrismObject<ShadowType> projection, Task task, OperationResult result) throws SchemaException {
public ShadowWrapper loadShadowWrapper(PrismObject<ShadowType> projection, boolean noFetch, Task task, OperationResult result) throws SchemaException {
PrismObjectWrapperFactory<ShadowType> factory = getPageBase().findObjectWrapperFactory(projection.getDefinition());
WrapperContext context = new WrapperContext(task, result);
context.setCreateIfEmpty(false);
context.setCreateIfEmpty(noFetch ? false : true);
ShadowWrapper wrapper = (ShadowWrapper) factory.createObjectWrapper(projection, ItemStatus.NOT_CHANGED, context);
wrapper.setProjectionStatus(UserDtoStatus.MODIFY);
return wrapper;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;

public class AssignmentHolderOperationalButtonsPanel<AH extends AssignmentHolderType> extends OperationalButtonsPanel<AH> {

Expand Down Expand Up @@ -85,7 +86,7 @@ public void onClick(AjaxRequestTarget target) {
};
changeArchetype.showTitleAsLabel(true);
changeArchetype.add(new VisibleBehaviour(() -> !getModelObject().isReadOnly() && isEditingObject()
&& getObjectArchetypeRef() != null && CollectionUtils.isNotEmpty(getArchetypeOidsListToAssign())));
&& getObjectArchetypeRef() != null)); // && CollectionUtils.isNotEmpty(getArchetypeOidsListToAssign())));
changeArchetype.add(AttributeAppender.append("class", "btn-default btn-sm"));
repeatingView.add(changeArchetype);
}
Expand Down Expand Up @@ -225,9 +226,7 @@ private List<String> getFilteredArchetypeOidsList() {
List<String> oidsList = new ArrayList<>();
try {
List<ArchetypeType> filteredArchetypes = getPageBase().getModelInteractionService().getFilteredArchetypesByHolderType(obj, result);
if (filteredArchetypes != null) {
filteredArchetypes.forEach(archetype -> oidsList.add(archetype.getOid()));
}
oidsList = filteredArchetypes.stream().map(filteredArchetype -> filteredArchetype.getOid()).collect(Collectors.toList());
} catch (SchemaException ex) {
result.recordPartialError(ex.getLocalizedMessage());
LOGGER.error("Couldn't load assignment target specification for the object {} , {}", obj.getName(), ex.getLocalizedMessage());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,9 +265,14 @@ private int countDeadShadows() {
if (getProjectionsModel() == null) {
return 0;
}

if (!getProjectionsModel().isLoaded()) {
return WebComponentUtil.countLinkForDeadShadows(getObjectWrapper().getObject().asObjectable().getLinkRef());
}

List<ShadowWrapper> projectionWrappers = getProjectionsModel().getObject();
if (projectionWrappers == null) {
return 0;
return 0;
}

int dead = 0;
Expand Down Expand Up @@ -959,7 +964,7 @@ private Collection<SelectorOptions<GetOperationOptions>> createLoadOptionForShad
public ShadowWrapper loadShadowWrapper(PrismObject<ShadowType> projection, Task task, OperationResult result) throws SchemaException {
PrismObjectWrapperFactory<ShadowType> factory = getPageBase().findObjectWrapperFactory(projection.getDefinition());
WrapperContext context = new WrapperContext(task, result);
context.setCreateIfEmpty(false);
context.setCreateIfEmpty(true);
context.setDetailsPageTypeConfiguration(findShadowDetailsPageConfiguration(projection.asObjectable()));
ShadowWrapper wrapper = (ShadowWrapper) factory.createObjectWrapper(projection, ItemStatus.NOT_CHANGED, context);
wrapper.setProjectionStatus(UserDtoStatus.MODIFY);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

import com.evolveum.midpoint.gui.api.GuiStyleConstants;
import com.evolveum.midpoint.gui.impl.page.admin.AbstractObjectMainPanel;
import com.evolveum.midpoint.gui.impl.page.admin.ObjectDetailsModels;
import com.evolveum.midpoint.gui.impl.page.admin.task.TaskDetailsModel;
import com.evolveum.midpoint.gui.impl.prism.panel.SingleContainerPanel;
import com.evolveum.midpoint.prism.path.ItemPath;
Expand All @@ -20,7 +19,7 @@
import com.evolveum.midpoint.web.model.PrismContainerWrapperModel;
import com.evolveum.midpoint.xml.ns._public.common.common_3.*;

@PanelType(name = "controlFlow", defaultContainerPath = "activity/controlFlow", defaultType = ActivityControlFlowSpecificationType.class)
@PanelType(name = "controlFlow", defaultContainerPath = "activity/controlFlow", defaultType = ActivityControlFlowDefinitionType.class)
@PanelInstance(identifier = "controlFlow", applicableForType = TaskType.class, childOf = TaskActivityPanel.class,
display = @PanelDisplay(label = "ActivityDefinitionType.controlFlow", icon = GuiStyleConstants.CLASS_TASK_CONTROL_FLOW_ICON, order = 20))
public class TaskControlFlowSpecificationPanel extends AbstractObjectMainPanel<TaskType, TaskDetailsModel> {
Expand All @@ -40,7 +39,7 @@ public TaskControlFlowSpecificationPanel(String id, TaskDetailsModel model, Cont
protected void initLayout() {
SingleContainerPanel activityDefinitionPanel = new SingleContainerPanel(ID_MAIN_PANEL,
PrismContainerWrapperModel.fromContainerWrapper(getObjectWrapperModel(), ItemPath.create(TaskType.F_ACTIVITY, ActivityDefinitionType.F_CONTROL_FLOW)),
ActivityControlFlowSpecificationType.COMPLEX_TYPE);
ActivityControlFlowDefinitionType.COMPLEX_TYPE);
add(activityDefinitionPanel);

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
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.xml.ns._public.common.common_3.ActivityDistributionDefinitionType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.ContainerPanelConfigurationType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.TaskType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.WorkDistributionType;

@PanelType(name = "distribution", defaultContainerPath = "activity/distribution", defaultType = WorkDistributionType.class)
@PanelType(name = "distribution", defaultContainerPath = "activity/distribution", defaultType = ActivityDistributionDefinitionType.class)
@PanelInstance(identifier = "distribution", applicableForType = TaskType.class, childOf = TaskActivityPanel.class,
display = @PanelDisplay(label = "ActivityDefinitionType.distribution", icon = GuiStyleConstants.CLASS_TASK_DISTRIBUTION_ICON, order = 30))
public class TaskDistributionPanel extends AbstractObjectMainPanel<TaskType, TaskDetailsModel> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,14 +220,14 @@ public static String getDisplayName(ProvenanceAcquisitionType acquisition) {
return "ProvenanceAcquisitionType.details";
}

public static String getDisplayName(TaskErrorHandlingStrategyEntryType taskErrorHandlingStrategy) {
public static String getDisplayName(ActivityErrorHandlingStrategyEntryType taskErrorHandlingStrategy) {
return "Strategy (order " + (taskErrorHandlingStrategy.getOrder() == null ? " not defined)" : Integer.toString(taskErrorHandlingStrategy.getOrder()) + ")");
}

//TODO improve
public static String getDisplayName(ActivityDefinitionType partitionDefinition) {
// Integer index = partitionDefinition.getIndex();
// WorkDistributionType workManagementType = partitionDefinition.getWorkManagement();
// ActivityDistributionDefinitionType workManagementType = partitionDefinition.getWorkManagement();
//
// String string = "";
// if (index != null) {
Expand All @@ -244,12 +244,4 @@ public static String getDisplayName(ActivityDefinitionType partitionDefinition)
// return string;
return "";
}

private static String appendKind(String string, TaskKindType taskKindType) {
if (string.isBlank()) {
return string += taskKindType;
}

return string += ", " + taskKindType;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

package com.evolveum.midpoint.web.component.data;

import java.time.Duration;
import java.util.List;

import com.evolveum.midpoint.web.component.util.VisibleBehaviour;
Expand All @@ -30,7 +31,6 @@
import com.evolveum.midpoint.gui.api.util.WebComponentUtil;
import com.evolveum.midpoint.prism.query.ObjectPaging;
import com.evolveum.midpoint.web.session.UserProfileStorage;
import org.apache.wicket.util.time.Duration;

/**
* @author Viliam Repan (lazyman)
Expand Down Expand Up @@ -113,7 +113,7 @@ protected Item<T> newRowItem(String id, int index, IModel<T> rowModel) {
table.setOutputMarkupId(true);
tableContainer.add(table);
box.add(tableContainer);
table.add(new AjaxSelfUpdatingTimerBehavior(Duration.seconds(computeRefreshInterval())) {
table.add(new AjaxSelfUpdatingTimerBehavior(Duration.ofSeconds(computeRefreshInterval())) {
@Override
protected boolean shouldTrigger() {
return isAutoRefreshEnabled();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,6 @@
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
<body>
<wicket:panel>

<div class="row">

<div class="col-md-12">
<h3><wicket:message key="PageInternals.title.thresholds.counters"/></h3>
<table class="table table-bordered">
<tbody>
<tr wicket:id="thresholdCountersTable">
<th wicket:id="counterTask"/>
<td wicket:id="counterPolicyRule"/>
<td wicket:id="counterCount"/>
<td>
<a class="btn btn-primary" wicket:id="resetThresholdCounter">
<wicket:message key="InternalsCountersPanel.threshold.reset.button"/>
</a>
</td>
</tr>
</tbody>
</table>
</div>
</div>

<div class="row">

<div class="col-md-6">
Expand Down

0 comments on commit 0010345

Please sign in to comment.