Skip to content

Commit

Permalink
Merge branch 'tmp/removing-legacy-tasks'
Browse files Browse the repository at this point in the history
  • Loading branch information
mederly committed Jul 5, 2023
2 parents 1dac156 + ae0dfae commit 94505e3
Show file tree
Hide file tree
Showing 265 changed files with 2,478 additions and 4,168 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
package com.evolveum.midpoint.gui.impl.factory.wrapper;

import java.util.Collection;
import java.util.List;
import java.util.stream.Collectors;

import com.evolveum.midpoint.model.common.archetypes.ArchetypeManager;
Expand Down Expand Up @@ -53,15 +54,18 @@ protected LookupTableType getPredefinedValues(PrismProperty<String> item, Wrappe

Collection<String> handlers;
if (assignmentTypes.isEmpty()) {
handlers = getTaskManager().getAllHandlerUris(true);
//handlers = getTaskManager().getAllHandlerUris(true);
handlers = List.of(); // FIXME the handlers are gone now
} else if (assignmentTypes.size() == 1) {
AssignmentType archetypeAssignment = assignmentTypes.iterator().next();
handlers = getTaskManager().getHandlerUrisForArchetype(archetypeAssignment.getTargetRef().getOid(), true);
// handlers = getTaskManager().getHandlerUrisForArchetype(archetypeAssignment.getTargetRef().getOid(), true);
handlers = List.of(); // FIXME the handlers are gone now
} else {
try {
ArchetypeType archetype = archetypeManager.determineStructuralArchetype(task, ctx.getResult());
// TODO what if there's no archetype?
handlers = getTaskManager().getHandlerUrisForArchetype(archetype.getOid(), true);
//handlers = getTaskManager().getHandlerUrisForArchetype(archetype.getOid(), true);
handlers = List.of(); // FIXME the handlers are gone now
} catch (SchemaException e) {
throw new UnsupportedOperationException("More than 1 structural archetype, this is not supported", e);
}
Expand Down
20 changes: 0 additions & 20 deletions gui/admin-gui/src/test/resources/common/role-enduser.xml
Original file line number Diff line number Diff line change
Expand Up @@ -219,25 +219,5 @@
</owner>
</object>
</authorization>
<authorization>
<name>self-owned-task-add-execute-changes</name>
<description>
Authorization to create a new 'execute changes' task owned by a currently logged-in user.
This is needed to execute asynchronous operations from the GUI.
</description>
<action>http://midpoint.evolveum.com/xml/ns/public/security/authorization-model-3#add</action>
<object>
<type>TaskType</type>
<filter>
<q:equal>
<q:path>handlerUri</q:path>
<q:value>http://midpoint.evolveum.com/xml/ns/public/model/synchronization/task/execute/handler-3</q:value>
</q:equal>
</filter>
<owner>
<special>self</special>
</owner>
</object>
</authorization>
<subtype>system</subtype>
</role>
60 changes: 31 additions & 29 deletions infra/common/src/test/resources/crypto/task-add-account.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,39 +13,41 @@
xmlns:icfs="http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/resource-schema-3"
xmlns:t="http://prism.evolveum.com/xml/ns/public/types-3" oid="a66d6763-eced-47b7-b57d-7bf6be27dcdb" version="5">
<name>Execute changes</name>
<extension xmlns:mext="http://midpoint.evolveum.com/xml/ns/public/model/extension-3">
<mext:objectDeltas>
<t:changeType>modify</t:changeType>
<t:objectType>c:UserType</t:objectType>
<t:oid>07cc8c14-f94a-4da9-86ab-0246fc63bb6b</t:oid>
<t:itemDelta>
<t:modificationType>add</t:modificationType>
<t:path xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3">c:linkRef</t:path>
<t:value xmlns="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" type="c:ShadowType" xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3" xsi:type="c:ObjectReferenceType">
<object>
<c:resourceRef oid="ef2bc95b-76e0-48e2-86d6-3d4f02d3fafe" type="c:ResourceType"/>
<c:objectClass>ri:AccountObjectClass</c:objectClass>
<c:kind>account</c:kind>
<c:intent>default</c:intent>
<c:attributes>
<icfs:password xsi:type="t:ProtectedStringType">pass1234word</icfs:password>
</c:attributes>
</object>
</t:value>
</t:itemDelta>
</mext:objectDeltas>
<mext:executeOptions>
<force>false</force>
<reconcile>false</reconcile>
<executeImmediatelyAfterApproval>false</executeImmediatelyAfterApproval>
</mext:executeOptions>
</extension>
<taskIdentifier>1585065525794-0-1</taskIdentifier>
<ownerRef oid="00000000-0000-0000-0000-000000000002" relation="org:default" type="c:UserType">
<!-- administrator -->
</ownerRef>
<channel>http://midpoint.evolveum.com/xml/ns/public/common/channels-3#user</channel>
<executionState>closed</executionState>
<handlerUri>http://midpoint.evolveum.com/xml/ns/public/model/execute-deltas/handler-3</handlerUri>
<binding>tight</binding>
<activity>
<work>
<explicitChangeExecution>
<delta>
<t:changeType>modify</t:changeType>
<t:objectType>c:UserType</t:objectType>
<t:oid>07cc8c14-f94a-4da9-86ab-0246fc63bb6b</t:oid>
<t:itemDelta>
<t:modificationType>add</t:modificationType>
<t:path xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3">c:linkRef</t:path>
<t:value xmlns="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" type="c:ShadowType" xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3" xsi:type="c:ObjectReferenceType">
<object>
<c:resourceRef oid="ef2bc95b-76e0-48e2-86d6-3d4f02d3fafe" type="c:ResourceType"/>
<c:objectClass>ri:AccountObjectClass</c:objectClass>
<c:kind>account</c:kind>
<c:intent>default</c:intent>
<c:attributes>
<icfs:password xsi:type="t:ProtectedStringType">pass1234word</icfs:password>
</c:attributes>
</object>
</t:value>
</t:itemDelta>
</delta>
<executionOptions>
<force>false</force>
<reconcile>false</reconcile>
<executeImmediatelyAfterApproval>false</executeImmediatelyAfterApproval>
</executionOptions>
</explicitChangeExecution>
</work>
</activity>
</task>
Original file line number Diff line number Diff line change
@@ -1,53 +1,58 @@
<!--
~ Copyright (c) 2010-2019 Evolveum and contributors
~ Copyright (C) 2010-2023 Evolveum and contributors
~
~ This work is dual-licensed under the Apache License 2.0
~ and European Union Public License. See LICENSE file for details.
-->

<task xmlns="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
xmlns:org="http://midpoint.evolveum.com/xml/ns/public/common/org-3"
xmlns:q="http://prism.evolveum.com/xml/ns/public/query-3"
xmlns:t="http://prism.evolveum.com/xml/ns/public/types-3" oid="9de76345-0f02-48de-86bf-e7a887cb374a">
xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
xmlns:org="http://midpoint.evolveum.com/xml/ns/public/common/org-3"
xmlns:q="http://prism.evolveum.com/xml/ns/public/query-3"
xmlns:t="http://prism.evolveum.com/xml/ns/public/types-3"
xmlns:s="http://midpoint.evolveum.com/xml/ns/public/model/scripting-3"
oid="9de76345-0f02-48de-86bf-e7a887cb374a">
<name>Task 1555581798624-0-1</name>
<extension xmlns:se="http://midpoint.evolveum.com/xml/ns/public/model/scripting/extension-3">
<se:executeScript xmlns:s="http://midpoint.evolveum.com/xml/ns/public/model/scripting-3">
<s:pipeline list="true">
<s:search>
<s:type>c:UserType</s:type>
<s:searchFilter>
<q:equal>
<q:path>c:name</q:path>
<q:value>jack</q:value>
</q:equal>
</s:searchFilter>
</s:search>
<s:action>
<s:type>modify</s:type>
<s:parameter>
<s:name>delta</s:name>
<value xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="t:ObjectDeltaType">
<t:changeType>modify</t:changeType>
<t:objectType>UserType</t:objectType>
<t:itemDelta>
<t:modificationType>replace</t:modificationType>
<t:path>credentials/password/value</t:path>
<t:value xsi:type="t:ProtectedStringType">
<t:clearValue>pass1234word</t:clearValue>
</t:value>
</t:itemDelta>
</value>
</s:parameter>
</s:action>
</s:pipeline>
</se:executeScript>
</extension>
<taskIdentifier>1555581798624-0-1</taskIdentifier>
<ownerRef oid="00000000-0000-0000-0000-000000000002" relation="org:default" type="c:UserType">
<!-- administrator -->
</ownerRef>
<executionState>runnable</executionState>
<handlerUri>http://midpoint.evolveum.com/xml/ns/public/model/scripting/handler-3</handlerUri>
<binding>tight</binding>
<activity>
<work>
<nonIterativeScripting>
<scriptExecutionRequest>
<s:pipeline list="true">
<s:search>
<s:type>c:UserType</s:type>
<s:searchFilter>
<q:equal>
<q:path>c:name</q:path>
<q:value>jack</q:value>
</q:equal>
</s:searchFilter>
</s:search>
<s:action>
<s:type>modify</s:type>
<s:parameter>
<s:name>delta</s:name>
<value xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="t:ObjectDeltaType">
<t:changeType>modify</t:changeType>
<t:objectType>UserType</t:objectType>
<t:itemDelta>
<t:modificationType>replace</t:modificationType>
<t:path>credentials/password/value</t:path>
<t:value xsi:type="t:ProtectedStringType">
<t:clearValue>pass1234word</t:clearValue>
</t:value>
</t:itemDelta>
</value>
</s:parameter>
</s:action>
</s:pipeline>
</scriptExecutionRequest>
</nonIterativeScripting>
</work>
</activity>
</task>
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import com.evolveum.midpoint.util.annotation.Experimental;
import com.evolveum.midpoint.xml.ns._public.common.common_3.*;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.VisibleForTesting;

import static com.evolveum.midpoint.util.QNameUtil.qNameToUri;

Expand Down Expand Up @@ -362,7 +363,9 @@ public abstract class SchemaConstants {
public static final ItemName LEGACY_NOT_UPDATED_DURATION_PROPERTY_NAME =
new ItemName(NS_MODEL_EXTENSION, "notUpdatedShadowsDuration");

@VisibleForTesting // should be ignored by production code since 4.8
public static final ItemName MODEL_EXTENSION_DRY_RUN = new ItemName(NS_MODEL_EXTENSION, "dryRun");
@VisibleForTesting // should be ignored by production code since 4.8
public static final ItemPath PATH_MODEL_EXTENSION_DRY_RUN = ItemPath.create(TaskType.F_EXTENSION, SchemaConstants.MODEL_EXTENSION_DRY_RUN);

// Temporary
Expand Down

This file was deleted.

0 comments on commit 94505e3

Please sign in to comment.