Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into upgrade-dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
skublik committed Jun 25, 2021
2 parents 9e23d16 + c063bdb commit 075b702
Show file tree
Hide file tree
Showing 634 changed files with 53,727 additions and 38,181 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
import javax.xml.datatype.XMLGregorianCalendar;
import javax.xml.namespace.QName;

import com.evolveum.midpoint.schema.util.task.*;

import com.evolveum.midpoint.web.component.util.SelectableBean;

import org.apache.commons.collections4.CollectionUtils;
Expand Down Expand Up @@ -113,9 +115,6 @@
import com.evolveum.midpoint.schema.result.OperationResult;
import com.evolveum.midpoint.schema.result.OperationResultStatus;
import com.evolveum.midpoint.schema.util.*;
import com.evolveum.midpoint.schema.util.task.TaskPartProgressInformation;
import com.evolveum.midpoint.schema.util.task.TaskProgressInformation;
import com.evolveum.midpoint.schema.util.task.TaskWorkStateUtil;
import com.evolveum.midpoint.security.api.AuthorizationConstants;
import com.evolveum.midpoint.security.api.MidPointPrincipal;
import com.evolveum.midpoint.task.api.Task;
Expand Down Expand Up @@ -3787,14 +3786,14 @@ public static <O extends ObjectType> CompositedIcon createCompositeIconForObject
appendActivationStatus(title, activationStatusIcon, obj, pageBase);
}

if (obj instanceof TaskType && TaskWorkStateUtil.isCoordinator((TaskType) obj)) {
if (obj instanceof TaskType && BucketingUtil.isCoordinator((TaskType) obj)) {
IconType icon = new IconType();
icon.setCssClass(GuiStyleConstants.CLASS_OBJECT_NODE_ICON_COLORED);
builder.appendLayerIcon(icon, IconCssStyle.BOTTOM_RIGHT_FOR_COLUMN_STYLE);
if (title.length() > 0) {
title.append("\n");
}
title.append(pageBase.createStringResource(TaskWorkStateUtil.getKind((TaskType) obj)).getString());
title.append(pageBase.createStringResource(BucketingUtil.getKind((TaskType) obj)).getString());
}

if (StringUtils.isNotEmpty(title.toString())) {
Expand Down Expand Up @@ -5047,22 +5046,19 @@ public static Long getTimestampAsLong(XMLGregorianCalendar cal, boolean currentI
}

public static String getTaskProgressInformation(TaskType taskType, boolean longForm, PageBase pageBase) {
TaskProgressInformation progress = TaskProgressInformation.fromTaskTree(taskType);
TaskPartProgressInformation partProgress = progress.getCurrentPartInformation();
if (partProgress == null) {
return null;
}
String partProgressHumanReadable = partProgress.toHumanReadableString(longForm);
ActivityProgressInformation progress = ActivityProgressInformation.fromRootTask(taskType, TaskResolver.empty());
String partProgressHumanReadable = progress.toHumanReadableString(longForm);

if (longForm) {
partProgressHumanReadable = StringUtils.replaceOnce(partProgressHumanReadable, "of", pageBase.getString("TaskSummaryPanel.progress.of"));
partProgressHumanReadable = StringUtils.replaceOnce(partProgressHumanReadable, "buckets", pageBase.getString("TaskSummaryPanel.progress.buckets"));
}

if (progress.getAllPartsCount() > 1) {
String rv = pageBase.getString("TaskSummaryPanel.progress.info." + (longForm ? "long" : "short"), partProgressHumanReadable, progress.getCurrentPartNumber(), progress.getAllPartsCount());
return rv;
}
// TODO
// if (progress.getAllPartsCount() > 1) {
// String rv = pageBase.getString("TaskSummaryPanel.progress.info." + (longForm ? "long" : "short"), partProgressHumanReadable, progress.getCurrentPartNumber(), progress.getAllPartsCount());
// return rv;
// }

return partProgressHumanReadable;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import com.evolveum.midpoint.util.exception.SchemaException;
import com.evolveum.midpoint.web.component.prism.ValueStatus;
import com.evolveum.midpoint.xml.ns._public.common.common_3.AbstractPolicyConstraintType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.TaskPartitionsDefinitionType;

/**
* @author katka
Expand Down Expand Up @@ -62,9 +61,10 @@ public boolean match(ItemDefinition<?> def) {
return true;
}

if (TaskPartitionsDefinitionType.COMPLEX_TYPE.equals(defName)) {
return true;
}
// TODO
// if (TaskPartsDefinitionType.COMPLEX_TYPE.equals(defName)) {
// return true;
// }

if (!(def instanceof PrismContainerDefinition)) {
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,22 +219,24 @@ public static String getDisplayName(TaskErrorHandlingStrategyEntryType taskError
}

//TODO improve
public static String getDisplayName(TaskPartitionDefinitionType partitionDefinition) {
Integer index = partitionDefinition.getIndex();
TaskWorkManagementType workManagementType = partitionDefinition.getWorkManagement();

String string = "";
if (index != null) {
string += "Partition " + index;
}

if (workManagementType != null) {
TaskKindType taskKindType = workManagementType.getTaskKind();
if (taskKindType != null) {
string = appendKind(string, taskKindType);
}
}
return string;
public static String getDisplayName(ActivityDefinitionType partitionDefinition) {
// Integer index = partitionDefinition.getIndex();
// WorkDistributionType workManagementType = partitionDefinition.getWorkManagement();
//
// String string = "";
// if (index != null) {
// string += "Partition " + index;
// }
//
// // FIXME
// if (workManagementType != null) {
// TaskKindType taskKindType = workManagementType.getTaskKind();
// if (taskKindType != null) {
// string = appendKind(string, taskKindType);
// }
// }
// return string;
return "";
}

private static String appendKind(String string, TaskKindType taskKindType) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,6 @@ private ItemVisibility getBasicTabVisibility(ItemPath path) {
return ItemVisibility.HIDDEN;
}

if (TaskType.F_OTHER_HANDLERS_URI_STACK.equivalent(path)) {
return ItemVisibility.HIDDEN;
}

//end region unsupported panel for type

String taskHandler = getTask().getHandlerUri();
Expand Down Expand Up @@ -289,7 +285,7 @@ private boolean getBasicTabEditability(ItemPath path) {

List<ItemPath> pathsToHide = Arrays.asList(TaskType.F_EXECUTION_STATUS, TaskType.F_NODE, TaskType.F_NODE_AS_OBSERVED, TaskType.F_RESULT_STATUS,
TaskType.F_RESULT, TaskType.F_NEXT_RUN_START_TIMESTAMP, TaskType.F_NEXT_RETRY_TIMESTAMP, TaskType.F_UNPAUSE_ACTION, TaskType.F_TASK_IDENTIFIER,
TaskType.F_PARENT, TaskType.F_WAITING_REASON, TaskType.F_STATE_BEFORE_SUSPEND, TaskType.F_CATEGORY, TaskType.F_OTHER_HANDLERS_URI_STACK,
TaskType.F_PARENT, TaskType.F_WAITING_REASON, TaskType.F_STATE_BEFORE_SUSPEND, TaskType.F_CATEGORY,
TaskType.F_CHANNEL, TaskType.F_DEPENDENT_TASK_REF, TaskType.F_LAST_RUN_START_TIMESTAMP, TaskType.F_LAST_RUN_FINISH_TIMESTAMP, TaskType.F_COMPLETION_TIMESTAMP
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
import com.evolveum.midpoint.schema.statistics.*;
import com.evolveum.midpoint.web.component.AceEditor;
import com.evolveum.midpoint.xml.ns._public.common.common_3.OperationStatsType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.WorkBucketManagementPerformanceInformationType;

import org.apache.wicket.model.Model;

Expand Down Expand Up @@ -138,12 +137,12 @@ private String getStatistics() {
options, iterations, seconds))
.append("\n");
}
WorkBucketManagementPerformanceInformationType buckets = statistics.getWorkBucketManagementPerformanceInformation();
if (buckets != null && !buckets.getOperation().isEmpty()) {
sb.append("Work buckets management performance information\n\n")
.append(TaskWorkBucketManagementPerformanceInformationUtil.format(buckets, options, iterations, seconds))
.append("\n");
}
// BucketManagementStatisticsType buckets = statistics.getWorkBucketManagementPerformanceInformation();
// if (buckets != null && !buckets.getOperation().isEmpty()) {
// sb.append("Work buckets management performance information\n\n")
// .append(ActivityBucketManagementStatisticsUtil.format(buckets, options, iterations, seconds))
// .append("\n");
// }
if (statistics.getCachesPerformanceInformation() != null) {
sb.append("Cache performance information\n\n")
.append(CachePerformanceInformationUtil.format(statistics.getCachesPerformanceInformation(), options))
Expand All @@ -157,16 +156,16 @@ private String getStatistics() {
}
sb.append("\n-------------------------------------------------------------------------------------------------------------------------------------------------------------------\n");
sb.append("Other performance-related information that is shown elsewhere (provided here just for completeness):\n\n");
if (statistics.getIterativeTaskInformation() != null) {
sb.append("Iterative task information\n\n")
.append(IterativeTaskInformation.format(statistics.getIterativeTaskInformation(), options))
.append("\n");
}
if (statistics.getActionsExecutedInformation() != null) {
sb.append("Actions executed:\n")
.append(ActionsExecutedInformation.format(statistics.getActionsExecutedInformation()))
.append("\n");
}
// if (statistics.getIterativeTaskInformation() != null) {
// sb.append("Iterative task information\n\n")
// .append(IterationInformation.format(statistics.getIterativeTaskInformation(), options))
// .append("\n");
// }
// if (statistics.getActionsExecutedInformation() != null) {
// sb.append("Actions executed:\n")
// .append(ActionsExecutedInformationUtil.format(statistics.getActionsExecutedInformation()))
// .append("\n");
// }
if (statistics.getEnvironmentalPerformanceInformation() != null) {
sb.append("Environmental performance information:\n")
.append(EnvironmentalPerformanceInformation.format(statistics.getEnvironmentalPerformanceInformation()))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

import com.evolveum.midpoint.gui.api.prism.wrapper.ItemWrapper;
import com.evolveum.midpoint.gui.api.util.WebModelServiceUtils;
import com.evolveum.midpoint.schema.util.ObjectTypeUtil;
import com.evolveum.midpoint.xml.ns._public.common.common_3.*;

import org.apache.wicket.ajax.AjaxRequestTarget;
Expand Down Expand Up @@ -142,25 +141,27 @@ public boolean isVisible() {
return super.isVisible() && parentPage.getTaskTabVisibilty().isWorkManagementVisible(getTask());
}
};
tabs.add(new PanelTab(parentPage.createStringResource("pageTask.workManagement.title"), workManagementTabVisibility) {
private static final long serialVersionUID = 1L;

@Override
public WebMarkupContainer createPanel(String panelId) {
return new SingleContainerPanel<TaskWorkManagementType>(panelId, PrismContainerWrapperModel.fromContainerWrapper(getObjectModel(), TaskType.F_WORK_MANAGEMENT), TaskWorkManagementType.COMPLEX_TYPE) {

@Override
protected ItemVisibility getVisibility(ItemWrapper itemWrapper) {
return getWorkManagementVisibility(itemWrapper.getPath());
}

@Override
protected ItemEditabilityHandler getEditabilityHandler() {
return getTaskEditabilityHandler();
}
};
}
});
// tabs.add(new PanelTab(parentPage.createStringResource("pageTask.workManagement.title"), workManagementTabVisibility) {
// private static final long serialVersionUID = 1L;
//
// @Override
// public WebMarkupContainer createPanel(String panelId) {
// // TODO FIX THIS after task schema change
// return new SingleContainerPanel<WorkDistributionType>(panelId,
// PrismContainerWrapperModel.fromContainerWrapper(getObjectModel(), TaskType.F_PARTS), WorkDistributionType.COMPLEX_TYPE) {
//
// @Override
// protected ItemVisibility getVisibility(ItemWrapper itemWrapper) {
// return getWorkManagementVisibility(itemWrapper.getPath());
// }
//
// @Override
// protected ItemEditabilityHandler getEditabilityHandler() {
// return getTaskEditabilityHandler();
// }
// };
// }
// });
}

private void createExecutionConstraintsTab(List<ITab> tabs, PageTask parentPage) {
Expand Down Expand Up @@ -378,21 +379,22 @@ private ItemVisibility getWorkManagementVisibility(ItemPath path) {
return ItemVisibility.AUTO;
}

if (ItemPath.create(TaskType.F_WORK_MANAGEMENT, TaskWorkManagementType.F_WORKERS).equivalent(path)) {
if (handler.endsWith("task/workers-creation/handler-3")) {
return ItemVisibility.AUTO;
} else {
return ItemVisibility.HIDDEN;
}
}

if (ItemPath.create(TaskType.F_WORK_MANAGEMENT, TaskWorkManagementType.F_PARTITIONS).equivalent(path)) {
if (handler.endsWith("task/lightweight-partitioning/handler-3") || handler.endsWith("model/partitioned-focus-validity-scanner/handler-3")
|| handler.endsWith("model/synchronization/task/partitioned-reconciliation/handler-3") || handler.endsWith("task/generic-partitioning/handler-3")) {
return ItemVisibility.AUTO;
}
return ItemVisibility.HIDDEN;
}
// FIXME ALL OF THIS
// if (ItemPath.create(TaskType.F_WORK_MANAGEMENT, TaskWorkManagementType.F_WORKERS).equivalent(path)) {
// if (handler.endsWith("task/workers-creation/handler-3")) {
// return ItemVisibility.AUTO;
// } else {
// return ItemVisibility.HIDDEN;
// }
// }
//
// if (ItemPath.create(TaskType.F_WORK_MANAGEMENT, TaskWorkManagementType.F_PARTITIONS).equivalent(path)) {
// if (handler.endsWith("task/lightweight-partitioning/handler-3") || handler.endsWith("model/partitioned-focus-validity-scanner/handler-3")
// || handler.endsWith("model/synchronization/task/partitioned-reconciliation/handler-3") || handler.endsWith("task/generic-partitioning/handler-3")) {
// return ItemVisibility.AUTO;
// }
// return ItemVisibility.HIDDEN;
// }

return ItemVisibility.AUTO;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ private void addSynchronizationTransitionPanel() {
}

private void addActionsTablePanel() {
ListDataProvider<ObjectActionsExecutedEntryType> objectActionsEntry = createActionsEntryProvider(ActionsExecutedInformationType.F_OBJECT_ACTIONS_ENTRY);
ListDataProvider<ObjectActionsExecutedEntryType> objectActionsEntry = createActionsEntryProvider(ActivityActionsExecutedType.F_OBJECT_ACTIONS_ENTRY);
BoxedTablePanel<ObjectActionsExecutedEntryType> actionTable = new BoxedTablePanel<>(ID_ACTION_ENTRY, objectActionsEntry, createActionEntryColumns()) {
@Override
protected boolean hideFooterIfSinglePage() {
Expand All @@ -138,14 +138,14 @@ protected WebMarkupContainer createHeader(String headerId) {
}

private boolean hasObjectActionsEntry() {
ActionsExecutedInformationType actionsExecutedInformationType = getActionExecutedInformationType();
if (actionsExecutedInformationType == null) {
ActivityActionsExecutedType activityActionsExecutedType = getActionExecutedInformationType();
if (activityActionsExecutedType == null) {
return false;
}
return CollectionUtils.isNotEmpty(actionsExecutedInformationType.getObjectActionsEntry());
return CollectionUtils.isNotEmpty(activityActionsExecutedType.getObjectActionsEntry());
}

private ActionsExecutedInformationType getActionExecutedInformationType() {
private ActivityActionsExecutedType getActionExecutedInformationType() {
if (statisticsModel == null) {
return null;
}
Expand All @@ -155,13 +155,13 @@ private ActionsExecutedInformationType getActionExecutedInformationType() {
return null;
}

ActionsExecutedInformationType actionsExecutedInformationType = stats.getActionsExecutedInformation();
return actionsExecutedInformationType;
ActivityActionsExecutedType activityActionsExecutedType = stats.getActionsExecutedInformation();
return activityActionsExecutedType;
}

private void addResultingEntryPanel() {
BoxedTablePanel<ObjectActionsExecutedEntryType> resultingEntry =
new BoxedTablePanel<>(ID_RESULTING_ENTRY, createActionsEntryProvider(ActionsExecutedInformationType.F_RESULTING_OBJECT_ACTIONS_ENTRY), createActionEntryColumns()) {
new BoxedTablePanel<>(ID_RESULTING_ENTRY, createActionsEntryProvider(ActivityActionsExecutedType.F_RESULTING_OBJECT_ACTIONS_ENTRY), createActionEntryColumns()) {
@Override
protected boolean hideFooterIfSinglePage() {
return true;
Expand All @@ -179,15 +179,15 @@ protected WebMarkupContainer createHeader(String headerId) {
}

private boolean hasResultingEntry() {
ActionsExecutedInformationType actionsExecutedInformationType = getActionExecutedInformationType();
if (actionsExecutedInformationType == null) {
ActivityActionsExecutedType activityActionsExecutedType = getActionExecutedInformationType();
if (activityActionsExecutedType == null) {
return false;
}
return CollectionUtils.isNotEmpty(actionsExecutedInformationType.getResultingObjectActionsEntry());
return CollectionUtils.isNotEmpty(activityActionsExecutedType.getResultingObjectActionsEntry());
}

private String getSynchronizationTransitionExpression() {
return OperationStatsType.F_SYNCHRONIZATION_INFORMATION.getLocalPart() + "." + SynchronizationInformationType.F_TRANSITION.getLocalPart();
return OperationStatsType.F_SYNCHRONIZATION_INFORMATION.getLocalPart() + "." + ActivitySynchronizationStatisticsType.F_TRANSITION.getLocalPart();
}

private <T> EnumPropertyColumn<T> createEnumColumn() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,9 @@
import com.evolveum.midpoint.web.component.data.ISelectableDataProvider;
import com.evolveum.midpoint.web.component.data.column.EnumPropertyColumn;
import com.evolveum.midpoint.web.component.util.SelectableBean;
import com.evolveum.midpoint.web.component.util.SelectableBeanImpl;
import com.evolveum.midpoint.web.component.util.SelectableListDataProvider;
import com.evolveum.midpoint.web.session.UserProfileStorage;
import com.evolveum.midpoint.xml.ns._public.common.common_3.TaskType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.TaskWorkManagementType;

/**
* @author semancik
Expand Down Expand Up @@ -64,7 +62,8 @@ protected void onInitialize() {
}

private String createTaskKindExpression() {
return SelectableBeanImpl.F_VALUE + "." + TaskType.F_WORK_MANAGEMENT.getLocalPart() + "." + TaskWorkManagementType.F_TASK_KIND.getLocalPart();
return "none"; // FIXME
//return SelectableBeanImpl.F_VALUE + "." + TaskType.F_WORK_MANAGEMENT.getLocalPart() + "." + TaskWorkManagementType.F_TASK_KIND.getLocalPart();
}
private void initLayout() {
Label subtasksLabel = new Label(ID_SUBTASKS_LABEL, new ResourceModel("pageTaskEdit.subtasksLabel"));
Expand Down

0 comments on commit 075b702

Please sign in to comment.