From 7e50c3e70f4651f195e79cc309da6cf139ec79c6 Mon Sep 17 00:00:00 2001 From: Hiroyuki Wada Date: Tue, 25 Dec 2018 21:01:56 +0900 Subject: [PATCH 001/224] Fix usersView action URL --- .../evolveum/midpoint/security/api/AuthorizationConstants.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/repo/security-api/src/main/java/com/evolveum/midpoint/security/api/AuthorizationConstants.java b/repo/security-api/src/main/java/com/evolveum/midpoint/security/api/AuthorizationConstants.java index 83feb584924..6a341d6fd30 100644 --- a/repo/security-api/src/main/java/com/evolveum/midpoint/security/api/AuthorizationConstants.java +++ b/repo/security-api/src/main/java/com/evolveum/midpoint/security/api/AuthorizationConstants.java @@ -100,7 +100,7 @@ public class AuthorizationConstants { public static final String AUTZ_UI_USERS_URL = NS_AUTHORIZATION_UI + "#users"; public static final QName AUTZ_UI_USERS_VIEW_QNAME = new QName(NS_AUTHORIZATION_UI, "usersView"); - public static final String AUTZ_UI_USERS_VIEW_URL = NS_AUTHORIZATION_UI + "usersView"; + public static final String AUTZ_UI_USERS_VIEW_URL = NS_AUTHORIZATION_UI + "#usersView"; public static final QName AUTZ_UI_FIND_USERS_QNAME = new QName(NS_AUTHORIZATION_UI, "findUsers"); public static final String AUTZ_UI_FIND_USERS_URL = NS_AUTHORIZATION_UI + "#findUsers"; From 6ea19332957de4154d93915ad1ce178586ac3471 Mon Sep 17 00:00:00 2001 From: Pavol Mederly Date: Tue, 5 Feb 2019 19:57:17 +0100 Subject: [PATCH 002/224] Start writing TestGrouper story test --- .../midpoint/testing/story/TestGrouper.java | 89 +++++++++++ .../src/test/resources/grouper/org-top.xml | 25 +++ .../resources/grouper/resource-grouper.xml | 147 ++++++++++++++++++ 3 files changed, 261 insertions(+) create mode 100644 testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestGrouper.java create mode 100644 testing/story/src/test/resources/grouper/org-top.xml create mode 100644 testing/story/src/test/resources/grouper/resource-grouper.xml diff --git a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestGrouper.java b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestGrouper.java new file mode 100644 index 00000000000..c2970014e64 --- /dev/null +++ b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestGrouper.java @@ -0,0 +1,89 @@ +/* + * Copyright (c) 2010-2019 Evolveum + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.evolveum.midpoint.testing.story; + +import com.evolveum.icf.dummy.resource.DummyResource; +import com.evolveum.icf.dummy.resource.DummySyncStyle; +import com.evolveum.midpoint.prism.PrismObject; +import com.evolveum.midpoint.schema.result.OperationResult; +import com.evolveum.midpoint.task.api.Task; +import com.evolveum.midpoint.test.DummyResourceContoller; +import com.evolveum.midpoint.test.util.MidPointTestConstants; +import com.evolveum.midpoint.test.util.TestUtil; +import com.evolveum.midpoint.xml.ns._public.common.common_3.ResourceType; +import org.springframework.test.annotation.DirtiesContext; +import org.springframework.test.annotation.DirtiesContext.ClassMode; +import org.springframework.test.context.ContextConfiguration; +import org.testng.annotations.Test; + +import java.io.File; + +/** + * + */ +@ContextConfiguration(locations = {"classpath:ctx-story-test-main.xml"}) +@DirtiesContext(classMode = ClassMode.AFTER_CLASS) +public class TestGrouper extends AbstractStoryTest { + + public static final File TEST_DIR = new File(MidPointTestConstants.TEST_RESOURCES_DIR, "grouper"); + + protected static final File RESOURCE_GROUPER_FILE = new File(TEST_DIR, "resource-grouper.xml"); + protected static final String RESOURCE_GROUPER_ID = "Grouper"; + protected static final String RESOURCE_GROUPER_OID = "bbb9900a-b53d-4453-b60b-908725e3950e"; + + public static final File ORG_TOP_FILE = new File(TEST_DIR, "org-top.xml"); + public static final String ORG_TOP_OID = "8fe3acc3-c689-4f77-9512-3d06b5d00dc2"; + + protected static DummyResource dummyResourceGrouper; + protected static DummyResourceContoller dummyResourceCtlGrouper; + protected ResourceType resourceDummyGrouperType; + protected PrismObject resourceDummyGrouper; + + @Override + protected String getTopOrgOid() { + return ORG_TOP_OID; + } + + @Override + public void initSystem(Task initTask, OperationResult initResult) throws Exception { + super.initSystem(initTask, initResult); + + // Resources + dummyResourceCtlGrouper = DummyResourceContoller.create(RESOURCE_GROUPER_ID, resourceDummyGrouper); + dummyResourceGrouper = dummyResourceCtlGrouper.getDummyResource(); + resourceDummyGrouper = importAndGetObjectFromFile(ResourceType.class, RESOURCE_GROUPER_FILE, RESOURCE_GROUPER_OID, initTask, initResult); + resourceDummyGrouperType = resourceDummyGrouper.asObjectable(); + dummyResourceCtlGrouper.setResource(resourceDummyGrouper); + dummyResourceGrouper.setSyncStyle(DummySyncStyle.SMART); + + // Org + importObjectFromFile(ORG_TOP_FILE, initResult); + } + + @Test + public void test000Sanity() throws Exception { + final String TEST_NAME = "test000Sanity"; + TestUtil.displayTestTitle(this, TEST_NAME); + Task task = taskManager.createTaskInstance(TestGrouper.class.getName() + "." + TEST_NAME); + + OperationResult testResultGrouper = modelService.testResource(RESOURCE_GROUPER_OID, task); + TestUtil.assertSuccess(testResultGrouper); + + dumpOrgTree(); + } + +} diff --git a/testing/story/src/test/resources/grouper/org-top.xml b/testing/story/src/test/resources/grouper/org-top.xml new file mode 100644 index 00000000000..12c9764aa65 --- /dev/null +++ b/testing/story/src/test/resources/grouper/org-top.xml @@ -0,0 +1,25 @@ + + + + + TOP + Top + 0000 + functional + diff --git a/testing/story/src/test/resources/grouper/resource-grouper.xml b/testing/story/src/test/resources/grouper/resource-grouper.xml new file mode 100644 index 00000000000..b92e04ec61b --- /dev/null +++ b/testing/story/src/test/resources/grouper/resource-grouper.xml @@ -0,0 +1,147 @@ + + + + + + Grouper Resource + + + + + connectorType + com.evolveum.icf.dummy.connector.DummyConnector + + + connectorVersion + 2.0 + + + + + + + Grouper + + + + + + account + subject + ri:AccountObjectClass + true + + + entitlement + group + ri:CustomprivilegeObjectClass + true + + icfs:name + + + name + + + + + + + + true + account + subject + UserType + + + name + + + $account/attributes/name + + + + + + linked + true + + + deleted + + http://midpoint.evolveum.com/xml/ns/public/model/action-3#unlink + + + + unlinked + + http://midpoint.evolveum.com/xml/ns/public/model/action-3#link + + + + unmatched + + + + true + entitlement + group + OrgType + + + name + + + $account/attributes/name + + + + + + linked + true + + + deleted + + http://midpoint.evolveum.com/xml/ns/public/model/action-3#deleteFocus + + + + unlinked + + http://midpoint.evolveum.com/xml/ns/public/model/action-3#link + + + + unmatched + + http://midpoint.evolveum.com/xml/ns/public/model/action-3#addFocus + + + + + From f45344c90326ea05e5cb9b17a45f14a13b61b0ef Mon Sep 17 00:00:00 2001 From: skublik Date: Wed, 6 Feb 2019 14:22:40 +0100 Subject: [PATCH 003/224] fix position sub icons of multiLayerIcon --- .../gui/impl/component/AjaxCompositedIconButton.java | 10 ++++++++++ .../midpoint/web/component/MultifunctionalButton.java | 9 ++++----- .../src/main/resources/static/less/midpoint-theme.less | 4 ++++ 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/gui/impl/component/AjaxCompositedIconButton.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/gui/impl/component/AjaxCompositedIconButton.java index c5934ff64eb..012f96a3525 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/gui/impl/component/AjaxCompositedIconButton.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/gui/impl/component/AjaxCompositedIconButton.java @@ -46,7 +46,17 @@ public AjaxCompositedIconButton(String id, CompositedIcon icon, IModel t this.title = title; this.icon =icon; + + add(AttributeAppender.append("class", new IModel() { + + private static final long serialVersionUID = 1L; + @Override + public String getObject() { + return " position-relative "; + } + })); + add(AttributeAppender.append("class", new IModel() { private static final long serialVersionUID = 1L; diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/MultifunctionalButton.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/MultifunctionalButton.java index 4cb962631e5..f9e53388509 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/MultifunctionalButton.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/MultifunctionalButton.java @@ -86,8 +86,8 @@ public void onClick(AjaxRequestTarget target) { CompositedIconBuilder additionalButtonBuilder = new CompositedIconBuilder(); additionalButtonBuilder.setBasicIcon(WebComponentUtil.getIconCssClass(additionalButtonDisplayType), IconCssStyle.IN_ROW_STYLE) - .appendColorHtmlValue(WebComponentUtil.getIconColor(additionalButtonDisplayType)); -// .appendLayerIcon(GuiStyleConstants.CLASS_PLUS_CIRCLE, IconCssStyle.BOTTOM_RIGHT_STYLE, GuiStyleConstants.GREEN_COLOR); + .appendColorHtmlValue(WebComponentUtil.getIconColor(additionalButtonDisplayType)) + .appendLayerIcon(GuiStyleConstants.CLASS_PLUS_CIRCLE, IconCssStyle.BOTTOM_RIGHT_STYLE, GuiStyleConstants.GREEN_COLOR); AjaxCompositedIconButton additionalButton = new AjaxCompositedIconButton(buttonsPanel.newChildId(), additionalButtonBuilder.build(), Model.of(WebComponentUtil.getDisplayTypeTitle(additionalButtonDisplayType))) { @@ -106,9 +106,8 @@ public void onClick(AjaxRequestTarget target) { DisplayType defaultObjectButtonDisplayType = getDefaultObjectButtonDisplayType(); CompositedIconBuilder defaultObjectButtonBuilder = new CompositedIconBuilder(); defaultObjectButtonBuilder.setBasicIcon(WebComponentUtil.getIconCssClass(defaultObjectButtonDisplayType), IconCssStyle.IN_ROW_STYLE) - .appendColorHtmlValue(WebComponentUtil.getIconColor(defaultObjectButtonDisplayType)); - //TODO fix style for circle image -// .appendLayerIcon(GuiStyleConstants.CLASS_PLUS_CIRCLE, IconCssStyle.BOTTOM_RIGHT_STYLE, GuiStyleConstants.GREEN_COLOR); + .appendColorHtmlValue(WebComponentUtil.getIconColor(defaultObjectButtonDisplayType)) + .appendLayerIcon(GuiStyleConstants.CLASS_PLUS_CIRCLE, IconCssStyle.BOTTOM_RIGHT_STYLE, GuiStyleConstants.GREEN_COLOR); AjaxCompositedIconButton defaultButton = new AjaxCompositedIconButton(buttonsPanel.newChildId(), defaultObjectButtonBuilder.build(), diff --git a/gui/admin-gui/src/main/resources/static/less/midpoint-theme.less b/gui/admin-gui/src/main/resources/static/less/midpoint-theme.less index 413c5824f5c..05e2e5f32e3 100644 --- a/gui/admin-gui/src/main/resources/static/less/midpoint-theme.less +++ b/gui/admin-gui/src/main/resources/static/less/midpoint-theme.less @@ -1460,4 +1460,8 @@ th.countLabel{ .buttons-panel-marging{ margin: 10px; +} + +.position-relative{ + position: relative; } \ No newline at end of file From 15a45c446f6c75256b896f7d1c3b10a63dec75fc Mon Sep 17 00:00:00 2001 From: Pavol Mederly Date: Wed, 6 Feb 2019 14:17:07 +0100 Subject: [PATCH 004/224] Fix reindex operation w.r.t. attributes (MID-5128) Now we apply 'raw' option when fetching object before reindexing. This ensures that definitions are retrieved for such object, so reindexing will not fail (for shadows). --- .../midpoint/repo/sql/ModifyTestReindex.java | 78 ++++++++++++++++++- .../repo/sql/helpers/ObjectUpdater.java | 14 ++-- 2 files changed, 83 insertions(+), 9 deletions(-) diff --git a/repo/repo-sql-impl-test/src/test/java/com/evolveum/midpoint/repo/sql/ModifyTestReindex.java b/repo/repo-sql-impl-test/src/test/java/com/evolveum/midpoint/repo/sql/ModifyTestReindex.java index 4adad50d24b..0443b1c545b 100644 --- a/repo/repo-sql-impl-test/src/test/java/com/evolveum/midpoint/repo/sql/ModifyTestReindex.java +++ b/repo/repo-sql-impl-test/src/test/java/com/evolveum/midpoint/repo/sql/ModifyTestReindex.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2017 Evolveum + * Copyright (c) 2010-2019 Evolveum * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,17 +16,28 @@ package com.evolveum.midpoint.repo.sql; -import com.evolveum.midpoint.prism.*; +import com.evolveum.midpoint.prism.MutablePrismPropertyDefinition; +import com.evolveum.midpoint.prism.PrismObject; +import com.evolveum.midpoint.prism.PrismProperty; +import com.evolveum.midpoint.prism.PrismPropertyDefinition; import com.evolveum.midpoint.prism.path.ItemPath; import com.evolveum.midpoint.prism.query.ObjectQuery; import com.evolveum.midpoint.repo.api.RepoModifyOptions; import com.evolveum.midpoint.schema.result.OperationResult; import com.evolveum.midpoint.test.util.TestUtil; +import com.evolveum.midpoint.util.DOMUtil; +import com.evolveum.midpoint.xml.ns._public.common.common_3.MetadataType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowType; import com.evolveum.midpoint.xml.ns._public.common.common_3.UserType; +import org.hibernate.Session; +import org.hibernate.Transaction; +import org.hibernate.query.Query; import org.springframework.test.annotation.DirtiesContext; import org.springframework.test.context.ContextConfiguration; import org.testng.annotations.Test; +import javax.xml.namespace.QName; + import static java.util.Collections.emptySet; import static org.testng.AssertJUnit.assertEquals; @@ -75,4 +86,67 @@ public void testReindex() throws Exception { assertEquals("Wrong # of objects found", 1, count); } + /** + * MID-5128 + */ + @Test + public void testReindexShadow() throws Exception { + final String TEST_NAME = "testReindexShadow"; + TestUtil.displayTestTitle(TEST_NAME); + OperationResult result = new OperationResult(TEST_NAME); + + String APPROVER_OID = "9123090439201432"; + PrismObject shadow = prismContext.createObjectable(ShadowType.class) + .name("unstable") + .beginMetadata() + .modifyApproverRef(APPROVER_OID, UserType.COMPLEX_TYPE) + .end() + .asPrismObject(); + MutablePrismPropertyDefinition def = prismContext.definitionFactory().createPropertyDefinition(new QName("http://temp/", "attr1"), DOMUtil.XSD_STRING); + def.setIndexed(true); + PrismProperty attribute = def.instantiate(); + attribute.addRealValue("value"); + shadow.findOrCreateContainer(ShadowType.F_ATTRIBUTES).add(attribute); + + ObjectQuery query = prismContext.queryFor(ShadowType.class) + .item(ShadowType.F_METADATA, MetadataType.F_MODIFY_APPROVER_REF).ref(APPROVER_OID, UserType.COMPLEX_TYPE) + .build(); + + // add shadow and check metadata search + + String oid = repositoryService.addObject(shadow, null, result); + + int count = repositoryService.countObjects(ShadowType.class, query, null, result); + assertEquals("Wrong # of objects found (after creation)", 1, count); + + // break metadata in repo + + Session session = factory.openSession(); + + System.out.println("definitions: " + session.createQuery("from RExtItem").list()); + System.out.println("ext values: " + session.createQuery("from ROExtString").list()); + + Transaction transaction = session.beginTransaction(); + Query updateQuery = session.createQuery( + "update com.evolveum.midpoint.repo.sql.data.common.RObjectReference set type = null where ownerOid = '" + oid + + "'"); + System.out.println("records modified = " + updateQuery.executeUpdate()); + transaction.commit(); + session.close(); + + // verify search is broken + + count = repositoryService.countObjects(ShadowType.class, query, null, result); + assertEquals("Wrong # of objects found (after zeroing the type)", 0, count); + + // reindex + + repositoryService.modifyObject(ShadowType.class, oid, emptySet(), getModifyOptions(), result); + + // verify search is OK + + count = repositoryService.countObjects(ShadowType.class, query, null, result); + assertEquals("Wrong # of objects found (after reindexing)", 1, count); + } + } diff --git a/repo/repo-sql-impl/src/main/java/com/evolveum/midpoint/repo/sql/helpers/ObjectUpdater.java b/repo/repo-sql-impl/src/main/java/com/evolveum/midpoint/repo/sql/helpers/ObjectUpdater.java index f00f1950513..d7f97225e0d 100644 --- a/repo/repo-sql-impl/src/main/java/com/evolveum/midpoint/repo/sql/helpers/ObjectUpdater.java +++ b/repo/repo-sql-impl/src/main/java/com/evolveum/midpoint/repo/sql/helpers/ObjectUpdater.java @@ -384,18 +384,18 @@ public void modifyObjectAttempt(Class type, String oid // // So the first step is to retrieve the current value of photo - we obviously do this only if the modifications // deal with the jpegPhoto property. - Collection> options; + GetOperationOptionsBuilder optionsBuilder = schemaHelper.getOperationOptionsBuilder(); boolean containsFocusPhotoModification = FocusType.class.isAssignableFrom(type) && containsPhotoModification(modifications); if (containsFocusPhotoModification) { - options = schemaHelper.getOperationOptionsBuilder() - .item(FocusType.F_JPEG_PHOTO).retrieve() - .build(); - } else { - options = null; + optionsBuilder = optionsBuilder.item(FocusType.F_JPEG_PHOTO).retrieve(); + } + if (reindex) { + LOGGER.trace("Setting 'raw' option for object fetching because reindex is being applied"); + optionsBuilder = optionsBuilder.root().raw(); } // get object - PrismObject prismObject = objectRetriever.getObjectInternal(session, type, oid, options, true, result); + PrismObject prismObject = objectRetriever.getObjectInternal(session, type, oid, optionsBuilder.build(), true, result); if (precondition != null && !precondition.holds(prismObject)) { throw new PreconditionViolationException("Modification precondition does not hold for " + prismObject); } From 4cc83cc56a90153ea1d1b498937070faa30a79b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Ga=C5=A1par=C3=ADk?= Date: Wed, 6 Feb 2019 15:39:34 +0100 Subject: [PATCH 005/224] Translation update Thanks to all Transifex users, that particpated: drfbot (de), d.tautkute (lt), jcollado (es), merlicaf (it), petr.gasparik (cs), sa_nagata (ja), wstaszewski (pl) --- .../localization/Midpoint_cs.properties | 39 ++++++------ .../localization/Midpoint_de.properties | 27 ++++---- .../localization/Midpoint_en.properties | 3 +- .../localization/Midpoint_es.properties | 31 +++++----- .../localization/Midpoint_et.properties | 27 ++++---- .../localization/Midpoint_fi.properties | 27 ++++---- .../localization/Midpoint_fr.properties | 27 ++++---- .../localization/Midpoint_hu.properties | 27 ++++---- .../localization/Midpoint_it.properties | 29 ++++----- .../localization/Midpoint_ja.properties | 27 ++++---- .../localization/Midpoint_lt.properties | 27 ++++---- .../localization/Midpoint_pl.properties | 61 ++++++++++--------- .../localization/Midpoint_pt_BR.properties | 27 ++++---- .../localization/Midpoint_ru.properties | 27 ++++---- .../localization/Midpoint_sk.properties | 27 ++++---- .../localization/Midpoint_tr.properties | 27 ++++---- .../localization/Midpoint_zh_CN.properties | 27 ++++---- .../localization/schema_cs.properties | 6 +- .../localization/schema_it.properties | 10 +-- .../localization/schema_pl.properties | 10 +-- 20 files changed, 265 insertions(+), 248 deletions(-) diff --git a/gui/admin-gui/src/main/resources/localization/Midpoint_cs.properties b/gui/admin-gui/src/main/resources/localization/Midpoint_cs.properties index b7247231b9f..5da01018ef8 100644 --- a/gui/admin-gui/src/main/resources/localization/Midpoint_cs.properties +++ b/gui/admin-gui/src/main/resources/localization/Midpoint_cs.properties @@ -604,7 +604,7 @@ MyAssignmentsPanel.type.user=Uživatel MyAssignmentsPanel.type.policyRule=Pravidlo politiky NameStep.arrowToTurotialText=Každý krok wizardu má tlačítko nápovědy. Stiskem tohoto tlačítka získáte informace o nastavení konfiguračního kroku. NameStep.connectorBundle=Balíček -NameStep.connectorHost=Hostitel konektoru +NameStep.connectorHost=Konektorový server NameStep.connectorInformation=Informace NameStep.connectorName=Název konektoru NameStep.connectorNotSelected=Nebyl vybrán konektor. @@ -668,7 +668,7 @@ ObjectTypeGuiDescriptor.accessCertificationCampaign=Kampaň certifikace přístu ObjectTypeGuiDescriptor.accessCertificationDefinition=Definice certifikace přístupů ObjectTypeGuiDescriptor.account=Účet ObjectTypeGuiDescriptor.connector=Konektor -ObjectTypeGuiDescriptor.connectorHost=Hostitel konektoru +ObjectTypeGuiDescriptor.connectorHost=Konektorový server ObjectTypeGuiDescriptor.focus=Vzorový objekt ObjectTypeGuiDescriptor.form=Formulář ObjectTypeGuiDescriptor.genericObject=Generický objekt @@ -1118,28 +1118,28 @@ PageAdmin.menu.top.configuration.notifications=Notifikace PageAdmin.menu.top.configuration.profiling=Profiling PageAdmin.menu.top.configuration.adminGui=Administrátorské rozhraní PageAdmin.menu.top.configuration.repositoryObjects=Objekty v repozitáři -PageAdmin.menu.top.configuration.repositoryObjectsList=Seznam objektů +PageAdmin.menu.top.configuration.repositoryObjectsList=Všechny objekty PageAdmin.menu.top.configuration.security=Bezpečnost PageAdmin.menu.top.home=Domů PageAdmin.menu.top.reports.created=Vytvořené reporty -PageAdmin.menu.top.reports.list=Seznam reportů +PageAdmin.menu.top.reports.list=Všechny reporty PageAdmin.menu.top.reports.new=Importovat Jasper report PageAdmin.menu.top.reports=Reporty PageAdmin.menu.top.resources.import=Import definice aplikace -PageAdmin.menu.top.resources.list=Seznam aplikací +PageAdmin.menu.top.resources.list=Všechny aplikace PageAdmin.menu.top.resources.new=Nová aplikace PageAdmin.menu.top.resources.view=Zobrazit aplikaci PageAdmin.menu.top.resources.edit=Upravit aplikaci PageAdmin.menu.top.resources=Aplikace -PageAdmin.menu.top.connectorHosts.list=Seznam hostitelů konektorů -PageAdmin.menu.top.roles.list=Seznam rolí +PageAdmin.menu.top.connectorHosts.list=Všechny konektorové servery +PageAdmin.menu.top.roles.list=Všechny role PageAdmin.menu.top.roles.new=Nová role PageAdmin.menu.top.roles=Role -PageAdmin.menu.top.serverTasks.list=Seznam úloh +PageAdmin.menu.top.serverTasks.list=Všechny úlohy PageAdmin.menu.top.serverTasks.new=Nová úloha PageAdmin.menu.top.serverTasks=Serverové úlohy PageAdmin.menu.top.users.find=Najít uživatele -PageAdmin.menu.top.users.list=Seznam uživatelů +PageAdmin.menu.top.users.list=Všichni uživatelé PageAdmin.menu.top.users.new=Nový uživatel PageAdmin.menu.top.users.org.new=Nová organizace PageAdmin.menu.top.users.org=Org. struktura @@ -1242,7 +1242,7 @@ pageAdmin.resources.description=Připojené aplikace pageAdminResources.detailsResource=Podrobnosti aplikace pageAdminResources.editResource=Upravit aplikaci pageAdminResources.importResource=Importovat aplikaci -pageAdminResources.listResources=Seznam aplikací +pageAdminResources.listResources=Všechny aplikace pageAdminResources.message.cantLoadResource=Nepodařilo se načíst podrobnosti aplikace. pageAdminResources.newResource=Nová aplikace pageAdmin.resources=Aplikace @@ -1997,7 +1997,7 @@ pageResources.button.discoveryRemote=Prozkoumávat pageResources.button.editAsXml=Upravit jako XML pageResources.button.search=Hledat pageResources.connector.hostname=Název hostitele -pageResources.connectorHosts=Hostitelé konektorů +pageResources.connectorHosts=Konektorový server pageResources.connector.name=Název pageResources.connector.port=Port pageResources.connector.protectConnection=Chráněno @@ -2012,7 +2012,7 @@ pageResources.message.deleteHostsConfirm=Opravdu chcete smazat {0} vybraných ho pageResources.message.deleteResourceConfirm=Opravdu chcete smazat aplikaci '{0}'? pageResources.message.deleteResourcesConfirm=Opravdu chcete smazat {0} vybraných aplikací? pageResources.message.refreshResourceSchemaConfirm=Opravdu chceme znovunačíst schéma aplikace? -pageResources.message.noHostSelected=Nebyl vybrán žádný hostitel konektoru. +pageResources.message.noHostSelected=Nebyl vybrán žádný konektorový server. pageResources.message.noResourceSelected=Nebyla vybrána žádná aplikace. pageResources.message.queryError=Chyba při překladu vyhledávacího dotazu do filtru. PageResources.message.deleteResourceConfirmedPerformed.success=Došlo k úspěšnému odstranění aplikace, či aplikací. @@ -2075,7 +2075,7 @@ pageServices.message.confirmationMessageForSingleObject.members=Opravdu chcete { pageRoles.message.nothingSelected=Nebyla vybrána žádná role. pageRoles.message.queryError=Chyba při překladu vyhledávacího dotazu do filtru. pageRoles.requestable=Žadatelné -PageRoles.title=Seznam rolí +PageRoles.title=Všechny role pageSecurityQuestions.message.WrongAnswer=Otázky nebyly správně zodpovězeny pageSecurityQuestions.message.noPolicySet=Politika hesel není nastavena PageSecurityQuestions.title=Bezpečnostní otázky @@ -2350,7 +2350,7 @@ pageTasks.message.noTaskSelected=Nebyla vybrána žádná úloha. pageTasks.node.clustered=V hroznu pageTasks.node.executionStatus=Stav pageTasks.node.lastCheckInTime=Čas posledního odbavení -pageTasks.node.managementPort=Port správy +pageTasks.node.contact=Kontakt pageTasks.node.name=Název pageTasks.nodes=Uzly pageTasks.node.statusMessage=Stavová zpráva @@ -2496,7 +2496,7 @@ pageCases.table.openTimestamp=Otevřeno pageCases.table.closeTimestamp=Ukončený pageCases.button.delete=Smazat PageCasesAllocatedToMe.title=Mé případy -PageCasesAll.title=Seznam případů +PageCasesAll.title=Všechny případy MultipleAssignmentSelectorPanel.availableRoles=Dostupné role MultipleAssignmentSelectorPanel.parameters=Parametry MultipleAssignmentSelectorPanel.currentRoles=Přiřazené role @@ -2506,7 +2506,7 @@ MultipleAssignmentSelector.orgUnit=Org. jednotka AssignmentPopup.addButtonTitle=Prosím, vyberte aspoň jeden objekt. pageValuePolicies.table.description=Popis pageValuePolicies.button.delete=Smazat -PageValuePolicies.title=Seznam politik hodnot +PageValuePolicies.title=Všechny politiky hodnot PageValuePolicy.title = Politika hodnot PageValuePolicy.button.back=Zpět PageValuePolicy.button.save=Uložit @@ -3599,7 +3599,7 @@ autoRefreshPanel.pauseRefreshing=Pozastavit obnovování autoRefreshPanel.refreshingEach=Obnova každých {0} vteřin autoRefreshPanel.noRefreshing=(neobnovuje se) PageAdmin.menu.top.services=Služby -PageAdmin.menu.top.services.list=Seznam služeb +PageAdmin.menu.top.services.list=Všechny služby PageAdmin.menu.top.services.new=Nová služba PageAdmin.menu.top.services.edit=Upravit službu taskShowAdvancedFeaturesPanel.label=Zobrazit rozšířené rysy @@ -3835,10 +3835,10 @@ operation.com.evolveum.midpoint.web.page.admin.services.PageServices.reconcileOb operation.com.evolveum.midpoint.web.page.admin.services.PageServices.deleteObjects=Smazat služby (GUI) operation.com.evolveum.midpoint.web.page.admin.services.PageServices.deleteObject=Smazat službu (GUI) operation.com.evolveum.midpoint.web.page.admin.resources.ResourceContentTabPanel.importObject=Importovat objekt (GUI) -PageConnectorHosts.title=Hostitelé konektorů +PageConnectorHosts.title=Konektorové servery PageConnectorHosts.message.deleteHostConfirmedPerformed.success=Aplikace byla úspěšně odstraněna. PageConnectorHosts.message.deleteHostConfirmedPerformed.partialError=Nepodařilo se odstranit hostitele. -PageConnectorHosts.message.discoveryRemotePerformed.fatalError=Nepodařilo se prozkoumat konektor na hostiteli '{0}:{1}' +PageConnectorHosts.message.discoveryRemotePerformed.fatalError=Nepodařilo se dopátrat konektory na serveru '{0}:{1}' operation.com.evolveum.midpoint.web.page.admin.configuration.PageRepositoryQuery.checkQuery=Zkontrolovat dotaz (GUI) operation.com.evolveum.midpoint.web.page.admin.configuration.PageRepositoryQuery.translateQuery=Přeložit dotaz (GUI) operation.com.evolveum.midpoint.web.page.admin.configuration.PageRepositoryQuery.executeQuery=Provést dotaz (GUI) @@ -4220,6 +4220,7 @@ chooseFocusTypeAndRelationDialogPanel.relation=Vazba: chooseFocusTypeAndRelationDialogPanel.type=Typ chooseFocusTypeAndRelationDialogPanel.tooltip.type=Typ objektu, pro který přiřazení existuje abstractRoleMemberPanel.menu.assign=Přiřadit +abstractRoleMemberPanel.menu.assignMember=Přiřadit člena abstractRoleMemberPanel.menu.unassign=Odebrat přiřazení abstractRoleMemberPanel.menu.recompute=Přepočítat abstractRoleMemberPanel.menu.create=Vytvořit diff --git a/gui/admin-gui/src/main/resources/localization/Midpoint_de.properties b/gui/admin-gui/src/main/resources/localization/Midpoint_de.properties index 10cfeb6db8d..7bef7ead21b 100644 --- a/gui/admin-gui/src/main/resources/localization/Midpoint_de.properties +++ b/gui/admin-gui/src/main/resources/localization/Midpoint_de.properties @@ -1118,28 +1118,28 @@ PageAdmin.menu.top.configuration.notifications=Benachrichtigungen PageAdmin.menu.top.configuration.profiling=Profilierung PageAdmin.menu.top.configuration.adminGui=Administrationsoberfläche PageAdmin.menu.top.configuration.repositoryObjects=Verzeichnis-Objekte -PageAdmin.menu.top.configuration.repositoryObjectsList=Objekte auflisten +PageAdmin.menu.top.configuration.repositoryObjectsList=All objects PageAdmin.menu.top.configuration.security=Sicherheit PageAdmin.menu.top.home=Home PageAdmin.menu.top.reports.created=Erstellte Berichte -PageAdmin.menu.top.reports.list=Berichte auflisten +PageAdmin.menu.top.reports.list=All reports PageAdmin.menu.top.reports.new=Jasperreport importieren PageAdmin.menu.top.reports=Berichte PageAdmin.menu.top.resources.import=Ressourcen Definition importieren -PageAdmin.menu.top.resources.list=Ressourcen auflisten +PageAdmin.menu.top.resources.list=All resources PageAdmin.menu.top.resources.new=Neue Ressource PageAdmin.menu.top.resources.view=Ressource anzeigen PageAdmin.menu.top.resources.edit=Ressource ändern PageAdmin.menu.top.resources=Ressourcen -PageAdmin.menu.top.connectorHosts.list=Konnektor Systeme anzeigen -PageAdmin.menu.top.roles.list=Rollen auflisten +PageAdmin.menu.top.connectorHosts.list=All connector hosts +PageAdmin.menu.top.roles.list=Alle Rollen PageAdmin.menu.top.roles.new=Neue Rolle PageAdmin.menu.top.roles=Rollen -PageAdmin.menu.top.serverTasks.list=Aufgaben auflisten +PageAdmin.menu.top.serverTasks.list=All tasks PageAdmin.menu.top.serverTasks.new=Neue Aufgabe PageAdmin.menu.top.serverTasks=Serveraufgaben PageAdmin.menu.top.users.find=Benutzer suchen -PageAdmin.menu.top.users.list=Benutzer auflisten +PageAdmin.menu.top.users.list=Alle Benutzer PageAdmin.menu.top.users.new=neuer Benutzer PageAdmin.menu.top.users.org.new=Neue Organisation PageAdmin.menu.top.users.org=Organisationsstruktur @@ -1242,7 +1242,7 @@ pageAdmin.resources.description=Verbundene Systeme pageAdminResources.detailsResource=Ressourcen Details pageAdminResources.editResource=Ressource ändern pageAdminResources.importResource=Ressourcen importieren -pageAdminResources.listResources=Ressourcen auflisten +pageAdminResources.listResources=All resources pageAdminResources.message.cantLoadResource=Ressourcen Details konnten nicht geladen werden. pageAdminResources.newResource=Neue Ressource pageAdmin.resources=Ressourcen @@ -2075,7 +2075,7 @@ pageServices.message.confirmationMessageForSingleObject.members=Wollen Sie wirkl pageRoles.message.nothingSelected=Es wurde keine Rolle ausgewählt pageRoles.message.queryError=Fehler aufgetreten während der Übersetzung des Suchbegriffs zum Filter. pageRoles.requestable=Beantragbar -PageRoles.title=Rollen auflisten +PageRoles.title=Alle Rollen pageSecurityQuestions.message.WrongAnswer=Fragen nicht richtig beanwortet pageSecurityQuestions.message.noPolicySet=Keine Passwortrichtlinie definiert PageSecurityQuestions.title=Sicherheitsfragen @@ -2350,7 +2350,7 @@ pageTasks.message.noTaskSelected=Es wurde keine Aufgabe ausgewählt. pageTasks.node.clustered=Clustered pageTasks.node.executionStatus=Status pageTasks.node.lastCheckInTime=Letzte Anmeldezeit -pageTasks.node.managementPort=Management Port +pageTasks.node.contact=Contact pageTasks.node.name=Name pageTasks.nodes=Knoten pageTasks.node.statusMessage=Statusmeldung @@ -2496,7 +2496,7 @@ pageCases.table.openTimestamp=Opened pageCases.table.closeTimestamp=Abgeschlossen pageCases.button.delete=Löschen PageCasesAllocatedToMe.title=My Cases -PageCasesAll.title=List Cases +PageCasesAll.title=All Cases MultipleAssignmentSelectorPanel.availableRoles=Verfügbare Rollen MultipleAssignmentSelectorPanel.parameters=Parameter MultipleAssignmentSelectorPanel.currentRoles=Aktuelle Rollen @@ -2506,7 +2506,7 @@ MultipleAssignmentSelector.orgUnit=Organisationseinheit AssignmentPopup.addButtonTitle=Please, select at least 1 object pageValuePolicies.table.description=Beschreibung pageValuePolicies.button.delete=Löschen -PageValuePolicies.title=Liste der Wert-Richtlinien +PageValuePolicies.title=All value policies PageValuePolicy.title = Richtlinie für Eingabewerte PageValuePolicy.button.back=Zurück PageValuePolicy.button.save=Speichern @@ -3599,7 +3599,7 @@ autoRefreshPanel.pauseRefreshing=Aktualisierung pausieren autoRefreshPanel.refreshingEach=Neu laden alle {0} Sekunden autoRefreshPanel.noRefreshing=(nicht aktualisieren) PageAdmin.menu.top.services=Dienste -PageAdmin.menu.top.services.list=Dienste auflisten +PageAdmin.menu.top.services.list=All services PageAdmin.menu.top.services.new=Neuer Dienst PageAdmin.menu.top.services.edit=Dienst bearbeiten taskShowAdvancedFeaturesPanel.label=Erweiterte Eigenschaften anzeigen @@ -4220,6 +4220,7 @@ chooseFocusTypeAndRelationDialogPanel.relation=Relation: chooseFocusTypeAndRelationDialogPanel.type=Typ chooseFocusTypeAndRelationDialogPanel.tooltip.type=Type of the object to which the assignment exits abstractRoleMemberPanel.menu.assign=Ressource zuweisen +abstractRoleMemberPanel.menu.assignMember=Assign member abstractRoleMemberPanel.menu.unassign=Entziehen abstractRoleMemberPanel.menu.recompute=Neu berechnen abstractRoleMemberPanel.menu.create=Erstellen diff --git a/gui/admin-gui/src/main/resources/localization/Midpoint_en.properties b/gui/admin-gui/src/main/resources/localization/Midpoint_en.properties index 1661476f695..f4b31c627a5 100644 --- a/gui/admin-gui/src/main/resources/localization/Midpoint_en.properties +++ b/gui/admin-gui/src/main/resources/localization/Midpoint_en.properties @@ -2350,7 +2350,7 @@ pageTasks.message.noTaskSelected=No task has been selected. pageTasks.node.clustered=Clustered pageTasks.node.executionStatus=Status pageTasks.node.lastCheckInTime=Last check-in time -pageTasks.node.managementPort=Management port +pageTasks.node.contact=Contact pageTasks.node.name=Name pageTasks.nodes=Nodes pageTasks.node.statusMessage=Status message @@ -4220,6 +4220,7 @@ chooseFocusTypeAndRelationDialogPanel.relation=Relation: chooseFocusTypeAndRelationDialogPanel.type=Type chooseFocusTypeAndRelationDialogPanel.tooltip.type=Type of the object to which the assignment exists abstractRoleMemberPanel.menu.assign=Assign +abstractRoleMemberPanel.menu.assignMember=Assign member abstractRoleMemberPanel.menu.unassign=Unassign abstractRoleMemberPanel.menu.recompute=Recompute abstractRoleMemberPanel.menu.create=Create diff --git a/gui/admin-gui/src/main/resources/localization/Midpoint_es.properties b/gui/admin-gui/src/main/resources/localization/Midpoint_es.properties index 9f5c1cd7252..2700d59c492 100644 --- a/gui/admin-gui/src/main/resources/localization/Midpoint_es.properties +++ b/gui/admin-gui/src/main/resources/localization/Midpoint_es.properties @@ -436,7 +436,7 @@ JasperReportConfigurationPanel.parameterName=Nombre de parámetro JasperReportConfigurationPanel.parameterProperty=Propiedad: {0} JasperReportConfigurationPanel.reportFields=Reporte de campos JasperReportConfigurationPanel.reportParameters=Reporte de parámetros -JasperReportConfigurationPanel.reportQuery=Reporte de pregunta +JasperReportConfigurationPanel.reportQuery=Consulta del reporte JasperReportConfigurationPanel.errormsg=Valores vacíos no permitidos JasperReportConfigurationPanel.properties=Propiedades JasperReportConfigurationPanel.configure=Configurar @@ -1118,28 +1118,28 @@ PageAdmin.menu.top.configuration.notifications=Notificaciones PageAdmin.menu.top.configuration.profiling=Profiling PageAdmin.menu.top.configuration.adminGui=Admin GUI PageAdmin.menu.top.configuration.repositoryObjects=Objetos del repositorio -PageAdmin.menu.top.configuration.repositoryObjectsList=Listar objetos +PageAdmin.menu.top.configuration.repositoryObjectsList=All objects PageAdmin.menu.top.configuration.security=Securidad PageAdmin.menu.top.home=Inicio PageAdmin.menu.top.reports.created=Informes creados -PageAdmin.menu.top.reports.list=Informes +PageAdmin.menu.top.reports.list=All reports PageAdmin.menu.top.reports.new=Importar reporte Jasper PageAdmin.menu.top.reports=Informes PageAdmin.menu.top.resources.import=Importar definición de recurso -PageAdmin.menu.top.resources.list=Listar recursos +PageAdmin.menu.top.resources.list=All resources PageAdmin.menu.top.resources.new=Nuevo recuros PageAdmin.menu.top.resources.view=Ver recurso PageAdmin.menu.top.resources.edit=Editar recurso PageAdmin.menu.top.resources=Recursos -PageAdmin.menu.top.connectorHosts.list=Listar hosts de conectores -PageAdmin.menu.top.roles.list=Listar roles +PageAdmin.menu.top.connectorHosts.list=All connector hosts +PageAdmin.menu.top.roles.list=All roles PageAdmin.menu.top.roles.new=Nuevo rol PageAdmin.menu.top.roles=Roles -PageAdmin.menu.top.serverTasks.list=Listar tareas +PageAdmin.menu.top.serverTasks.list=All tasks PageAdmin.menu.top.serverTasks.new=Nueva tarea PageAdmin.menu.top.serverTasks=Tareas del servidor PageAdmin.menu.top.users.find=Encontrar usuarios -PageAdmin.menu.top.users.list=Listar usuarios +PageAdmin.menu.top.users.list=Todos los usuarios PageAdmin.menu.top.users.new=Nuevo usuario PageAdmin.menu.top.users.org.new=Nueva organización PageAdmin.menu.top.users.org=Estructura organizativa @@ -1242,7 +1242,7 @@ pageAdmin.resources.description=Sistemas conectados pageAdminResources.detailsResource=Detalles del recurso pageAdminResources.editResource=Editar recurso pageAdminResources.importResource=Importar recurso -pageAdminResources.listResources=Listar recursos +pageAdminResources.listResources=All resources pageAdminResources.message.cantLoadResource=No se pudo cargar los detalles del recurso. pageAdminResources.newResource=Nuevo recurso pageAdmin.resources=Recursos @@ -2075,7 +2075,7 @@ pageServices.message.confirmationMessageForSingleObject.members=Do you really wa pageRoles.message.nothingSelected=No se ha seleccionado rol. pageRoles.message.queryError=Error ocurrido durante la búsqueda de la traducción consulta de búsqueda para filtrar. pageRoles.requestable=Solicitable -PageRoles.title=Listar roles +PageRoles.title=All roles pageSecurityQuestions.message.WrongAnswer=Preguntas No Respondidas Correctamente pageSecurityQuestions.message.noPolicySet=No hay política de contraseñas configurada PageSecurityQuestions.title=Preguntas de Seguridad @@ -2350,7 +2350,7 @@ pageTasks.message.noTaskSelected=No se ha seleccionado una tarea. pageTasks.node.clustered=Clusterizado pageTasks.node.executionStatus=Estado pageTasks.node.lastCheckInTime=Último tiempo de check-in -pageTasks.node.managementPort=Puerto de gestión +pageTasks.node.contact=Contact pageTasks.node.name=Nombre pageTasks.nodes=Nodos pageTasks.node.statusMessage=Mensaje de estado @@ -2496,7 +2496,7 @@ pageCases.table.openTimestamp=Abierto pageCases.table.closeTimestamp=Cerrado pageCases.button.delete=Eliminar PageCasesAllocatedToMe.title=Mis casos -PageCasesAll.title=Listar casos +PageCasesAll.title=All Cases MultipleAssignmentSelectorPanel.availableRoles=Available roles MultipleAssignmentSelectorPanel.parameters=Parametros MultipleAssignmentSelectorPanel.currentRoles=Current roles @@ -2506,7 +2506,7 @@ MultipleAssignmentSelector.orgUnit=Unidad Org. AssignmentPopup.addButtonTitle=Please, select at least 1 object pageValuePolicies.table.description=Descripción pageValuePolicies.button.delete=Eliminar -PageValuePolicies.title=List value policies +PageValuePolicies.title=All value policies PageValuePolicy.title = Política de valor PageValuePolicy.button.back=Atrás PageValuePolicy.button.save=Guardar @@ -3599,7 +3599,7 @@ autoRefreshPanel.pauseRefreshing=Pausar refrescado autoRefreshPanel.refreshingEach=Refrescando cada {0} segundos autoRefreshPanel.noRefreshing=(no refrescando) PageAdmin.menu.top.services=Servicios -PageAdmin.menu.top.services.list=Listar servicios +PageAdmin.menu.top.services.list=All services PageAdmin.menu.top.services.new=Nuevo servicio PageAdmin.menu.top.services.edit=Editar servicio taskShowAdvancedFeaturesPanel.label=Mostrar opciones avanzadas @@ -3861,7 +3861,7 @@ PageAssignmentShoppingCart.title=Solicitud de asignación PageAssignmentShoppingKart.roleCatalogIsNotConfigured=El catalogo de roles no está configurado en el XML de configuración del sistema RoleCatalogItemButton.assignmentsLimitReachedTitle=Maximum number of the assignments requests has been reached ({0}). No more item can be added/modified/deleted. AssignmentPanel.assignmentsLimitReachedWarning=The number of the selected items exceeds assignments request limit ({0}). -AssignmentConflictPanel.existingAssignmentLabelMessage=(which user already has) +AssignmentConflictPanel.existingAssignmentLabelMessage=(que el usuario ya posee) AssignmentConflictPanel.addedAssignmentLabelMessage=(que es agregado al carrito de compras) AssignmentConflictPanel.conflictMessage=tiene conflicto con AssignmentConflictPanel.removeButton=Remover @@ -4220,6 +4220,7 @@ chooseFocusTypeAndRelationDialogPanel.relation=Relación: chooseFocusTypeAndRelationDialogPanel.type=Tipo chooseFocusTypeAndRelationDialogPanel.tooltip.type=Type of the object to which the assignment exits abstractRoleMemberPanel.menu.assign=Asignar Recursos de la Cuenta +abstractRoleMemberPanel.menu.assignMember=Assign member abstractRoleMemberPanel.menu.unassign=Desasignar abstractRoleMemberPanel.menu.recompute=Re-procesar abstractRoleMemberPanel.menu.create=Crear diff --git a/gui/admin-gui/src/main/resources/localization/Midpoint_et.properties b/gui/admin-gui/src/main/resources/localization/Midpoint_et.properties index 4438ca9fed0..cf1ff905bce 100644 --- a/gui/admin-gui/src/main/resources/localization/Midpoint_et.properties +++ b/gui/admin-gui/src/main/resources/localization/Midpoint_et.properties @@ -1118,28 +1118,28 @@ PageAdmin.menu.top.configuration.notifications=Teavitused PageAdmin.menu.top.configuration.profiling=Profiilimine PageAdmin.menu.top.configuration.adminGui=Admin GUI PageAdmin.menu.top.configuration.repositoryObjects=Hoidla objektid -PageAdmin.menu.top.configuration.repositoryObjectsList=List objects +PageAdmin.menu.top.configuration.repositoryObjectsList=All objects PageAdmin.menu.top.configuration.security=Turve PageAdmin.menu.top.home=Kodu PageAdmin.menu.top.reports.created=Loodud aruanded -PageAdmin.menu.top.reports.list=Aruannete loend +PageAdmin.menu.top.reports.list=All reports PageAdmin.menu.top.reports.new=Impordi Jasper-aruanne PageAdmin.menu.top.reports=Aruanded PageAdmin.menu.top.resources.import=Impordi ressursi definitsioon -PageAdmin.menu.top.resources.list=Ressursside loend +PageAdmin.menu.top.resources.list=All resources PageAdmin.menu.top.resources.new=Uus ressurss PageAdmin.menu.top.resources.view=Kuva ressurss PageAdmin.menu.top.resources.edit=Redigeeri ressurssi PageAdmin.menu.top.resources=Ressursid -PageAdmin.menu.top.connectorHosts.list=Konnektorhostide loend -PageAdmin.menu.top.roles.list=Rollide loend +PageAdmin.menu.top.connectorHosts.list=All connector hosts +PageAdmin.menu.top.roles.list=Kõik rollid PageAdmin.menu.top.roles.new=Uus roll PageAdmin.menu.top.roles=Rollid -PageAdmin.menu.top.serverTasks.list=Ülesannete loend +PageAdmin.menu.top.serverTasks.list=All tasks PageAdmin.menu.top.serverTasks.new=Uus ülesanne PageAdmin.menu.top.serverTasks=Serveri tööülesanded PageAdmin.menu.top.users.find=Leia kasutajaid -PageAdmin.menu.top.users.list=Kasutajate loend +PageAdmin.menu.top.users.list=Kõik kasutajad PageAdmin.menu.top.users.new=Uus kasutaja PageAdmin.menu.top.users.org.new=Uus organisatsioon PageAdmin.menu.top.users.org=Org. struktuur @@ -1242,7 +1242,7 @@ pageAdmin.resources.description=Ühendatud süsteemid pageAdminResources.detailsResource=Ressursi üksikasjad pageAdminResources.editResource=Redigeeri ressurssi pageAdminResources.importResource=Impordi ressurss -pageAdminResources.listResources=Ressursside loend +pageAdminResources.listResources=All resources pageAdminResources.message.cantLoadResource=Ei saanud laadida ressursi üksikasju. pageAdminResources.newResource=Uus ressurss pageAdmin.resources=Ressursid @@ -2075,7 +2075,7 @@ pageServices.message.confirmationMessageForSingleObject.members=Do you really wa pageRoles.message.nothingSelected=Rolli pole valitud. pageRoles.message.queryError=Otsingupäringu tõlkimisel filtrile ilmnes tõrge. pageRoles.requestable=Taotletav -PageRoles.title=Rollide loend +PageRoles.title=Kõik rollid pageSecurityQuestions.message.WrongAnswer=Küsimustele pole õigesti vastatud pageSecurityQuestions.message.noPolicySet=Paroolipoliitika puudub PageSecurityQuestions.title=Turbeküsimused @@ -2350,7 +2350,7 @@ pageTasks.message.noTaskSelected=Ülesannet pole valitud pageTasks.node.clustered=Klasterdatud pageTasks.node.executionStatus=Olek pageTasks.node.lastCheckInTime=Viimane oleku kontroll -pageTasks.node.managementPort=Haldusport +pageTasks.node.contact=Contact pageTasks.node.name=Nimi pageTasks.nodes=Sõlmed pageTasks.node.statusMessage=Olekuteade @@ -2496,7 +2496,7 @@ pageCases.table.openTimestamp=Opened pageCases.table.closeTimestamp=Suletud pageCases.button.delete=Kustuta PageCasesAllocatedToMe.title=My Cases -PageCasesAll.title=List Cases +PageCasesAll.title=All Cases MultipleAssignmentSelectorPanel.availableRoles=Saadaolevad rollid MultipleAssignmentSelectorPanel.parameters=Parameetrid MultipleAssignmentSelectorPanel.currentRoles=Praegused rollid @@ -2506,7 +2506,7 @@ MultipleAssignmentSelector.orgUnit=Org. üksus AssignmentPopup.addButtonTitle=Please, select at least 1 object pageValuePolicies.table.description=Kirjeldus pageValuePolicies.button.delete=Kustuta -PageValuePolicies.title=List value policies +PageValuePolicies.title=All value policies PageValuePolicy.title = Väärtuspoliitika PageValuePolicy.button.back=Tagasi PageValuePolicy.button.save=Salvesta @@ -3599,7 +3599,7 @@ autoRefreshPanel.pauseRefreshing=Peata värskendamine autoRefreshPanel.refreshingEach=Värskendusaeg {0} sek. autoRefreshPanel.noRefreshing=(ei värskendata) PageAdmin.menu.top.services=Teenused -PageAdmin.menu.top.services.list=Teenuste loend +PageAdmin.menu.top.services.list=All services PageAdmin.menu.top.services.new=Uus teenus PageAdmin.menu.top.services.edit=Redigeeri teenust taskShowAdvancedFeaturesPanel.label=Näita põhjalikumalt @@ -4220,6 +4220,7 @@ chooseFocusTypeAndRelationDialogPanel.relation=Relation: chooseFocusTypeAndRelationDialogPanel.type=Tüüp chooseFocusTypeAndRelationDialogPanel.tooltip.type=Type of the object to which the assignment exits abstractRoleMemberPanel.menu.assign=Omista +abstractRoleMemberPanel.menu.assignMember=Assign member abstractRoleMemberPanel.menu.unassign=Eemalda omistus abstractRoleMemberPanel.menu.recompute=Arvuta uuesti abstractRoleMemberPanel.menu.create=Loo diff --git a/gui/admin-gui/src/main/resources/localization/Midpoint_fi.properties b/gui/admin-gui/src/main/resources/localization/Midpoint_fi.properties index 9300fe709bf..f9367d4d5a9 100644 --- a/gui/admin-gui/src/main/resources/localization/Midpoint_fi.properties +++ b/gui/admin-gui/src/main/resources/localization/Midpoint_fi.properties @@ -1118,28 +1118,28 @@ PageAdmin.menu.top.configuration.notifications=Ilmoitukset PageAdmin.menu.top.configuration.profiling=Profilointi PageAdmin.menu.top.configuration.adminGui=Järjestelmänvalvoja GUI PageAdmin.menu.top.configuration.repositoryObjects=Säilöobjektit -PageAdmin.menu.top.configuration.repositoryObjectsList=Luettele objektit +PageAdmin.menu.top.configuration.repositoryObjectsList=All objects PageAdmin.menu.top.configuration.security=Turvallisuus PageAdmin.menu.top.home=Koti PageAdmin.menu.top.reports.created=Luodut raportit -PageAdmin.menu.top.reports.list=Luettele raportit +PageAdmin.menu.top.reports.list=All reports PageAdmin.menu.top.reports.new=Tuo Jasper raportti PageAdmin.menu.top.reports=Raportit PageAdmin.menu.top.resources.import=Tuo resurssimääritys -PageAdmin.menu.top.resources.list=Luettele resurssit +PageAdmin.menu.top.resources.list=All resources PageAdmin.menu.top.resources.new=Uusi resurssi PageAdmin.menu.top.resources.view=Katsele resurssia PageAdmin.menu.top.resources.edit=Muokkaa resurssia PageAdmin.menu.top.resources=Resurssit -PageAdmin.menu.top.connectorHosts.list=Listaa liittimen isännät -PageAdmin.menu.top.roles.list=Luettele roolit +PageAdmin.menu.top.connectorHosts.list=All connector hosts +PageAdmin.menu.top.roles.list=Kaikki roolit PageAdmin.menu.top.roles.new=Uusi rooli PageAdmin.menu.top.roles=Roolit -PageAdmin.menu.top.serverTasks.list=Luettele tehtävät +PageAdmin.menu.top.serverTasks.list=All tasks PageAdmin.menu.top.serverTasks.new=Uusi tehtävä PageAdmin.menu.top.serverTasks=Palvelin tehtävät PageAdmin.menu.top.users.find=Etsi käyttäjiä -PageAdmin.menu.top.users.list=Luettele käyttäjät +PageAdmin.menu.top.users.list=Kaikki käyttäjät PageAdmin.menu.top.users.new=Uusi käyttäjä PageAdmin.menu.top.users.org.new=Uusi organisaatio PageAdmin.menu.top.users.org=Org. rakenne @@ -1242,7 +1242,7 @@ pageAdmin.resources.description=Liitetyt järjestelmät pageAdminResources.detailsResource=Resurssin yksityiskohdat pageAdminResources.editResource=Muokkaa resurssia pageAdminResources.importResource=Tuo resurssi -pageAdminResources.listResources=Luettele resurssit +pageAdminResources.listResources=All resources pageAdminResources.message.cantLoadResource=Ei pystytty lataamaan resurssin yksityiskohtia. pageAdminResources.newResource=Uusi resurssi pageAdmin.resources=Resurssit @@ -2075,7 +2075,7 @@ pageServices.message.confirmationMessageForSingleObject.members=Do you really wa pageRoles.message.nothingSelected=Roolia ei ole valittu. pageRoles.message.queryError=Virhe tapahtui kääntäessä haku tiedustelua suodattimeen. pageRoles.requestable=Pyydettävissä -PageRoles.title=Luettele roolit +PageRoles.title=Kaikki roolit pageSecurityQuestions.message.WrongAnswer=Kysymyksiin Ei Vastattu Oikein pageSecurityQuestions.message.noPolicySet=Salasanan linjausta ei ole asetettu PageSecurityQuestions.title=Turvakysymykset @@ -2350,7 +2350,7 @@ pageTasks.message.noTaskSelected=Tehtävää ei valittuna. pageTasks.node.clustered=Ryhmitetty pageTasks.node.executionStatus=Tila pageTasks.node.lastCheckInTime=Viimeinen check-in aika -pageTasks.node.managementPort=Hallinta portti +pageTasks.node.contact=Contact pageTasks.node.name=Nimi pageTasks.nodes=Solmut pageTasks.node.statusMessage=Tila viesti @@ -2496,7 +2496,7 @@ pageCases.table.openTimestamp=Avattu pageCases.table.closeTimestamp=Suljettu pageCases.button.delete=Poista PageCasesAllocatedToMe.title=My Cases -PageCasesAll.title=List Cases +PageCasesAll.title=All Cases MultipleAssignmentSelectorPanel.availableRoles=Vapaat roolit MultipleAssignmentSelectorPanel.parameters=Parametrit MultipleAssignmentSelectorPanel.currentRoles=Nykyiset roolit @@ -2506,7 +2506,7 @@ MultipleAssignmentSelector.orgUnit=Org. yksikkö AssignmentPopup.addButtonTitle=Please, select at least 1 object pageValuePolicies.table.description=Kuvaus pageValuePolicies.button.delete=Poista -PageValuePolicies.title=Luettele arvolinjaukset +PageValuePolicies.title=All value policies PageValuePolicy.title = Arvolinjaus PageValuePolicy.button.back=Takaisin PageValuePolicy.button.save=Tallenna @@ -3599,7 +3599,7 @@ autoRefreshPanel.pauseRefreshing=Keskeytä päivitys autoRefreshPanel.refreshingEach=Päivitetään joka {0} sek autoRefreshPanel.noRefreshing=(ei päivittämistä) PageAdmin.menu.top.services=Palvelut -PageAdmin.menu.top.services.list=Luettele palvelut +PageAdmin.menu.top.services.list=All services PageAdmin.menu.top.services.new=Uusi palvelu PageAdmin.menu.top.services.edit=Muokkaa palvelua taskShowAdvancedFeaturesPanel.label=Näytä edistyneet toiminnot @@ -4220,6 +4220,7 @@ chooseFocusTypeAndRelationDialogPanel.relation=Relation: chooseFocusTypeAndRelationDialogPanel.type=Tyyppi chooseFocusTypeAndRelationDialogPanel.tooltip.type=Type of the object to which the assignment exits abstractRoleMemberPanel.menu.assign=Osoita +abstractRoleMemberPanel.menu.assignMember=Assign member abstractRoleMemberPanel.menu.unassign=Poista osoitus abstractRoleMemberPanel.menu.recompute=Uudelleenlaske abstractRoleMemberPanel.menu.create=Luo diff --git a/gui/admin-gui/src/main/resources/localization/Midpoint_fr.properties b/gui/admin-gui/src/main/resources/localization/Midpoint_fr.properties index a59dd09d0fc..e51c118e1ef 100644 --- a/gui/admin-gui/src/main/resources/localization/Midpoint_fr.properties +++ b/gui/admin-gui/src/main/resources/localization/Midpoint_fr.properties @@ -1118,28 +1118,28 @@ PageAdmin.menu.top.configuration.notifications=Notifications PageAdmin.menu.top.configuration.profiling=Profilage PageAdmin.menu.top.configuration.adminGui=Interface graphique d'administration PageAdmin.menu.top.configuration.repositoryObjects=Objets du dépôt -PageAdmin.menu.top.configuration.repositoryObjectsList=Liste des objets +PageAdmin.menu.top.configuration.repositoryObjectsList=All objects PageAdmin.menu.top.configuration.security=Sécurité PageAdmin.menu.top.home=Accueil PageAdmin.menu.top.reports.created=Rapports produits -PageAdmin.menu.top.reports.list=Liste des rapports +PageAdmin.menu.top.reports.list=All reports PageAdmin.menu.top.reports.new=Importer un rapport Jasper PageAdmin.menu.top.reports=Rapports PageAdmin.menu.top.resources.import=Importer une déf. de ressource -PageAdmin.menu.top.resources.list=Liste des ressources +PageAdmin.menu.top.resources.list=All resources PageAdmin.menu.top.resources.new=Nouvelle ressource PageAdmin.menu.top.resources.view=Voir ressources PageAdmin.menu.top.resources.edit=Modifier la ressource PageAdmin.menu.top.resources=Ressources -PageAdmin.menu.top.connectorHosts.list=Liste des hôtes de connecteurs -PageAdmin.menu.top.roles.list=Liste des rôles +PageAdmin.menu.top.connectorHosts.list=All connector hosts +PageAdmin.menu.top.roles.list=Tous les rôles PageAdmin.menu.top.roles.new=Nouveau rôle PageAdmin.menu.top.roles=Rôles -PageAdmin.menu.top.serverTasks.list=Liste des tâches +PageAdmin.menu.top.serverTasks.list=All tasks PageAdmin.menu.top.serverTasks.new=Nouvelle tâche PageAdmin.menu.top.serverTasks=Tâches serveur PageAdmin.menu.top.users.find=Trouver des utilisateurs -PageAdmin.menu.top.users.list=Liste des utilisateurs +PageAdmin.menu.top.users.list=Tous les utilisateurs PageAdmin.menu.top.users.new=Nouvel utilisateur PageAdmin.menu.top.users.org.new=Nouvelle entité org. PageAdmin.menu.top.users.org=Organigramme @@ -1242,7 +1242,7 @@ pageAdmin.resources.description=Systèmes connectés pageAdminResources.detailsResource=Détails de la ressource pageAdminResources.editResource=Modifier la ressource pageAdminResources.importResource=Importer ressource -pageAdminResources.listResources=Liste des ressources +pageAdminResources.listResources=All resources pageAdminResources.message.cantLoadResource=Impossible de charger les détails de la ressource pageAdminResources.newResource=Nouvelle ressource pageAdmin.resources=Ressources @@ -2075,7 +2075,7 @@ pageServices.message.confirmationMessageForSingleObject.members=Do you really wa pageRoles.message.nothingSelected=Aucune rôle n'a été sélectionné. pageRoles.message.queryError=Une erreur s'est produite lors de la requête de recherche de traduction à filtrer. pageRoles.requestable=Sur demande -PageRoles.title=Liste des rôles +PageRoles.title=Tous les rôles pageSecurityQuestions.message.WrongAnswer=Questions non répondues correctement pageSecurityQuestions.message.noPolicySet=Aucune politique des mots de passe n'est définie PageSecurityQuestions.title=Questions de sécurité @@ -2350,7 +2350,7 @@ pageTasks.message.noTaskSelected=Aucune tâche n'a été sélectionnée. pageTasks.node.clustered=En grappe pageTasks.node.executionStatus=État pageTasks.node.lastCheckInTime=Dernier contact -pageTasks.node.managementPort=Port pour la gestion du système +pageTasks.node.contact=Contact pageTasks.node.name=Nom pageTasks.nodes=Nœuds pageTasks.node.statusMessage=Message d'état @@ -2496,7 +2496,7 @@ pageCases.table.openTimestamp=Ouvert pageCases.table.closeTimestamp=Fermé pageCases.button.delete=Supprimer PageCasesAllocatedToMe.title=Mes Cas -PageCasesAll.title=Liste des Cas +PageCasesAll.title=All Cases MultipleAssignmentSelectorPanel.availableRoles=Rôles disponibles MultipleAssignmentSelectorPanel.parameters=Paramètres MultipleAssignmentSelectorPanel.currentRoles=Rôle actuel @@ -2506,7 +2506,7 @@ MultipleAssignmentSelector.orgUnit=Entité org. AssignmentPopup.addButtonTitle=Veuillez sélectionner au moins 1 objet pageValuePolicies.table.description=Description pageValuePolicies.button.delete=Supprimer -PageValuePolicies.title=Liste des politiques de valeurs +PageValuePolicies.title=All value policies PageValuePolicy.title = Politique de valeur PageValuePolicy.button.back=Retour PageValuePolicy.button.save=Enregistrer @@ -3599,7 +3599,7 @@ autoRefreshPanel.pauseRefreshing=Suspendre le rafraîchissement autoRefreshPanel.refreshingEach=Rafraîchir toutes les {0} sec autoRefreshPanel.noRefreshing=(pas de rafraîchissement) PageAdmin.menu.top.services=Services -PageAdmin.menu.top.services.list=Liste des services +PageAdmin.menu.top.services.list=All services PageAdmin.menu.top.services.new=Nouveau service PageAdmin.menu.top.services.edit=Modifier le service taskShowAdvancedFeaturesPanel.label=Montrer les fonctionnalités avancées @@ -4220,6 +4220,7 @@ chooseFocusTypeAndRelationDialogPanel.relation=Relation : chooseFocusTypeAndRelationDialogPanel.type=Type chooseFocusTypeAndRelationDialogPanel.tooltip.type=Type of the object to which the assignment exits abstractRoleMemberPanel.menu.assign=Attribuer +abstractRoleMemberPanel.menu.assignMember=Assign member abstractRoleMemberPanel.menu.unassign=Retirer l'attribution abstractRoleMemberPanel.menu.recompute=Recalculer abstractRoleMemberPanel.menu.create=Créer diff --git a/gui/admin-gui/src/main/resources/localization/Midpoint_hu.properties b/gui/admin-gui/src/main/resources/localization/Midpoint_hu.properties index 89300577497..f67160529f3 100644 --- a/gui/admin-gui/src/main/resources/localization/Midpoint_hu.properties +++ b/gui/admin-gui/src/main/resources/localization/Midpoint_hu.properties @@ -1118,28 +1118,28 @@ PageAdmin.menu.top.configuration.notifications=Értesítések PageAdmin.menu.top.configuration.profiling=Profiling PageAdmin.menu.top.configuration.adminGui=Admin GUI PageAdmin.menu.top.configuration.repositoryObjects=Repository objects -PageAdmin.menu.top.configuration.repositoryObjectsList=List objects +PageAdmin.menu.top.configuration.repositoryObjectsList=All objects PageAdmin.menu.top.configuration.security=Biztonság PageAdmin.menu.top.home=Home PageAdmin.menu.top.reports.created=Created reports -PageAdmin.menu.top.reports.list=Riport lista +PageAdmin.menu.top.reports.list=All reports PageAdmin.menu.top.reports.new=Jasper riport importálása PageAdmin.menu.top.reports=Riportok\t PageAdmin.menu.top.resources.import=Erőforrás definíció importálása -PageAdmin.menu.top.resources.list=Erőforrás lista +PageAdmin.menu.top.resources.list=All resources PageAdmin.menu.top.resources.new=Új erőforrás PageAdmin.menu.top.resources.view=Erőforrás megtekintése PageAdmin.menu.top.resources.edit=Erőforrás szerkesztése PageAdmin.menu.top.resources=Erőforrások -PageAdmin.menu.top.connectorHosts.list=List connector hosts -PageAdmin.menu.top.roles.list=Szerep lista +PageAdmin.menu.top.connectorHosts.list=All connector hosts +PageAdmin.menu.top.roles.list=All roles PageAdmin.menu.top.roles.new=Új szerep PageAdmin.menu.top.roles=Szerepek -PageAdmin.menu.top.serverTasks.list=List tasks +PageAdmin.menu.top.serverTasks.list=All tasks PageAdmin.menu.top.serverTasks.new=New task PageAdmin.menu.top.serverTasks=Server tasks PageAdmin.menu.top.users.find=Felhasználók keresése -PageAdmin.menu.top.users.list=Felhasználó lista +PageAdmin.menu.top.users.list=All users PageAdmin.menu.top.users.new=Új felhasználó PageAdmin.menu.top.users.org.new=Új szervezet PageAdmin.menu.top.users.org=Szervezeti struktúra @@ -1242,7 +1242,7 @@ pageAdmin.resources.description=Connected systems pageAdminResources.detailsResource=Resource details pageAdminResources.editResource=Erőforrás szerkesztése pageAdminResources.importResource=Import resource -pageAdminResources.listResources=Erőforrás lista +pageAdminResources.listResources=All resources pageAdminResources.message.cantLoadResource=Couldn't load resource details. pageAdminResources.newResource=Új erőforrás pageAdmin.resources=Erőforrások @@ -2075,7 +2075,7 @@ pageServices.message.confirmationMessageForSingleObject.members=Do you really wa pageRoles.message.nothingSelected=No role has been selected. pageRoles.message.queryError=Error occurred during translation search query to filter. pageRoles.requestable=Igényelhető -PageRoles.title=Szerep lista +PageRoles.title=All roles pageSecurityQuestions.message.WrongAnswer=Questions Not Answered Correctly pageSecurityQuestions.message.noPolicySet=No password policy is set PageSecurityQuestions.title=Security Questions @@ -2350,7 +2350,7 @@ pageTasks.message.noTaskSelected=No task has been selected. pageTasks.node.clustered=Clustered pageTasks.node.executionStatus=Állapot pageTasks.node.lastCheckInTime=Last check-in time -pageTasks.node.managementPort=Management port +pageTasks.node.contact=Contact pageTasks.node.name=Név pageTasks.nodes=Nodes pageTasks.node.statusMessage=Status message @@ -2496,7 +2496,7 @@ pageCases.table.openTimestamp=Opened pageCases.table.closeTimestamp=Lezárva pageCases.button.delete=Törlés PageCasesAllocatedToMe.title=My Cases -PageCasesAll.title=List Cases +PageCasesAll.title=All Cases MultipleAssignmentSelectorPanel.availableRoles=Available roles MultipleAssignmentSelectorPanel.parameters=Parameters MultipleAssignmentSelectorPanel.currentRoles=Current roles @@ -2506,7 +2506,7 @@ MultipleAssignmentSelector.orgUnit=Org. unit AssignmentPopup.addButtonTitle=Please, select at least 1 object pageValuePolicies.table.description=Leírás pageValuePolicies.button.delete=Törlés -PageValuePolicies.title=List value policies +PageValuePolicies.title=All value policies PageValuePolicy.title = Value policy PageValuePolicy.button.back=Vissza PageValuePolicy.button.save=Mentés @@ -3599,7 +3599,7 @@ autoRefreshPanel.pauseRefreshing=Pause refreshing autoRefreshPanel.refreshingEach=Refreshing each {0} sec autoRefreshPanel.noRefreshing=(no refreshing) PageAdmin.menu.top.services=Szolgáltatások -PageAdmin.menu.top.services.list=List services +PageAdmin.menu.top.services.list=All services PageAdmin.menu.top.services.new=New service PageAdmin.menu.top.services.edit=Edit service taskShowAdvancedFeaturesPanel.label=Show advanced features @@ -4220,6 +4220,7 @@ chooseFocusTypeAndRelationDialogPanel.relation=Relation: chooseFocusTypeAndRelationDialogPanel.type=Típus chooseFocusTypeAndRelationDialogPanel.tooltip.type=Type of the object to which the assignment exits abstractRoleMemberPanel.menu.assign=Hozzárendel +abstractRoleMemberPanel.menu.assignMember=Assign member abstractRoleMemberPanel.menu.unassign=Hozzárendelés megszüntetése abstractRoleMemberPanel.menu.recompute=Újraszámítás abstractRoleMemberPanel.menu.create=Létrehoz diff --git a/gui/admin-gui/src/main/resources/localization/Midpoint_it.properties b/gui/admin-gui/src/main/resources/localization/Midpoint_it.properties index dc840d68898..5139502b15c 100644 --- a/gui/admin-gui/src/main/resources/localization/Midpoint_it.properties +++ b/gui/admin-gui/src/main/resources/localization/Midpoint_it.properties @@ -693,7 +693,7 @@ ObjectTypeGuiDescriptor.case=Caso ObjectTypeGuiDescriptor.valuePolicy=Policy del valore ObjectTypeGuiDescriptor.functionLibrary=Libreria di funzioni ObjectTypeGuiDescriptor.objectCollection=Collezione di oggetti -ObjectTypeGuiDescriptor.archetype=Archetype +ObjectTypeGuiDescriptor.archetype=Archetipo ObjectTypeGuiDescriptor.unknown=Non definito operation.com.evolveum.midpoint.common.crypto.CryptoUtil.securitySelfTest=Autotest di sicurezza operation.com.evolveum.midpoint.common.operation.import.object=Importa oggetto @@ -1118,28 +1118,28 @@ PageAdmin.menu.top.configuration.notifications=Notifiche PageAdmin.menu.top.configuration.profiling=Profilazione PageAdmin.menu.top.configuration.adminGui=Admin GUI PageAdmin.menu.top.configuration.repositoryObjects=Repository degli oggetti -PageAdmin.menu.top.configuration.repositoryObjectsList=Lista degli oggetti +PageAdmin.menu.top.configuration.repositoryObjectsList=Tutti gli oggetti PageAdmin.menu.top.configuration.security=Security PageAdmin.menu.top.home=Home PageAdmin.menu.top.reports.created=Report creati -PageAdmin.menu.top.reports.list=Lista dei report +PageAdmin.menu.top.reports.list=Tutti i report PageAdmin.menu.top.reports.new=Importa report Jasper PageAdmin.menu.top.reports=I Report PageAdmin.menu.top.resources.import=Importa definizione risorsa -PageAdmin.menu.top.resources.list=lista risorse +PageAdmin.menu.top.resources.list=Tutte le risorse PageAdmin.menu.top.resources.new=Nuova risorsa PageAdmin.menu.top.resources.view=Visualizza risorsa PageAdmin.menu.top.resources.edit=Modifica risorsa PageAdmin.menu.top.resources=Risorse -PageAdmin.menu.top.connectorHosts.list=Lista connettori hosts -PageAdmin.menu.top.roles.list=Lista ruoli +PageAdmin.menu.top.connectorHosts.list=Tutti gli host del connettore +PageAdmin.menu.top.roles.list=Tutti i ruoli PageAdmin.menu.top.roles.new=Nuovo ruolo PageAdmin.menu.top.roles=Ruoli -PageAdmin.menu.top.serverTasks.list=Lista tasks +PageAdmin.menu.top.serverTasks.list=Tutti i task PageAdmin.menu.top.serverTasks.new=Nuovo task PageAdmin.menu.top.serverTasks=Server tasks PageAdmin.menu.top.users.find=Ricerca utenti -PageAdmin.menu.top.users.list=Lista utenti +PageAdmin.menu.top.users.list=Tutti gli utenti PageAdmin.menu.top.users.new=Nuovo utente PageAdmin.menu.top.users.org.new=Nuova organizzazione PageAdmin.menu.top.users.org=Struttura organizzativa @@ -1242,7 +1242,7 @@ pageAdmin.resources.description=Sistemi connessi pageAdminResources.detailsResource=Dettagli risorsa pageAdminResources.editResource=Modifica risorsa pageAdminResources.importResource=Importa risorsa -pageAdminResources.listResources=lista risorse +pageAdminResources.listResources=Tutte le risorse pageAdminResources.message.cantLoadResource=Impossibile caricare i dettagli della risorsa. pageAdminResources.newResource=Nuova risorsa pageAdmin.resources=Risorse @@ -2075,7 +2075,7 @@ pageServices.message.confirmationMessageForSingleObject.members=Vuoi veramente { pageRoles.message.nothingSelected=Nessun ruolo è stato selezionato. pageRoles.message.queryError=Si è verificato un errore durante la traduzione della query di ricerca nel corrispondente filtro. pageRoles.requestable=Richiedibile -PageRoles.title=Lista ruoli +PageRoles.title=Tutti i ruoli pageSecurityQuestions.message.WrongAnswer=Domande non risposte correttamente pageSecurityQuestions.message.noPolicySet=Nessuna password policy è stata impostata PageSecurityQuestions.title=Domande di sicurezza @@ -2350,7 +2350,7 @@ pageTasks.message.noTaskSelected=Nessun task è stato selezionato. pageTasks.node.clustered=Clustered pageTasks.node.executionStatus=Stato pageTasks.node.lastCheckInTime=Ultimo check-in -pageTasks.node.managementPort=Management port +pageTasks.node.contact=Contatto pageTasks.node.name=Nome pageTasks.nodes=Nodi pageTasks.node.statusMessage=Messaggio di stato @@ -2496,7 +2496,7 @@ pageCases.table.openTimestamp=Aperto pageCases.table.closeTimestamp=Chiuso pageCases.button.delete=Elimina PageCasesAllocatedToMe.title=I miei Casi -PageCasesAll.title=Lista dei casi +PageCasesAll.title=Tutti i casi MultipleAssignmentSelectorPanel.availableRoles=Ruoli disponibili MultipleAssignmentSelectorPanel.parameters=Parametri MultipleAssignmentSelectorPanel.currentRoles=Ruoli attuali @@ -2506,7 +2506,7 @@ MultipleAssignmentSelector.orgUnit=Unità Organizzativa AssignmentPopup.addButtonTitle=Per favore, seleziona almeno 1 oggetto pageValuePolicies.table.description=Descrizione pageValuePolicies.button.delete=Elimina -PageValuePolicies.title=Lista valori policy +PageValuePolicies.title=Tutti i valori delle policy PageValuePolicy.title = Policy del valore PageValuePolicy.button.back=Indietro PageValuePolicy.button.save=Salva @@ -3599,7 +3599,7 @@ autoRefreshPanel.pauseRefreshing=Metti in pausa l'aggiornamento autoRefreshPanel.refreshingEach=In aggiornamento ogni {0} sec autoRefreshPanel.noRefreshing=(non in aggiornamento) PageAdmin.menu.top.services=Servizi -PageAdmin.menu.top.services.list=Lista dei servizi +PageAdmin.menu.top.services.list=Tutti i servizi PageAdmin.menu.top.services.new=Nuovo servizio PageAdmin.menu.top.services.edit=Modifica servizio taskShowAdvancedFeaturesPanel.label=Mostra funzionalità avanzate @@ -4220,6 +4220,7 @@ chooseFocusTypeAndRelationDialogPanel.relation=Relazione: chooseFocusTypeAndRelationDialogPanel.type=Tipo chooseFocusTypeAndRelationDialogPanel.tooltip.type=Tipo dell'oggetto a cui termina l'assegnazione abstractRoleMemberPanel.menu.assign=Assegna +abstractRoleMemberPanel.menu.assignMember=Assegna membro abstractRoleMemberPanel.menu.unassign=Annulla assegnazione abstractRoleMemberPanel.menu.recompute=Ricalcola abstractRoleMemberPanel.menu.create=Crea diff --git a/gui/admin-gui/src/main/resources/localization/Midpoint_ja.properties b/gui/admin-gui/src/main/resources/localization/Midpoint_ja.properties index 32a18f5fcd2..05965f1b786 100644 --- a/gui/admin-gui/src/main/resources/localization/Midpoint_ja.properties +++ b/gui/admin-gui/src/main/resources/localization/Midpoint_ja.properties @@ -1118,28 +1118,28 @@ PageAdmin.menu.top.configuration.notifications=通知 PageAdmin.menu.top.configuration.profiling=プロファイリング PageAdmin.menu.top.configuration.adminGui=管理GUI PageAdmin.menu.top.configuration.repositoryObjects=リポジトリー・オブジェクト -PageAdmin.menu.top.configuration.repositoryObjectsList=オブジェクト一覧 +PageAdmin.menu.top.configuration.repositoryObjectsList=All objects PageAdmin.menu.top.configuration.security=セキュリティー PageAdmin.menu.top.home=ホーム PageAdmin.menu.top.reports.created=作成されたレポート -PageAdmin.menu.top.reports.list=レポート一覧 +PageAdmin.menu.top.reports.list=All reports PageAdmin.menu.top.reports.new=Jasperレポートのインポート PageAdmin.menu.top.reports=レポート PageAdmin.menu.top.resources.import=リソース定義のインポート -PageAdmin.menu.top.resources.list=リソース一覧 +PageAdmin.menu.top.resources.list=All resources PageAdmin.menu.top.resources.new=新規リソース PageAdmin.menu.top.resources.view=リソースを表示 PageAdmin.menu.top.resources.edit=リソースの編集 PageAdmin.menu.top.resources=リソース -PageAdmin.menu.top.connectorHosts.list=コネクターホスト一覧 -PageAdmin.menu.top.roles.list=ロール一覧 +PageAdmin.menu.top.connectorHosts.list=All connector hosts +PageAdmin.menu.top.roles.list=すべてのロール PageAdmin.menu.top.roles.new=新規ロール PageAdmin.menu.top.roles=ロール -PageAdmin.menu.top.serverTasks.list=タスク一覧 +PageAdmin.menu.top.serverTasks.list=All tasks PageAdmin.menu.top.serverTasks.new=新しいタスク PageAdmin.menu.top.serverTasks=サーバータスク PageAdmin.menu.top.users.find=ユーザー検索 -PageAdmin.menu.top.users.list=ユーザー一覧 +PageAdmin.menu.top.users.list=すべてのユーザー PageAdmin.menu.top.users.new=新規ユーザー PageAdmin.menu.top.users.org.new=新規組織 PageAdmin.menu.top.users.org=組織構造 @@ -1242,7 +1242,7 @@ pageAdmin.resources.description=接続先システム pageAdminResources.detailsResource=リソース詳細 pageAdminResources.editResource=リソースの編集 pageAdminResources.importResource=リソースのインポート -pageAdminResources.listResources=リソース一覧 +pageAdminResources.listResources=All resources pageAdminResources.message.cantLoadResource=リソースの詳細をロードできませんでした。 pageAdminResources.newResource=新規リソース pageAdmin.resources=リソース @@ -2075,7 +2075,7 @@ pageServices.message.confirmationMessageForSingleObject.members=本当にサー pageRoles.message.nothingSelected=ロールが選択されていません。 pageRoles.message.queryError=フィルタリングする翻訳検索クエリーでエラーが発生しました。 pageRoles.requestable=要求可能 -PageRoles.title=ロール一覧 +PageRoles.title=すべてのロール pageSecurityQuestions.message.WrongAnswer=質問の答えが正しくありません pageSecurityQuestions.message.noPolicySet=パスワードポリシーが未設定 PageSecurityQuestions.title=セキュリティに関する質問 @@ -2350,7 +2350,7 @@ pageTasks.message.noTaskSelected=タスクが選択されていません。 pageTasks.node.clustered=クラスタ化 pageTasks.node.executionStatus=ステータス pageTasks.node.lastCheckInTime=最終チェックイン時間 -pageTasks.node.managementPort=管理ポート +pageTasks.node.contact=Contact pageTasks.node.name=名前 pageTasks.nodes=ノード pageTasks.node.statusMessage=ステータス・メッセージ @@ -2496,7 +2496,7 @@ pageCases.table.openTimestamp=Opened pageCases.table.closeTimestamp=終了 pageCases.button.delete=削除 PageCasesAllocatedToMe.title=私のケース -PageCasesAll.title=ケース一覧 +PageCasesAll.title=All Cases MultipleAssignmentSelectorPanel.availableRoles=利用可能なロール MultipleAssignmentSelectorPanel.parameters=パラメーター MultipleAssignmentSelectorPanel.currentRoles=現在のロール @@ -2506,7 +2506,7 @@ MultipleAssignmentSelector.orgUnit=組織ユニット AssignmentPopup.addButtonTitle=少なくとも1つのオブジェクトを選択してください。 pageValuePolicies.table.description=説明 pageValuePolicies.button.delete=削除 -PageValuePolicies.title=バリューポリシー一覧 +PageValuePolicies.title=All value policies PageValuePolicy.title = バリューポリシー PageValuePolicy.button.back=戻る PageValuePolicy.button.save=保存 @@ -3599,7 +3599,7 @@ autoRefreshPanel.pauseRefreshing=リフレッシュを一時中断する autoRefreshPanel.refreshingEach={0} 秒毎にリフレッシュ autoRefreshPanel.noRefreshing=(リフレッシュしない) PageAdmin.menu.top.services=サービス -PageAdmin.menu.top.services.list=サービス一覧 +PageAdmin.menu.top.services.list=All services PageAdmin.menu.top.services.new=新規サービス PageAdmin.menu.top.services.edit=サービスの編集 taskShowAdvancedFeaturesPanel.label=高度な機能を表示 @@ -4220,6 +4220,7 @@ chooseFocusTypeAndRelationDialogPanel.relation=リレーション: chooseFocusTypeAndRelationDialogPanel.type=タイプ chooseFocusTypeAndRelationDialogPanel.tooltip.type=割当てが終了するオブジェクトのタイプ abstractRoleMemberPanel.menu.assign=アサイン +abstractRoleMemberPanel.menu.assignMember=Assign member abstractRoleMemberPanel.menu.unassign=アサイン解除 abstractRoleMemberPanel.menu.recompute=再計算 abstractRoleMemberPanel.menu.create=作成 diff --git a/gui/admin-gui/src/main/resources/localization/Midpoint_lt.properties b/gui/admin-gui/src/main/resources/localization/Midpoint_lt.properties index c5e6c9407de..e69dde9f114 100644 --- a/gui/admin-gui/src/main/resources/localization/Midpoint_lt.properties +++ b/gui/admin-gui/src/main/resources/localization/Midpoint_lt.properties @@ -1118,28 +1118,28 @@ PageAdmin.menu.top.configuration.notifications=Pranešimai PageAdmin.menu.top.configuration.profiling=Profiliavimas PageAdmin.menu.top.configuration.adminGui=Administratoriaus GUI PageAdmin.menu.top.configuration.repositoryObjects=Saugyklos objektai -PageAdmin.menu.top.configuration.repositoryObjectsList=Objektų sąrašas +PageAdmin.menu.top.configuration.repositoryObjectsList=All objects PageAdmin.menu.top.configuration.security=Sauga PageAdmin.menu.top.home=Pradžia PageAdmin.menu.top.reports.created=Sukurtos ataskaitos -PageAdmin.menu.top.reports.list=Galimų ataskaitų sąrašas +PageAdmin.menu.top.reports.list=All reports PageAdmin.menu.top.reports.new=Importuoti Jasper ataskaitas PageAdmin.menu.top.reports=Ataskaitos PageAdmin.menu.top.resources.import=Resursų importavimo apibrėžtis -PageAdmin.menu.top.resources.list=Resursų sąrašas +PageAdmin.menu.top.resources.list=All resources PageAdmin.menu.top.resources.new=Naujas resursas PageAdmin.menu.top.resources.view=Peržiūrėti resursus PageAdmin.menu.top.resources.edit=Redaguoti resursus PageAdmin.menu.top.resources=Resursai -PageAdmin.menu.top.connectorHosts.list=Sąsajos įrenginių sąrašas -PageAdmin.menu.top.roles.list=Rolių sąrašas +PageAdmin.menu.top.connectorHosts.list=All connector hosts +PageAdmin.menu.top.roles.list=Visos rolės PageAdmin.menu.top.roles.new=Nauja rolė PageAdmin.menu.top.roles=Rolės -PageAdmin.menu.top.serverTasks.list=Užduočių sąrašas +PageAdmin.menu.top.serverTasks.list=All tasks PageAdmin.menu.top.serverTasks.new=Nauja užduotis PageAdmin.menu.top.serverTasks=Serverio užduotys PageAdmin.menu.top.users.find=Naudotojų paieška -PageAdmin.menu.top.users.list=Naudotojų sąrašas +PageAdmin.menu.top.users.list=Visi naudotojai PageAdmin.menu.top.users.new=Naujas naudotojas PageAdmin.menu.top.users.org.new=Nauja organizacija PageAdmin.menu.top.users.org=Org. struktūra @@ -1242,7 +1242,7 @@ pageAdmin.resources.description=Sujungtos sistemos pageAdminResources.detailsResource=Išsami informacija apie resursą pageAdminResources.editResource=Redaguoti resursą pageAdminResources.importResource=Importuoti resursą -pageAdminResources.listResources=Resursų sąrašas +pageAdminResources.listResources=All resources pageAdminResources.message.cantLoadResource=Negalima įkelti detalios informacijos apie resursą. pageAdminResources.newResource=Naujas resursas pageAdmin.resources=Resursai @@ -2075,7 +2075,7 @@ pageServices.message.confirmationMessageForSingleObject.members=Ar tikrai norite pageRoles.message.nothingSelected=Rolė nepasirinkta. pageRoles.message.queryError=Klaida, perkeliant paieškos užklausą į filtrą. pageRoles.requestable=Prašomas -PageRoles.title=Rolių sąrašas +PageRoles.title=Visos rolės pageSecurityQuestions.message.WrongAnswer=Klausimai atsakyti neteisingai pageSecurityQuestions.message.noPolicySet=Nenustatyta slaptažodžio politika PageSecurityQuestions.title=Saugos klausimai @@ -2350,7 +2350,7 @@ pageTasks.message.noTaskSelected=Nepasirinkta užduotis. pageTasks.node.clustered=Klasterizuota pageTasks.node.executionStatus=Statusas pageTasks.node.lastCheckInTime=Paskutinis prisijungimas -pageTasks.node.managementPort=Valdymo prievadas +pageTasks.node.contact=Contact pageTasks.node.name=Pavadinimas pageTasks.nodes=Mazgai pageTasks.node.statusMessage=Būsenos žinutė @@ -2496,7 +2496,7 @@ pageCases.table.openTimestamp=Atidaryta pageCases.table.closeTimestamp=Uždaryta pageCases.button.delete=Ištrinti PageCasesAllocatedToMe.title=Mano atvejai -PageCasesAll.title=Atvejų sąrašas +PageCasesAll.title=All Cases MultipleAssignmentSelectorPanel.availableRoles=Galimos rolės MultipleAssignmentSelectorPanel.parameters=Nustatymai MultipleAssignmentSelectorPanel.currentRoles=Esamos rolės @@ -2506,7 +2506,7 @@ MultipleAssignmentSelector.orgUnit=Org. vienetas AssignmentPopup.addButtonTitle=Prašome pasirinkti bent 1 objektą pageValuePolicies.table.description=Aprašymas pageValuePolicies.button.delete=Ištrinti -PageValuePolicies.title=Pateikti reikšmių taisykles +PageValuePolicies.title=All value policies PageValuePolicy.title = Reikšmių politika PageValuePolicy.button.back=Atgal PageValuePolicy.button.save=Išsaugoti @@ -3599,7 +3599,7 @@ autoRefreshPanel.pauseRefreshing=Sustabdyti atnaujinimą autoRefreshPanel.refreshingEach=Atnaujinti kas {0} sekundžių autoRefreshPanel.noRefreshing=(neatnaujinama) PageAdmin.menu.top.services=Paslaugos -PageAdmin.menu.top.services.list=Paslaugų sąrašas +PageAdmin.menu.top.services.list=All services PageAdmin.menu.top.services.new=Nauja paslauga PageAdmin.menu.top.services.edit=Redaguoti paslaugą taskShowAdvancedFeaturesPanel.label=Rodyti papildomas funkcijas @@ -4220,6 +4220,7 @@ chooseFocusTypeAndRelationDialogPanel.relation=Santykis: chooseFocusTypeAndRelationDialogPanel.type=Tipas chooseFocusTypeAndRelationDialogPanel.tooltip.type=Objekto tipas į kurį priskyrimas išeina abstractRoleMemberPanel.menu.assign=Priskirti +abstractRoleMemberPanel.menu.assignMember=Assign member abstractRoleMemberPanel.menu.unassign=Pašalinti abstractRoleMemberPanel.menu.recompute=Perskaičiuoti abstractRoleMemberPanel.menu.create=Sukurti diff --git a/gui/admin-gui/src/main/resources/localization/Midpoint_pl.properties b/gui/admin-gui/src/main/resources/localization/Midpoint_pl.properties index 0360acbbcc9..e7c6db012f3 100644 --- a/gui/admin-gui/src/main/resources/localization/Midpoint_pl.properties +++ b/gui/admin-gui/src/main/resources/localization/Midpoint_pl.properties @@ -693,7 +693,7 @@ ObjectTypeGuiDescriptor.case=Przypadek ObjectTypeGuiDescriptor.valuePolicy=Polityka wartości ObjectTypeGuiDescriptor.functionLibrary=Biblioteka funkcji ObjectTypeGuiDescriptor.objectCollection=Kolekcja obiektów -ObjectTypeGuiDescriptor.archetype=Archetype +ObjectTypeGuiDescriptor.archetype=Archetyp ObjectTypeGuiDescriptor.unknown=Niezdefiniowany operation.com.evolveum.midpoint.common.crypto.CryptoUtil.securitySelfTest=Autotest bezpieczeństwa operation.com.evolveum.midpoint.common.operation.import.object=Import obiektu @@ -1118,28 +1118,28 @@ PageAdmin.menu.top.configuration.notifications=Powiadomienia PageAdmin.menu.top.configuration.profiling=Profilowanie PageAdmin.menu.top.configuration.adminGui=GUI Administratora PageAdmin.menu.top.configuration.repositoryObjects=Obiekty repozytorium -PageAdmin.menu.top.configuration.repositoryObjectsList=Lista obiektów +PageAdmin.menu.top.configuration.repositoryObjectsList=Wszystkie obiekty PageAdmin.menu.top.configuration.security=Bezpieczeństwo PageAdmin.menu.top.home=Strona domowa PageAdmin.menu.top.reports.created=Utworzone raporty -PageAdmin.menu.top.reports.list=Lista raportów +PageAdmin.menu.top.reports.list=Wszystkie raporty PageAdmin.menu.top.reports.new=Import Jasper Reports PageAdmin.menu.top.reports=Raporty PageAdmin.menu.top.resources.import=Import definicji systemu -PageAdmin.menu.top.resources.list=Lista systemów +PageAdmin.menu.top.resources.list=Wszystkie systemy PageAdmin.menu.top.resources.new=Nowy system PageAdmin.menu.top.resources.view=Podgląd systemu PageAdmin.menu.top.resources.edit=Edycja systemu PageAdmin.menu.top.resources=Systemy -PageAdmin.menu.top.connectorHosts.list=Lista hostów konektorów -PageAdmin.menu.top.roles.list=Lista ról +PageAdmin.menu.top.connectorHosts.list=Wszystkie hosty konetktorów +PageAdmin.menu.top.roles.list=Wszystkie role PageAdmin.menu.top.roles.new=Nowa rola PageAdmin.menu.top.roles=Role -PageAdmin.menu.top.serverTasks.list=Lista zadań +PageAdmin.menu.top.serverTasks.list=Wszystkie zadania PageAdmin.menu.top.serverTasks.new=Nowe zadanie PageAdmin.menu.top.serverTasks=Zadania serwera PageAdmin.menu.top.users.find=Znajdź użytkowników -PageAdmin.menu.top.users.list=Lista użytkowników +PageAdmin.menu.top.users.list=Wszyscy użytkownicy PageAdmin.menu.top.users.new=Nowy użytkownik PageAdmin.menu.top.users.org.new=Nowa organizacja PageAdmin.menu.top.users.org=Struktura org. @@ -1242,7 +1242,7 @@ pageAdmin.resources.description=Podłączone systemy pageAdminResources.detailsResource=Szczegóły systemu pageAdminResources.editResource=Edycja systemu pageAdminResources.importResource=Import systemu -pageAdminResources.listResources=Lista systemów +pageAdminResources.listResources=Wszystkie systemy pageAdminResources.message.cantLoadResource=Nie można wczytać szczegółów systemu. pageAdminResources.newResource=Nowy system pageAdmin.resources=Systemy @@ -2064,18 +2064,18 @@ PageRoleEditor.title.inducements=Dziedziczenia PageRoleEditor.title.newRole=Utwórz pageRoles.button.delete=Usuń pageRoles.dialog.title.confirmDelete=Potwierdź usunięcie -pageRoles.message.confirmationMessageForMultipleObject=Naprawdę chcesz {0} zaznaczonych {1} ról? -pageRoles.message.confirmationMessageForSingleObject=Naprawdę chcesz {0} rolę '{1}'? -pageRoles.message.confirmationMessageForMultipleObject.members=Naprawdę chcesz {0} zaznaczone {1} rolę (role)? Niektóre z nich posiadają członka (członków). -pageRoles.message.confirmationMessageForSingleObject.members=Naprawdę chcesz {0} rolę {1}? Zaznaczona rola posiada członka (członków). -pageServices.message.confirmationMessageForMultipleObject=Naprawdę chcesz {0} zaznaczonych {1} usług(ę)? -pageServices.message.confirmationMessageForSingleObject=Naprawdę chcesz {0} usługę '{1}'? -pageServices.message.confirmationMessageForMultipleObject.members=Naprawdę chcesz {0} wybrane {1} usług(i)? Niektóre z nich posiadają członków. -pageServices.message.confirmationMessageForSingleObject.members=Naprawdę chcesz {0} usługę '{1}'? Wybrana usługa posiada członków. +pageRoles.message.confirmationMessageForMultipleObject=Potwierdź operację: {0} zaznaczonych {1} ról. +pageRoles.message.confirmationMessageForSingleObject=Potwierdź operację: {0} rolę '{1}'. +pageRoles.message.confirmationMessageForMultipleObject.members=Potwierdź operację: {0} zaznaczone {1} rolę (role). Niektóre z nich posiadają członka (członków). +pageRoles.message.confirmationMessageForSingleObject.members=Potwierdź operację: {0} rolę {1}. Zaznaczona rola posiada członka (członków). +pageServices.message.confirmationMessageForMultipleObject=Potwierdź operację: {0} zaznaczonych {1} usług(ę). +pageServices.message.confirmationMessageForSingleObject=Potwierdź operację: {0} usługę '{1}'. +pageServices.message.confirmationMessageForMultipleObject.members=Potwierdź operację: {0} wybrane {1} usług(i). Niektóre z nich posiadają członków. +pageServices.message.confirmationMessageForSingleObject.members=Potwierdź operację: {0} usługę '{1}'. Wybrana usługa posiada członków. pageRoles.message.nothingSelected=Nie zaznaczono żadnej roli. pageRoles.message.queryError=Wystąpił błąd podczas tłumaczenia zapytania do filtra. pageRoles.requestable=Wnioskowalne -PageRoles.title=Lista ról +PageRoles.title=Wszystkie role pageSecurityQuestions.message.WrongAnswer=Nie odpowiedziano poprawnie na pytania pageSecurityQuestions.message.noPolicySet=Brak ustawionej polityki hasła PageSecurityQuestions.title=Pytania zabezpieczające @@ -2319,10 +2319,10 @@ pageTasks.message.deleteWorkersAndWorkState.fatalError=Nie można usunąć praco pageTasks.message.getLastCheckInTime={0} temu pageTasks.message.startSchedulerAction=uruchom harmonogram dla pageTasks.message.stopSchedulerTasksAction=zatrzymaj harmonogram+zadania dla -pageTasks.message.confirmationMessageForSingleTaskObject=Naprawdę chcesz {0} zadanie '{1}'? -pageTasks.message.confirmationMessageForMultipleTaskObject=Naprawdę chcesz {0} zaznaczonych {1} zadań? -pageTasks.message.confirmationMessageForSingleNodeObject=Naprawdę chcesz {0} noda '{1}'? -pageTasks.message.confirmationMessageForMultipleNodeObject=Naprawdę chcesz {0} zaznaczonych {1} nod(ów)? +pageTasks.message.confirmationMessageForSingleTaskObject=Potwierdź operację: {0} zadanie '{1}'. +pageTasks.message.confirmationMessageForMultipleTaskObject=Potwierdź operację: {0} zaznaczonych {1} zadań. +pageTasks.message.confirmationMessageForSingleNodeObject=Potwierdź operację: {0} noda '{1}'. +pageTasks.message.confirmationMessageForMultipleNodeObject=Potwierdź operację: {0} zaznaczonych {1} nod(ów). pageTasks.message.resumeTasksPerformed.success=Zadanie(a) zostało(y) poprawnie wznowione. pageTasks.message.resumeTasksPerformed.fatalError=Nie można wznowić zadania (zadań) pageTasks.message.synchronizeTasksPerformed.fatalError=Nie można zsynchronizować zadań @@ -2350,7 +2350,7 @@ pageTasks.message.noTaskSelected=Nie wybrano zadań. pageTasks.node.clustered=Sklastrowany pageTasks.node.executionStatus=Status pageTasks.node.lastCheckInTime=Ostatnie sprawdzenie -pageTasks.node.managementPort=Port do zarządzania +pageTasks.node.contact=Kontakt pageTasks.node.name=Nazwa pageTasks.nodes=Nody pageTasks.node.statusMessage=Informacja o statusie @@ -2435,8 +2435,8 @@ pageUsers.menu.reconcile=Rekoncyliacja pageUsers.menu.unlock=Odblokuj pageUsers.message.deleteUserConfirm=Naprawdę chcesz usunąć {0} zaznaczonych użytkowników? pageUsers.message.deleteUserConfirmSingle=Naprawdę chcesz usunąć użytkownika '{0}'? -pageUsers.message.confirmationMessageForSingleObject=Naprawdę chcesz {0} użytkownika '{1}'? -pageUsers.message.confirmationMessageForMultipleObject=Naprawdę chcesz {0} zaznaczonych {1} użytkownik(ów)? +pageUsers.message.confirmationMessageForSingleObject=Potwierdź operację: {0} użytkownika '{1}'. +pageUsers.message.confirmationMessageForMultipleObject=Potwierdź operację: {0} zaznaczonych {1} użytkownik(ów). pageUsers.message.enableAction=aktywować pageUsers.message.disableAction=zablokować pageUsers.message.reconcileAction=rekoncyliacja @@ -2496,7 +2496,7 @@ pageCases.table.openTimestamp=Otwarte pageCases.table.closeTimestamp=Zamknięty pageCases.button.delete=Usuń PageCasesAllocatedToMe.title=Moje przypadki -PageCasesAll.title=Lista przypadków +PageCasesAll.title=Wszystkie przypadki MultipleAssignmentSelectorPanel.availableRoles=Dostępne role MultipleAssignmentSelectorPanel.parameters=Parametry MultipleAssignmentSelectorPanel.currentRoles=Bieżące role @@ -2506,7 +2506,7 @@ MultipleAssignmentSelector.orgUnit=Jednostka organizacyjna AssignmentPopup.addButtonTitle=Wybierz proszę co najmniej 1 obiekt pageValuePolicies.table.description=Opis pageValuePolicies.button.delete=Usuń -PageValuePolicies.title=Lista polityki wartości +PageValuePolicies.title=Wszystkie polityki wartości PageValuePolicy.title = Polityka wartości PageValuePolicy.button.back=Wstecz PageValuePolicy.button.save=Zapisz @@ -3599,7 +3599,7 @@ autoRefreshPanel.pauseRefreshing=Zatrzymaj odświeżanie autoRefreshPanel.refreshingEach=Odświeżanie co {0} s. autoRefreshPanel.noRefreshing=(brak odświeżania) PageAdmin.menu.top.services=Usługi -PageAdmin.menu.top.services.list=Lista usług +PageAdmin.menu.top.services.list=Wszystkie usługi PageAdmin.menu.top.services.new=Nowa usługa PageAdmin.menu.top.services.edit=Edycja usługi taskShowAdvancedFeaturesPanel.label=Pokaż zaawansowane funkcje @@ -3629,8 +3629,8 @@ TaskDto.changesRejected=Odrzucone zmiany TaskDto.changesCanceled=Zmiany anulowane PageServices.title=Lista usług PageServices.message.deleteServicesConfirm=Naprawdę chcesz usunąć {0} zaznaczonych usług? -PageServices.message.confirmationMessageForMultipleObject=Naprawdę chcesz {0} zaznaczonych {1} usług(ę)? -PageServices.message.confirmationMessageForSingleObject=Naprawdę chcesz {0} usługę '{1}'? +PageServices.message.confirmationMessageForMultipleObject=Potwierdź operację: {0} zaznaczonych {1} usług(ę). +PageServices.message.confirmationMessageForSingleObject=Potwierdź operację: {0} usługę '{1}'. PageServices.message.nothingSelected=Nie wybrano usługi. PageServices.message.buttonDelete=Usuń LiveSyncHandlerPanel.deleteToken=Usuń token @@ -4220,6 +4220,7 @@ chooseFocusTypeAndRelationDialogPanel.relation=Relacja: chooseFocusTypeAndRelationDialogPanel.type=Typ chooseFocusTypeAndRelationDialogPanel.tooltip.type=Typ obiektu do którego istnieje przypisanie abstractRoleMemberPanel.menu.assign=Przypisz +abstractRoleMemberPanel.menu.assignMember=Przypisz członka abstractRoleMemberPanel.menu.unassign=Cofnij przypisanie abstractRoleMemberPanel.menu.recompute=Przelicz abstractRoleMemberPanel.menu.create=Utwórz diff --git a/gui/admin-gui/src/main/resources/localization/Midpoint_pt_BR.properties b/gui/admin-gui/src/main/resources/localization/Midpoint_pt_BR.properties index 9c075e05b6e..cf8a2bc83ed 100644 --- a/gui/admin-gui/src/main/resources/localization/Midpoint_pt_BR.properties +++ b/gui/admin-gui/src/main/resources/localization/Midpoint_pt_BR.properties @@ -1118,28 +1118,28 @@ PageAdmin.menu.top.configuration.notifications=Notificações PageAdmin.menu.top.configuration.profiling=Conf. Perfil PageAdmin.menu.top.configuration.adminGui=Admin GUI PageAdmin.menu.top.configuration.repositoryObjects=Objetos de repositório -PageAdmin.menu.top.configuration.repositoryObjectsList=List objects +PageAdmin.menu.top.configuration.repositoryObjectsList=All objects PageAdmin.menu.top.configuration.security=Segurança PageAdmin.menu.top.home=Início PageAdmin.menu.top.reports.created=Relatórios criados -PageAdmin.menu.top.reports.list=Listar relatórios +PageAdmin.menu.top.reports.list=All reports PageAdmin.menu.top.reports.new=Importar relatório Jasper PageAdmin.menu.top.reports=Relatórios PageAdmin.menu.top.resources.import=Importar definição de recurso -PageAdmin.menu.top.resources.list=Listar recursos +PageAdmin.menu.top.resources.list=All resources PageAdmin.menu.top.resources.new=Novo recurso PageAdmin.menu.top.resources.view=Ver recurso PageAdmin.menu.top.resources.edit=Editar recurso PageAdmin.menu.top.resources=Recursos -PageAdmin.menu.top.connectorHosts.list=Listar 'hosts' de conectores -PageAdmin.menu.top.roles.list=Listar perfis +PageAdmin.menu.top.connectorHosts.list=All connector hosts +PageAdmin.menu.top.roles.list=Todos perfis PageAdmin.menu.top.roles.new=Novo perfil PageAdmin.menu.top.roles=Perfis -PageAdmin.menu.top.serverTasks.list=Listar tarefas +PageAdmin.menu.top.serverTasks.list=All tasks PageAdmin.menu.top.serverTasks.new=Nova tarefa PageAdmin.menu.top.serverTasks=Tarefas de servidor PageAdmin.menu.top.users.find=Encontrar usuários -PageAdmin.menu.top.users.list=Listar usuários +PageAdmin.menu.top.users.list=Todos usuários PageAdmin.menu.top.users.new=Novo usuário PageAdmin.menu.top.users.org.new=Nova organização PageAdmin.menu.top.users.org=Estrutura org. @@ -1242,7 +1242,7 @@ pageAdmin.resources.description=Sistemas conectados pageAdminResources.detailsResource=Detalhes de recurso pageAdminResources.editResource=Editar recurso pageAdminResources.importResource=Importar recurso -pageAdminResources.listResources=Listar recurso +pageAdminResources.listResources=All resources pageAdminResources.message.cantLoadResource=Não foi possível carregar detalhes do recurso. pageAdminResources.newResource=Novo recurso pageAdmin.resources=Recursos @@ -2075,7 +2075,7 @@ pageServices.message.confirmationMessageForSingleObject.members=Do you really wa pageRoles.message.nothingSelected=Nenhum perfil selecionado. pageRoles.message.queryError=Ocorreu um erro durante a pesquisa de tradução a filtrar. pageRoles.requestable=Requisitável -PageRoles.title=Listar perfis +PageRoles.title=Todos perfis pageSecurityQuestions.message.WrongAnswer=Questões não foram respondidas corretamente pageSecurityQuestions.message.noPolicySet=Nenhuma politica de senha habilitada PageSecurityQuestions.title=Questões de segurança @@ -2350,7 +2350,7 @@ pageTasks.message.noTaskSelected=Nenhuma tarefa selecionada. pageTasks.node.clustered=Agrupado pageTasks.node.executionStatus=Status pageTasks.node.lastCheckInTime=Último horário de check-in -pageTasks.node.managementPort=Porta de gerenciamento +pageTasks.node.contact=Contact pageTasks.node.name=Nome pageTasks.nodes=Nós pageTasks.node.statusMessage=Mensagem de status @@ -2496,7 +2496,7 @@ pageCases.table.openTimestamp=Opened pageCases.table.closeTimestamp=Fechado pageCases.button.delete=Deletar PageCasesAllocatedToMe.title=My Cases -PageCasesAll.title=List Cases +PageCasesAll.title=All Cases MultipleAssignmentSelectorPanel.availableRoles=Perfis disponíveis MultipleAssignmentSelectorPanel.parameters=Parâmetros MultipleAssignmentSelectorPanel.currentRoles=Perfis atuais @@ -2506,7 +2506,7 @@ MultipleAssignmentSelector.orgUnit=Unid. org. AssignmentPopup.addButtonTitle=Please, select at least 1 object pageValuePolicies.table.description=Descrição pageValuePolicies.button.delete=Deletar -PageValuePolicies.title=List value policies +PageValuePolicies.title=All value policies PageValuePolicy.title = Política de valor PageValuePolicy.button.back=Voltar PageValuePolicy.button.save=Salvar @@ -3599,7 +3599,7 @@ autoRefreshPanel.pauseRefreshing=Pausar atualização autoRefreshPanel.refreshingEach=Atualizar a cada {0} seg autoRefreshPanel.noRefreshing=(nenhuma atualização) PageAdmin.menu.top.services=Serviços -PageAdmin.menu.top.services.list=Listar serviços +PageAdmin.menu.top.services.list=All services PageAdmin.menu.top.services.new=Novo serviço PageAdmin.menu.top.services.edit=Editar serviço taskShowAdvancedFeaturesPanel.label=Mostrar caract. avançadas @@ -4220,6 +4220,7 @@ chooseFocusTypeAndRelationDialogPanel.relation=Relation: chooseFocusTypeAndRelationDialogPanel.type=Tipo chooseFocusTypeAndRelationDialogPanel.tooltip.type=Type of the object to which the assignment exits abstractRoleMemberPanel.menu.assign=Atribuir +abstractRoleMemberPanel.menu.assignMember=Assign member abstractRoleMemberPanel.menu.unassign=Remover atribuição abstractRoleMemberPanel.menu.recompute=Recomputar abstractRoleMemberPanel.menu.create=Criar diff --git a/gui/admin-gui/src/main/resources/localization/Midpoint_ru.properties b/gui/admin-gui/src/main/resources/localization/Midpoint_ru.properties index bf04cfc0dd4..d9c1a5a17dc 100644 --- a/gui/admin-gui/src/main/resources/localization/Midpoint_ru.properties +++ b/gui/admin-gui/src/main/resources/localization/Midpoint_ru.properties @@ -1118,28 +1118,28 @@ PageAdmin.menu.top.configuration.notifications=Уведомления PageAdmin.menu.top.configuration.profiling=Профилирование PageAdmin.menu.top.configuration.adminGui=Интерфейс администратора PageAdmin.menu.top.configuration.repositoryObjects=Объекты в репозитории -PageAdmin.menu.top.configuration.repositoryObjectsList=List objects +PageAdmin.menu.top.configuration.repositoryObjectsList=All objects PageAdmin.menu.top.configuration.security=Безопасность PageAdmin.menu.top.home=Главная PageAdmin.menu.top.reports.created=Созданные отчеты -PageAdmin.menu.top.reports.list=Список отчетов +PageAdmin.menu.top.reports.list=All reports PageAdmin.menu.top.reports.new=Импорт отчета Jasper PageAdmin.menu.top.reports=Отчеты PageAdmin.menu.top.resources.import=Импорт описания ресурса -PageAdmin.menu.top.resources.list=Список ресурсов +PageAdmin.menu.top.resources.list=All resources PageAdmin.menu.top.resources.new=Создать ресурс PageAdmin.menu.top.resources.view=Просмотр ресурса PageAdmin.menu.top.resources.edit=Изменить ресурс PageAdmin.menu.top.resources=Ресурсы -PageAdmin.menu.top.connectorHosts.list=Список хостов коннектора -PageAdmin.menu.top.roles.list=Список ролей +PageAdmin.menu.top.connectorHosts.list=All connector hosts +PageAdmin.menu.top.roles.list=Все роли PageAdmin.menu.top.roles.new=Создать роль PageAdmin.menu.top.roles=Роли -PageAdmin.menu.top.serverTasks.list=Список задач +PageAdmin.menu.top.serverTasks.list=All tasks PageAdmin.menu.top.serverTasks.new=Создать задачу PageAdmin.menu.top.serverTasks=Задачи сервера PageAdmin.menu.top.users.find=Поиск пользователей -PageAdmin.menu.top.users.list=Список пользователей +PageAdmin.menu.top.users.list=Все пользователи PageAdmin.menu.top.users.new=Создать пользователя PageAdmin.menu.top.users.org.new=Создать организацию PageAdmin.menu.top.users.org=Оргструктура @@ -1242,7 +1242,7 @@ pageAdmin.resources.description=Связанные системы pageAdminResources.detailsResource=Подробная информация ресурса pageAdminResources.editResource=Изменить ресурс pageAdminResources.importResource=Импорт ресурса -pageAdminResources.listResources=Список ресурсов +pageAdminResources.listResources=All resources pageAdminResources.message.cantLoadResource=Невозможно загрузить сведения ресурса. pageAdminResources.newResource=Создать ресурс pageAdmin.resources=Ресурсы @@ -2075,7 +2075,7 @@ pageServices.message.confirmationMessageForSingleObject.members=Do you really wa pageRoles.message.nothingSelected=Роль не выбрана. pageRoles.message.queryError=Ошибка обработки результата поискового запроса фильтром pageRoles.requestable=Доступно для запросов -PageRoles.title=Список ролей +PageRoles.title=Все роли pageSecurityQuestions.message.WrongAnswer=Вопросы без правильного ответа pageSecurityQuestions.message.noPolicySet=Не определена парольная политика PageSecurityQuestions.title=Контрольные вопросы @@ -2350,7 +2350,7 @@ pageTasks.message.noTaskSelected=Задачи не выбраны. pageTasks.node.clustered=Кластеризовано pageTasks.node.executionStatus=Статус pageTasks.node.lastCheckInTime=Время последнего входа -pageTasks.node.managementPort=Порт управления +pageTasks.node.contact=Contact pageTasks.node.name=Наименование pageTasks.nodes=Узлы pageTasks.node.statusMessage=Статус сообщения @@ -2496,7 +2496,7 @@ pageCases.table.openTimestamp=Opened pageCases.table.closeTimestamp=Закрыто pageCases.button.delete=Удалить PageCasesAllocatedToMe.title=My Cases -PageCasesAll.title=List Cases +PageCasesAll.title=All Cases MultipleAssignmentSelectorPanel.availableRoles=Доступные роли MultipleAssignmentSelectorPanel.parameters=Параметры MultipleAssignmentSelectorPanel.currentRoles=Текущие роли @@ -2506,7 +2506,7 @@ MultipleAssignmentSelector.orgUnit=Организационное подразд AssignmentPopup.addButtonTitle=Please, select at least 1 object pageValuePolicies.table.description=Описание pageValuePolicies.button.delete=Удалить -PageValuePolicies.title=List value policies +PageValuePolicies.title=All value policies PageValuePolicy.title = Значение политики PageValuePolicy.button.back=Назад PageValuePolicy.button.save=Сохранить @@ -3599,7 +3599,7 @@ autoRefreshPanel.pauseRefreshing=Обновление паузы autoRefreshPanel.refreshingEach=Обновляется каждые {0} сек. autoRefreshPanel.noRefreshing=(нет обновлений) PageAdmin.menu.top.services=Сервисы -PageAdmin.menu.top.services.list=Список сервисов +PageAdmin.menu.top.services.list=All services PageAdmin.menu.top.services.new=Новый сервис PageAdmin.menu.top.services.edit=Редактировать сервис taskShowAdvancedFeaturesPanel.label=Показать дополнительные характеристики @@ -4220,6 +4220,7 @@ chooseFocusTypeAndRelationDialogPanel.relation=Relation: chooseFocusTypeAndRelationDialogPanel.type=Тип chooseFocusTypeAndRelationDialogPanel.tooltip.type=Type of the object to which the assignment exits abstractRoleMemberPanel.menu.assign=Назначить +abstractRoleMemberPanel.menu.assignMember=Assign member abstractRoleMemberPanel.menu.unassign=Снять назначение abstractRoleMemberPanel.menu.recompute=Проанализировать заново abstractRoleMemberPanel.menu.create=Создать diff --git a/gui/admin-gui/src/main/resources/localization/Midpoint_sk.properties b/gui/admin-gui/src/main/resources/localization/Midpoint_sk.properties index a8ae2b35d52..bda4b658de1 100644 --- a/gui/admin-gui/src/main/resources/localization/Midpoint_sk.properties +++ b/gui/admin-gui/src/main/resources/localization/Midpoint_sk.properties @@ -1118,28 +1118,28 @@ PageAdmin.menu.top.configuration.notifications=Notifikácie PageAdmin.menu.top.configuration.profiling=Profilovanie PageAdmin.menu.top.configuration.adminGui=Administrátorské rozhranie PageAdmin.menu.top.configuration.repositoryObjects=Objekty repozitára -PageAdmin.menu.top.configuration.repositoryObjectsList=List objects +PageAdmin.menu.top.configuration.repositoryObjectsList=All objects PageAdmin.menu.top.configuration.security=Zabezpečenie PageAdmin.menu.top.home=Domov PageAdmin.menu.top.reports.created=Vytvorené reporty -PageAdmin.menu.top.reports.list=Zoznam reportov +PageAdmin.menu.top.reports.list=All reports PageAdmin.menu.top.reports.new=Importovať definíciu reportu PageAdmin.menu.top.reports=Reporty PageAdmin.menu.top.resources.import=Importovať definíciu systému -PageAdmin.menu.top.resources.list=Zoznam koncových systémov +PageAdmin.menu.top.resources.list=All resources PageAdmin.menu.top.resources.new=Nový koncový systém PageAdmin.menu.top.resources.view=Zobraziť koncový systém PageAdmin.menu.top.resources.edit=Editovať koncový systém PageAdmin.menu.top.resources=Koncové systémy -PageAdmin.menu.top.connectorHosts.list=Zoznam hostiteľov konektorov -PageAdmin.menu.top.roles.list=Zoznam rolí +PageAdmin.menu.top.connectorHosts.list=All connector hosts +PageAdmin.menu.top.roles.list=Všetky roly PageAdmin.menu.top.roles.new=Nová rola PageAdmin.menu.top.roles=Roly -PageAdmin.menu.top.serverTasks.list=Zoznam úloh +PageAdmin.menu.top.serverTasks.list=All tasks PageAdmin.menu.top.serverTasks.new=Nová úloha PageAdmin.menu.top.serverTasks=Serverové úlohy PageAdmin.menu.top.users.find=Nájsť používateľov -PageAdmin.menu.top.users.list=Zoznam používateľov +PageAdmin.menu.top.users.list=All users PageAdmin.menu.top.users.new=Nový používateľ PageAdmin.menu.top.users.org.new=Nová organizácia PageAdmin.menu.top.users.org=Org. štruktúra @@ -1242,7 +1242,7 @@ pageAdmin.resources.description=Pripojené systémy pageAdminResources.detailsResource=Detaily systému pageAdminResources.editResource=Editovať systém pageAdminResources.importResource=Importovať zo systému -pageAdminResources.listResources=Zoznam systémov +pageAdminResources.listResources=All resources pageAdminResources.message.cantLoadResource=Nepodarilo sa načítať detaily koncového systému. pageAdminResources.newResource=Nový systém pageAdmin.resources=Systémy @@ -2075,7 +2075,7 @@ pageServices.message.confirmationMessageForSingleObject.members=Do you really wa pageRoles.message.nothingSelected=Nebola vybratá rola. pageRoles.message.queryError=Nastala chyba pri prekladaní dotazu na filter do databázy. pageRoles.requestable=Požadovateľné -PageRoles.title=Zoznam rolí +PageRoles.title=Všetky roly pageSecurityQuestions.message.WrongAnswer=Otázky neboli zodpovedané správne pageSecurityQuestions.message.noPolicySet=No password policy is set PageSecurityQuestions.title=Otázky zabezpečenia @@ -2350,7 +2350,7 @@ pageTasks.message.noTaskSelected=Nebola vybraná žiadna úloha. pageTasks.node.clustered=V klastri pageTasks.node.executionStatus=Stav pageTasks.node.lastCheckInTime=Posledný čas kontroly -pageTasks.node.managementPort=Port na správu +pageTasks.node.contact=Contact pageTasks.node.name=Meno pageTasks.nodes=Uzly pageTasks.node.statusMessage=Stavová správa @@ -2496,7 +2496,7 @@ pageCases.table.openTimestamp=Opened pageCases.table.closeTimestamp=Uzavretý pageCases.button.delete=Zmazanie PageCasesAllocatedToMe.title=My Cases -PageCasesAll.title=List Cases +PageCasesAll.title=All Cases MultipleAssignmentSelectorPanel.availableRoles=Dostupné roly MultipleAssignmentSelectorPanel.parameters=Parametre MultipleAssignmentSelectorPanel.currentRoles=Priradené roly @@ -2506,7 +2506,7 @@ MultipleAssignmentSelector.orgUnit=Org. jednotka AssignmentPopup.addButtonTitle=Please, select at least 1 object pageValuePolicies.table.description=Popis pageValuePolicies.button.delete=Zmazanie -PageValuePolicies.title=List value policies +PageValuePolicies.title=All value policies PageValuePolicy.title = Hodnotová politika PageValuePolicy.button.back=Späť PageValuePolicy.button.save=Uložiť @@ -3599,7 +3599,7 @@ autoRefreshPanel.pauseRefreshing=Pause refreshing autoRefreshPanel.refreshingEach=Refreshing each {0} sec autoRefreshPanel.noRefreshing=(no refreshing) PageAdmin.menu.top.services=Služby -PageAdmin.menu.top.services.list=Zoznam služieb +PageAdmin.menu.top.services.list=All services PageAdmin.menu.top.services.new=Nová služba PageAdmin.menu.top.services.edit=Upraviť službu taskShowAdvancedFeaturesPanel.label=Show advanced features @@ -4220,6 +4220,7 @@ chooseFocusTypeAndRelationDialogPanel.relation=Relation: chooseFocusTypeAndRelationDialogPanel.type=Typ chooseFocusTypeAndRelationDialogPanel.tooltip.type=Type of the object to which the assignment exits abstractRoleMemberPanel.menu.assign=Priradiť +abstractRoleMemberPanel.menu.assignMember=Assign member abstractRoleMemberPanel.menu.unassign=Zrušiť priradenie abstractRoleMemberPanel.menu.recompute=Prepočítanie abstractRoleMemberPanel.menu.create=Vytvoriť diff --git a/gui/admin-gui/src/main/resources/localization/Midpoint_tr.properties b/gui/admin-gui/src/main/resources/localization/Midpoint_tr.properties index 79b9aa2fbfa..d8c7946d607 100644 --- a/gui/admin-gui/src/main/resources/localization/Midpoint_tr.properties +++ b/gui/admin-gui/src/main/resources/localization/Midpoint_tr.properties @@ -1118,28 +1118,28 @@ PageAdmin.menu.top.configuration.notifications=Bildirimler PageAdmin.menu.top.configuration.profiling=Performans profilleme PageAdmin.menu.top.configuration.adminGui=Yönetici Arayüzü PageAdmin.menu.top.configuration.repositoryObjects=Depo nesneleri -PageAdmin.menu.top.configuration.repositoryObjectsList=Nesneleri listele +PageAdmin.menu.top.configuration.repositoryObjectsList=All objects PageAdmin.menu.top.configuration.security=Güvenlik PageAdmin.menu.top.home=Ana Sayfa PageAdmin.menu.top.reports.created=Oluşturulan Raporlar -PageAdmin.menu.top.reports.list=Rapor Listesi +PageAdmin.menu.top.reports.list=All reports PageAdmin.menu.top.reports.new=Rapor tanımını içeri al PageAdmin.menu.top.reports=Raporlar PageAdmin.menu.top.resources.import=Kaynak tanımını içeri al -PageAdmin.menu.top.resources.list=Kaynak Listesi +PageAdmin.menu.top.resources.list=All resources PageAdmin.menu.top.resources.new=Yeni Kaynak PageAdmin.menu.top.resources.view=Kaynağı görüntüle PageAdmin.menu.top.resources.edit=Kaynağı düzenle PageAdmin.menu.top.resources=Kaynaklar -PageAdmin.menu.top.connectorHosts.list=Bağlaycıcı sunucularını listele -PageAdmin.menu.top.roles.list=Rol Listesi +PageAdmin.menu.top.connectorHosts.list=All connector hosts +PageAdmin.menu.top.roles.list=Tüm roller PageAdmin.menu.top.roles.new=Yeni Rol PageAdmin.menu.top.roles=Roller -PageAdmin.menu.top.serverTasks.list=Görev Listesi +PageAdmin.menu.top.serverTasks.list=All tasks PageAdmin.menu.top.serverTasks.new=Yeni Görev PageAdmin.menu.top.serverTasks=Sunucu Görevleri PageAdmin.menu.top.users.find=Kullanıcı Bul -PageAdmin.menu.top.users.list=Kullanıcı listele +PageAdmin.menu.top.users.list=Tüm kullanıcılar PageAdmin.menu.top.users.new=Yeni kullanıcı PageAdmin.menu.top.users.org.new=Yeni organizasyon PageAdmin.menu.top.users.org=Organizasyon Yapısı @@ -1242,7 +1242,7 @@ pageAdmin.resources.description=Bağlanılan sistemler pageAdminResources.detailsResource=Kaynak detayları pageAdminResources.editResource=Kaynak düzenle pageAdminResources.importResource=İçe kaynak aktar -pageAdminResources.listResources=Kaynakları listele +pageAdminResources.listResources=All resources pageAdminResources.message.cantLoadResource=Kaynak detaylarını yüklenemedi. pageAdminResources.newResource=Yeni kaynak. pageAdmin.resources=Kaynaklar @@ -2075,7 +2075,7 @@ pageServices.message.confirmationMessageForSingleObject.members=Do you really wa pageRoles.message.nothingSelected=Hiçbir rol seçilmedi pageRoles.message.queryError=Arama sorgusundan filtreye çevirim yapılırken hata oluştu. pageRoles.requestable=İstenilebilen -PageRoles.title=Roller listesi +PageRoles.title=Tüm roller pageSecurityQuestions.message.WrongAnswer=Soruları Doğru Cevaplamadınız pageSecurityQuestions.message.noPolicySet=Hiçbir şifre politikası belirlenmedi PageSecurityQuestions.title=Güvenlik Soruları @@ -2350,7 +2350,7 @@ pageTasks.message.noTaskSelected=Hiç görev seçilmedi. pageTasks.node.clustered=Kümelenmiş pageTasks.node.executionStatus=Durum pageTasks.node.lastCheckInTime=Son denetleme zamanı -pageTasks.node.managementPort=Yönetim portu +pageTasks.node.contact=Contact pageTasks.node.name=Ad pageTasks.nodes=Düğümler pageTasks.node.statusMessage=Durum mesajı @@ -2496,7 +2496,7 @@ pageCases.table.openTimestamp=Opened pageCases.table.closeTimestamp=Kapalı pageCases.button.delete=Sil PageCasesAllocatedToMe.title=Durumlarım -PageCasesAll.title=Durumları Listele +PageCasesAll.title=All Cases MultipleAssignmentSelectorPanel.availableRoles=Mevcut roller MultipleAssignmentSelectorPanel.parameters=Parametreler MultipleAssignmentSelectorPanel.currentRoles=Mevcut roller @@ -2506,7 +2506,7 @@ MultipleAssignmentSelector.orgUnit=Org. birimi AssignmentPopup.addButtonTitle=Please, select at least 1 object pageValuePolicies.table.description=Açıklama pageValuePolicies.button.delete=Sil -PageValuePolicies.title=Değer politikalarını listele +PageValuePolicies.title=All value policies PageValuePolicy.title = Değer politikası PageValuePolicy.button.back=Geri PageValuePolicy.button.save=Kaydet @@ -3599,7 +3599,7 @@ autoRefreshPanel.pauseRefreshing=Tazelemeyi duraklat autoRefreshPanel.refreshingEach=Her {0} saniyede tazeleme autoRefreshPanel.noRefreshing=(tazeleme olmadan) PageAdmin.menu.top.services=Servisler -PageAdmin.menu.top.services.list=Servisleri listele +PageAdmin.menu.top.services.list=All services PageAdmin.menu.top.services.new=Yeni servis PageAdmin.menu.top.services.edit=Servisi güncelle taskShowAdvancedFeaturesPanel.label=Gelişmiş özellikleri göster @@ -4220,6 +4220,7 @@ chooseFocusTypeAndRelationDialogPanel.relation=Relation: chooseFocusTypeAndRelationDialogPanel.type=Tip chooseFocusTypeAndRelationDialogPanel.tooltip.type=Type of the object to which the assignment exits abstractRoleMemberPanel.menu.assign=Ata +abstractRoleMemberPanel.menu.assignMember=Assign member abstractRoleMemberPanel.menu.unassign=Atama kaldır abstractRoleMemberPanel.menu.recompute=Tekrar hesapla abstractRoleMemberPanel.menu.create=Oluşturma diff --git a/gui/admin-gui/src/main/resources/localization/Midpoint_zh_CN.properties b/gui/admin-gui/src/main/resources/localization/Midpoint_zh_CN.properties index 752ef5b26f9..b56406de289 100644 --- a/gui/admin-gui/src/main/resources/localization/Midpoint_zh_CN.properties +++ b/gui/admin-gui/src/main/resources/localization/Midpoint_zh_CN.properties @@ -1118,28 +1118,28 @@ PageAdmin.menu.top.configuration.notifications=通知 PageAdmin.menu.top.configuration.profiling=分析 PageAdmin.menu.top.configuration.adminGui=管理控制台(GUI) PageAdmin.menu.top.configuration.repositoryObjects=存储库对象 -PageAdmin.menu.top.configuration.repositoryObjectsList=列出对象 +PageAdmin.menu.top.configuration.repositoryObjectsList=All objects PageAdmin.menu.top.configuration.security=安全 PageAdmin.menu.top.home=主页 PageAdmin.menu.top.reports.created=已创建的报表 -PageAdmin.menu.top.reports.list=报表列表 +PageAdmin.menu.top.reports.list=All reports PageAdmin.menu.top.reports.new=导入Jasper报表 PageAdmin.menu.top.reports=报表 PageAdmin.menu.top.resources.import=导入资源定义 -PageAdmin.menu.top.resources.list=列出资源 +PageAdmin.menu.top.resources.list=All resources PageAdmin.menu.top.resources.new=新资源 PageAdmin.menu.top.resources.view=查看资源 PageAdmin.menu.top.resources.edit=编辑资源 PageAdmin.menu.top.resources=资源 -PageAdmin.menu.top.connectorHosts.list=列出连接器主机 -PageAdmin.menu.top.roles.list=角色列表 +PageAdmin.menu.top.connectorHosts.list=All connector hosts +PageAdmin.menu.top.roles.list=所有角色 PageAdmin.menu.top.roles.new=新角色 PageAdmin.menu.top.roles=角色 -PageAdmin.menu.top.serverTasks.list=任务列表 +PageAdmin.menu.top.serverTasks.list=All tasks PageAdmin.menu.top.serverTasks.new=新任务 PageAdmin.menu.top.serverTasks=服务器任务 PageAdmin.menu.top.users.find=查找用户 -PageAdmin.menu.top.users.list=用户列表 +PageAdmin.menu.top.users.list=所有用户 PageAdmin.menu.top.users.new=新用户 PageAdmin.menu.top.users.org.new=新组织 PageAdmin.menu.top.users.org=组织结构 @@ -1242,7 +1242,7 @@ pageAdmin.resources.description=已连接的系统 pageAdminResources.detailsResource=资源详细信息 pageAdminResources.editResource=编辑资源 pageAdminResources.importResource=导入资源 -pageAdminResources.listResources=资源列表 +pageAdminResources.listResources=All resources pageAdminResources.message.cantLoadResource=不能载入资源详细信息。 pageAdminResources.newResource=新资源 pageAdmin.resources=资源 @@ -2075,7 +2075,7 @@ pageServices.message.confirmationMessageForSingleObject.members=Do you really wa pageRoles.message.nothingSelected=没有选择角色。 pageRoles.message.queryError=当转换搜索查询到筛选器时发生错误。 pageRoles.requestable=可请求的 -PageRoles.title=角色列表 +PageRoles.title=所有角色 pageSecurityQuestions.message.WrongAnswer=问题没有回答正确 pageSecurityQuestions.message.noPolicySet=没有设置密码策略 PageSecurityQuestions.title=安全问题 @@ -2350,7 +2350,7 @@ pageTasks.message.noTaskSelected=未选中任务。 pageTasks.node.clustered=集群的 pageTasks.node.executionStatus=状态 pageTasks.node.lastCheckInTime=最后检入时间 -pageTasks.node.managementPort=管理端口 +pageTasks.node.contact=Contact pageTasks.node.name=名称 pageTasks.nodes=节点 pageTasks.node.statusMessage=状态消息 @@ -2496,7 +2496,7 @@ pageCases.table.openTimestamp=Opened pageCases.table.closeTimestamp=已关闭 pageCases.button.delete=删除 PageCasesAllocatedToMe.title=My Cases -PageCasesAll.title=List Cases +PageCasesAll.title=All Cases MultipleAssignmentSelectorPanel.availableRoles=可用的角色 MultipleAssignmentSelectorPanel.parameters=参数 MultipleAssignmentSelectorPanel.currentRoles=当前角色 @@ -2506,7 +2506,7 @@ MultipleAssignmentSelector.orgUnit=组织单元 AssignmentPopup.addButtonTitle=Please, select at least 1 object pageValuePolicies.table.description=描述 pageValuePolicies.button.delete=删除 -PageValuePolicies.title=列出值策略 +PageValuePolicies.title=All value policies PageValuePolicy.title = 值策略 PageValuePolicy.button.back=返回 PageValuePolicy.button.save=保存 @@ -3599,7 +3599,7 @@ autoRefreshPanel.pauseRefreshing=暂停刷新 autoRefreshPanel.refreshingEach=每{0}秒刷新 autoRefreshPanel.noRefreshing=(未刷新) PageAdmin.menu.top.services=服务 -PageAdmin.menu.top.services.list=服务列表 +PageAdmin.menu.top.services.list=All services PageAdmin.menu.top.services.new=新服务 PageAdmin.menu.top.services.edit=编辑服务 taskShowAdvancedFeaturesPanel.label=显示高级特性 @@ -4220,6 +4220,7 @@ chooseFocusTypeAndRelationDialogPanel.relation=Relation: chooseFocusTypeAndRelationDialogPanel.type=类型 chooseFocusTypeAndRelationDialogPanel.tooltip.type=Type of the object to which the assignment exits abstractRoleMemberPanel.menu.assign=分配 +abstractRoleMemberPanel.menu.assignMember=Assign member abstractRoleMemberPanel.menu.unassign=取消分配 abstractRoleMemberPanel.menu.recompute=重算 abstractRoleMemberPanel.menu.create=创建 diff --git a/infra/schema/src/main/resources/localization/schema_cs.properties b/infra/schema/src/main/resources/localization/schema_cs.properties index 35059005f3d..3c3731ffbea 100644 --- a/infra/schema/src/main/resources/localization/schema_cs.properties +++ b/infra/schema/src/main/resources/localization/schema_cs.properties @@ -482,7 +482,7 @@ ObjectType.AccessCertificationCampaignType=Kampaň certifikace přístupů ObjectType.AccessCertificationDefinitionType=Definice certifikace přístupů ObjectType.AccountType=Účet ObjectType.ConnectorType=Konektor -ObjectType.ConnectorHostType=Konektor server +ObjectType.ConnectorHostType=Konektorový server ObjectType.FocusType=Vzorový objekt ObjectType.FormType=Formulář ObjectType.FunctionLibraryType=Knihovna funkcí @@ -514,7 +514,7 @@ ObjectTypeLowercase.AccessCertificationCampaignType=kampaň certifikace přístu ObjectTypeLowercase.AccessCertificationDefinitionType=definice certifikace přístupů ObjectTypeLowercase.AccountType=účet ObjectTypeLowercase.ConnectorType=konektor -ObjectTypeLowercase.ConnectorHostType=hostitel konektoru +ObjectTypeLowercase.ConnectorHostType=konektorový server ObjectTypeLowercase.FocusType=vzorový objekt (fokus) ObjectTypeLowercase.GenericObjectType=generický objekt ObjectTypeLowercase.LookupTableType=překladová tabulka @@ -715,7 +715,7 @@ TaskType.intent=Záměr TaskType.objectClass=Třída objektu TaskType.executionStatus=Stav ObjectTypes.CONNECTOR=Konektor -ObjectTypes.CONNECTOR_HOST=Konektor host +ObjectTypes.CONNECTOR_HOST=Konektorový server ObjectTypes.GENERIC_OBJECT=Obecný objekt ObjectTypes.RESOURCE=Aplikace ObjectTypes.USER=Uživatel diff --git a/infra/schema/src/main/resources/localization/schema_it.properties b/infra/schema/src/main/resources/localization/schema_it.properties index ffc2eb39c9d..d197f4907a6 100644 --- a/infra/schema/src/main/resources/localization/schema_it.properties +++ b/infra/schema/src/main/resources/localization/schema_it.properties @@ -506,8 +506,8 @@ ObjectType.TaskType=Task ObjectType.UserType=Utente ObjectType.ServiceType=Servizio ObjectType.ValuePolicyType=Policy del valore -ObjectType.ArchetypeType=Archetype -ObjectType.AssignmentHolderType=Assignment holder +ObjectType.ArchetypeType=Archetipo +ObjectType.AssignmentHolderType=Titolare dell'assegnazione ObjectType.CaseType=Caso ObjectTypeLowercase.AbstractRoleType=ruolo astratto ObjectTypeLowercase.AccessCertificationCampaignType=Campagna di certificazione degli accessi @@ -1222,8 +1222,8 @@ Channel.INIT=inizializzazione Channel.USER=Utente Channel.SELF_REGISTRATION=Registrazione self-service Channel.RESET_PASSWORD=Reset password -ArchetypePolicyType.objectTemplateRef=Object template reference +ArchetypePolicyType.objectTemplateRef=Riferimento template oggetto ArchetypePolicyType.display=Mostra ArchetypePolicyType.conflictResolution=Conflitti nella risoluzione -ArchetypePolicyType.lifecycleStateModel=Lifecycle state model -ArchetypePolicyType.applicablePolicies=Applicable policies +ArchetypePolicyType.lifecycleStateModel=Modello dello stato del ciclo di vita +ArchetypePolicyType.applicablePolicies=Policy applicabili diff --git a/infra/schema/src/main/resources/localization/schema_pl.properties b/infra/schema/src/main/resources/localization/schema_pl.properties index 5ea5955e83a..bf178056d00 100644 --- a/infra/schema/src/main/resources/localization/schema_pl.properties +++ b/infra/schema/src/main/resources/localization/schema_pl.properties @@ -506,8 +506,8 @@ ObjectType.TaskType=Zadanie ObjectType.UserType=Użytkownik ObjectType.ServiceType=Usługa ObjectType.ValuePolicyType=Polityka wartości -ObjectType.ArchetypeType=Archetype -ObjectType.AssignmentHolderType=Assignment holder +ObjectType.ArchetypeType=Archetyp +ObjectType.AssignmentHolderType=Posiadacz przypisania ObjectType.CaseType=Przypadek ObjectTypeLowercase.AbstractRoleType=rola abstrakcyjna ObjectTypeLowercase.AccessCertificationCampaignType=kampania certyfikacji dostępu @@ -1222,8 +1222,8 @@ Channel.INIT=Inicjalizacja Channel.USER=Użytkownik Channel.SELF_REGISTRATION=Samodzielna rejestracja Channel.RESET_PASSWORD=Reset hasła -ArchetypePolicyType.objectTemplateRef=Object template reference +ArchetypePolicyType.objectTemplateRef=Odniesienie do szablonu obiektu ArchetypePolicyType.display=Wyświetl ArchetypePolicyType.conflictResolution=Rozwiązywanie konfliktów -ArchetypePolicyType.lifecycleStateModel=Lifecycle state model -ArchetypePolicyType.applicablePolicies=Applicable policies +ArchetypePolicyType.lifecycleStateModel=Model stanu cyklu życia +ArchetypePolicyType.applicablePolicies=Możliwe polityki From a1eb2d4111eb012185d68c567c53dc60f14085ec Mon Sep 17 00:00:00 2001 From: Katarina Valalikova Date: Wed, 6 Feb 2019 16:37:59 +0100 Subject: [PATCH 006/224] thresholds improvements, imroving vounter manager implementations, cleanup assignemnt evaluation in different steps -> assignmentCollector. --- .../model/impl/lens/AssignmentCollector.java | 189 +++++++++++++++ .../model/impl/lens/AssignmentEvaluator.java | 5 + .../model/impl/lens/projector/Projector.java | 42 +++- .../projector/SmartAssignmentCollection.java | 15 ++ .../focus/AssignmentTripleEvaluator.java | 33 +++ .../policy/PolicyRuleSuspendTaskExecutor.java | 66 +++-- .../impl/security/UserProfileCompiler.java | 227 ++++++++++-------- .../model/impl/sync/LiveSyncTaskHandler.java | 2 +- .../impl/sync/ReconciliationTaskHandler.java | 35 ++- .../midpoint/repo/common/CounterManager.java | 141 +++++++++-- .../repo/common/CounterSepcification.java | 37 ++- .../AbstractSearchIterativeTaskHandler.java | 2 +- .../story/src/test/resources/logback-test.xml | 5 + .../role-policy-rule-change-activation.xml | 4 +- .../thresholds/role-policy-rule-create.xml | 8 +- 15 files changed, 642 insertions(+), 169 deletions(-) create mode 100644 model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/AssignmentCollector.java diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/AssignmentCollector.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/AssignmentCollector.java new file mode 100644 index 00000000000..befbeba942e --- /dev/null +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/AssignmentCollector.java @@ -0,0 +1,189 @@ +/* + * Copyright (c) 2010-2018 Evolveum + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.evolveum.midpoint.model.impl.lens; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Component; + +import com.evolveum.midpoint.common.ActivationComputer; +import com.evolveum.midpoint.common.Clock; +import com.evolveum.midpoint.model.api.authentication.MidPointUserProfilePrincipal; +import com.evolveum.midpoint.model.api.context.EvaluatedAssignment; +import com.evolveum.midpoint.model.api.context.EvaluatedAssignmentTarget; +import com.evolveum.midpoint.model.api.util.DeputyUtils; +import com.evolveum.midpoint.model.api.util.ModelUtils; +import com.evolveum.midpoint.model.common.SystemObjectCache; +import com.evolveum.midpoint.model.common.mapping.MappingFactory; +import com.evolveum.midpoint.model.impl.lens.projector.MappingEvaluator; +import com.evolveum.midpoint.prism.PrismContainerDefinition; +import com.evolveum.midpoint.prism.PrismContainerValue; +import com.evolveum.midpoint.prism.PrismContext; +import com.evolveum.midpoint.prism.PrismObject; +import com.evolveum.midpoint.prism.delta.PlusMinusZero; +import com.evolveum.midpoint.prism.util.ItemDeltaItem; +import com.evolveum.midpoint.prism.util.ObjectDeltaObject; +import com.evolveum.midpoint.repo.api.RepositoryService; +import com.evolveum.midpoint.repo.cache.RepositoryCache; +import com.evolveum.midpoint.repo.common.ObjectResolver; +import com.evolveum.midpoint.schema.RelationRegistry; +import com.evolveum.midpoint.schema.result.OperationResult; +import com.evolveum.midpoint.schema.util.FocusTypeUtil; +import com.evolveum.midpoint.security.api.Authorization; +import com.evolveum.midpoint.security.api.AuthorizationTransformer; +import com.evolveum.midpoint.security.api.DelegatorWithOtherPrivilegesLimitations; +import com.evolveum.midpoint.security.api.MidPointPrincipal; +import com.evolveum.midpoint.task.api.Task; +import com.evolveum.midpoint.util.exception.CommunicationException; +import com.evolveum.midpoint.util.exception.ConfigurationException; +import com.evolveum.midpoint.util.exception.ExpressionEvaluationException; +import com.evolveum.midpoint.util.exception.ObjectNotFoundException; +import com.evolveum.midpoint.util.exception.PolicyViolationException; +import com.evolveum.midpoint.util.exception.SchemaException; +import com.evolveum.midpoint.util.exception.SecurityViolationException; +import com.evolveum.midpoint.util.logging.Trace; +import com.evolveum.midpoint.util.logging.TraceManager; +import com.evolveum.midpoint.xml.ns._public.common.common_3.AdminGuiConfigurationType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.AssignmentHolderType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.AssignmentType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectPolicyConfigurationType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.OtherPrivilegesLimitationType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.SystemConfigurationType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.UserType; + +/** + * @author katka + * + */ +@Component +public class AssignmentCollector { + + private final static Trace LOGGER = TraceManager.getTrace(AssignmentCollector.class); + + @Autowired + @Qualifier("cacheRepositoryService") + private RepositoryService repositoryService; + @Autowired private SystemObjectCache systemObjectCache; + @Autowired private RelationRegistry relationRegistry; + @Autowired private PrismContext prismContext; + @Autowired @Qualifier("modelObjectResolver") private ObjectResolver objectResolver; + @Autowired private MappingFactory mappingFactory; + @Autowired private MappingEvaluator mappingEvaluator; + @Autowired private ActivationComputer activationComputer; + @Autowired private Clock clock; + + + public Collection> collect(PrismObject assignmentHolder, PrismObject systemConfiguration, boolean loginMode, Task task, OperationResult result) throws SchemaException { + + LensContext lensContext = createAuthenticationLensContext(assignmentHolder, systemConfiguration); + + AH assignmentHolderType = assignmentHolder.asObjectable(); + Collection forcedAssignments = null; + try { + forcedAssignments = LensUtil.getForcedAssignments(lensContext.getFocusContext().getLifecycleModel(), + assignmentHolderType.getLifecycleState(), objectResolver, prismContext, task, result); + } catch (ObjectNotFoundException | CommunicationException | ConfigurationException | SecurityViolationException + | ExpressionEvaluationException e1) { + LOGGER.error("Forced assignments defined for lifecycle {} won't be evaluated", assignmentHolderType.getLifecycleState(), e1); + } + Collection> evaluatedAssignments = new ArrayList<>(); + + if (!assignmentHolderType.getAssignment().isEmpty() || forcedAssignments != null) { + + AssignmentEvaluator.Builder builder = + new AssignmentEvaluator.Builder() + .repository(repositoryService) + .focusOdo(new ObjectDeltaObject<>(assignmentHolder, null, assignmentHolder)) + .channel(null) + .objectResolver(objectResolver) + .systemObjectCache(systemObjectCache) + .relationRegistry(relationRegistry) + .prismContext(prismContext) + .mappingFactory(mappingFactory) + .mappingEvaluator(mappingEvaluator) + .activationComputer(activationComputer) + .now(clock.currentTimeXMLGregorianCalendar()) + // We do need only authorizations + gui config. Therefore we not need to evaluate + // constructions and the like, so switching it off makes the evaluation run faster. + // It also avoids nasty problems with resources being down, + // resource schema not available, etc. + .loginMode(loginMode) + // We do not have real lens context here. But the push methods in ModelExpressionThreadLocalHolder + // will need something to push on the stack. So give them context placeholder. + .lensContext(lensContext); + + AssignmentEvaluator assignmentEvaluator = builder.build(); + + evaluatedAssignments.addAll(evaluateAssignments(assignmentHolderType, assignmentHolderType.getAssignment(), false, assignmentEvaluator,task, result)); + + evaluatedAssignments.addAll(evaluateAssignments(assignmentHolderType, forcedAssignments, true, assignmentEvaluator, task, result)); + } + + return evaluatedAssignments; + + } + + private Collection> evaluateAssignments(AH assignmentHolder, Collection assignments, boolean virtual, AssignmentEvaluator assignmentEvaluator, Task task, OperationResult result) { + + List> evaluatedAssignments = new ArrayList<>(); + try { + RepositoryCache.enter(); + for (AssignmentType assignmentType: assignments) { + try { + ItemDeltaItem,PrismContainerDefinition> assignmentIdi = new ItemDeltaItem<>(); + assignmentIdi.setItemOld(LensUtil.createAssignmentSingleValueContainerClone(assignmentType)); + assignmentIdi.recompute(); + EvaluatedAssignment assignment = assignmentEvaluator.evaluate(assignmentIdi, PlusMinusZero.ZERO, false, assignmentHolder, assignmentHolder.toString(), virtual, task, result); + evaluatedAssignments.add(assignment); + } catch (SchemaException | ObjectNotFoundException | ExpressionEvaluationException | PolicyViolationException | SecurityViolationException | ConfigurationException | CommunicationException e) { + LOGGER.error("Error while processing assignment of {}: {}; assignment: {}", + assignmentHolder, e.getMessage(), assignmentType, e); + } + } + } finally { + RepositoryCache.exit(); + } + return evaluatedAssignments; + } + + private LensContext createAuthenticationLensContext(PrismObject user, PrismObject systemConfiguration) throws SchemaException { + LensContext lensContext = new LensContextPlaceholder<>(user, prismContext); + if (systemConfiguration != null) { + ObjectPolicyConfigurationType policyConfigurationType = determineObjectPolicyConfiguration(user, systemConfiguration); + lensContext.getFocusContext().setObjectPolicyConfigurationType(policyConfigurationType); + } + return lensContext; + } + + private ObjectPolicyConfigurationType determineObjectPolicyConfiguration(PrismObject user, PrismObject systemConfiguration) throws SchemaException { + ObjectPolicyConfigurationType policyConfigurationType; + try { + policyConfigurationType = ModelUtils.determineObjectPolicyConfiguration(user, systemConfiguration.asObjectable()); + } catch (ConfigurationException e) { + throw new SchemaException(e.getMessage(), e); + } + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("Selected policy configuration from subtypes {}:\n{}", + FocusTypeUtil.determineSubTypes(user), policyConfigurationType==null?null:policyConfigurationType.asPrismContainerValue().debugDump(1)); + } + + return policyConfigurationType; + } +} diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/AssignmentEvaluator.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/AssignmentEvaluator.java index a7f44723575..35bd74c46be 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/AssignmentEvaluator.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/AssignmentEvaluator.java @@ -442,12 +442,17 @@ private boolean evaluateSegmentContent(AssignmentPathSegm } if (assignmentType.getPolicyRule() != null && !loginMode) { // We can ignore "reallyValid" for the same reason as for focus mappings. + LOGGER.info("###policy rule"); if (isNonNegative(relativeMode)) { + LOGGER.info("##### is non negative"); if (segment.isMatchingOrder()) { + LOGGER.info("##### collect focus rules"); collectPolicyRule(true, segment, ctx); } if (segment.isMatchingOrderForTarget()) { collectPolicyRule(false, segment, ctx); + } else { + collectPolicyRule(false, segment, ctx); } } } diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/projector/Projector.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/projector/Projector.java index 60590a46403..919feca1d65 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/projector/Projector.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/projector/Projector.java @@ -19,28 +19,38 @@ import static com.evolveum.midpoint.model.api.ProgressInformation.StateType.ENTERING; import static com.evolveum.midpoint.schema.internals.InternalsConfig.consistencyChecks; +import java.util.HashSet; import java.util.List; +import java.util.Set; import javax.xml.datatype.XMLGregorianCalendar; import com.evolveum.midpoint.model.api.ProgressInformation; import com.evolveum.midpoint.xml.ns._public.common.common_3.*; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import com.evolveum.midpoint.common.Clock; +import com.evolveum.midpoint.model.api.context.EvaluatedAssignment; +import com.evolveum.midpoint.model.api.context.EvaluatedPolicyRule; import com.evolveum.midpoint.model.api.context.SynchronizationPolicyDecision; import com.evolveum.midpoint.model.impl.lens.ClockworkMedic; +import com.evolveum.midpoint.model.impl.lens.EvaluatedAssignmentImpl; import com.evolveum.midpoint.model.impl.lens.LensContext; import com.evolveum.midpoint.model.impl.lens.LensProjectionContext; import com.evolveum.midpoint.model.impl.lens.LensUtil; import com.evolveum.midpoint.model.impl.lens.projector.credentials.ProjectionCredentialsProcessor; import com.evolveum.midpoint.model.impl.lens.projector.focus.AssignmentProcessor; +import com.evolveum.midpoint.model.impl.lens.projector.focus.AssignmentTripleEvaluator; import com.evolveum.midpoint.model.impl.lens.projector.focus.AssignmentHolderProcessor; import com.evolveum.midpoint.model.impl.util.ModelImplUtils; +import com.evolveum.midpoint.prism.PrismContext; +import com.evolveum.midpoint.prism.delta.DeltaSetTriple; import com.evolveum.midpoint.prism.xml.XmlTypeConverter; import com.evolveum.midpoint.repo.api.PreconditionViolationException; +import com.evolveum.midpoint.repo.common.CounterManager; import com.evolveum.midpoint.schema.ResourceShadowDiscriminator; import com.evolveum.midpoint.schema.internals.InternalCounters; import com.evolveum.midpoint.schema.internals.InternalMonitor; @@ -89,6 +99,8 @@ public class Projector { @Autowired private Clock clock; @Autowired private ClockworkMedic medic; + @Autowired private CounterManager counterManager; + private static final Trace LOGGER = TraceManager.getTrace(Projector.class); /** @@ -152,6 +164,8 @@ private void projectInternal(LensContext context, Stri String traceTitle = fromStart ? "projector start" : "projector resume"; medic.traceContext(LOGGER, activityDescription, traceTitle, false, context, false); +// setupCounters(now, context.getPrismContext(), task, parentResult); + if (consistencyChecks) context.checkConsistence(); if (fromStart) { @@ -295,7 +309,33 @@ private void projectInternal(LensContext context, Stri } } - +// +// private synchronized void setupCounters(XMLGregorianCalendar now, PrismContext prismContext, Task task, OperationResult result) throws ObjectNotFoundException, SchemaException, ExpressionEvaluationException, PolicyViolationException, SecurityViolationException, ConfigurationException, CommunicationException { +// +// if (task.getOid() == null) { +// return; +// } +// +// TaskType taskType = task.getTaskType(); +// LOGGER.trace("Collecting counters for {}", task); +// +// AssignmentTripleEvaluator ate = new AssignmentTripleEvaluator<>(); +// ate.setNow(now); +// ate.setPrismContext(prismContext); +// ate.setResult(result); +// ate.setSource(taskType); +// ate.setTask(task); +// DeltaSetTriple> evaluatedAssignments = ate.preProcessAssignments(task.getTaskPrismObject()); +// +// Set evaluatedPolicyRules = new HashSet<>(); +// +// for (EvaluatedAssignmentImpl evaluatedAssignment : evaluatedAssignments.union()) { +// evaluatedPolicyRules.addAll(evaluatedAssignment.getOtherTargetsPolicyRules()); +// } +// evaluatedPolicyRules.forEach(policyRule -> counterManager.registerCounter(task, policyRule.getPolicyRule())); +// +// } +// private void projectProjection(LensContext context, LensProjectionContext projectionContext, PartialProcessingOptionsType partialProcessingOptions, XMLGregorianCalendar now, String activityDescription, Task task, OperationResult parentResult) diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/projector/SmartAssignmentCollection.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/projector/SmartAssignmentCollection.java index 019f9af6f5e..1c3f529da94 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/projector/SmartAssignmentCollection.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/projector/SmartAssignmentCollection.java @@ -76,6 +76,21 @@ public void collect(PrismObject objectCurrent, PrismObject objectOld, Cont collectAssignments(assignmentDelta); } + + public void collectAssignmentsForPreprocessing(PrismContainer assignmentContainer, Collection forcedAssignments) throws SchemaException { + + aMap = new HashMap<>(); + idMap = new HashMap<>(); + + if (assignmentContainer != null) { + collectAssignments(assignmentContainer, Mode.CURRENT); + } + + collectVirtualAssignments(forcedAssignments, Mode.CURRENT); + +// aMap = null; +// idMap = null; + } private void collectAssignments(PrismContainer assignmentContainer, Mode mode) throws SchemaException { if (assignmentContainer == null) { diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/projector/focus/AssignmentTripleEvaluator.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/projector/focus/AssignmentTripleEvaluator.java index f05c8e64d3a..2281d260999 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/projector/focus/AssignmentTripleEvaluator.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/projector/focus/AssignmentTripleEvaluator.java @@ -23,6 +23,7 @@ import com.evolveum.midpoint.common.ActivationComputer; import com.evolveum.midpoint.model.api.ModelExecuteOptions; +import com.evolveum.midpoint.model.api.context.EvaluatedAssignment; import com.evolveum.midpoint.model.api.context.SynchronizationPolicyDecision; import com.evolveum.midpoint.model.impl.lens.AssignmentEvaluator; import com.evolveum.midpoint.model.impl.lens.EvaluatedAssignmentImpl; @@ -158,6 +159,38 @@ public void setResult(OperationResult result) { public void reset() { assignmentEvaluator.reset(); } + +// public DeltaSetTriple> preProcessAssignments(PrismObject taskType) throws ObjectNotFoundException, SchemaException, ExpressionEvaluationException, PolicyViolationException, SecurityViolationException, ConfigurationException, CommunicationException { +// +//// LensFocusContext focusContext = context.getFocusContext(); +// +// SmartAssignmentCollection assignmentCollection = new SmartAssignmentCollection<>(); +// +//// Collection forcedAssignments = LensUtil.getForcedAssignments(focusContext.getLifecycleModel(), +//// getNewObjectLifecycleState(focusContext), assignmentEvaluator.getObjectResolver(), +//// prismContext, task, result); +// +// assignmentCollection.collectAssignmentsForPreprocessing(taskType.findContainer(TaskType.F_ASSIGNMENT), null); +// +// +// if (LOGGER.isTraceEnabled()) { +// LOGGER.trace("Assignment collection:\n{}", assignmentCollection.debugDump(1)); +// } +// +// // Iterate over all the assignments. I mean really all. This is a union of the existing and changed assignments +// // therefore it contains all three types of assignments (plus, minus and zero). As it is an union each assignment +// // will be processed only once. Inside the loop we determine whether it was added, deleted or remains unchanged. +// // This is a first step of the processing. It takes all the account constructions regardless of the resource and +// // account type (intent). Therefore several constructions for the same resource and intent may appear in the resulting +// // sets. This is not good as we want only a single account for each resource/intent combination. But that will be +// // sorted out later. +// DeltaSetTriple> evaluatedAssignmentTriple = prismContext.deltaFactory().createDeltaSetTriple(); +// for (SmartAssignmentElement assignmentElement : assignmentCollection) { +// processAssignment(evaluatedAssignmentTriple, null, null, assignmentElement); +// } +// +// return evaluatedAssignmentTriple; +// } public DeltaSetTriple> processAllAssignments() throws ObjectNotFoundException, SchemaException, ExpressionEvaluationException, PolicyViolationException, SecurityViolationException, ConfigurationException, CommunicationException { diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/projector/policy/PolicyRuleSuspendTaskExecutor.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/projector/policy/PolicyRuleSuspendTaskExecutor.java index 31393eff190..d429ca1176a 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/projector/policy/PolicyRuleSuspendTaskExecutor.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/projector/policy/PolicyRuleSuspendTaskExecutor.java @@ -15,8 +15,6 @@ */ package com.evolveum.midpoint.model.impl.lens.projector.policy; -import java.util.Collection; - import org.jetbrains.annotations.NotNull; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @@ -24,20 +22,18 @@ import com.evolveum.midpoint.model.api.context.EvaluatedPolicyRule; import com.evolveum.midpoint.model.api.context.ModelContext; import com.evolveum.midpoint.model.api.context.ModelElementContext; -import com.evolveum.midpoint.model.api.context.ModelProjectionContext; import com.evolveum.midpoint.repo.common.CounterManager; import com.evolveum.midpoint.repo.common.CounterSepcification; import com.evolveum.midpoint.schema.result.OperationResult; import com.evolveum.midpoint.task.api.Task; -import com.evolveum.midpoint.task.api.TaskManager; +import com.evolveum.midpoint.util.DebugDumpable; +import com.evolveum.midpoint.util.DebugUtil; import com.evolveum.midpoint.util.exception.ObjectNotFoundException; -import com.evolveum.midpoint.util.exception.PolicyViolationException; import com.evolveum.midpoint.util.exception.SchemaException; import com.evolveum.midpoint.util.exception.ThresholdPolicyViolationException; import com.evolveum.midpoint.util.logging.Trace; import com.evolveum.midpoint.util.logging.TraceManager; import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType; -import com.evolveum.midpoint.xml.ns._public.common.common_3.PolicyActionType; import com.evolveum.midpoint.xml.ns._public.common.common_3.PolicyThresholdType; import com.evolveum.midpoint.xml.ns._public.common.common_3.SuspendTaskPolicyActionType; import com.evolveum.midpoint.xml.ns._public.common.common_3.WaterMarkType; @@ -52,57 +48,52 @@ public class PolicyRuleSuspendTaskExecutor { private static final Trace LOGGER = TraceManager.getTrace(PolicyRuleSuspendTaskExecutor.class); @Autowired private CounterManager counterManager; - @Autowired private TaskManager taskManager; +// @Autowired private TaskManager taskManager; public void execute(@NotNull ModelContext context, Task task, OperationResult result) throws ThresholdPolicyViolationException, ObjectNotFoundException, SchemaException { ModelElementContext focusCtx = context.getFocusContext(); - CounterSepcification counterSpec = counterManager.getCounterSpec(task); - - int counter = 1; - if (counterSpec != null) { - counter = counterSpec.getCount(); - } - - LOGGER.info("counter: {}", counter); - + if (focusCtx == null || focusCtx.getPolicyRules() == null) { return; } for (EvaluatedPolicyRule policyRule : focusCtx.getPolicyRules()) { - LOGGER.info("focus policy rules: {}", policyRule); - counter = checkEvaluatedPolicyRule(task, policyRule, counter, result); - } - - Collection projectionCtxs = context.getProjectionContexts(); - for (ModelProjectionContext projectionCtx : projectionCtxs) { - Collection evaluatedPolicyRules = projectionCtx.getPolicyRules(); - for (EvaluatedPolicyRule policyRule : evaluatedPolicyRules) { - LOGGER.info("projction policy rules: {}", policyRule); - counter = checkEvaluatedPolicyRule(task, policyRule, counter, result); + CounterSepcification counterSpec = counterManager.getCounterSpec(task, policyRule.getPolicyRule()); + LOGGER.trace("Found counter specification {} for {}", counterSpec, DebugUtil.debugDumpLazily(policyRule)); + + int counter = 1; + if (counterSpec != null) { + counter = counterSpec.getCount(); } + counter = checkEvaluatedPolicyRule(task, policyRule, counter, result); + if (counterSpec != null) { + LOGGER.trace("Setting new count = {} to counter spec", counter); + counterSpec.setCount(counter); + } } + + //TODO : not supported yet +// Collection projectionCtxs = context.getProjectionContexts(); +// for (ModelProjectionContext projectionCtx : projectionCtxs) { +// Collection evaluatedPolicyRules = projectionCtx.getPolicyRules(); +// for (EvaluatedPolicyRule policyRule : evaluatedPolicyRules) { +// LOGGER.info("projction policy rules: {}", policyRule); +// counter = checkEvaluatedPolicyRule(task, policyRule, counter, result); +// } +// +// } - LOGGER.info("counter after: {}", counter); - if (counterSpec != null) { - counterSpec.setCount(counter); - } + } private synchronized int checkEvaluatedPolicyRule(Task task, EvaluatedPolicyRule policyRule, int counter, OperationResult result) throws ThresholdPolicyViolationException, ObjectNotFoundException, SchemaException { - for (PolicyActionType action : policyRule.getEnabledActions()) { - LOGGER.info("action: {}", action); - } if (policyRule.containsEnabledAction(SuspendTaskPolicyActionType.class)) { - LOGGER.info("counter increment: {}", policyRule); counter++; -// SuspendTaskPolicyActionType stopAction = policyRule.getEnabledAction(SuspendTaskPolicyActionType.class); - + LOGGER.trace("Suspend task action enabled for {}, checking threshold settings", DebugUtil.debugDumpLazily(policyRule)); PolicyThresholdType thresholdSettings = policyRule.getPolicyThreshold(); if (isOverThreshold(thresholdSettings, counter)) { -// taskManager.suspendTask(task, 10, result); throw new ThresholdPolicyViolationException("Policy rule violation: " + policyRule.getPolicyRule()); } } @@ -114,6 +105,7 @@ private boolean isOverThreshold(PolicyThresholdType thresholdSettings, int count // TODO: better implementation that takes hight water mark into account WaterMarkType lowWaterMark = thresholdSettings.getLowWaterMark(); if (lowWaterMark == null) { + LOGGER.trace("No low water mark defined."); return true; } Integer lowWaterCount = lowWaterMark.getCount(); diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/security/UserProfileCompiler.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/security/UserProfileCompiler.java index b2bb22eeb88..50b9b5b3c81 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/security/UserProfileCompiler.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/security/UserProfileCompiler.java @@ -42,6 +42,7 @@ import com.evolveum.midpoint.model.api.util.ModelUtils; import com.evolveum.midpoint.model.common.SystemObjectCache; import com.evolveum.midpoint.model.common.mapping.MappingFactory; +import com.evolveum.midpoint.model.impl.lens.AssignmentCollector; import com.evolveum.midpoint.model.impl.lens.AssignmentEvaluator; import com.evolveum.midpoint.model.impl.lens.LensContext; import com.evolveum.midpoint.model.impl.lens.LensContextPlaceholder; @@ -131,12 +132,16 @@ public class UserProfileCompiler { @Autowired private SystemObjectCache systemObjectCache; @Autowired private RelationRegistry relationRegistry; @Autowired private PrismContext prismContext; - @Autowired private MappingFactory mappingFactory; - @Autowired private MappingEvaluator mappingEvaluator; - @Autowired private ActivationComputer activationComputer; - @Autowired private Clock clock; +// @Autowired private MappingFactory mappingFactory; +// @Autowired private MappingEvaluator mappingEvaluator; +// @Autowired private ActivationComputer activationComputer; +// @Autowired private Clock clock; @Autowired @Qualifier("modelObjectResolver") private ObjectResolver objectResolver; + @Autowired private AssignmentCollector assignmentCollector; + + + @Autowired @Qualifier("cacheRepositoryService") private RepositoryService repositoryService; @@ -145,7 +150,7 @@ public void compileUserProfile(MidPointUserProfilePrincipal principal, PrismObje principal.setApplicableSecurityPolicy(securityHelper.locateSecurityPolicy(principal.getUser().asPrismObject(), systemConfiguration, task, result)); - Collection authorizations = principal.getAuthorities(); +// Collection authorizations = principal.getAuthorities(); List adminGuiConfigurations = new ArrayList<>(); collect(adminGuiConfigurations, principal, systemConfiguration, authorizationTransformer, task, result); @@ -155,46 +160,64 @@ public void compileUserProfile(MidPointUserProfilePrincipal principal, PrismObje private void collect(List adminGuiConfigurations, MidPointUserProfilePrincipal principal, PrismObject systemConfiguration, AuthorizationTransformer authorizationTransformer, Task task, OperationResult result) throws SchemaException { UserType userType = principal.getUser(); - LensContext lensContext = createAuthenticationLensContext(userType.asPrismObject(), systemConfiguration); +// LensContext lensContext = createAuthenticationLensContext(userType.asPrismObject(), systemConfiguration); +// +// Collection forcedAssignments = null; +// try { +// forcedAssignments = LensUtil.getForcedAssignments(lensContext.getFocusContext().getLifecycleModel(), +// userType.getLifecycleState(), objectResolver, prismContext, task, result); +// } catch (ObjectNotFoundException | CommunicationException | ConfigurationException | SecurityViolationException +// | ExpressionEvaluationException e1) { +// LOGGER.error("Forced assignments defined for lifecycle {} won't be evaluated", userType.getLifecycleState(), e1); +// } +// if (!userType.getAssignment().isEmpty() || forcedAssignments != null) { +// +// AssignmentEvaluator.Builder builder = +// new AssignmentEvaluator.Builder() +// .repository(repositoryService) +// .focusOdo(new ObjectDeltaObject<>(userType.asPrismObject(), null, userType.asPrismObject())) +// .channel(null) +// .objectResolver(objectResolver) +// .systemObjectCache(systemObjectCache) +// .relationRegistry(relationRegistry) +// .prismContext(prismContext) +// .mappingFactory(mappingFactory) +// .mappingEvaluator(mappingEvaluator) +// .activationComputer(activationComputer) +// .now(clock.currentTimeXMLGregorianCalendar()) +// // We do need only authorizations + gui config. Therefore we not need to evaluate +// // constructions and the like, so switching it off makes the evaluation run faster. +// // It also avoids nasty problems with resources being down, +// // resource schema not available, etc. +// .loginMode(true) +// // We do not have real lens context here. But the push methods in ModelExpressionThreadLocalHolder +// // will need something to push on the stack. So give them context placeholder. +// .lensContext(lensContext); +// +// AssignmentEvaluator assignmentEvaluator = builder.build(); +// +// evaluateAssignments(userType.getAssignment(), false, assignmentEvaluator, principal, authorizationTransformer, adminGuiConfigurations, task, result); +// +// evaluateAssignments(forcedAssignments, true, assignmentEvaluator, principal, authorizationTransformer, adminGuiConfigurations, task, result); +// } - Collection forcedAssignments = null; - try { - forcedAssignments = LensUtil.getForcedAssignments(lensContext.getFocusContext().getLifecycleModel(), - userType.getLifecycleState(), objectResolver, prismContext, task, result); - } catch (ObjectNotFoundException | CommunicationException | ConfigurationException | SecurityViolationException - | ExpressionEvaluationException e1) { - LOGGER.error("Forced assignments defined for lifecycle {} won't be evaluated", userType.getLifecycleState(), e1); - } - if (!userType.getAssignment().isEmpty() || forcedAssignments != null) { - - AssignmentEvaluator.Builder builder = - new AssignmentEvaluator.Builder() - .repository(repositoryService) - .focusOdo(new ObjectDeltaObject<>(userType.asPrismObject(), null, userType.asPrismObject())) - .channel(null) - .objectResolver(objectResolver) - .systemObjectCache(systemObjectCache) - .relationRegistry(relationRegistry) - .prismContext(prismContext) - .mappingFactory(mappingFactory) - .mappingEvaluator(mappingEvaluator) - .activationComputer(activationComputer) - .now(clock.currentTimeXMLGregorianCalendar()) - // We do need only authorizations + gui config. Therefore we not need to evaluate - // constructions and the like, so switching it off makes the evaluation run faster. - // It also avoids nasty problems with resources being down, - // resource schema not available, etc. - .loginMode(true) - // We do not have real lens context here. But the push methods in ModelExpressionThreadLocalHolder - // will need something to push on the stack. So give them context placeholder. - .lensContext(lensContext); - - AssignmentEvaluator assignmentEvaluator = builder.build(); - - evaluateAssignments(userType.getAssignment(), false, assignmentEvaluator, principal, authorizationTransformer, adminGuiConfigurations, task, result); - - evaluateAssignments(forcedAssignments, true, assignmentEvaluator, principal, authorizationTransformer, adminGuiConfigurations, task, result); + Collection> evaluatedAssignments = assignmentCollector.collect(userType.asPrismObject(), systemConfiguration, true, task, result); + Collection authorizations = principal.getAuthorities(); + for (EvaluatedAssignment assignment : evaluatedAssignments) { + if (assignment.isValid()) { + addAuthorizations(authorizations, assignment.getAuthorizations(), authorizationTransformer); + adminGuiConfigurations.addAll(assignment.getAdminGuiConfigurations()); + } + for (EvaluatedAssignmentTarget target : assignment.getRoles().getNonNegativeValues()) { + if (target.isValid() && target.getTarget() != null && target.getTarget().asObjectable() instanceof UserType + && DeputyUtils.isDelegationPath(target.getAssignmentPath(), relationRegistry)) { + List limitations = DeputyUtils.extractLimitations(target.getAssignmentPath()); + principal.addDelegatorWithOtherPrivilegesLimitations(new DelegatorWithOtherPrivilegesLimitations( + (UserType) target.getTarget().asObjectable(), limitations)); + } + } } + if (userType.getAdminGuiConfiguration() != null) { // config from the user object should go last (to be applied as the last one) adminGuiConfigurations.add(userType.getAdminGuiConfiguration()); @@ -202,65 +225,65 @@ private void collect(List adminGuiConfigurations, Mid } - private void evaluateAssignments(Collection assignments, boolean virtual, AssignmentEvaluator assignmentEvaluator, MidPointPrincipal principal, AuthorizationTransformer authorizationTransformer, Collection adminGuiConfigurations, Task task, OperationResult result) { - UserType userType = principal.getUser(); - - Collection authorizations = principal.getAuthorities(); - - - try { - RepositoryCache.enter(); - for (AssignmentType assignmentType: assignments) { - try { - ItemDeltaItem,PrismContainerDefinition> assignmentIdi = new ItemDeltaItem<>(); - assignmentIdi.setItemOld(LensUtil.createAssignmentSingleValueContainerClone(assignmentType)); - assignmentIdi.recompute(); - EvaluatedAssignment assignment = assignmentEvaluator.evaluate(assignmentIdi, PlusMinusZero.ZERO, false, userType, userType.toString(), virtual, task, result); - if (assignment.isValid()) { - addAuthorizations(authorizations, assignment.getAuthorizations(), authorizationTransformer); - adminGuiConfigurations.addAll(assignment.getAdminGuiConfigurations()); - } - for (EvaluatedAssignmentTarget target : assignment.getRoles().getNonNegativeValues()) { - if (target.isValid() && target.getTarget() != null && target.getTarget().asObjectable() instanceof UserType - && DeputyUtils.isDelegationPath(target.getAssignmentPath(), relationRegistry)) { - List limitations = DeputyUtils.extractLimitations(target.getAssignmentPath()); - principal.addDelegatorWithOtherPrivilegesLimitations(new DelegatorWithOtherPrivilegesLimitations( - (UserType) target.getTarget().asObjectable(), limitations)); - } - } - } catch (SchemaException | ObjectNotFoundException | ExpressionEvaluationException | PolicyViolationException | SecurityViolationException | ConfigurationException | CommunicationException e) { - LOGGER.error("Error while processing assignment of {}: {}; assignment: {}", - userType, e.getMessage(), assignmentType, e); - } - } - } finally { - RepositoryCache.exit(); - } - } - - private LensContext createAuthenticationLensContext(PrismObject user, PrismObject systemConfiguration) throws SchemaException { - LensContext lensContext = new LensContextPlaceholder<>(user, prismContext); - if (systemConfiguration != null) { - ObjectPolicyConfigurationType policyConfigurationType = determineObjectPolicyConfiguration(user, systemConfiguration); - lensContext.getFocusContext().setObjectPolicyConfigurationType(policyConfigurationType); - } - return lensContext; - } - - private ObjectPolicyConfigurationType determineObjectPolicyConfiguration(PrismObject user, PrismObject systemConfiguration) throws SchemaException { - ObjectPolicyConfigurationType policyConfigurationType; - try { - policyConfigurationType = ModelUtils.determineObjectPolicyConfiguration(user, systemConfiguration.asObjectable()); - } catch (ConfigurationException e) { - throw new SchemaException(e.getMessage(), e); - } - if (LOGGER.isTraceEnabled()) { - LOGGER.trace("Selected policy configuration from subtypes {}:\n{}", - FocusTypeUtil.determineSubTypes(user), policyConfigurationType==null?null:policyConfigurationType.asPrismContainerValue().debugDump(1)); - } - - return policyConfigurationType; - } +// private void evaluateAssignments(Collection assignments, boolean virtual, AssignmentEvaluator assignmentEvaluator, MidPointPrincipal principal, AuthorizationTransformer authorizationTransformer, Collection adminGuiConfigurations, Task task, OperationResult result) { +// UserType userType = principal.getUser(); +// +// +// +// Collection authorizations = principal.getAuthorities(); +// try { +// RepositoryCache.enter(); +// for (AssignmentType assignmentType: assignments) { +// try { +// ItemDeltaItem,PrismContainerDefinition> assignmentIdi = new ItemDeltaItem<>(); +// assignmentIdi.setItemOld(LensUtil.createAssignmentSingleValueContainerClone(assignmentType)); +// assignmentIdi.recompute(); +// EvaluatedAssignment assignment = assignmentEvaluator.evaluate(assignmentIdi, PlusMinusZero.ZERO, false, userType, userType.toString(), virtual, task, result); +// if (assignment.isValid()) { +// addAuthorizations(authorizations, assignment.getAuthorizations(), authorizationTransformer); +// adminGuiConfigurations.addAll(assignment.getAdminGuiConfigurations()); +// } +// for (EvaluatedAssignmentTarget target : assignment.getRoles().getNonNegativeValues()) { +// if (target.isValid() && target.getTarget() != null && target.getTarget().asObjectable() instanceof UserType +// && DeputyUtils.isDelegationPath(target.getAssignmentPath(), relationRegistry)) { +// List limitations = DeputyUtils.extractLimitations(target.getAssignmentPath()); +// principal.addDelegatorWithOtherPrivilegesLimitations(new DelegatorWithOtherPrivilegesLimitations( +// (UserType) target.getTarget().asObjectable(), limitations)); +// } +// } +// } catch (SchemaException | ObjectNotFoundException | ExpressionEvaluationException | PolicyViolationException | SecurityViolationException | ConfigurationException | CommunicationException e) { +// LOGGER.error("Error while processing assignment of {}: {}; assignment: {}", +// userType, e.getMessage(), assignmentType, e); +// } +// } +// } finally { +// RepositoryCache.exit(); +// } +// } + +// private LensContext createAuthenticationLensContext(PrismObject user, PrismObject systemConfiguration) throws SchemaException { +// LensContext lensContext = new LensContextPlaceholder<>(user, prismContext); +// if (systemConfiguration != null) { +// ObjectPolicyConfigurationType policyConfigurationType = determineObjectPolicyConfiguration(user, systemConfiguration); +// lensContext.getFocusContext().setObjectPolicyConfigurationType(policyConfigurationType); +// } +// return lensContext; +// } + +// private ObjectPolicyConfigurationType determineObjectPolicyConfiguration(PrismObject user, PrismObject systemConfiguration) throws SchemaException { +// ObjectPolicyConfigurationType policyConfigurationType; +// try { +// policyConfigurationType = ModelUtils.determineObjectPolicyConfiguration(user, systemConfiguration.asObjectable()); +// } catch (ConfigurationException e) { +// throw new SchemaException(e.getMessage(), e); +// } +// if (LOGGER.isTraceEnabled()) { +// LOGGER.trace("Selected policy configuration from subtypes {}:\n{}", +// FocusTypeUtil.determineSubTypes(user), policyConfigurationType==null?null:policyConfigurationType.asPrismContainerValue().debugDump(1)); +// } +// +// return policyConfigurationType; +// } private void addAuthorizations(Collection targetCollection, Collection sourceCollection, AuthorizationTransformer authorizationTransformer) { if (sourceCollection == null) { diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/sync/LiveSyncTaskHandler.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/sync/LiveSyncTaskHandler.java index 06492a59b50..678c431d5b1 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/sync/LiveSyncTaskHandler.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/sync/LiveSyncTaskHandler.java @@ -87,7 +87,7 @@ public StatisticsCollectionStrategy getStatisticsCollectionStrategy() { public TaskRunResult run(Task task) { LOGGER.trace("LiveSyncTaskHandler.run starting"); - counterManager.registerCounter(task, true); +// counterManager.registerCounter(task, true); OperationResult opResult = new OperationResult(OperationConstants.LIVE_SYNC); TaskRunResult runResult = new TaskRunResult(); diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/sync/ReconciliationTaskHandler.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/sync/ReconciliationTaskHandler.java index f9cbc64d3e4..d0ed7116abc 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/sync/ReconciliationTaskHandler.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/sync/ReconciliationTaskHandler.java @@ -24,8 +24,13 @@ import com.evolveum.midpoint.common.refinery.RefinedResourceSchema; import com.evolveum.midpoint.common.refinery.RefinedResourceSchemaImpl; import com.evolveum.midpoint.model.api.ModelPublicConstants; +import com.evolveum.midpoint.model.api.context.EvaluatedAssignment; +import com.evolveum.midpoint.model.api.context.EvaluatedPolicyRule; import com.evolveum.midpoint.model.api.util.ModelUtils; +import com.evolveum.midpoint.model.common.SystemObjectCache; import com.evolveum.midpoint.model.impl.ModelConstants; +import com.evolveum.midpoint.model.impl.lens.AssignmentCollector; +import com.evolveum.midpoint.model.impl.lens.EvaluatedAssignmentImpl; import com.evolveum.midpoint.model.impl.lens.projector.policy.PolicyRuleSuspendTaskExecutor; import com.evolveum.midpoint.model.impl.util.ModelImplUtils; import com.evolveum.midpoint.prism.PrismContext; @@ -54,6 +59,7 @@ import com.evolveum.midpoint.schema.util.ShadowUtil; import com.evolveum.midpoint.task.api.*; import com.evolveum.midpoint.task.api.TaskRunResult.TaskRunResultStatus; +import com.evolveum.midpoint.util.DebugUtil; import com.evolveum.midpoint.util.Holder; import com.evolveum.midpoint.util.QNameUtil; import com.evolveum.midpoint.util.exception.*; @@ -64,6 +70,7 @@ import com.evolveum.midpoint.xml.ns._public.common.common_3.ResourceType; import com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowType; import com.evolveum.midpoint.xml.ns._public.common.common_3.TaskStageType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.TaskType; import com.evolveum.midpoint.xml.ns._public.common.common_3.WorkBucketType; import com.evolveum.prism.xml.ns._public.types_3.PolyStringType; @@ -77,7 +84,9 @@ import javax.annotation.PostConstruct; import javax.xml.namespace.QName; import java.util.Collection; +import java.util.HashSet; import java.util.List; +import java.util.Set; /** * The task handler for reconciliation. @@ -119,6 +128,8 @@ public class ReconciliationTaskHandler implements WorkBucketAwareTaskHandler { private RepositoryService repositoryService; @Autowired private CounterManager counterManager; + @Autowired private AssignmentCollector assignmentCollector; + @Autowired private SystemObjectCache systemObjectCache; private static final transient Trace LOGGER = TraceManager.getTrace(ReconciliationTaskHandler.class); @@ -158,7 +169,7 @@ public StatisticsCollectionStrategy getStatisticsCollectionStrategy() { public TaskWorkBucketProcessingResult run(Task localCoordinatorTask, WorkBucketType workBucket, TaskWorkBucketProcessingResult previousRunResult) { - counterManager.registerCounter(localCoordinatorTask, false); +// counterManager.registerCounter(localCoordinatorTask, false); String handlerUri = localCoordinatorTask.getHandlerUri(); Stage stage = getStage(handlerUri); @@ -187,6 +198,28 @@ public TaskWorkBucketProcessingResult run(Task localCoordinatorTask, WorkBucketT String resourceOid = localCoordinatorTask.getObjectOid(); opResult.addContext("resourceOid", resourceOid); + + try { + + Collection> evaluatedAssignments = assignmentCollector.collect(localCoordinatorTask.getTaskPrismObject(), systemObjectCache.getSystemConfiguration(opResult), false, localCoordinatorTask, opResult); + Set evaluatedPolicyRules = new HashSet<>(); + + LOGGER.info("Evaluated assignments for task: {}", DebugUtil.debugDumpLazily(evaluatedAssignments)); + + for (EvaluatedAssignment evaluatedAssignment : evaluatedAssignments) { + LOGGER.info("Evaluated other policy rules for task: {}", DebugUtil.debugDumpLazily(evaluatedAssignment.getOtherTargetsPolicyRules())); + evaluatedPolicyRules.addAll(evaluatedAssignment.getOtherTargetsPolicyRules()); + + LOGGER.info("Evaluated focus policy rules for task: {}", DebugUtil.debugDumpLazily(evaluatedAssignment.getFocusPolicyRules())); + evaluatedPolicyRules.addAll(evaluatedAssignment.getFocusPolicyRules()); + + LOGGER.info("Evaluated this policy rules for task: {}", DebugUtil.debugDumpLazily(evaluatedAssignment.getThisTargetPolicyRules())); + evaluatedPolicyRules.addAll(evaluatedAssignment.getThisTargetPolicyRules()); + } + evaluatedPolicyRules.forEach(policyRule -> counterManager.registerCounter(localCoordinatorTask, policyRule.getPolicyRule())); + } catch (SchemaException e) { + throw new SystemException("Cannot collect task thresholds."); + } if (localCoordinatorTask.getChannel() == null) { localCoordinatorTask.setChannel(SchemaConstants.CHANGE_CHANNEL_RECON_URI); diff --git a/repo/repo-common/src/main/java/com/evolveum/midpoint/repo/common/CounterManager.java b/repo/repo-common/src/main/java/com/evolveum/midpoint/repo/common/CounterManager.java index e033ce64b0a..3ee05095c6b 100644 --- a/repo/repo-common/src/main/java/com/evolveum/midpoint/repo/common/CounterManager.java +++ b/repo/repo-common/src/main/java/com/evolveum/midpoint/repo/common/CounterManager.java @@ -15,16 +15,22 @@ */ package com.evolveum.midpoint.repo.common; -import java.util.HashMap; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; +import javax.xml.datatype.Duration; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import com.evolveum.midpoint.common.Clock; +import com.evolveum.midpoint.prism.xml.XmlTypeConverter; import com.evolveum.midpoint.task.api.Task; -import com.evolveum.midpoint.xml.ns._public.common.common_3.TaskType; +import com.evolveum.midpoint.util.logging.Trace; +import com.evolveum.midpoint.util.logging.TraceManager; +import com.evolveum.midpoint.xml.ns._public.common.common_3.PolicyRuleType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.PolicyThresholdType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.TimeIntervalType; /** * @author katka @@ -34,39 +40,132 @@ public class CounterManager { @Autowired private Clock clock; + + private static final Trace LOGGER = TraceManager.getTrace(CounterManager.class); - private Map countersMap = new ConcurrentHashMap<>(); +// private Map countersMapOld = new ConcurrentHashMap<>(); +// + private Map countersMap = new ConcurrentHashMap<>(); +// +// public synchronized void registerCounter(Task task, boolean timeCounter) { +// CounterSepcification counterSpec = countersMapOld.get(task.getOid()); +// if (counterSpec == null) { +// counterSpec = new CounterSepcification(); +// counterSpec.setCounterStart(clock.currentTimeMillis()); +// countersMapOld.put(task.getOid(), counterSpec); +// return; +// } +// +// if (timeCounter) { +// long currentInMillis = clock.currentTimeMillis(); +// long start = counterSpec.getCounterStart(); +// if (start + 3600 * 1000 < currentInMillis) { +// counterSpec = new CounterSepcification(); +// counterSpec.setCounterStart(clock.currentTimeMillis()); +// countersMapOld.replace(task.getOid(), counterSpec); +// } +// return; +// } +// +// counterSpec = new CounterSepcification(); +// counterSpec.setCounterStart(clock.currentTimeMillis()); +// countersMapOld.replace(task.getOid(), counterSpec); +// } - public synchronized void registerCounter(Task task, boolean timeCounter) { - CounterSepcification counterSpec = countersMap.get(task.getOid()); + public synchronized void registerCounter(Task task, PolicyRuleType policyRule) { + + if (task.getOid() == null) { + LOGGER.trace("Not persistent task, skipping registering counter."); + return; + } + + CounterKey key = new CounterKey(task.getOid(), policyRule); + CounterSepcification counterSpec = countersMap.get(key); if (counterSpec == null) { - counterSpec = new CounterSepcification(); - counterSpec.setCounterStart(clock.currentTimeMillis()); - countersMap.put(task.getOid(), counterSpec); + initCleanCounter(policyRule, task); return; } - if (timeCounter) { - long currentInMillis = clock.currentTimeMillis(); - long start = counterSpec.getCounterStart(); - if (start + 3600 * 1000 < currentInMillis) { - counterSpec = new CounterSepcification(); - counterSpec.setCounterStart(clock.currentTimeMillis()); - countersMap.replace(task.getOid(), counterSpec); - } - return; + if (isResetCounter(counterSpec)) { + refreshCounter(key, counterSpec); + } + + } + + private boolean isResetCounter(CounterSepcification counterSpec) { + + PolicyThresholdType threshold = counterSpec.getPolicyThreshold(); + if (threshold == null) { + return true; + } + + TimeIntervalType timeInterval = threshold.getTimeInterval(); + + if (timeInterval == null) { + return true; + } + if (timeInterval.getInterval() == null) { + return true; } - counterSpec = new CounterSepcification(); + Duration interval = timeInterval.getInterval(); + return !XmlTypeConverter.isAfterInterval(XmlTypeConverter.createXMLGregorianCalendar(counterSpec.getCounterStart()), interval, clock.currentTimeXMLGregorianCalendar()); + + } + + private CounterSepcification initCleanCounter(PolicyRuleType policyRule, Task task) { + CounterSepcification counterSpec = new CounterSepcification(); counterSpec.setCounterStart(clock.currentTimeMillis()); - countersMap.replace(task.getOid(), counterSpec); + counterSpec.setPolicyThreshold(policyRule.getPolicyThreshold()); + countersMap.put(new CounterKey(task.getOid(), policyRule), counterSpec); + return counterSpec; } + private void refreshCounter(CounterKey key, CounterSepcification counterSpec) { + counterSpec.reset(clock.currentTimeMillis()); + countersMap.replace(key, counterSpec); + } - public CounterSepcification getCounterSpec(Task task) { + public CounterSepcification getCounterSpec(Task task, PolicyRuleType policyRule) { if (task.getOid() == null) { + LOGGER.trace("Cannot get counter spec for task without oid"); return null; } - return countersMap.get(task.getOid()); + + LOGGER.trace("Getting counter spec for {} and {}", task, policyRule); + return countersMap.get(new CounterKey(task.getOid(), policyRule)); + } + + class CounterKey { + + private String oid; + private PolicyRuleType policyRule; + + public CounterKey(String oid, PolicyRuleType policyRule) { + this.oid = oid; + this.policyRule = policyRule; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + if (o == null || getClass() != o.getClass()) + return false; + + CounterKey cacheKey = (CounterKey) o; + + if (policyRule != null ? !policyRule.equals(cacheKey.policyRule) : cacheKey.policyRule != null) + return false; + return oid != null ? oid.equals(cacheKey.oid) : cacheKey.oid == null; + } + + @Override + public int hashCode() { + int result = policyRule != null ? policyRule.hashCode() : 0; + result = 31 * result + (oid != null ? oid.hashCode() : 0); + LOGGER.trace("hashCode {} for {}{}", result, oid, policyRule); + return result; + } } } diff --git a/repo/repo-common/src/main/java/com/evolveum/midpoint/repo/common/CounterSepcification.java b/repo/repo-common/src/main/java/com/evolveum/midpoint/repo/common/CounterSepcification.java index 162da2a57c5..f083703bf00 100644 --- a/repo/repo-common/src/main/java/com/evolveum/midpoint/repo/common/CounterSepcification.java +++ b/repo/repo-common/src/main/java/com/evolveum/midpoint/repo/common/CounterSepcification.java @@ -15,14 +15,21 @@ */ package com.evolveum.midpoint.repo.common; +import java.time.Duration; + +import com.evolveum.midpoint.prism.xml.XmlTypeConverter; +import com.evolveum.midpoint.util.DebugDumpable; +import com.evolveum.midpoint.xml.ns._public.common.common_3.PolicyThresholdType; + /** * @author katka * */ -public class CounterSepcification { +public class CounterSepcification implements DebugDumpable { private int count = 0; - private long counterStart = 0; + private long counterStart; + private PolicyThresholdType policyThreshold; public int getCount() { return count; @@ -36,7 +43,33 @@ public void setCount(int count) { public void setCounterStart(long counterStart) { this.counterStart = counterStart; } + + /** + * @return the policyThreshold + */ + public PolicyThresholdType getPolicyThreshold() { + return policyThreshold; + } + /** + * @param policyThreshold the policyThreshold to set + */ + public void setPolicyThreshold(PolicyThresholdType policyThreshold) { + this.policyThreshold = policyThreshold; + } + + public void reset(long currentTimeMillis) { + count = 0; + counterStart = currentTimeMillis; + } + @Override + public String debugDump(int indent) { + StringBuilder sb = new StringBuilder(); + sb.append("Current count: ").append(count).append("\n"); + sb.append("Counter start: ").append(XmlTypeConverter.createXMLGregorianCalendar(counterStart)).append("\n"); + sb.append("Thresholds: \n").append(policyThreshold.toString()); + return sb.toString(); + } } diff --git a/repo/repo-common/src/main/java/com/evolveum/midpoint/repo/common/task/AbstractSearchIterativeTaskHandler.java b/repo/repo-common/src/main/java/com/evolveum/midpoint/repo/common/task/AbstractSearchIterativeTaskHandler.java index 04780bb53f4..54832ca0904 100644 --- a/repo/repo-common/src/main/java/com/evolveum/midpoint/repo/common/task/AbstractSearchIterativeTaskHandler.java +++ b/repo/repo-common/src/main/java/com/evolveum/midpoint/repo/common/task/AbstractSearchIterativeTaskHandler.java @@ -175,7 +175,7 @@ public TaskWorkBucketProcessingResult run(Task localCoordinatorTask, WorkBucketT LOGGER.trace("{} run starting: local coordinator task {}, bucket {}, previous run result {}", taskName, localCoordinatorTask, workBucket, previousRunResult); - counterManager.registerCounter(localCoordinatorTask, false); +// counterManager.registerCounter(localCoordinatorTask, false); if (localCoordinatorTask.getOid() == null) { throw new IllegalArgumentException( diff --git a/testing/story/src/test/resources/logback-test.xml b/testing/story/src/test/resources/logback-test.xml index d7a372551f2..26bda76405e 100644 --- a/testing/story/src/test/resources/logback-test.xml +++ b/testing/story/src/test/resources/logback-test.xml @@ -80,10 +80,15 @@ + + + + + diff --git a/testing/story/src/test/resources/thresholds/role-policy-rule-change-activation.xml b/testing/story/src/test/resources/thresholds/role-policy-rule-change-activation.xml index 15c74d3b3ed..cca127e3e6b 100644 --- a/testing/story/src/test/resources/thresholds/role-policy-rule-change-activation.xml +++ b/testing/story/src/test/resources/thresholds/role-policy-rule-change-activation.xml @@ -26,7 +26,9 @@ - 3 + + 3 + diff --git a/testing/story/src/test/resources/thresholds/role-policy-rule-create.xml b/testing/story/src/test/resources/thresholds/role-policy-rule-create.xml index 2345ea4bd7a..c1ce8a5db9e 100644 --- a/testing/story/src/test/resources/thresholds/role-policy-rule-create.xml +++ b/testing/story/src/test/resources/thresholds/role-policy-rule-create.xml @@ -25,8 +25,12 @@ - 4 - PT1H + + + + + 5 + From 9fc92ca70a0a5636d7affbd93d54760ba5ecbee0 Mon Sep 17 00:00:00 2001 From: Pavol Mederly Date: Tue, 5 Feb 2019 19:57:39 +0100 Subject: [PATCH 007/224] Adapt TestConsistencyMechanism story test (cherry picked from commit 0a1820c1a20346ce428c89555d708d7963c5186d) --- .../midpoint/testing/story/TestConsistencyMechanism.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestConsistencyMechanism.java b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestConsistencyMechanism.java index 71b7f3f6ca3..ea7ee20669f 100644 --- a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestConsistencyMechanism.java +++ b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestConsistencyMechanism.java @@ -2263,11 +2263,7 @@ public void test999Shutdown() throws Exception { waitFor("waiting for task manager shutdown", new Checker() { @Override public boolean check() throws CommonException { - try { - return taskManager.getLocallyRunningTasks(new OperationResult("dummy")).isEmpty(); - } catch (TaskManagerException e) { - throw new SystemException(e); - } + return taskManager.getLocallyRunningTasks(new OperationResult("dummy")).isEmpty(); } @Override From 86fe098b89d5ad974a9e0b7c478c5d3f894c47f7 Mon Sep 17 00:00:00 2001 From: Pavol Mederly Date: Wed, 6 Feb 2019 22:21:22 +0100 Subject: [PATCH 008/224] Clean up notification processing a bit Minor refactorings, cleanups and fixes were done. First parts of a test of messaging-based resource with attribute caching is passing. --- .../midpoint/schema/util/MiscSchemaUtil.java | 6 +- .../midpoint/schema/util/ShadowUtil.java | 10 +- .../midpoint/model/impl/ModelCrudService.java | 30 +- .../test/AbstractModelIntegrationTest.java | 14 +- .../api/ResourceEventDescription.java | 4 +- .../api/ResourceEventListener.java | 4 +- .../impl/ProvisioningContext.java | 11 +- .../impl/ResourceEventListenerImpl.java | 34 ++- .../provisioning/impl/ShadowCache.java | 118 ++++---- .../provisioning/impl/ShadowManager.java | 168 +++++------ .../midpoint/provisioning/ucf/api/Change.java | 8 + .../midpoint/testing/story/TestGrouper.java | 271 +++++++++++++++++- .../resources/grouper/resource-grouper.xml | 29 ++ .../test/resources/grouper/shadow-alumni.xml | 29 ++ .../grouper/shadow-banderson-with-groups.xml | 31 ++ .../resources/grouper/shadow-banderson.xml | 29 ++ .../resources/grouper/shadow-jlewis685.xml | 29 ++ .../test/resources/grouper/shadow-staff.xml | 29 ++ 18 files changed, 639 insertions(+), 215 deletions(-) create mode 100644 testing/story/src/test/resources/grouper/shadow-alumni.xml create mode 100644 testing/story/src/test/resources/grouper/shadow-banderson-with-groups.xml create mode 100644 testing/story/src/test/resources/grouper/shadow-banderson.xml create mode 100644 testing/story/src/test/resources/grouper/shadow-jlewis685.xml create mode 100644 testing/story/src/test/resources/grouper/shadow-staff.xml diff --git a/infra/schema/src/main/java/com/evolveum/midpoint/schema/util/MiscSchemaUtil.java b/infra/schema/src/main/java/com/evolveum/midpoint/schema/util/MiscSchemaUtil.java index a87b3c7fdea..170ba2ae4e1 100644 --- a/infra/schema/src/main/java/com/evolveum/midpoint/schema/util/MiscSchemaUtil.java +++ b/infra/schema/src/main/java/com/evolveum/midpoint/schema/util/MiscSchemaUtil.java @@ -375,14 +375,14 @@ public static void reduceSearchResult(List if (results == null || results.isEmpty()) { return; } - Map> map = new HashMap<>(); + Set oidsSeen = new HashSet<>(); Iterator> iterator = results.iterator(); while (iterator.hasNext()) { PrismObject prismObject = iterator.next(); - if (map.containsKey(prismObject.getOid())) { + if (oidsSeen.contains(prismObject.getOid())) { iterator.remove(); } else { - map.put(prismObject.getOid(), prismObject); + oidsSeen.add(prismObject.getOid()); } } } diff --git a/infra/schema/src/main/java/com/evolveum/midpoint/schema/util/ShadowUtil.java b/infra/schema/src/main/java/com/evolveum/midpoint/schema/util/ShadowUtil.java index b22c9725274..eeccd71d91f 100644 --- a/infra/schema/src/main/java/com/evolveum/midpoint/schema/util/ShadowUtil.java +++ b/infra/schema/src/main/java/com/evolveum/midpoint/schema/util/ShadowUtil.java @@ -502,11 +502,19 @@ public static boolean isDead(ShadowType shadow) { Boolean dead = shadow.isDead(); return dead != null && dead; } - + + public static boolean isDead(PrismObject shadow) { + return isDead(shadow.asObjectable()); + } + public static boolean isExists(ShadowType shadow) { Boolean exists = shadow.isExists(); return exists == null || exists; } + + public static boolean isExists(PrismObject shadow) { + return isExists(shadow.asObjectable()); + } public static boolean matches(ShadowType shadowType, String resourceOid, ShadowKindType kind, String intent) { if (shadowType == null) { diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/ModelCrudService.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/ModelCrudService.java index 2bee796f5c9..52823b4c1ec 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/ModelCrudService.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/ModelCrudService.java @@ -15,8 +15,8 @@ */ package com.evolveum.midpoint.model.impl; -import java.util.ArrayList; import java.util.Collection; +import java.util.Collections; import java.util.List; import javax.xml.namespace.QName; @@ -128,46 +128,42 @@ public void notifyChange(ResourceObjectShadowChangeDescriptionType changeDescrip PrismObject oldShadow; LOGGER.trace("resolving old object"); - if (!StringUtils.isEmpty(oldShadowOid)){ + if (!StringUtils.isEmpty(oldShadowOid)) { oldShadow = getObject(ShadowType.class, oldShadowOid, SelectorOptions.createCollection(GetOperationOptions.createDoNotDiscovery()), task, parentResult); eventDescription.setOldShadow(oldShadow); - LOGGER.trace("old object resolved to: {}", oldShadow.debugDump()); - } else{ + LOGGER.trace("old object resolved to: {}", oldShadow.debugDumpLazily()); + } else { LOGGER.trace("Old shadow null"); } PrismObject currentShadow = null; ShadowType currentShadowType = changeDescription.getCurrentShadow(); LOGGER.trace("resolving current shadow"); - if (currentShadowType != null){ + if (currentShadowType != null) { prismContext.adopt(currentShadowType); currentShadow = currentShadowType.asPrismObject(); - LOGGER.trace("current shadow resolved to {}", currentShadow.debugDump()); + LOGGER.trace("current shadow resolved to {}", currentShadow.debugDumpLazily()); } eventDescription.setCurrentShadow(currentShadow); ObjectDeltaType deltaType = changeDescription.getObjectDelta(); - ObjectDelta delta = null; - PrismObject shadowToAdd; - if (deltaType != null){ + if (deltaType != null) { - delta = prismContext.deltaFactory().object().createEmptyDelta(ShadowType.class, deltaType.getOid(), + PrismObject shadowToAdd; + ObjectDelta delta = prismContext.deltaFactory().object().createEmptyDelta(ShadowType.class, deltaType.getOid(), ChangeType.toChangeType(deltaType.getChangeType())); if (delta.getChangeType() == ChangeType.ADD) { -// LOGGER.trace("determined ADD change "); if (deltaType.getObjectToAdd() == null){ LOGGER.trace("No object to add specified. Check your delta. Add delta must contain object to add"); throw new IllegalArgumentException("No object to add specified. Check your delta. Add delta must contain object to add"); -// return handleTaskResult(task); } Object objToAdd = deltaType.getObjectToAdd(); if (!(objToAdd instanceof ShadowType)){ LOGGER.trace("Wrong object specified in change description. Expected on the the shadow type, but got " + objToAdd.getClass().getSimpleName()); throw new IllegalArgumentException("Wrong object specified in change description. Expected on the the shadow type, but got " + objToAdd.getClass().getSimpleName()); -// return handleTaskResult(task); } prismContext.adopt((ShadowType)objToAdd); @@ -176,13 +172,11 @@ public void notifyChange(ResourceObjectShadowChangeDescriptionType changeDescrip delta.setObjectToAdd(shadowToAdd); } else { Collection modifications = DeltaConvertor.toModifications(deltaType.getItemDelta(), prismContext.getSchemaRegistry().findObjectDefinitionByCompileTimeClass(ShadowType.class)); - delta.getModifications().addAll(modifications); + delta.addModifications(modifications); } + ModelImplUtils.encrypt(Collections.singletonList(delta), protector, null, parentResult); + eventDescription.setDelta(delta); } - Collection> deltas = new ArrayList<>(); - deltas.add(delta); - ModelImplUtils.encrypt(deltas, protector, null, parentResult); - eventDescription.setDelta(delta); eventDescription.setSourceChannel(changeDescription.getChannel()); diff --git a/model/model-test/src/main/java/com/evolveum/midpoint/model/test/AbstractModelIntegrationTest.java b/model/model-test/src/main/java/com/evolveum/midpoint/model/test/AbstractModelIntegrationTest.java index bcaa6ecbd66..636130b6b4f 100644 --- a/model/model-test/src/main/java/com/evolveum/midpoint/model/test/AbstractModelIntegrationTest.java +++ b/model/model-test/src/main/java/com/evolveum/midpoint/model/test/AbstractModelIntegrationTest.java @@ -50,6 +50,7 @@ import com.evolveum.midpoint.prism.delta.*; import com.evolveum.midpoint.prism.equivalence.EquivalenceStrategy; import com.evolveum.midpoint.prism.path.*; +import com.evolveum.midpoint.provisioning.api.ChangeNotificationDispatcher; import com.evolveum.midpoint.schema.*; import com.evolveum.midpoint.schema.result.OperationResultStatus; import com.evolveum.midpoint.task.api.TaskDebugUtil; @@ -288,7 +289,7 @@ public abstract class AbstractModelIntegrationTest extends AbstractIntegrationTe @Autowired protected SecurityContextManager securityContextManager; @Autowired protected MidpointFunctions libraryMidpointFunctions; @Autowired protected ValuePolicyProcessor valuePolicyProcessor; - + @Autowired(required = false) @Qualifier("modelObjectResolver") protected ObjectResolver modelObjectResolver; @@ -5554,7 +5555,16 @@ protected OrgAsserter assertOrgAfter(String oid) throws ObjectNotFoundExce asserter.assertOid(oid); return asserter; } - + + protected OrgAsserter assertOrgByName(String name, String message) throws ObjectNotFoundException, SchemaException, SecurityViolationException, CommunicationException, ConfigurationException, ExpressionEvaluationException { + PrismObject org = findObjectByName(OrgType.class, name); + assertNotNull("No org with name '"+name+"'", org); + OrgAsserter asserter = OrgAsserter.forOrg(org, message); + initializeAsserter(asserter); + asserter.assertName(name); + return asserter; + } + protected RoleAsserter assertRole(String oid, String message) throws ObjectNotFoundException, SchemaException, SecurityViolationException, CommunicationException, ConfigurationException, ExpressionEvaluationException { PrismObject role = getObject(RoleType.class, oid); RoleAsserter asserter = assertRole(role, message); diff --git a/provisioning/provisioning-api/src/main/java/com/evolveum/midpoint/provisioning/api/ResourceEventDescription.java b/provisioning/provisioning-api/src/main/java/com/evolveum/midpoint/provisioning/api/ResourceEventDescription.java index eaa72ee4634..4a51e94e29b 100644 --- a/provisioning/provisioning-api/src/main/java/com/evolveum/midpoint/provisioning/api/ResourceEventDescription.java +++ b/provisioning/provisioning-api/src/main/java/com/evolveum/midpoint/provisioning/api/ResourceEventDescription.java @@ -13,7 +13,7 @@ public class ResourceEventDescription implements Serializable, DebugDumpable{ private PrismObject oldShadow; private PrismObject currentShadow; - private ObjectDelta delta; + private ObjectDelta delta; private String sourceChannel; // private PrismObject resource; @@ -26,7 +26,7 @@ public PrismObject getOldShadow() { return oldShadow; } - public ObjectDelta getDelta() { + public ObjectDelta getDelta() { return delta; } diff --git a/provisioning/provisioning-api/src/main/java/com/evolveum/midpoint/provisioning/api/ResourceEventListener.java b/provisioning/provisioning-api/src/main/java/com/evolveum/midpoint/provisioning/api/ResourceEventListener.java index 73b19fd2ea2..b1716b6c6e1 100644 --- a/provisioning/provisioning-api/src/main/java/com/evolveum/midpoint/provisioning/api/ResourceEventListener.java +++ b/provisioning/provisioning-api/src/main/java/com/evolveum/midpoint/provisioning/api/ResourceEventListener.java @@ -27,6 +27,8 @@ public interface ResourceEventListener extends ProvisioningListener { - public void notifyEvent(ResourceEventDescription eventDescription, Task task, OperationResult parentResult) throws SchemaException, CommunicationException, ConfigurationException, SecurityViolationException, ObjectNotFoundException, GenericConnectorException, ObjectAlreadyExistsException, ExpressionEvaluationException; + void notifyEvent(ResourceEventDescription eventDescription, Task task, OperationResult parentResult) throws SchemaException, + CommunicationException, ConfigurationException, SecurityViolationException, ObjectNotFoundException, + GenericConnectorException, ObjectAlreadyExistsException, ExpressionEvaluationException; } diff --git a/provisioning/provisioning-impl/src/main/java/com/evolveum/midpoint/provisioning/impl/ProvisioningContext.java b/provisioning/provisioning-impl/src/main/java/com/evolveum/midpoint/provisioning/impl/ProvisioningContext.java index cf461f49fc9..57c69618dfd 100644 --- a/provisioning/provisioning-impl/src/main/java/com/evolveum/midpoint/provisioning/impl/ProvisioningContext.java +++ b/provisioning/provisioning-impl/src/main/java/com/evolveum/midpoint/provisioning/impl/ProvisioningContext.java @@ -31,10 +31,7 @@ import com.evolveum.midpoint.util.exception.*; import com.evolveum.midpoint.util.logging.Trace; import com.evolveum.midpoint.util.logging.TraceManager; -import com.evolveum.midpoint.xml.ns._public.common.common_3.CapabilitiesType; -import com.evolveum.midpoint.xml.ns._public.common.common_3.ResourceType; -import com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowKindType; -import com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.*; import com.evolveum.midpoint.xml.ns._public.resource.capabilities_3.CapabilityType; import org.jetbrains.annotations.NotNull; @@ -338,4 +335,10 @@ public PrismContext getPrismContext() { public ItemPath path(Object... components) { return ItemPath.create(components); } + + public CachingStategyType getCachingStrategy() + throws ObjectNotFoundException, SchemaException, CommunicationException, ConfigurationException, + ExpressionEvaluationException { + return ProvisioningUtil.getCachingStrategy(this); + } } diff --git a/provisioning/provisioning-impl/src/main/java/com/evolveum/midpoint/provisioning/impl/ResourceEventListenerImpl.java b/provisioning/provisioning-impl/src/main/java/com/evolveum/midpoint/provisioning/impl/ResourceEventListenerImpl.java index d957dc6b8fa..c7bffc0f0b1 100644 --- a/provisioning/provisioning-impl/src/main/java/com/evolveum/midpoint/provisioning/impl/ResourceEventListenerImpl.java +++ b/provisioning/provisioning-impl/src/main/java/com/evolveum/midpoint/provisioning/impl/ResourceEventListenerImpl.java @@ -21,6 +21,7 @@ import javax.annotation.PostConstruct; import javax.annotation.PreDestroy; +import com.evolveum.midpoint.xml.ns._public.common.common_3.CachingStategyType; import org.apache.commons.lang.Validate; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @@ -33,7 +34,6 @@ import com.evolveum.midpoint.provisioning.api.ResourceEventDescription; import com.evolveum.midpoint.provisioning.api.ResourceEventListener; import com.evolveum.midpoint.provisioning.ucf.api.Change; -import com.evolveum.midpoint.schema.processor.ObjectClassComplexTypeDefinition; import com.evolveum.midpoint.schema.processor.ResourceAttribute; import com.evolveum.midpoint.schema.result.OperationResult; import com.evolveum.midpoint.schema.util.ShadowUtil; @@ -77,44 +77,50 @@ public String getName() { } @Override - public void notifyEvent(ResourceEventDescription eventDescription, Task task, OperationResult parentResult) throws SchemaException, CommunicationException, ConfigurationException, SecurityViolationException, ObjectNotFoundException, GenericConnectorException, ObjectAlreadyExistsException, ExpressionEvaluationException { + public void notifyEvent(ResourceEventDescription eventDescription, Task task, OperationResult parentResult) + throws SchemaException, CommunicationException, ConfigurationException, SecurityViolationException, + ObjectNotFoundException, GenericConnectorException, ObjectAlreadyExistsException, ExpressionEvaluationException { Validate.notNull(eventDescription, "Event description must not be null."); Validate.notNull(task, "Task must not be null."); Validate.notNull(parentResult, "Operation result must not be null"); - LOGGER.trace("Received event notification with the description: {}", eventDescription.debugDump()); + LOGGER.trace("Received event notification with the description: {}", eventDescription.debugDumpLazily()); - if (eventDescription.getCurrentShadow() == null && eventDescription.getDelta() == null){ + if (eventDescription.getCurrentShadow() == null && eventDescription.getDelta() == null) { throw new IllegalStateException("Neither current shadow, nor delta specified. It is required to have at least one of them specified."); } applyDefinitions(eventDescription, parentResult); - PrismObject shadow = null; - - shadow = eventDescription.getShadow(); - + PrismObject shadow = eventDescription.getShadow(); ProvisioningContext ctx = provisioningContextFactory.create(shadow, task, parentResult); ctx.assertDefinition(); Collection> identifiers = ShadowUtil.getPrimaryIdentifiers(shadow); + // TODO reconsider this + if (ctx.getCachingStrategy() == CachingStategyType.PASSIVE) { + if (eventDescription.getCurrentShadow() == null && eventDescription.getOldShadow() != null && eventDescription.getDelta() != null) { + PrismObject newShadow = eventDescription.getOldShadow().clone(); + eventDescription.getDelta().applyTo(newShadow); + eventDescription.setCurrentShadow(newShadow); + } + } + Change change = new Change(identifiers, eventDescription.getCurrentShadow(), eventDescription.getOldShadow(), eventDescription.getDelta()); - ObjectClassComplexTypeDefinition objectClassDefinition = ShadowUtil.getObjectClassDefinition(shadow); - change.setObjectClassDefinition(objectClassDefinition); + change.setObjectClassDefinition(ShadowUtil.getObjectClassDefinition(shadow)); - LOGGER.trace("Start to precess change: {}", change.toString()); + LOGGER.trace("Starting to process change: {}", change); try { - shadowCache.processChange(ctx, change, null, parentResult); + shadowCache.preProcessChange(ctx, change, eventDescription.getOldShadow(), parentResult); } catch (EncryptionException e) { // TODO: better handling throw new SystemException(e.getMessage(), e); } - LOGGER.trace("Change after processing {} . Start synchronizing.", change.toString()); + LOGGER.trace("Processed change {}. Starting synchronizing.", change); shadowCache.processSynchronization(ctx, change, parentResult); - } private void applyDefinitions(ResourceEventDescription eventDescription, diff --git a/provisioning/provisioning-impl/src/main/java/com/evolveum/midpoint/provisioning/impl/ShadowCache.java b/provisioning/provisioning-impl/src/main/java/com/evolveum/midpoint/provisioning/impl/ShadowCache.java index a6f390dee95..efc6ce2df30 100644 --- a/provisioning/provisioning-impl/src/main/java/com/evolveum/midpoint/provisioning/impl/ShadowCache.java +++ b/provisioning/provisioning-impl/src/main/java/com/evolveum/midpoint/provisioning/impl/ShadowCache.java @@ -95,8 +95,8 @@ * process. * * The two principal classes that do the operations are: - * ResourceObjectConvertor: executes operations on resource ShadowManager: - * executes operations in the repository + * ResourceObjectConvertor: executes operations on resource + * ShadowManager: executes operations in the repository * * @author Radovan Semancik * @author Katarina Valalikova @@ -149,7 +149,7 @@ public PrismContext getPrismContext() { return prismContext; } - public PrismObject getShadow(String oid, PrismObject repositoryShadow, + PrismObject getShadow(String oid, PrismObject repositoryShadow, Collection> options, Task task, OperationResult parentResult) throws ObjectNotFoundException, CommunicationException, SchemaException, ConfigurationException, SecurityViolationException, ExpressionEvaluationException, EncryptionException { @@ -379,7 +379,7 @@ private PrismObject processNoFetchGet(ProvisioningContext ctx, if (!GetOperationOptions.isRaw(rootOptions)) { // Even with noFetch we still want to delete expired pending operations. And even delete // the shadow if needed. - repositoryShadow = refreshShadowQick(ctx, repositoryShadow, now, task, parentResult); + repositoryShadow = refreshShadowQuick(ctx, repositoryShadow, now, task, parentResult); } if (repositoryShadow == null) { @@ -1306,7 +1306,7 @@ public PrismObject refreshShadow(PrismObject repoShadow, /** * Used to quickly and efficiently refresh shadow before GET operations. */ - private PrismObject refreshShadowQick(ProvisioningContext ctx, + private PrismObject refreshShadowQuick(ProvisioningContext ctx, PrismObject repoShadow, XMLGregorianCalendar now, Task task, OperationResult parentResult) throws ObjectNotFoundException, SchemaException, CommunicationException, ConfigurationException, ExpressionEvaluationException, EncryptionException { @@ -1948,7 +1948,7 @@ public SearchResultMetadata searchObjectsIterative(final ProvisioningContext ctx } - ObjectQuery createAttributeQuery(ObjectQuery query) throws SchemaException { + private ObjectQuery createAttributeQuery(ObjectQuery query) throws SchemaException { QueryFactory queryFactory = prismContext.queryFactory(); ObjectFilter filter = null; @@ -2359,17 +2359,15 @@ public int synchronize(ResourceShadowDiscriminator shadowCoordinates, PrismPrope ProvisioningContext shadowCtx; PrismObject oldShadow = null; if (changeObjectClassDefinition == null) { - if (change.getObjectDelta() != null && change.getObjectDelta().isDelete()) { + if (change.isDelete()) { oldShadow = change.getOldShadow(); if (oldShadow == null) { - oldShadow = shadowManager.findOrAddShadowFromChangeGlobalContext(ctx, change, - parentResult); - } - if (oldShadow == null) { - LOGGER.debug( - "No old shadow for delete synchronization event {}, we probably did not know about that object anyway, so well be ignoring this event", - change); - continue; + oldShadow = shadowManager.findOrAddShadowFromChangeOnDelete(ctx, change, parentResult); + if (oldShadow == null) { + LOGGER.debug("No old shadow for delete synchronization event {}, we probably did not know about " + + "that object anyway, so well be ignoring this event", change); + continue; + } } shadowCtx = ctx.spawn(oldShadow); } else { @@ -2379,7 +2377,7 @@ public int synchronize(ResourceShadowDiscriminator shadowCoordinates, PrismPrope shadowCtx = ctx.spawn(changeObjectClassDefinition.getTypeName()); } - processChange(shadowCtx, change, oldShadow, parentResult); + preProcessChange(shadowCtx, change, oldShadow, parentResult); // this is the case,when we want to skip processing of change, // because the shadow was not created or found to the resource @@ -2430,14 +2428,13 @@ public int synchronize(ResourceShadowDiscriminator shadowCoordinates, PrismPrope } } - @SuppressWarnings("rawtypes") boolean processSynchronization(ProvisioningContext ctx, Change change, OperationResult parentResult) throws SchemaException, ObjectNotFoundException, ObjectAlreadyExistsException, CommunicationException, ConfigurationException, ExpressionEvaluationException { OperationResult result = parentResult.createSubresult(OP_PROCESS_SYNCHRONIZATION); - boolean successfull = false; + boolean successful; try { ResourceObjectShadowChangeDescription shadowChangeDescription = createResourceShadowChangeDescription( change, ctx.getResource(), ctx.getChannel()); @@ -2446,16 +2443,13 @@ boolean processSynchronization(ProvisioningContext ctx, Change change, Operation LOGGER.trace("Created resource object shadow change description {}", SchemaDebugUtil.prettyPrint(shadowChangeDescription)); } - OperationResult notifyChangeResult = new OperationResult( - ShadowCache.class.getName() + "notifyChange"); + OperationResult notifyChangeResult = new OperationResult(ShadowCache.class.getName() + "notifyChange"); notifyChangeResult.addParam("resourceObjectShadowChangeDescription", shadowChangeDescription.toString()); try { notifyResourceObjectChangeListeners(shadowChangeDescription, ctx.getTask(), notifyChangeResult); notifyChangeResult.recordSuccess(); } catch (RuntimeException ex) { - // recordFatalError(LOGGER, notifyChangeResult, "Synchronization - // error: " + ex.getMessage(), ex); saveAccountResult(shadowChangeDescription, change, notifyChangeResult, result); throw new SystemException("Synchronization error: " + ex.getMessage(), ex); } @@ -2471,10 +2465,9 @@ boolean processSynchronization(ProvisioningContext ctx, Change change, Operation // And we need to modify ResourceObjectChangeListener for that. Keeping all dead // shadows is much easier. // deleteShadowFromRepoIfNeeded(change, result); - successfull = true; - + successful = true; } else { - successfull = false; + successful = false; saveAccountResult(shadowChangeDescription, change, notifyChangeResult, result); } @@ -2488,7 +2481,7 @@ boolean processSynchronization(ProvisioningContext ctx, Change change, Operation throw e; } - return successfull; + return successful; } private void notifyResourceObjectChangeListeners(ResourceObjectShadowChangeDescription change, Task task, @@ -2496,7 +2489,6 @@ private void notifyResourceObjectChangeListeners(ResourceObjectShadowChangeDescr changeNotificationDispatcher.notifyChange(change, task, parentResult); } - @SuppressWarnings("unchecked") private ResourceObjectShadowChangeDescription createResourceShadowChangeDescription( Change change, ResourceType resourceType, String channel) { ResourceObjectShadowChangeDescription shadowChangeDescription = new ResourceObjectShadowChangeDescription(); @@ -2602,62 +2594,58 @@ private void deleteShadowFromRepoIfNeeded(Change change, OperationResult parentR } } - void processChange(ProvisioningContext ctx, Change change, PrismObject oldShadow, + /** + * Manages repository representation of the shadow affected by the change. + * Does no synchronization. + * + * TODO what about cached attributes? Should they be updated here? + */ + void preProcessChange(ProvisioningContext ctx, Change change, PrismObject oldShadow, OperationResult parentResult) throws SchemaException, CommunicationException, ConfigurationException, SecurityViolationException, ObjectNotFoundException, GenericConnectorException, ObjectAlreadyExistsException, ExpressionEvaluationException, EncryptionException { if (oldShadow == null) { oldShadow = shadowManager.findOrAddShadowFromChange(ctx, change, parentResult); + if (oldShadow == null) { + LOGGER.debug("No old shadow for synchronization event {}, the shadow must be gone in the meantime " + + "(this is probably harmless)", change); + return; + } } - if (oldShadow != null) { - shadowCaretaker.applyAttributesDefinition(ctx, oldShadow); + shadowCaretaker.applyAttributesDefinition(ctx, oldShadow); - LOGGER.trace("Processing change, old shadow: {}", ShadowUtil.shortDumpShadow(oldShadow)); + LOGGER.trace("Processing change, old shadow: {}", ShadowUtil.shortDumpShadow(oldShadow)); - // skip setting other attribute when shadow is null - if (oldShadow == null) { - change.setOldShadow(null); - return; - } + ProvisioningUtil.setProtectedFlag(ctx, oldShadow, matchingRuleRegistry, relationRegistry); + change.setOldShadow(oldShadow); - ProvisioningUtil.setProtectedFlag(ctx, oldShadow, matchingRuleRegistry, relationRegistry); - change.setOldShadow(oldShadow); + if (change.getCurrentShadow() != null) { + PrismObject currentShadow = completeShadow(ctx, change.getCurrentShadow(), + oldShadow, false, parentResult); + change.setCurrentShadow(currentShadow); + // TODO: shadowState + shadowManager.updateShadow(ctx, currentShadow, oldShadow, null, parentResult); + } - if (change.getCurrentShadow() != null) { - PrismObject currentShadow = completeShadow(ctx, change.getCurrentShadow(), - oldShadow, false, parentResult); - change.setCurrentShadow(currentShadow); - // TODO: shadowState - shadowManager.updateShadow(ctx, currentShadow, oldShadow, null, parentResult); - } + if (change.getObjectDelta() != null && change.getObjectDelta().getOid() == null) { + change.getObjectDelta().setOid(oldShadow.getOid()); + } - if (change.getObjectDelta() != null && change.getObjectDelta().getOid() == null) { - change.getObjectDelta().setOid(oldShadow.getOid()); + if (change.isDelete()) { + PrismObject currentShadow = change.getCurrentShadow(); + if (currentShadow == null) { + currentShadow = oldShadow.clone(); + change.setCurrentShadow(currentShadow); } - - if (change.getObjectDelta() != null && change.getObjectDelta().isDelete()) { - PrismObject currentShadow = change.getCurrentShadow(); - if (currentShadow == null) { - currentShadow = oldShadow.clone(); - change.setCurrentShadow(currentShadow); - } - ShadowType currentShadowType = currentShadow.asObjectable(); - if (!ShadowUtil.isDead(currentShadowType) || ShadowUtil.isExists(currentShadowType)) { - shadowManager.markShadowTombstone(currentShadow, parentResult); - } + if (!ShadowUtil.isDead(currentShadow) || ShadowUtil.isExists(currentShadow)) { + shadowManager.markShadowTombstone(currentShadow, parentResult); } - - } else { - LOGGER.debug( - "No old shadow for synchronization event {}, the shadow must be gone in the meantime (this is probably harmless)", - change); } - } - public PrismProperty fetchCurrentToken(ResourceShadowDiscriminator shadowCoordinates, + PrismProperty fetchCurrentToken(ResourceShadowDiscriminator shadowCoordinates, OperationResult parentResult) throws ObjectNotFoundException, CommunicationException, SchemaException, ConfigurationException, ExpressionEvaluationException { Validate.notNull(parentResult, "Operation result must not be null."); diff --git a/provisioning/provisioning-impl/src/main/java/com/evolveum/midpoint/provisioning/impl/ShadowManager.java b/provisioning/provisioning-impl/src/main/java/com/evolveum/midpoint/provisioning/impl/ShadowManager.java index 9d0476e0b12..2ddf3689f60 100644 --- a/provisioning/provisioning-impl/src/main/java/com/evolveum/midpoint/provisioning/impl/ShadowManager.java +++ b/provisioning/provisioning-impl/src/main/java/com/evolveum/midpoint/provisioning/impl/ShadowManager.java @@ -165,11 +165,8 @@ public PrismObject lookupLiveShadowInRepository(ProvisioningContext OperationResult parentResult) throws SchemaException, ConfigurationException, ObjectNotFoundException, CommunicationException, ExpressionEvaluationException { - ObjectQuery query = createSearchShadowQueryByPrimaryIdentifier(ctx, resourceShadow, prismContext, - parentResult); - if (LOGGER.isTraceEnabled()) { - LOGGER.trace("Searching for shadow using filter:\n{}", query.debugDump()); - } + ObjectQuery query = createSearchShadowQueryByPrimaryIdentifier(ctx, resourceShadow, prismContext, parentResult); + LOGGER.trace("Searching for shadow using filter:\n{}", DebugUtil.debugDumpLazily(query)); List> foundShadows = repositoryService.searchObjects(ShadowType.class, query, null, parentResult); MiscSchemaUtil.reduceSearchResult(foundShadows); @@ -206,8 +203,7 @@ public PrismObject eliminateDeadShadows(List PrismObject liveShadow = null; for (PrismObject shadow: shadows) { - ShadowType shadowType = shadow.asObjectable(); - if (!ShadowUtil.isDead(shadowType)) { + if (!ShadowUtil.isDead(shadow)) { if (liveShadow == null) { liveShadow = shadow; } else { @@ -424,23 +420,23 @@ private List> getNormalizedValue(PrismProperty attr } // beware, may return null if an shadow that was to be marked as DEAD, was deleted in the meantime - public PrismObject findOrAddShadowFromChange(ProvisioningContext ctx, Change change, - OperationResult parentResult) throws SchemaException, CommunicationException, - ConfigurationException, SecurityViolationException, ObjectNotFoundException, ExpressionEvaluationException, EncryptionException { + PrismObject findOrAddShadowFromChange(ProvisioningContext ctx, Change change, + OperationResult parentResult) throws SchemaException, CommunicationException, + ConfigurationException, ObjectNotFoundException, ExpressionEvaluationException, EncryptionException { // Try to locate existing shadow in the repository - List> accountList = searchShadowByIdenifiers(ctx, change, parentResult); + List> accountList = searchShadowByIdentifiers(ctx, change, parentResult); // We normally do not want dead shadows here. Normally we should not receive any change notifications about dead // shadows anyway. And dead shadows may get into the way. E.g. account is deleted and then it is quickly re-created. // In that case we will get ADD change notification and there is a dead shadow in repo. But we do not want to use that // dead shadow. The notification is about a new (re-create) account. We want to create new shadow. - PrismObject foundShadow = eliminateDeadShadows(accountList, parentResult); + PrismObject foundLiveShadow = eliminateDeadShadows(accountList, parentResult); - if (foundShadow == null) { + if (foundLiveShadow == null) { // account was not found in the repository, create it now - if ((change.getObjectDelta() != null && change.getObjectDelta().getChangeType() == ChangeType.DELETE)) { + if (change.isDelete()) { if (accountList.isEmpty()) { // Delete. No shadow is OK here. return null; @@ -451,135 +447,99 @@ public PrismObject findOrAddShadowFromChange(ProvisioningContext ctx } else { - foundShadow = createNewShadowFromChange(ctx, change, parentResult); + foundLiveShadow = createNewShadowFromChange(ctx, change, parentResult); try { - ConstraintsChecker.onShadowAddOperation(foundShadow.asObjectable()); - String oid = repositoryService.addObject(foundShadow, null, parentResult); - foundShadow.setOid(oid); + ConstraintsChecker.onShadowAddOperation(foundLiveShadow.asObjectable()); + String oid = repositoryService.addObject(foundLiveShadow, null, parentResult); + foundLiveShadow.setOid(oid); if (change.getObjectDelta() != null && change.getObjectDelta().getOid() == null) { change.getObjectDelta().setOid(oid); } } catch (ObjectAlreadyExistsException e) { - parentResult.recordFatalError("Can't add " + foundShadow + " to the repository. Reason: " + e.getMessage(), e); + parentResult.recordFatalError("Can't add " + foundLiveShadow + " to the repository. Reason: " + e.getMessage(), e); throw new IllegalStateException(e.getMessage(), e); } - LOGGER.debug("Added new shadow (from change): {}", foundShadow); + LOGGER.debug("Added new shadow (from change): {}", foundLiveShadow); if (LOGGER.isTraceEnabled()) { - LOGGER.trace("Added new shadow (from change):\n{}", foundShadow.debugDump(1)); + LOGGER.trace("Added new shadow (from change):\n{}", foundLiveShadow.debugDump(1)); } } + } else { + // TODO in the case of delete: should we do here the same as in findOrAddShadowFromChangeOnDelete, i.e. mark the shadow as dead? + // (probably not; it looks like the same is executed in preProcessChange by calling markAsTombstone) } - return foundShadow; + return foundLiveShadow; } - // This is really invoked only for delete case. It is mostly copy&paste with findOrAddShadowFromChange. + // This is really invoked only for delete case. It is partially copy&paste with findOrAddShadowFromChange. // TODO: not very elegant, cleanup - public PrismObject findOrAddShadowFromChangeGlobalContext(ProvisioningContext globalCtx, Change change, + PrismObject findOrAddShadowFromChangeOnDelete(ProvisioningContext globalCtx, Change change, OperationResult parentResult) throws SchemaException, CommunicationException, - ConfigurationException, SecurityViolationException, ObjectNotFoundException, ExpressionEvaluationException, EncryptionException { + ConfigurationException, ObjectNotFoundException, ExpressionEvaluationException { // Try to locate existing shadow in the repository - List> accountList = searchShadowByIdenifiers(globalCtx, change, parentResult); + List> accountList = searchShadowByIdentifiers(globalCtx, change, parentResult); // We normally do not want dead shadows here. Normally we should not receive any change notifications about dead // shadows anyway. And dead shadows may get into the way. E.g. account is deleted and then it is quickly re-created. // In that case we will get ADD change notification and there is a dead shadow in repo. But we do not want to use that // dead shadow. The notification is about a new (re-create) account. We want to create new shadow. PrismObject newShadow = eliminateDeadShadows(accountList, parentResult); - + + assert change.isDelete(); if (newShadow == null) { - - if ((change.getObjectDelta() != null && change.getObjectDelta().getChangeType() == ChangeType.DELETE)) { - if (accountList.isEmpty()) { - // Delete. No shadow is OK here. - return null; - } else { - // Delete of shadow that is already dead. - return accountList.get(0); - } - + if (accountList.isEmpty()) { + // Delete. No shadow is OK here. + return null; } else { - // All situations except delete: create new shadow - newShadow = createNewShadowFromChange(globalCtx, change, parentResult); - - try { - ConstraintsChecker.onShadowAddOperation(newShadow.asObjectable()); - String oid = repositoryService.addObject(newShadow, null, parentResult); - newShadow.setOid(oid); - if (change.getObjectDelta() != null && change.getObjectDelta().getOid() == null) { - change.getObjectDelta().setOid(oid); - } - } catch (ObjectAlreadyExistsException e) { - parentResult.recordFatalError("Can't add " + SchemaDebugUtil.prettyPrint(newShadow) - + " to the repository. Reason: " + e.getMessage(), e); - throw new IllegalStateException(e.getMessage(), e); - } - LOGGER.debug("Added new shadow (from global change): {}", newShadow); - if (LOGGER.isTraceEnabled()) { - LOGGER.trace("Added new shadow (from global change):\n{}", newShadow.debugDump()); - } + // Delete of shadow that is already dead. + return accountList.get(0); } - } else { // Live shadow was found in repository - - if (change.getObjectDelta() != null && change.getObjectDelta().getChangeType() == ChangeType.DELETE) { - List> deadDeltas = prismContext.deltaFor(ShadowType.class) - .item(ShadowType.F_DEAD).replace(true) - .item(ShadowType.F_EXISTS).replace(false) - .asItemDeltas(); - try { - ConstraintsChecker.onShadowModifyOperation(deadDeltas); - repositoryService.modifyObject(ShadowType.class, newShadow.getOid(), deadDeltas, parentResult); - } catch (ObjectAlreadyExistsException e) { - parentResult.recordFatalError( - "Can't add " + newShadow + " to the repository. Reason: " + e.getMessage(), e); - throw new IllegalStateException(e.getMessage(), e); - } catch (ObjectNotFoundException e) { - parentResult.recordWarning("Shadow " + newShadow + " was probably deleted from the repository in the meantime. Exception: " - + e.getMessage(), e); - return null; - } - - ObjectDeltaUtil.applyTo(newShadow, deadDeltas); - } - } + // TODO consider eliminating this, as it is covered by call to markAsTombstone in preProcessChange + List> deadDeltas = prismContext.deltaFor(ShadowType.class) + .item(ShadowType.F_DEAD).replace(true) + .item(ShadowType.F_EXISTS).replace(false) + .asItemDeltas(); + try { + ConstraintsChecker.onShadowModifyOperation(deadDeltas); + repositoryService.modifyObject(ShadowType.class, newShadow.getOid(), deadDeltas, parentResult); + } catch (ObjectAlreadyExistsException e) { + parentResult.recordFatalError( + "Can't add " + newShadow + " to the repository. Reason: " + e.getMessage(), e); + throw new IllegalStateException(e.getMessage(), e); + } catch (ObjectNotFoundException e) { + parentResult.recordWarning("Shadow " + newShadow + " was probably deleted from the repository in the meantime. Exception: " + + e.getMessage(), e); + return null; + } + ObjectDeltaUtil.applyTo(newShadow, deadDeltas); + } return newShadow; } private PrismObject createNewShadowFromChange(ProvisioningContext ctx, Change change, - OperationResult parentResult) throws SchemaException, - CommunicationException, ConfigurationException, - SecurityViolationException, ObjectNotFoundException, ExpressionEvaluationException, EncryptionException { + OperationResult parentResult) throws SchemaException, CommunicationException, ConfigurationException, + ObjectNotFoundException, ExpressionEvaluationException, EncryptionException { + + assert !change.isDelete(); PrismObject shadow = change.getCurrentShadow(); - if (shadow == null){ - //try to look in the delta, if there exists some account to be added - if (change.getObjectDelta() != null) { - if (change.getObjectDelta().isAdd()) { - shadow = (PrismObject) change.getObjectDelta().getObjectToAdd(); - } else if (change.getObjectDelta().isDelete()) { - // Sanity checks. We can remove them later when entire sync code is cleaned up. - ShadowType shadowType = shadow.asObjectable(); - if (!ShadowUtil.isDead(shadowType)) { - throw new IllegalStateException("Deleted "+shadow+" not dead"); - } - if (ShadowUtil.isExists(shadowType)) { - throw new IllegalStateException("Deleted "+shadow+" exists"); - } - } + if (shadow == null) { + if (change.isAdd()) { + shadow = change.getObjectDelta().getObjectToAdd(); + assert shadow != null; + } else { + throw new IllegalStateException("Could not create shadow from change description. Neither current shadow, nor delta containing shadow exists."); } } - if (shadow == null){ - throw new IllegalStateException("Could not create shadow from change description. Neither current shadow, nor delta containing shadow exits."); - } - try { shadow = createRepositoryShadow(ctx, shadow); } catch (SchemaException ex) { @@ -593,13 +553,13 @@ private PrismObject createNewShadowFromChange(ProvisioningContext ct return shadow; } - private List> searchShadowByIdenifiers(ProvisioningContext ctx, Change change, OperationResult parentResult) + private List> searchShadowByIdentifiers(ProvisioningContext ctx, Change change, OperationResult parentResult) throws SchemaException, ConfigurationException, ObjectNotFoundException, CommunicationException, ExpressionEvaluationException { Collection> identifiers = change.getIdentifiers(); ObjectQuery query = createSearchShadowQuery(ctx, identifiers, true, prismContext, parentResult); - List> accountList = null; + List> accountList; try { accountList = repositoryService.searchObjects(ShadowType.class, query, null, parentResult); } catch (SchemaException ex) { @@ -1998,7 +1958,7 @@ public PrismObject markShadowTombstone(PrismObject repoS repositoryService.modifyObject(ShadowType.class, repoShadow.getOid(), shadowChanges, parentResult); } catch (ObjectAlreadyExistsException e) { // Should not happen, this is not a rename - new SystemException(e.getMessage(), e); + throw new SystemException(e.getMessage(), e); } catch (ObjectNotFoundException e) { // Cannot be more dead LOGGER.trace("Attempt to mark shadow {} as tombstone found that no such shadow exists", repoShadow); diff --git a/provisioning/ucf-api/src/main/java/com/evolveum/midpoint/provisioning/ucf/api/Change.java b/provisioning/ucf-api/src/main/java/com/evolveum/midpoint/provisioning/ucf/api/Change.java index cd84f9681fd..8dff4bae96f 100644 --- a/provisioning/ucf-api/src/main/java/com/evolveum/midpoint/provisioning/ucf/api/Change.java +++ b/provisioning/ucf-api/src/main/java/com/evolveum/midpoint/provisioning/ucf/api/Change.java @@ -118,6 +118,14 @@ public boolean isTokenOnly() { return identifiers == null && objectDelta == null && currentShadow == null && token != null; } + public boolean isDelete() { + return objectDelta != null && objectDelta.isDelete(); + } + + // todo what if delta is null, oldShadow is null, current is not null? + public boolean isAdd() { + return objectDelta != null && objectDelta.isAdd(); + } @Override public String toString() { diff --git a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestGrouper.java b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestGrouper.java index c2970014e64..64252dae979 100644 --- a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestGrouper.java +++ b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestGrouper.java @@ -18,13 +18,26 @@ import com.evolveum.icf.dummy.resource.DummyResource; import com.evolveum.icf.dummy.resource.DummySyncStyle; +import com.evolveum.midpoint.common.refinery.RefinedResourceSchemaImpl; +import com.evolveum.midpoint.model.impl.ModelCrudService; import com.evolveum.midpoint.prism.PrismObject; +import com.evolveum.midpoint.prism.delta.DeltaFactory; +import com.evolveum.midpoint.prism.delta.ObjectDelta; +import com.evolveum.midpoint.prism.path.ItemPath; +import com.evolveum.midpoint.schema.DeltaConvertor; +import com.evolveum.midpoint.schema.constants.SchemaConstants; +import com.evolveum.midpoint.schema.processor.ResourceAttributeDefinition; +import com.evolveum.midpoint.schema.processor.ResourceSchema; import com.evolveum.midpoint.schema.result.OperationResult; import com.evolveum.midpoint.task.api.Task; import com.evolveum.midpoint.test.DummyResourceContoller; import com.evolveum.midpoint.test.util.MidPointTestConstants; import com.evolveum.midpoint.test.util.TestUtil; +import com.evolveum.midpoint.xml.ns._public.common.common_3.ResourceObjectShadowChangeDescriptionType; import com.evolveum.midpoint.xml.ns._public.common.common_3.ResourceType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowKindType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowType; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.annotation.DirtiesContext; import org.springframework.test.annotation.DirtiesContext.ClassMode; import org.springframework.test.context.ContextConfiguration; @@ -39,6 +52,8 @@ @DirtiesContext(classMode = ClassMode.AFTER_CLASS) public class TestGrouper extends AbstractStoryTest { + @Autowired private ModelCrudService modelCrudService; + public static final File TEST_DIR = new File(MidPointTestConstants.TEST_RESOURCES_DIR, "grouper"); protected static final File RESOURCE_GROUPER_FILE = new File(TEST_DIR, "resource-grouper.xml"); @@ -48,11 +63,27 @@ public class TestGrouper extends AbstractStoryTest { public static final File ORG_TOP_FILE = new File(TEST_DIR, "org-top.xml"); public static final String ORG_TOP_OID = "8fe3acc3-c689-4f77-9512-3d06b5d00dc2"; + public static final String BANDERSON_USERNAME = "banderson"; + public static final String JLEWIS685_USERNAME = "jlewis685"; + public static final String ALUMNI_NAME = "ref:alumni"; + public static final String STAFF_NAME = "ref:staff"; + + public static final String GROUPER_USER_INTENT = "subject"; + public static final String GROUPER_GROUP_INTENT = "group"; + protected static DummyResource dummyResourceGrouper; protected static DummyResourceContoller dummyResourceCtlGrouper; protected ResourceType resourceDummyGrouperType; protected PrismObject resourceDummyGrouper; + protected static final File SHADOW_BANDERSON_FILE = new File(TEST_DIR, "shadow-banderson.xml"); + protected static final File SHADOW_BANDERSON_WITH_GROUPS_FILE = new File(TEST_DIR, "shadow-banderson-with-groups.xml"); + protected static final File SHADOW_JLEWIS685_FILE = new File(TEST_DIR, "shadow-jlewis685.xml"); + protected static final File SHADOW_ALUMNI_FILE = new File(TEST_DIR, "shadow-alumni.xml"); + protected static final File SHADOW_STAFF_FILE = new File(TEST_DIR, "shadow-staff.xml"); + + private String lewisShadowOid; + @Override protected String getTopOrgOid() { return ORG_TOP_OID; @@ -65,10 +96,12 @@ public void initSystem(Task initTask, OperationResult initResult) throws Excepti // Resources dummyResourceCtlGrouper = DummyResourceContoller.create(RESOURCE_GROUPER_ID, resourceDummyGrouper); dummyResourceGrouper = dummyResourceCtlGrouper.getDummyResource(); + dummyResourceGrouper.setSyncStyle(DummySyncStyle.SMART); + dummyResourceGrouper.populateWithDefaultSchema(); + resourceDummyGrouper = importAndGetObjectFromFile(ResourceType.class, RESOURCE_GROUPER_FILE, RESOURCE_GROUPER_OID, initTask, initResult); resourceDummyGrouperType = resourceDummyGrouper.asObjectable(); dummyResourceCtlGrouper.setResource(resourceDummyGrouper); - dummyResourceGrouper.setSyncStyle(DummySyncStyle.SMART); // Org importObjectFromFile(ORG_TOP_FILE, initResult); @@ -86,4 +119,240 @@ public void test000Sanity() throws Exception { dumpOrgTree(); } + /** + * MEMBER_ADD event for banderson. + */ + @Test + public void test100AddAnderson() throws Exception { + final String TEST_NAME = "test100AddAnderson"; + TestUtil.displayTestTitle(this, TEST_NAME); + Task task = taskManager.createTaskInstance(TestGrouper.class.getName() + "." + TEST_NAME); + OperationResult result = task.getResult(); + + // GIVEN + + PrismObject bandersonShadow = prismContext.parseObject(SHADOW_BANDERSON_FILE); + ResourceObjectShadowChangeDescriptionType change = new ResourceObjectShadowChangeDescriptionType(); + ObjectDelta addDelta = DeltaFactory.Object.createAddDelta(bandersonShadow); + change.setObjectDelta(DeltaConvertor.toObjectDeltaType(addDelta)); + change.setChannel(SchemaConstants.CHANGE_CHANNEL_LIVE_SYNC_URI); + + // WHEN + + modelCrudService.notifyChange(change, result, task); + + // THEN + + result.computeStatus(); + TestUtil.assertSuccess(result); + + assertUserAfterByUsername(BANDERSON_USERNAME) + .displayWithProjections() + .links() + .single() + .resolveTarget() + .assertKind(ShadowKindType.ACCOUNT) + .assertIntent(GROUPER_USER_INTENT) + .assertResource(RESOURCE_GROUPER_OID); + } + + /** + * MEMBER_ADD event for jlewis685. + */ + @Test + public void test105AddLewis() throws Exception { + final String TEST_NAME = "test105AddLewis"; + TestUtil.displayTestTitle(this, TEST_NAME); + Task task = taskManager.createTaskInstance(TestGrouper.class.getName() + "." + TEST_NAME); + OperationResult result = task.getResult(); + + // GIVEN + + PrismObject lewisShadow = prismContext.parseObject(SHADOW_JLEWIS685_FILE); + ResourceObjectShadowChangeDescriptionType change = new ResourceObjectShadowChangeDescriptionType(); + ObjectDelta addDelta = DeltaFactory.Object.createAddDelta(lewisShadow); + change.setObjectDelta(DeltaConvertor.toObjectDeltaType(addDelta)); + change.setChannel(SchemaConstants.CHANGE_CHANNEL_LIVE_SYNC_URI); + + // WHEN + + modelCrudService.notifyChange(change, result, task); + + // THEN + + result.computeStatus(); + TestUtil.assertSuccess(result); + + lewisShadowOid = assertUserAfterByUsername(JLEWIS685_USERNAME) + .displayWithProjections() + .links() + .single() + .resolveTarget() + .assertKind(ShadowKindType.ACCOUNT) + .assertIntent(GROUPER_USER_INTENT) + .assertResource(RESOURCE_GROUPER_OID) + .end() + .getOid(); + System.out.println("lewis shadow OID = " + lewisShadowOid); + } + + /** + * GROUP_ADD event for ref:alumni. + */ + @Test + public void test110AddAlumni() throws Exception { + final String TEST_NAME = "test110AddAlumni"; + TestUtil.displayTestTitle(this, TEST_NAME); + Task task = taskManager.createTaskInstance(TestGrouper.class.getName() + "." + TEST_NAME); + OperationResult result = task.getResult(); + + // GIVEN + + PrismObject alumniShadow = prismContext.parseObject(SHADOW_ALUMNI_FILE); + ResourceObjectShadowChangeDescriptionType change = new ResourceObjectShadowChangeDescriptionType(); + ObjectDelta addDelta = DeltaFactory.Object.createAddDelta(alumniShadow); + change.setObjectDelta(DeltaConvertor.toObjectDeltaType(addDelta)); + change.setChannel(SchemaConstants.CHANGE_CHANNEL_LIVE_SYNC_URI); + + // WHEN + + modelCrudService.notifyChange(change, result, task); + + // THEN + + result.computeStatus(); + TestUtil.assertSuccess(result); + + assertOrgByName(ALUMNI_NAME, "after") + .displayWithProjections() + .links() + .single() + .resolveTarget() + .assertKind(ShadowKindType.ENTITLEMENT) + .assertIntent(GROUPER_GROUP_INTENT) + .assertResource(RESOURCE_GROUPER_OID); + } + + /** + * GROUP_ADD event for ref:staff. + */ + @Test + public void test120AddStaff() throws Exception { + final String TEST_NAME = "test120AddStaff"; + TestUtil.displayTestTitle(this, TEST_NAME); + Task task = taskManager.createTaskInstance(TestGrouper.class.getName() + "." + TEST_NAME); + OperationResult result = task.getResult(); + + // GIVEN + + PrismObject staffShadow = prismContext.parseObject(SHADOW_STAFF_FILE); + ResourceObjectShadowChangeDescriptionType change = new ResourceObjectShadowChangeDescriptionType(); + ObjectDelta addDelta = DeltaFactory.Object.createAddDelta(staffShadow); + change.setObjectDelta(DeltaConvertor.toObjectDeltaType(addDelta)); + change.setChannel(SchemaConstants.CHANGE_CHANNEL_LIVE_SYNC_URI); + + // WHEN + + modelCrudService.notifyChange(change, result, task); + + // THEN + + result.computeStatus(); + TestUtil.assertSuccess(result); + + assertOrgByName(STAFF_NAME, "after") + .displayWithProjections() + .links() + .single() + .resolveTarget() + .assertKind(ShadowKindType.ENTITLEMENT) + .assertIntent(GROUPER_GROUP_INTENT) + .assertResource(RESOURCE_GROUPER_OID); + } + + /** + * Adding ref:alumni and ref:staff membership for banderson "the old way" (i.e. by providing full current shadow). + */ + @Test + public void test200AddGroupsForAnderson() throws Exception { + final String TEST_NAME = "test200AddGroupsForAnderson"; + TestUtil.displayTestTitle(this, TEST_NAME); + Task task = taskManager.createTaskInstance(TestGrouper.class.getName() + "." + TEST_NAME); + OperationResult result = task.getResult(); + + // GIVEN + + PrismObject bandersonShadow = prismContext.parseObject(SHADOW_BANDERSON_WITH_GROUPS_FILE); + ResourceObjectShadowChangeDescriptionType change = new ResourceObjectShadowChangeDescriptionType(); + change.setCurrentShadow(bandersonShadow.asObjectable()); + change.setChannel(SchemaConstants.CHANGE_CHANNEL_LIVE_SYNC_URI); + + // WHEN + + modelCrudService.notifyChange(change, result, task); + + // THEN + + result.computeStatus(); + TestUtil.assertSuccess(result); + + assertUserAfterByUsername(BANDERSON_USERNAME) + .displayWithProjections() + .assertOrganizationalUnits(ALUMNI_NAME, STAFF_NAME) + .links() + .single() + .resolveTarget() + .assertKind(ShadowKindType.ACCOUNT) + .assertIntent(GROUPER_USER_INTENT) + .assertResource(RESOURCE_GROUPER_OID) + .display("shadow after"); + } + + /** + * Adding ref:alumni membership for jlewis685 "the new way" (i.e. by a delta). + */ + @Test + public void test210AddGroupsForLewis() throws Exception { + final String TEST_NAME = "test210AddGroupsForLewis"; + TestUtil.displayTestTitle(this, TEST_NAME); + Task task = taskManager.createTaskInstance(TestGrouper.class.getName() + "." + TEST_NAME); + OperationResult result = task.getResult(); + + // GIVEN + + ResourceSchema schema = RefinedResourceSchemaImpl.getResourceSchema(resourceDummyGrouper, prismContext); + assert schema != null; + ResourceAttributeDefinition privilegeDefinition = schema.findDefaultObjectClassDefinition(ShadowKindType.ACCOUNT) + .findAttributeDefinition(DummyResourceContoller.DUMMY_ENTITLEMENT_PRIVILEGE_NAME); + ObjectDelta delta = prismContext.deltaFor(ShadowType.class) + .item(ItemPath.create(ShadowType.F_ATTRIBUTES, DummyResourceContoller.DUMMY_ENTITLEMENT_PRIVILEGE_NAME), privilegeDefinition) + .add(ALUMNI_NAME) + .asObjectDeltaCast(lewisShadowOid); + + ResourceObjectShadowChangeDescriptionType change = new ResourceObjectShadowChangeDescriptionType(); + change.setObjectDelta(DeltaConvertor.toObjectDeltaType(delta)); + change.setOldShadowOid(lewisShadowOid); + change.setChannel(SchemaConstants.CHANGE_CHANNEL_LIVE_SYNC_URI); + + // WHEN + + modelCrudService.notifyChange(change, result, task); + + // THEN + + result.computeStatus(); + TestUtil.assertSuccess(result); + + assertUserAfterByUsername(JLEWIS685_USERNAME) + .displayWithProjections() + .assertOrganizationalUnits(ALUMNI_NAME) + .links() + .single() + .resolveTarget() + .assertKind(ShadowKindType.ACCOUNT) + .assertIntent(GROUPER_USER_INTENT) + .assertResource(RESOURCE_GROUPER_OID) + .display("shadow after"); + } + } diff --git a/testing/story/src/test/resources/grouper/resource-grouper.xml b/testing/story/src/test/resources/grouper/resource-grouper.xml index b92e04ec61b..88e61c3ee82 100644 --- a/testing/story/src/test/resources/grouper/resource-grouper.xml +++ b/testing/story/src/test/resources/grouper/resource-grouper.xml @@ -53,6 +53,22 @@ subject ri:AccountObjectClass true + + icfs:name + + + name + + + + + ri:privileges + + + organizationalUnit + + + entitlement @@ -103,6 +119,9 @@ unmatched + + http://midpoint.evolveum.com/xml/ns/public/model/action-3#addFocus + @@ -144,4 +163,14 @@ + + + + true + + + + + passive + diff --git a/testing/story/src/test/resources/grouper/shadow-alumni.xml b/testing/story/src/test/resources/grouper/shadow-alumni.xml new file mode 100644 index 00000000000..031430ca7ad --- /dev/null +++ b/testing/story/src/test/resources/grouper/shadow-alumni.xml @@ -0,0 +1,29 @@ + + + + ref:alumni + + ri:CustomprivilegeObjectClass + entitlement + group + + ref:alumni + e91de1a2ba17474a871655064eeaf186 + + \ No newline at end of file diff --git a/testing/story/src/test/resources/grouper/shadow-banderson-with-groups.xml b/testing/story/src/test/resources/grouper/shadow-banderson-with-groups.xml new file mode 100644 index 00000000000..58536dcd3f4 --- /dev/null +++ b/testing/story/src/test/resources/grouper/shadow-banderson-with-groups.xml @@ -0,0 +1,31 @@ + + + + banderson + + ri:AccountObjectClass + account + subject + + banderson + banderson + ref:alumni + ref:staff + + \ No newline at end of file diff --git a/testing/story/src/test/resources/grouper/shadow-banderson.xml b/testing/story/src/test/resources/grouper/shadow-banderson.xml new file mode 100644 index 00000000000..1efdfff5b5c --- /dev/null +++ b/testing/story/src/test/resources/grouper/shadow-banderson.xml @@ -0,0 +1,29 @@ + + + + banderson + + ri:AccountObjectClass + account + subject + + banderson + banderson + + \ No newline at end of file diff --git a/testing/story/src/test/resources/grouper/shadow-jlewis685.xml b/testing/story/src/test/resources/grouper/shadow-jlewis685.xml new file mode 100644 index 00000000000..b38411f1233 --- /dev/null +++ b/testing/story/src/test/resources/grouper/shadow-jlewis685.xml @@ -0,0 +1,29 @@ + + + + jlewis685 + + ri:AccountObjectClass + account + subject + + jlewis685 + jlewis685 + + \ No newline at end of file diff --git a/testing/story/src/test/resources/grouper/shadow-staff.xml b/testing/story/src/test/resources/grouper/shadow-staff.xml new file mode 100644 index 00000000000..dd3468c0942 --- /dev/null +++ b/testing/story/src/test/resources/grouper/shadow-staff.xml @@ -0,0 +1,29 @@ + + + + ref:staff + + ri:CustomprivilegeObjectClass + entitlement + group + + ref:staff + 432895fed53280163308a8230019583b + + \ No newline at end of file From caf359b9d7aa3091ef01e65e96555b69558b5d68 Mon Sep 17 00:00:00 2001 From: kate Date: Thu, 7 Feb 2019 00:03:11 +0100 Subject: [PATCH 009/224] schrodinger test fix --- .../impl/component/icon/CompositedIconBuilder.java | 11 +++++++++-- .../component/user/UserAssignmentsTab.java | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/gui/impl/component/icon/CompositedIconBuilder.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/gui/impl/component/icon/CompositedIconBuilder.java index 53147387076..63dbcb15a0c 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/gui/impl/component/icon/CompositedIconBuilder.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/gui/impl/component/icon/CompositedIconBuilder.java @@ -40,7 +40,10 @@ public CompositedIcon build() { private void setBasicIcon(String icon, String style) { StringBuilder sb = new StringBuilder(icon); - sb.append(" ").append(style); + if (StringUtils.isNotEmpty(basicIcon)) { + sb.append(" "); + } + sb.append(style); basicIcon = sb.toString(); } @@ -58,7 +61,11 @@ public CompositedIconBuilder setBasicIcon(String icon, IconCssStyle style) { public CompositedIconBuilder setBasicIcon(String icon, IconCssStyle style, String additionalCssClass) { additionalCssClass = additionalCssClass + " " + validateInput(icon, style, true); - setBasicIcon(icon, style.getBasicCssClass() + " " + additionalCssClass); + if (additionalCssClass == null || StringUtils.isEmpty(additionalCssClass.trim())){ + setBasicIcon(icon, style.getBasicCssClass()); + } else { + setBasicIcon(icon, style.getBasicCssClass() + " " + additionalCssClass); + } return this; } diff --git a/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/user/UserAssignmentsTab.java b/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/user/UserAssignmentsTab.java index 9b96f0728d9..9f642e484f7 100644 --- a/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/user/UserAssignmentsTab.java +++ b/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/user/UserAssignmentsTab.java @@ -75,7 +75,7 @@ public AbstractTableWithPrismView unassignByName(String name } public FocusSetAssignmentsModal clickAddAssignemnt() { - $(Schrodinger.byElementAttributeValue("i", "class", "fa fa-plus")) + $(Schrodinger.byElementAttributeValue("i", "class", "fe fe-assignment")) .waitUntil(Condition.appears, MidPoint.TIMEOUT_DEFAULT_2_S).click(); SelenideElement modalElement = $(Schrodinger.byElementAttributeValue("div", "aria-labelledby", "Select object(s)")) From fa1705ff4388c980f4322bf03933b9d3ab9d9269 Mon Sep 17 00:00:00 2001 From: Pavol Mederly Date: Thu, 7 Feb 2019 13:19:02 +0100 Subject: [PATCH 010/224] Remove task only if in CLOSED state (MID-5033) It looks like that when re-scheduling already closed single-run tasks they keep their completionTimestamp set. And so they are eventually cleaned up. This is an immediate fix, requiring tasks that are to be cleaned to have also execution status = CLOSED. See also MID-5133. --- .../midpoint/task/quartzimpl/TaskManagerQuartzImpl.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/TaskManagerQuartzImpl.java b/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/TaskManagerQuartzImpl.java index 187b0a1a121..c17355f9422 100644 --- a/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/TaskManagerQuartzImpl.java +++ b/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/TaskManagerQuartzImpl.java @@ -2151,7 +2151,8 @@ public void cleanupTasks(CleanupPolicyType policy, Task executionTask, Operation List> obsoleteTasks; try { ObjectQuery obsoleteTasksQuery = prismContext.queryFor(TaskType.class) - .item(TaskType.F_COMPLETION_TIMESTAMP).le(timeXml) + .item(TaskType.F_EXECUTION_STATUS).eq(TaskExecutionStatusType.CLOSED) + .and().item(TaskType.F_COMPLETION_TIMESTAMP).le(timeXml) .and().item(TaskType.F_PARENT).isNull() .build(); obsoleteTasks = repositoryService.searchObjects(TaskType.class, obsoleteTasksQuery, null, result); From bccb9d032dd8123b45b9611ebee6fd6875b13d26 Mon Sep 17 00:00:00 2001 From: Pavol Mederly Date: Thu, 7 Feb 2019 13:19:02 +0100 Subject: [PATCH 011/224] Remove task only if in CLOSED state (MID-5033) It looks like that when re-scheduling already closed single-run tasks they keep their completionTimestamp set. And so they are eventually cleaned up. This is an immediate fix, requiring tasks that are to be cleaned to have also execution status = CLOSED. See also MID-5133. --- .../midpoint/task/quartzimpl/TaskManagerQuartzImpl.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/TaskManagerQuartzImpl.java b/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/TaskManagerQuartzImpl.java index 187b0a1a121..c17355f9422 100644 --- a/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/TaskManagerQuartzImpl.java +++ b/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/TaskManagerQuartzImpl.java @@ -2151,7 +2151,8 @@ public void cleanupTasks(CleanupPolicyType policy, Task executionTask, Operation List> obsoleteTasks; try { ObjectQuery obsoleteTasksQuery = prismContext.queryFor(TaskType.class) - .item(TaskType.F_COMPLETION_TIMESTAMP).le(timeXml) + .item(TaskType.F_EXECUTION_STATUS).eq(TaskExecutionStatusType.CLOSED) + .and().item(TaskType.F_COMPLETION_TIMESTAMP).le(timeXml) .and().item(TaskType.F_PARENT).isNull() .build(); obsoleteTasks = repositoryService.searchObjects(TaskType.class, obsoleteTasksQuery, null, result); From 7ce1f01a2bc11630233af54181722fc36d941e37 Mon Sep 17 00:00:00 2001 From: Radovan Semancik Date: Thu, 7 Feb 2019 16:03:05 +0100 Subject: [PATCH 012/224] Attempts to reproduce ConnId thread issues (MID-5099). Not successful. --- .../midpoint/schema/util/ObjectTypeUtil.java | 11 +- .../midpoint/test/ldap/OpenDJController.java | 3 +- .../test/AbstractModelIntegrationTest.java | 4 + .../resources/ldap-sync-massive/kraken.ldif | 10 + .../ldap-sync-massive/resource-opendj-bad.xml | 249 ++++++++++++++++++ .../ldap-sync-massive/resource-opendj.xml | 237 +++++++++++++++++ .../ldap-sync-massive/task-live-sync.xml | 44 ++++ .../resources/ldap-sync-massive/will.ldif | 15 ++ testing/story/testng-integration.xml | 1 + 9 files changed, 572 insertions(+), 2 deletions(-) create mode 100644 testing/story/src/test/resources/ldap-sync-massive/kraken.ldif create mode 100644 testing/story/src/test/resources/ldap-sync-massive/resource-opendj-bad.xml create mode 100644 testing/story/src/test/resources/ldap-sync-massive/resource-opendj.xml create mode 100644 testing/story/src/test/resources/ldap-sync-massive/task-live-sync.xml create mode 100644 testing/story/src/test/resources/ldap-sync-massive/will.ldif diff --git a/infra/schema/src/main/java/com/evolveum/midpoint/schema/util/ObjectTypeUtil.java b/infra/schema/src/main/java/com/evolveum/midpoint/schema/util/ObjectTypeUtil.java index 95d451d7819..d5157468a50 100644 --- a/infra/schema/src/main/java/com/evolveum/midpoint/schema/util/ObjectTypeUtil.java +++ b/infra/schema/src/main/java/com/evolveum/midpoint/schema/util/ObjectTypeUtil.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2017 Evolveum + * Copyright (c) 2010-2019 Evolveum * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -583,6 +583,15 @@ public static T getExtensionItemRealValue(@Nullable ExtensionType extension, Item item = extension.asPrismContainerValue().findItem(ItemName.fromQName(itemName)); return item != null ? (T) item.getRealValue() : null; } + + public static T getExtensionItemRealValue(@NotNull PrismObject object, @NotNull QName itemName) { + PrismContainer extension = object.getExtension(); + if (extension == null) { + return null; + } + Item item = extension.findItem(ItemName.fromQName(itemName)); + return item != null ? (T) item.getRealValue() : null; + } public static void normalizeRelation(ObjectReferenceType reference, RelationRegistry relationRegistry) { if (reference != null) { diff --git a/infra/test-util/src/main/java/com/evolveum/midpoint/test/ldap/OpenDJController.java b/infra/test-util/src/main/java/com/evolveum/midpoint/test/ldap/OpenDJController.java index 719a6c5ea16..82c5db3d8ef 100755 --- a/infra/test-util/src/main/java/com/evolveum/midpoint/test/ldap/OpenDJController.java +++ b/infra/test-util/src/main/java/com/evolveum/midpoint/test/ldap/OpenDJController.java @@ -754,11 +754,12 @@ public void addEntry(Entry ldapEntry) { } } - public void addEntry(String ldif) throws IOException, LDIFException { + public Entry addEntry(String ldif) throws IOException, LDIFException { LDIFImportConfig importConfig = new LDIFImportConfig(IOUtils.toInputStream(ldif, "utf-8")); LDIFReader ldifReader = new LDIFReader(importConfig); Entry ldifEntry = ldifReader.readEntry(); addEntry(ldifEntry); + return ldifEntry; } public ChangeRecordEntry executeRenameChange(File file) throws LDIFException, IOException{ diff --git a/model/model-test/src/main/java/com/evolveum/midpoint/model/test/AbstractModelIntegrationTest.java b/model/model-test/src/main/java/com/evolveum/midpoint/model/test/AbstractModelIntegrationTest.java index bcaa6ecbd66..7126bed4a86 100644 --- a/model/model-test/src/main/java/com/evolveum/midpoint/model/test/AbstractModelIntegrationTest.java +++ b/model/model-test/src/main/java/com/evolveum/midpoint/model/test/AbstractModelIntegrationTest.java @@ -3134,6 +3134,10 @@ protected OperationResult waitForTaskNextRunAssertSuccess(Task origTask, final b return taskResult; } + protected OperationResult waitForTaskNextRun(final String taskOid) throws Exception { + return waitForTaskNextRun(taskOid, false, DEFAULT_TASK_WAIT_TIMEOUT, false); + } + protected OperationResult waitForTaskNextRun(final String taskOid, final boolean checkSubresult, final int timeout) throws Exception { return waitForTaskNextRun(taskOid, checkSubresult, timeout, false); } diff --git a/testing/story/src/test/resources/ldap-sync-massive/kraken.ldif b/testing/story/src/test/resources/ldap-sync-massive/kraken.ldif new file mode 100644 index 00000000000..27c3d35afcf --- /dev/null +++ b/testing/story/src/test/resources/ldap-sync-massive/kraken.ldif @@ -0,0 +1,10 @@ +dn: uid=kraken,ou=People,dc=example,dc=com +uid: kraken +cn: Kraken Krakenoff +sn: Kraken +givenname: Krakenoff +objectclass: top +objectclass: person +objectclass: organizationalPerson +objectclass: inetOrgPerson + diff --git a/testing/story/src/test/resources/ldap-sync-massive/resource-opendj-bad.xml b/testing/story/src/test/resources/ldap-sync-massive/resource-opendj-bad.xml new file mode 100644 index 00000000000..272fcab3233 --- /dev/null +++ b/testing/story/src/test/resources/ldap-sync-massive/resource-opendj-bad.xml @@ -0,0 +1,249 @@ + + + + + + + + Embedded Test OpenDJ + + + Dummy description, just for the test + + + c:connectorType + com.evolveum.polygon.connector.ldap.LdapConnector + + + + + + + + 10389 + localhost + dc=example,dc=com + cn=directory manager + secret + auto + entryUUID + ds-pwp-account-disabled + isMemberOf + + + + false + false + false + + + + 1 + 3 + + + + 1 + + + + + + + + account + default + Default Account + true + ri:inetOrgPerson + + ri:dn + Distinguished Name + + + + $user/name + + + + + + + + + ri:cn + Common Name + + + fullName + + + + weak + + fullName + + + + + + ri:sn + + + familyName + + + + weak + + familyName + + + + + + ri:givenName + + + givenName + + + + weak + + givenName + + + + + + ri:uid + + + weak + + $user/name + + + + weak + + name + + + + + + + + http://prism.evolveum.com/xml/ns/public/matching-rule-3#stringIgnoreCase + attributes/ri:dn + uid=idm,ou=Administrators,dc=example,dc=com + + + + + + + + + + + + + + + + + + + + + + ri:ds-pwp-account-disabled + + true + + + + + + + + true + ri:inetOrgPerson + + + + declare namespace c="http://midpoint.evolveum.com/xml/ns/public/common/common-3"; + c:name + + + + declare namespace c="http://midpoint.evolveum.com/xml/ns/public/common/common-3"; + declare namespace dj="http://midpoint.evolveum.com/xml/ns/public/resource/instance/ef2bc95b-76e0-59e2-86d6-3d4f02d3ffff"; + $c:account/c:attributes/dj:uid + + + + + + linked + true + + + deleted + true + + http://midpoint.evolveum.com/xml/ns/public/model/action-3#unlink + + + + unlinked + true + + http://midpoint.evolveum.com/xml/ns/public/model/action-3#link + + + + unmatched + true + + http://midpoint.evolveum.com/xml/ns/public/model/action-3#addFocus + + + + + + diff --git a/testing/story/src/test/resources/ldap-sync-massive/resource-opendj.xml b/testing/story/src/test/resources/ldap-sync-massive/resource-opendj.xml new file mode 100644 index 00000000000..b65e3d10058 --- /dev/null +++ b/testing/story/src/test/resources/ldap-sync-massive/resource-opendj.xml @@ -0,0 +1,237 @@ + + + + + + Embedded Test OpenDJ + + + Dummy description, just for the test + + + c:connectorType + com.evolveum.polygon.connector.ldap.LdapConnector + + + + + + + + 10389 + localhost + dc=example,dc=com + cn=directory manager + secret + auto + entryUUID + ds-pwp-account-disabled + isMemberOf + + + + false + false + false + + + + + + + + account + default + Default Account + true + ri:inetOrgPerson + + ri:dn + Distinguished Name + + + + $user/name + + + + + + + + + ri:cn + Common Name + + + fullName + + + + weak + + fullName + + + + + + ri:sn + + + familyName + + + + weak + + familyName + + + + + + ri:givenName + + + givenName + + + + weak + + givenName + + + + + + ri:uid + + + weak + + $user/name + + + + weak + + name + + + + + + + + http://prism.evolveum.com/xml/ns/public/matching-rule-3#stringIgnoreCase + attributes/ri:dn + uid=idm,ou=Administrators,dc=example,dc=com + + + + + + + + + + + + + + + + + + + + + + ri:ds-pwp-account-disabled + + true + + + + + + + + true + ri:inetOrgPerson + + + + declare namespace c="http://midpoint.evolveum.com/xml/ns/public/common/common-3"; + c:name + + + + declare namespace c="http://midpoint.evolveum.com/xml/ns/public/common/common-3"; + declare namespace dj="http://midpoint.evolveum.com/xml/ns/public/resource/instance/ef2bc95b-76e0-59e2-86d6-3d4f02d3ffff"; + $c:account/c:attributes/dj:uid + + + + + + linked + true + + + deleted + true + + http://midpoint.evolveum.com/xml/ns/public/model/action-3#unlink + + + + unlinked + true + + http://midpoint.evolveum.com/xml/ns/public/model/action-3#link + + + + unmatched + true + + http://midpoint.evolveum.com/xml/ns/public/model/action-3#addFocus + + + + + + diff --git a/testing/story/src/test/resources/ldap-sync-massive/task-live-sync.xml b/testing/story/src/test/resources/ldap-sync-massive/task-live-sync.xml new file mode 100644 index 00000000000..9b030a5ecaf --- /dev/null +++ b/testing/story/src/test/resources/ldap-sync-massive/task-live-sync.xml @@ -0,0 +1,44 @@ + + + + + + Live Sync: OpenDJ + + + ri:inetOrgPerson + + + eba4a816-2a05-11e9-9123-03a2334b9b4c + + runnable + + http://midpoint.evolveum.com/xml/ns/public/model/synchronization/task/live-sync/handler-3 + + recurring + tight + + 1 + + + diff --git a/testing/story/src/test/resources/ldap-sync-massive/will.ldif b/testing/story/src/test/resources/ldap-sync-massive/will.ldif new file mode 100644 index 00000000000..2f4de887c57 --- /dev/null +++ b/testing/story/src/test/resources/ldap-sync-massive/will.ldif @@ -0,0 +1,15 @@ +dn: uid=will,ou=People,dc=example,dc=com +uid: will +cn: Will Turner +sn: Turner +givenname: Will +objectclass: top +objectclass: person +objectclass: organizationalPerson +objectclass: inetOrgPerson +l: Caribbean +mail: will.turner@blackpearl.com +telephonenumber: +1 408 555 1234 +facsimiletelephonenumber: +1 408 555 4321 +userpassword: supersecret + diff --git a/testing/story/testng-integration.xml b/testing/story/testng-integration.xml index 57ca7dcee62..aba8c2298ea 100644 --- a/testing/story/testng-integration.xml +++ b/testing/story/testng-integration.xml @@ -58,6 +58,7 @@ + From 5621d8574ce58ad669f1b928403fa138c876912e Mon Sep 17 00:00:00 2001 From: kate Date: Thu, 7 Feb 2019 17:15:14 +0100 Subject: [PATCH 013/224] more schrodinger test fixes --- .../resources/localization/schema.properties | 1 + .../testing/schrodinger/TestBase.java | 2 ++ .../schrodinger/scenarios/AccountTests.java | 19 ++++++++----------- .../scenarios/OrganizationStructureTests.java | 12 +++++++----- .../scenarios/SynchronizationTests.java | 6 +++--- .../page/resource/ViewResourcePage.java | 2 +- 6 files changed, 22 insertions(+), 20 deletions(-) diff --git a/infra/schema/src/main/resources/localization/schema.properties b/infra/schema/src/main/resources/localization/schema.properties index 1075f92095b..9560c93b2c3 100755 --- a/infra/schema/src/main/resources/localization/schema.properties +++ b/infra/schema/src/main/resources/localization/schema.properties @@ -1227,3 +1227,4 @@ ArchetypePolicyType.display=Display ArchetypePolicyType.conflictResolution=Conflict resolution ArchetypePolicyType.lifecycleStateModel=Lifecycle state model ArchetypePolicyType.applicablePolicies=Applicable policies +ConfigurationType.configurationProperties=Configuration properties \ No newline at end of file diff --git a/testing/schrodingertest/src/test/java/com/evolveum/midpoint/testing/schrodinger/TestBase.java b/testing/schrodingertest/src/test/java/com/evolveum/midpoint/testing/schrodinger/TestBase.java index 89bff2abc67..564925ad7be 100644 --- a/testing/schrodingertest/src/test/java/com/evolveum/midpoint/testing/schrodinger/TestBase.java +++ b/testing/schrodingertest/src/test/java/com/evolveum/midpoint/testing/schrodinger/TestBase.java @@ -47,6 +47,8 @@ public abstract class TestBase { public static final String PROPERTY_NAME_USER_HOME = "user.home"; public static final String PROPERTY_NAME_FILE_SEPARATOR = "file.separator"; + protected static final String CSV_RESOURCE_ATTR_UNIQUE= "Unique attribute name"; + private static final Logger LOG = LoggerFactory.getLogger(TestBase.class); protected static File CSV_TARGET_DIR; diff --git a/testing/schrodingertest/src/test/java/com/evolveum/midpoint/testing/schrodinger/scenarios/AccountTests.java b/testing/schrodingertest/src/test/java/com/evolveum/midpoint/testing/schrodinger/scenarios/AccountTests.java index f9b350c9687..18d2d1299a2 100644 --- a/testing/schrodingertest/src/test/java/com/evolveum/midpoint/testing/schrodinger/scenarios/AccountTests.java +++ b/testing/schrodingertest/src/test/java/com/evolveum/midpoint/testing/schrodinger/scenarios/AccountTests.java @@ -38,9 +38,6 @@ public class AccountTests extends TestBase { protected static final String CSV_RESOURCE_ATTR_FILE_PATH= "File path"; - //TODO seems that some problems with property files in the csv resource which is being used for tests, replace value after resolution - protected static final String CSV_RESOURCE_ATTR_UNIQUE= "UI_CSV_NAME_ATTRIBUTE"; - protected static final String TEST_USER_MIKE_NAME= "michelangelo"; protected static final String TEST_USER_MIKE_LAST_NAME_OLD= "di Lodovico Buonarroti Simoni"; protected static final String TEST_USER_MIKE_LAST_NAME_NEW= "di Lodovico Buonarroti Simoni Il Divino"; @@ -73,7 +70,7 @@ public void createMidpointUser() throws IOException, ConfigurationException { ); } - @Test(groups = TEST_GROUP_BEFORE_USER_DELETION) + @Test(priority = 2, groups = TEST_GROUP_BEFORE_USER_DELETION) public void importCsvResource(){ ImportObjectPage importPage = basicPage.importObject(); @@ -89,7 +86,7 @@ public void importCsvResource(){ } - @Test (dependsOnMethods = {IMPORT_CSV_RESOURCE_DEPENDENCY},groups = TEST_GROUP_BEFORE_USER_DELETION) + @Test (priority = 3, dependsOnMethods = {IMPORT_CSV_RESOURCE_DEPENDENCY},groups = TEST_GROUP_BEFORE_USER_DELETION) public void changeResourceFilePath(){ ListResourcesPage listResourcesPage = basicPage.listResources(); @@ -108,7 +105,7 @@ public void changeResourceFilePath(){ refreshResourceSchema(CSV_RESOURCE_NAME); } - @Test(dependsOnMethods = {CREATE_MP_USER_DEPENDENCY,CHANGE_RESOURCE_FILE_PATH_DEPENDENCY},groups = TEST_GROUP_BEFORE_USER_DELETION) + @Test(priority = 4, dependsOnMethods = {CREATE_MP_USER_DEPENDENCY,CHANGE_RESOURCE_FILE_PATH_DEPENDENCY},groups = TEST_GROUP_BEFORE_USER_DELETION) public void addAccount() { ListUsersPage users = basicPage.listUsers(); Assert.assertTrue( @@ -135,7 +132,7 @@ public void addAccount() { ); } - @Test (dependsOnMethods = {ADD_ACCOUNT_DEPENDENCY},groups = TEST_GROUP_BEFORE_USER_DELETION) + @Test (priority = 5, dependsOnMethods = {ADD_ACCOUNT_DEPENDENCY},groups = TEST_GROUP_BEFORE_USER_DELETION) public void modifyAccountAttribute(){ ListUsersPage users = basicPage.listUsers(); users @@ -159,7 +156,7 @@ public void modifyAccountAttribute(){ ; } - @Test (dependsOnMethods = {ADD_ACCOUNT_DEPENDENCY},groups = TEST_GROUP_BEFORE_USER_DELETION) + @Test (priority = 6, dependsOnMethods = {ADD_ACCOUNT_DEPENDENCY},groups = TEST_GROUP_BEFORE_USER_DELETION) public void modifyAccountPassword(){ ListUsersPage users = basicPage.listUsers(); users @@ -184,7 +181,7 @@ public void modifyAccountPassword(){ .isSuccess(); } - @Test (dependsOnMethods = {ADD_ACCOUNT_DEPENDENCY},groups = TEST_GROUP_BEFORE_USER_DELETION) + @Test (priority = 7, dependsOnMethods = {ADD_ACCOUNT_DEPENDENCY},groups = TEST_GROUP_BEFORE_USER_DELETION) public void disableAccount(){ ListUsersPage users = basicPage.listUsers(); users @@ -208,7 +205,7 @@ public void disableAccount(){ .isSuccess(); } - @Test (dependsOnMethods = {ADD_ACCOUNT_DEPENDENCY, DISABLE_ACCOUNT_DEPENDENCY},groups = TEST_GROUP_BEFORE_USER_DELETION) + @Test (priority = 8, dependsOnMethods = {ADD_ACCOUNT_DEPENDENCY, DISABLE_ACCOUNT_DEPENDENCY},groups = TEST_GROUP_BEFORE_USER_DELETION) public void enableAccount(){ ListUsersPage users = basicPage.listUsers(); users @@ -232,7 +229,7 @@ public void enableAccount(){ .isSuccess(); } - @Test(dependsOnMethods = {ENABLE_ACCOUNT_DEPENDENCY},groups = TEST_GROUP_BEFORE_USER_DELETION) + @Test(priority = 9, dependsOnMethods = {ENABLE_ACCOUNT_DEPENDENCY},groups = TEST_GROUP_BEFORE_USER_DELETION) public void deleteAccount(){ ListUsersPage users = basicPage.listUsers(); users diff --git a/testing/schrodingertest/src/test/java/com/evolveum/midpoint/testing/schrodinger/scenarios/OrganizationStructureTests.java b/testing/schrodingertest/src/test/java/com/evolveum/midpoint/testing/schrodinger/scenarios/OrganizationStructureTests.java index 497ee55ef07..c36cb5d191f 100644 --- a/testing/schrodingertest/src/test/java/com/evolveum/midpoint/testing/schrodinger/scenarios/OrganizationStructureTests.java +++ b/testing/schrodingertest/src/test/java/com/evolveum/midpoint/testing/schrodinger/scenarios/OrganizationStructureTests.java @@ -41,9 +41,6 @@ public class OrganizationStructureTests extends TestBase { private static final String DIRECTORY_CURRENT_TEST = "organizationStructureTests"; private static final String FILE_RESOUCE_NAME = "midpoint-advanced-sync.csv"; - //TODO seems that some problems with property files in the csv resource which is being used for tests, replace value after resolution - protected static final String CSV_RESOURCE_ATTR_UNIQUE= "UI_CSV_NAME_ATTRIBUTE"; - @Test public void importOrgStructure() throws IOException, ConfigurationException { @@ -121,7 +118,7 @@ public void unassignOrgUnit(){ public void orgUnitAccountInducement(){ importObject(CSV_RESOURCE_ADVANCED_SYNC,true); importObject(ORG_ACCOUNT_INDUCEMENT_FILE); - importObject(ScenariosCommons.USER_TEST_RAPHAEL_FILE); + importObject(ScenariosCommons.USER_TEST_RAPHAEL_FILE, true); changeResourceFilePath(); @@ -160,7 +157,12 @@ public void changeResourceFilePath(){ Assert.assertTrue(listResourcesPage .table() - .clickByName("CSV (target with groups)") + .search() + .byName() + .inputValue(NAME_CSV_RESOURCE_ADVANCED_SYNC) + .updateSearch() + .and() + .clickByName(NAME_CSV_RESOURCE_ADVANCED_SYNC) .clickEditResourceConfiguration() .form() .changeAttributeValue("File path", "", CSV_TARGET_FILE.getAbsolutePath()) diff --git a/testing/schrodingertest/src/test/java/com/evolveum/midpoint/testing/schrodinger/scenarios/SynchronizationTests.java b/testing/schrodingertest/src/test/java/com/evolveum/midpoint/testing/schrodinger/scenarios/SynchronizationTests.java index 8798212af05..88fce5336f0 100644 --- a/testing/schrodingertest/src/test/java/com/evolveum/midpoint/testing/schrodinger/scenarios/SynchronizationTests.java +++ b/testing/schrodingertest/src/test/java/com/evolveum/midpoint/testing/schrodinger/scenarios/SynchronizationTests.java @@ -55,7 +55,7 @@ public void setUpResourceAndSynchronizationTask() throws ConfigurationException, listResourcesPage .table() .clickByName(ScenariosCommons.RESOURCE_CSV_GROUPS_AUTHORITATIVE_NAME) - .clicAccountsTab() + .clickAccountsTab() .liveSyncTask() .clickCreateNew() .basicTable() @@ -116,7 +116,7 @@ public void protectedAccountAdded(){ .updateSearch() .and() .clickByName(ScenariosCommons.RESOURCE_CSV_GROUPS_AUTHORITATIVE_NAME) - .clicAccountsTab() + .clickAccountsTab() .clickSearchInResource() .table() .currentTableContains(ScenariosCommons.TEST_USER_PROTECTED_NAME) @@ -239,7 +239,7 @@ public void resourceAccountDeleted(){ .updateSearch() .and() .clickByName(ScenariosCommons.RESOURCE_CSV_GROUPS_AUTHORITATIVE_NAME) - .clicAccountsTab() + .clickAccountsTab() .clickSearchInResource() .table() .selectCheckboxByName("raphael") diff --git a/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/page/resource/ViewResourcePage.java b/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/page/resource/ViewResourcePage.java index f100d8e2530..2413983dc4d 100644 --- a/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/page/resource/ViewResourcePage.java +++ b/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/page/resource/ViewResourcePage.java @@ -33,7 +33,7 @@ public ResourceWizardPage clickShowUsingWizard() { return new ResourceWizardPage(); } - public ResourceAccountsTab clicAccountsTab() { + public ResourceAccountsTab clickAccountsTab() { $(Schrodinger.byDataResourceKey("schrodinger", "PageResource.tab.content.account")).parent() .waitUntil(Condition.visible, MidPoint.TIMEOUT_DEFAULT_2_S).click(); From cc1937857c0e31b4491d5ba536b35a43da6343b4 Mon Sep 17 00:00:00 2001 From: Radovan Semancik Date: Thu, 7 Feb 2019 17:49:57 +0100 Subject: [PATCH 014/224] Upgrade to ConnId framework 1.5.0.8 (MID-5099) --- build-system/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-system/pom.xml b/build-system/pom.xml index 54edadc62d8..d5086c418d9 100644 --- a/build-system/pom.xml +++ b/build-system/pom.xml @@ -83,7 +83,7 @@ 5.22.0 1.3 2.0.6 - 1.5.0.0 + 1.5.0.8 6.5.0 10.11.1.1 1.8.0 From 62a2058a6d4dbca5a05add3667342c409672ee55 Mon Sep 17 00:00:00 2001 From: Radovan Semancik Date: Thu, 7 Feb 2019 17:51:02 +0100 Subject: [PATCH 015/224] Fixed ConnId timeout configuration for update operations (MID-5126) --- .../ConnIdConfigurationTransformer.java | 9 ++- .../connid/ConnectorFactoryConnIdImpl.java | 30 +++++---- .../story/TestMisbehavingResources.java | 64 +++++++++++++++++-- .../story/src/test/resources/logback-test.xml | 1 + 4 files changed, 80 insertions(+), 24 deletions(-) diff --git a/provisioning/ucf-impl-connid/src/main/java/com/evolveum/midpoint/provisioning/ucf/impl/connid/ConnIdConfigurationTransformer.java b/provisioning/ucf-impl-connid/src/main/java/com/evolveum/midpoint/provisioning/ucf/impl/connid/ConnIdConfigurationTransformer.java index 2a893f511c5..85475957afb 100644 --- a/provisioning/ucf-impl-connid/src/main/java/com/evolveum/midpoint/provisioning/ucf/impl/connid/ConnIdConfigurationTransformer.java +++ b/provisioning/ucf-impl-connid/src/main/java/com/evolveum/midpoint/provisioning/ucf/impl/connid/ConnIdConfigurationTransformer.java @@ -18,6 +18,7 @@ import java.io.File; import java.lang.reflect.Array; import java.util.ArrayList; +import java.util.Collection; import java.util.List; import javax.xml.namespace.QName; @@ -245,9 +246,11 @@ private void transformConnectorTimeoutsConfiguration(APIConfiguration apiConfig, if (SchemaConstants.NS_ICF_CONFIGURATION.equals(propertQName.getNamespaceURI())) { String opName = propertQName.getLocalPart(); - Class apiOpClass = ConnectorFactoryConnIdImpl.resolveApiOpClass(opName); - if (apiOpClass != null) { - apiConfig.setTimeout(apiOpClass, parseInt(prismProperty)); + Collection> apiOpClasses = ConnectorFactoryConnIdImpl.resolveApiOpClass(opName); + if (apiOpClasses != null) { + for (Class apiOpClass : apiOpClasses) { + apiConfig.setTimeout(apiOpClass, parseInt(prismProperty)); + } } else { throw new SchemaException("Unknown operation name " + opName + " in " + ConnectorFactoryConnIdImpl.CONNECTOR_SCHEMA_TIMEOUTS_XML_ELEMENT_NAME); diff --git a/provisioning/ucf-impl-connid/src/main/java/com/evolveum/midpoint/provisioning/ucf/impl/connid/ConnectorFactoryConnIdImpl.java b/provisioning/ucf-impl-connid/src/main/java/com/evolveum/midpoint/provisioning/ucf/impl/connid/ConnectorFactoryConnIdImpl.java index 1d1d94d9eef..04af09a8226 100644 --- a/provisioning/ucf-impl-connid/src/main/java/com/evolveum/midpoint/provisioning/ucf/impl/connid/ConnectorFactoryConnIdImpl.java +++ b/provisioning/ucf-impl-connid/src/main/java/com/evolveum/midpoint/provisioning/ucf/impl/connid/ConnectorFactoryConnIdImpl.java @@ -26,6 +26,7 @@ import java.net.URL; import java.security.Key; import java.util.Arrays; +import java.util.Collection; import java.util.Enumeration; import java.util.HashMap; import java.util.HashSet; @@ -69,6 +70,7 @@ import org.identityconnectors.framework.api.operations.SyncApiOp; import org.identityconnectors.framework.api.operations.TestApiOp; import org.identityconnectors.framework.api.operations.UpdateApiOp; +import org.identityconnectors.framework.api.operations.UpdateDeltaApiOp; import org.identityconnectors.framework.api.operations.ValidateApiOp; import org.identityconnectors.framework.common.FrameworkUtil; import org.springframework.beans.factory.annotation.Autowired; @@ -153,7 +155,7 @@ public class ConnectorFactoryConnIdImpl implements ConnectorFactory { public static final String CONNECTOR_SCHEMA_RESULTS_HANDLER_CONFIGURATION_ENABLE_CASE_INSENSITIVE_HANDLER = "enableCaseInsensitiveFilter"; public static final String CONNECTOR_SCHEMA_RESULTS_HANDLER_CONFIGURATION_ENABLE_ATTRIBUTES_TO_GET_SEARCH_RESULTS_HANDLER = "enableAttributesToGetSearchResultsHandler"; - static final Map> apiOpMap = new HashMap<>(); + static final Map>> apiOpMap = new HashMap<>(); private static final String ICF_CONFIGURATION_NAMESPACE_PREFIX = SchemaConstants.ICF_FRAMEWORK_URI + "/bundle/"; private static final String CONNECTOR_IDENTIFIER_SEPARATOR = "/"; @@ -892,23 +894,23 @@ public void access(char[] decryptedChars) { result.computeStatus(); } - static Class resolveApiOpClass(String opName) { + static Collection> resolveApiOpClass(String opName) { return apiOpMap.get(opName); } static { - apiOpMap.put("create", CreateApiOp.class); - apiOpMap.put("get", GetApiOp.class); - apiOpMap.put("update", UpdateApiOp.class); - apiOpMap.put("delete", DeleteApiOp.class); - apiOpMap.put("test", TestApiOp.class); - apiOpMap.put("scriptOnConnector", ScriptOnConnectorApiOp.class); - apiOpMap.put("scriptOnResource", ScriptOnResourceApiOp.class); - apiOpMap.put("authentication", AuthenticationApiOp.class); - apiOpMap.put("search", SearchApiOp.class); - apiOpMap.put("validate", ValidateApiOp.class); - apiOpMap.put("sync", SyncApiOp.class); - apiOpMap.put("schema", SchemaApiOp.class); + apiOpMap.put("create", Arrays.asList(CreateApiOp.class)); + apiOpMap.put("get", Arrays.asList(GetApiOp.class)); + apiOpMap.put("update", Arrays.asList(UpdateApiOp.class, UpdateDeltaApiOp.class)); + apiOpMap.put("delete", Arrays.asList(DeleteApiOp.class)); + apiOpMap.put("test", Arrays.asList(TestApiOp.class)); + apiOpMap.put("scriptOnConnector", Arrays.asList(ScriptOnConnectorApiOp.class)); + apiOpMap.put("scriptOnResource", Arrays.asList(ScriptOnResourceApiOp.class)); + apiOpMap.put("authentication", Arrays.asList(AuthenticationApiOp.class)); + apiOpMap.put("search", Arrays.asList(SearchApiOp.class)); + apiOpMap.put("validate", Arrays.asList(ValidateApiOp.class)); + apiOpMap.put("sync", Arrays.asList(SyncApiOp.class)); + apiOpMap.put("schema", Arrays.asList(SchemaApiOp.class)); } @Override diff --git a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestMisbehavingResources.java b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestMisbehavingResources.java index f07bce6ce1f..6c8c5c2766c 100644 --- a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestMisbehavingResources.java +++ b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestMisbehavingResources.java @@ -33,6 +33,7 @@ import com.evolveum.midpoint.schema.result.OperationResult; import com.evolveum.midpoint.task.api.Task; import com.evolveum.midpoint.test.util.MidPointTestConstants; +import com.evolveum.midpoint.xml.ns._public.common.common_3.UserType; /** * Test for various resource-side errors, strange situations, timeouts @@ -48,6 +49,8 @@ public class TestMisbehavingResources extends AbstractStoryTest { protected static final File RESOURCE_DUMMY_FILE = new File(TEST_DIR, "resource-dummy.xml"); protected static final String RESOURCE_DUMMY_OID = "5f9615a2-d05b-11e8-9dab-37186a8ab7ef"; + + private static final String USER_JACK_FULL_NAME_CAPTAIN = "Captain Jack Sparrow"; @Override public void initSystem(Task initTask, OperationResult initResult) throws Exception { @@ -98,7 +101,7 @@ public void test019SanityUnassignJackDummyAccount() throws Exception { } /** - * MID-4773 + * MID-4773, MID-5099 */ @Test public void test100AssignJackDummyAccountTimeout() throws Exception { @@ -119,11 +122,7 @@ public void test100AssignJackDummyAccountTimeout() throws Exception { displayThen(TEST_NAME); assertInProgress(result); - // ConnId timeout is obviously not enforced. Therefore if the operation - // does not fail by itself it is not forcibly stopped. The account is - // created anyway. - assertDummyAccountByUsername(null, USER_JACK_USERNAME) - .assertFullName(USER_JACK_FULL_NAME); + assertNoDummyAccount(USER_JACK_USERNAME); } @Test @@ -140,7 +139,7 @@ public void test102AssignJackDummyAccounRetry() throws Exception { // WHEN displayWhen(TEST_NAME); - recomputeUser(USER_JACK_OID, task, result); + reconcileUser(USER_JACK_OID, task, result); // THEN displayThen(TEST_NAME); @@ -149,4 +148,55 @@ public void test102AssignJackDummyAccounRetry() throws Exception { assertDummyAccountByUsername(null, USER_JACK_USERNAME) .assertFullName(USER_JACK_FULL_NAME); } + + /** + * MID-5126 + */ + @Test + public void test110ModifyJackDummyAccountTimeout() throws Exception { + final String TEST_NAME = "test110ModifyJackDummyAccountTimeout"; + displayTestTitle(TEST_NAME); + + getDummyResource().setOperationDelayOffset(3000); + + Task task = createTask(TEST_NAME); + OperationResult result = task.getResult(); + + // WHEN + displayWhen(TEST_NAME); + + modifyUserReplace(USER_JACK_OID, UserType.F_FULL_NAME, task, result, createPolyString(USER_JACK_FULL_NAME_CAPTAIN)); + + // THEN + displayThen(TEST_NAME); + assertInProgress(result); + + assertDummyAccountByUsername(null, USER_JACK_USERNAME) + // operation timed out, data not updated + .assertFullName(USER_JACK_FULL_NAME); + } + + @Test + public void test112ModifyJackDummyAccounRetry() throws Exception { + final String TEST_NAME = "test112ModifyJackDummyAccounRetry"; + displayTestTitle(TEST_NAME); + + getDummyResource().setOperationDelayOffset(0); + clockForward("P1D"); + + Task task = createTask(TEST_NAME); + OperationResult result = task.getResult(); + + // WHEN + displayWhen(TEST_NAME); + + reconcileUser(USER_JACK_OID, task, result); + + // THEN + displayThen(TEST_NAME); + assertSuccess(result); + + assertDummyAccountByUsername(null, USER_JACK_USERNAME) + .assertFullName(USER_JACK_FULL_NAME_CAPTAIN); + } } diff --git a/testing/story/src/test/resources/logback-test.xml b/testing/story/src/test/resources/logback-test.xml index d7a372551f2..649cd0a84b1 100644 --- a/testing/story/src/test/resources/logback-test.xml +++ b/testing/story/src/test/resources/logback-test.xml @@ -82,6 +82,7 @@ + From cc622d450194c786ce7d2eb302049a508284edea Mon Sep 17 00:00:00 2001 From: Radovan Semancik Date: Thu, 7 Feb 2019 17:51:45 +0100 Subject: [PATCH 016/224] Missing test --- .../testing/story/TestLdapSyncMassive.java | 573 ++++++++++++++++++ 1 file changed, 573 insertions(+) create mode 100644 testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestLdapSyncMassive.java diff --git a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestLdapSyncMassive.java b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestLdapSyncMassive.java new file mode 100644 index 00000000000..beed6191255 --- /dev/null +++ b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestLdapSyncMassive.java @@ -0,0 +1,573 @@ +/* + * Copyright (c) 2016-2019 Evolveum + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.evolveum.midpoint.testing.story; + + +import static org.testng.AssertJUnit.assertEquals; +import static org.testng.AssertJUnit.assertNotNull; + +import java.io.File; +import java.io.IOException; +import java.util.List; + +import org.opends.server.types.DirectoryException; +import org.opends.server.types.Entry; +import org.springframework.test.annotation.DirtiesContext; +import org.springframework.test.annotation.DirtiesContext.ClassMode; +import org.springframework.test.context.ContextConfiguration; +import org.testng.annotations.AfterClass; +import org.testng.annotations.Test; + +import com.evolveum.midpoint.prism.PrismObject; +import com.evolveum.midpoint.schema.SearchResultList; +import com.evolveum.midpoint.schema.constants.MidPointConstants; +import com.evolveum.midpoint.schema.constants.SchemaConstants; +import com.evolveum.midpoint.schema.result.OperationResult; +import com.evolveum.midpoint.schema.statistics.ConnectorOperationalStatus; +import com.evolveum.midpoint.schema.util.ObjectTypeUtil; +import com.evolveum.midpoint.task.api.Task; +import com.evolveum.midpoint.test.util.MidPointTestConstants; +import com.evolveum.midpoint.test.util.ParallelTestThread; +import com.evolveum.midpoint.test.util.TestUtil; +import com.evolveum.midpoint.util.exception.CommunicationException; +import com.evolveum.midpoint.util.exception.ConfigurationException; +import com.evolveum.midpoint.util.exception.ExpressionEvaluationException; +import com.evolveum.midpoint.util.exception.ObjectAlreadyExistsException; +import com.evolveum.midpoint.util.exception.ObjectNotFoundException; +import com.evolveum.midpoint.util.exception.PolicyViolationException; +import com.evolveum.midpoint.util.exception.SchemaException; +import com.evolveum.midpoint.util.exception.SecurityViolationException; +import com.evolveum.midpoint.xml.ns._public.common.api_types_3.ImportOptionsType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.ResourceType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.TaskType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.UserType; + +/** + * Testing sync, with lot of sync cycles. The goal is to test thread pooling and memory + * management related to sync (e.g. MID-5099) + * + * @author Radovan Semancik + * + */ +@ContextConfiguration(locations = {"classpath:ctx-story-test-main.xml"}) +@DirtiesContext(classMode = ClassMode.AFTER_CLASS) +public class TestLdapSyncMassive extends AbstractStoryTest { + + public static final File TEST_DIR = new File(MidPointTestConstants.TEST_RESOURCES_DIR, "ldap-sync-massive"); + + private static final String RESOURCE_OPENDJ_OID = "10000000-0000-0000-0000-000000000003"; + private static final String RESOURCE_OPENDJ_NAMESPACE = MidPointConstants.NS_RI; + + private static final File RESOURCE_OPENDJ_FILE_BAD = new File(TEST_DIR, "resource-opendj-bad.xml"); + + private static final File TASK_LIVE_SYNC_FILE = new File(TEST_DIR, "task-live-sync.xml"); + private static final String TASK_LIVE_SYNC_OID = "eba4a816-2a05-11e9-9123-03a2334b9b4c"; + + private static final File ACCOUNT_WILL_LDIF_FILE = new File(TEST_DIR, "will.ldif"); + private static final String ACCOUNT_WILL_LDAP_UID = "will"; + private static final String ACCOUNT_WILL_LDAP_CN = "Will Turner"; + + private static final File ACCOUNT_KRAKEN_LDIF_FILE = new File(TEST_DIR, "kraken.ldif"); + private static final String ACCOUNT_KRAKEN_LDAP_UID = "kraken"; + private static final String ACCOUNT_KRAKEN_LDAP_CN = "Kraken Krakenoff"; + + private static final int THREAD_COUNT_TOLERANCE = 5; + private static final int THREAD_COUNT_TOLERANCE_BIG = 20; + + private static final int SYNC_ADD_ATTEMPTS = 30; + private static final int NUMBER_OF_GOBLINS = 50; + + private static final int NUMBER_OF_TEST_THREADS = 5; + private static final Integer TEST_THREADS_RANDOM_START_RANGE = 10; + private static final long PARALLEL_TEST_TIMEOUT = 60000L; + + private PrismObject resourceOpenDj; + private Integer lastSyncToken; + private int threadCountBaseline; + + private File getTestDir() { + return TEST_DIR; + } + + private File getResourceOpenDjFile() { + return new File(getTestDir(), "resource-opendj.xml"); + } + + @Override + protected void startResources() throws Exception { + openDJController.startCleanServer(); + } + + @AfterClass + public static void stopResources() throws Exception { + openDJController.stop(); + } + + @Override + public void initSystem(Task initTask, OperationResult initResult) throws Exception { + super.initSystem(initTask, initResult); + + // Resources + resourceOpenDj = importAndGetObjectFromFile(ResourceType.class, getResourceOpenDjFile(), RESOURCE_OPENDJ_OID, initTask, initResult); + openDJController.setResource(resourceOpenDj); + } + + @Test + public void test000Sanity() throws Exception { + final String TEST_NAME = "test000Sanity"; + displayTestTitle(TEST_NAME); + Task task = createTask(TEST_NAME); + + OperationResult testResultOpenDj = modelService.testResource(RESOURCE_OPENDJ_OID, task); + TestUtil.assertSuccess(testResultOpenDj); + + assertLdapConnectorInstances(1); + + dumpLdap(); + } + + @Test + public void test080ImportSyncTask() throws Exception { + final String TEST_NAME = "test080ImportSyncTask"; + displayTestTitle(TEST_NAME); + + // WHEN + displayWhen(TEST_NAME); + + importObjectFromFile(TASK_LIVE_SYNC_FILE); + + // THEN + displayThen(TEST_NAME); + + waitForTaskNextRunAssertSuccess(TASK_LIVE_SYNC_OID, true); + + PrismObject syncTask = getTask(TASK_LIVE_SYNC_OID); + lastSyncToken = ObjectTypeUtil.getExtensionItemRealValue(syncTask, SchemaConstants.SYNC_TOKEN); + display("Initial sync token", lastSyncToken); + assertNotNull("Null sync token", lastSyncToken); + + assertLdapConnectorInstances(1); + + threadCountBaseline = Thread.activeCount(); + display("Thread count baseline", threadCountBaseline); + + dumpLdap(); + } + + /** + * Add a single LDAP account. This goal is to test whether we have good configuration. + */ + @Test + public void test110SyncAddWill() throws Exception { + final String TEST_NAME = "test110SyncAddWill"; + displayTestTitle(TEST_NAME); + + Entry entry = openDJController.addEntryFromLdifFile(ACCOUNT_WILL_LDIF_FILE); + display("Entry from LDIF", entry); + + // WHEN + displayWhen(TEST_NAME); + + waitForTaskNextRunAssertSuccess(TASK_LIVE_SYNC_OID, true); + + // THEN + displayThen(TEST_NAME); + + assertSyncTokenIncrement(1); + + assertLdapConnectorInstances(1); + + assertUserAfterByUsername(ACCOUNT_WILL_LDAP_UID) + .assertFullName(ACCOUNT_WILL_LDAP_CN); + + assertThreadCount(); + + // just to make sure we are stable + + waitForTaskNextRunAssertSuccess(TASK_LIVE_SYNC_OID, true); + + assertSyncTokenIncrement(0); + assertLdapConnectorInstances(1); + assertThreadCount(); + + dumpLdap(); + + } + + /** + * "Good run". This is a run with more sync cycles, but without + * any effort to trigger problems. This is here to make sure we + * have the right "baseline", e.g. thread count tolerance. + */ + @Test + public void test112SyncAddGoods() throws Exception { + final String TEST_NAME = "test112SyncAddGoods"; + displayTestTitle(TEST_NAME); + + // WHEN + displayWhen(TEST_NAME); + + for (int i = 0; i < SYNC_ADD_ATTEMPTS; i++) { + syncAddAttemptGood("good", i); + } + + // THEN + displayThen(TEST_NAME); + + dumpLdap(); + + } + + + /** + * Add "goblin" users, each with an LDAP account. + * We do not really needs them now. But these will make + * subsequent tests more massive. + * Adding them in this way is much faster then adding + * them in sync one by one. + * And we need to add them while the resource still + * works OK. + */ + @Test + public void test150AddGoblins() throws Exception { + final String TEST_NAME = "test150AddGoblins"; + displayTestTitle(TEST_NAME); + + // WHEN + displayWhen(TEST_NAME); + + for (int i = 0; i < NUMBER_OF_GOBLINS; i++) { + String username = goblinUsername(i); + PrismObject goblin = createUser(username, "Goblin", Integer.toString(i), true); + goblin.asObjectable(). + beginAssignment() + .beginConstruction() + .resourceRef(RESOURCE_OPENDJ_OID, ResourceType.COMPLEX_TYPE); + addObject(goblin); + } + + // THEN + displayThen(TEST_NAME); + + dumpLdap(); + assertLdapConnectorInstances(1,2); + + waitForTaskNextRunAssertSuccess(TASK_LIVE_SYNC_OID, true); + + assertLdapConnectorInstances(1,2); + assertSyncTokenIncrement(NUMBER_OF_GOBLINS); + assertThreadCount(); + + waitForTaskNextRunAssertSuccess(TASK_LIVE_SYNC_OID, true); + + assertLdapConnectorInstances(1,2); + assertSyncTokenIncrement(0); + assertThreadCount(); + + } + + + + private String goblinUsername(int i) { + return String.format("goblin%05d", i); + } + + /** + * Overwrite the resource with a bad configuration. + * Now we are going to make some trouble. + */ + @Test + public void test200SyncAddKraken() throws Exception { + final String TEST_NAME = "test200SyncAddKraken"; + displayTestTitle(TEST_NAME); + + Task task = createTask(TEST_NAME); + OperationResult result = task.getResult(); + + ImportOptionsType options = new ImportOptionsType() + .overwrite(true); + importObjectFromFile(RESOURCE_OPENDJ_FILE_BAD, options, task, result); + + OperationResult testResultOpenDj = modelService.testResource(RESOURCE_OPENDJ_OID, task); + display("Test resource result", testResultOpenDj); + TestUtil.assertSuccess(testResultOpenDj); + + PrismObject resourceAfter = modelService.getObject(ResourceType.class, RESOURCE_OPENDJ_OID, null, task, result); + assertResource(resourceAfter, "after") + .assertHasSchema(); + + assertLdapConnectorInstances(1,2); + } + + /** + * Just make first attempt with bad configuration. + * This is here mostly to make sure we really have a bad configuration. + */ + @Test + public void test210SyncAddKraken() throws Exception { + final String TEST_NAME = "test210SyncAddKraken"; + displayTestTitle(TEST_NAME); + + Entry entry = openDJController.addEntryFromLdifFile(ACCOUNT_KRAKEN_LDIF_FILE); + display("Entry from LDIF", entry); + + // WHEN + displayWhen(TEST_NAME); + + OperationResult taskResult = waitForTaskNextRun(TASK_LIVE_SYNC_OID); + + // THEN + displayThen(TEST_NAME); + assertPartialError(taskResult); + + assertSyncTokenIncrement(0); + assertLdapConnectorInstances(1,2); + assertThreadCount(); + + // just to make sure we are stable + // in fact, it is "FUBAR, but stable" + + taskResult = waitForTaskNextRun(TASK_LIVE_SYNC_OID); + assertPartialError(taskResult); + + assertSyncTokenIncrement(0); + assertLdapConnectorInstances(1,2); + assertThreadCount(); + + dumpLdap(); + + } + + /** + * "Bad run". + * MID-5099: cannot reproduce + */ + @Test + public void test212SyncAddBads() throws Exception { + final String TEST_NAME = "test212SyncAddBads"; + displayTestTitle(TEST_NAME); + + // WHEN + displayWhen(TEST_NAME); + + for (int i = 0; i < SYNC_ADD_ATTEMPTS; i++) { + syncAddAttemptBad("bad", i); + } + + // THEN + displayThen(TEST_NAME); + + dumpLdap(); + + } + + /** + * Suspend sync task. We do not want that to mess the results of subsequent + * tests (e.g. mess the number of connector instances). + */ + @Test + public void test219StopSyncTask() throws Exception { + final String TEST_NAME = "test219StopSyncTask"; + displayTestTitle(TEST_NAME); + + // WHEN + displayWhen(TEST_NAME); + + suspendTask(TASK_LIVE_SYNC_OID); + + // THEN + displayThen(TEST_NAME); + + assertSyncTokenIncrement(0); + assertLdapConnectorInstances(1,2); + assertThreadCount(); + + } + + @Test + public void test230UserRecomputeSequential() throws Exception { + final String TEST_NAME = "test230UserRecomputeSequential"; + displayTestTitle(TEST_NAME); + + Task task = createTask(TEST_NAME); + OperationResult result = task.getResult(); + + SearchResultList> users = modelService.searchObjects(UserType.class, null, null, task, result); + + // WHEN + displayWhen(TEST_NAME); + + for (PrismObject user : users) { + reconcile(TEST_NAME, user); + } + + // THEN + displayThen(TEST_NAME); + + assertLdapConnectorInstances(1,2); + assertThreadCount(); + } + + @Test + public void test232UserRecomputeParallel() throws Exception { + final String TEST_NAME = "test232UserRecomputeParallel"; + displayTestTitle(TEST_NAME); + + Task task = createTask(TEST_NAME); + OperationResult result = task.getResult(); + + SearchResultList> users = modelService.searchObjects(UserType.class, null, null, task, result); + + // WHEN + displayWhen(TEST_NAME); + + int segmentSize = users.size() / NUMBER_OF_TEST_THREADS; + ParallelTestThread[] threads = multithread(TEST_NAME, + (threadIndex) -> { + for (int i = segmentSize * threadIndex; i < segmentSize * threadIndex + segmentSize; i++) { + PrismObject user = users.get(i); + reconcile(TEST_NAME, user); + } + + }, NUMBER_OF_TEST_THREADS, TEST_THREADS_RANDOM_START_RANGE); + + // THEN + displayThen(TEST_NAME); + waitForThreads(threads, PARALLEL_TEST_TIMEOUT); + + // When system is put under load, this means more threads. But not huge number of threads. + assertThreadCount(THREAD_COUNT_TOLERANCE_BIG); + assertLdapConnectorInstances(1,NUMBER_OF_TEST_THREADS); + } + + private void reconcile(final String TEST_NAME, PrismObject user) throws CommunicationException, ObjectAlreadyExistsException, ExpressionEvaluationException, PolicyViolationException, SchemaException, SecurityViolationException, ConfigurationException, ObjectNotFoundException { + Task task = createTask(TEST_NAME+".user."+user.getName()); + OperationResult result = task.getResult(); + + reconcileUser(user.getOid(), task, result); + + // We do not bother to check result. Even though the + // timeout is small, the operation may succeed occasionally. + // This annoying success cout cause the tests to fail. + } + + private void syncAddAttemptGood(String prefix, int index) throws Exception { + + String uid = String.format("%s%05d", prefix, index); + String cn = prefix+" "+index; + addAttemptEntry(uid, cn, Integer.toString(index)); + + waitForTaskNextRunAssertSuccess(TASK_LIVE_SYNC_OID, true); + + assertSyncTokenIncrement(1); + + assertUserAfterByUsername(uid) + .assertFullName(cn); + + assertThreadCount(); + } + + private void syncAddAttemptBad(String prefix, int index) throws Exception { + + String uid = String.format("%s%05d", prefix, index); + String cn = prefix+" "+index; + addAttemptEntry(uid, cn, Integer.toString(index)); + + OperationResult taskResult = waitForTaskNextRun(TASK_LIVE_SYNC_OID); + + assertPartialError(taskResult); + assertSyncTokenIncrement(0); + assertLdapConnectorInstances(1); + assertThreadCount(); + } + + private void addAttemptEntry(String uid, String cn, String sn) throws Exception { + Entry entry = openDJController.addEntry( + "dn: uid="+uid+",ou=People,dc=example,dc=com\n" + + "uid: "+uid+"\n" + + "cn: "+cn+"\n" + + "sn: "+sn+"\n" + + "givenname: "+uid+"\n" + + "objectclass: top\n" + + "objectclass: person\n" + + "objectclass: organizationalPerson\n" + + "objectclass: inetOrgPerson" + ); + display("Added generated entry", entry); + } + + private void assertThreadCount() { + assertThreadCount(THREAD_COUNT_TOLERANCE); + } + + private void assertThreadCount(int tolerance) { + int currentThreadCount = Thread.activeCount(); + if (!isWithinTolerance(threadCountBaseline, currentThreadCount, tolerance)) { + fail("Thread count out of tolerance: "+currentThreadCount+" ("+(currentThreadCount-threadCountBaseline)+")"); + } + } + + private boolean isWithinTolerance(int baseline, int currentCount, int tolerance) { + if (currentCount > baseline + tolerance) { + return false; + } + if (currentCount < baseline - tolerance) { + return false; + } + return true; + } + + private void assertSyncTokenIncrement(int expectedIncrement) throws ObjectNotFoundException, SchemaException, SecurityViolationException, CommunicationException, ConfigurationException, ExpressionEvaluationException { + PrismObject syncTask = getTask(TASK_LIVE_SYNC_OID); + Integer currentSyncToken = ObjectTypeUtil.getExtensionItemRealValue(syncTask, SchemaConstants.SYNC_TOKEN); + display("Sync token, last="+lastSyncToken+", current="+currentSyncToken+", expectedIncrement="+expectedIncrement); + if (currentSyncToken != lastSyncToken + expectedIncrement) { + fail("Expected sync token increment "+expectedIncrement+", but it was "+(currentSyncToken-lastSyncToken)); + } + lastSyncToken = currentSyncToken; + } + + protected void assertLdapConnectorInstances(int expectedConnectorInstances) throws NumberFormatException, IOException, InterruptedException, SchemaException, ObjectNotFoundException, CommunicationException, ConfigurationException, ExpressionEvaluationException { + assertLdapConnectorInstances(expectedConnectorInstances, expectedConnectorInstances); + } + + protected void assertLdapConnectorInstances(int expectedConnectorInstancesMin, int expectedConnectorInstancesMax) throws NumberFormatException, IOException, InterruptedException, SchemaException, ObjectNotFoundException, CommunicationException, ConfigurationException, ExpressionEvaluationException { + Task task = createTask(TestLdapSyncMassive.class.getName() + ".assertLdapConnectorInstances"); + OperationResult result = task.getResult(); + List stats = provisioningService.getConnectorOperationalStatus(RESOURCE_OPENDJ_OID, task, result); + display("Resource connector stats", stats); + assertSuccess(result); + + assertEquals("unexpected number of stats", 1, stats.size()); + ConnectorOperationalStatus stat = stats.get(0); + + int actualConnectorInstances = stat.getPoolStatusNumIdle() + stat.getPoolStatusNumActive(); + + if (actualConnectorInstances < expectedConnectorInstancesMin) { + fail("Number of LDAP connector instances too low: "+actualConnectorInstances+", expected at least "+expectedConnectorInstancesMin); + } + if (actualConnectorInstances > expectedConnectorInstancesMax) { + fail("Number of LDAP connector instances too high: "+actualConnectorInstances+", expected at most "+expectedConnectorInstancesMax); + } + } + + private void dumpLdap() throws DirectoryException { + display("LDAP server tree", openDJController.dumpTree()); + } + + +} \ No newline at end of file From df6b34aedd77341c4f59f2f0947f530fa466c4eb Mon Sep 17 00:00:00 2001 From: Pavol Mederly Date: Thu, 7 Feb 2019 18:39:38 +0100 Subject: [PATCH 017/224] Make DeleteTaskHandler stoppable (MID-5134) Originally this task handler did not watch for task.canRun() as it should. --- .../model/impl/util/DeleteTaskHandler.java | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/util/DeleteTaskHandler.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/util/DeleteTaskHandler.java index 7a32ea12e69..74dad692d1e 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/util/DeleteTaskHandler.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/util/DeleteTaskHandler.java @@ -189,7 +189,7 @@ private TaskRunResult runInternal(Task task) { } SearchResultList> objects; - while (true) { + while (task.canRun()) { objects = modelService.searchObjects(objectType, query, searchOptions, task, opResult); if (objects.isEmpty()) { break; @@ -197,6 +197,9 @@ private TaskRunResult runInternal(Task task) { int skipped = 0; for (PrismObject object: objects) { + if (!task.canRun()) { + break; + } if (!optionRaw && ShadowType.class.isAssignableFrom(objectType) && isTrue(((ShadowType)(object.asObjectable())).isProtectedObject())) { LOGGER.debug("Skipping delete of protected object {}", object); @@ -204,8 +207,7 @@ && isTrue(((ShadowType)(object.asObjectable())).isProtectedObject())) { continue; } - ObjectDelta delta = prismContext.deltaFactory().object().createDeleteDelta(objectType, object.getOid() - ); + ObjectDelta delta = prismContext.deltaFactory().object().createDeleteDelta(objectType, object.getOid()); String objectName = PolyString.getOrig(object.getName()); String objectDisplayName = StatisticsUtil.getDisplayName(object); @@ -225,14 +227,13 @@ && isTrue(((ShadowType)(object.asObjectable())).isProtectedObject())) { opResult.summarize(); if (LOGGER.isTraceEnabled()) { - LOGGER.trace("Search returned {} objects, {} skipped, progress: {}, result:\n{}", - objects.size(), skipped, task.getProgress(), opResult.debugDump()); + LOGGER.trace("Search returned {} objects, {} skipped, progress: {} (interrupted: {}), result:\n{}", + objects.size(), skipped, task.getProgress(), !task.canRun(), opResult.debugDump()); } if (objects.size() == skipped) { break; } - } } catch (ObjectAlreadyExistsException | ObjectNotFoundException | SchemaException @@ -260,11 +261,14 @@ && isTrue(((ShadowType)(object.asObjectable())).isProtectedObject())) { if (task.getProgress() > 0) { statistics += " Wall clock time average: " + ((float) wallTime / (float) task.getProgress()) + " milliseconds"; } + if (!task.canRun()) { + statistics += " (task run was interrupted)"; + } opResult.createSubresult(DeleteTaskHandler.class.getName() + ".statistics").recordStatus(OperationResultStatus.SUCCESS, statistics); LOGGER.info(finishMessage + statistics); - LOGGER.trace("Run finished (task {}, run result {})", task, runResult); + LOGGER.trace("Run finished (task {}, run result {}); interrupted = {}", task, runResult, !task.canRun()); return runResult; } From e2c8f79559194d974fac3991f5808e3e29c4d8f4 Mon Sep 17 00:00:00 2001 From: kate Date: Thu, 7 Feb 2019 22:19:45 +0100 Subject: [PATCH 018/224] schrodinger test: search resource by name --- .../com/evolveum/midpoint/testing/schrodinger/TestBase.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/testing/schrodingertest/src/test/java/com/evolveum/midpoint/testing/schrodinger/TestBase.java b/testing/schrodingertest/src/test/java/com/evolveum/midpoint/testing/schrodinger/TestBase.java index 564925ad7be..69e6f61ef4e 100644 --- a/testing/schrodingertest/src/test/java/com/evolveum/midpoint/testing/schrodinger/TestBase.java +++ b/testing/schrodingertest/src/test/java/com/evolveum/midpoint/testing/schrodinger/TestBase.java @@ -196,6 +196,11 @@ public void changeResourceAttribute(String resourceName,String attributeName,Str Assert.assertTrue( listResourcesPage .table() + .search() + .byName() + .inputValue(resourceName) + .updateSearch() + .and() .clickByName(resourceName) .clickEditResourceConfiguration() .form() From d7a33a6dd348899367890656e578fa6ab392f4bd Mon Sep 17 00:00:00 2001 From: Radovan Semancik Date: Fri, 8 Feb 2019 18:09:22 +0100 Subject: [PATCH 019/224] Reproduced provisioning/UCF/ConnId race issue (MID-5068) --- .../impl/dummy/AbstractDummyTest.java | 4 + .../impl/dummy/TestDummyParallelism.java | 175 +++++++++++++++++- .../test/resources/dummy/account-wally.xml | 38 ++++ .../test/AbstractIntegrationTest.java | 10 +- 4 files changed, 221 insertions(+), 6 deletions(-) create mode 100644 provisioning/provisioning-impl/src/test/resources/dummy/account-wally.xml diff --git a/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/impl/dummy/AbstractDummyTest.java b/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/impl/dummy/AbstractDummyTest.java index f63de9b58ed..6f918556a77 100644 --- a/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/impl/dummy/AbstractDummyTest.java +++ b/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/impl/dummy/AbstractDummyTest.java @@ -114,6 +114,10 @@ public abstract class AbstractDummyTest extends AbstractProvisioningIntegrationT protected static final String ACCOUNT_LECHUCK_OID = "c0c010c0-d34d-b44f-f11d-444400009aa9"; protected static final String ACCOUNT_LECHUCK_NAME = "lechuck"; + protected static final File ACCOUNT_WALLY_FILE = new File(TEST_DIR, "account-wally.xml"); + protected static final String ACCOUNT_WALLY_OID = "20b46da4-2bad-11e9-b807-7b7672a5eebe"; + protected static final String ACCOUNT_WALLY_NAME = "wally"; + protected static final File GROUP_PIRATES_FILE = new File(TEST_DIR, "group-pirates.xml"); protected static final String GROUP_PIRATES_OID = "c0c010c0-d34d-b44f-f11d-3332eeee0000"; protected static final String GROUP_PIRATES_NAME = "pirates"; diff --git a/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/impl/dummy/TestDummyParallelism.java b/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/impl/dummy/TestDummyParallelism.java index 02ab7630bbb..ce611f2fcfc 100644 --- a/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/impl/dummy/TestDummyParallelism.java +++ b/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/impl/dummy/TestDummyParallelism.java @@ -20,30 +20,51 @@ package com.evolveum.midpoint.provisioning.impl.dummy; import java.io.File; - +import java.util.ArrayList; +import java.util.List; +import java.util.Random; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.locks.Condition; +import java.util.concurrent.locks.Lock; +import java.util.concurrent.locks.ReentrantLock; + +import org.apache.commons.lang.mutable.MutableBoolean; import org.springframework.test.annotation.DirtiesContext; import org.springframework.test.context.ContextConfiguration; import org.testng.annotations.Listeners; import org.testng.annotations.Test; import com.evolveum.midpoint.prism.PrismObject; +import com.evolveum.midpoint.prism.delta.ItemDelta; import com.evolveum.midpoint.prism.delta.ObjectDelta; +import com.evolveum.midpoint.prism.query.ObjectQuery; import com.evolveum.midpoint.repo.cache.RepositoryCache; +import com.evolveum.midpoint.schema.ResultHandler; import com.evolveum.midpoint.schema.constants.SchemaConstants; import com.evolveum.midpoint.schema.result.OperationResult; +import com.evolveum.midpoint.schema.result.OperationResultStatus; +import com.evolveum.midpoint.schema.util.ObjectQueryUtil; import com.evolveum.midpoint.task.api.Task; import com.evolveum.midpoint.test.DummyResourceContoller; import com.evolveum.midpoint.test.asserter.ShadowAsserter; import com.evolveum.midpoint.test.util.Counter; import com.evolveum.midpoint.test.util.ParallelTestThread; import com.evolveum.midpoint.util.FailableProducer; +import com.evolveum.midpoint.util.exception.CommunicationException; +import com.evolveum.midpoint.util.exception.ConfigurationException; +import com.evolveum.midpoint.util.exception.ExpressionEvaluationException; import com.evolveum.midpoint.util.exception.ObjectAlreadyExistsException; import com.evolveum.midpoint.util.exception.ObjectNotFoundException; +import com.evolveum.midpoint.util.exception.PolicyViolationException; +import com.evolveum.midpoint.util.exception.SchemaException; +import com.evolveum.midpoint.util.exception.SecurityViolationException; import com.evolveum.midpoint.util.logging.Trace; import com.evolveum.midpoint.util.logging.TraceManager; import com.evolveum.midpoint.xml.ns._public.common.common_3.ActivationStatusType; import com.evolveum.midpoint.xml.ns._public.common.common_3.OperationProvisioningScriptsType; import com.evolveum.midpoint.xml.ns._public.common.common_3.PendingOperationExecutionStatusType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.ResourceType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowKindType; import com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowType; /** @@ -72,8 +93,13 @@ public class TestDummyParallelism extends AbstractBasicDummyTest { private static final int DUMMY_OPERATION_DELAY_RANGE = 1500; + private static final int MESS_RESOURCE_ITERATIONS = 200; + + private final Random RND = new Random(); + private String accountMorganOid; private String accountElizabethOid; + private String accountWallyOid; protected int getConcurrentTestNumberOfThreads() { return 5; @@ -602,4 +628,151 @@ public void test229ParallelDeleteSlow() throws Exception { assertSteadyResource(); } + /** + * Several threads reading from resource. Couple other threads try to get into the way + * by modifying the resource, hence forcing connector re-initialization. + * The goal is to detect connector initialization race conditions. + * + * MID-5068 + */ + @Test(enabled=false) // MID-5068 + public void test800ParallelReadAndModifyResource() throws Exception { + final String TEST_NAME = "test800ParallelReadAndModifyResource"; + displayTestTitle(TEST_NAME); + + Task task = createTask(TEST_NAME); + OperationResult result = task.getResult(); + + dummyResource.setOperationDelayRange(0); + + PrismObject accountBefore = parseObject(ACCOUNT_WALLY_FILE); + display("Account before", accountBefore); + accountWallyOid = provisioningService.addObject(accountBefore, null, null, task, result); + PrismObject shadowBefore = provisioningService.getObject(ShadowType.class, accountWallyOid, null, task, result); + result.computeStatus(); + if (result.getStatus() != OperationResultStatus.SUCCESS) { + display("Failed read result (precondition)", result); + fail("Unexpected read status (precondition): "+result.getStatus()); + } + + // WHEN + displayWhen(TEST_NAME); + + long t0 = System.currentTimeMillis(); + MutableBoolean readFinished = new MutableBoolean(); + + ParallelTestThread[] threads = multithread(TEST_NAME, + (threadIndex) -> { + + if (threadIndex <= 6) { + + for (int i = 0; /* neverending */ ; i++) { + + messResource(TEST_NAME, threadIndex, i); + + display("T +"+(System.currentTimeMillis() - t0)); + + if (readFinished.booleanValue()) { + break; + } + + } + + } else if (threadIndex == 7) { + + for (int i = 0; /* neverending */ ; i++) { + + Task localTask = createTask(TEST_NAME + ".test."+i); + + OperationResult testResult = provisioningService.testResource(RESOURCE_DUMMY_OID, localTask); + + display("TEST "+threadIndex+"."+i+": "+testResult.getStatus()); + + if (testResult.getStatus() != OperationResultStatus.SUCCESS) { + display("Failed test resource result", testResult); + readFinished.setValue(true); + fail("Unexpected test resource result status: "+testResult.getStatus()); + } + + if (readFinished.booleanValue()) { + break; + } + + } + + } else { + + try { + for (int i = 0; i < MESS_RESOURCE_ITERATIONS; i++) { + Task localTask = createTask(TEST_NAME + ".op."+i); + OperationResult localResult = localTask.getResult(); + + Object out = doResourceOperation(threadIndex, i, localTask, localResult); + + localResult.computeStatus(); + display("OP "+threadIndex+"."+i+": " + out.toString() + ": "+localResult.getStatus()); + + if (localResult.getStatus() != OperationResultStatus.SUCCESS) { + display("Failed read result", localResult); + readFinished.setValue(true); + fail("Unexpected read status: "+localResult.getStatus()); + } + + if (readFinished.booleanValue()) { + break; + } + } + } finally { + readFinished.setValue(true); + } + } + + display("mischief managed ("+threadIndex+")"); + + }, 15, getConcurrentTestFastRandomStartDelayRange()); + + // THEN + displayThen(TEST_NAME); + waitForThreads(threads, WAIT_TIMEOUT); + + PrismObject resourceAfter = provisioningService.getObject(ResourceType.class, RESOURCE_DUMMY_OID, null, task, result); + display("resource after", resourceAfter); + } + + private Object doResourceOperation(int threadIndex, int i, Task task, OperationResult result) throws Exception { + int op = RND.nextInt(3); + + if (op == 0) { + return provisioningService.getObject(ShadowType.class, accountWallyOid, null, task, result); + + } else if (op == 1) { + ObjectQuery query = ObjectQueryUtil.createResourceAndKind(RESOURCE_DUMMY_OID, ShadowKindType.ACCOUNT, prismContext); + List> list = new ArrayList<>(); + ResultHandler handler = (o,or) -> { list.add(o); return true; }; + provisioningService.searchObjectsIterative(ShadowType.class, query, null, handler, task, result); + return list; + + } else if (op == 2) { + ObjectQuery query = ObjectQueryUtil.createResourceAndKind(RESOURCE_DUMMY_OID, ShadowKindType.ACCOUNT, prismContext); + return provisioningService.searchObjects(ShadowType.class, query, null, task, result); + } + return null; + } + + private void messResource(final String TEST_NAME, int threadIndex, int i) throws ObjectNotFoundException, SchemaException, CommunicationException, ConfigurationException, SecurityViolationException, PolicyViolationException, ObjectAlreadyExistsException, ExpressionEvaluationException { + Task task = createTask(TEST_NAME+".mess."+threadIndex+"."+i); + OperationResult result = task.getResult(); + List> deltas = deltaFor(ResourceType.class) + .item(ResourceType.F_DESCRIPTION).replace("Iter "+threadIndex+"."+i) + .asItemDeltas(); + provisioningService.modifyObject(ResourceType.class, RESOURCE_DUMMY_OID, deltas, null, null, task, result); + result.computeStatus(); + + display("MESS "+threadIndex+"."+i+": "+result.getStatus()); + + if (result.getStatus() != OperationResultStatus.SUCCESS) { + display("Failed mess resource result", result); + fail("Unexpected mess resource result status: "+result.getStatus()); + } + } } diff --git a/provisioning/provisioning-impl/src/test/resources/dummy/account-wally.xml b/provisioning/provisioning-impl/src/test/resources/dummy/account-wally.xml new file mode 100644 index 00000000000..0e4464d278e --- /dev/null +++ b/provisioning/provisioning-impl/src/test/resources/dummy/account-wally.xml @@ -0,0 +1,38 @@ + + + + + + ri:AccountObjectClass + account + + wally + Wally B. Feed + + + + + IloveMAPS + + + + diff --git a/repo/repo-test-util/src/main/java/com/evolveum/midpoint/test/AbstractIntegrationTest.java b/repo/repo-test-util/src/main/java/com/evolveum/midpoint/test/AbstractIntegrationTest.java index 876aee14574..d190a4293b4 100644 --- a/repo/repo-test-util/src/main/java/com/evolveum/midpoint/test/AbstractIntegrationTest.java +++ b/repo/repo-test-util/src/main/java/com/evolveum/midpoint/test/AbstractIntegrationTest.java @@ -1736,7 +1736,7 @@ protected void assertSuccess(OperationResult result) { if (result.isUnknown()) { result.computeStatus(); } - display("Operation result status", result.getStatus()); + display("Operation " + result.getOperation() + " result status", result.getStatus()); TestUtil.assertSuccess(result); } @@ -1744,7 +1744,7 @@ protected void assertHadnledError(OperationResult result) { if (result.isUnknown()) { result.computeStatus(); } - display("Operation result status", result.getStatus()); + display("Operation " + result.getOperation() + " result status", result.getStatus()); TestUtil.assertResultStatus(result, OperationResultStatus.HANDLED_ERROR); } @@ -1752,7 +1752,7 @@ protected void assertSuccess(OperationResult result, int depth) { if (result.isUnknown()) { result.computeStatus(); } - display("Operation result status", result.getStatus()); + display("Operation " + result.getOperation() + " result status", result.getStatus()); TestUtil.assertSuccess(result, depth); } @@ -1767,7 +1767,7 @@ protected void assertResultStatus(OperationResult result, OperationResultStatus if (result.isUnknown()) { result.computeStatus(); } - assertEquals("Unexpected result status", expectedStatus, result.getStatus()); + assertEquals("Unexpected operation " + result.getOperation() + " result status", expectedStatus, result.getStatus()); } protected String assertInProgress(OperationResult result) { @@ -1775,7 +1775,7 @@ protected String assertInProgress(OperationResult result) { result.computeStatus(); } if (!OperationResultStatus.IN_PROGRESS.equals(result.getStatus())) { - String message = "Expected IN_PROGRESS, but result status was " + result.getStatus(); + String message = "Expected operation " + result.getOperation() + " status IN_PROGRESS, but result status was " + result.getStatus(); display (message, result); fail(message); } From ab6ef90cf3be9890c47714d94939b56e2cbcd904 Mon Sep 17 00:00:00 2001 From: kate Date: Mon, 11 Feb 2019 09:19:40 +0100 Subject: [PATCH 020/224] archetype schrodinger tests --- .../resources/localization/schema.properties | 16 +++++++- .../testing/schrodinger/TestBase.java | 11 ++++-- .../scenarios/ObjectListArchetypeTests.java | 33 +++++++++++++++++ .../objects/archetypes/archetype-employee.xml | 37 +++++++++++++++++++ 4 files changed, 93 insertions(+), 4 deletions(-) create mode 100644 testing/schrodingertest/src/test/java/com/evolveum/midpoint/testing/schrodinger/scenarios/ObjectListArchetypeTests.java create mode 100644 testing/schrodingertest/src/test/resources/configuration/objects/archetypes/archetype-employee.xml diff --git a/infra/schema/src/main/resources/localization/schema.properties b/infra/schema/src/main/resources/localization/schema.properties index 9560c93b2c3..a5932b4673c 100755 --- a/infra/schema/src/main/resources/localization/schema.properties +++ b/infra/schema/src/main/resources/localization/schema.properties @@ -331,6 +331,16 @@ GuiObjectListViewType.disableSorting=Disable sorting GuiObjectListViewType.action=Action GuiObjectListViewsType.default=Default GuiObjectListViewsType.objectList=Object list +GuiObjectListViewsType.objectCollectionView=Object collection view +GuiObjectListViewType.collection=Collection +CollectionSpecificationType.collectionRef=Collection ref +CollectionSpecificationType.depth=Depth +CollectionSpecificationType.interpretation=Interpretation +CollectionSpecificationType.relation=Relation +UserInterfaceFeatureType.display=Display +DisplayType.pluralLabel=Plural label +DisplayType.icon=Icon +IconType.color=Color HasAssignmentPolicyConstraintType.targetRef=Target HasAssignmentPolicyConstraintType.enabled=Enable HasAssignmentPolicyConstraintType.direct=Direct @@ -623,6 +633,8 @@ RoleManagementConfigurationType.defaultExecuteAfterAllApprovals=Default execute RoleManagementConfigurationType.autoassignEnabled=Autoassign enabled RoleManagementConfigurationType.relations=Relations SearchBoxConfigurationType.defaultMode=Default mode +SearchBoxConfigurationType.defaultObjectType=Default object type +SearchBoxConfigurationType.defaultScope=Default scope ShadowType.dead=Dead ShadowType.kind=Kind ShadowType.failedOperationType=Failed operation type @@ -865,6 +877,8 @@ AdminGuiConfigurationType.defaultExportSettings=Default export settings AdminGuiConfigurationType.feature=Feature AdminGuiConfigurationType.feedbackMessagesHook=Feedback messages hook AdminGuiConfigurationType.roleManagement=Role management +AdminGuiConfigurationType.displayFormats=Display formats +AdminGuiConfigurationType.objectCollectionViews=Object collection views midPointVersion=${pom.version} midPointRevision=${git.describe} IdempotenceType.CONSERVATIVE=Conservative @@ -1227,4 +1241,4 @@ ArchetypePolicyType.display=Display ArchetypePolicyType.conflictResolution=Conflict resolution ArchetypePolicyType.lifecycleStateModel=Lifecycle state model ArchetypePolicyType.applicablePolicies=Applicable policies -ConfigurationType.configurationProperties=Configuration properties \ No newline at end of file +ConfigurationType.configurationProperties=Configuration properties diff --git a/testing/schrodingertest/src/test/java/com/evolveum/midpoint/testing/schrodinger/TestBase.java b/testing/schrodingertest/src/test/java/com/evolveum/midpoint/testing/schrodinger/TestBase.java index 69e6f61ef4e..b5d95100636 100644 --- a/testing/schrodingertest/src/test/java/com/evolveum/midpoint/testing/schrodinger/TestBase.java +++ b/testing/schrodingertest/src/test/java/com/evolveum/midpoint/testing/schrodinger/TestBase.java @@ -197,9 +197,9 @@ public void changeResourceAttribute(String resourceName,String attributeName,Str listResourcesPage .table() .search() - .byName() - .inputValue(resourceName) - .updateSearch() + .byName() + .inputValue(resourceName) + .updateSearch() .and() .clickByName(resourceName) .clickEditResourceConfiguration() @@ -214,6 +214,11 @@ public void changeResourceAttribute(String resourceName,String attributeName,Str Assert.assertTrue( listResourcesPage .table() + .search() + .byName() + .inputValue(resourceName) + .updateSearch() + .and() .clickByName(resourceName) .clickEditResourceConfiguration() .form() diff --git a/testing/schrodingertest/src/test/java/com/evolveum/midpoint/testing/schrodinger/scenarios/ObjectListArchetypeTests.java b/testing/schrodingertest/src/test/java/com/evolveum/midpoint/testing/schrodinger/scenarios/ObjectListArchetypeTests.java new file mode 100644 index 00000000000..b7f813cd9cd --- /dev/null +++ b/testing/schrodingertest/src/test/java/com/evolveum/midpoint/testing/schrodinger/scenarios/ObjectListArchetypeTests.java @@ -0,0 +1,33 @@ +package com.evolveum.midpoint.testing.schrodinger.scenarios; + +import com.evolveum.midpoint.schrodinger.page.configuration.ImportObjectPage; +import com.evolveum.midpoint.testing.schrodinger.TestBase; +import org.testng.Assert; +import org.testng.annotations.Test; + +import javax.naming.ConfigurationException; +import java.io.File; +import java.io.IOException; + +/** + * Created by honchar + */ +public class ObjectListArchetypeTests extends TestBase { + + private static final File EMPLOYEE_ARCHETYPE_FILE = new File("src/test/resources/configuration/objects/archetypes/archetype-employee.xml"); + + @Test + public void importEmployeeArchetype() throws IOException, ConfigurationException { + + ImportObjectPage importPage = basicPage.importObject(); + Assert.assertTrue( + importPage + .getObjectsFromFile() + .chooseFile(EMPLOYEE_ARCHETYPE_FILE) + .checkOverwriteExistingObject() + .clickImport() + .feedback() + .isSuccess() + ); + } +} diff --git a/testing/schrodingertest/src/test/resources/configuration/objects/archetypes/archetype-employee.xml b/testing/schrodingertest/src/test/resources/configuration/objects/archetypes/archetype-employee.xml new file mode 100644 index 00000000000..df79c31fe63 --- /dev/null +++ b/testing/schrodingertest/src/test/resources/configuration/objects/archetypes/archetype-employee.xml @@ -0,0 +1,37 @@ + + + Employee + + + + Employees + + fa fa-male + blue + + + + + + UserType + + + From f09a5b9f02638d56366cdc7593107ba0c63ac197 Mon Sep 17 00:00:00 2001 From: Pavol Mederly Date: Fri, 8 Feb 2019 20:02:39 +0100 Subject: [PATCH 021/224] Add "thread dump" functionality (GUI, REST) Thread dumps now can be requested via GUI or via REST. They can be global (all threads) or related to running tasks only. Dumps can be displayed or attached to respective tasks as diagnostic information. --- .../configuration/InternalsThreadsPanel.html | 35 +++++ .../configuration/InternalsThreadsPanel.java | 145 ++++++++++++++++++ .../admin/configuration/PageInternals.java | 16 +- .../localization/Midpoint.properties | 10 +- .../schema/constants/SchemaConstants.java | 16 +- .../xml/ns/public/common/common-core-3.xsd | 74 +++++++++ .../com/evolveum/midpoint/util/MiscUtil.java | 28 ++++ .../model/api/ModelAuthorizationAction.java | 2 + .../midpoint/model/api/TaskService.java | 20 +++ .../midpoint/model/impl/ModelRestService.java | 69 ++++++++- .../impl/controller/ModelController.java | 34 +++- .../midpoint/repo/api/RepositoryService.java | 7 + .../midpoint/repo/cache/RepositoryCache.java | 15 ++ .../repo/sql/SqlRepositoryServiceImpl.java | 71 +++++++++ .../midpoint/task/api/TaskManager.java | 9 ++ .../quartzimpl/TaskManagerQuartzImpl.java | 28 ++++ .../task/quartzimpl/TaskQuartzImpl.java | 17 +- .../execution/ExecutionManager.java | 141 +++++++++++++++++ .../quartzimpl/execution/JobExecutor.java | 1 - .../execution/LocalNodeManager.java | 19 +++ .../execution/StalledTasksWatcher.java | 15 +- .../script-delay-for-testing-thread-dumps.xml | 63 ++++++++ 22 files changed, 818 insertions(+), 17 deletions(-) create mode 100644 gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/configuration/InternalsThreadsPanel.html create mode 100644 gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/configuration/InternalsThreadsPanel.java create mode 100644 samples/tasks/bulk-actions/script-delay-for-testing-thread-dumps.xml diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/configuration/InternalsThreadsPanel.html b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/configuration/InternalsThreadsPanel.html new file mode 100644 index 00000000000..f7d73545dab --- /dev/null +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/configuration/InternalsThreadsPanel.html @@ -0,0 +1,35 @@ + + + + + + + + + + \ No newline at end of file diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/configuration/InternalsThreadsPanel.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/configuration/InternalsThreadsPanel.java new file mode 100644 index 00000000000..9c795a1ab76 --- /dev/null +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/configuration/InternalsThreadsPanel.java @@ -0,0 +1,145 @@ +/* + * Copyright (c) 2010-2019 Evolveum + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.evolveum.midpoint.web.page.admin.configuration; + +import com.evolveum.midpoint.gui.api.component.BasePanel; +import com.evolveum.midpoint.schema.constants.SchemaConstants; +import com.evolveum.midpoint.schema.result.OperationResult; +import com.evolveum.midpoint.task.api.Task; +import com.evolveum.midpoint.util.exception.CommonException; +import com.evolveum.midpoint.util.logging.LoggingUtils; +import com.evolveum.midpoint.util.logging.Trace; +import com.evolveum.midpoint.util.logging.TraceManager; +import com.evolveum.midpoint.web.component.AceEditor; +import com.evolveum.midpoint.web.component.AjaxButton; +import com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour; +import org.apache.wicket.ajax.AjaxRequestTarget; +import org.apache.wicket.model.IModel; +import org.apache.wicket.model.Model; + +public class InternalsThreadsPanel extends BasePanel { + + private static final Trace LOGGER = TraceManager.getTrace(InternalsThreadsPanel.class); + + private static final long serialVersionUID = 1L; + + private static final String ID_RESULT = "result"; + + private static final String ID_SHOW_ALL_THREADS = "showAllThreads"; + private static final String ID_SHOW_TASKS_THREADS = "showTasksThreads"; + private static final String ID_RECORD_TASKS_THREADS = "recordTasksThreads"; + + private IModel resultModel = Model.of((String) null); + + public InternalsThreadsPanel(String id) { + super(id); + } + + @Override + protected void onInitialize() { + super.onInitialize(); + + AceEditor result = new AceEditor(ID_RESULT, resultModel); + result.setReadonly(true); + result.setResizeToMaxHeight(true); + result.setMode(null); + result.add(new VisibleEnableBehaviour() { + @Override + public boolean isVisible() { + return resultModel.getObject() != null; + } + }); + add(result); + + add(new AjaxButton(ID_SHOW_ALL_THREADS, createStringResource("InternalsThreadsPanel.button.showAllThreads")) { + private static final long serialVersionUID = 1L; + @Override + public void onClick(AjaxRequestTarget target) { + executeShowAllThreads(target); + } + }); + add(new AjaxButton(ID_SHOW_TASKS_THREADS, createStringResource("InternalsThreadsPanel.button.showTasksThreads")) { + private static final long serialVersionUID = 1L; + @Override + public void onClick(AjaxRequestTarget target) { + executeShowTasksThreads(target); + } + }); + add(new AjaxButton(ID_RECORD_TASKS_THREADS, createStringResource("InternalsThreadsPanel.button.recordTasksThreads")) { + private static final long serialVersionUID = 1L; + @Override + public void onClick(AjaxRequestTarget target) { + executeRecordTasksThreads(target); + } + }); + + } + + private void executeShowAllThreads(AjaxRequestTarget target) { + Task task = getPageBase().createSimpleTask(InternalsThreadsPanel.class.getName() + ".executeShowAllThreads"); + OperationResult result = task.getResult(); + + try { + String dump = getPageBase().getTaskService().getThreadsDump(task, result); + LOGGER.debug("Threads:\n{}", dump); + resultModel.setObject(dump); + } catch (CommonException | RuntimeException e) { + result.recordFatalError("Couldn't get threads", e); + LoggingUtils.logUnexpectedException(LOGGER, "Couldn't get threads", e); + } finally { + result.computeStatus(); + } + getPageBase().showResult(result); + target.add(this, getPageBase().getFeedbackPanel()); + } + + private void executeShowTasksThreads(AjaxRequestTarget target) { + Task task = getPageBase().createSimpleTask(InternalsThreadsPanel.class.getName() + ".executeShowTasksThreads"); + OperationResult result = task.getResult(); + + try { + String dump = getPageBase().getTaskService().getRunningTasksThreadsDump(task, result); + LOGGER.debug("Running tasks' threads:\n{}", dump); + resultModel.setObject(dump); + } catch (CommonException | RuntimeException e) { + result.recordFatalError("Couldn't get tasks' threads", e); + LoggingUtils.logUnexpectedException(LOGGER, "Couldn't get tasks' threads", e); + } finally { + result.computeStatus(); + } + getPageBase().showResult(result); + target.add(this, getPageBase().getFeedbackPanel()); + } + + private void executeRecordTasksThreads(AjaxRequestTarget target) { + Task task = getPageBase().createSimpleTask(InternalsThreadsPanel.class.getName() + ".executeRecordTasksThreads"); + OperationResult result = task.getResult(); + + try { + String info = getPageBase().getTaskService().recordRunningTasksThreadsDump(SchemaConstants.USER_REQUEST_URI, task, result); + resultModel.setObject(info); + } catch (CommonException | RuntimeException e) { + result.recordFatalError("Couldn't record tasks' threads", e); + LoggingUtils.logUnexpectedException(LOGGER, "Couldn't record tasks' threads", e); + } finally { + result.computeStatus(); + } + getPageBase().showResult(result); + target.add(this, getPageBase().getFeedbackPanel()); + } + +} diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/configuration/PageInternals.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/configuration/PageInternals.java index 34e1856371d..f40c7abc9dd 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/configuration/PageInternals.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/configuration/PageInternals.java @@ -145,6 +145,16 @@ public WebMarkupContainer getPanel(String panelId) { } }); + tabs.add(new AbstractTab(createStringResource("PageInternals.tab.threads")) { + + private static final long serialVersionUID = 1L; + + @Override + public WebMarkupContainer getPanel(String panelId) { + return initThreadsPanel(panelId); + } + }); + TabbedPanel tabPannel = new TabbedPanel<>(ID_TAB_PANEL, tabs); add(tabPannel); @@ -171,10 +181,12 @@ private WebMarkupContainer initCounters(String panelId) { } private WebMarkupContainer initCachePanel(String panelId) { - return new InternalsCachePanel(panelId); + return new InternalsCachePanel(panelId); } + private WebMarkupContainer initThreadsPanel(String panelId) { + return new InternalsThreadsPanel(panelId); + } - } diff --git a/gui/admin-gui/src/main/resources/localization/Midpoint.properties b/gui/admin-gui/src/main/resources/localization/Midpoint.properties index e8d7962bea0..ff952ba804a 100755 --- a/gui/admin-gui/src/main/resources/localization/Midpoint.properties +++ b/gui/admin-gui/src/main/resources/localization/Midpoint.properties @@ -4253,8 +4253,13 @@ DisplayNamePanel.viewObjectDetails=View object details PageUsersView.title=Users view pageAdminFocus.dataProtection=Data protection PageInternals.title.cache=Caches +PageInternals.title.threads=Threads PageInternals.tab.cache=Cache management +PageInternals.tab.threads=Threads InternalsCachePanel.button.clearCaches=Clear caches +InternalsThreadsPanel.button.showAllThreads=Show all threads +InternalsThreadsPanel.button.showTasksThreads=Show tasks threads +InternalsThreadsPanel.button.recordTasksThreads=Record tasks threads PageAccountActivation.user.not.found=Unexpected problem occurs. Please contact system administrator. propertyConstraintValidator.error=Cannot set property constraint without path defined. ReferencePopupPanel.oid=Oid: @@ -4356,4 +4361,7 @@ LoggingConfigurationTabPanel.appender.nameColumn=Name LoggingConfigurationTabPanel.appender.patternColumn=Pattern LoggingConfigurationTabPanel.appender.typeColumn=Type ResourceSummaryPanel.UP=Up -ResourceSummaryPanel.DOWN=Down \ No newline at end of file +ResourceSummaryPanel.DOWN=Down +operation.com.evolveum.midpoint.web.page.admin.configuration.InternalsThreadsPanel.executeShowAllThreads=Show all threads (Gui) +operation.com.evolveum.midpoint.web.page.admin.configuration.InternalsThreadsPanel.executeShowTasksThreads=Show running tasks threads (Gui) +operation.com.evolveum.midpoint.web.page.admin.configuration.InternalsThreadsPanel.executeRecordTasksThreads=Record running tasks threads (Gui) \ No newline at end of file diff --git a/infra/schema/src/main/java/com/evolveum/midpoint/schema/constants/SchemaConstants.java b/infra/schema/src/main/java/com/evolveum/midpoint/schema/constants/SchemaConstants.java index 28a4770e31d..8531101d7ac 100644 --- a/infra/schema/src/main/java/com/evolveum/midpoint/schema/constants/SchemaConstants.java +++ b/infra/schema/src/main/java/com/evolveum/midpoint/schema/constants/SchemaConstants.java @@ -602,11 +602,23 @@ public abstract class SchemaConstants { public static final ItemPath PATH_PARENT = ItemPath.create(PrismConstants.T_PARENT); public static final ItemPath PATH_OBJECT_REFERENCE = ItemPath.create(PrismConstants.T_OBJECT_REFERENCE); - + + // diagnostic information types + + public static final QName TASK_THREAD_DUMP = new QName(NS_C, "taskThreadDump"); + public static final String TASK_THREAD_DUMP_URI = QNameUtil.qNameToUri(TASK_THREAD_DUMP); + + // diagnostic information causes + + public static final QName USER_REQUEST = new QName(NS_C, "userRequest"); + public static final String USER_REQUEST_URI = QNameUtil.qNameToUri(USER_REQUEST); + public static final QName INTERNAL = new QName(NS_C, "internal"); + public static final String INTERNAL_URI = QNameUtil.qNameToUri(INTERNAL); + //task stages private static final String RECON_HANDLER = "http://midpoint.evolveum.com/xml/ns/public/model/synchronization/task/reconciliation/handler-3"; public static final String DRY_RUN_URI = RECON_HANDLER + "#dryRun"; public static final String SIMULATE_URI = RECON_HANDLER + "#simulate"; public static final String EXECUTE_URI = RECON_HANDLER + "#execute"; - + } diff --git a/infra/schema/src/main/resources/xml/ns/public/common/common-core-3.xsd b/infra/schema/src/main/resources/xml/ns/public/common/common-core-3.xsd index 0ca28178a62..7ae3a58c24e 100755 --- a/infra/schema/src/main/resources/xml/ns/public/common/common-core-3.xsd +++ b/infra/schema/src/main/resources/xml/ns/public/common/common-core-3.xsd @@ -432,6 +432,18 @@ + + + + Diagnostic information attached to this object. + + + 4.0 + true + + + + @@ -2765,6 +2777,68 @@ + + + + A diagnostic information attached to an object. + It can be put there because of a user request or by midPoint itself. + EXPERIMENTAL. + + + 4.0 + true + + + + + + + When the information was created. + + + + + + + Type of the information (e.g. thread dump). + + + + + + + Cause of the information being created (e.g. a user request). + + + + + + + Identifier of a node where the information was captured. + + + + + + + + + + + + + + + + + A textual representation of the information. + (It can be augmented/replaced by more structured form using a subclass of DiagnosticInformationType.) + + + + + + diff --git a/infra/util/src/main/java/com/evolveum/midpoint/util/MiscUtil.java b/infra/util/src/main/java/com/evolveum/midpoint/util/MiscUtil.java index 1d9f4f609dd..3179db59c39 100644 --- a/infra/util/src/main/java/com/evolveum/midpoint/util/MiscUtil.java +++ b/infra/util/src/main/java/com/evolveum/midpoint/util/MiscUtil.java @@ -23,12 +23,16 @@ import com.evolveum.midpoint.util.logging.Trace; import com.evolveum.midpoint.util.logging.TraceManager; +import org.jetbrains.annotations.Nullable; import javax.xml.datatype.DatatypeConfigurationException; import javax.xml.datatype.DatatypeConstants; import javax.xml.datatype.DatatypeFactory; import javax.xml.datatype.XMLGregorianCalendar; import java.io.*; +import java.lang.management.ManagementFactory; +import java.lang.management.ThreadInfo; +import java.lang.management.ThreadMXBean; import java.net.MalformedURLException; import java.net.URI; import java.net.URL; @@ -735,4 +739,28 @@ public static List join(Collection a, Collection b) { return list; } + /** + * Thanks for this code go to https://crunchify.com/how-to-generate-java-thread-dump-programmatically/ + */ + public static String takeThreadDump(@Nullable Thread thread) { + StringBuilder dump = new StringBuilder(); + ThreadMXBean threadMXBean = ManagementFactory.getThreadMXBean(); + long[] threadIds = thread != null ? new long[] { thread.getId() } : threadMXBean.getAllThreadIds(); + ThreadInfo[] threadInfos = threadMXBean.getThreadInfo(threadIds, 100); + for (ThreadInfo threadInfo : threadInfos) { + dump.append("Thread name: \""); + dump.append(threadInfo.getThreadName()); + dump.append("\"\n"); + dump.append("Thread state: "); + dump.append(threadInfo.getThreadState()); + StackTraceElement[] stackTraceElements = threadInfo.getStackTrace(); + for (StackTraceElement stackTraceElement : stackTraceElements) { + dump.append("\n at "); + dump.append(stackTraceElement); + } + dump.append("\n\n"); + } + return dump.toString(); + } + } diff --git a/model/model-api/src/main/java/com/evolveum/midpoint/model/api/ModelAuthorizationAction.java b/model/model-api/src/main/java/com/evolveum/midpoint/model/api/ModelAuthorizationAction.java index f8b5e2af931..141e7f7dfac 100644 --- a/model/model-api/src/main/java/com/evolveum/midpoint/model/api/ModelAuthorizationAction.java +++ b/model/model-api/src/main/java/com/evolveum/midpoint/model/api/ModelAuthorizationAction.java @@ -62,6 +62,8 @@ public enum ModelAuthorizationAction implements DisplayableValue { STOP_TASK_SCHEDULER("stopTaskScheduler", "Stop task scheduler", "STOP_TASK_SCHEDULER_HELP"), START_TASK_SCHEDULER("startTaskScheduler", "Start task scheduler", "START_TASK_SCHEDULER_HELP"), + READ_THREADS("readThreads", "Read threads", "READ_THREADS_HELP"), + CREATE_CERTIFICATION_CAMPAIGN("createCertificationCampaign", "Create a certification campaign", "CREATE_CERTIFICATION_CAMPAIGN_HELP"), OPEN_CERTIFICATION_CAMPAIGN_REVIEW_STAGE("openCertificationCampaignReviewStage", "Open access certification campaign review stage", "OPEN_CERTIFICATION_CAMPAIGN_REVIEW_STAGE_HELP"), CLOSE_CERTIFICATION_CAMPAIGN_REVIEW_STAGE("closeCertificationCampaignReviewStage", "Close access certification campaign review stage", "CLOSE_CERTIFICATION_CAMPAIGN_REVIEW_STAGE_HELP"), diff --git a/model/model-api/src/main/java/com/evolveum/midpoint/model/api/TaskService.java b/model/model-api/src/main/java/com/evolveum/midpoint/model/api/TaskService.java index 6877f251bd4..28f81ed7c85 100644 --- a/model/model-api/src/main/java/com/evolveum/midpoint/model/api/TaskService.java +++ b/model/model-api/src/main/java/com/evolveum/midpoint/model/api/TaskService.java @@ -23,6 +23,7 @@ import com.evolveum.midpoint.util.exception.*; import com.evolveum.midpoint.xml.ns._public.common.common_3.SchedulerInformationType; import com.evolveum.midpoint.xml.ns._public.common.common_3.TaskType; +import org.jetbrains.annotations.NotNull; import java.util.Collection; import java.util.List; @@ -209,5 +210,24 @@ void deleteWorkersAndWorkState(String coordinatorOid, long subtasksWaitTime, Tas throws SecurityViolationException, ObjectNotFoundException, SchemaException, ExpressionEvaluationException, CommunicationException, ConfigurationException; + String getThreadsDump(@NotNull Task task, @NotNull OperationResult parentResult) throws CommunicationException, + ObjectNotFoundException, SchemaException, SecurityViolationException, + ConfigurationException, ExpressionEvaluationException; + + // TODO migrate to more structured information + String getRunningTasksThreadsDump(@NotNull Task task, @NotNull OperationResult parentResult) + throws CommunicationException, ObjectNotFoundException, SchemaException, SecurityViolationException, + ConfigurationException, ExpressionEvaluationException; + + // TODO reconsider the return value + String recordRunningTasksThreadsDump(String cause, @NotNull Task task, @NotNull OperationResult parentResult) + throws CommunicationException, ObjectNotFoundException, SchemaException, SecurityViolationException, + ConfigurationException, ExpressionEvaluationException, ObjectAlreadyExistsException; + + // TODO migrate to more structured information + String getTaskThreadsDump(@NotNull String taskOid, @NotNull Task task, @NotNull OperationResult parentResult) + throws CommunicationException, ObjectNotFoundException, SchemaException, SecurityViolationException, + ConfigurationException, ExpressionEvaluationException; + //endregion } diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/ModelRestService.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/ModelRestService.java index 9234765fd83..b66899a8141 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/ModelRestService.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/ModelRestService.java @@ -109,6 +109,9 @@ public class ModelRestService { public static final String OPERATION_STOP_LOCAL_SCHEDULER = CLASS_DOT + "stopScheduler"; public static final String OPERATION_START_LOCAL_SCHEDULER = CLASS_DOT + "startScheduler"; public static final String OPERATION_STOP_LOCAL_TASK = CLASS_DOT + "stopLocalTask"; + public static final String OPERATION_GET_THREADS_DUMP = CLASS_DOT + "getThreadsDump"; + public static final String OPERATION_GET_RUNNING_TASKS_THREADS_DUMP = CLASS_DOT + "getRunningTasksThreadsDump"; + public static final String OPERATION_GET_TASK_THREADS_DUMP = CLASS_DOT + "getTaskThreadsDump"; private static final String CURRENT = "current"; private static final String VALIDATE = "validate"; @@ -1054,8 +1057,72 @@ public Response executeCredentialReset(@PathParam("oid") String oid, ExecuteCred finishRequest(task); return response; + } - + + @GET + @Path("/threads") + @Produces({"text/plain"}) + public Response getThreadsDump(@Context MessageContext mc) { + + Task task = RestServiceUtil.initRequest(mc); + OperationResult result = task.getResult().createSubresult(OPERATION_GET_THREADS_DUMP); + + Response response; + try { + String dump = taskService.getThreadsDump(task, result); + response = Response.ok(dump).build(); + } catch (Exception ex) { + LoggingUtils.logUnexpectedException(LOGGER, "Cannot get threads dump", ex); + response = RestServiceUtil.handleExceptionNoLog(result, ex); + } + result.computeStatus(); + finishRequest(task); + return response; + } + + @GET + @Path("/tasks/threads") + @Produces({"text/plain"}) + public Response getRunningTasksThreadsDump(@Context MessageContext mc) { + + Task task = RestServiceUtil.initRequest(mc); + OperationResult result = task.getResult().createSubresult(OPERATION_GET_RUNNING_TASKS_THREADS_DUMP); + + Response response; + try { + String dump = taskService.getRunningTasksThreadsDump(task, result); + response = Response.ok(dump).build(); + } catch (Exception ex) { + LoggingUtils.logUnexpectedException(LOGGER, "Cannot get running tasks threads dump", ex); + response = RestServiceUtil.handleExceptionNoLog(result, ex); + } + result.computeStatus(); + finishRequest(task); + return response; + } + + @GET + @Path("/tasks/{oid}/threads") + @Produces({"text/plain"}) + public Response getTaskThreadsDump(@PathParam("oid") String oid, @Context MessageContext mc) { + + Task task = RestServiceUtil.initRequest(mc); + OperationResult result = task.getResult().createSubresult(OPERATION_GET_TASK_THREADS_DUMP); + + Response response; + try { + String dump = taskService.getTaskThreadsDump(oid, task, result); + response = Response.ok(dump).build(); + } catch (Exception ex) { + LoggingUtils.logUnexpectedException(LOGGER, "Cannot get task threads dump for task " + oid, ex); + response = RestServiceUtil.handleExceptionNoLog(result, ex); + } + result.computeStatus(); + finishRequest(task); + return response; + } + // @GET // @Path("tasks/{oid}") // public Response getTaskByIdentifier(@PathParam("oid") String identifier) throws SchemaException, ObjectNotFoundException { diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/controller/ModelController.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/controller/ModelController.java index b4ac06f5457..c7f88a0fa95 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/controller/ModelController.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/controller/ModelController.java @@ -2289,6 +2289,38 @@ public void completeWorkItem(@NotNull String caseOid, long workItemId, AbstractW } } -//endregion + @Override + public String getThreadsDump(@NotNull Task task, @NotNull OperationResult parentResult) + throws CommunicationException, ObjectNotFoundException, SchemaException, SecurityViolationException, + ConfigurationException, ExpressionEvaluationException { + securityEnforcer.authorize(ModelAuthorizationAction.READ_THREADS.getUrl(), null, AuthorizationParameters.EMPTY, null, task, parentResult); + return MiscUtil.takeThreadDump(null); + } + + @Override + public String getRunningTasksThreadsDump(@NotNull Task task, @NotNull OperationResult parentResult) + throws CommunicationException, ObjectNotFoundException, SchemaException, SecurityViolationException, + ConfigurationException, ExpressionEvaluationException { + securityEnforcer.authorize(ModelAuthorizationAction.READ_THREADS.getUrl(), null, AuthorizationParameters.EMPTY, null, task, parentResult); + return taskManager.getRunningTasksThreadsDump(parentResult); + } + + @Override + public String recordRunningTasksThreadsDump(String cause, @NotNull Task task, @NotNull OperationResult parentResult) + throws CommunicationException, ObjectNotFoundException, SchemaException, SecurityViolationException, + ConfigurationException, ExpressionEvaluationException, ObjectAlreadyExistsException { + securityEnforcer.authorize(ModelAuthorizationAction.READ_THREADS.getUrl(), null, AuthorizationParameters.EMPTY, null, task, parentResult); + return taskManager.recordRunningTasksThreadsDump(cause, parentResult); + } + + @Override + public String getTaskThreadsDump(@NotNull String taskOid, @NotNull Task task, @NotNull OperationResult parentResult) + throws CommunicationException, ObjectNotFoundException, SchemaException, SecurityViolationException, + ConfigurationException, ExpressionEvaluationException { + securityEnforcer.authorize(ModelAuthorizationAction.READ_THREADS.getUrl(), null, AuthorizationParameters.EMPTY, null, task, parentResult); + return taskManager.getTaskThreadsDump(taskOid, parentResult); + } + + //endregion } diff --git a/repo/repo-api/src/main/java/com/evolveum/midpoint/repo/api/RepositoryService.java b/repo/repo-api/src/main/java/com/evolveum/midpoint/repo/api/RepositoryService.java index dac24882d71..f72023e92c4 100644 --- a/repo/repo-api/src/main/java/com/evolveum/midpoint/repo/api/RepositoryService.java +++ b/repo/repo-api/src/main/java/com/evolveum/midpoint/repo/api/RepositoryService.java @@ -138,6 +138,7 @@ public interface RepositoryService { String ADVANCE_SEQUENCE = CLASS_NAME_WITH_DOT + "advanceSequence"; String RETURN_UNUSED_VALUES_TO_SEQUENCE = CLASS_NAME_WITH_DOT + "returnUnusedValuesToSequence"; String EXECUTE_QUERY_DIAGNOSTICS = CLASS_NAME_WITH_DOT + "executeQueryDiagnostics"; + String ADD_DIAGNOSTIC_INFORMATION = CLASS_NAME_WITH_DOT + "addDiagnosticInformation"; String KEY_DIAG_DATA = "repositoryDiagData"; // see GetOperationOptions.attachDiagData @@ -636,4 +637,10 @@ boolean selectorMatches(ObjectSelectorType objectSelector void unregisterConflictWatcher(ConflictWatcher watcher); boolean hasConflict(ConflictWatcher watcher, OperationResult result); + + /** + * Adds a diagnostic information, honoring cleanup rules (deleting obsolete records). + */ + void addDiagnosticInformation(Class type, String oid, DiagnosticInformationType information, OperationResult parentResult) + throws ObjectNotFoundException, SchemaException, ObjectAlreadyExistsException; } diff --git a/repo/repo-cache/src/main/java/com/evolveum/midpoint/repo/cache/RepositoryCache.java b/repo/repo-cache/src/main/java/com/evolveum/midpoint/repo/cache/RepositoryCache.java index 0c1bb3e760a..7aaa50a78eb 100644 --- a/repo/repo-cache/src/main/java/com/evolveum/midpoint/repo/cache/RepositoryCache.java +++ b/repo/repo-cache/src/main/java/com/evolveum/midpoint/repo/cache/RepositoryCache.java @@ -823,4 +823,19 @@ private PrismObject reloadObject( throw ex; } } + + @Override + public void addDiagnosticInformation(Class type, String oid, DiagnosticInformationType information, + OperationResult parentResult) throws ObjectNotFoundException, SchemaException, ObjectAlreadyExistsException { + delay(modifyRandomDelayRange); + Long startTime = repoOpStart(); + try { + repositoryService.addDiagnosticInformation(type, oid, information, parentResult); + } finally { + repoOpEnd(startTime); + // this changes the object. We are too lazy to apply changes ourselves, so just invalidate + // the object in cache + invalidateCacheEntry(type, oid); + } + } } diff --git a/repo/repo-sql-impl/src/main/java/com/evolveum/midpoint/repo/sql/SqlRepositoryServiceImpl.java b/repo/repo-sql-impl/src/main/java/com/evolveum/midpoint/repo/sql/SqlRepositoryServiceImpl.java index 98ba827c5e5..f1414fe6951 100644 --- a/repo/repo-sql-impl/src/main/java/com/evolveum/midpoint/repo/sql/SqlRepositoryServiceImpl.java +++ b/repo/repo-sql-impl/src/main/java/com/evolveum/midpoint/repo/sql/SqlRepositoryServiceImpl.java @@ -35,6 +35,7 @@ import com.evolveum.midpoint.prism.query.ObjectFilter; import com.evolveum.midpoint.prism.query.ObjectPaging; import com.evolveum.midpoint.prism.query.ObjectQuery; +import com.evolveum.midpoint.prism.xml.XmlTypeConverter; import com.evolveum.midpoint.repo.api.*; import com.evolveum.midpoint.repo.api.query.ObjectFilterExpressionEvaluator; import com.evolveum.midpoint.repo.sql.helpers.*; @@ -42,6 +43,7 @@ import com.evolveum.midpoint.repo.sql.query2.matcher.PolyStringMatcher; import com.evolveum.midpoint.repo.sql.query2.matcher.StringMatcher; import com.evolveum.midpoint.schema.*; +import com.evolveum.midpoint.schema.constants.SchemaConstants; import com.evolveum.midpoint.schema.internals.InternalMonitor; import com.evolveum.midpoint.schema.internals.InternalsConfig; import com.evolveum.midpoint.schema.result.OperationResult; @@ -81,6 +83,7 @@ import java.util.*; import java.util.function.Consumer; import java.util.function.Supplier; +import java.util.stream.Collectors; import javax.xml.namespace.QName; @@ -1209,4 +1212,72 @@ public boolean hasConflict(ConflictWatcher watcher, OperationResult result) { } return watcher.hasConflict(); } + + /** + * This is an approximate implementation, not taking care of two clients appending the diag information concurrently. + * So there could be situations when obsolete information is not removed because of this. + */ + @Override + public void addDiagnosticInformation(Class type, String oid, DiagnosticInformationType information, + OperationResult parentResult) throws ObjectNotFoundException, SchemaException, ObjectAlreadyExistsException { + OperationResult result = parentResult.createMinorSubresult(ADD_DIAGNOSTIC_INFORMATION); + try { + PrismObject object = getObject(type, oid, null, result); + boolean canStoreInfo = pruneDiagnosticInformation(type, oid, information, + object.asObjectable().getDiagnosticInformation(), result); + if (canStoreInfo) { + List> modifications = prismContext.deltaFor(type) + .item(ObjectType.F_DIAGNOSTIC_INFORMATION).add(information) + .asItemDeltas(); + modifyObject(type, oid, modifications, result); + } + result.computeStatus(); + } catch (Throwable t) { + result.recordFatalError("Couldn't add diagnostic information: " + t.getMessage(), t); + throw t; + } + } + + // TODO replace by something in system configuration (postponing until this feature is used more) + + private static final Map DIAG_INFO_CLEANUP_POLICY = new HashMap<>(); + static { + DIAG_INFO_CLEANUP_POLICY.put(SchemaConstants.TASK_THREAD_DUMP_URI, 5); + DIAG_INFO_CLEANUP_POLICY.put(null, 2); + } + + // returns true if the new information can be stored + private boolean pruneDiagnosticInformation(Class type, String oid, + DiagnosticInformationType newInformation, List oldInformationList, + OperationResult result) throws ObjectAlreadyExistsException, ObjectNotFoundException, SchemaException { + String infoType = newInformation.getType(); + if (infoType == null) { + throw new IllegalArgumentException("Diagnostic information type is not specified"); + } + Integer limit; + if (DIAG_INFO_CLEANUP_POLICY.containsKey(infoType)) { + limit = DIAG_INFO_CLEANUP_POLICY.get(infoType); + } else { + limit = DIAG_INFO_CLEANUP_POLICY.get(null); + } + LOGGER.trace("Limit for diagnostic information of type '{}': {}", infoType, limit); + if (limit != null) { + List oldToPrune = oldInformationList.stream() + .filter(i -> infoType.equals(i.getType())) + .collect(Collectors.toList()); + int pruneToSize = limit > 0 ? limit-1 : 0; + if (oldToPrune.size() > pruneToSize) { + oldToPrune.sort(Comparator.nullsFirst(Comparator.comparing(i -> XmlTypeConverter.toDate(i.getTimestamp())))); + List toDelete = oldToPrune.subList(0, oldToPrune.size() - pruneToSize); + LOGGER.trace("Going to delete {} diagnostic information values", toDelete.size()); + List> modifications = prismContext.deltaFor(type) + .item(ObjectType.F_DIAGNOSTIC_INFORMATION).deleteRealValues(toDelete) + .asItemDeltas(); + modifyObject(type, oid, modifications, result); + } + return limit > 0; + } else { + return true; + } + } } diff --git a/repo/task-api/src/main/java/com/evolveum/midpoint/task/api/TaskManager.java b/repo/task-api/src/main/java/com/evolveum/midpoint/task/api/TaskManager.java index b00193dcf6f..16e9970fbcb 100644 --- a/repo/task-api/src/main/java/com/evolveum/midpoint/task/api/TaskManager.java +++ b/repo/task-api/src/main/java/com/evolveum/midpoint/task/api/TaskManager.java @@ -716,4 +716,13 @@ ObjectQuery narrowQueryForWorkBucket(ObjectQuery query, Class * This must be synchronized, because interrupt() method uses it. */ - private Set lightweightAsynchronousSubtasks = Collections.synchronizedSet(new HashSet()); + private Set lightweightAsynchronousSubtasks = Collections.synchronizedSet(new HashSet<>()); private Task parentForLightweightAsynchronousTask; // EXPERIMENTAL /* @@ -155,12 +155,17 @@ public class TaskQuartzImpl implements Task { private Future lightweightHandlerFuture; /** - * An indication whether lighweight hander is currently executing or not. + * An indication whether lightweight handler is currently executing or not. * Used for waiting upon its completion (because java.util.concurrent facilities are not able * to show this for cancelled/interrupted tasks). */ private volatile boolean lightweightHandlerExecuting; + /** + * Thread in which this task's lightweight handler is executing. + */ + private volatile Thread lightweightThread; + private static final Trace LOGGER = TraceManager.getTrace(TaskQuartzImpl.class); private static final Trace PERFORMANCE_ADVISOR = TraceManager.getPerformanceAdvisorTrace(); @@ -2794,6 +2799,14 @@ public boolean isLightweightHandlerExecuting() { return lightweightHandlerExecuting; } + public Thread getLightweightThread() { + return lightweightThread; + } + + public void setLightweightThread(Thread lightweightThread) { + this.lightweightThread = lightweightThread; + } + // Operational data private EnvironmentalPerformanceInformation getEnvironmentalPerformanceInformation() { diff --git a/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/execution/ExecutionManager.java b/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/execution/ExecutionManager.java index 0aaa661c4b9..9e7c590ddc7 100644 --- a/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/execution/ExecutionManager.java +++ b/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/execution/ExecutionManager.java @@ -17,13 +17,16 @@ package com.evolveum.midpoint.task.quartzimpl.execution; import com.evolveum.midpoint.prism.PrismObject; +import com.evolveum.midpoint.prism.xml.XmlTypeConverter; import com.evolveum.midpoint.repo.api.PreconditionViolationException; +import com.evolveum.midpoint.schema.constants.SchemaConstants; import com.evolveum.midpoint.schema.result.OperationResult; import com.evolveum.midpoint.schema.result.OperationResultStatus; import com.evolveum.midpoint.task.api.*; import com.evolveum.midpoint.task.quartzimpl.*; import com.evolveum.midpoint.task.quartzimpl.cluster.ClusterStatusInformation; import com.evolveum.midpoint.util.MiscUtil; +import com.evolveum.midpoint.util.exception.ObjectAlreadyExistsException; import com.evolveum.midpoint.util.exception.ObjectNotFoundException; import com.evolveum.midpoint.util.exception.SchemaException; import com.evolveum.midpoint.util.exception.SystemException; @@ -759,5 +762,143 @@ void setLocalExecutionLimitations(Scheduler scheduler, TaskExecutionLimitationsT throw new SystemException("Couldn't set local Quartz scheduler execution capabilities: " + e.getMessage(), e); } } + + public Thread getTaskThread(String oid) { + return localNodeManager.getLocalTaskThread(oid); + } + + public String getRunningTasksThreadsDump(OperationResult parentResult) { + OperationResult result = parentResult.createSubresult(ExecutionManager.DOT_CLASS + "getRunningTasksThreadsDump"); + try { + Set locallyRunningTasks = taskManager.getLocallyRunningTasks(result); + StringBuilder output = new StringBuilder(); + for (Task task : locallyRunningTasks) { + try { + output.append(getTaskThreadsDump(task.getOid(), result)); + } catch (SchemaException | ObjectNotFoundException | RuntimeException e) { + LoggingUtils.logUnexpectedException(LOGGER, "Couldn't get task thread dump for {}", e, task); + output.append("Couldn't get task thread dump for ").append(task).append("\n\n"); + } + } + result.computeStatus(); + return output.toString(); + } catch (Throwable t) { + result.recordFatalError("Couldn't get thread dump for running tasks: " + t.getMessage(), t); + throw t; + } + } + + public String recordRunningTasksThreadsDump(String cause, OperationResult parentResult) throws ObjectAlreadyExistsException { + OperationResult result = parentResult.createSubresult(ExecutionManager.DOT_CLASS + "recordRunningTasksThreadsDump"); + try { + Set locallyRunningTasks = taskManager.getLocallyRunningTasks(result); + StringBuilder output = new StringBuilder(); + for (Task task : locallyRunningTasks) { + try { + output.append(recordTaskThreadsDump(task.getOid(), cause, result)); + } catch (SchemaException | ObjectNotFoundException | RuntimeException e) { + LoggingUtils.logUnexpectedException(LOGGER, "Couldn't get task thread dump for {}", e, task); + output.append("Couldn't get task thread dump for ").append(task).append("\n\n"); + } + } + result.computeStatus(); + return output.toString(); + } catch (Throwable t) { + result.recordFatalError("Couldn't record thread dump for running tasks: " + t.getMessage(), t); + throw t; + } + } + + public String getTaskThreadsDump(String taskOid, OperationResult parentResult) + throws SchemaException, ObjectNotFoundException { + StringBuilder output = new StringBuilder(); + OperationResult result = parentResult.createSubresult(ExecutionManager.DOT_CLASS + "getTaskThreadsDump"); + try { + TaskQuartzImpl task = taskManager.getTask(taskOid, parentResult); + Task localTask = taskManager.getLocallyRunningTaskByIdentifier(task.getTaskIdentifier()); + Thread rootThread = taskManager.getTaskThread(taskOid); + if (localTask == null || rootThread == null) { + result.recordStatus(OperationResultStatus.NOT_APPLICABLE, "Task " + task + " is not running locally"); + return null; + } + output.append("*** Root thread for task ").append(task).append(":\n\n"); + addTaskInfo(output, localTask, rootThread); + for (Task subtask : new HashSet<>(localTask.getLightweightAsynchronousSubtasks())) { + TaskQuartzImpl subtaskImpl = (TaskQuartzImpl) subtask; + Thread thread = subtaskImpl.getLightweightThread(); + output.append("** Information for lightweight asynchronous subtask ").append(subtask).append(":\n\n"); + addTaskInfo(output, subtask, thread); + } + result.recordSuccess(); + } catch (Throwable t) { + result.recordFatalError("Couldn't get task threads dump: " + t.getMessage(), t); + throw t; + } + return output.toString(); + } + + private void addTaskInfo(StringBuilder output, Task localTask, Thread thread) { + output.append("Execution state: ").append(localTask.getExecutionStatus()).append("\n"); + output.append("Progress: ").append(localTask.getProgress()); + if (localTask.getExpectedTotal() != null) { + output.append(" of ").append(localTask.getExpectedTotal()); + } + output.append("\n"); + OperationStatsType stats = localTask.getAggregatedLiveOperationStats(); + IterativeTaskInformationType info = stats != null ? stats.getIterativeTaskInformation() : null; + if (info != null) { + output.append("Total success count: ").append(info.getTotalSuccessCount()).append(", failure count: ").append(info.getTotalFailureCount()).append("\n"); + output.append("Current object: ").append(info.getCurrentObjectOid()).append(" ").append(info.getCurrentObjectName()).append("\n"); + if (info.getLastSuccessObjectOid() != null || info.getLastSuccessObjectName() != null) { + output.append("Last object (success): ").append(info.getLastSuccessObjectOid()) + .append(" (").append(info.getLastSuccessObjectName()).append(") at ") + .append(info.getLastSuccessEndTimestamp()).append("\n"); + } + if (info.getLastFailureObjectOid() != null || info.getLastFailureObjectName() != null) { + output.append("Last object (failure): ").append(info.getLastFailureObjectOid()) + .append(" (").append(info.getLastFailureObjectName()).append(") at ") + .append(info.getLastFailureEndTimestamp()).append("\n"); + } + } + output.append("\n"); + if (thread != null) { + output.append(MiscUtil.takeThreadDump(thread)); + } else { + output.append("(no thread for this task)"); + } + output.append("\n\n"); + } + + public String recordTaskThreadsDump(String taskOid, String cause, OperationResult parentResult) + throws ObjectAlreadyExistsException, ObjectNotFoundException, SchemaException { + StringBuilder output = new StringBuilder(); + + OperationResult result = parentResult.createSubresult(ExecutionManager.DOT_CLASS + "recordTaskThreadDump"); + result.addParam("taskOid", taskOid); + result.addParam("cause", cause); + try { + String dump = getTaskThreadsDump(taskOid, result); + if (dump != null) { + LOGGER.debug("Thread dump for task {}:\n{}", taskOid, dump); + DiagnosticInformationType event = new DiagnosticInformationType() + .timestamp(XmlTypeConverter.createXMLGregorianCalendar(new Date())) + .type(SchemaConstants.TASK_THREAD_DUMP_URI) + .cause(cause) + .nodeIdentifier(taskManager.getNodeId()) + .content(dump); + taskManager.getRepositoryService().addDiagnosticInformation(TaskType.class, taskOid, event, result); + output.append("Thread dump for task ").append(taskOid).append(" was recorded.\n"); + result.computeStatus(); + } else { + output.append("Thread dump for task ").append(taskOid).append(" was NOT recorded as it couldn't be obtained.\n"); + result.recordStatus(OperationResultStatus.NOT_APPLICABLE, "Unable to get threads dump for task " + + taskOid + "; it is probably not running locally."); + } + } catch (Throwable t) { + result.recordFatalError("Couldn't take thread dump: " + t.getMessage(), t); + throw t; + } + return output.toString(); + } } diff --git a/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/execution/JobExecutor.java b/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/execution/JobExecutor.java index 56b07df9f21..1ba335066d1 100644 --- a/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/execution/JobExecutor.java +++ b/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/execution/JobExecutor.java @@ -918,7 +918,6 @@ private void sendThreadInterrupt(boolean alsoSubtasks) { } } - // should be used only for testing public Thread getExecutingThread() { return executingThread; } diff --git a/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/execution/LocalNodeManager.java b/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/execution/LocalNodeManager.java index 76964f71845..07b4cbe0e4e 100644 --- a/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/execution/LocalNodeManager.java +++ b/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/execution/LocalNodeManager.java @@ -31,6 +31,8 @@ import com.evolveum.midpoint.xml.ns._public.common.common_3.NodeExecutionStatusType; import com.evolveum.midpoint.xml.ns._public.common.common_3.NodeType; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; import org.quartz.*; import org.quartz.impl.StdSchedulerFactory; import org.quartz.listeners.SchedulerListenerSupport; @@ -460,6 +462,23 @@ Set getLocallyRunningTasksOids(OperationResult parentResult) { } } + @Nullable + Thread getLocalTaskThread(@NotNull String oid) { + try { + for (JobExecutionContext jec : getQuartzScheduler().getCurrentlyExecutingJobs()) { + if (oid.equals(jec.getJobDetail().getKey().getName())) { + Job job = jec.getJobInstance(); + if (job instanceof JobExecutor) { + return ((JobExecutor) job).getExecutingThread(); + } + } + } + } catch (SchedulerException e) { + LoggingUtils.logUnexpectedException(LOGGER, "Cannot get the list of currently executing jobs", e); + } + return null; + } + /** * Returns all the currently executing tasks. * diff --git a/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/execution/StalledTasksWatcher.java b/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/execution/StalledTasksWatcher.java index b1e02d8965c..65a0c8c4e7e 100644 --- a/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/execution/StalledTasksWatcher.java +++ b/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/execution/StalledTasksWatcher.java @@ -16,10 +16,12 @@ package com.evolveum.midpoint.task.quartzimpl.execution; +import com.evolveum.midpoint.schema.constants.SchemaConstants; import com.evolveum.midpoint.schema.result.OperationResult; import com.evolveum.midpoint.task.quartzimpl.TaskManagerQuartzImpl; import com.evolveum.midpoint.task.quartzimpl.TaskQuartzImpl; import com.evolveum.midpoint.task.quartzimpl.TaskQuartzImplUtil; +import com.evolveum.midpoint.util.exception.ObjectAlreadyExistsException; import com.evolveum.midpoint.util.exception.ObjectNotFoundException; import com.evolveum.midpoint.util.exception.SchemaException; import com.evolveum.midpoint.util.logging.LoggingUtils; @@ -30,7 +32,6 @@ import java.util.Date; import java.util.HashMap; -import java.util.Iterator; import java.util.Map; /** @@ -118,18 +119,18 @@ public void checkStalledTasks(OperationResult parentResult) { lastProgressEntry.lastNotificationIssuedTimestamp != 0 ? " [this is a repeated notification]" : ""); lastProgressEntry.lastNotificationIssuedTimestamp = currentTimestamp; + try { + taskManager.recordTaskThreadsDump(task.getOid(), SchemaConstants.INTERNAL_URI, result); + } catch (SchemaException|ObjectNotFoundException|ObjectAlreadyExistsException|RuntimeException e) { + LoggingUtils.logUnexpectedException(LOGGER, "Couldn't record thread dump for stalled task {}", e, task); + } } } } } // clean-up obsolete progress entries - Iterator iterator = lastProgressMap.keySet().iterator(); - while (iterator.hasNext()) { - if (!runningTasks.containsKey(iterator.next())) { - iterator.remove(); - } - } + lastProgressMap.keySet().removeIf(s -> !runningTasks.containsKey(s)); LOGGER.trace("checkStalledTasks lastProgress map after cleaning up = {}", lastProgressMap); } diff --git a/samples/tasks/bulk-actions/script-delay-for-testing-thread-dumps.xml b/samples/tasks/bulk-actions/script-delay-for-testing-thread-dumps.xml new file mode 100644 index 00000000000..a6fd54ecf9b --- /dev/null +++ b/samples/tasks/bulk-actions/script-delay-for-testing-thread-dumps.xml @@ -0,0 +1,63 @@ + + + + + + + Lazy task (multi workers) + + + + execute-script + + script + + + log.info('Hello {} (wait starting)', input) + try { + Thread.sleep(10000) + } catch (InterruptedException e) { + log.error('Got InterruptedException, stopping waiting', e) + } + log.info('Hello {} (wait done)', input) + + + + + + ObjectType + 3 + + + runnable + BulkActions + http://midpoint.evolveum.com/xml/ns/public/model/iterative-scripting/handler-3 + single + From 48de7fe291b43ab76b77ddabfcecf34d34f3237c Mon Sep 17 00:00:00 2001 From: kate Date: Tue, 12 Feb 2019 00:59:48 +0100 Subject: [PATCH 022/224] set archetype ref in system configuration test --- .../resources/localization/schema.properties | 2 + .../scenarios/ObjectListArchetypeTests.java | 59 ++++++++++++++++++- .../component/common/DropDown.java | 14 +++++ .../component/common/PrismForm.java | 40 +++++++++++++ .../component/configuration/AdminGuiTab.java | 7 +++ .../ObjectCollectionViewsPanel.java | 7 +++ .../{common => modal}/ConfirmationModal.java | 3 +- .../{ => modal}/FocusSetAssignmentsModal.java | 4 +- .../{ => modal}/FocusSetProjectionModal.java | 4 +- .../component/{common => modal}/ModalBox.java | 2 +- .../component/modal/ObjectBrowserModal.java | 34 +++++++++++ .../modal/ObjectBrowserModalTable.java | 28 +++++++++ .../resource/ResourceShadowTableCog.java | 2 +- .../resource/TestConnectionModal.java | 2 +- .../component/user/UserAssignmentsTab.java | 2 +- .../component/user/UserProjectionsCog.java | 4 +- .../component/user/UsersPageTable.java | 2 +- .../component/user/UsersTableDropDown.java | 2 +- .../page/configuration/AboutPage.java | 3 +- 19 files changed, 205 insertions(+), 16 deletions(-) create mode 100644 tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/configuration/ObjectCollectionViewsPanel.java rename tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/{common => modal}/ConfirmationModal.java (92%) rename tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/{ => modal}/FocusSetAssignmentsModal.java (93%) rename tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/{ => modal}/FocusSetProjectionModal.java (87%) rename tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/{common => modal}/ModalBox.java (86%) create mode 100644 tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/modal/ObjectBrowserModal.java create mode 100644 tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/modal/ObjectBrowserModalTable.java diff --git a/infra/schema/src/main/resources/localization/schema.properties b/infra/schema/src/main/resources/localization/schema.properties index a5932b4673c..d0b74777d13 100755 --- a/infra/schema/src/main/resources/localization/schema.properties +++ b/infra/schema/src/main/resources/localization/schema.properties @@ -754,6 +754,8 @@ ObjectTypes.FORM=Form ObjectTypes.CASE=Case ObjectTypes.FUNCTION_LIBRARY=Function library ObjectTypes.OBJECT_COLLECTION=Object collection +ObjectTypes.ARCHETYPE=Archetype +ObjectTypes.ASSIGNMENT_HOLDER_TYPE=Assignment holder type OrgType.parentOrganization=Parent Organization ObjectType.extension=Extension FocusType.assignmentKey=Assignment diff --git a/testing/schrodingertest/src/test/java/com/evolveum/midpoint/testing/schrodinger/scenarios/ObjectListArchetypeTests.java b/testing/schrodingertest/src/test/java/com/evolveum/midpoint/testing/schrodinger/scenarios/ObjectListArchetypeTests.java index b7f813cd9cd..a61bf0722b3 100644 --- a/testing/schrodingertest/src/test/java/com/evolveum/midpoint/testing/schrodinger/scenarios/ObjectListArchetypeTests.java +++ b/testing/schrodingertest/src/test/java/com/evolveum/midpoint/testing/schrodinger/scenarios/ObjectListArchetypeTests.java @@ -1,7 +1,15 @@ package com.evolveum.midpoint.testing.schrodinger.scenarios; +import com.codeborne.selenide.Condition; +import com.codeborne.selenide.SelenideElement; +import com.evolveum.midpoint.schrodinger.MidPoint; +import com.evolveum.midpoint.schrodinger.component.common.PrismForm; +import com.evolveum.midpoint.schrodinger.component.configuration.AdminGuiTab; +import com.evolveum.midpoint.schrodinger.component.modal.ObjectBrowserModal; import com.evolveum.midpoint.schrodinger.page.configuration.ImportObjectPage; +import com.evolveum.midpoint.schrodinger.util.Schrodinger; import com.evolveum.midpoint.testing.schrodinger.TestBase; +import org.openqa.selenium.By; import org.testng.Assert; import org.testng.annotations.Test; @@ -9,14 +17,22 @@ import java.io.File; import java.io.IOException; +import static com.codeborne.selenide.Selenide.$; + /** * Created by honchar */ public class ObjectListArchetypeTests extends TestBase { private static final File EMPLOYEE_ARCHETYPE_FILE = new File("src/test/resources/configuration/objects/archetypes/archetype-employee.xml"); + private static final String ARCHETYPE_OBJECT_NAME = "Employee"; + private static final String COLLECTION_REF_ATTRIBUTE_NAME = "Collection ref"; + private static final String OBJECT_COLLECTION_VIEWS_HEADER = "Object collection views"; + private static final String OBJECT_COLLECTION_VIEW_HEADER = "Object collection view"; + private static final String NEW_GUI_OBJECT_LIST_VIEW_HEADER = "New gui object list view"; + private static final String COLLECTION_HEADER = "Collection"; - @Test + @Test(priority = 0) public void importEmployeeArchetype() throws IOException, ConfigurationException { ImportObjectPage importPage = basicPage.importObject(); @@ -30,4 +46,45 @@ public void importEmployeeArchetype() throws IOException, ConfigurationException .isSuccess() ); } + + @Test(priority = 1, dependsOnMethods ={"importEmployeeArchetype"}) + public void configureArchetypeObjectListView(){ + AdminGuiTab adminGuiTab = basicPage.adminGui(); + PrismForm prismForm = adminGuiTab.form(); + SelenideElement collectionContainerProperties = prismForm + .expandContainerPropertiesPanel(OBJECT_COLLECTION_VIEWS_HEADER) + .addNewContainerValue(OBJECT_COLLECTION_VIEW_HEADER, NEW_GUI_OBJECT_LIST_VIEW_HEADER) + .expandContainerPropertiesPanel(NEW_GUI_OBJECT_LIST_VIEW_HEADER) + .expandContainerPropertiesPanel(COLLECTION_HEADER) + .getPrismPropertiesPanel(COLLECTION_HEADER); + + collectionContainerProperties + .$(Schrodinger.byDataId("edit")) + .click(); + + SelenideElement modalWindow = $(By.className("wicket-modal")) + .waitUntil(Condition.appear, MidPoint.TIMEOUT_DEFAULT_2_S); + + ObjectBrowserModal objectBrowserModal = new ObjectBrowserModal<>(prismForm, modalWindow); + objectBrowserModal + .selectType("ARCHETYPE") + .table() + .search() + .byName() + .inputValue(ARCHETYPE_OBJECT_NAME) + .updateSearch(); + objectBrowserModal + .table() + .clickByName(ARCHETYPE_OBJECT_NAME); + + Assert.assertTrue(prismForm + .compareInputAttributeValue(COLLECTION_REF_ATTRIBUTE_NAME, ARCHETYPE_OBJECT_NAME + ": ArchetypeType")); + + adminGuiTab + .getParent() + .save() + .feedback() + .isSuccess(); + } } + diff --git a/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/common/DropDown.java b/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/common/DropDown.java index 0e9e6269071..aaa7b75a642 100644 --- a/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/common/DropDown.java +++ b/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/common/DropDown.java @@ -1,7 +1,10 @@ package com.evolveum.midpoint.schrodinger.component.common; +import com.codeborne.selenide.Condition; import com.codeborne.selenide.SelenideElement; +import com.evolveum.midpoint.schrodinger.MidPoint; import com.evolveum.midpoint.schrodinger.component.Component; +import com.evolveum.midpoint.schrodinger.util.Schrodinger; /** * Created by matus on 5/2/2018. @@ -10,4 +13,15 @@ public class DropDown extends Component { public DropDown(T parent, SelenideElement parentElement) { super(parent, parentElement); } + + public DropDown selectOption(String option){ + getParentElement() + .$(Schrodinger.byElementAttributeValue("option", "value", option)) + .click(); + + getParentElement() + .$(Schrodinger.byElementAttributeValue("option", "value", option)) + .waitUntil(Condition.selected, MidPoint.TIMEOUT_DEFAULT_2_S); + return this; + } } diff --git a/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/common/PrismForm.java b/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/common/PrismForm.java index d212e101162..c71b2ac055f 100644 --- a/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/common/PrismForm.java +++ b/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/common/PrismForm.java @@ -22,6 +22,7 @@ import com.codeborne.selenide.SelenideElement; import com.evolveum.midpoint.schrodinger.MidPoint; import com.evolveum.midpoint.schrodinger.component.Component; +import com.evolveum.midpoint.schrodinger.component.configuration.ObjectCollectionViewsPanel; import com.evolveum.midpoint.schrodinger.util.Schrodinger; import org.openqa.selenium.By; @@ -254,4 +255,43 @@ public PrismForm selectOption(String attributeName, String option) { return this; } + public PrismForm expandContainerPropertiesPanel(String containerHeaderKey){ + SelenideElement panelHeader = $(Schrodinger.byDataResourceKey("div", containerHeaderKey)); + + SelenideElement headerChevron = panelHeader.$(By.tagName("i")); + if (!headerChevron.has(Condition.cssClass("fa fa-caret-down fa-lg"))) { + headerChevron.click(); + //TODO fix this check +// panelHeader +// .shouldHave(Condition.cssClass("fa fa-caret-down fa-lg")); +// .waitUntil(Condition.cssClass("fa fa-caret-down fa-lg"), MidPoint.TIMEOUT_DEFAULT_2_S); + } + panelHeader + .parent() + .$(By.className("prism-properties")) + .shouldBe(Condition.visible); + return this; + } + + public PrismForm addNewContainerValue(String containerHeaderKey, String newContainerHeaderKey){ + SelenideElement panelHeader = $(Schrodinger.byDataResourceKey("div", containerHeaderKey)); + panelHeader.$(Schrodinger.byDataId("addButton")).click(); + + SelenideElement newPanelHeader = $(Schrodinger.byDataResourceKey("div", newContainerHeaderKey)); + newPanelHeader.shouldHave(Condition.cssClass("container-fluid success")).waitUntil(Condition.cssClass("container-fluid success"), MidPoint.TIMEOUT_DEFAULT_2_S); + + return this; + } + + public SelenideElement getPrismPropertiesPanel(String containerHeaderKey){ + expandContainerPropertiesPanel(containerHeaderKey); + + SelenideElement containerHeaderPanel = $(Schrodinger.byDataResourceKey("div", containerHeaderKey)); + return containerHeaderPanel + .parent() + .$(By.className("prism-properties")) + .shouldBe(Condition.visible) + .waitUntil(Condition.visible, MidPoint.TIMEOUT_DEFAULT_2_S); + + } } diff --git a/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/configuration/AdminGuiTab.java b/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/configuration/AdminGuiTab.java index 8cbe2865054..3af14c9b5c7 100644 --- a/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/configuration/AdminGuiTab.java +++ b/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/configuration/AdminGuiTab.java @@ -2,6 +2,7 @@ import com.codeborne.selenide.SelenideElement; import com.evolveum.midpoint.schrodinger.component.Component; +import com.evolveum.midpoint.schrodinger.component.common.PrismForm; import com.evolveum.midpoint.schrodinger.page.configuration.SystemPage; /** @@ -12,4 +13,10 @@ public class AdminGuiTab extends Component { public AdminGuiTab(SystemPage parent, SelenideElement parentElement) { super(parent, parentElement); } + + public PrismForm form() { + + SelenideElement element = null; + return new PrismForm<>(this, element); + } } \ No newline at end of file diff --git a/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/configuration/ObjectCollectionViewsPanel.java b/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/configuration/ObjectCollectionViewsPanel.java new file mode 100644 index 00000000000..3cb007d8aa4 --- /dev/null +++ b/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/configuration/ObjectCollectionViewsPanel.java @@ -0,0 +1,7 @@ +package com.evolveum.midpoint.schrodinger.component.configuration; + +/** + * Created by kate on 11.2.2019. + */ +public class ObjectCollectionViewsPanel { +} diff --git a/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/common/ConfirmationModal.java b/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/modal/ConfirmationModal.java similarity index 92% rename from tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/common/ConfirmationModal.java rename to tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/modal/ConfirmationModal.java index 15633fdbb4b..6dd8e9820d8 100644 --- a/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/common/ConfirmationModal.java +++ b/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/modal/ConfirmationModal.java @@ -1,8 +1,9 @@ -package com.evolveum.midpoint.schrodinger.component.common; +package com.evolveum.midpoint.schrodinger.component.modal; import com.codeborne.selenide.Condition; import com.codeborne.selenide.SelenideElement; import com.evolveum.midpoint.schrodinger.MidPoint; +import com.evolveum.midpoint.schrodinger.component.modal.ModalBox; import com.evolveum.midpoint.schrodinger.util.Schrodinger; import org.openqa.selenium.By; diff --git a/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/FocusSetAssignmentsModal.java b/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/modal/FocusSetAssignmentsModal.java similarity index 93% rename from tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/FocusSetAssignmentsModal.java rename to tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/modal/FocusSetAssignmentsModal.java index fc69e23a58e..57c03482c51 100644 --- a/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/FocusSetAssignmentsModal.java +++ b/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/modal/FocusSetAssignmentsModal.java @@ -1,9 +1,9 @@ -package com.evolveum.midpoint.schrodinger.component; +package com.evolveum.midpoint.schrodinger.component.modal; import com.codeborne.selenide.Condition; import com.codeborne.selenide.SelenideElement; import com.evolveum.midpoint.schrodinger.MidPoint; -import com.evolveum.midpoint.schrodinger.component.common.ModalBox; +import com.evolveum.midpoint.schrodinger.component.FocusTableWithChoosableElements; import com.evolveum.midpoint.schrodinger.util.Schrodinger; import org.openqa.selenium.By; diff --git a/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/FocusSetProjectionModal.java b/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/modal/FocusSetProjectionModal.java similarity index 87% rename from tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/FocusSetProjectionModal.java rename to tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/modal/FocusSetProjectionModal.java index c3e367dab3d..e02a7ad4a65 100644 --- a/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/FocusSetProjectionModal.java +++ b/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/modal/FocusSetProjectionModal.java @@ -1,9 +1,9 @@ -package com.evolveum.midpoint.schrodinger.component; +package com.evolveum.midpoint.schrodinger.component.modal; import com.codeborne.selenide.Condition; import com.codeborne.selenide.SelenideElement; import com.evolveum.midpoint.schrodinger.MidPoint; -import com.evolveum.midpoint.schrodinger.component.common.ModalBox; +import com.evolveum.midpoint.schrodinger.component.FocusTableWithChoosableElements; import com.evolveum.midpoint.schrodinger.util.Schrodinger; import org.openqa.selenium.By; diff --git a/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/common/ModalBox.java b/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/modal/ModalBox.java similarity index 86% rename from tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/common/ModalBox.java rename to tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/modal/ModalBox.java index a2f72416bdb..3aae8754f5a 100644 --- a/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/common/ModalBox.java +++ b/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/modal/ModalBox.java @@ -1,4 +1,4 @@ -package com.evolveum.midpoint.schrodinger.component.common; +package com.evolveum.midpoint.schrodinger.component.modal; import com.codeborne.selenide.SelenideElement; import com.evolveum.midpoint.schrodinger.component.Component; diff --git a/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/modal/ObjectBrowserModal.java b/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/modal/ObjectBrowserModal.java new file mode 100644 index 00000000000..acb9484c40b --- /dev/null +++ b/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/modal/ObjectBrowserModal.java @@ -0,0 +1,34 @@ +package com.evolveum.midpoint.schrodinger.component.modal; + +import com.codeborne.selenide.Condition; +import com.codeborne.selenide.SelenideElement; +import com.evolveum.midpoint.schrodinger.MidPoint; +import com.evolveum.midpoint.schrodinger.component.common.DropDown; +import com.evolveum.midpoint.schrodinger.util.Schrodinger; +import org.openqa.selenium.By; + +import static com.codeborne.selenide.Selenide.$; + +/** + * Created by honchar. + */ +public class ObjectBrowserModal extends ModalBox { + public ObjectBrowserModal(T parent, SelenideElement parentElement) { + super(parent, parentElement); + } + + public ObjectBrowserModal selectType(String type) { + DropDown typeDropDown = + (DropDown) $(Schrodinger.byElementAttributeValue("select", "data-s-id", "type")); + typeDropDown.selectOption(type); + return this; + } + + public ObjectBrowserModalTable table(){ + SelenideElement box = $(By.className("box boxed-table")) + .waitUntil(Condition.appear, MidPoint.TIMEOUT_DEFAULT_2_S); + + return new ObjectBrowserModalTable(this, box); + } + +} diff --git a/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/modal/ObjectBrowserModalTable.java b/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/modal/ObjectBrowserModalTable.java new file mode 100644 index 00000000000..47acda13c52 --- /dev/null +++ b/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/modal/ObjectBrowserModalTable.java @@ -0,0 +1,28 @@ +package com.evolveum.midpoint.schrodinger.component.modal; + +import com.codeborne.selenide.Condition; +import com.codeborne.selenide.SelenideElement; +import com.evolveum.midpoint.schrodinger.MidPoint; +import com.evolveum.midpoint.schrodinger.component.common.table.Table; +import com.evolveum.midpoint.schrodinger.util.Schrodinger; + +/** + * Created by honchar + */ +public class ObjectBrowserModalTable extends Table>{ + + public ObjectBrowserModalTable(ObjectBrowserModal parent, SelenideElement parentElement){ + super(parent, parentElement); + } + + public T clickByName(String name){ + getParentElement().$(Schrodinger.byElementValue("span", "data-s-id", "label", name)) + .waitUntil(Condition.appears, MidPoint.TIMEOUT_DEFAULT_2_S).click(); + + getParent() + .getParentElement() + .waitUntil(Condition.disappears, MidPoint.TIMEOUT_DEFAULT_2_S); + + return getParent().getParent(); + } +} diff --git a/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/resource/ResourceShadowTableCog.java b/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/resource/ResourceShadowTableCog.java index 60d4a02a349..1a89784b1b2 100644 --- a/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/resource/ResourceShadowTableCog.java +++ b/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/resource/ResourceShadowTableCog.java @@ -3,7 +3,7 @@ import com.codeborne.selenide.Condition; import com.codeborne.selenide.SelenideElement; import com.evolveum.midpoint.schrodinger.MidPoint; -import com.evolveum.midpoint.schrodinger.component.common.ConfirmationModal; +import com.evolveum.midpoint.schrodinger.component.modal.ConfirmationModal; import com.evolveum.midpoint.schrodinger.component.common.DropDown; import com.evolveum.midpoint.schrodinger.util.Schrodinger; diff --git a/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/resource/TestConnectionModal.java b/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/resource/TestConnectionModal.java index dcb79d1bd61..449c6edc76a 100644 --- a/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/resource/TestConnectionModal.java +++ b/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/resource/TestConnectionModal.java @@ -5,7 +5,7 @@ import com.codeborne.selenide.SelenideElement; import com.evolveum.midpoint.schrodinger.MidPoint; import com.evolveum.midpoint.schrodinger.component.common.FeedbackBox; -import com.evolveum.midpoint.schrodinger.component.common.ModalBox; +import com.evolveum.midpoint.schrodinger.component.modal.ModalBox; import com.evolveum.midpoint.schrodinger.util.Schrodinger; import static com.codeborne.selenide.Selenide.$; diff --git a/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/user/UserAssignmentsTab.java b/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/user/UserAssignmentsTab.java index 9f642e484f7..e0ceea01f78 100644 --- a/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/user/UserAssignmentsTab.java +++ b/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/user/UserAssignmentsTab.java @@ -20,7 +20,7 @@ import com.codeborne.selenide.SelenideElement; import com.evolveum.midpoint.schrodinger.MidPoint; import com.evolveum.midpoint.schrodinger.component.Component; -import com.evolveum.midpoint.schrodinger.component.FocusSetAssignmentsModal; +import com.evolveum.midpoint.schrodinger.component.modal.FocusSetAssignmentsModal; import com.evolveum.midpoint.schrodinger.component.common.PrismFormWithActionButtons; import com.evolveum.midpoint.schrodinger.component.common.table.AbstractTableWithPrismView; import com.evolveum.midpoint.schrodinger.page.user.UserPage; diff --git a/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/user/UserProjectionsCog.java b/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/user/UserProjectionsCog.java index 18e52263e5b..f8011196633 100644 --- a/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/user/UserProjectionsCog.java +++ b/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/user/UserProjectionsCog.java @@ -3,9 +3,9 @@ import com.codeborne.selenide.Condition; import com.codeborne.selenide.SelenideElement; import com.evolveum.midpoint.schrodinger.MidPoint; -import com.evolveum.midpoint.schrodinger.component.FocusSetProjectionModal; +import com.evolveum.midpoint.schrodinger.component.modal.FocusSetProjectionModal; import com.evolveum.midpoint.schrodinger.component.common.DropDown; -import com.evolveum.midpoint.schrodinger.component.common.ConfirmationModal; +import com.evolveum.midpoint.schrodinger.component.modal.ConfirmationModal; import com.evolveum.midpoint.schrodinger.util.Schrodinger; import static com.codeborne.selenide.Selenide.$; diff --git a/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/user/UsersPageTable.java b/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/user/UsersPageTable.java index 4ff96e95bc2..539cef6159c 100644 --- a/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/user/UsersPageTable.java +++ b/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/user/UsersPageTable.java @@ -19,7 +19,7 @@ import com.codeborne.selenide.Condition; import com.codeborne.selenide.SelenideElement; import com.evolveum.midpoint.schrodinger.MidPoint; -import com.evolveum.midpoint.schrodinger.component.common.ConfirmationModal; +import com.evolveum.midpoint.schrodinger.component.modal.ConfirmationModal; import com.evolveum.midpoint.schrodinger.component.common.Search; import com.evolveum.midpoint.schrodinger.component.common.table.TableWithPageRedirect; import com.evolveum.midpoint.schrodinger.page.user.UserPage; diff --git a/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/user/UsersTableDropDown.java b/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/user/UsersTableDropDown.java index 2e4d2acd2d7..8b24855d8b3 100644 --- a/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/user/UsersTableDropDown.java +++ b/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/user/UsersTableDropDown.java @@ -3,7 +3,7 @@ import com.codeborne.selenide.Condition; import com.codeborne.selenide.SelenideElement; import com.evolveum.midpoint.schrodinger.MidPoint; -import com.evolveum.midpoint.schrodinger.component.common.ConfirmationModal; +import com.evolveum.midpoint.schrodinger.component.modal.ConfirmationModal; import com.evolveum.midpoint.schrodinger.component.common.DropDown; import com.evolveum.midpoint.schrodinger.util.Schrodinger; diff --git a/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/page/configuration/AboutPage.java b/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/page/configuration/AboutPage.java index 242e7473b7a..0e8c98f5199 100644 --- a/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/page/configuration/AboutPage.java +++ b/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/page/configuration/AboutPage.java @@ -3,8 +3,7 @@ import com.codeborne.selenide.Condition; import com.codeborne.selenide.SelenideElement; import com.evolveum.midpoint.schrodinger.MidPoint; -import com.evolveum.midpoint.schrodinger.component.common.ConfirmationModal; -import com.evolveum.midpoint.schrodinger.component.common.FeedbackBox; +import com.evolveum.midpoint.schrodinger.component.modal.ConfirmationModal; import com.evolveum.midpoint.schrodinger.component.common.table.ReadOnlyTable; import com.evolveum.midpoint.schrodinger.page.BasicPage; import com.evolveum.midpoint.schrodinger.page.LoginPage; From 55b473d0d3aa18dcd45eba2c4a825b736534b77a Mon Sep 17 00:00:00 2001 From: kate Date: Tue, 12 Feb 2019 10:27:23 +0100 Subject: [PATCH 023/224] fix for archetype object list test --- .../scenarios/ObjectListArchetypeTests.java | 16 ++++++++------ .../component/common/PrismForm.java | 22 +++++++++++-------- .../component/modal/ObjectBrowserModal.java | 6 ++--- .../page/configuration/SystemPage.java | 5 ++++- 4 files changed, 29 insertions(+), 20 deletions(-) diff --git a/testing/schrodingertest/src/test/java/com/evolveum/midpoint/testing/schrodinger/scenarios/ObjectListArchetypeTests.java b/testing/schrodingertest/src/test/java/com/evolveum/midpoint/testing/schrodinger/scenarios/ObjectListArchetypeTests.java index a61bf0722b3..b9cd213b529 100644 --- a/testing/schrodingertest/src/test/java/com/evolveum/midpoint/testing/schrodinger/scenarios/ObjectListArchetypeTests.java +++ b/testing/schrodingertest/src/test/java/com/evolveum/midpoint/testing/schrodinger/scenarios/ObjectListArchetypeTests.java @@ -3,6 +3,7 @@ import com.codeborne.selenide.Condition; import com.codeborne.selenide.SelenideElement; import com.evolveum.midpoint.schrodinger.MidPoint; +import com.evolveum.midpoint.schrodinger.component.common.FeedbackBox; import com.evolveum.midpoint.schrodinger.component.common.PrismForm; import com.evolveum.midpoint.schrodinger.component.configuration.AdminGuiTab; import com.evolveum.midpoint.schrodinger.component.modal.ObjectBrowserModal; @@ -30,6 +31,7 @@ public class ObjectListArchetypeTests extends TestBase { private static final String OBJECT_COLLECTION_VIEWS_HEADER = "Object collection views"; private static final String OBJECT_COLLECTION_VIEW_HEADER = "Object collection view"; private static final String NEW_GUI_OBJECT_LIST_VIEW_HEADER = "New gui object list view"; + private static final String NEW_OBJECT_LIST_VIEW_CONTAINER_KEY = "GuiObjectListViewType.details"; private static final String COLLECTION_HEADER = "Collection"; @Test(priority = 0) @@ -51,14 +53,14 @@ public void importEmployeeArchetype() throws IOException, ConfigurationException public void configureArchetypeObjectListView(){ AdminGuiTab adminGuiTab = basicPage.adminGui(); PrismForm prismForm = adminGuiTab.form(); - SelenideElement collectionContainerProperties = prismForm + prismForm .expandContainerPropertiesPanel(OBJECT_COLLECTION_VIEWS_HEADER) - .addNewContainerValue(OBJECT_COLLECTION_VIEW_HEADER, NEW_GUI_OBJECT_LIST_VIEW_HEADER) - .expandContainerPropertiesPanel(NEW_GUI_OBJECT_LIST_VIEW_HEADER) - .expandContainerPropertiesPanel(COLLECTION_HEADER) - .getPrismPropertiesPanel(COLLECTION_HEADER); + .addNewContainerValue(OBJECT_COLLECTION_VIEW_HEADER, NEW_OBJECT_LIST_VIEW_CONTAINER_KEY) + .expandContainerPropertiesPanel(NEW_OBJECT_LIST_VIEW_CONTAINER_KEY) + .expandContainerPropertiesPanel(COLLECTION_HEADER); - collectionContainerProperties + SelenideElement collectionRefPropertyPanel = prismForm.findProperty(COLLECTION_REF_ATTRIBUTE_NAME); + collectionRefPropertyPanel .$(Schrodinger.byDataId("edit")) .click(); @@ -67,7 +69,7 @@ public void configureArchetypeObjectListView(){ ObjectBrowserModal objectBrowserModal = new ObjectBrowserModal<>(prismForm, modalWindow); objectBrowserModal - .selectType("ARCHETYPE") + .selectType("Archetype") .table() .search() .byName() diff --git a/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/common/PrismForm.java b/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/common/PrismForm.java index c71b2ac055f..a9af8561ef6 100644 --- a/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/common/PrismForm.java +++ b/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/common/PrismForm.java @@ -37,6 +37,8 @@ */ public class PrismForm extends Component { + private static final String CARET_DOWN_ICON_STYLE = "fa-caret-down"; + public PrismForm(T parent, SelenideElement parentElement) { super(parent, parentElement); } @@ -219,7 +221,7 @@ private SelenideElement findProperValueContainer() { return null; } - private SelenideElement findProperty(String name) { + public SelenideElement findProperty(String name) { Selenide.sleep(5000); @@ -256,15 +258,14 @@ public PrismForm selectOption(String attributeName, String option) { } public PrismForm expandContainerPropertiesPanel(String containerHeaderKey){ - SelenideElement panelHeader = $(Schrodinger.byDataResourceKey("div", containerHeaderKey)); + SelenideElement panelHeader = $(Schrodinger.byElementAttributeValue("div", "data-s-resource-key", containerHeaderKey)); SelenideElement headerChevron = panelHeader.$(By.tagName("i")); - if (!headerChevron.has(Condition.cssClass("fa fa-caret-down fa-lg"))) { + if (headerChevron.getAttribute("class") != null && !headerChevron.getAttribute("class").contains(CARET_DOWN_ICON_STYLE)) { headerChevron.click(); - //TODO fix this check -// panelHeader -// .shouldHave(Condition.cssClass("fa fa-caret-down fa-lg")); -// .waitUntil(Condition.cssClass("fa fa-caret-down fa-lg"), MidPoint.TIMEOUT_DEFAULT_2_S); + panelHeader + .$(Schrodinger.byElementAttributeValue("i", "class","fa fa-caret-down fa-lg")) + .waitUntil(Condition.visible, MidPoint.TIMEOUT_DEFAULT_2_S); } panelHeader .parent() @@ -277,8 +278,11 @@ public PrismForm addNewContainerValue(String containerHeaderKey, String newCo SelenideElement panelHeader = $(Schrodinger.byDataResourceKey("div", containerHeaderKey)); panelHeader.$(Schrodinger.byDataId("addButton")).click(); - SelenideElement newPanelHeader = $(Schrodinger.byDataResourceKey("div", newContainerHeaderKey)); - newPanelHeader.shouldHave(Condition.cssClass("container-fluid success")).waitUntil(Condition.cssClass("container-fluid success"), MidPoint.TIMEOUT_DEFAULT_2_S); + panelHeader + .parent() + .$(Schrodinger.byDataResourceKey(newContainerHeaderKey)) + .shouldBe(Condition.visible) + .waitUntil(Condition.visible, MidPoint.TIMEOUT_DEFAULT_2_S); return this; } diff --git a/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/modal/ObjectBrowserModal.java b/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/modal/ObjectBrowserModal.java index acb9484c40b..4b780726e4d 100644 --- a/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/modal/ObjectBrowserModal.java +++ b/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/modal/ObjectBrowserModal.java @@ -18,14 +18,14 @@ public ObjectBrowserModal(T parent, SelenideElement parentElement) { } public ObjectBrowserModal selectType(String type) { - DropDown typeDropDown = - (DropDown) $(Schrodinger.byElementAttributeValue("select", "data-s-id", "type")); + SelenideElement typeDropDown = + $(Schrodinger.byElementAttributeValue("select", "data-s-id", "type")); typeDropDown.selectOption(type); return this; } public ObjectBrowserModalTable table(){ - SelenideElement box = $(By.className("box boxed-table")) + SelenideElement box = $(Schrodinger.byElementAttributeValue("div", "class","box boxed-table")) .waitUntil(Condition.appear, MidPoint.TIMEOUT_DEFAULT_2_S); return new ObjectBrowserModalTable(this, box); diff --git a/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/page/configuration/SystemPage.java b/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/page/configuration/SystemPage.java index 232d6a36e83..9af79581171 100644 --- a/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/page/configuration/SystemPage.java +++ b/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/page/configuration/SystemPage.java @@ -3,6 +3,9 @@ import com.codeborne.selenide.SelenideElement; import com.evolveum.midpoint.schrodinger.component.configuration.*; import com.evolveum.midpoint.schrodinger.page.BasicPage; +import com.evolveum.midpoint.schrodinger.util.Schrodinger; + +import static com.codeborne.selenide.Selenide.$; /** * Created by Viliam Repan (lazyman). @@ -15,7 +18,7 @@ public SystemPage cancel() { } public SystemPage save() { - //todo implement + $(Schrodinger.byDataId("save")).click(); return this; } From 5803d93ff66639bd0ccf30889143a79458a005ce Mon Sep 17 00:00:00 2001 From: kate Date: Tue, 12 Feb 2019 10:28:41 +0100 Subject: [PATCH 024/224] archetype tests are added to suite --- testing/schrodingertest/testng-integration-schrodinger.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/testing/schrodingertest/testng-integration-schrodinger.xml b/testing/schrodingertest/testng-integration-schrodinger.xml index 76d7301656a..e180528b6cb 100644 --- a/testing/schrodingertest/testng-integration-schrodinger.xml +++ b/testing/schrodingertest/testng-integration-schrodinger.xml @@ -46,4 +46,9 @@ + + + + + \ No newline at end of file From 44c6478c6bd1423ad742c919baec5e43709dc13b Mon Sep 17 00:00:00 2001 From: kate Date: Tue, 12 Feb 2019 16:17:46 +0100 Subject: [PATCH 025/224] schrodinger: create new employee user test --- .../resources/localization/schema.properties | 1 + .../scenarios/ObjectListArchetypeTests.java | 66 ++++++++++++++++++- .../component/common/table/Table.java | 8 +++ .../component/user/UserAssignmentsTab.java | 9 +++ .../component/user/UsersPageTable.java | 16 +++++ .../midpoint/schrodinger/page/BasicPage.java | 11 +++- 6 files changed, 109 insertions(+), 2 deletions(-) diff --git a/infra/schema/src/main/resources/localization/schema.properties b/infra/schema/src/main/resources/localization/schema.properties index d0b74777d13..aedaf3abc3c 100755 --- a/infra/schema/src/main/resources/localization/schema.properties +++ b/infra/schema/src/main/resources/localization/schema.properties @@ -333,6 +333,7 @@ GuiObjectListViewsType.default=Default GuiObjectListViewsType.objectList=Object list GuiObjectListViewsType.objectCollectionView=Object collection view GuiObjectListViewType.collection=Collection +GuiObjectListViewType.details=Details CollectionSpecificationType.collectionRef=Collection ref CollectionSpecificationType.depth=Depth CollectionSpecificationType.interpretation=Interpretation diff --git a/testing/schrodingertest/src/test/java/com/evolveum/midpoint/testing/schrodinger/scenarios/ObjectListArchetypeTests.java b/testing/schrodingertest/src/test/java/com/evolveum/midpoint/testing/schrodinger/scenarios/ObjectListArchetypeTests.java index b9cd213b529..41d36f74ea8 100644 --- a/testing/schrodingertest/src/test/java/com/evolveum/midpoint/testing/schrodinger/scenarios/ObjectListArchetypeTests.java +++ b/testing/schrodingertest/src/test/java/com/evolveum/midpoint/testing/schrodinger/scenarios/ObjectListArchetypeTests.java @@ -3,11 +3,11 @@ import com.codeborne.selenide.Condition; import com.codeborne.selenide.SelenideElement; import com.evolveum.midpoint.schrodinger.MidPoint; -import com.evolveum.midpoint.schrodinger.component.common.FeedbackBox; import com.evolveum.midpoint.schrodinger.component.common.PrismForm; import com.evolveum.midpoint.schrodinger.component.configuration.AdminGuiTab; import com.evolveum.midpoint.schrodinger.component.modal.ObjectBrowserModal; import com.evolveum.midpoint.schrodinger.page.configuration.ImportObjectPage; +import com.evolveum.midpoint.schrodinger.page.user.ListUsersPage; import com.evolveum.midpoint.schrodinger.util.Schrodinger; import com.evolveum.midpoint.testing.schrodinger.TestBase; import org.openqa.selenium.By; @@ -27,6 +27,10 @@ public class ObjectListArchetypeTests extends TestBase { private static final File EMPLOYEE_ARCHETYPE_FILE = new File("src/test/resources/configuration/objects/archetypes/archetype-employee.xml"); private static final String ARCHETYPE_OBJECT_NAME = "Employee"; + private static final String ARCHETYPE_PLURAL_LABEL = "Employees"; + private static final String ARCHETYPE_ICON_CSS_STYLE = "fa fa-male"; + private static final String EMPLOYEE_USER_NAME_VALUE = "TestEmployee"; + private static final String COLLECTION_REF_ATTRIBUTE_NAME = "Collection ref"; private static final String OBJECT_COLLECTION_VIEWS_HEADER = "Object collection views"; private static final String OBJECT_COLLECTION_VIEW_HEADER = "Object collection view"; @@ -59,6 +63,14 @@ public void configureArchetypeObjectListView(){ .expandContainerPropertiesPanel(NEW_OBJECT_LIST_VIEW_CONTAINER_KEY) .expandContainerPropertiesPanel(COLLECTION_HEADER); + //set UserType + SelenideElement newGuiObjectListViewPropertiesPanel = prismForm.getPrismPropertiesPanel(NEW_OBJECT_LIST_VIEW_CONTAINER_KEY); + newGuiObjectListViewPropertiesPanel + .$(Schrodinger.byDataResourceKey("Type")) + .$(Schrodinger.byElementAttributeValue("select", "data-s-id", "input")) + .selectOption("User"); + + //set archetypeRef SelenideElement collectionRefPropertyPanel = prismForm.findProperty(COLLECTION_REF_ATTRIBUTE_NAME); collectionRefPropertyPanel .$(Schrodinger.byDataId("edit")) @@ -88,5 +100,57 @@ public void configureArchetypeObjectListView(){ .feedback() .isSuccess(); } + + + + @Test(priority = 2, dependsOnMethods ={"configureArchetypeObjectListView"}) + public void actualizeArchetypeConfiguration() { + basicPage.loggedUser().logout(); + midPoint.login() + .login(midPoint.getUsername(),midPoint.getPassword()); + + //check archetype pluralLabel + ListUsersPage collectionListPage = basicPage.listUsers(ARCHETYPE_PLURAL_LABEL); + + Assert.assertTrue(collectionListPage + .table() + .buttonToolBarExists()); + + //check new employee button exists on the toolbar + collectionListPage + .table() + .getToolbarButton(ARCHETYPE_ICON_CSS_STYLE) + .shouldBe(Condition.visible) + .waitUntil(Condition.visible, MidPoint.TIMEOUT_DEFAULT_2_S); + + } + + @Test(priority = 3, dependsOnMethods ={"configureArchetypeObjectListView"}) + public void createNewEmployeeUser(){ + ListUsersPage collectionListPage = basicPage.listUsers(ARCHETYPE_PLURAL_LABEL); + + collectionListPage + .table() + .newObjectButtonClickPerformed(ARCHETYPE_ICON_CSS_STYLE) + .selectTabBasic() + .form() + .addAttributeValue("name", EMPLOYEE_USER_NAME_VALUE) + .and() + .and() + .clickSave() + .feedback() + .isSuccess(); + + basicPage.listUsers(ARCHETYPE_PLURAL_LABEL) + .table() + .search() + .byName() + .inputValue(EMPLOYEE_USER_NAME_VALUE) + .updateSearch() + .and() + .clickByName(EMPLOYEE_USER_NAME_VALUE); + + } + } diff --git a/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/common/table/Table.java b/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/common/table/Table.java index 939eb0dbc5c..78af76fd1b0 100644 --- a/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/common/table/Table.java +++ b/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/common/table/Table.java @@ -69,4 +69,12 @@ public boolean currentTableContains(String name) { } + public boolean buttonToolBarExists(){ + return $(Schrodinger.byDataId("buttonToolbar")).exists(); + } + + public SelenideElement getButtonToolbar(){ + return $(Schrodinger.byDataId("buttonToolbar")); + } + } diff --git a/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/user/UserAssignmentsTab.java b/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/user/UserAssignmentsTab.java index e0ceea01f78..07b4a3f94ef 100644 --- a/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/user/UserAssignmentsTab.java +++ b/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/user/UserAssignmentsTab.java @@ -25,6 +25,7 @@ import com.evolveum.midpoint.schrodinger.component.common.table.AbstractTableWithPrismView; import com.evolveum.midpoint.schrodinger.page.user.UserPage; import com.evolveum.midpoint.schrodinger.util.Schrodinger; +import org.apache.http.util.Asserts; import static com.codeborne.selenide.Selenide.$; @@ -83,4 +84,12 @@ public FocusSetAssignmentsModal clickAddAssignemnt() { return new FocusSetAssignmentsModal<>(this, modalElement); } + + public boolean assignmentExists(String assignmentName){ + SelenideElement assignmentSummaryDisplayName = table() + .clickByName(assignmentName) + .getParentElement() + .$(Schrodinger.byDataId("displayName")); + return assignmentName.equals(assignmentSummaryDisplayName.getText()); + } } diff --git a/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/user/UsersPageTable.java b/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/user/UsersPageTable.java index 539cef6159c..52f51323f8e 100644 --- a/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/user/UsersPageTable.java +++ b/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/user/UsersPageTable.java @@ -93,4 +93,20 @@ public UsersTableDropDown> clickActionDropDown() { return new UsersTableDropDown<>(this, dropDown); } + + public SelenideElement getToolbarButton(String iconCssClass){ + SelenideElement buttonToolbar = getButtonToolbar(); + return buttonToolbar + .$(Schrodinger.byElementAttributeValue("i", "class", iconCssClass)); + } + + public UserPage newObjectButtonClickPerformed(String iconCssClass){ + getToolbarButton(iconCssClass) + .click(); + + $(Schrodinger.byDataId("tabPanel")) + .shouldBe(Condition.visible) + .waitUntil(Condition.visible, MidPoint.TIMEOUT_MEDIUM_6_S); + return new UserPage(); + } } diff --git a/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/page/BasicPage.java b/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/page/BasicPage.java index e68b4a01f4b..897636b4f2e 100644 --- a/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/page/BasicPage.java +++ b/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/page/BasicPage.java @@ -33,6 +33,7 @@ import com.evolveum.midpoint.schrodinger.page.user.UserPage; import com.evolveum.midpoint.schrodinger.page.workitems.*; import com.evolveum.midpoint.schrodinger.util.Schrodinger; +import org.apache.commons.lang3.StringUtils; import org.openqa.selenium.By; import static com.codeborne.selenide.Selenide.$; @@ -72,7 +73,15 @@ public DashboardPage dashboard() { } public ListUsersPage listUsers() { - clickAdministrationMenu("PageAdmin.menu.top.users", "PageAdmin.menu.top.users.list"); + return listUsers(""); + } + + public ListUsersPage listUsers(String objectListMenuItemKey) { + if (StringUtils.isEmpty(objectListMenuItemKey)) { + clickAdministrationMenu("PageAdmin.menu.top.users", "PageAdmin.menu.top.users.list"); + } else { + clickAdministrationMenu("PageAdmin.menu.top.users", objectListMenuItemKey); + } return new ListUsersPage(); } From cf7fec98f2b08c063a5bd655c93d0c94e31a6817 Mon Sep 17 00:00:00 2001 From: kate Date: Tue, 12 Feb 2019 23:01:52 +0100 Subject: [PATCH 026/224] schrodinger: test fix --- .../scenarios/ObjectListArchetypeTests.java | 4 ++++ .../scenarios/PostAuthenticationTests.java | 6 ++++++ .../midpoint/schrodinger/page/BasicPage.java | 15 +++++++++++++-- 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/testing/schrodingertest/src/test/java/com/evolveum/midpoint/testing/schrodinger/scenarios/ObjectListArchetypeTests.java b/testing/schrodingertest/src/test/java/com/evolveum/midpoint/testing/schrodinger/scenarios/ObjectListArchetypeTests.java index 41d36f74ea8..f60f3b81e72 100644 --- a/testing/schrodingertest/src/test/java/com/evolveum/midpoint/testing/schrodinger/scenarios/ObjectListArchetypeTests.java +++ b/testing/schrodingertest/src/test/java/com/evolveum/midpoint/testing/schrodinger/scenarios/ObjectListArchetypeTests.java @@ -112,6 +112,10 @@ public void actualizeArchetypeConfiguration() { //check archetype pluralLabel ListUsersPage collectionListPage = basicPage.listUsers(ARCHETYPE_PLURAL_LABEL); + //check the icon class next to the Employee menu item + Assert.assertTrue(ARCHETYPE_ICON_CSS_STYLE + .equals(basicPage.getAdministrationMenuItemIconClass("PageAdmin.menu.top.users", ARCHETYPE_PLURAL_LABEL))); + Assert.assertTrue(collectionListPage .table() .buttonToolBarExists()); diff --git a/testing/schrodingertest/src/test/java/com/evolveum/midpoint/testing/schrodinger/scenarios/PostAuthenticationTests.java b/testing/schrodingertest/src/test/java/com/evolveum/midpoint/testing/schrodinger/scenarios/PostAuthenticationTests.java index 77b295be902..5ff79a4ba2e 100644 --- a/testing/schrodingertest/src/test/java/com/evolveum/midpoint/testing/schrodinger/scenarios/PostAuthenticationTests.java +++ b/testing/schrodingertest/src/test/java/com/evolveum/midpoint/testing/schrodinger/scenarios/PostAuthenticationTests.java @@ -8,6 +8,9 @@ import java.io.File; +import static com.codeborne.selenide.Selenide.open; +import static com.codeborne.selenide.Selenide.screenshot; + public class PostAuthenticationTests extends TestBase { private static final File SYSTEM_CONFIGURATION_POST_AUTH_ACTIVE_FILE = new File("./src/test/resources/configuration/objects/systemconfig/system-configuration-post-auth-active.xml"); @@ -106,6 +109,9 @@ public void flowWithPostAuthRoleAssigned(){ midPoint.login() .login(midPoint.getUsername(),midPoint.getPassword()); + //todo midpoint opens the previous page before logout + open("/self/dashboard"); + importObject(SYSTEM_CONFIGURATION_POST_AUTH_ACTIVE_FILE,true); ListUsersPage usersPage = basicPage.listUsers(); diff --git a/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/page/BasicPage.java b/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/page/BasicPage.java index 897636b4f2e..2d488d26514 100644 --- a/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/page/BasicPage.java +++ b/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/page/BasicPage.java @@ -36,6 +36,8 @@ import org.apache.commons.lang3.StringUtils; import org.openqa.selenium.By; +import java.awt.*; + import static com.codeborne.selenide.Selenide.$; /** @@ -297,6 +299,11 @@ private void clickAdministrationMenu(String mainMenuKey, String menuItemKey) { clickMenuItem("PageAdmin.menu.mainNavigation", mainMenuKey, menuItemKey); } + public String getAdministrationMenuItemIconClass(String mainMenuKey, String menuItemKey){ + SelenideElement menuItem = getMenuItemElement("PageAdmin.menu.mainNavigation", mainMenuKey, menuItemKey); + return menuItem.parent().$(By.tagName("i")).getAttribute("class"); + } + private void clickConfigurationMenu(String mainMenuKey, String menuItemKey) { clickMenuItem("PageAdmin.menu.top.configuration", mainMenuKey, menuItemKey); } @@ -308,6 +315,10 @@ public FeedbackBox feedback() { } private void clickMenuItem(String topLevelMenuKey, String mainMenuKey, String menuItemKey) { + getMenuItemElement(topLevelMenuKey, mainMenuKey, menuItemKey).click(); + } + + private SelenideElement getMenuItemElement(String topLevelMenuKey, String mainMenuKey, String menuItemKey){ SelenideElement topLevelMenu = $(Schrodinger.byDataResourceKey(topLevelMenuKey)); topLevelMenu.shouldBe(Condition.visible); @@ -321,7 +332,7 @@ private void clickMenuItem(String topLevelMenuKey, String mainMenuKey, String me mainMenu.shouldBe(Condition.visible); if (menuItemKey == null) { mainMenu.click(); - return; + return mainMenu; } SelenideElement mainMenuLi = mainMenu.parent().parent(); @@ -333,6 +344,6 @@ private void clickMenuItem(String topLevelMenuKey, String mainMenuKey, String me SelenideElement menuItem = mainMenu.$(Schrodinger.byDataResourceKey(menuItemKey)); menuItem.shouldBe(Condition.visible); - menuItem.click(); + return menuItem; } } From 320e993e374cbef8aaac4c3cd7c6df75af5f29c0 Mon Sep 17 00:00:00 2001 From: kate Date: Wed, 13 Feb 2019 16:36:03 +0100 Subject: [PATCH 027/224] schrodinger: assignment archetype test --- .../scenarios/AssignmentArchetypeTest.java | 34 +++++++++++++ .../scenarios/ObjectListArchetypeTests.java | 44 ++++++++++------ .../archetypes/archetype-business-role.xml | 51 +++++++++++++++++++ .../configuration/RoleManagementTab.java | 20 ++++++++ .../midpoint/schrodinger/page/BasicPage.java | 5 ++ .../page/configuration/SystemPage.java | 4 ++ 6 files changed, 142 insertions(+), 16 deletions(-) create mode 100644 testing/schrodingertest/src/test/java/com/evolveum/midpoint/testing/schrodinger/scenarios/AssignmentArchetypeTest.java create mode 100644 testing/schrodingertest/src/test/resources/configuration/objects/archetypes/archetype-business-role.xml create mode 100644 tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/configuration/RoleManagementTab.java diff --git a/testing/schrodingertest/src/test/java/com/evolveum/midpoint/testing/schrodinger/scenarios/AssignmentArchetypeTest.java b/testing/schrodingertest/src/test/java/com/evolveum/midpoint/testing/schrodinger/scenarios/AssignmentArchetypeTest.java new file mode 100644 index 00000000000..6e419bc4bf9 --- /dev/null +++ b/testing/schrodingertest/src/test/java/com/evolveum/midpoint/testing/schrodinger/scenarios/AssignmentArchetypeTest.java @@ -0,0 +1,34 @@ +package com.evolveum.midpoint.testing.schrodinger.scenarios; + +import com.evolveum.midpoint.testing.schrodinger.TestBase; +import org.testng.annotations.Test; + +import java.io.File; + +/** + * Created by honchar + */ +public class AssignmentArchetypeTest extends TestBase { + + private static final File ARCHETYPE_BUSINESS_ROLE_FILE = new File("src/test/resources/configuration/objects/archetypes/archetype-business-role.xml"); + private static final String RELATIONS_CONTAINER_HEADER_KEY = "Relations"; + private static final String RELATION_CONTAINER_HEADER_KEY = "Relation"; + private static final String NEWLY_ADDED_RELATION_CONTAINER_HEADER_KEY = "RelationDefinitionType.details"; + + @Test(priority = 0) + public void importArchetypeBusinessRole() { + importObject(ARCHETYPE_BUSINESS_ROLE_FILE); + } + + @Test + public void configureRelationDefinitions(){ + //TODO wait till MID-5144 fix +// basicPage +// .roleManagement() +// .form() +// .expandContainerPropertiesPanel(RELATIONS_CONTAINER_HEADER_KEY) +// .addNewContainerValue(RELATION_CONTAINER_HEADER_KEY, NEWLY_ADDED_RELATION_CONTAINER_HEADER_KEY) +// .expandContainerPropertiesPanel(NEWLY_ADDED_RELATION_CONTAINER_HEADER_KEY) + + } +} diff --git a/testing/schrodingertest/src/test/java/com/evolveum/midpoint/testing/schrodinger/scenarios/ObjectListArchetypeTests.java b/testing/schrodingertest/src/test/java/com/evolveum/midpoint/testing/schrodinger/scenarios/ObjectListArchetypeTests.java index f60f3b81e72..912f7a0c962 100644 --- a/testing/schrodingertest/src/test/java/com/evolveum/midpoint/testing/schrodinger/scenarios/ObjectListArchetypeTests.java +++ b/testing/schrodingertest/src/test/java/com/evolveum/midpoint/testing/schrodinger/scenarios/ObjectListArchetypeTests.java @@ -6,7 +6,6 @@ import com.evolveum.midpoint.schrodinger.component.common.PrismForm; import com.evolveum.midpoint.schrodinger.component.configuration.AdminGuiTab; import com.evolveum.midpoint.schrodinger.component.modal.ObjectBrowserModal; -import com.evolveum.midpoint.schrodinger.page.configuration.ImportObjectPage; import com.evolveum.midpoint.schrodinger.page.user.ListUsersPage; import com.evolveum.midpoint.schrodinger.util.Schrodinger; import com.evolveum.midpoint.testing.schrodinger.TestBase; @@ -37,23 +36,14 @@ public class ObjectListArchetypeTests extends TestBase { private static final String NEW_GUI_OBJECT_LIST_VIEW_HEADER = "New gui object list view"; private static final String NEW_OBJECT_LIST_VIEW_CONTAINER_KEY = "GuiObjectListViewType.details"; private static final String COLLECTION_HEADER = "Collection"; + public static final String OBJECT_LIST_ARCHETYPE_TESTS_GROUP = "bjectListArchetypeTests"; - @Test(priority = 0) + @Test(priority = 0, groups = OBJECT_LIST_ARCHETYPE_TESTS_GROUP) public void importEmployeeArchetype() throws IOException, ConfigurationException { - - ImportObjectPage importPage = basicPage.importObject(); - Assert.assertTrue( - importPage - .getObjectsFromFile() - .chooseFile(EMPLOYEE_ARCHETYPE_FILE) - .checkOverwriteExistingObject() - .clickImport() - .feedback() - .isSuccess() - ); + importObject(EMPLOYEE_ARCHETYPE_FILE, true); } - @Test(priority = 1, dependsOnMethods ={"importEmployeeArchetype"}) + @Test(priority = 1, dependsOnMethods ={"importEmployeeArchetype"}, groups = OBJECT_LIST_ARCHETYPE_TESTS_GROUP) public void configureArchetypeObjectListView(){ AdminGuiTab adminGuiTab = basicPage.adminGui(); PrismForm prismForm = adminGuiTab.form(); @@ -103,7 +93,7 @@ public void configureArchetypeObjectListView(){ - @Test(priority = 2, dependsOnMethods ={"configureArchetypeObjectListView"}) + @Test(priority = 2, dependsOnMethods ={"configureArchetypeObjectListView"}, groups = OBJECT_LIST_ARCHETYPE_TESTS_GROUP) public void actualizeArchetypeConfiguration() { basicPage.loggedUser().logout(); midPoint.login() @@ -129,7 +119,7 @@ public void actualizeArchetypeConfiguration() { } - @Test(priority = 3, dependsOnMethods ={"configureArchetypeObjectListView"}) + @Test(priority = 3, dependsOnMethods ={"actualizeArchetypeConfiguration"}, groups = OBJECT_LIST_ARCHETYPE_TESTS_GROUP) public void createNewEmployeeUser(){ ListUsersPage collectionListPage = basicPage.listUsers(ARCHETYPE_PLURAL_LABEL); @@ -156,5 +146,27 @@ public void createNewEmployeeUser(){ } + @Test(priority = 4, dependsOnMethods ={"actualizeArchetypeConfiguration"}) + public void checkNewObjectButtonWithDropdown(){ + ListUsersPage userListPage = basicPage.listUsers(); + Assert.assertTrue(userListPage + .table() + .getToolbarButton("fa fa-plus") + .exists()); + + SelenideElement newObjectButton = userListPage + .table() + .getToolbarButton("fa fa-plus"); + newObjectButton.click(); + + newObjectButton + .$(By.tagName("ul")) + .shouldBe(Condition.visible) + .waitUntil(Condition.visible, MidPoint.TIMEOUT_DEFAULT_2_S) + .$(Schrodinger.byElementAttributeValue("i", "class", ARCHETYPE_ICON_CSS_STYLE)) + .$(Schrodinger.byElementAttributeValue("i", "class", "fa fa-user")); //standard user icon + + } + } diff --git a/testing/schrodingertest/src/test/resources/configuration/objects/archetypes/archetype-business-role.xml b/testing/schrodingertest/src/test/resources/configuration/objects/archetypes/archetype-business-role.xml new file mode 100644 index 00000000000..9fec16ab0e6 --- /dev/null +++ b/testing/schrodingertest/src/test/resources/configuration/objects/archetypes/archetype-business-role.xml @@ -0,0 +1,51 @@ + + + Business Role + + + + Business Roles + + fe fe-business + green + + + + + + This archetype is applicable to roles. + RoleType + + + + + Any user can have business role (can be a member). + UserType + org:approver + + + Only employees may be owners/approvers for business role. + UserType + + org:owner + + + diff --git a/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/configuration/RoleManagementTab.java b/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/configuration/RoleManagementTab.java new file mode 100644 index 00000000000..af376dac800 --- /dev/null +++ b/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/component/configuration/RoleManagementTab.java @@ -0,0 +1,20 @@ +package com.evolveum.midpoint.schrodinger.component.configuration; + +import com.codeborne.selenide.SelenideElement; +import com.evolveum.midpoint.schrodinger.component.Component; +import com.evolveum.midpoint.schrodinger.component.common.PrismForm; +import com.evolveum.midpoint.schrodinger.page.configuration.SystemPage; + +/** + * Created by honchar + */ +public class RoleManagementTab extends Component { + + public RoleManagementTab(SystemPage parent, SelenideElement parentElement) { + super(parent, parentElement); + } + + public PrismForm form(){ + return new PrismForm<>(this, null); + } +} diff --git a/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/page/BasicPage.java b/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/page/BasicPage.java index 2d488d26514..73a0666a42e 100644 --- a/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/page/BasicPage.java +++ b/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/page/BasicPage.java @@ -277,6 +277,11 @@ public AdminGuiTab adminGui() { return new SystemPage().adminGuiTab(); } + public RoleManagementTab roleManagement() { + clickConfigurationMenu("PageAdmin.menu.top.configuration.basic", "PageAdmin.menu.top.configuration.roleManagement"); + return new SystemPage().roleManagementTab(); + } + public InternalsConfigurationPage internalsConfiguration() { clickConfigurationMenu("PageAdmin.menu.top.configuration.internals", null); return new InternalsConfigurationPage(); diff --git a/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/page/configuration/SystemPage.java b/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/page/configuration/SystemPage.java index 9af79581171..e5c205f5f12 100644 --- a/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/page/configuration/SystemPage.java +++ b/tools/schrodinger/src/main/java/com/evolveum/midpoint/schrodinger/page/configuration/SystemPage.java @@ -51,4 +51,8 @@ public AdminGuiTab adminGuiTab() { SelenideElement element = null; return new AdminGuiTab(this, element); } + + public RoleManagementTab roleManagementTab(){ + return new RoleManagementTab(this, null); + } } From 63fd5bff1f22c732bb690c84e2cc8389c665a7b9 Mon Sep 17 00:00:00 2001 From: skublik Date: Wed, 13 Feb 2019 18:20:51 +0100 Subject: [PATCH 028/224] adding condition for AjaxRequestTarget and move calling of updateModal() (MID-5140) --- .../com/evolveum/midpoint/web/component/wizard/Wizard.java | 2 +- .../evolveum/midpoint/web/component/wizard/WizardSteps.java | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/wizard/Wizard.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/wizard/Wizard.java index d5ff3d639b0..dafc4677558 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/wizard/Wizard.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/wizard/Wizard.java @@ -200,7 +200,7 @@ public void onActiveStepChanged(IWizardStep newStep) { WizardSteps steps = (WizardSteps) get(createComponentPath(ID_FORM, ID_STEPS)); IModel> stepsModel = steps.getModel(); stepsModel.getObject().get(index).setActive(true); - steps.updateModal(); +// steps.updateModal(); } @Override diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/wizard/WizardSteps.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/wizard/WizardSteps.java index 2d16774aa1a..55717fc78f7 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/wizard/WizardSteps.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/wizard/WizardSteps.java @@ -115,6 +115,7 @@ public String getObject() { @Override public void onClick(AjaxRequestTarget target) { showHelpPerformed(target); + updateModal(); } }; add(help); @@ -130,8 +131,8 @@ private void initModals(){ public void updateModal(){ WizardHelpDialog window = (WizardHelpDialog)get(ID_HELP_MODAL); - if(window != null){ - AjaxRequestTarget target = getRequestCycle().find(AjaxRequestTarget.class).get(); + if(window != null && getRequestCycle().find(AjaxRequestTarget.class).isPresent()){ + AjaxRequestTarget target = getRequestCycle().find(AjaxRequestTarget.class).get(); window.updateModal(target ,getActiveStep()); } } From fd9943dced5b044b6279773f6e790e5a5a0bc6d5 Mon Sep 17 00:00:00 2001 From: Matus Macik Date: Thu, 14 Feb 2019 14:32:22 +0100 Subject: [PATCH 029/224] Changing "factory default button" name --- .../src/main/resources/localization/Midpoint.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gui/admin-gui/src/main/resources/localization/Midpoint.properties b/gui/admin-gui/src/main/resources/localization/Midpoint.properties index ff952ba804a..db1d288b80c 100755 --- a/gui/admin-gui/src/main/resources/localization/Midpoint.properties +++ b/gui/admin-gui/src/main/resources/localization/Midpoint.properties @@ -1013,7 +1013,7 @@ PageAbout.button.testRepositoryCheckOrgClosure=Check and repair org closure cons PageAbout.button.reindexRepositoryObjects=Reindex repository objects PageAbout.button.testRepository=Repository self test PageAbout.button.clearCssJsCache=Clear CSS/JS cache -PageAbout.button.factoryDefault=Switch to factory default +PageAbout.button.factoryDefault=Reset to factory default PageAbout.message.deleteAllObjects=Do you really want to delete all objects? It may take several minutes. PageAbout.message.couldntObtainJvmParams=Couldn't obtain JVM parameters from JMX. PageAbout.midPointRevision=${git.describe} @@ -4364,4 +4364,4 @@ ResourceSummaryPanel.UP=Up ResourceSummaryPanel.DOWN=Down operation.com.evolveum.midpoint.web.page.admin.configuration.InternalsThreadsPanel.executeShowAllThreads=Show all threads (Gui) operation.com.evolveum.midpoint.web.page.admin.configuration.InternalsThreadsPanel.executeShowTasksThreads=Show running tasks threads (Gui) -operation.com.evolveum.midpoint.web.page.admin.configuration.InternalsThreadsPanel.executeRecordTasksThreads=Record running tasks threads (Gui) \ No newline at end of file +operation.com.evolveum.midpoint.web.page.admin.configuration.InternalsThreadsPanel.executeRecordTasksThreads=Record running tasks threads (Gui) From 41e8c3c5eb6c04d0a90b06cead1e0222932048da Mon Sep 17 00:00:00 2001 From: kate Date: Thu, 14 Feb 2019 16:03:15 +0100 Subject: [PATCH 030/224] shopping cart improvements --- .../web/component/form/DropDownFormGroup.java | 2 + .../input/RelationDropDownChoicePanel.java | 6 +- .../self/AbstractShoppingCartTabPanel.html | 23 +++- .../self/AbstractShoppingCartTabPanel.java | 119 ++++++++++++++++-- .../page/self/PageAssignmentShoppingCart.html | 18 --- .../page/self/PageAssignmentShoppingCart.java | 117 ----------------- .../web/page/self/PageAssignmentsList.java | 8 +- .../localization/Midpoint.properties | 1 + 8 files changed, 144 insertions(+), 150 deletions(-) diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/form/DropDownFormGroup.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/form/DropDownFormGroup.java index c874d9f8013..2f4c1411c96 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/form/DropDownFormGroup.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/form/DropDownFormGroup.java @@ -17,6 +17,7 @@ package com.evolveum.midpoint.web.component.form; import com.evolveum.midpoint.gui.api.component.BasePanel; +import com.evolveum.midpoint.web.component.util.VisibleBehaviour; import com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour; import com.evolveum.midpoint.web.util.InfoTooltipBehavior; @@ -76,6 +77,7 @@ private void initLayout(IModel> choices, IChoiceRenderer renderer, IM boolean isTooltipInModal, String labelCssClass, String textCssClass, final boolean required, boolean isSimilarAsPropertyPanel) { WebMarkupContainer labelContainer = new WebMarkupContainer(ID_LABEL_CONTAINER); + labelContainer.add(new VisibleBehaviour(() -> label != null && StringUtils.isNotEmpty(label.getObject()))); add(labelContainer); Label l = new Label(ID_LABEL, label); diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/input/RelationDropDownChoicePanel.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/input/RelationDropDownChoicePanel.java index b682adbf46f..e3a39ea832e 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/input/RelationDropDownChoicePanel.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/input/RelationDropDownChoicePanel.java @@ -78,7 +78,7 @@ protected void onInitialize(){ defaultRelation = supportedRelations.size() > 0 ? supportedRelations.get(0) : PrismConstants.Q_ANY; } DropDownFormGroup input = new DropDownFormGroup(ID_INPUT, Model.of(defaultRelation), new ListModel<>(supportedRelations), getRenderer(), - createStringResource("relationDropDownChoicePanel.relation"), "relationDropDownChoicePanel.tooltip.relation", true, "col-md-4", "col-md-8", !allowNull); + getRelationLabelModel(), "relationDropDownChoicePanel.tooltip.relation", true, "col-md-4", "col-md-8", !allowNull); input.getInput().add(new EmptyOnChangeAjaxFormUpdatingBehavior()); input.getInput().add(new OnChangeAjaxBehavior() { @@ -130,6 +130,10 @@ public String getIdValue(QName object, int index) { }; } + protected IModel getRelationLabelModel(){ + return createStringResource("relationDropDownChoicePanel.relation"); + } + protected void onValueChanged(AjaxRequestTarget target){ } diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/self/AbstractShoppingCartTabPanel.html b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/self/AbstractShoppingCartTabPanel.html index 99ab9899ecf..698b9776815 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/self/AbstractShoppingCartTabPanel.html +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/self/AbstractShoppingCartTabPanel.html @@ -22,7 +22,28 @@
- + + diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/self/AbstractShoppingCartTabPanel.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/self/AbstractShoppingCartTabPanel.java index 8be047cb0a6..2560c7fdb49 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/self/AbstractShoppingCartTabPanel.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/self/AbstractShoppingCartTabPanel.java @@ -28,26 +28,22 @@ import com.evolveum.midpoint.util.logging.Trace; import com.evolveum.midpoint.util.logging.TraceManager; import com.evolveum.midpoint.web.component.AjaxButton; -import com.evolveum.midpoint.web.component.assignment.AssignmentEditorDto; -import com.evolveum.midpoint.web.component.assignment.AssignmentsUtil; -import com.evolveum.midpoint.web.component.assignment.GridViewComponent; -import com.evolveum.midpoint.web.component.assignment.RoleCatalogItemButton; +import com.evolveum.midpoint.web.component.assignment.*; import com.evolveum.midpoint.web.component.data.ObjectDataProvider; +import com.evolveum.midpoint.web.component.input.RelationDropDownChoicePanel; import com.evolveum.midpoint.web.component.search.SearchFactory; import com.evolveum.midpoint.web.component.search.SearchPanel; import com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour; import com.evolveum.midpoint.web.page.admin.users.dto.UserDtoStatus; import com.evolveum.midpoint.web.session.RoleCatalogStorage; -import com.evolveum.midpoint.xml.ns._public.common.common_3.AbstractRoleType; -import com.evolveum.midpoint.xml.ns._public.common.common_3.AssignmentType; -import com.evolveum.midpoint.xml.ns._public.common.common_3.RoleManagementConfigurationType; -import com.evolveum.midpoint.xml.ns._public.common.common_3.UserType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.*; import org.apache.wicket.ajax.AjaxRequestTarget; import org.apache.wicket.ajax.attributes.AjaxRequestAttributes; import org.apache.wicket.behavior.AttributeAppender; import org.apache.wicket.markup.html.WebMarkupContainer; import org.apache.wicket.markup.html.form.Form; import org.apache.wicket.markup.repeater.Item; +import org.apache.wicket.model.IModel; import org.apache.wicket.model.Model; import javax.xml.namespace.QName; @@ -65,6 +61,10 @@ public abstract class AbstractShoppingCartTabPanel e private static final String ID_SEARCH_FORM = "searchForm"; private static final String ID_SEARCH = "search"; private static final String ID_ADD_ALL_BUTTON = "addAllButton"; + private static final String ID_PARAMETERS_PANEL = "parametersPanel"; + private static final String ID_RELATION_CONTAINER = "relationContainer"; + private static final String ID_RELATION = "relation"; + private static final String ID_TARGET_USER_PANEL = "targetUserPanel"; private static final String DOT_CLASS = AbstractShoppingCartTabPanel.class.getName() + "."; private static final String OPERATION_LOAD_ASSIGNABLE_ROLES = DOT_CLASS + "loadAssignableRoles"; @@ -96,7 +96,7 @@ private void initLayout(){ initSearchPanel(shoppingCartContainer); initShoppingCartItemsPanel(shoppingCartContainer); - initAddAllButton(shoppingCartContainer); + initParametersPanel(shoppingCartContainer); } protected void initLeftSidePanel(){ @@ -169,7 +169,81 @@ public boolean isVisible(){ shoppingCartContainer.add(catalogItemsGrid); } - private void initAddAllButton(WebMarkupContainer shoppingCartContainer){ + private void initParametersPanel(WebMarkupContainer shoppingCartContainer){ + WebMarkupContainer parametersPanel = new WebMarkupContainer(ID_PARAMETERS_PANEL); + parametersPanel.setOutputMarkupId(true); + shoppingCartContainer.add(parametersPanel); + + initTargetUserSelectionPanel(parametersPanel); + initRelationPanel(parametersPanel); + initAddAllButton(parametersPanel); + } + + private void initTargetUserSelectionPanel(WebMarkupContainer parametersPanel){ + UserSelectionButton targetUserPanel = new UserSelectionButton(ID_TARGET_USER_PANEL, + new IModel>() { + @Override + public List getObject() { + return getRoleCatalogStorage().getTargetUserList(); + } + }, + true, createStringResource("AssignmentCatalogPanel.selectTargetUser")){ + private static final long serialVersionUID = 1L; + + @Override + protected String getUserButtonLabel(){ + return getTargetUserSelectionButtonLabel(getModelObject()); + } + + @Override + protected String getTargetUserButtonClass(){ + return "btn-sm"; + } + + @Override + protected void onDeleteSelectedUsersPerformed(AjaxRequestTarget target){ + super.onDeleteSelectedUsersPerformed(target); + getRoleCatalogStorage().setTargetUserList(new ArrayList<>()); + + target.add(AbstractShoppingCartTabPanel.this); +// target.add(parametersPanel.get(ID_TARGET_USER_PANEL)); + } + + @Override + protected void multipleUsersSelectionPerformed(AjaxRequestTarget target, List usersList){ + getRoleCatalogStorage().setTargetUserList(usersList); + target.add(AbstractShoppingCartTabPanel.this); +// target.add(parametersPanel.get(ID_TARGET_USER_PANEL)); + } + + }; + targetUserPanel.setOutputMarkupId(true); + parametersPanel.add(targetUserPanel); + } + + private void initRelationPanel(WebMarkupContainer parametersPanel){ + WebMarkupContainer relationContainer = new WebMarkupContainer(ID_RELATION_CONTAINER); + relationContainer.setOutputMarkupId(true); + parametersPanel.add(relationContainer); + + List availableRelations = WebComponentUtil.getCategoryRelationChoices(AreaCategoryType.SELF_SERVICE, getPageBase()); + relationContainer.add(new RelationDropDownChoicePanel(ID_RELATION, getRoleCatalogStorage().getSelectedRelation(), + availableRelations, false){ + private static final long serialVersionUID = 1L; + + @Override + protected void onValueChanged(AjaxRequestTarget target){ + getRoleCatalogStorage().setSelectedRelation(getRelationValue()); + } + + @Override + protected IModel getRelationLabelModel(){ + return Model.of(); + } + }); + } + + private void initAddAllButton(WebMarkupContainer parametersPanel){ AjaxButton addAllButton = new AjaxButton(ID_ADD_ALL_BUTTON, createStringResource("AbstractShoppingCartTabPanel.addAllButton")) { private static final long serialVersionUID = 1L; @@ -203,7 +277,30 @@ public boolean isEnabled() { }); addAllButton.add(AttributeAppender.append("title", AssignmentsUtil.getShoppingCartAssignmentsLimitReachedTitleModel(getPageBase()))); - shoppingCartContainer.add(addAllButton); + parametersPanel.add(addAllButton); + } + + private String getTargetUserSelectionButtonLabel(List usersList){ + if (usersList == null || usersList.size() == 0){ + return createStringResource("AssignmentCatalogPanel.requestForMe").getString(); + } else if (usersList.size() == 1){ + if (usersList.get(0).getOid().equals(getPageBase().loadUserSelf().getOid())){ + return createStringResource("AssignmentCatalogPanel.requestForMe").getString(); + } else { + return usersList.get(0).getName().getOrig(); + } + } else { + return createStringResource("AssignmentCatalogPanel.requestForMultiple", + usersList.size()).getString(); + } + } + + private QName getRelationParameterValue(){ + return getRelationDropDown().getRelationValue(); + } + + private RelationDropDownChoicePanel getRelationDropDown(){ + return (RelationDropDownChoicePanel)get(createComponentPath(ID_SHOPPING_CART_CONTAINER, ID_PARAMETERS_PANEL, ID_RELATION_CONTAINER, ID_RELATION)); } private void addAllAssignmentsPerformed(AjaxRequestTarget target){ diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/self/PageAssignmentShoppingCart.html b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/self/PageAssignmentShoppingCart.html index 9ea1ffbde80..45240b10c4b 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/self/PageAssignmentShoppingCart.html +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/self/PageAssignmentShoppingCart.html @@ -22,24 +22,6 @@
diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/self/AbstractShoppingCartTabPanel.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/self/AbstractShoppingCartTabPanel.java index 2560c7fdb49..e0169a05f11 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/self/AbstractShoppingCartTabPanel.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/self/AbstractShoppingCartTabPanel.java @@ -33,10 +33,13 @@ import com.evolveum.midpoint.web.component.input.RelationDropDownChoicePanel; import com.evolveum.midpoint.web.component.search.SearchFactory; import com.evolveum.midpoint.web.component.search.SearchPanel; +import com.evolveum.midpoint.web.component.util.VisibleBehaviour; import com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour; import com.evolveum.midpoint.web.page.admin.users.dto.UserDtoStatus; import com.evolveum.midpoint.web.session.RoleCatalogStorage; import com.evolveum.midpoint.xml.ns._public.common.common_3.*; +import org.apache.wicket.AttributeModifier; +import org.apache.wicket.ajax.AjaxChannel; import org.apache.wicket.ajax.AjaxRequestTarget; import org.apache.wicket.ajax.attributes.AjaxRequestAttributes; import org.apache.wicket.behavior.AttributeAppender; @@ -61,6 +64,7 @@ public abstract class AbstractShoppingCartTabPanel e private static final String ID_SEARCH_FORM = "searchForm"; private static final String ID_SEARCH = "search"; private static final String ID_ADD_ALL_BUTTON = "addAllButton"; + private static final String ID_GO_TO_SHOPPING_CART_BUTTON = "goToShoppingCart"; private static final String ID_PARAMETERS_PANEL = "parametersPanel"; private static final String ID_RELATION_CONTAINER = "relationContainer"; private static final String ID_RELATION = "relation"; @@ -176,7 +180,7 @@ private void initParametersPanel(WebMarkupContainer shoppingCartContainer){ initTargetUserSelectionPanel(parametersPanel); initRelationPanel(parametersPanel); - initAddAllButton(parametersPanel); + initButtonsPanel(parametersPanel); } private void initTargetUserSelectionPanel(WebMarkupContainer parametersPanel){ @@ -243,7 +247,7 @@ protected IModel getRelationLabelModel(){ }); } - private void initAddAllButton(WebMarkupContainer parametersPanel){ + private void initButtonsPanel(WebMarkupContainer parametersPanel){ AjaxButton addAllButton = new AjaxButton(ID_ADD_ALL_BUTTON, createStringResource("AbstractShoppingCartTabPanel.addAllButton")) { private static final long serialVersionUID = 1L; @@ -278,6 +282,26 @@ public boolean isEnabled() { addAllButton.add(AttributeAppender.append("title", AssignmentsUtil.getShoppingCartAssignmentsLimitReachedTitleModel(getPageBase()))); parametersPanel.add(addAllButton); + + AjaxButton goToShoppingCartButton = new AjaxButton(ID_GO_TO_SHOPPING_CART_BUTTON, createStringResource("AbstractShoppingCartTabPanel.goToShoppingCartButton")) { + private static final long serialVersionUID = 1L; + + @Override + protected void updateAjaxAttributes(AjaxRequestAttributes attributes) { + attributes.setChannel(new AjaxChannel("blocking", AjaxChannel.Type.ACTIVE)); + } + + @Override + public void onClick(AjaxRequestTarget ajaxRequestTarget) { + AbstractShoppingCartTabPanel.this.getPageBase().navigateToNext(new PageAssignmentsList(true)); + } + }; + goToShoppingCartButton.setOutputMarkupId(true); + goToShoppingCartButton.add(new VisibleBehaviour(() -> { + boolean isShoppingCartEmpty = AbstractShoppingCartTabPanel.this.getRoleCatalogStorage().getAssignmentShoppingCart().size() == 0; + return !isShoppingCartEmpty; + })); + parametersPanel.add(goToShoppingCartButton); } private String getTargetUserSelectionButtonLabel(List usersList){ @@ -416,6 +440,8 @@ private UserType getTargetUser(){ } protected void assignmentAddedToShoppingCartPerformed(AjaxRequestTarget target){ + getPageBase().reloadShoppingCartIcon(target); + target.add(AbstractShoppingCartTabPanel.this); } protected QName getNewAssignmentRelation() { diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/self/PageAssignmentShoppingCart.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/self/PageAssignmentShoppingCart.java index 9b949c26525..35fbf3ec723 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/self/PageAssignmentShoppingCart.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/self/PageAssignmentShoppingCart.java @@ -154,15 +154,7 @@ private List getTabsList(){ @Override public WebMarkupContainer createPanel(String panelId) { - return new RoleCatalogTabPanel(panelId, roleManagementConfigModel.getObject(), roleCatalogOid){ - private static final long serialVersionUID = 1L; - - @Override - protected void assignmentAddedToShoppingCartPerformed(AjaxRequestTarget target){ - reloadShoppingCartIcon(target); - } - - }; + return new RoleCatalogTabPanel(panelId, roleManagementConfigModel.getObject(), roleCatalogOid); } }); } @@ -181,10 +173,6 @@ protected QName getQueryType() { return RoleType.COMPLEX_TYPE; } - @Override - protected void assignmentAddedToShoppingCartPerformed(AjaxRequestTarget target){ - reloadShoppingCartIcon(target); - } }; } }); @@ -203,10 +191,6 @@ protected QName getQueryType() { return OrgType.COMPLEX_TYPE; } - @Override - protected void assignmentAddedToShoppingCartPerformed(AjaxRequestTarget target){ - reloadShoppingCartIcon(target); - } }; } }); @@ -224,11 +208,6 @@ public WebMarkupContainer createPanel(String panelId) { protected QName getQueryType() { return ServiceType.COMPLEX_TYPE; } - - @Override - protected void assignmentAddedToShoppingCartPerformed(AjaxRequestTarget target){ - reloadShoppingCartIcon(target); - } }; } }); @@ -239,14 +218,7 @@ protected void assignmentAddedToShoppingCartPerformed(AjaxRequestTarget target){ @Override public WebMarkupContainer createPanel(String panelId) { - return new UserViewTabPanel(panelId, roleManagementConfigModel.getObject()) { - private static final long serialVersionUID = 1L; - - @Override - protected void assignmentAddedToShoppingCartPerformed(AjaxRequestTarget target){ - reloadShoppingCartIcon(target); - } - }; + return new UserViewTabPanel(panelId, roleManagementConfigModel.getObject()); } }); return tabs; diff --git a/gui/admin-gui/src/main/resources/localization/Midpoint.properties b/gui/admin-gui/src/main/resources/localization/Midpoint.properties index 903e6554dcb..58d9443d467 100755 --- a/gui/admin-gui/src/main/resources/localization/Midpoint.properties +++ b/gui/admin-gui/src/main/resources/localization/Midpoint.properties @@ -3916,6 +3916,7 @@ PageAssignmentConflicts.back=Back PageAssignmentConflicts.submit=Submit PageAssignmentsList.conflictsWarning=Unable to calculate assignment conflicts due to authorization problem. Reason: AbstractShoppingCartTabPanel.addAllButton=Add all +AbstractShoppingCartTabPanel.goToShoppingCartButton=Go to shopping cart AbstractShoppingCartTabPanel.requestingForLabel=Requesting for AbstractShoppingCartTabPanel.availableRelationsLabel=Available relations AssignmentCatalogPanel.selectTargetUser=Select target user From b6f33f2b1c2bbceaa82ee3b76c03ad800ea23676 Mon Sep 17 00:00:00 2001 From: kate Date: Fri, 15 Feb 2019 10:58:12 +0100 Subject: [PATCH 032/224] user-friendly messages for shopping cart --- .../web/page/self/PageAssignmentsList.java | 22 +++++++++++-------- .../localization/Midpoint.properties | 3 +++ 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/self/PageAssignmentsList.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/self/PageAssignmentsList.java index 2d1e644141c..2a4a4152531 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/self/PageAssignmentsList.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/self/PageAssignmentsList.java @@ -266,6 +266,7 @@ private void onSingleUserRequestPerformed(AjaxRequestTarget target) { storage.getRoleCatalog().getAssignmentShoppingCart().clear(); } catch (Exception e) { result.recordFatalError(e); + result.setMessage(createStringResource("PageAssignmentsList.requestError").getString()); LoggingUtils.logUnexpectedException(LOGGER, "Could not save assignments ", e); } finally { result.recomputeStatus(); @@ -274,20 +275,22 @@ private void onSingleUserRequestPerformed(AjaxRequestTarget target) { findBackgroundTaskOperation(result); if (backgroundTaskOperationResult != null && StringUtils.isNotEmpty(backgroundTaskOperationResult.getBackgroundTaskOid())){ - result.setMessage(createStringResource("operation.com.evolveum.midpoint.web.page.self.PageRequestRole.taskCreated").getString()); + result.setMessage(createStringResource("PageAssignmentsList.requestInProgress").getString()); showResult(result); clearStorage(); setResponsePage(PageAssignmentShoppingCart.class); return; } - showResult(result); if (!WebComponentUtil.isSuccessOrHandledError(result)) { + result.setMessage(createStringResource("PageAssignmentsList.requestError").getString()); target.add(getFeedbackPanel()); target.add(PageAssignmentsList.this.get(ID_FORM)); } else { clearStorage(); + result.setMessage(createStringResource("PageAssignmentsList.requestSuccess").getString()); setResponsePage(PageAssignmentShoppingCart.class); } + showResult(result); } private void targetUserChangePerformed(AjaxRequestTarget target){ @@ -326,6 +329,7 @@ private void onMultiUserRequestPerformed(AjaxRequestTarget target) { WebModelServiceUtils.runTask(task, operationalTask, result, PageAssignmentsList.this); } catch (SchemaException e) { result.recordFatalError(result.getOperation(), e); + result.setMessage(createStringResource("PageAssignmentsList.requestError").getString()); LoggingUtils.logUnexpectedException(LOGGER, "Failed to execute operaton " + result.getOperation(), e); target.add(getFeedbackPanel()); @@ -333,7 +337,7 @@ private void onMultiUserRequestPerformed(AjaxRequestTarget target) { findBackgroundTaskOperation(result); if (backgroundTaskOperationResult != null && StringUtils.isNotEmpty(backgroundTaskOperationResult.getBackgroundTaskOid())) { - result.setMessage(createStringResource("operation.com.evolveum.midpoint.web.page.self.PageRequestRole.taskCreated").getString()); + result.setMessage(createStringResource("PageAssignmentsList.requestInProgress").getString()); showResult(result); clearStorage(); setResponsePage(PageAssignmentShoppingCart.class); @@ -342,12 +346,14 @@ private void onMultiUserRequestPerformed(AjaxRequestTarget target) { if (WebComponentUtil.isSuccessOrHandledError(result) || OperationResultStatus.IN_PROGRESS.equals(result.getStatus())) { clearStorage(); + result.setMessage(createStringResource("PageAssignmentsList.requestSuccess").getString()); setResponsePage(PageAssignmentShoppingCart.class); } else { - showResult(result); + result.setMessage(createStringResource("PageAssignmentsList.requestError").getString()); target.add(getFeedbackPanel()); target.add(PageAssignmentsList.this.get(ID_FORM)); } + showResult(result); } private void clearStorage(){ @@ -672,11 +678,9 @@ private Component getTargetUserSelectionButton(){ private String getTargetUserSelectionButtonLabel(List usersList){ if (usersList == null || usersList.size() == 0){ - StringBuilder sb = new StringBuilder(); - sb.append(createStringResource("AssignmentCatalogPanel.requestFor").getString()); - sb.append(" "); - sb.append(createStringResource("AssignmentCatalogPanel.requestForMe").getString()); - return sb.toString(); + String label = createStringResource("AssignmentCatalogPanel.requestFor", + createStringResource("AssignmentCatalogPanel.requestForMe").getString()).getString(); + return label; } else if (usersList.size() == 1){ String name = usersList.get(0).getName().getOrig(); return createStringResource("AssignmentCatalogPanel.requestFor", name).getString(); diff --git a/gui/admin-gui/src/main/resources/localization/Midpoint.properties b/gui/admin-gui/src/main/resources/localization/Midpoint.properties index 58d9443d467..9e238d690dd 100755 --- a/gui/admin-gui/src/main/resources/localization/Midpoint.properties +++ b/gui/admin-gui/src/main/resources/localization/Midpoint.properties @@ -3951,6 +3951,9 @@ AssignmentViewType.USER_TYPE=User's assignments PageAssignmentsList.requestButton = Request operation.com.evolveum.midpoint.web.page.self.PageAssignmentsList.requestAssignments=Request assignment com.evolveum.midpoint.web.page.self.PageAssignmentsList.requestAssignments=Request assignments +PageAssignmentsList.requestInProgress=Processing of your request is in progress. Your request may be subject to approval or other manual or asynchronous processing. Please allow sufficient time for the request to be processed. +PageAssignmentsList.requestSuccess=Your request has been processed. Assignments are ready to use. +PageAssignmentsList.requestError=There was an error processing your request. PageAssignmentsList.title=New assignments list PageAssignmentsList.assignmentsToRequest=Assignments to request PageAuditLogViewer.title=Audit Log Viewer From bc0266dfe0187021aeeac81c32b3f750ceb1f307 Mon Sep 17 00:00:00 2001 From: kate Date: Fri, 15 Feb 2019 11:29:40 +0100 Subject: [PATCH 033/224] MID-5029 Shopping cart - properties, 2x relation --- .../web/component/assignment/AssignmentEditorPanel.java | 9 ++++++++- .../web/component/input/RelationDropDownChoicePanel.java | 3 ++- .../web/page/self/AbstractShoppingCartTabPanel.html | 4 ++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/assignment/AssignmentEditorPanel.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/assignment/AssignmentEditorPanel.java index 430116a4a48..4a53f184e37 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/assignment/AssignmentEditorPanel.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/assignment/AssignmentEditorPanel.java @@ -73,6 +73,7 @@ import org.apache.wicket.markup.html.list.ListView; import org.apache.wicket.model.IModel; import org.apache.wicket.model.LoadableDetachableModel; +import org.apache.wicket.model.Model; import org.apache.wicket.model.PropertyModel; import org.apache.wicket.request.resource.PackageResourceReference; @@ -993,7 +994,13 @@ protected void onValueChanged(AjaxRequestTarget target){ ref.setRelation(getRelationValue()); } } - }; relationDropDown.setEnabled(getModel().getObject().isEditable()); + + @Override + protected IModel getRelationLabelModel(){ + return Model.of(); + } + }; + relationDropDown.setEnabled(getModel().getObject().isEditable()); relationDropDown.add(new VisibleEnableBehaviour() { private static final long serialVersionUID = 1L; diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/input/RelationDropDownChoicePanel.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/input/RelationDropDownChoicePanel.java index e3a39ea832e..ba38c290284 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/input/RelationDropDownChoicePanel.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/input/RelationDropDownChoicePanel.java @@ -78,7 +78,8 @@ protected void onInitialize(){ defaultRelation = supportedRelations.size() > 0 ? supportedRelations.get(0) : PrismConstants.Q_ANY; } DropDownFormGroup input = new DropDownFormGroup(ID_INPUT, Model.of(defaultRelation), new ListModel<>(supportedRelations), getRenderer(), - getRelationLabelModel(), "relationDropDownChoicePanel.tooltip.relation", true, "col-md-4", "col-md-8", !allowNull); + getRelationLabelModel(), "relationDropDownChoicePanel.tooltip.relation", true, "col-md-4", + getRelationLabelModel() == null || StringUtils.isEmpty(getRelationLabelModel().getObject()) ? "" : "col-md-8", !allowNull); input.getInput().add(new EmptyOnChangeAjaxFormUpdatingBehavior()); input.getInput().add(new OnChangeAjaxBehavior() { diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/self/AbstractShoppingCartTabPanel.html b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/self/AbstractShoppingCartTabPanel.html index 006271e1cbb..edf3961933f 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/self/AbstractShoppingCartTabPanel.html +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/self/AbstractShoppingCartTabPanel.html @@ -29,7 +29,7 @@
-
+
@@ -37,7 +37,7 @@
-
+
From db9db4effef612d2bfc64496a5d7c349e196e65f Mon Sep 17 00:00:00 2001 From: Pavol Mederly Date: Tue, 12 Feb 2019 07:45:10 +0100 Subject: [PATCH 034/224] Change Set to List to lower contention Lightweight asynchronous tasks are shared objects that hold their data in thread-unsafe prism objects. This is to be fixed somehow. Using HashSet structures makes this problem even worse because hashCode/equals are called repetitively in various threads that access those sets. So here we replace sets with lists to treat at least some of the concurrency issues (MID-5136). --- .../com/evolveum/midpoint/task/api/Task.java | 4 ++-- .../midpoint/task/api/TaskManager.java | 2 +- .../task/quartzimpl/TaskManagerQuartzImpl.java | 3 ++- .../task/quartzimpl/TaskQuartzImpl.java | 18 ++++++++++-------- .../quartzimpl/execution/ExecutionManager.java | 12 ++++++------ .../task/quartzimpl/execution/JobExecutor.java | 9 ++++++--- .../quartzimpl/execution/LocalNodeManager.java | 4 ++-- 7 files changed, 29 insertions(+), 23 deletions(-) diff --git a/repo/task-api/src/main/java/com/evolveum/midpoint/task/api/Task.java b/repo/task-api/src/main/java/com/evolveum/midpoint/task/api/Task.java index 396a1b13b64..ec36848290c 100644 --- a/repo/task-api/src/main/java/com/evolveum/midpoint/task/api/Task.java +++ b/repo/task-api/src/main/java/com/evolveum/midpoint/task/api/Task.java @@ -1018,9 +1018,9 @@ void savePendingModifications(OperationResult parentResult) throws ObjectNotFoun boolean isLightweightAsynchronousTask(); - Set getLightweightAsynchronousSubtasks(); + Collection getLightweightAsynchronousSubtasks(); - Set getRunningLightweightAsynchronousSubtasks(); + Collection getRunningLightweightAsynchronousSubtasks(); boolean lightweightHandlerStartRequested(); diff --git a/repo/task-api/src/main/java/com/evolveum/midpoint/task/api/TaskManager.java b/repo/task-api/src/main/java/com/evolveum/midpoint/task/api/TaskManager.java index 16e9970fbcb..6559752bc6f 100644 --- a/repo/task-api/src/main/java/com/evolveum/midpoint/task/api/TaskManager.java +++ b/repo/task-api/src/main/java/com/evolveum/midpoint/task/api/TaskManager.java @@ -357,7 +357,7 @@ void modifyTask(String oid, Collection modifications, Opera * * @return tasks that currently run on this node. */ - Set getLocallyRunningTasks(OperationResult parentResult); + Collection getLocallyRunningTasks(OperationResult parentResult); /** * Returns the local scheduler information. diff --git a/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/TaskManagerQuartzImpl.java b/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/TaskManagerQuartzImpl.java index d0924d92703..b282f67eefd 100644 --- a/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/TaskManagerQuartzImpl.java +++ b/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/TaskManagerQuartzImpl.java @@ -37,6 +37,7 @@ import com.evolveum.midpoint.prism.ItemDefinition; import com.evolveum.midpoint.prism.crypto.Protector; import com.evolveum.midpoint.prism.path.ItemPath; +import com.evolveum.midpoint.prism.util.CloneUtil; import com.evolveum.midpoint.repo.api.*; import com.evolveum.midpoint.schema.*; import com.evolveum.midpoint.task.api.*; @@ -1879,7 +1880,7 @@ public String getNodeId() { } @Override - public Set getLocallyRunningTasks(OperationResult parentResult) { + public Collection getLocallyRunningTasks(OperationResult parentResult) { return executionManager.getLocallyRunningTasks(parentResult); } diff --git a/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/TaskQuartzImpl.java b/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/TaskQuartzImpl.java index cd308ee7ea6..230aa765189 100644 --- a/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/TaskQuartzImpl.java +++ b/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/TaskQuartzImpl.java @@ -61,6 +61,7 @@ import javax.xml.datatype.XMLGregorianCalendar; import javax.xml.namespace.QName; import java.util.*; +import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.Future; import static com.evolveum.midpoint.prism.xml.XmlTypeConverter.createXMLGregorianCalendar; @@ -108,9 +109,9 @@ public class TaskQuartzImpl implements Task { * Lightweight asynchronous subtasks. * Each task here is a LAT, i.e. transient and with assigned lightweight handler. *

- * This must be synchronized, because interrupt() method uses it. + * This must be concurrent, because interrupt() method uses it. */ - private Set lightweightAsynchronousSubtasks = Collections.synchronizedSet(new HashSet<>()); + private Map lightweightAsynchronousSubtasks = new ConcurrentHashMap<>(); private Task parentForLightweightAsynchronousTask; // EXPERIMENTAL /* @@ -2588,7 +2589,8 @@ public Task createSubtask() { public Task createSubtask(LightweightTaskHandler handler) { TaskQuartzImpl sub = ((TaskQuartzImpl) createSubtask()); sub.setLightweightTaskHandler(handler); - lightweightAsynchronousSubtasks.add(sub); + assert sub.getTaskIdentifier() != null; + lightweightAsynchronousSubtasks.put(sub.getTaskIdentifier(), sub); sub.parentForLightweightAsynchronousTask = this; return sub; } @@ -2764,20 +2766,20 @@ public Future getLightweightHandlerFuture() { } @Override - public Set getLightweightAsynchronousSubtasks() { - return Collections.unmodifiableSet(lightweightAsynchronousSubtasks); + public Collection getLightweightAsynchronousSubtasks() { + return Collections.unmodifiableList(new ArrayList<>(lightweightAsynchronousSubtasks.values())); } @Override - public Set getRunningLightweightAsynchronousSubtasks() { + public Collection getRunningLightweightAsynchronousSubtasks() { // beware: Do not touch task prism here, because this method can be called asynchronously - Set retval = new HashSet<>(); + List retval = new ArrayList<>(); for (TaskQuartzImpl subtask : getLightweightAsynchronousSubtasks()) { if (subtask.getExecutionStatus() == TaskExecutionStatus.RUNNABLE && subtask.lightweightHandlerStartRequested()) { retval.add(subtask); } } - return Collections.unmodifiableSet(retval); + return Collections.unmodifiableList(retval); } @Override diff --git a/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/execution/ExecutionManager.java b/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/execution/ExecutionManager.java index 9e7c590ddc7..7f63a8ebf65 100644 --- a/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/execution/ExecutionManager.java +++ b/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/execution/ExecutionManager.java @@ -108,7 +108,7 @@ public boolean stopSchedulersAndTasks(Collection nodeIdentifiers, long t LOGGER.debug("{} task(s) found on nodes that are going down, stopping them.", taskInfoList.size()); - Set tasks = new HashSet<>(); + List tasks = new ArrayList<>(); for (ClusterStatusInformation.TaskInfo taskInfo : taskInfoList) { try { tasks.add(taskManager.getTask(taskInfo.getOid(), result)); @@ -225,7 +225,7 @@ public boolean stopAllTasksOnThisNodeAndWait(long timeToWait, OperationResult pa result.addParam("timeToWait", timeToWait); LOGGER.info("Stopping all tasks on local node"); - Set tasks = localNodeManager.getLocallyRunningTasks(result); + Collection tasks = localNodeManager.getLocallyRunningTasks(result); boolean retval = stopTasksRunAndWait(tasks, null, timeToWait, false, result); result.computeStatus(); return retval; @@ -544,7 +544,7 @@ public Set getLocallyRunningTasksOids(OperationResult parentResult) { return localNodeManager.getLocallyRunningTasksOids(parentResult); } - public Set getLocallyRunningTasks(OperationResult parentResult) { + public Collection getLocallyRunningTasks(OperationResult parentResult) { return localNodeManager.getLocallyRunningTasks(parentResult); } @@ -770,7 +770,7 @@ public Thread getTaskThread(String oid) { public String getRunningTasksThreadsDump(OperationResult parentResult) { OperationResult result = parentResult.createSubresult(ExecutionManager.DOT_CLASS + "getRunningTasksThreadsDump"); try { - Set locallyRunningTasks = taskManager.getLocallyRunningTasks(result); + Collection locallyRunningTasks = taskManager.getLocallyRunningTasks(result); StringBuilder output = new StringBuilder(); for (Task task : locallyRunningTasks) { try { @@ -791,7 +791,7 @@ public String getRunningTasksThreadsDump(OperationResult parentResult) { public String recordRunningTasksThreadsDump(String cause, OperationResult parentResult) throws ObjectAlreadyExistsException { OperationResult result = parentResult.createSubresult(ExecutionManager.DOT_CLASS + "recordRunningTasksThreadsDump"); try { - Set locallyRunningTasks = taskManager.getLocallyRunningTasks(result); + Collection locallyRunningTasks = taskManager.getLocallyRunningTasks(result); StringBuilder output = new StringBuilder(); for (Task task : locallyRunningTasks) { try { @@ -823,7 +823,7 @@ public String getTaskThreadsDump(String taskOid, OperationResult parentResult) } output.append("*** Root thread for task ").append(task).append(":\n\n"); addTaskInfo(output, localTask, rootThread); - for (Task subtask : new HashSet<>(localTask.getLightweightAsynchronousSubtasks())) { + for (Task subtask : localTask.getLightweightAsynchronousSubtasks()) { TaskQuartzImpl subtaskImpl = (TaskQuartzImpl) subtask; Thread thread = subtaskImpl.getLightweightThread(); output.append("** Information for lightweight asynchronous subtask ").append(subtask).append(":\n\n"); diff --git a/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/execution/JobExecutor.java b/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/execution/JobExecutor.java index 1ba335066d1..a23ed2175bd 100644 --- a/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/execution/JobExecutor.java +++ b/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/execution/JobExecutor.java @@ -54,6 +54,7 @@ import javax.xml.datatype.Duration; import java.util.*; +import java.util.Objects; @DisallowConcurrentExecution public class JobExecutor implements InterruptableJob { @@ -225,7 +226,7 @@ public void execute(JobExecutionContext context) throws JobExecutionException { static class GroupExecInfo { int limit; - Set tasks = new HashSet<>(); + Collection tasks = new ArrayList<>(); GroupExecInfo(Integer l) { limit = l != null ? l : Integer.MAX_VALUE; @@ -235,7 +236,9 @@ public void accept(Integer limit, Task task) { if (limit != null && limit < this.limit) { this.limit = limit; } - this.tasks.add(task); + if (tasks.stream().noneMatch(t -> Objects.equals(t.getOid(), task.getOid()))) { // just for sure + tasks.add(task); + } } @Override @@ -257,7 +260,7 @@ private boolean checkExecutionConstraints(TaskQuartzImpl task, OperationResult r for (Map.Entry entry : groupMap.entrySet()) { String group = entry.getKey(); int limit = entry.getValue().limit; - Set tasksInGroup = entry.getValue().tasks; + Collection tasksInGroup = entry.getValue().tasks; if (tasksInGroup.size() >= limit) { RescheduleTime rescheduleTime = getRescheduleTime(executionConstraints, DEFAULT_RESCHEDULE_TIME_FOR_GROUP_LIMIT, task.getNextRunStartTime(result)); diff --git a/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/execution/LocalNodeManager.java b/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/execution/LocalNodeManager.java index 07b4cbe0e4e..c9e4eade38c 100644 --- a/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/execution/LocalNodeManager.java +++ b/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/execution/LocalNodeManager.java @@ -484,11 +484,11 @@ Thread getLocalTaskThread(@NotNull String oid) { * * @return */ - Set getLocallyRunningTasks(OperationResult parentResult) { + Collection getLocallyRunningTasks(OperationResult parentResult) { OperationResult result = parentResult.createSubresult(LocalNodeManager.class.getName() + ".getLocallyRunningTasks"); - Set retval = new HashSet<>(); + List retval = new ArrayList<>(); for (String oid : getLocallyRunningTasksOids(result)) { OperationResult result1 = result.createSubresult(LocalNodeManager.class.getName() + ".getLocallyRunningTask"); From d9e4d229dd6dd62dab8c463ed7260f036d1d9191 Mon Sep 17 00:00:00 2001 From: Pavol Mederly Date: Thu, 14 Feb 2019 19:16:02 +0100 Subject: [PATCH 035/224] Make running tasks thread-safe by synchronization This is to resolve ConcurrentModificationExceptions (e.g. MID-5111, MID-5113, MID-4088, MID-3954, MID-5131, MID-5135). Features: 1) Methods of Task implementation are synchronized on various objects to ensure thread safety 2) RunningTask as a subtype of Task provides even more safety by cloning returned objects where appropriate Although the implementation is not 100% safe yet, it should be well enough for current state of midPoint code base. --- .../configuration/PageAdminConfiguration.java | 2 +- .../midpoint/prism/xml/XmlTypeConverter.java | 5 +- .../statistics/StatisticsCollector.java | 6 - .../AccCertTimedActionTriggerHandler.java | 3 +- ...tificationCampaignCreationTaskHandler.java | 2 +- ...tionCampaignReiterationTriggerHandler.java | 4 +- ...onCloseStageApproachingTriggerHandler.java | 4 +- ...CertificationCloseStageTriggerHandler.java | 4 +- ...AccessCertificationClosingTaskHandler.java | 6 +- ...ssCertificationRemediationTaskHandler.java | 2 +- .../midpoint/model/impl/ModelConstants.java | 9 +- .../impl/cleanup/CleanUpTaskHandler.java | 2 +- .../cleanup/ShadowRefreshTaskHandler.java | 7 +- .../controller/ExecuteDeltasTaskHandler.java | 2 +- .../controller/ModelOperationTaskHandler.java | 10 +- ...ImportAccountsFromResourceTaskHandler.java | 34 +- .../ImportObjectsFromFileTaskHandler.java | 5 +- .../ObjectIntegrityCheckResultHandler.java | 5 +- .../ObjectIntegrityCheckTaskHandler.java | 3 +- .../ShadowIntegrityCheckResultHandler.java | 5 +- .../ShadowIntegrityCheckTaskHandler.java | 3 +- .../model/impl/lens/AssignmentEvaluator.java | 3 +- .../midpoint/model/impl/lens/Clockwork.java | 17 +- .../impl/lens/OperationalDataManager.java | 4 +- .../impl/scripting/ExecutionContext.java | 3 +- .../IterativeScriptExecutionTaskHandler.java | 9 +- .../scripting/ScriptExecutionTaskHandler.java | 2 +- .../impl/sync/ExecuteChangesTaskHandler.java | 10 +- .../sync/FocusValidityScannerTaskHandler.java | 7 +- .../model/impl/sync/LiveSyncTaskHandler.java | 3 +- .../model/impl/sync/RecomputeTaskHandler.java | 10 +- .../impl/sync/ReconciliationTaskHandler.java | 33 +- .../impl/sync/SynchronizationContext.java | 3 +- .../sync/SynchronizeAccountResultHandler.java | 20 +- .../CompletedTaskCleanupTriggerHandler.java | 4 +- .../impl/trigger/RecomputeTriggerHandler.java | 6 +- .../model/impl/trigger/TriggerHandler.java | 4 +- .../trigger/TriggerScannerTaskHandler.java | 11 +- .../util/AbstractScannerResultHandler.java | 4 +- .../impl/util/AbstractScannerTaskHandler.java | 3 +- .../impl/util/AuditReindexTaskHandler.java | 6 +- .../model/impl/util/DeleteTaskHandler.java | 4 +- .../model/impl/util/ModelImplUtils.java | 44 +- .../model/impl/util/ReindexResultHandler.java | 5 +- .../model/impl/util/ReindexTaskHandler.java | 3 +- .../TestSemiManualGroupingProposed.java | 2 +- .../model/intest/util/MockTaskHandler.java | 10 +- .../model/intest/util/MockTriggerHandler.java | 4 +- .../report/impl/ReportCreateTaskHandler.java | 10 +- .../midpoint/report/TestReportJasper.java | 3 +- .../common/WfTimedActionTriggerHandler.java | 3 +- .../processes/itemApproval/MidpointUtil.java | 24 +- .../general/GeneralChangeProcessor.java | 2 +- .../WfPrepareChildOperationTaskHandler.java | 4 +- .../WfPrepareRootOperationTaskHandler.java | 2 +- ...opagateTaskObjectReferenceTaskHandler.java | 2 +- .../WfProcessInstanceShadowTaskHandler.java | 3 +- .../midpoint/wf/impl/tasks/WfTask.java | 10 +- .../wf/impl/tasks/WfTaskController.java | 2 +- .../midpoint/wf/impl/tasks/WfTaskUtil.java | 4 +- .../impl/ProvisioningServiceImpl.java | 7 +- .../provisioning/impl/ShadowCache.java | 27 +- .../task/MultiPropagationResultHandler.java | 5 +- .../task/MultiPropagationTaskHandler.java | 7 +- .../impl/task/PropagationResultHandler.java | 10 +- .../impl/task/PropagationTaskHandler.java | 7 +- .../impl/mock/SynchronizationServiceMock.java | 2 +- .../AbstractSearchIterativeResultHandler.java | 19 +- .../AbstractSearchIterativeTaskHandler.java | 12 +- .../repo/common/task/TaskHandlerUtil.java | 3 +- .../repo/sql/util/SimpleTaskAdapter.java | 299 +- .../task/api/LightweightTaskHandler.java | 2 +- .../midpoint/task/api/RunningTask.java | 102 + .../com/evolveum/midpoint/task/api/Task.java | 141 +- .../midpoint/task/api/TaskHandler.java | 2 +- .../midpoint/task/api/TaskManager.java | 11 +- .../task/api/WorkBucketAwareTaskHandler.java | 4 +- .../quartzimpl/InternalTaskInterface.java | 72 + .../quartzimpl/RunningTaskQuartzImpl.java | 266 ++ .../quartzimpl/TaskManagerQuartzImpl.java | 253 +- .../task/quartzimpl/TaskQuartzImpl.java | 2562 ++++++----------- .../task/quartzimpl/TaskQuartzImplUtil.java | 12 +- .../execution/ExecutionManager.java | 25 +- .../quartzimpl/execution/JobExecutor.java | 34 +- .../execution/StalledTasksWatcher.java | 6 +- .../execution/TaskSynchronizer.java | 12 +- .../handlers/JdbcPingTaskHandler.java | 6 +- .../quartzimpl/handlers/NoOpTaskHandler.java | 8 +- .../handlers/PartitioningTaskHandler.java | 25 +- .../WaitForSubtasksByPollingTaskHandler.java | 8 +- .../handlers/WaitForTasksTaskHandler.java | 2 +- .../handlers/WorkersCreationTaskHandler.java | 6 +- .../handlers/WorkersRestartTaskHandler.java | 2 +- .../quartzimpl/statistics/Statistics.java | 334 +++ .../quartzimpl/work/WorkStateManager.java | 32 +- .../work/workers/WorkersManager.java | 11 +- .../quartzimpl/AbstractTaskManagerTest.java | 2 +- .../midpoint/task/quartzimpl/CleanupTest.java | 2 +- .../task/quartzimpl/MockCycleTaskHandler.java | 9 +- .../task/quartzimpl/MockLongTaskHandler.java | 9 +- .../quartzimpl/MockParallelTaskHandler.java | 68 +- .../quartzimpl/MockSingleTaskHandler.java | 11 +- .../MockWorkBucketsTaskHandler.java | 4 +- .../TestQuartzTaskManagerContract.java | 85 +- .../task/quartzimpl/TestWorkDistribution.java | 40 +- .../basic/task-100LightweightSubtasks.xml | 2 +- 106 files changed, 2554 insertions(+), 2440 deletions(-) create mode 100644 repo/task-api/src/main/java/com/evolveum/midpoint/task/api/RunningTask.java create mode 100644 repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/InternalTaskInterface.java create mode 100644 repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/RunningTaskQuartzImpl.java create mode 100644 repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/statistics/Statistics.java diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/configuration/PageAdminConfiguration.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/configuration/PageAdminConfiguration.java index 349b2d966f6..e2f0316e248 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/configuration/PageAdminConfiguration.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/configuration/PageAdminConfiguration.java @@ -84,7 +84,7 @@ protected String deleteObjectsAsync(QName type, ObjectQuery objectQuery, boolean task.setExtensionProperty(rawProp); task.setName(taskName); - task.savePendingModifications(result); + task.flushPendingModifications(result); TaskManager taskManager = getTaskManager(); taskManager.switchToBackground(task, result); diff --git a/infra/prism-api/src/main/java/com/evolveum/midpoint/prism/xml/XmlTypeConverter.java b/infra/prism-api/src/main/java/com/evolveum/midpoint/prism/xml/XmlTypeConverter.java index 3d5fb4d344d..6b593549c04 100644 --- a/infra/prism-api/src/main/java/com/evolveum/midpoint/prism/xml/XmlTypeConverter.java +++ b/infra/prism-api/src/main/java/com/evolveum/midpoint/prism/xml/XmlTypeConverter.java @@ -117,7 +117,10 @@ private static boolean isMatchingType(Class expectedClass, Class actualCla return false; } - public static XMLGregorianCalendar createXMLGregorianCalendar(long timeInMillis) { + public static XMLGregorianCalendar createXMLGregorianCalendar(Long timeInMillis) { + if (timeInMillis == null) { + return null; + } GregorianCalendar gregorianCalendar = new GregorianCalendar(); gregorianCalendar.setTimeInMillis(timeInMillis); return createXMLGregorianCalendar(gregorianCalendar); diff --git a/infra/schema/src/main/java/com/evolveum/midpoint/schema/statistics/StatisticsCollector.java b/infra/schema/src/main/java/com/evolveum/midpoint/schema/statistics/StatisticsCollector.java index 7939eedbc42..e79eab6eac1 100644 --- a/infra/schema/src/main/java/com/evolveum/midpoint/schema/statistics/StatisticsCollector.java +++ b/infra/schema/src/main/java/com/evolveum/midpoint/schema/statistics/StatisticsCollector.java @@ -42,12 +42,6 @@ */ public interface StatisticsCollector { - /** - * Gets information from the current task and its transient subtasks (aka worker threads). - */ - - OperationStatsType getAggregatedLiveOperationStats(); - /** * Records various kinds of operational information. */ diff --git a/model/certification-impl/src/main/java/com/evolveum/midpoint/certification/impl/AccCertTimedActionTriggerHandler.java b/model/certification-impl/src/main/java/com/evolveum/midpoint/certification/impl/AccCertTimedActionTriggerHandler.java index bcf8a44ca77..03cd2266779 100644 --- a/model/certification-impl/src/main/java/com/evolveum/midpoint/certification/impl/AccCertTimedActionTriggerHandler.java +++ b/model/certification-impl/src/main/java/com/evolveum/midpoint/certification/impl/AccCertTimedActionTriggerHandler.java @@ -26,6 +26,7 @@ import com.evolveum.midpoint.schema.util.CertCampaignTypeUtil; import com.evolveum.midpoint.schema.util.ObjectTypeUtil; import com.evolveum.midpoint.schema.util.WfContextUtil; +import com.evolveum.midpoint.task.api.RunningTask; import com.evolveum.midpoint.task.api.Task; import com.evolveum.midpoint.util.exception.*; import com.evolveum.midpoint.util.logging.Trace; @@ -61,7 +62,7 @@ private void initialize() { } @Override - public void handle(PrismObject object, TriggerType trigger, Task triggerScannerTask, OperationResult parentResult) { + public void handle(PrismObject object, TriggerType trigger, RunningTask triggerScannerTask, OperationResult parentResult) { if (!(object.asObjectable() instanceof AccessCertificationCampaignType)) { throw new IllegalArgumentException("Unexpected object type: should be AccessCertificationCampaignType: " + object); } diff --git a/model/certification-impl/src/main/java/com/evolveum/midpoint/certification/impl/AccessCertificationCampaignCreationTaskHandler.java b/model/certification-impl/src/main/java/com/evolveum/midpoint/certification/impl/AccessCertificationCampaignCreationTaskHandler.java index e0357befe23..f9f83d71a25 100644 --- a/model/certification-impl/src/main/java/com/evolveum/midpoint/certification/impl/AccessCertificationCampaignCreationTaskHandler.java +++ b/model/certification-impl/src/main/java/com/evolveum/midpoint/certification/impl/AccessCertificationCampaignCreationTaskHandler.java @@ -61,7 +61,7 @@ public StatisticsCollectionStrategy getStatisticsCollectionStrategy() { } @Override - public TaskRunResult run(Task task) { + public TaskRunResult run(RunningTask task) { LOGGER.trace("Task run starting"); OperationResult opResult = new OperationResult(CLASS_DOT+"run"); diff --git a/model/certification-impl/src/main/java/com/evolveum/midpoint/certification/impl/AccessCertificationCampaignReiterationTriggerHandler.java b/model/certification-impl/src/main/java/com/evolveum/midpoint/certification/impl/AccessCertificationCampaignReiterationTriggerHandler.java index ff2492f0c79..d63915b384c 100644 --- a/model/certification-impl/src/main/java/com/evolveum/midpoint/certification/impl/AccessCertificationCampaignReiterationTriggerHandler.java +++ b/model/certification-impl/src/main/java/com/evolveum/midpoint/certification/impl/AccessCertificationCampaignReiterationTriggerHandler.java @@ -22,7 +22,7 @@ import com.evolveum.midpoint.schema.result.OperationResult; import com.evolveum.midpoint.schema.util.CertCampaignTypeUtil; import com.evolveum.midpoint.schema.util.ObjectTypeUtil; -import com.evolveum.midpoint.task.api.Task; +import com.evolveum.midpoint.task.api.RunningTask; import com.evolveum.midpoint.util.exception.CommonException; import com.evolveum.midpoint.util.exception.SystemException; import com.evolveum.midpoint.util.logging.LoggingUtils; @@ -56,7 +56,7 @@ private void initialize() { } @Override - public void handle(PrismObject prismObject, TriggerType trigger, Task task, OperationResult result) { + public void handle(PrismObject prismObject, TriggerType trigger, RunningTask task, OperationResult result) { try { ObjectType object = prismObject.asObjectable(); if (!(object instanceof AccessCertificationCampaignType)) { diff --git a/model/certification-impl/src/main/java/com/evolveum/midpoint/certification/impl/AccessCertificationCloseStageApproachingTriggerHandler.java b/model/certification-impl/src/main/java/com/evolveum/midpoint/certification/impl/AccessCertificationCloseStageApproachingTriggerHandler.java index 9098aaabc00..8526f8466f2 100644 --- a/model/certification-impl/src/main/java/com/evolveum/midpoint/certification/impl/AccessCertificationCloseStageApproachingTriggerHandler.java +++ b/model/certification-impl/src/main/java/com/evolveum/midpoint/certification/impl/AccessCertificationCloseStageApproachingTriggerHandler.java @@ -23,7 +23,7 @@ import com.evolveum.midpoint.schema.result.OperationResult; import com.evolveum.midpoint.schema.util.CertCampaignTypeUtil; import com.evolveum.midpoint.schema.util.ObjectTypeUtil; -import com.evolveum.midpoint.task.api.Task; +import com.evolveum.midpoint.task.api.RunningTask; import com.evolveum.midpoint.util.exception.*; import com.evolveum.midpoint.util.logging.LoggingUtils; import com.evolveum.midpoint.util.logging.Trace; @@ -60,7 +60,7 @@ private void initialize() { } @Override - public void handle(PrismObject prismObject, TriggerType trigger, Task task, OperationResult result) { + public void handle(PrismObject prismObject, TriggerType trigger, RunningTask task, OperationResult result) { try { ObjectType object = prismObject.asObjectable(); if (!(object instanceof AccessCertificationCampaignType)) { diff --git a/model/certification-impl/src/main/java/com/evolveum/midpoint/certification/impl/AccessCertificationCloseStageTriggerHandler.java b/model/certification-impl/src/main/java/com/evolveum/midpoint/certification/impl/AccessCertificationCloseStageTriggerHandler.java index ca0a9b60f4e..611399cd4e1 100644 --- a/model/certification-impl/src/main/java/com/evolveum/midpoint/certification/impl/AccessCertificationCloseStageTriggerHandler.java +++ b/model/certification-impl/src/main/java/com/evolveum/midpoint/certification/impl/AccessCertificationCloseStageTriggerHandler.java @@ -22,7 +22,7 @@ import com.evolveum.midpoint.schema.result.OperationResult; import com.evolveum.midpoint.schema.util.CertCampaignTypeUtil; import com.evolveum.midpoint.schema.util.ObjectTypeUtil; -import com.evolveum.midpoint.task.api.Task; +import com.evolveum.midpoint.task.api.RunningTask; import com.evolveum.midpoint.util.exception.*; import com.evolveum.midpoint.util.logging.LoggingUtils; import com.evolveum.midpoint.util.logging.Trace; @@ -57,7 +57,7 @@ private void initialize() { } @Override - public void handle(PrismObject prismObject, TriggerType trigger, Task task, OperationResult result) { + public void handle(PrismObject prismObject, TriggerType trigger, RunningTask task, OperationResult result) { try { ObjectType object = prismObject.asObjectable(); if (!(object instanceof AccessCertificationCampaignType)) { diff --git a/model/certification-impl/src/main/java/com/evolveum/midpoint/certification/impl/AccessCertificationClosingTaskHandler.java b/model/certification-impl/src/main/java/com/evolveum/midpoint/certification/impl/AccessCertificationClosingTaskHandler.java index c9c662ad02c..04bcef004ab 100644 --- a/model/certification-impl/src/main/java/com/evolveum/midpoint/certification/impl/AccessCertificationClosingTaskHandler.java +++ b/model/certification-impl/src/main/java/com/evolveum/midpoint/certification/impl/AccessCertificationClosingTaskHandler.java @@ -90,7 +90,7 @@ public StatisticsCollectionStrategy getStatisticsCollectionStrategy() { } @Override - public TaskRunResult run(Task task) { + public TaskRunResult run(RunningTask task) { LOGGER.info("Task run starting"); OperationResult opResult = new OperationResult(CLASS_DOT+"run"); @@ -285,11 +285,11 @@ private static class ObjectContext { } private static class RunContext { - final Task task; + final RunningTask task; final Map objectContextMap = new HashMap<>(); final PerformerCommentsFormatter commentsFormatter; - RunContext(Task task, PerformerCommentsFormatter commentsFormatter) { + RunContext(RunningTask task, PerformerCommentsFormatter commentsFormatter) { this.task = task; this.commentsFormatter = commentsFormatter; } diff --git a/model/certification-impl/src/main/java/com/evolveum/midpoint/certification/impl/AccessCertificationRemediationTaskHandler.java b/model/certification-impl/src/main/java/com/evolveum/midpoint/certification/impl/AccessCertificationRemediationTaskHandler.java index e8d5e21969b..e5d9c57ad37 100644 --- a/model/certification-impl/src/main/java/com/evolveum/midpoint/certification/impl/AccessCertificationRemediationTaskHandler.java +++ b/model/certification-impl/src/main/java/com/evolveum/midpoint/certification/impl/AccessCertificationRemediationTaskHandler.java @@ -83,7 +83,7 @@ public StatisticsCollectionStrategy getStatisticsCollectionStrategy() { } @Override - public TaskRunResult run(Task task) { + public TaskRunResult run(RunningTask task) { LOGGER.trace("Task run starting"); OperationResult opResult = new OperationResult(CLASS_DOT+"run"); diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/ModelConstants.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/ModelConstants.java index 4cb73446db6..d96274aea09 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/ModelConstants.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/ModelConstants.java @@ -18,6 +18,7 @@ import javax.xml.namespace.QName; import com.evolveum.midpoint.model.api.ModelPublicConstants; +import com.evolveum.midpoint.prism.path.ItemName; import com.evolveum.midpoint.schema.constants.SchemaConstants; /** @@ -35,13 +36,13 @@ public class ModelConstants { public static final String NS_EXTENSION = SchemaConstants.NS_MODEL + "/extension-3"; - public static final QName OBJECTCLASS_PROPERTY_NAME = new QName(ModelConstants.NS_EXTENSION, "objectclass"); + public static final ItemName OBJECTCLASS_PROPERTY_NAME = new ItemName(ModelConstants.NS_EXTENSION, "objectclass"); - public static final QName KIND_PROPERTY_NAME = new QName(ModelConstants.NS_EXTENSION, "kind"); + public static final ItemName KIND_PROPERTY_NAME = new ItemName(ModelConstants.NS_EXTENSION, "kind"); - public static final QName INTENT_PROPERTY_NAME = new QName(ModelConstants.NS_EXTENSION, "intent"); + public static final ItemName INTENT_PROPERTY_NAME = new ItemName(ModelConstants.NS_EXTENSION, "intent"); - public static final QName FILENAME_PROPERTY_NAME = new QName(ModelConstants.NS_EXTENSION, "filename"); + public static final ItemName FILENAME_PROPERTY_NAME = new ItemName(ModelConstants.NS_EXTENSION, "filename"); } diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/cleanup/CleanUpTaskHandler.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/cleanup/CleanUpTaskHandler.java index 02dda5f6e61..01654039b3a 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/cleanup/CleanUpTaskHandler.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/cleanup/CleanUpTaskHandler.java @@ -72,7 +72,7 @@ public StatisticsCollectionStrategy getStatisticsCollectionStrategy() { } @Override - public TaskRunResult run(Task task) { + public TaskRunResult run(RunningTask task) { LOGGER.trace("CleanUpTaskHandler.run starting"); OperationResult opResult = new OperationResult(OperationConstants.CLEANUP); diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/cleanup/ShadowRefreshTaskHandler.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/cleanup/ShadowRefreshTaskHandler.java index 45969bed632..b5621da3202 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/cleanup/ShadowRefreshTaskHandler.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/cleanup/ShadowRefreshTaskHandler.java @@ -17,6 +17,7 @@ import javax.annotation.PostConstruct; +import com.evolveum.midpoint.task.api.RunningTask; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @@ -89,19 +90,19 @@ protected ObjectQuery createQuery(AbstractScannerResultHandler handl } @Override - protected void finish(AbstractScannerResultHandler handler, TaskRunResult runResult, Task task, OperationResult opResult) + protected void finish(AbstractScannerResultHandler handler, TaskRunResult runResult, RunningTask task, OperationResult opResult) throws SchemaException { super.finish(handler, runResult, task, opResult); } @Override - protected AbstractScannerResultHandler createHandler(TaskRunResult runResult, final Task coordinatorTask, + protected AbstractScannerResultHandler createHandler(TaskRunResult runResult, final RunningTask coordinatorTask, OperationResult opResult) { AbstractScannerResultHandler handler = new AbstractScannerResultHandler( coordinatorTask, ShadowRefreshTaskHandler.class.getName(), "shadowRefresh", "shadow refresh task", taskManager) { @Override - protected boolean handleObject(PrismObject object, Task workerTask, OperationResult result) throws CommonException { + protected boolean handleObject(PrismObject object, RunningTask workerTask, OperationResult result) throws CommonException { LOGGER.trace("Refreshing {}", object); provisioningService.refreshShadow(object, null, workerTask, result); diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/controller/ExecuteDeltasTaskHandler.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/controller/ExecuteDeltasTaskHandler.java index 1b624125fa8..84fbad6cb77 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/controller/ExecuteDeltasTaskHandler.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/controller/ExecuteDeltasTaskHandler.java @@ -57,7 +57,7 @@ public class ExecuteDeltasTaskHandler implements TaskHandler { @Autowired private ModelService modelService; @Override - public TaskRunResult run(Task task) { + public TaskRunResult run(RunningTask task) { OperationResult result = task.getResult().createSubresult(DOT_CLASS + "run"); TaskRunResult runResult = new TaskRunResult(); diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/controller/ModelOperationTaskHandler.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/controller/ModelOperationTaskHandler.java index 626ee63e626..e785cf9105e 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/controller/ModelOperationTaskHandler.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/controller/ModelOperationTaskHandler.java @@ -25,11 +25,7 @@ import com.evolveum.midpoint.provisioning.api.ProvisioningService; import com.evolveum.midpoint.repo.api.PreconditionViolationException; import com.evolveum.midpoint.schema.result.OperationResult; -import com.evolveum.midpoint.task.api.Task; -import com.evolveum.midpoint.task.api.TaskCategory; -import com.evolveum.midpoint.task.api.TaskHandler; -import com.evolveum.midpoint.task.api.TaskManager; -import com.evolveum.midpoint.task.api.TaskRunResult; +import com.evolveum.midpoint.task.api.*; import com.evolveum.midpoint.util.exception.*; import com.evolveum.midpoint.util.logging.LoggingUtils; import com.evolveum.midpoint.util.logging.Trace; @@ -67,7 +63,7 @@ public class ModelOperationTaskHandler implements TaskHandler { @Autowired private Clockwork clockwork; @Override - public TaskRunResult run(Task task) { + public TaskRunResult run(RunningTask task) { OperationResult result = task.getResult().createSubresult(DOT_CLASS + "run"); TaskRunResult runResult = new TaskRunResult(); @@ -116,7 +112,7 @@ public TaskRunResult run(Task task) { clockwork.run(context, task, result); task.setModelOperationContext(context.toLensContextType(context.getState() == ModelState.FINAL)); - task.savePendingModifications(result); + task.flushPendingModifications(result); if (result.isUnknown()) { result.computeStatus(); diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/importer/ImportAccountsFromResourceTaskHandler.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/importer/ImportAccountsFromResourceTaskHandler.java index 5a82038ee90..9e60fcdba5d 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/importer/ImportAccountsFromResourceTaskHandler.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/importer/ImportAccountsFromResourceTaskHandler.java @@ -23,7 +23,9 @@ import com.evolveum.midpoint.common.refinery.RefinedResourceSchemaImpl; import com.evolveum.midpoint.prism.*; import com.evolveum.midpoint.prism.path.ItemPath; +import com.evolveum.midpoint.task.api.*; import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @@ -37,7 +39,6 @@ import com.evolveum.midpoint.provisioning.api.ChangeNotificationDispatcher; import com.evolveum.midpoint.provisioning.api.ProvisioningService; import com.evolveum.midpoint.provisioning.api.ResourceObjectChangeListener; -import com.evolveum.midpoint.repo.common.CounterManager; import com.evolveum.midpoint.schema.constants.SchemaConstants; import com.evolveum.midpoint.schema.processor.ObjectClassComplexTypeDefinition; import com.evolveum.midpoint.schema.result.OperationConstants; @@ -45,11 +46,6 @@ import com.evolveum.midpoint.schema.util.ObjectQueryUtil; import com.evolveum.midpoint.schema.util.ObjectTypeUtil; import com.evolveum.midpoint.schema.util.ShadowUtil; -import com.evolveum.midpoint.task.api.Task; -import com.evolveum.midpoint.task.api.TaskCategory; -import com.evolveum.midpoint.task.api.TaskHandler; -import com.evolveum.midpoint.task.api.TaskManager; -import com.evolveum.midpoint.task.api.TaskRunResult; import com.evolveum.midpoint.task.api.TaskRunResult.TaskRunResultStatus; import com.evolveum.midpoint.util.DOMUtil; import com.evolveum.midpoint.util.exception.CommunicationException; @@ -147,7 +143,7 @@ public void launch(ResourceType resource, QName objectclass, Task task, Operatio PrismProperty objectclassProp = objectclassPropertyDefinition.instantiate(); objectclassProp.setRealValue(objectclass); task.setExtensionProperty(objectclassProp); - task.savePendingModifications(result); // just to be sure (if the task was already persistent) + task.flushPendingModifications(result); // just to be sure (if the task was already persistent) // task.modify(modifications, result); } catch (ObjectNotFoundException e) { LOGGER.error("Task object not found, expecting it to exist (task {})", task, e); @@ -174,7 +170,7 @@ public void launch(ResourceType resource, QName objectclass, Task task, Operatio } @Override - protected SynchronizeAccountResultHandler createHandler(TaskRunResult runResult, Task coordinatorTask, + protected SynchronizeAccountResultHandler createHandler(TaskRunResult runResult, RunningTask coordinatorTask, OperationResult opResult) { ResourceType resource = resolveObjectRef(ResourceType.class, runResult, coordinatorTask, opResult); @@ -182,18 +178,25 @@ protected SynchronizeAccountResultHandler createHandler(TaskRunResult runResult, return null; } - return createHandler(resource, null, runResult, coordinatorTask, opResult); + ObjectClassComplexTypeDefinition objectClass = determineObjectClassDefinition(resource, null, runResult, coordinatorTask, opResult); + if (objectClass == null) { + return null; + } + return createHandler(resource, objectClass, coordinatorTask); } // shadowToImport - it is used to derive objectClass/intent/kind when importing a single shadow - private SynchronizeAccountResultHandler createHandler(ResourceType resource, PrismObject shadowToImport, - TaskRunResult runResult, Task coordinatorTask, OperationResult opResult) { - - ObjectClassComplexTypeDefinition objectClass = determineObjectClassDefinition(resource, shadowToImport, runResult, coordinatorTask, opResult); + private SynchronizeAccountResultHandler createHandlerForSingleShadow(@NotNull ResourceType resource, @NotNull PrismObject shadowToImport, + TaskRunResult runResult, RunningTask task, OperationResult opResult) { + ObjectClassComplexTypeDefinition objectClass = determineObjectClassDefinition(resource, shadowToImport, runResult, task, opResult); if (objectClass == null) { return null; } + return createHandler(resource, objectClass, task); + } + private SynchronizeAccountResultHandler createHandler(@NotNull ResourceType resource, @NotNull ObjectClassComplexTypeDefinition objectClass, + RunningTask coordinatorTask) { LOGGER.info("Start executing import from resource {}, importing object class {}", resource, objectClass.getTypeName()); SynchronizeAccountResultHandler handler = new SynchronizeAccountResultHandler(resource, objectClass, "import", @@ -299,7 +302,8 @@ public boolean importSingleShadow(String shadowOid, Task task, OperationResult p // Create a result handler just for one object. Invoke the handle() method manually. TaskRunResult runResult = new TaskRunResult(); - SynchronizeAccountResultHandler resultHandler = createHandler(resource.asObjectable(), shadow, runResult, task, parentResult); + RunningTask fakeRunningTask = taskManager.createFakeRunningTask(task); + SynchronizeAccountResultHandler resultHandler = createHandlerForSingleShadow(resource.asObjectable(), shadow, runResult, fakeRunningTask, parentResult); if (resultHandler == null) { return false; } @@ -316,7 +320,7 @@ public boolean importSingleShadow(String shadowOid, Task task, OperationResult p return false; } - finish(resultHandler, runResult, task, parentResult); + finish(resultHandler, runResult, fakeRunningTask, parentResult); return true; } diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/importer/ImportObjectsFromFileTaskHandler.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/importer/ImportObjectsFromFileTaskHandler.java index 0d2996e0130..9318083ddeb 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/importer/ImportObjectsFromFileTaskHandler.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/importer/ImportObjectsFromFileTaskHandler.java @@ -40,7 +40,6 @@ import javax.annotation.PostConstruct; import java.io.File; -import java.util.List; /** * Task handler for "Import objects from file" task. @@ -121,7 +120,7 @@ public void launch(File input, Task task, OperationResult parentResult) { PrismProperty filenameProp = filenamePropertyDefinition.instantiate(); filenameProp.setRealValue(input.getAbsolutePath()); task.setExtensionProperty(filenameProp); - task.savePendingModifications(result); + task.flushPendingModifications(result); // task.modify(modifications, result); } catch (ObjectNotFoundException e) { LOGGER.error("Task object not found, expecting it to exist (task {})", task, e); @@ -150,7 +149,7 @@ public void launch(File input, Task task, OperationResult parentResult) { * The body of the task. This will start the import "loop". */ @Override - public TaskRunResult run(Task task) { + public TaskRunResult run(RunningTask task) { LOGGER.debug("Import objects from file run (task {})", task); diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/integrity/ObjectIntegrityCheckResultHandler.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/integrity/ObjectIntegrityCheckResultHandler.java index ce844692101..efdfed3c075 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/integrity/ObjectIntegrityCheckResultHandler.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/integrity/ObjectIntegrityCheckResultHandler.java @@ -23,6 +23,7 @@ import com.evolveum.midpoint.repo.common.task.AbstractSearchIterativeResultHandler; import com.evolveum.midpoint.schema.result.OperationResult; import com.evolveum.midpoint.schema.util.ObjectTypeUtil; +import com.evolveum.midpoint.task.api.RunningTask; import com.evolveum.midpoint.task.api.Task; import com.evolveum.midpoint.task.api.TaskManager; import com.evolveum.midpoint.util.exception.CommonException; @@ -49,7 +50,7 @@ public class ObjectIntegrityCheckResultHandler extends AbstractSearchIterativeRe private ObjectStatistics statistics = new ObjectStatistics(); - public ObjectIntegrityCheckResultHandler(Task coordinatorTask, String taskOperationPrefix, String processShortName, + public ObjectIntegrityCheckResultHandler(RunningTask coordinatorTask, String taskOperationPrefix, String processShortName, String contextDesc, TaskManager taskManager, PrismContext prismContext, RepositoryService repositoryService, SystemObjectCache systemObjectCache, OperationResult result) { super(coordinatorTask, taskOperationPrefix, processShortName, contextDesc, taskManager); @@ -72,7 +73,7 @@ private void logConfiguration(String state) { } @Override - protected boolean handleObject(PrismObject object, Task workerTask, OperationResult parentResult) throws CommonException { + protected boolean handleObject(PrismObject object, RunningTask workerTask, OperationResult parentResult) throws CommonException { OperationResult result = parentResult.createMinorSubresult(CLASS_DOT + "handleObject"); try { statistics.record(object); diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/integrity/ObjectIntegrityCheckTaskHandler.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/integrity/ObjectIntegrityCheckTaskHandler.java index 20dfa935749..5afb2ad0436 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/integrity/ObjectIntegrityCheckTaskHandler.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/integrity/ObjectIntegrityCheckTaskHandler.java @@ -24,6 +24,7 @@ import com.evolveum.midpoint.schema.SelectorOptions; import com.evolveum.midpoint.schema.result.OperationConstants; import com.evolveum.midpoint.schema.result.OperationResult; +import com.evolveum.midpoint.task.api.RunningTask; import com.evolveum.midpoint.task.api.Task; import com.evolveum.midpoint.task.api.TaskCategory; import com.evolveum.midpoint.task.api.TaskRunResult; @@ -72,7 +73,7 @@ private void initialize() { } @Override - protected ObjectIntegrityCheckResultHandler createHandler(TaskRunResult runResult, Task coordinatorTask, OperationResult opResult) { + protected ObjectIntegrityCheckResultHandler createHandler(TaskRunResult runResult, RunningTask coordinatorTask, OperationResult opResult) { return new ObjectIntegrityCheckResultHandler(coordinatorTask, ObjectIntegrityCheckTaskHandler.class.getName(), "check object integrity", "check object integrity", taskManager, prismContext, repositoryService, systemObjectCache, opResult); diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/integrity/ShadowIntegrityCheckResultHandler.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/integrity/ShadowIntegrityCheckResultHandler.java index 3120540d1fa..901c35971c8 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/integrity/ShadowIntegrityCheckResultHandler.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/integrity/ShadowIntegrityCheckResultHandler.java @@ -39,6 +39,7 @@ import com.evolveum.midpoint.schema.constants.SchemaConstants; import com.evolveum.midpoint.schema.result.OperationResult; import com.evolveum.midpoint.schema.util.ObjectTypeUtil; +import com.evolveum.midpoint.task.api.RunningTask; import com.evolveum.midpoint.task.api.Task; import com.evolveum.midpoint.task.api.TaskManager; import com.evolveum.midpoint.util.DebugUtil; @@ -109,7 +110,7 @@ public class ShadowIntegrityCheckResultHandler extends AbstractSearchIterativeRe private Set duplicateShadowsDetected = new HashSet<>(); private Set duplicateShadowsDeleted = new HashSet<>(); - public ShadowIntegrityCheckResultHandler(Task coordinatorTask, String taskOperationPrefix, String processShortName, + public ShadowIntegrityCheckResultHandler(RunningTask coordinatorTask, String taskOperationPrefix, String processShortName, String contextDesc, TaskManager taskManager, PrismContext prismContext, ProvisioningService provisioningService, MatchingRuleRegistry matchingRuleRegistry, RepositoryService repositoryService, SynchronizationService synchronizationService, @@ -245,7 +246,7 @@ private boolean contains(PrismProperty property, String keyword) { } @Override - protected boolean handleObject(PrismObject shadow, Task workerTask, OperationResult parentResult) throws CommonException { + protected boolean handleObject(PrismObject shadow, RunningTask workerTask, OperationResult parentResult) throws CommonException { OperationResult result = parentResult.createMinorSubresult(CLASS_DOT + "handleObject"); ShadowCheckResult checkResult = new ShadowCheckResult(shadow); try { diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/integrity/ShadowIntegrityCheckTaskHandler.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/integrity/ShadowIntegrityCheckTaskHandler.java index a5e532c6992..74a54cc5bc0 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/integrity/ShadowIntegrityCheckTaskHandler.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/integrity/ShadowIntegrityCheckTaskHandler.java @@ -24,6 +24,7 @@ import com.evolveum.midpoint.provisioning.api.ProvisioningService; import com.evolveum.midpoint.schema.result.OperationConstants; import com.evolveum.midpoint.schema.result.OperationResult; +import com.evolveum.midpoint.task.api.RunningTask; import com.evolveum.midpoint.task.api.Task; import com.evolveum.midpoint.task.api.TaskCategory; import com.evolveum.midpoint.task.api.TaskRunResult; @@ -89,7 +90,7 @@ private void initialize() { } @Override - protected ShadowIntegrityCheckResultHandler createHandler(TaskRunResult runResult, Task coordinatorTask, OperationResult opResult) { + protected ShadowIntegrityCheckResultHandler createHandler(TaskRunResult runResult, RunningTask coordinatorTask, OperationResult opResult) { return new ShadowIntegrityCheckResultHandler(coordinatorTask, ShadowIntegrityCheckTaskHandler.class.getName(), "check shadow integrity", "check shadow integrity", taskManager, prismContext, provisioningService, matchingRuleRegistry, repositoryService, synchronizationService, systemObjectCache, opResult); diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/AssignmentEvaluator.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/AssignmentEvaluator.java index a7f44723575..aee7a0bfb57 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/AssignmentEvaluator.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/AssignmentEvaluator.java @@ -372,8 +372,7 @@ private boolean isVirtualAssignment(AssignmentPathS LOGGER.error("Cannot search for forced roles", e); } - Collection taskAssignments = ctx.task.getTaskType().getAssignment(); - for (AssignmentType taskAssignment : taskAssignments) { + for (AssignmentType taskAssignment : ctx.task.getAssignments()) { try { forcedRoles.add(objectResolver.resolve(taskAssignment.getTargetRef(), getPrismContext().getSchemaRegistry().determineClassForType(taskAssignment.getTargetRef().getType()), null, " resolve task assignemnts ", ctx.task, ctx.result)); diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/Clockwork.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/Clockwork.java index b60ce9a408f..e1a2b41fe8a 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/Clockwork.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/Clockwork.java @@ -26,15 +26,14 @@ import java.util.Collection; import java.util.Comparator; import java.util.Date; -import java.util.HashMap; import java.util.Iterator; import java.util.List; -import java.util.Map; import javax.xml.datatype.XMLGregorianCalendar; import javax.xml.namespace.QName; import com.evolveum.midpoint.prism.*; +import com.evolveum.midpoint.task.api.*; import org.apache.commons.lang.StringUtils; import org.apache.commons.lang3.Validate; import org.jetbrains.annotations.NotNull; @@ -50,7 +49,6 @@ import com.evolveum.midpoint.model.api.ModelExecuteOptions; import com.evolveum.midpoint.model.api.ProgressInformation; import com.evolveum.midpoint.model.api.ProgressListener; -import com.evolveum.midpoint.model.api.context.ModelContext; import com.evolveum.midpoint.model.api.context.ModelState; import com.evolveum.midpoint.model.api.hooks.ChangeHook; import com.evolveum.midpoint.model.api.hooks.HookOperationMode; @@ -80,8 +78,6 @@ import com.evolveum.midpoint.repo.api.ConflictWatcher; import com.evolveum.midpoint.repo.api.PreconditionViolationException; import com.evolveum.midpoint.repo.api.RepositoryService; -import com.evolveum.midpoint.repo.cache.RepositoryCache; -import com.evolveum.midpoint.repo.common.CounterManager; import com.evolveum.midpoint.repo.common.expression.ExpressionFactory; import com.evolveum.midpoint.repo.common.expression.ExpressionVariables; import com.evolveum.midpoint.schema.ObjectDeltaOperation; @@ -93,11 +89,6 @@ import com.evolveum.midpoint.schema.result.OperationResultStatus; import com.evolveum.midpoint.schema.util.ObjectTypeUtil; import com.evolveum.midpoint.schema.util.SystemConfigurationTypeUtil; -import com.evolveum.midpoint.task.api.Task; -import com.evolveum.midpoint.task.api.TaskBinding; -import com.evolveum.midpoint.task.api.TaskCategory; -import com.evolveum.midpoint.task.api.TaskExecutionStatus; -import com.evolveum.midpoint.task.api.TaskManager; import com.evolveum.midpoint.util.DebugUtil; import com.evolveum.midpoint.util.Holder; import com.evolveum.midpoint.util.exception.CommunicationException; @@ -989,11 +980,11 @@ private void storeOperationExecution(@NotNull PrismObject private void setOperationContext(OperationExecutionType operation, OperationResultStatusType overallStatus, XMLGregorianCalendar now, String channel, Task task) { - if (task.getParentForLightweightAsynchronousTask() != null) { - task = task.getParentForLightweightAsynchronousTask(); + if (task instanceof RunningTask && ((RunningTask) task).getParentForLightweightAsynchronousTask() != null) { + task = ((RunningTask) task).getParentForLightweightAsynchronousTask(); } if (task.isPersistent()) { - operation.setTaskRef(ObjectTypeUtil.createObjectRef(task.getTaskPrismObject(), prismContext)); + operation.setTaskRef(task.getSelfReference()); } operation.setStatus(overallStatus); operation.setInitiatorRef(ObjectTypeUtil.createObjectRef(task.getOwner(), prismContext)); // TODO what if the real initiator is different? (e.g. when executing approved changes) diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/OperationalDataManager.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/OperationalDataManager.java index 55a2ce0d692..f4076c2c8ce 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/OperationalDataManager.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/OperationalDataManager.java @@ -247,7 +247,7 @@ private void applyCreateMetadata(LensContext context, if (task.getOwner() != null) { metaData.setCreatorRef(createObjectRef(task.getOwner(), prismContext)); } - metaData.setCreateTaskRef(task.getOid() != null ? createObjectRef(task.getTaskPrismObject(), prismContext) : null); + metaData.setCreateTaskRef(task.getOid() != null ? task.getSelfReference() : null); } public Collection> createModifyMetadataDeltas(LensContext context, @@ -257,7 +257,7 @@ public Collection> c .item(metadataPath.append(MetadataType.F_MODIFY_TIMESTAMP)).replace(now) .item(metadataPath.append(MetadataType.F_MODIFIER_REF)).replace(createObjectRef(task.getOwner(), prismContext)) .item(metadataPath.append(MetadataType.F_MODIFY_TASK_REF)).replaceRealValues( - task.getOid() != null ? singleton(createObjectRef(task.getTaskPrismObject(), prismContext)) : emptySet()) + task.getOid() != null ? singleton(task.getSelfReference()) : emptySet()) .asItemDeltas(); } diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/scripting/ExecutionContext.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/scripting/ExecutionContext.java index c951e9e5160..2fd69ebe296 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/scripting/ExecutionContext.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/scripting/ExecutionContext.java @@ -21,6 +21,7 @@ import com.evolveum.midpoint.model.api.ScriptExecutionResult; import com.evolveum.midpoint.prism.PrismContext; import com.evolveum.midpoint.prism.query.QueryConverter; +import com.evolveum.midpoint.task.api.RunningTask; import com.evolveum.midpoint.task.api.Task; import com.evolveum.midpoint.util.exception.SystemException; import com.evolveum.midpoint.util.logging.Trace; @@ -124,7 +125,7 @@ public String getChannel() { } public boolean canRun() { - return task == null || task.canRun(); + return !(task instanceof RunningTask) || ((RunningTask) task).canRun(); } public void checkTaskStop() { diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/scripting/IterativeScriptExecutionTaskHandler.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/scripting/IterativeScriptExecutionTaskHandler.java index d6f3ead757f..8879c5f67af 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/scripting/IterativeScriptExecutionTaskHandler.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/scripting/IterativeScriptExecutionTaskHandler.java @@ -26,10 +26,7 @@ import com.evolveum.midpoint.schema.constants.SchemaConstants; import com.evolveum.midpoint.schema.result.OperationConstants; import com.evolveum.midpoint.schema.result.OperationResult; -import com.evolveum.midpoint.task.api.Task; -import com.evolveum.midpoint.task.api.TaskCategory; -import com.evolveum.midpoint.task.api.TaskManager; -import com.evolveum.midpoint.task.api.TaskRunResult; +import com.evolveum.midpoint.task.api.*; import com.evolveum.midpoint.util.exception.*; import com.evolveum.midpoint.util.logging.LoggingUtils; import com.evolveum.midpoint.util.logging.Trace; @@ -69,7 +66,7 @@ protected Class getType(Task task) { @NotNull @Override - protected AbstractSearchIterativeResultHandler createHandler(TaskRunResult runResult, final Task coordinatorTask, + protected AbstractSearchIterativeResultHandler createHandler(TaskRunResult runResult, RunningTask coordinatorTask, OperationResult opResult) { PrismProperty executeScriptProperty = coordinatorTask.getExtensionProperty(SchemaConstants.SE_EXECUTE_SCRIPT); @@ -85,7 +82,7 @@ protected AbstractSearchIterativeResultHandler createHandler(TaskRun AbstractSearchIterativeResultHandler handler = new AbstractSearchIterativeResultHandler( coordinatorTask, IterativeScriptExecutionTaskHandler.class.getName(), "execute", "execute task", taskManager) { @Override - protected boolean handleObject(PrismObject object, Task workerTask, OperationResult result) { + protected boolean handleObject(PrismObject object, RunningTask workerTask, OperationResult result) { try { ExecuteScriptType executeScriptRequest = executeScriptRequestTemplate.clone(); executeScriptRequest.setInput(new ValueListType().value(object.asObjectable())); diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/scripting/ScriptExecutionTaskHandler.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/scripting/ScriptExecutionTaskHandler.java index e9965ab98a9..795a8aa10f6 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/scripting/ScriptExecutionTaskHandler.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/scripting/ScriptExecutionTaskHandler.java @@ -66,7 +66,7 @@ public StatisticsCollectionStrategy getStatisticsCollectionStrategy() { } @Override - public TaskRunResult run(Task task) { + public TaskRunResult run(RunningTask task) { OperationResult result = task.getResult().createSubresult(DOT_CLASS + "run"); TaskRunResult runResult = new TaskRunResult(); diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/sync/ExecuteChangesTaskHandler.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/sync/ExecuteChangesTaskHandler.java index 2e7b4757a74..76a348bfd7f 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/sync/ExecuteChangesTaskHandler.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/sync/ExecuteChangesTaskHandler.java @@ -19,6 +19,7 @@ import javax.annotation.PostConstruct; +import com.evolveum.midpoint.task.api.*; import org.jetbrains.annotations.NotNull; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @@ -30,16 +31,11 @@ import com.evolveum.midpoint.prism.PrismObject; import com.evolveum.midpoint.prism.PrismProperty; import com.evolveum.midpoint.prism.delta.ObjectDelta; -import com.evolveum.midpoint.prism.query.ObjectQuery; import com.evolveum.midpoint.repo.common.task.AbstractSearchIterativeResultHandler; import com.evolveum.midpoint.schema.DeltaConvertor; import com.evolveum.midpoint.schema.constants.SchemaConstants; import com.evolveum.midpoint.schema.result.OperationConstants; import com.evolveum.midpoint.schema.result.OperationResult; -import com.evolveum.midpoint.task.api.Task; -import com.evolveum.midpoint.task.api.TaskCategory; -import com.evolveum.midpoint.task.api.TaskManager; -import com.evolveum.midpoint.task.api.TaskRunResult; import com.evolveum.midpoint.util.exception.CommonException; import com.evolveum.midpoint.util.exception.CommunicationException; import com.evolveum.midpoint.util.exception.ConfigurationException; @@ -88,13 +84,13 @@ protected Class getType(Task task) { @NotNull @Override - protected AbstractSearchIterativeResultHandler createHandler(TaskRunResult runResult, final Task coordinatorTask, + protected AbstractSearchIterativeResultHandler createHandler(TaskRunResult runResult, RunningTask coordinatorTask, OperationResult opResult) { AbstractSearchIterativeResultHandler handler = new AbstractSearchIterativeResultHandler( coordinatorTask, ExecuteChangesTaskHandler.class.getName(), "execute", "execute task", taskManager) { @Override - protected boolean handleObject(PrismObject object, Task workerTask, OperationResult result) throws CommonException { + protected boolean handleObject(PrismObject object, RunningTask workerTask, OperationResult result) throws CommonException { executeChange(object, coordinatorTask, workerTask, result); return true; } diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/sync/FocusValidityScannerTaskHandler.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/sync/FocusValidityScannerTaskHandler.java index 7f013f09e65..8e0ea10da39 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/sync/FocusValidityScannerTaskHandler.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/sync/FocusValidityScannerTaskHandler.java @@ -36,6 +36,7 @@ import com.evolveum.midpoint.schema.result.OperationConstants; import com.evolveum.midpoint.schema.result.OperationResult; import com.evolveum.midpoint.schema.util.ObjectTypeUtil; +import com.evolveum.midpoint.task.api.RunningTask; import com.evolveum.midpoint.task.api.Task; import com.evolveum.midpoint.task.api.TaskRunResult; import com.evolveum.midpoint.util.LocalizableMessageBuilder; @@ -241,7 +242,7 @@ private ObjectFilter createFilterFor(Class type, ItemPa } @Override - protected void finish(AbstractScannerResultHandler handler, TaskRunResult runResult, Task coordinatorTask, OperationResult opResult) + protected void finish(AbstractScannerResultHandler handler, TaskRunResult runResult, RunningTask coordinatorTask, OperationResult opResult) throws SchemaException { TimeValidityPolicyConstraintType validityConstraintType = getValidityPolicyConstraint(coordinatorTask); @@ -256,13 +257,13 @@ protected void finish(AbstractScannerResultHandler handler, TaskRunRe @NotNull @Override - protected AbstractScannerResultHandler createHandler(TaskRunResult runResult, final Task coordinatorTask, + protected AbstractScannerResultHandler createHandler(TaskRunResult runResult, RunningTask coordinatorTask, OperationResult opResult) { AbstractScannerResultHandler handler = new AbstractScannerResultHandler( coordinatorTask, FocusValidityScannerTaskHandler.class.getName(), "recompute", "recompute task", taskManager) { @Override - protected boolean handleObject(PrismObject object, Task workerTask, OperationResult result) throws CommonException, PreconditionViolationException { + protected boolean handleObject(PrismObject object, RunningTask workerTask, OperationResult result) throws CommonException, PreconditionViolationException { if (oidAlreadySeen(coordinatorTask, object.getOid())) { LOGGER.trace("Recomputation already executed for {}", ObjectTypeUtil.toShortString(object)); } else { diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/sync/LiveSyncTaskHandler.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/sync/LiveSyncTaskHandler.java index 06492a59b50..d04f3831743 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/sync/LiveSyncTaskHandler.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/sync/LiveSyncTaskHandler.java @@ -45,7 +45,6 @@ import org.springframework.stereotype.Component; import javax.annotation.PostConstruct; -import java.util.List; /** * The task handler for a live synchronization. @@ -84,7 +83,7 @@ public StatisticsCollectionStrategy getStatisticsCollectionStrategy() { } @Override - public TaskRunResult run(Task task) { + public TaskRunResult run(RunningTask task) { LOGGER.trace("LiveSyncTaskHandler.run starting"); counterManager.registerCounter(task, true); diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/sync/RecomputeTaskHandler.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/sync/RecomputeTaskHandler.java index 5761b656eb8..a43b278cd03 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/sync/RecomputeTaskHandler.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/sync/RecomputeTaskHandler.java @@ -18,6 +18,7 @@ import javax.annotation.PostConstruct; import com.evolveum.midpoint.schema.constants.SchemaConstants; +import com.evolveum.midpoint.task.api.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @@ -30,15 +31,10 @@ import com.evolveum.midpoint.model.impl.util.ModelImplUtils; import com.evolveum.midpoint.prism.PrismContext; import com.evolveum.midpoint.prism.PrismObject; -import com.evolveum.midpoint.prism.query.ObjectQuery; import com.evolveum.midpoint.repo.api.PreconditionViolationException; import com.evolveum.midpoint.repo.common.task.AbstractSearchIterativeResultHandler; import com.evolveum.midpoint.schema.result.OperationConstants; import com.evolveum.midpoint.schema.result.OperationResult; -import com.evolveum.midpoint.task.api.Task; -import com.evolveum.midpoint.task.api.TaskCategory; -import com.evolveum.midpoint.task.api.TaskManager; -import com.evolveum.midpoint.task.api.TaskRunResult; import com.evolveum.midpoint.util.exception.CommonException; import com.evolveum.midpoint.util.exception.CommunicationException; import com.evolveum.midpoint.util.exception.ConfigurationException; @@ -92,13 +88,13 @@ protected Class getType(Task task) { } @Override - protected AbstractSearchIterativeResultHandler createHandler(TaskRunResult runResult, final Task coordinatorTask, + protected AbstractSearchIterativeResultHandler createHandler(TaskRunResult runResult, RunningTask coordinatorTask, OperationResult opResult) { AbstractSearchIterativeResultHandler handler = new AbstractSearchIterativeResultHandler( coordinatorTask, RecomputeTaskHandler.class.getName(), "recompute", "recompute task", taskManager) { @Override - protected boolean handleObject(PrismObject object, Task workerTask, OperationResult result) throws CommonException, PreconditionViolationException { + protected boolean handleObject(PrismObject object, RunningTask workerTask, OperationResult result) throws CommonException, PreconditionViolationException { recompute(object, getOptions(coordinatorTask), workerTask, result); return true; } diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/sync/ReconciliationTaskHandler.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/sync/ReconciliationTaskHandler.java index f9cbc64d3e4..2ccb47f04d9 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/sync/ReconciliationTaskHandler.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/sync/ReconciliationTaskHandler.java @@ -24,7 +24,6 @@ import com.evolveum.midpoint.common.refinery.RefinedResourceSchema; import com.evolveum.midpoint.common.refinery.RefinedResourceSchemaImpl; import com.evolveum.midpoint.model.api.ModelPublicConstants; -import com.evolveum.midpoint.model.api.util.ModelUtils; import com.evolveum.midpoint.model.impl.ModelConstants; import com.evolveum.midpoint.model.impl.lens.projector.policy.PolicyRuleSuspendTaskExecutor; import com.evolveum.midpoint.model.impl.util.ModelImplUtils; @@ -101,7 +100,7 @@ public class ReconciliationTaskHandler implements WorkBucketAwareTaskHandler { public static final String DRY_RUN_URI = ModelPublicConstants.RECONCILIATION_TASK_HANDLER_URI + "#dryRun"; public static final String SIMULATE_URI = ModelPublicConstants.RECONCILIATION_TASK_HANDLER_URI + "#simulate"; public static final String EXECUTE_URI = ModelPublicConstants.RECONCILIATION_TASK_HANDLER_URI + "#execute"; - + /** * Just for testability. Used in tests. Injected by explicit call to a * setter. @@ -155,7 +154,7 @@ public StatisticsCollectionStrategy getStatisticsCollectionStrategy() { } @Override - public TaskWorkBucketProcessingResult run(Task localCoordinatorTask, WorkBucketType workBucket, + public TaskWorkBucketProcessingResult run(RunningTask localCoordinatorTask, WorkBucketType workBucket, TaskWorkBucketProcessingResult previousRunResult) { counterManager.registerCounter(localCoordinatorTask, false); @@ -164,7 +163,7 @@ public TaskWorkBucketProcessingResult run(Task localCoordinatorTask, WorkBucketT Stage stage = getStage(handlerUri); LOGGER.trace("ReconciliationTaskHandler.run starting (stage: {})", stage); ReconciliationTaskResult reconResult = new ReconciliationTaskResult(); - + LOGGER.info("Recon task: {}", localCoordinatorTask.getTaskPrismObject().debugDump()); if (BooleanUtils.isTrue(localCoordinatorTask.getExtensionPropertyRealValue(SchemaConstants.MODEL_EXTENSION_FINISH_OPERATIONS_ONLY))) { @@ -377,7 +376,7 @@ private Stage getStage(String handlerUri) { private void setExpectedTotalToNull(Task coordinatorTask, OperationResult opResult) { coordinatorTask.setExpectedTotal(null); try { - coordinatorTask.savePendingModifications(opResult); + coordinatorTask.flushPendingModifications(opResult); } catch (Throwable t) { throw new SystemException("Couldn't update the task: " + t.getMessage(), t); } @@ -408,7 +407,7 @@ public void launch(ResourceType resource, QName objectclass, Task task, Operatio try { task.setExtensionPropertyValue(ModelConstants.OBJECTCLASS_PROPERTY_NAME, objectclass); - task.savePendingModifications(result); // just to be sure (if the task was already persistent) + task.flushPendingModifications(result); // just to be sure (if the task was already persistent) } catch (ObjectNotFoundException e) { LOGGER.error("Task object not found, expecting it to exist (task {})", task, e); result.recordFatalError("Task object not found", e); @@ -448,7 +447,7 @@ private void incrementAndRecordProgress(Task task, OperationResult opResult) { recordProgress(task, task.getProgress() + 1, opResult); } - private void processInterruption(TaskRunResult runResult, PrismObject resource, Task task, OperationResult opResult) { + private void processInterruption(TaskRunResult runResult, PrismObject resource, RunningTask task, OperationResult opResult) { opResult.recordWarning("Interrupted"); if (LOGGER.isWarnEnabled()) { LOGGER.warn("Reconciliation on {} interrupted", resource); @@ -458,7 +457,7 @@ private void processInterruption(TaskRunResult runResult, PrismObject resource, Task task, OperationResult opResult) { + TaskRunResultStatus runResultStatus, PrismObject resource, RunningTask task, OperationResult opResult) { String message = errorDesc+": "+ex.getMessage(); LOGGER.error("Reconciliation: {}-{}", new Object[]{message, ex}); opResult.recordFatalError(message, ex); @@ -487,7 +486,7 @@ private void processErrorPartial(TaskRunResult runResult, String errorDesc, Exce private boolean performResourceReconciliation(PrismObject resource, ObjectClassComplexTypeDefinition objectclassDef, - ReconciliationTaskResult reconResult, Task localCoordinatorTask, + ReconciliationTaskResult reconResult, RunningTask localCoordinatorTask, WorkBucketType workBucket, OperationResult result) throws ObjectNotFoundException, SchemaException, CommunicationException, ConfigurationException, SecurityViolationException, ExpressionEvaluationException { @@ -496,27 +495,27 @@ private boolean performResourceReconciliation(PrismObject resource if (CollectionUtils.isEmpty(stages)) { TaskStageType defaultStage = new TaskStageType(prismContext); defaultStage.setStage(EXECUTE_URI); - return performResourceReconciliationInternal(resource, objectclassDef, defaultStage, + return performResourceReconciliationInternal(resource, objectclassDef, defaultStage, reconResult, localCoordinatorTask, workBucket, result); } - + boolean canContinue = true; for (TaskStageType stage : stages) { - canContinue = performResourceReconciliationInternal(resource, objectclassDef, stage, + canContinue = performResourceReconciliationInternal(resource, objectclassDef, stage, reconResult, localCoordinatorTask, workBucket, result); if (!canContinue) { break; } } - + return canContinue; - + } // returns false in case of execution interruption private boolean performResourceReconciliationInternal(PrismObject resource, ObjectClassComplexTypeDefinition objectclassDef, TaskStageType stage, - ReconciliationTaskResult reconResult, Task localCoordinatorTask, + ReconciliationTaskResult reconResult, RunningTask localCoordinatorTask, WorkBucketType workBucket, OperationResult result) throws ObjectNotFoundException, SchemaException, CommunicationException, ConfigurationException, SecurityViolationException, ExpressionEvaluationException { @@ -580,7 +579,7 @@ private boolean performResourceReconciliationInternal(PrismObject // returns false in case of execution interruption private boolean performShadowReconciliation(final PrismObject resource, final ObjectClassComplexTypeDefinition objectclassDef, - long startTimestamp, long endTimestamp, ReconciliationTaskResult reconResult, final Task localCoordinatorTask, + long startTimestamp, long endTimestamp, ReconciliationTaskResult reconResult, RunningTask localCoordinatorTask, WorkBucketType workBucket, OperationResult result) throws SchemaException, ObjectNotFoundException { boolean interrupted; @@ -726,7 +725,7 @@ private void processShadowReconError(Exception e, PrismObject shadow * Scans shadows for unfinished operations and tries to finish them. * Returns false if the reconciliation was interrupted. */ - private boolean scanForUnfinishedOperations(Task task, String resourceOid, ReconciliationTaskResult reconResult, + private boolean scanForUnfinishedOperations(RunningTask task, String resourceOid, ReconciliationTaskResult reconResult, OperationResult result) throws SchemaException { LOGGER.trace("Scan for unfinished operations starting"); OperationResult opResult = result.createSubresult(OperationConstants.RECONCILIATION+".repoReconciliation"); diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/sync/SynchronizationContext.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/sync/SynchronizationContext.java index dde6b0f2577..dbc98abb425 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/sync/SynchronizationContext.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/sync/SynchronizationContext.java @@ -19,6 +19,7 @@ import javax.xml.namespace.QName; +import com.evolveum.midpoint.prism.path.ItemName; import org.apache.commons.lang.BooleanUtils; import org.apache.commons.lang.StringUtils; @@ -124,7 +125,7 @@ public boolean isSatisfyTaskConstraints() throws SchemaException { //TODO multi-threded tasks? private T getTaskPropertyValue(QName propertyName) { - PrismProperty prop = task.getExtensionProperty(propertyName); + PrismProperty prop = task.getExtensionProperty(ItemName.fromQName(propertyName)); if (prop == null || prop.isEmpty()) { return null; } diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/sync/SynchronizeAccountResultHandler.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/sync/SynchronizeAccountResultHandler.java index 2bfc02eb46d..4328d64945e 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/sync/SynchronizeAccountResultHandler.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/sync/SynchronizeAccountResultHandler.java @@ -29,7 +29,7 @@ import com.evolveum.midpoint.schema.processor.ObjectClassComplexTypeDefinition; import com.evolveum.midpoint.schema.result.OperationResult; import com.evolveum.midpoint.schema.result.OperationResultStatus; -import com.evolveum.midpoint.task.api.Task; +import com.evolveum.midpoint.task.api.RunningTask; import com.evolveum.midpoint.task.api.TaskManager; import com.evolveum.midpoint.util.QNameUtil; import com.evolveum.midpoint.util.logging.Trace; @@ -64,9 +64,9 @@ public class SynchronizeAccountResultHandler extends AbstractSearchIterativeResu private ObjectClassComplexTypeDefinition objectClassDef; private QName sourceChannel; private boolean forceAdd; - + public SynchronizeAccountResultHandler(ResourceType resource, ObjectClassComplexTypeDefinition objectClassDef, - String processShortName, Task coordinatorTask, ResourceObjectChangeListener objectChangeListener, + String processShortName, RunningTask coordinatorTask, ResourceObjectChangeListener objectChangeListener, TaskStageType stageType, TaskManager taskManager) { super(coordinatorTask, SynchronizeAccountResultHandler.class.getName(), processShortName, "from "+resource, stageType, taskManager); this.objectChangeListener = objectChangeListener; @@ -111,14 +111,14 @@ public ObjectClassComplexTypeDefinition getObjectClass() { return objectClassDef; } - + /** * This methods will be called for each search result. It means it will be * called for each account on a resource. We will pretend that the account * was created and invoke notification interface. */ @Override - protected boolean handleObject(PrismObject accountShadow, Task workerTask, OperationResult result) { + protected boolean handleObject(PrismObject accountShadow, RunningTask workerTask, OperationResult result) { long started = System.currentTimeMillis(); try { workerTask.recordIterativeOperationStart(accountShadow.asObjectable()); @@ -136,7 +136,7 @@ protected boolean handleObject(PrismObject accountShadow, Task worke } } - protected boolean handleObjectInternal(PrismObject accountShadow, Task workerTask, OperationResult result) { + protected boolean handleObjectInternal(PrismObject accountShadow, RunningTask workerTask, OperationResult result) { if (LOGGER.isTraceEnabled()) { LOGGER.trace("{} considering object:\n{}", getProcessShortNameCapitalized(), accountShadow.debugDump(1)); @@ -205,20 +205,20 @@ protected boolean handleObjectInternal(PrismObject accountShadow, Ta objectChangeListener.notifyChange(change, workerTask, result); LOGGER.info("#### notify chnage finished."); - + // No exception thrown here. The error is indicated in the result. Will be processed by superclass. return workerTask.canRun(); } - + private boolean isShadowUnknown(ShadowType shadowType) { if (ShadowKindType.UNKNOWN == shadowType.getKind()) { return true; } - + if (SchemaConstants.INTENT_UNKNOWN.equals(shadowType.getIntent())) { return true; } - + return false; } } diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/trigger/CompletedTaskCleanupTriggerHandler.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/trigger/CompletedTaskCleanupTriggerHandler.java index c1efbdd6015..5fde4cb53b6 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/trigger/CompletedTaskCleanupTriggerHandler.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/trigger/CompletedTaskCleanupTriggerHandler.java @@ -20,7 +20,7 @@ import com.evolveum.midpoint.repo.api.RepositoryService; import com.evolveum.midpoint.schema.constants.SchemaConstants; import com.evolveum.midpoint.schema.result.OperationResult; -import com.evolveum.midpoint.task.api.Task; +import com.evolveum.midpoint.task.api.RunningTask; import com.evolveum.midpoint.task.api.TaskManager; import com.evolveum.midpoint.util.exception.CommonException; import com.evolveum.midpoint.util.logging.LoggingUtils; @@ -57,7 +57,7 @@ private void initialize() { } @Override - public void handle(PrismObject object, TriggerType trigger, Task task, OperationResult result) { + public void handle(PrismObject object, TriggerType trigger, RunningTask task, OperationResult result) { try { // reload the task to minimize potential for race conflicts // todo use repo preconditions to implement this diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/trigger/RecomputeTriggerHandler.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/trigger/RecomputeTriggerHandler.java index 7e4e62581a9..ec993a58766 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/trigger/RecomputeTriggerHandler.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/trigger/RecomputeTriggerHandler.java @@ -17,6 +17,7 @@ import javax.annotation.PostConstruct; +import com.evolveum.midpoint.task.api.RunningTask; import com.evolveum.midpoint.util.logging.LoggingUtils; import com.evolveum.midpoint.xml.ns._public.common.common_3.TriggerType; import org.springframework.beans.factory.annotation.Autowired; @@ -27,12 +28,9 @@ import com.evolveum.midpoint.model.impl.lens.Clockwork; import com.evolveum.midpoint.model.impl.lens.ContextFactory; import com.evolveum.midpoint.model.impl.lens.LensContext; -import com.evolveum.midpoint.prism.PrismContext; import com.evolveum.midpoint.prism.PrismObject; -import com.evolveum.midpoint.provisioning.api.ProvisioningService; import com.evolveum.midpoint.repo.api.PreconditionViolationException; import com.evolveum.midpoint.schema.result.OperationResult; -import com.evolveum.midpoint.task.api.Task; import com.evolveum.midpoint.util.exception.CommonException; import com.evolveum.midpoint.util.logging.Trace; import com.evolveum.midpoint.util.logging.TraceManager; @@ -63,7 +61,7 @@ private void initialize() { * @see com.evolveum.midpoint.model.trigger.TriggerHandler#handle(com.evolveum.midpoint.prism.PrismObject) */ @Override - public void handle(PrismObject object, TriggerType trigger, Task task, OperationResult result) { + public void handle(PrismObject object, TriggerType trigger, RunningTask task, OperationResult result) { try { LOGGER.trace("Recomputing {}", object); diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/trigger/TriggerHandler.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/trigger/TriggerHandler.java index 621e4358ab9..c8a570c5b41 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/trigger/TriggerHandler.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/trigger/TriggerHandler.java @@ -17,7 +17,7 @@ import com.evolveum.midpoint.prism.PrismObject; import com.evolveum.midpoint.schema.result.OperationResult; -import com.evolveum.midpoint.task.api.Task; +import com.evolveum.midpoint.task.api.RunningTask; import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType; import com.evolveum.midpoint.xml.ns._public.common.common_3.TriggerType; @@ -27,6 +27,6 @@ */ public interface TriggerHandler { - void handle(PrismObject object, TriggerType trigger, Task task, OperationResult result); + void handle(PrismObject object, TriggerType trigger, RunningTask task, OperationResult result); } diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/trigger/TriggerScannerTaskHandler.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/trigger/TriggerScannerTaskHandler.java index 1d03f6496b5..2ed63e90e9b 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/trigger/TriggerScannerTaskHandler.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/trigger/TriggerScannerTaskHandler.java @@ -30,6 +30,7 @@ import com.evolveum.midpoint.schema.result.OperationResult; import com.evolveum.midpoint.schema.util.MiscSchemaUtil; import com.evolveum.midpoint.schema.util.ObjectTypeUtil; +import com.evolveum.midpoint.task.api.RunningTask; import com.evolveum.midpoint.task.api.Task; import com.evolveum.midpoint.task.api.TaskRunResult; import com.evolveum.midpoint.util.exception.*; @@ -125,20 +126,20 @@ protected ObjectQuery createQuery(AbstractScannerResultHandler handl } @Override - protected void finish(AbstractScannerResultHandler handler, TaskRunResult runResult, Task task, OperationResult opResult) + protected void finish(AbstractScannerResultHandler handler, TaskRunResult runResult, RunningTask task, OperationResult opResult) throws SchemaException { super.finish(handler, runResult, task, opResult); cleanupProcessedOids(task); } @Override - protected AbstractScannerResultHandler createHandler(TaskRunResult runResult, final Task coordinatorTask, + protected AbstractScannerResultHandler createHandler(TaskRunResult runResult, RunningTask coordinatorTask, OperationResult opResult) { AbstractScannerResultHandler handler = new AbstractScannerResultHandler( coordinatorTask, TriggerScannerTaskHandler.class.getName(), "trigger", "trigger task", taskManager) { @Override - protected boolean handleObject(PrismObject object, Task workerTask, OperationResult result) { + protected boolean handleObject(PrismObject object, RunningTask workerTask, OperationResult result) { fireTriggers(this, object, workerTask, coordinatorTask, result); return true; } @@ -147,7 +148,7 @@ protected boolean handleObject(PrismObject object, Task workerTask, return handler; } - private void fireTriggers(AbstractScannerResultHandler handler, PrismObject object, Task workerTask, Task coordinatorTask, + private void fireTriggers(AbstractScannerResultHandler handler, PrismObject object, RunningTask workerTask, Task coordinatorTask, OperationResult result) { PrismContainer triggerContainer = object.findContainer(F_TRIGGER); if (triggerContainer == null) { @@ -192,7 +193,7 @@ private boolean isHot(AbstractScannerResultHandler handler, XMLGrego // returns true if the trigger can be removed private boolean fireTrigger(TriggerType trigger, PrismObject object, - Task workerTask, Task coordinatorTask, OperationResult result) { + RunningTask workerTask, Task coordinatorTask, OperationResult result) { String handlerUri = trigger.getHandlerUri(); if (handlerUri == null) { LOGGER.warn("Trigger without handler URI in {}", object); diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/util/AbstractScannerResultHandler.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/util/AbstractScannerResultHandler.java index 9f5128a4270..db8238d8b20 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/util/AbstractScannerResultHandler.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/util/AbstractScannerResultHandler.java @@ -18,7 +18,7 @@ import javax.xml.datatype.XMLGregorianCalendar; import com.evolveum.midpoint.repo.common.task.AbstractSearchIterativeResultHandler; -import com.evolveum.midpoint.task.api.Task; +import com.evolveum.midpoint.task.api.RunningTask; import com.evolveum.midpoint.task.api.TaskManager; import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType; @@ -28,7 +28,7 @@ public abstract class AbstractScannerResultHandler extends protected XMLGregorianCalendar lastScanTimestamp; protected XMLGregorianCalendar thisScanTimestamp; - public AbstractScannerResultHandler(Task coordinatorTask, String taskOperationPrefix, + public AbstractScannerResultHandler(RunningTask coordinatorTask, String taskOperationPrefix, String processShortName, String contextDesc, TaskManager taskManager) { super(coordinatorTask, taskOperationPrefix, processShortName, contextDesc, taskManager); } diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/util/AbstractScannerTaskHandler.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/util/AbstractScannerTaskHandler.java index 3075705e695..f5a6bb441a4 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/util/AbstractScannerTaskHandler.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/util/AbstractScannerTaskHandler.java @@ -19,6 +19,7 @@ import com.evolveum.midpoint.prism.*; import com.evolveum.midpoint.prism.path.ItemPath; +import com.evolveum.midpoint.task.api.RunningTask; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @@ -74,7 +75,7 @@ protected boolean initializeRun(H handler, TaskRunResult runResult, } @Override - protected void finish(H handler, TaskRunResult runResult, Task task, OperationResult opResult) throws SchemaException { + protected void finish(H handler, TaskRunResult runResult, RunningTask task, OperationResult opResult) throws SchemaException { super.finish(handler, runResult, task, opResult); if (task.canRun()) { diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/util/AuditReindexTaskHandler.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/util/AuditReindexTaskHandler.java index 94843da4ab1..d5ad8e3e3a9 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/util/AuditReindexTaskHandler.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/util/AuditReindexTaskHandler.java @@ -48,7 +48,7 @@ private void initialize() { } @Override - public TaskRunResult run(Task coordinatorTask) { + public TaskRunResult run(RunningTask coordinatorTask) { OperationResult opResult = new OperationResult(OperationConstants.AUDIT_REINDEX + ".run"); opResult.setStatus(OperationResultStatus.IN_PROGRESS); TaskRunResult runResult = new TaskRunResult(); @@ -77,10 +77,10 @@ public int getProgress() { try { LOGGER.trace("{}: expecting {} objects to be processed", taskName, expectedTotal); - coordinatorTask.setProgress(0); + coordinatorTask.setProgress(0L); coordinatorTask.setExpectedTotal(expectedTotal); try { - coordinatorTask.savePendingModifications(opResult); + coordinatorTask.flushPendingModifications(opResult); } catch (ObjectAlreadyExistsException e) { // other exceptions are handled in the outer try block throw new IllegalStateException( "Unexpected ObjectAlreadyExistsException when updating task progress/expectedTotal", diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/util/DeleteTaskHandler.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/util/DeleteTaskHandler.java index 74dad692d1e..fe3d001f74f 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/util/DeleteTaskHandler.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/util/DeleteTaskHandler.java @@ -92,11 +92,11 @@ public StatisticsCollectionStrategy getStatisticsCollectionStrategy() { } @Override - public TaskRunResult run(Task task) { + public TaskRunResult run(RunningTask task) { return runInternal(task); } - private TaskRunResult runInternal(Task task) { + private TaskRunResult runInternal(RunningTask task) { LOGGER.trace("Delete task run starting ({})", task); long startTimestamp = System.currentTimeMillis(); diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/util/ModelImplUtils.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/util/ModelImplUtils.java index 99c103de200..c9b7f0eb947 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/util/ModelImplUtils.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/util/ModelImplUtils.java @@ -37,6 +37,7 @@ import com.evolveum.midpoint.prism.crypto.Protector; import com.evolveum.midpoint.prism.delta.ItemDelta; import com.evolveum.midpoint.prism.delta.ObjectDelta; +import com.evolveum.midpoint.prism.path.ItemName; import com.evolveum.midpoint.prism.path.ItemPath; import com.evolveum.midpoint.prism.query.FullTextFilter; import com.evolveum.midpoint.prism.query.InOidFilter; @@ -58,6 +59,7 @@ import com.evolveum.midpoint.schema.util.ExceptionUtil; import com.evolveum.midpoint.schema.util.FocusTypeUtil; import com.evolveum.midpoint.schema.util.ResourceTypeUtil; +import com.evolveum.midpoint.task.api.RunningTask; import com.evolveum.midpoint.task.api.Task; import com.evolveum.midpoint.util.exception.CommunicationException; import com.evolveum.midpoint.util.exception.ConfigurationException; @@ -593,40 +595,56 @@ public static void clearRequestee(Task task) { } public static boolean isDryRun(Task task) throws SchemaException { - Boolean dryRun = findItemValue(task, SchemaConstants.MODEL_EXTENSION_DRY_RUN); - if (dryRun == null && task.isLightweightAsynchronousTask() && task.getParentForLightweightAsynchronousTask() != null) { - dryRun = findItemValue(task.getParentForLightweightAsynchronousTask(), SchemaConstants.MODEL_EXTENSION_DRY_RUN); - } + Boolean dryRun = findExtensionItemValueInThisOrParent(task, SchemaConstants.MODEL_EXTENSION_DRY_RUN); return dryRun != null ? dryRun : Boolean.FALSE; } + public static boolean isSimulateRun(Task task) throws SchemaException { + Boolean simulate = findExtensionItemValueInThisOrParent(task, SchemaConstants.MODEL_EXTENSION_SIMULATE_BEFORE_EXECUTE); + return simulate != null ? simulate : Boolean.FALSE; + } + public static boolean canPerformStage(String stageUri, Task task) throws SchemaException { PrismObject taskType = task.getTaskPrismObject(); PrismProperty stageType = taskType.findProperty(ItemPath.create(TaskType.F_STAGE, TaskStageType.F_STAGE)); if (stageType == null) { return false; } - + String stageTypeRealValue = stageType.getRealValue(); return stageUri.equals(stageTypeRealValue); } - + public static String getStageUri(Task task) { PrismObject taskType = task.getTaskPrismObject(); PrismProperty stageType = taskType.findProperty(ItemPath.create(TaskType.F_STAGE, TaskStageType.F_STAGE)); if (stageType == null) { return ModelPublicConstants.RECONCILIATION_TASK_HANDLER_URI + "#execute"; } - + return stageType.getRealValue(); } - - static Boolean findItemValue(Task task, QName path) throws SchemaException{ + + private static Boolean findExtensionItemValueInThisOrParent(Task task, QName path) throws SchemaException { + Boolean value = findExtensionItemValue(task, path); + if (value != null) { + return value; + } + if (task instanceof RunningTask) { + RunningTask runningTask = (RunningTask) task; + if (runningTask.isLightweightAsynchronousTask() && runningTask.getParentForLightweightAsynchronousTask() != null) { + return findExtensionItemValue(runningTask.getParentForLightweightAsynchronousTask(), path); + } + } + return null; + } + + private static Boolean findExtensionItemValue(Task task, QName path) throws SchemaException{ Validate.notNull(task, "Task must not be null."); - if (task.getExtension() == null) { + if (!task.hasExtension()) { return null; } - PrismProperty item = task.getExtensionProperty(path); + PrismProperty item = task.getExtensionProperty(ItemName.fromQName(path)); if (item == null || item.isEmpty()) { return null; } @@ -641,7 +659,7 @@ static Boolean findItemValue(Task task, QName path) throws SchemaException{ public static ModelExecuteOptions getModelExecuteOptions(Task task) throws SchemaException { Validate.notNull(task, "Task must not be null."); - if (task.getExtension() == null) { + if (!task.hasExtension()) { return null; } //LOGGER.info("Task:\n{}",task.debugDump(1)); @@ -846,5 +864,5 @@ public static CriticalityType handleConnectorErrorCriticality(ResourceType resou RepoCommonUtils.processErrorCriticality(resourceType, criticality, e, result); return criticality; } - + } diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/util/ReindexResultHandler.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/util/ReindexResultHandler.java index 62fba026396..1eec033d1d1 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/util/ReindexResultHandler.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/util/ReindexResultHandler.java @@ -21,6 +21,7 @@ import com.evolveum.midpoint.repo.api.RepositoryService; import com.evolveum.midpoint.repo.common.task.AbstractSearchIterativeResultHandler; import com.evolveum.midpoint.schema.result.OperationResult; +import com.evolveum.midpoint.task.api.RunningTask; import com.evolveum.midpoint.task.api.Task; import com.evolveum.midpoint.task.api.TaskManager; import com.evolveum.midpoint.util.exception.CommonException; @@ -42,7 +43,7 @@ public class ReindexResultHandler extends AbstractSearchIterativeResultHandler object, Task workerTask, OperationResult parentResult) throws CommonException { + protected boolean handleObject(PrismObject object, RunningTask workerTask, OperationResult parentResult) throws CommonException { OperationResult result = parentResult.createMinorSubresult(CLASS_DOT + "handleObject"); repositoryService.modifyObject(object.asObjectable().getClass(), object.getOid(), new ArrayList<>(), RepoModifyOptions.createExecuteIfNoChanges(), result); diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/util/ReindexTaskHandler.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/util/ReindexTaskHandler.java index 2e6ef943616..50305777d7f 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/util/ReindexTaskHandler.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/util/ReindexTaskHandler.java @@ -21,6 +21,7 @@ import com.evolveum.midpoint.schema.result.OperationResult; import com.evolveum.midpoint.security.api.AuthorizationConstants; import com.evolveum.midpoint.security.enforcer.api.AuthorizationParameters; +import com.evolveum.midpoint.task.api.RunningTask; import com.evolveum.midpoint.task.api.Task; import com.evolveum.midpoint.task.api.TaskCategory; import com.evolveum.midpoint.task.api.TaskRunResult; @@ -69,7 +70,7 @@ private void initialize() { } @Override - protected ReindexResultHandler createHandler(TaskRunResult runResult, Task coordinatorTask, OperationResult opResult) + protected ReindexResultHandler createHandler(TaskRunResult runResult, RunningTask coordinatorTask, OperationResult opResult) throws SchemaException, SecurityViolationException, ObjectNotFoundException, ExpressionEvaluationException, CommunicationException, ConfigurationException { securityEnforcer.authorize(AuthorizationConstants.AUTZ_ALL_URL, null, AuthorizationParameters.EMPTY, null, coordinatorTask, opResult); return new ReindexResultHandler(coordinatorTask, ReindexTaskHandler.class.getName(), diff --git a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/manual/TestSemiManualGroupingProposed.java b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/manual/TestSemiManualGroupingProposed.java index 7251a1d031c..592ebabaebe 100644 --- a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/manual/TestSemiManualGroupingProposed.java +++ b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/manual/TestSemiManualGroupingProposed.java @@ -115,7 +115,7 @@ protected void assertNewPropagationTask() throws Exception { @Override protected void assertFinishedPropagationTask(Task finishedTask, OperationResultStatusType expectedStatus) { super.assertFinishedPropagationTask(finishedTask, expectedStatus); - SearchFilterType filterType = finishedTask.getTaskType().getObjectRef().getFilter(); + SearchFilterType filterType = finishedTask.getObjectRef().getFilter(); display("Propagation task filter", filterType); assertEquals("Unexpected propagation task progress", 1, finishedTask.getProgress()); diff --git a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/util/MockTaskHandler.java b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/util/MockTaskHandler.java index 92606a25489..b3dc2ada158 100644 --- a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/util/MockTaskHandler.java +++ b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/util/MockTaskHandler.java @@ -15,10 +15,9 @@ */ package com.evolveum.midpoint.model.intest.util; -import java.util.List; - import javax.annotation.PostConstruct; +import com.evolveum.midpoint.task.api.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @@ -26,11 +25,6 @@ import com.evolveum.midpoint.schema.result.OperationConstants; import com.evolveum.midpoint.schema.result.OperationResult; import com.evolveum.midpoint.schema.result.OperationResultStatus; -import com.evolveum.midpoint.task.api.Task; -import com.evolveum.midpoint.task.api.TaskCategory; -import com.evolveum.midpoint.task.api.TaskHandler; -import com.evolveum.midpoint.task.api.TaskManager; -import com.evolveum.midpoint.task.api.TaskRunResult; import com.evolveum.midpoint.task.api.TaskRunResult.TaskRunResultStatus; import com.evolveum.midpoint.util.logging.Trace; import com.evolveum.midpoint.util.logging.TraceManager; @@ -56,7 +50,7 @@ private void initialize() { } @Override - public TaskRunResult run(Task task) { + public TaskRunResult run(RunningTask task) { LOGGER.trace("MockTaskHandler.run starting"); OperationResult opResult = new OperationResult(OperationConstants.RECONCILIATION); diff --git a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/util/MockTriggerHandler.java b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/util/MockTriggerHandler.java index 035599b4ddc..c91529183f6 100644 --- a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/util/MockTriggerHandler.java +++ b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/util/MockTriggerHandler.java @@ -19,7 +19,7 @@ import com.evolveum.midpoint.prism.PrismObject; import com.evolveum.midpoint.schema.constants.SchemaConstants; import com.evolveum.midpoint.schema.result.OperationResult; -import com.evolveum.midpoint.task.api.Task; +import com.evolveum.midpoint.task.api.RunningTask; import com.evolveum.midpoint.test.IntegrationTestTools; import com.evolveum.midpoint.util.logging.Trace; import com.evolveum.midpoint.util.logging.TraceManager; @@ -71,7 +71,7 @@ public void setFailOnNextInvocation(boolean failOnNextInvocation) { * @see com.evolveum.midpoint.model.trigger.TriggerHandler#handle(com.evolveum.midpoint.prism.PrismObject) */ @Override - public void handle(PrismObject object, TriggerType trigger, Task task, OperationResult result) { + public void handle(PrismObject object, TriggerType trigger, RunningTask task, OperationResult result) { IntegrationTestTools.display("Mock trigger handler called with " + object); lastObject = object.clone(); invocationCount.incrementAndGet(); diff --git a/model/report-impl/src/main/java/com/evolveum/midpoint/report/impl/ReportCreateTaskHandler.java b/model/report-impl/src/main/java/com/evolveum/midpoint/report/impl/ReportCreateTaskHandler.java index 66002b35be6..2c567a7a648 100644 --- a/model/report-impl/src/main/java/com/evolveum/midpoint/report/impl/ReportCreateTaskHandler.java +++ b/model/report-impl/src/main/java/com/evolveum/midpoint/report/impl/ReportCreateTaskHandler.java @@ -34,6 +34,7 @@ import com.evolveum.midpoint.repo.common.commandline.CommandLineScriptExecutor; import com.evolveum.midpoint.repo.common.expression.ExpressionVariables; +import com.evolveum.midpoint.task.api.*; import net.sf.jasperreports.engine.JRException; import net.sf.jasperreports.engine.JRTemplate; import net.sf.jasperreports.engine.JasperExportManager; @@ -78,11 +79,6 @@ import com.evolveum.midpoint.schema.util.MiscSchemaUtil; import com.evolveum.midpoint.schema.util.ObjectTypeUtil; import com.evolveum.midpoint.schema.util.ReportTypeUtil; -import com.evolveum.midpoint.task.api.Task; -import com.evolveum.midpoint.task.api.TaskCategory; -import com.evolveum.midpoint.task.api.TaskHandler; -import com.evolveum.midpoint.task.api.TaskManager; -import com.evolveum.midpoint.task.api.TaskRunResult; import com.evolveum.midpoint.task.api.TaskRunResult.TaskRunResultStatus; import com.evolveum.midpoint.util.exception.CommunicationException; import com.evolveum.midpoint.util.exception.ConfigurationException; @@ -144,7 +140,7 @@ private void initialize() { } @Override - public TaskRunResult run(Task task) { + public TaskRunResult run(RunningTask task) { // TODO Auto-generated method stub OperationResult parentResult = task.getResult(); OperationResult result = parentResult.createSubresult(ReportCreateTaskHandler.class.getSimpleName() + ".run"); @@ -171,7 +167,7 @@ public TaskRunResult run(Task task) { for (Item item : items) { PrismProperty pp = (PrismProperty) item; String paramName = pp.getPath().lastName().getLocalPart(); - Object value = null; + Object value; if (isSingleValue(paramName, jasperReport.getParameters())) { value = pp.getRealValues().iterator().next(); } else { diff --git a/model/report-impl/src/test/java/com/evolveum/midpoint/report/TestReportJasper.java b/model/report-impl/src/test/java/com/evolveum/midpoint/report/TestReportJasper.java index 9c62255c8db..7ccb2817089 100644 --- a/model/report-impl/src/test/java/com/evolveum/midpoint/report/TestReportJasper.java +++ b/model/report-impl/src/test/java/com/evolveum/midpoint/report/TestReportJasper.java @@ -19,6 +19,7 @@ import java.util.HashMap; import java.util.Map; +import com.evolveum.midpoint.task.api.RunningTask; import net.sf.jasperreports.engine.JasperCompileManager; import net.sf.jasperreports.engine.JasperExportManager; import net.sf.jasperreports.engine.JasperFillManager; @@ -86,7 +87,7 @@ public void f() throws Exception{ JasperDesign jd = JRXmlLoader.load(new File("src/test/resources/reports/report-users-ds.jrxml")); JasperReport jr = JasperCompileManager.compileReport(jd); - Task task = taskManager.createTaskInstance(); + RunningTask task = taskManager.createFakeRunningTask(taskManager.createTaskInstance()); Map params = new HashMap<>(); // params.put(MidPointQueryExecutorFactory.PARAMETER_MIDPOINT_CONNECTION, modelService); // params.put(MidPointQueryExecutorFactory.PARAMETER_PRISM_CONTEXT, prismContext); diff --git a/model/workflow-impl/src/main/java/com/evolveum/midpoint/wf/impl/processes/common/WfTimedActionTriggerHandler.java b/model/workflow-impl/src/main/java/com/evolveum/midpoint/wf/impl/processes/common/WfTimedActionTriggerHandler.java index 65c7cc55bfc..1492087128b 100644 --- a/model/workflow-impl/src/main/java/com/evolveum/midpoint/wf/impl/processes/common/WfTimedActionTriggerHandler.java +++ b/model/workflow-impl/src/main/java/com/evolveum/midpoint/wf/impl/processes/common/WfTimedActionTriggerHandler.java @@ -25,6 +25,7 @@ import com.evolveum.midpoint.schema.result.OperationResult; import com.evolveum.midpoint.schema.util.ObjectTypeUtil; import com.evolveum.midpoint.schema.util.WfContextUtil; +import com.evolveum.midpoint.task.api.RunningTask; import com.evolveum.midpoint.task.api.Task; import com.evolveum.midpoint.task.api.TaskManager; import com.evolveum.midpoint.util.exception.*; @@ -72,7 +73,7 @@ private void initialize() { } @Override - public void handle(PrismObject object, TriggerType trigger, Task triggerScannerTask, OperationResult parentResult) { + public void handle(PrismObject object, TriggerType trigger, RunningTask triggerScannerTask, OperationResult parentResult) { if (!(object.asObjectable() instanceof TaskType)) { throw new IllegalArgumentException("Unexpected object type: should be TaskType: " + object); } diff --git a/model/workflow-impl/src/main/java/com/evolveum/midpoint/wf/impl/processes/itemApproval/MidpointUtil.java b/model/workflow-impl/src/main/java/com/evolveum/midpoint/wf/impl/processes/itemApproval/MidpointUtil.java index e3ebc4279b1..f20a5176e47 100644 --- a/model/workflow-impl/src/main/java/com/evolveum/midpoint/wf/impl/processes/itemApproval/MidpointUtil.java +++ b/model/workflow-impl/src/main/java/com/evolveum/midpoint/wf/impl/processes/itemApproval/MidpointUtil.java @@ -165,7 +165,7 @@ public static void createTriggersForTimedActions(String workItemId, int escalati public static void removeTriggersForWorkItem(Task wfTask, String workItemId, OperationResult result) { List> toDelete = new ArrayList<>(); - for (TriggerType triggerType : wfTask.getTaskPrismObject().asObjectable().getTrigger()) { + for (TriggerType triggerType : wfTask.getTriggers()) { if (WfTimedActionTriggerHandler.HANDLER_URI.equals(triggerType.getHandlerUri())) { PrismProperty workItemIdProperty = triggerType.getExtension().asPrismContainerValue() .findProperty(SchemaConstants.MODEL_EXTENSION_WORK_ITEM_ID); @@ -177,17 +177,17 @@ public static void removeTriggersForWorkItem(Task wfTask, String workItemId, Ope removeSelectedTriggers(wfTask, toDelete, result); } - // not necessary any more, as work item triggers are deleted when the work item (task) is deleted - // (and there are currently no triggers other than work-item-related) - public static void removeAllStageTriggersForWorkItem(Task wfTask, OperationResult result) { - List> toDelete = new ArrayList<>(); - for (TriggerType triggerType : wfTask.getTaskPrismObject().asObjectable().getTrigger()) { - if (WfTimedActionTriggerHandler.HANDLER_URI.equals(triggerType.getHandlerUri())) { - toDelete.add(triggerType.clone().asPrismContainerValue()); - } - } - removeSelectedTriggers(wfTask, toDelete, result); - } +// // not necessary any more, as work item triggers are deleted when the work item (task) is deleted +// // (and there are currently no triggers other than work-item-related) +// public static void removeAllStageTriggersForWorkItem(Task wfTask, OperationResult result) { +// List> toDelete = new ArrayList<>(); +// for (TriggerType triggerType : wfTask.getTaskPrismObject().asObjectable().getTrigger()) { +// if (WfTimedActionTriggerHandler.HANDLER_URI.equals(triggerType.getHandlerUri())) { +// toDelete.add(triggerType.clone().asPrismContainerValue()); +// } +// } +// removeSelectedTriggers(wfTask, toDelete, result); +// } private static void removeSelectedTriggers(Task wfTask, List> toDelete, OperationResult result) { try { diff --git a/model/workflow-impl/src/main/java/com/evolveum/midpoint/wf/impl/processors/general/GeneralChangeProcessor.java b/model/workflow-impl/src/main/java/com/evolveum/midpoint/wf/impl/processors/general/GeneralChangeProcessor.java index 6d703a2f451..422dc5f9f57 100644 --- a/model/workflow-impl/src/main/java/com/evolveum/midpoint/wf/impl/processors/general/GeneralChangeProcessor.java +++ b/model/workflow-impl/src/main/java/com/evolveum/midpoint/wf/impl/processors/general/GeneralChangeProcessor.java @@ -202,7 +202,7 @@ public void onProcessEnd(ProcessEvent event, WfTask wfTask, OperationResult resu wfTaskUtil.storeModelContext(rootTask, lensContextType); } - rootTask.savePendingModifications(result); + rootTask.flushPendingModifications(result); LOGGER.trace("onProcessEnd ending for task {}", task); } //endregion diff --git a/model/workflow-impl/src/main/java/com/evolveum/midpoint/wf/impl/processors/primary/WfPrepareChildOperationTaskHandler.java b/model/workflow-impl/src/main/java/com/evolveum/midpoint/wf/impl/processors/primary/WfPrepareChildOperationTaskHandler.java index b33f84d9a8c..e60f5c33e49 100644 --- a/model/workflow-impl/src/main/java/com/evolveum/midpoint/wf/impl/processors/primary/WfPrepareChildOperationTaskHandler.java +++ b/model/workflow-impl/src/main/java/com/evolveum/midpoint/wf/impl/processors/primary/WfPrepareChildOperationTaskHandler.java @@ -73,7 +73,7 @@ public void init() { //region Body @SuppressWarnings("unchecked") @Override - public TaskRunResult run(Task task) { + public TaskRunResult run(RunningTask task) { TaskRunResult.TaskRunResultStatus status = TaskRunResult.TaskRunResultStatus.FINISHED; @@ -115,7 +115,7 @@ public TaskRunResult run(Task task) { } wfTask.storeModelContext(modelContext, true); } - task.savePendingModifications(result); + task.flushPendingModifications(result); } catch (SchemaException | ObjectNotFoundException | ObjectAlreadyExistsException | ConfigurationException | ExpressionEvaluationException | RuntimeException | Error e) { LoggingUtils.logUnexpectedException(LOGGER, "Couldn't prepare child model context", e); status = TaskRunResult.TaskRunResultStatus.PERMANENT_ERROR; diff --git a/model/workflow-impl/src/main/java/com/evolveum/midpoint/wf/impl/processors/primary/WfPrepareRootOperationTaskHandler.java b/model/workflow-impl/src/main/java/com/evolveum/midpoint/wf/impl/processors/primary/WfPrepareRootOperationTaskHandler.java index d84487dc516..2cc276604a7 100644 --- a/model/workflow-impl/src/main/java/com/evolveum/midpoint/wf/impl/processors/primary/WfPrepareRootOperationTaskHandler.java +++ b/model/workflow-impl/src/main/java/com/evolveum/midpoint/wf/impl/processors/primary/WfPrepareRootOperationTaskHandler.java @@ -70,7 +70,7 @@ public void init() { //region run method @Override - public TaskRunResult run(Task task) { + public TaskRunResult run(RunningTask task) { TaskRunResultStatus status = TaskRunResultStatus.FINISHED; diff --git a/model/workflow-impl/src/main/java/com/evolveum/midpoint/wf/impl/processors/primary/WfPropagateTaskObjectReferenceTaskHandler.java b/model/workflow-impl/src/main/java/com/evolveum/midpoint/wf/impl/processors/primary/WfPropagateTaskObjectReferenceTaskHandler.java index fd5ff64f8aa..a3be6769159 100644 --- a/model/workflow-impl/src/main/java/com/evolveum/midpoint/wf/impl/processors/primary/WfPropagateTaskObjectReferenceTaskHandler.java +++ b/model/workflow-impl/src/main/java/com/evolveum/midpoint/wf/impl/processors/primary/WfPropagateTaskObjectReferenceTaskHandler.java @@ -76,7 +76,7 @@ public void init() { //region Body @Override - public TaskRunResult run(Task task) { + public TaskRunResult run(RunningTask task) { TaskRunResult.TaskRunResultStatus status = TaskRunResult.TaskRunResultStatus.FINISHED; diff --git a/model/workflow-impl/src/main/java/com/evolveum/midpoint/wf/impl/tasks/WfProcessInstanceShadowTaskHandler.java b/model/workflow-impl/src/main/java/com/evolveum/midpoint/wf/impl/tasks/WfProcessInstanceShadowTaskHandler.java index 99669ce7010..7993f732ea9 100644 --- a/model/workflow-impl/src/main/java/com/evolveum/midpoint/wf/impl/tasks/WfProcessInstanceShadowTaskHandler.java +++ b/model/workflow-impl/src/main/java/com/evolveum/midpoint/wf/impl/tasks/WfProcessInstanceShadowTaskHandler.java @@ -34,7 +34,6 @@ import org.springframework.stereotype.Component; import javax.annotation.PostConstruct; -import java.util.List; /** * @author mederly @@ -87,7 +86,7 @@ public void init() { * */ @Override - public TaskRunResult run(Task task) { + public TaskRunResult run(RunningTask task) { OperationResult taskResult = WfTaskUtil.getResult(task); diff --git a/model/workflow-impl/src/main/java/com/evolveum/midpoint/wf/impl/tasks/WfTask.java b/model/workflow-impl/src/main/java/com/evolveum/midpoint/wf/impl/tasks/WfTask.java index 547fdac2e19..2380d4cd0e5 100644 --- a/model/workflow-impl/src/main/java/com/evolveum/midpoint/wf/impl/tasks/WfTask.java +++ b/model/workflow-impl/src/main/java/com/evolveum/midpoint/wf/impl/tasks/WfTask.java @@ -109,7 +109,7 @@ public void addDependent(WfTask wfTask) { } public void commitChanges(OperationResult result) throws SchemaException, ObjectNotFoundException, ObjectAlreadyExistsException { - task.savePendingModifications(result); + task.flushPendingModifications(result); } public void resumeTask(OperationResult result) throws SchemaException, ObjectNotFoundException { @@ -122,7 +122,7 @@ public void startWaitingForSubtasks(OperationResult result) throws SchemaExcepti public void setWfProcessId(String pid) throws SchemaException { processInstanceId = pid; - task.addModification( + task.modify( getPrismContext().deltaFor(TaskType.class) .item(F_WORKFLOW_CONTEXT, F_PROCESS_INSTANCE_ID).replace(pid) .asItemDelta()); @@ -130,7 +130,7 @@ public void setWfProcessId(String pid) throws SchemaException { public void setProcessInstanceEndTimestamp() throws SchemaException, ObjectNotFoundException, ObjectAlreadyExistsException { XMLGregorianCalendar now = XmlTypeConverter.createXMLGregorianCalendar(new Date()); - task.addModification( + task.modify( getPrismContext().deltaFor(TaskType.class) .item(F_WORKFLOW_CONTEXT, F_END_TIMESTAMP).replace(now) .asItemDelta()); @@ -233,14 +233,14 @@ public PrismObject getRequesterIfExists(OperationResult result) { } public void setOutcome(String outcome) throws SchemaException { - task.addModifications(getPrismContext().deltaFor(TaskType.class) + task.modify(getPrismContext().deltaFor(TaskType.class) .item(F_WORKFLOW_CONTEXT, F_OUTCOME).replace(outcome) .asItemDeltas()); } public void setProcessInstanceStageInformation(Integer stageNumber, Integer stageCount, String stageName, String stageDisplayName) throws SchemaException { - task.addModifications(getPrismContext().deltaFor(TaskType.class) + task.modify(getPrismContext().deltaFor(TaskType.class) .item(F_WORKFLOW_CONTEXT, F_STAGE_NUMBER).replace(stageNumber) .asItemDeltas()); } diff --git a/model/workflow-impl/src/main/java/com/evolveum/midpoint/wf/impl/tasks/WfTaskController.java b/model/workflow-impl/src/main/java/com/evolveum/midpoint/wf/impl/tasks/WfTaskController.java index 30cf769b2da..42cabea2e95 100644 --- a/model/workflow-impl/src/main/java/com/evolveum/midpoint/wf/impl/tasks/WfTaskController.java +++ b/model/workflow-impl/src/main/java/com/evolveum/midpoint/wf/impl/tasks/WfTaskController.java @@ -181,7 +181,7 @@ private Task submitTask(WfTaskCreationInstruction instruction, Task parentTask, /** * Beware, in order to make the change permanent, it is necessary to call commitChanges on * "executesFirst". It is advisable not to modify underlying tasks between 'addDependency' - * and 'commitChanges' because of the savePendingModifications() mechanism that is used here. + * and 'commitChanges' because of the flushPendingModifications() mechanism that is used here. * * @param executesFirst * @param executesSecond diff --git a/model/workflow-impl/src/main/java/com/evolveum/midpoint/wf/impl/tasks/WfTaskUtil.java b/model/workflow-impl/src/main/java/com/evolveum/midpoint/wf/impl/tasks/WfTaskUtil.java index f2d11e49ac8..2bdf8816c88 100644 --- a/model/workflow-impl/src/main/java/com/evolveum/midpoint/wf/impl/tasks/WfTaskUtil.java +++ b/model/workflow-impl/src/main/java/com/evolveum/midpoint/wf/impl/tasks/WfTaskUtil.java @@ -169,7 +169,7 @@ public void storeResultingDeltas(ObjectTreeDeltas deltas, Task task) throws Sche .findContainerDefinitionByCompileTimeClass(WfPrimaryChangeProcessorStateType.class) .findPropertyDefinition(F_RESULTING_DELTAS); ItemPath path = ItemPath.create(F_WORKFLOW_CONTEXT, F_PROCESSOR_SPECIFIC_STATE, F_RESULTING_DELTAS); - task.addModification(prismContext.deltaFor(TaskType.class) + task.modify(prismContext.deltaFor(TaskType.class) .item(path, def).replace(deltasType) .asItemDelta()); if (LOGGER.isTraceEnabled()) { @@ -202,7 +202,7 @@ public void setRootTaskOidImmediate(Task task, String oid, OperationResult resul if (StringUtils.isNotEmpty(oid)) { values.add(createObjectRef(oid, TASK).asReferenceValue()); } - task.addModificationImmediate( + task.modifyAndFlush( prismContext.deltaFor(TaskType.class) .item(F_WORKFLOW_CONTEXT, F_ROOT_TASK_REF).replace(values) .asItemDelta(), diff --git a/provisioning/provisioning-impl/src/main/java/com/evolveum/midpoint/provisioning/impl/ProvisioningServiceImpl.java b/provisioning/provisioning-impl/src/main/java/com/evolveum/midpoint/provisioning/impl/ProvisioningServiceImpl.java index 1a10800952c..253a4056612 100644 --- a/provisioning/provisioning-impl/src/main/java/com/evolveum/midpoint/provisioning/impl/ProvisioningServiceImpl.java +++ b/provisioning/provisioning-impl/src/main/java/com/evolveum/midpoint/provisioning/impl/ProvisioningServiceImpl.java @@ -383,12 +383,9 @@ public int synchronize(ResourceShadowDiscriminator shadowCoordinates, Task task, @SuppressWarnings("rawtypes") private PrismProperty getTokenProperty(ResourceShadowDiscriminator shadowCoordinates, Task task, OperationResult result) throws ObjectNotFoundException, CommunicationException, SchemaException, ConfigurationException, ExpressionEvaluationException { - PrismProperty tokenProperty = null; - if (task.getExtension() != null) { - tokenProperty = task.getExtensionProperty(SchemaConstants.SYNC_TOKEN); - } + PrismProperty tokenProperty = task.getExtensionProperty(SchemaConstants.SYNC_TOKEN); - if (tokenProperty != null && (tokenProperty.getAnyRealValue() == null)) { + if (tokenProperty != null && tokenProperty.getAnyRealValue() == null) { LOGGER.warn("Sync token exists, but it is empty (null value). Ignoring it."); if (LOGGER.isTraceEnabled()) { LOGGER.trace("Empty sync token property:\n{}", tokenProperty.debugDump()); diff --git a/provisioning/provisioning-impl/src/main/java/com/evolveum/midpoint/provisioning/impl/ShadowCache.java b/provisioning/provisioning-impl/src/main/java/com/evolveum/midpoint/provisioning/impl/ShadowCache.java index a6f390dee95..ecc5a02c307 100644 --- a/provisioning/provisioning-impl/src/main/java/com/evolveum/midpoint/provisioning/impl/ShadowCache.java +++ b/provisioning/provisioning-impl/src/main/java/com/evolveum/midpoint/provisioning/impl/ShadowCache.java @@ -53,6 +53,7 @@ import com.evolveum.midpoint.schema.util.ResourceTypeUtil; import com.evolveum.midpoint.schema.util.SchemaDebugUtil; import com.evolveum.midpoint.schema.util.ShadowUtil; +import com.evolveum.midpoint.task.api.RunningTask; import com.evolveum.midpoint.task.api.Task; import com.evolveum.midpoint.task.api.TaskManager; import com.evolveum.midpoint.util.DebugUtil; @@ -2391,27 +2392,29 @@ public int synchronize(ResourceShadowDiscriminator shadowCoordinates, PrismPrope PrismProperty newToken = change.getToken(); task.setExtensionProperty(newToken); processedChanges++; - task.incrementProgressAndStoreStatsIfNeeded(); + if (task instanceof RunningTask) { + ((RunningTask) task).incrementProgressAndStoreStatsIfNeeded(); + } LOGGER.debug( "Skipping processing change. Can't find appropriate shadow (e.g. the object was deleted on the resource meantime)."); continue; } boolean isSuccess = processSynchronization(shadowCtx, change, parentResult); - boolean retryUnhandledError = true; - if (task.getExtension() != null) { - PrismProperty tokenRetryUnhandledErrProperty = task.getExtensionProperty(SchemaConstants.SYNC_TOKEN_RETRY_UNHANDLED); - - if (tokenRetryUnhandledErrProperty != null) { - retryUnhandledError = (boolean) tokenRetryUnhandledErrProperty.getRealValue(); - } - } - + boolean retryUnhandledError = true; + + PrismProperty tokenRetryUnhandledErrProperty = task.getExtensionProperty(SchemaConstants.SYNC_TOKEN_RETRY_UNHANDLED); + if (tokenRetryUnhandledErrProperty != null) { + retryUnhandledError = (boolean) tokenRetryUnhandledErrProperty.getRealValue(); + } + if (!retryUnhandledError || isSuccess) { // get updated token from change, create property modification from new token and replace old token with the new one task.setExtensionProperty(change.getToken()); processedChanges++; - task.incrementProgressAndStoreStatsIfNeeded(); + if (task instanceof RunningTask) { + ((RunningTask) task).incrementProgressAndStoreStatsIfNeeded(); + } } } @@ -2420,7 +2423,7 @@ public int synchronize(ResourceShadowDiscriminator shadowCoordinates, PrismPrope LOGGER.trace("No changes to synchronize on {}", ctx.getResource()); task.setExtensionProperty(lastToken); } - task.savePendingModifications(parentResult); + task.flushPendingModifications(parentResult); return processedChanges; } catch (SchemaException | CommunicationException | GenericFrameworkException | ConfigurationException | diff --git a/provisioning/provisioning-impl/src/main/java/com/evolveum/midpoint/provisioning/impl/task/MultiPropagationResultHandler.java b/provisioning/provisioning-impl/src/main/java/com/evolveum/midpoint/provisioning/impl/task/MultiPropagationResultHandler.java index bce1777fa5b..7a73cbe5c34 100644 --- a/provisioning/provisioning-impl/src/main/java/com/evolveum/midpoint/provisioning/impl/task/MultiPropagationResultHandler.java +++ b/provisioning/provisioning-impl/src/main/java/com/evolveum/midpoint/provisioning/impl/task/MultiPropagationResultHandler.java @@ -25,6 +25,7 @@ import com.evolveum.midpoint.repo.common.task.AbstractSearchIterativeResultHandler; import com.evolveum.midpoint.schema.ResultHandler; import com.evolveum.midpoint.schema.result.OperationResult; +import com.evolveum.midpoint.task.api.RunningTask; import com.evolveum.midpoint.task.api.Task; import com.evolveum.midpoint.task.api.TaskManager; import com.evolveum.midpoint.util.exception.CommonException; @@ -45,14 +46,14 @@ public class MultiPropagationResultHandler extends AbstractSearchIterativeResult private final RepositoryService repositoryService; private final ShadowCache shadowCache; - public MultiPropagationResultHandler(Task coordinatorTask, String taskOperationPrefix, TaskManager taskManager, RepositoryService repositoryService, ShadowCache shadowCache) { + public MultiPropagationResultHandler(RunningTask coordinatorTask, String taskOperationPrefix, TaskManager taskManager, RepositoryService repositoryService, ShadowCache shadowCache) { super(coordinatorTask, taskOperationPrefix, "propagation", "multipropagation", null, taskManager); this.repositoryService = repositoryService; this.shadowCache = shadowCache; } @Override - protected boolean handleObject(PrismObject resource, Task workerTask, OperationResult taskResult) + protected boolean handleObject(PrismObject resource, RunningTask workerTask, OperationResult taskResult) throws CommonException { LOGGER.trace("Propagating provisioning operations on {}", resource); diff --git a/provisioning/provisioning-impl/src/main/java/com/evolveum/midpoint/provisioning/impl/task/MultiPropagationTaskHandler.java b/provisioning/provisioning-impl/src/main/java/com/evolveum/midpoint/provisioning/impl/task/MultiPropagationTaskHandler.java index 745e3d6084e..b136a1151da 100644 --- a/provisioning/provisioning-impl/src/main/java/com/evolveum/midpoint/provisioning/impl/task/MultiPropagationTaskHandler.java +++ b/provisioning/provisioning-impl/src/main/java/com/evolveum/midpoint/provisioning/impl/task/MultiPropagationTaskHandler.java @@ -17,6 +17,7 @@ import javax.annotation.PostConstruct; +import com.evolveum.midpoint.task.api.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @@ -25,10 +26,6 @@ import com.evolveum.midpoint.schema.constants.SchemaConstants; import com.evolveum.midpoint.schema.result.OperationConstants; import com.evolveum.midpoint.schema.result.OperationResult; -import com.evolveum.midpoint.task.api.Task; -import com.evolveum.midpoint.task.api.TaskCategory; -import com.evolveum.midpoint.task.api.TaskManager; -import com.evolveum.midpoint.task.api.TaskRunResult; import com.evolveum.midpoint.util.logging.Trace; import com.evolveum.midpoint.util.logging.TraceManager; import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType; @@ -74,7 +71,7 @@ private void initialize() { } @Override - protected MultiPropagationResultHandler createHandler(TaskRunResult runResult, Task coordinatorTask, + protected MultiPropagationResultHandler createHandler(TaskRunResult runResult, RunningTask coordinatorTask, OperationResult opResult) { MultiPropagationResultHandler handler = new MultiPropagationResultHandler(coordinatorTask, getTaskOperationPrefix(), taskManager, repositoryService, shadowCache); diff --git a/provisioning/provisioning-impl/src/main/java/com/evolveum/midpoint/provisioning/impl/task/PropagationResultHandler.java b/provisioning/provisioning-impl/src/main/java/com/evolveum/midpoint/provisioning/impl/task/PropagationResultHandler.java index 7bf22683dfd..ce1067b920f 100644 --- a/provisioning/provisioning-impl/src/main/java/com/evolveum/midpoint/provisioning/impl/task/PropagationResultHandler.java +++ b/provisioning/provisioning-impl/src/main/java/com/evolveum/midpoint/provisioning/impl/task/PropagationResultHandler.java @@ -22,7 +22,7 @@ import com.evolveum.midpoint.repo.api.PreconditionViolationException; import com.evolveum.midpoint.repo.common.task.AbstractSearchIterativeResultHandler; import com.evolveum.midpoint.schema.result.OperationResult; -import com.evolveum.midpoint.task.api.Task; +import com.evolveum.midpoint.task.api.RunningTask; import com.evolveum.midpoint.task.api.TaskManager; import com.evolveum.midpoint.util.exception.CommonException; import com.evolveum.midpoint.util.exception.SystemException; @@ -43,19 +43,19 @@ public class PropagationResultHandler extends AbstractSearchIterativeResultHandl private final ShadowCache shadowCache; private final PrismObject resource; - public PropagationResultHandler(Task coordinatorTask, String taskOperationPrefix, TaskManager taskManager, ShadowCache shadowCache, PrismObject resource) { + public PropagationResultHandler(RunningTask coordinatorTask, String taskOperationPrefix, TaskManager taskManager, ShadowCache shadowCache, PrismObject resource) { super(coordinatorTask, taskOperationPrefix, "propagation", "to "+resource, null, taskManager); this.shadowCache = shadowCache; this.resource = resource; } - + protected PrismObject getResource() { return resource; } @Override - protected boolean handleObject(PrismObject shadow, Task workerTask, OperationResult result) - throws CommonException, PreconditionViolationException { + protected boolean handleObject(PrismObject shadow, RunningTask workerTask, OperationResult result) + throws CommonException { try { shadowCache.propagateOperations(resource, shadow, workerTask, result); } catch (GenericFrameworkException | EncryptionException e) { diff --git a/provisioning/provisioning-impl/src/main/java/com/evolveum/midpoint/provisioning/impl/task/PropagationTaskHandler.java b/provisioning/provisioning-impl/src/main/java/com/evolveum/midpoint/provisioning/impl/task/PropagationTaskHandler.java index 4428c74dfac..111e386a05e 100644 --- a/provisioning/provisioning-impl/src/main/java/com/evolveum/midpoint/provisioning/impl/task/PropagationTaskHandler.java +++ b/provisioning/provisioning-impl/src/main/java/com/evolveum/midpoint/provisioning/impl/task/PropagationTaskHandler.java @@ -17,6 +17,7 @@ import javax.annotation.PostConstruct; +import com.evolveum.midpoint.task.api.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @@ -29,10 +30,6 @@ import com.evolveum.midpoint.schema.constants.SchemaConstants; import com.evolveum.midpoint.schema.result.OperationConstants; import com.evolveum.midpoint.schema.result.OperationResult; -import com.evolveum.midpoint.task.api.Task; -import com.evolveum.midpoint.task.api.TaskCategory; -import com.evolveum.midpoint.task.api.TaskManager; -import com.evolveum.midpoint.task.api.TaskRunResult; import com.evolveum.midpoint.task.api.TaskRunResult.TaskRunResultStatus; import com.evolveum.midpoint.util.exception.CommunicationException; import com.evolveum.midpoint.util.exception.ConfigurationException; @@ -82,7 +79,7 @@ private void initialize() { } @Override - protected PropagationResultHandler createHandler(TaskRunResult runResult, Task coordinatorTask, + protected PropagationResultHandler createHandler(TaskRunResult runResult, RunningTask coordinatorTask, OperationResult opResult) { String resourceOid = coordinatorTask.getObjectOid(); diff --git a/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/impl/mock/SynchronizationServiceMock.java b/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/impl/mock/SynchronizationServiceMock.java index 2e33c7dc9a7..9ac4315bbe2 100644 --- a/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/impl/mock/SynchronizationServiceMock.java +++ b/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/impl/mock/SynchronizationServiceMock.java @@ -178,7 +178,7 @@ private static boolean isDryRun(Task task){ Validate.notNull(task, "Task must not be null."); - if (task.getExtension() == null){ + if (!task.hasExtension()) { return false; } diff --git a/repo/repo-common/src/main/java/com/evolveum/midpoint/repo/common/task/AbstractSearchIterativeResultHandler.java b/repo/repo-common/src/main/java/com/evolveum/midpoint/repo/common/task/AbstractSearchIterativeResultHandler.java index 181c63e66c9..a38c6dd14a6 100644 --- a/repo/repo-common/src/main/java/com/evolveum/midpoint/repo/common/task/AbstractSearchIterativeResultHandler.java +++ b/repo/repo-common/src/main/java/com/evolveum/midpoint/repo/common/task/AbstractSearchIterativeResultHandler.java @@ -25,6 +25,7 @@ import com.evolveum.midpoint.schema.statistics.StatisticsUtil; import com.evolveum.midpoint.schema.util.ExceptionUtil; import com.evolveum.midpoint.task.api.LightweightTaskHandler; +import com.evolveum.midpoint.task.api.RunningTask; import com.evolveum.midpoint.task.api.TaskManager; import com.evolveum.midpoint.util.exception.SystemException; import org.apache.commons.lang.StringUtils; @@ -68,7 +69,7 @@ public abstract class AbstractSearchIterativeResultHandler protected static final long REQUEST_QUEUE_OFFER_TIMEOUT = 1000L; private final TaskManager taskManager; - private final Task coordinatorTask; + private final RunningTask coordinatorTask; private final String taskOperationPrefix; private final String processShortName; private String contextDesc; @@ -93,7 +94,7 @@ public abstract class AbstractSearchIterativeResultHandler private TaskStageType stageType; - public AbstractSearchIterativeResultHandler(Task coordinatorTask, String taskOperationPrefix, String processShortName, + public AbstractSearchIterativeResultHandler(RunningTask coordinatorTask, String taskOperationPrefix, String processShortName, String contextDesc, TaskManager taskManager) { this(coordinatorTask, taskOperationPrefix, processShortName, contextDesc, null, taskManager); } @@ -292,7 +293,7 @@ public WorkerHandler(OperationResult workerSpecificResult) { } @Override - public void run(Task workerTask) { + public void run(RunningTask workerTask) { // temporary hack: how to see thread name for this task workerTask.setName(workerTask.getName().getOrig() + " (" + Thread.currentThread().getName() + ")"); @@ -318,7 +319,7 @@ public void run(Task workerTask) { } } - private void processRequest(ProcessingRequest request, Task workerTask, OperationResult parentResult) { + private void processRequest(ProcessingRequest request, RunningTask workerTask, OperationResult parentResult) { PrismObject object = request.object; @@ -394,7 +395,7 @@ private void processRequest(ProcessingRequest request, Task workerTask, Operatio long duration = System.currentTimeMillis()-startTime; long total = totalTimeProcessing.addAndGet(duration); - int progress = objectsProcessed.incrementAndGet(); + long progress = objectsProcessed.incrementAndGet(); result.addContext(OperationResult.CONTEXT_PROGRESS, progress); @@ -408,7 +409,7 @@ private void processRequest(ProcessingRequest request, Task workerTask, Operatio workerTask.setProgress(workerTask.getProgress()+1); } // todo report current op result? - coordinatorTask.storeOperationStatsIfNeeded(); // includes savePendingModifications + coordinatorTask.storeOperationStatsIfNeeded(); // includes flushPendingModifications } if (logObjectProgress) { @@ -521,7 +522,7 @@ public void setLogErrors(boolean logErrors) { this.logErrors = logErrors; } - protected abstract boolean handleObject(PrismObject object, Task workerTask, OperationResult result) throws CommonException, PreconditionViolationException; + protected abstract boolean handleObject(PrismObject object, RunningTask workerTask, OperationResult result) throws CommonException, PreconditionViolationException; public class ProcessingRequest { public PrismObject object; @@ -531,7 +532,7 @@ public ProcessingRequest(PrismObject object) { } } - public void createWorkerThreads(Task coordinatorTask, OperationResult opResult) { + public void createWorkerThreads(RunningTask coordinatorTask, OperationResult opResult) { Integer threadsCount = getWorkerThreadsCount(coordinatorTask); if (threadsCount == null || threadsCount == 0) { return; // nothing to do @@ -549,7 +550,7 @@ public void createWorkerThreads(Task coordinatorTask, OperationResult opResult) workerSpecificResult.addContext("subtaskIndex", i+1); workerSpecificResults.add(workerSpecificResult); - Task subtask = coordinatorTask.createSubtask(new WorkerHandler(workerSpecificResult)); + RunningTask subtask = coordinatorTask.createSubtask(new WorkerHandler(workerSpecificResult)); if (isEnableIterationStatistics()) { subtask.resetIterativeTaskInformation(null); } diff --git a/repo/repo-common/src/main/java/com/evolveum/midpoint/repo/common/task/AbstractSearchIterativeTaskHandler.java b/repo/repo-common/src/main/java/com/evolveum/midpoint/repo/common/task/AbstractSearchIterativeTaskHandler.java index 04780bb53f4..550f31d993d 100644 --- a/repo/repo-common/src/main/java/com/evolveum/midpoint/repo/common/task/AbstractSearchIterativeTaskHandler.java +++ b/repo/repo-common/src/main/java/com/evolveum/midpoint/repo/common/task/AbstractSearchIterativeTaskHandler.java @@ -170,7 +170,7 @@ public StatisticsCollectionStrategy getStatisticsCollectionStrategy() { } @Override - public TaskWorkBucketProcessingResult run(Task localCoordinatorTask, WorkBucketType workBucket, + public TaskWorkBucketProcessingResult run(RunningTask localCoordinatorTask, WorkBucketType workBucket, TaskWorkBucketProcessingResult previousRunResult) { LOGGER.trace("{} run starting: local coordinator task {}, bucket {}, previous run result {}", taskName, localCoordinatorTask, workBucket, previousRunResult); @@ -244,7 +244,7 @@ public TaskWorkBucketProcessingResult run(Task localCoordinatorTask, WorkBucketT localCoordinatorTask.setExpectedTotal(expectedTotal); } try { - localCoordinatorTask.savePendingModifications(opResult); + localCoordinatorTask.flushPendingModifications(opResult); } catch (ObjectAlreadyExistsException e) { // other exceptions are handled in the outer try block throw new IllegalStateException( "Unexpected ObjectAlreadyExistsException when updating task progress/expectedTotal", e); @@ -347,7 +347,7 @@ protected String getDefaultChannel() { } private Collection> updateSearchOptionsWithIterationMethod( - Collection> searchOptions, Task localCoordinatorTask) { + Collection> searchOptions, RunningTask localCoordinatorTask) { Collection> rv; IterationMethodType iterationMethod = getIterationMethodFromTask(localCoordinatorTask); if (iterationMethod != null) { @@ -433,7 +433,7 @@ private ObjectQuery prepareQuery(H resultHandler, return query; } - private H setupHandler(TaskWorkBucketProcessingResult runResult, Task localCoordinatorTask, OperationResult opResult) + private H setupHandler(TaskWorkBucketProcessingResult runResult, RunningTask localCoordinatorTask, OperationResult opResult) throws ExitWorkBucketHandlerException { try { H resultHandler = createHandler(runResult, localCoordinatorTask, opResult); @@ -491,7 +491,7 @@ private TaskWorkBucketProcessingResult logErrorAndSetResult(TaskWorkBucketProces } - protected void finish(H handler, TaskRunResult runResult, Task task, OperationResult opResult) throws SchemaException { + protected void finish(H handler, TaskRunResult runResult, RunningTask task, OperationResult opResult) throws SchemaException { } private H getHandler(Task task) { @@ -535,7 +535,7 @@ protected boolean requiresDirectRepositoryAccess(H resultHandler, TaskRunResult protected abstract Class getType(Task task); - protected abstract H createHandler(TaskRunResult runResult, Task coordinatorTask, + protected abstract H createHandler(TaskRunResult runResult, RunningTask coordinatorTask, OperationResult opResult) throws SchemaException, SecurityViolationException, ObjectNotFoundException, ExpressionEvaluationException, CommunicationException, ConfigurationException; /** diff --git a/repo/repo-common/src/main/java/com/evolveum/midpoint/repo/common/task/TaskHandlerUtil.java b/repo/repo-common/src/main/java/com/evolveum/midpoint/repo/common/task/TaskHandlerUtil.java index a949cdffde8..cca7777c646 100644 --- a/repo/repo-common/src/main/java/com/evolveum/midpoint/repo/common/task/TaskHandlerUtil.java +++ b/repo/repo-common/src/main/java/com/evolveum/midpoint/repo/common/task/TaskHandlerUtil.java @@ -19,6 +19,7 @@ import com.evolveum.midpoint.schema.result.OperationResult; import com.evolveum.midpoint.schema.result.OperationResultStatus; import com.evolveum.midpoint.schema.statistics.IterativeTaskInformation; +import com.evolveum.midpoint.task.api.RunningTask; import com.evolveum.midpoint.task.api.Task; import com.evolveum.midpoint.util.logging.Trace; import com.evolveum.midpoint.util.logging.TraceManager; @@ -32,7 +33,7 @@ public class TaskHandlerUtil { private static final transient Trace LOGGER = TraceManager.getTrace(TaskHandlerUtil.class); - public static void appendLastFailuresInformation(String operationNamePrefix, Task task, OperationResult result) { + public static void appendLastFailuresInformation(String operationNamePrefix, RunningTask task, OperationResult result) { appendLastFailuresInformation(operationNamePrefix, task, false, result); for (Task subtask : task.getLightweightAsynchronousSubtasks()) { appendLastFailuresInformation(operationNamePrefix, subtask, true, result); diff --git a/repo/repo-sql-impl-test/src/test/java/com/evolveum/midpoint/repo/sql/util/SimpleTaskAdapter.java b/repo/repo-sql-impl-test/src/test/java/com/evolveum/midpoint/repo/sql/util/SimpleTaskAdapter.java index ff5191ee589..c84b70cf940 100644 --- a/repo/repo-sql-impl-test/src/test/java/com/evolveum/midpoint/repo/sql/util/SimpleTaskAdapter.java +++ b/repo/repo-sql-impl-test/src/test/java/com/evolveum/midpoint/repo/sql/util/SimpleTaskAdapter.java @@ -16,14 +16,7 @@ package com.evolveum.midpoint.repo.sql.util; -import com.evolveum.midpoint.prism.Containerable; -import com.evolveum.midpoint.prism.Item; -import com.evolveum.midpoint.prism.ItemDefinition; -import com.evolveum.midpoint.prism.PrismContainer; -import com.evolveum.midpoint.prism.PrismObject; -import com.evolveum.midpoint.prism.PrismProperty; -import com.evolveum.midpoint.prism.PrismReference; -import com.evolveum.midpoint.prism.PrismValue; +import com.evolveum.midpoint.prism.*; import com.evolveum.midpoint.prism.delta.ChangeType; import com.evolveum.midpoint.prism.delta.ItemDelta; import com.evolveum.midpoint.prism.path.ItemName; @@ -31,16 +24,15 @@ import com.evolveum.midpoint.schema.statistics.ProvisioningOperation; import com.evolveum.midpoint.schema.statistics.SynchronizationInformation; import com.evolveum.midpoint.task.api.*; -import com.evolveum.midpoint.util.exception.ObjectAlreadyExistsException; -import com.evolveum.midpoint.util.exception.ObjectNotFoundException; -import com.evolveum.midpoint.util.exception.SchemaException; import com.evolveum.midpoint.xml.ns._public.common.common_3.*; import com.evolveum.prism.xml.ns._public.types_3.PolyStringType; import org.jetbrains.annotations.NotNull; import javax.xml.namespace.QName; - -import java.util.*; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.Map; import static java.util.Collections.emptyMap; import static java.util.Collections.emptySet; @@ -106,7 +98,7 @@ public boolean isSingle() { } @Override - public boolean isCycle() { + public boolean isRecurring() { throw new UnsupportedOperationException("not implemented yet."); } @@ -136,8 +128,7 @@ public void setBinding(TaskBinding value) { } @Override - public void setBindingImmediate(TaskBinding value, OperationResult parentResult) - throws ObjectNotFoundException, SchemaException { + public void setBindingImmediate(TaskBinding value, OperationResult parentResult) { throw new UnsupportedOperationException("not implemented yet."); } @@ -152,8 +143,7 @@ public void setHandlerUri(String value) { } @Override - public void setHandlerUriImmediate(String value, OperationResult parentResult) - throws ObjectNotFoundException, SchemaException { + public void setHandlerUriImmediate(String value, OperationResult parentResult) { throw new UnsupportedOperationException("not implemented yet."); } @@ -215,8 +205,7 @@ public String getOid() { } @Override - public PrismObject getObject(Class type, OperationResult parentResult) - throws ObjectNotFoundException, SchemaException { + public PrismObject getObject(Class type, OperationResult parentResult) { throw new UnsupportedOperationException("not implemented yet."); } @@ -261,8 +250,7 @@ public void setResult(OperationResult result) { } @Override - public void setResultImmediate(OperationResult result, OperationResult parentResult) - throws ObjectNotFoundException, SchemaException { + public void setResultImmediate(OperationResult result, OperationResult parentResult) { throw new UnsupportedOperationException("not implemented yet."); } @@ -297,85 +285,62 @@ public void setName(String value) { } @Override - public void setNameImmediate(PolyStringType value, OperationResult parentResult) - throws ObjectNotFoundException, SchemaException, ObjectAlreadyExistsException { - throw new UnsupportedOperationException("not implemented yet."); - } - - @Override - public PrismContainer getExtension() { + public void setNameImmediate(PolyStringType value, OperationResult parentResult) { throw new UnsupportedOperationException("not implemented yet."); } - @Override - public PrismProperty getExtensionProperty(QName propertyName) { - throw new UnsupportedOperationException("not implemented yet."); - } - - @Override - public T getExtensionPropertyRealValue(QName propertyName) { - throw new UnsupportedOperationException("not implemented yet."); - } - - @Override - public T getExtensionContainerRealValue(QName containerName) { - return null; - } - @Override public Item getExtensionItem(ItemName propertyName) { throw new UnsupportedOperationException("not implemented yet."); } @Override - public void setExtensionContainer(PrismContainer item) throws SchemaException { + public void setExtensionContainer(PrismContainer item) { throw new UnsupportedOperationException("not implemented yet."); } @Override - public void setExtensionReference(PrismReference reference) throws SchemaException { + public void setExtensionReference(PrismReference reference) { throw new UnsupportedOperationException("not implemented yet."); } @Override - public void setExtensionProperty(PrismProperty property) throws SchemaException { + public void setExtensionProperty(PrismProperty property) { throw new UnsupportedOperationException("not implemented yet."); } @Override - public void setExtensionPropertyImmediate(PrismProperty property, OperationResult parentResult) - throws ObjectNotFoundException, SchemaException { + public void setExtensionPropertyImmediate(PrismProperty property, OperationResult parentResult) { throw new UnsupportedOperationException("not implemented yet."); } @Override - public void addExtensionProperty(PrismProperty property) throws SchemaException { + public void addExtensionProperty(PrismProperty property) { throw new UnsupportedOperationException("not implemented yet."); } @Override - public void setExtensionPropertyValue(QName propertyName, T value) throws SchemaException { + public void setExtensionPropertyValue(QName propertyName, T value) { throw new UnsupportedOperationException("not implemented yet."); } @Override - public void setExtensionPropertyValueTransient(QName propertyName, T value) throws SchemaException { + public void setExtensionPropertyValueTransient(QName propertyName, T value) { throw new UnsupportedOperationException("not implemented yet."); } @Override - public void setExtensionContainerValue(QName containerName, T value) - throws SchemaException { + public void setExtensionContainerValue(QName containerName, T value) { throw new UnsupportedOperationException("not implemented yet."); } @Override - public void setExtensionItem(Item item) throws SchemaException { + public void setExtensionItem(Item item) { throw new UnsupportedOperationException("not implemented yet."); } @Override - public void modifyExtension(ItemDelta itemDelta) throws SchemaException { + public void modifyExtension(ItemDelta itemDelta) { throw new UnsupportedOperationException("not implemented yet."); } @@ -385,18 +350,17 @@ public long getProgress() { } @Override - public void setProgress(long value) { + public void setProgress(Long value) { throw new UnsupportedOperationException("not implemented yet."); } @Override - public void setProgressImmediate(long progress, OperationResult parentResult) - throws ObjectNotFoundException, SchemaException { + public void setProgressImmediate(Long progress, OperationResult parentResult) { throw new UnsupportedOperationException("not implemented yet."); } @Override - public void setProgressTransient(long value) { + public void setProgressTransient(Long value) { } @Override @@ -410,7 +374,7 @@ public TaskType getTaskType() { } @Override - public void refresh(OperationResult parentResult) throws ObjectNotFoundException, SchemaException { + public void refresh(OperationResult parentResult) { throw new UnsupportedOperationException("not implemented yet."); } @@ -425,13 +389,7 @@ public String debugDump(int indent) { } @Override - public boolean canRun() { - throw new UnsupportedOperationException("not implemented yet."); - } - - @Override - public void savePendingModifications(OperationResult parentResult) - throws ObjectNotFoundException, SchemaException, ObjectAlreadyExistsException { + public void flushPendingModifications(OperationResult parentResult) { throw new UnsupportedOperationException("not implemented yet."); } @@ -486,8 +444,42 @@ public void setCategory(String category) { } @Override - public void setDescriptionImmediate(String value, OperationResult parentResult) - throws ObjectNotFoundException, SchemaException { + public PrismContainer getExtension() { + return null; + } + + @Override + public PrismContainer getExtensionClone() { + return null; + } + + @Override + public boolean hasExtension() { + return false; + } + + @Override + public PrismProperty getExtensionProperty(ItemName propertyName) { + return null; + } + + @Override + public T getExtensionPropertyRealValue(ItemName propertyName) { + return null; + } + + @Override + public T getExtensionContainerRealValue(ItemName containerName) { + return null; + } + + @Override + public PrismReference getExtensionReference(ItemName name) { + return null; + } + + @Override + public void setDescriptionImmediate(String value, OperationResult parentResult) { throw new UnsupportedOperationException("not implemented yet."); } @@ -502,7 +494,7 @@ public String getDescription() { } @Override - public void deleteExtensionProperty(PrismProperty property) throws SchemaException { + public void deleteExtensionProperty(PrismProperty property) { throw new UnsupportedOperationException("not implemented yet."); } @@ -526,26 +518,6 @@ public Task createSubtask() { throw new UnsupportedOperationException("not implemented yet."); } - @Override - public Task createSubtask(LightweightTaskHandler handler) { - throw new UnsupportedOperationException("not implemented yet."); - } - -// @Deprecated -// @Override -// public TaskRunResult waitForSubtasks(Integer interval, OperationResult parentResult) -// throws ObjectNotFoundException, SchemaException, ObjectAlreadyExistsException { -// throw new UnsupportedOperationException("not implemented yet."); -// } -// -// @Deprecated -// @Override -// public TaskRunResult waitForSubtasks(Integer interval, Collection> extensionDeltas, -// OperationResult parentResult) -// throws ObjectNotFoundException, SchemaException, ObjectAlreadyExistsException { -// throw new UnsupportedOperationException("not implemented yet."); -// } - @Override public String getParent() { throw new UnsupportedOperationException("not implemented yet."); @@ -568,23 +540,23 @@ public void pushHandlerUri(String uri, ScheduleType schedule, TaskBinding bindin } @Override - public void finishHandler(OperationResult parentResult) throws ObjectNotFoundException, SchemaException { + public void finishHandler(OperationResult parentResult) { throw new UnsupportedOperationException("not implemented yet."); } @NotNull @Override - public List listSubtasks(boolean persistentOnly, OperationResult parentResult) throws SchemaException { + public List listSubtasks(boolean persistentOnly, OperationResult parentResult) { throw new UnsupportedOperationException("not implemented yet."); } @Override - public List listPrerequisiteTasks(OperationResult parentResult) throws SchemaException { + public List listPrerequisiteTasks(OperationResult parentResult) { throw new UnsupportedOperationException("not implemented yet."); } @Override - public void startWaitingForTasksImmediate(OperationResult result) throws SchemaException, ObjectNotFoundException { + public void startWaitingForTasksImmediate(OperationResult result) { throw new UnsupportedOperationException("not implemented yet."); } @@ -599,17 +571,12 @@ public void deleteDependent(String value) { } @Override - public List listDependents(OperationResult result) throws SchemaException, ObjectNotFoundException { - throw new UnsupportedOperationException("not implemented yet."); - } - - @Override - public Task getParentTask(OperationResult result) throws SchemaException, ObjectNotFoundException { + public List listDependents(OperationResult result) { throw new UnsupportedOperationException("not implemented yet."); } @Override - public Task getParentForLightweightAsynchronousTask() { + public Task getParentTask(OperationResult result) { throw new UnsupportedOperationException("not implemented yet."); } @@ -644,23 +611,17 @@ public Long getCompletionTimestamp() { } @Override - public void setObjectRefImmediate(ObjectReferenceType value, OperationResult parentResult) - throws ObjectNotFoundException, SchemaException, ObjectAlreadyExistsException { + public void setObjectRefImmediate(ObjectReferenceType value, OperationResult parentResult) { throw new UnsupportedOperationException("not implemented yet."); } @Override - public PrismReference getExtensionReference(QName propertyName) { + public void addExtensionReference(PrismReference reference) { throw new UnsupportedOperationException("not implemented yet."); } @Override - public void addExtensionReference(PrismReference reference) throws SchemaException { - throw new UnsupportedOperationException("not implemented yet."); - } - - @Override - public List listSubtasksDeeply(boolean persistentOnly, OperationResult result) throws SchemaException { + public List listSubtasksDeeply(boolean persistentOnly, OperationResult result) { throw new UnsupportedOperationException("not implemented yet."); } @@ -675,50 +636,6 @@ public PolicyRuleType getPolicyRule() { } - @Override - public LightweightTaskHandler getLightweightTaskHandler() { - return null; - } - - @Override - public boolean isLightweightAsynchronousTask() { - return false; - } - - @Override - public Set getLightweightAsynchronousSubtasks() { - return null; - } - - @Override - public Set getRunningLightweightAsynchronousSubtasks() { - return null; - } - - @Override - public boolean lightweightHandlerStartRequested() { - return false; - } - - @Override - public void startLightweightHandler() { - } - - @Override - public void startCollectingOperationStats(@NotNull StatisticsCollectionStrategy strategy) { - - } - - @Override - public void storeOperationStatsDeferred() { - - } - - @Override - public OperationStatsType getAggregatedLiveOperationStats() { - return null; - } - @Override public Long getExpectedTotal() { return null; //To change body of implemented methods use File | Settings | File Templates. @@ -730,7 +647,7 @@ public void setExpectedTotal(Long value) { } @Override - public void setExpectedTotalImmediate(Long value, OperationResult parentResult) throws ObjectNotFoundException, SchemaException { + public void setExpectedTotalImmediate(Long value, OperationResult parentResult) { //To change body of implemented methods use File | Settings | File Templates. } @@ -813,42 +730,17 @@ public OperationStatsType getStoredOperationStats() { } @Override - public void storeOperationStats() { - - } - - @Override - public void storeOperationStatsIfNeeded() { - + public void initializeWorkflowContextImmediate(String processInstanceId, OperationResult result) { } - @Override - public Long getLastOperationStatsUpdateTimestamp() { - return null; + @Override public void modify(ItemDelta delta) { } - @Override - public void setOperationStatsUpdateInterval(long interval) { + @Override public void modify(Collection> deltas) { } - @Override - public long getOperationStatsUpdateInterval() { - return 0; - } - - @Override - public void initializeWorkflowContextImmediate(String processInstanceId, OperationResult result) throws SchemaException { - } - - @Override public void addModification(ItemDelta delta) throws SchemaException { - } - - @Override public void addModifications(Collection> deltas) throws SchemaException { - - } - - @Override public void addModificationImmediate(ItemDelta delta, OperationResult parentResult) throws SchemaException { + @Override public void modifyAndFlush(ItemDelta delta, OperationResult parentResult) { } @Override @@ -856,12 +748,7 @@ public WfContextType getWorkflowContext() { return null; } - @Override public void setWorkflowContext(WfContextType context) throws SchemaException { - } - - @Override - public void incrementProgressAndStoreStatsIfNeeded() { - + @Override public void setWorkflowContext(WfContextType context) { } @Override @@ -930,4 +817,34 @@ public TaskKindType getKind() { public String getExecutionGroup() { return null; } + + @Override + public OperationStatsType getAggregatedLiveOperationStats() { + return null; + } + + @Override + public ObjectReferenceType getSelfReference() { + return null; + } + + @Override + public String getVersion() { + return null; + } + + @Override + public Collection getTriggers() { + return null; + } + + @Override + public Collection getAssignments() { + return null; + } + + @Override + public ObjectReferenceType getOwnerRef() { + return null; + } } diff --git a/repo/task-api/src/main/java/com/evolveum/midpoint/task/api/LightweightTaskHandler.java b/repo/task-api/src/main/java/com/evolveum/midpoint/task/api/LightweightTaskHandler.java index ad2b7006856..4823975d9c9 100644 --- a/repo/task-api/src/main/java/com/evolveum/midpoint/task/api/LightweightTaskHandler.java +++ b/repo/task-api/src/main/java/com/evolveum/midpoint/task/api/LightweightTaskHandler.java @@ -26,6 +26,6 @@ @FunctionalInterface public interface LightweightTaskHandler { - public void run(Task task); + void run(RunningTask task); } diff --git a/repo/task-api/src/main/java/com/evolveum/midpoint/task/api/RunningTask.java b/repo/task-api/src/main/java/com/evolveum/midpoint/task/api/RunningTask.java new file mode 100644 index 00000000000..9437404a69a --- /dev/null +++ b/repo/task-api/src/main/java/com/evolveum/midpoint/task/api/RunningTask.java @@ -0,0 +1,102 @@ +/* + * Copyright (c) 2010-2019 Evolveum + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.evolveum.midpoint.task.api; + +import com.evolveum.midpoint.xml.ns._public.common.common_3.OperationStatsType; +import org.jetbrains.annotations.NotNull; + +import java.util.Collection; + +/** + * A task that is directly used to execute the handler code. + * + * It is a very sensitive structure. First of all, it must be thread-safe because it is used for the handler code execution + * and at the same time accessed by clients that need to check its state. There are two such situations: + * (1) Lightweight Asynchronous Tasks because they have no persistent representation. The only instance that exists + * is the one that is being executed by a handler. + * (2) When a client asks the task manager for a current state of the task (typically being interested in operational stats). + * The information could be fetched from the repository but it would be a bit outdated. This situation can be avoided + * by retrieving information always from the repository, sacrificing information timeliness a bit. But the (1) cannot. + * + * Some information related to task execution (e.g. list of lightweight asynchronous tasks, information on task thread, etc) + * is relevant only for running tasks. Therefore they are moved here. + */ +public interface RunningTask extends Task { + + /** + * Returns true if the task can run (was not interrupted). + * + * Will return false e.g. if shutdown was signaled. + * + * BEWARE: this flag is present only on the instance of the task that is being "executed", i.e. passed to + * task execution routine and task handler(s). + * + * @return true if the task can run + */ + boolean canRun(); + + /** + * Creates a transient subtask, ready to execute a given LightweightTaskHandler. + * + * Owner is inherited from parent task to subtask. + * + * @return + */ + RunningTask createSubtask(LightweightTaskHandler handler); + + + /** + * Returns the in-memory version of the parent task. Applicable only to lightweight subtasks. + * EXPERIMENTAL (use with care) + */ + RunningTask getParentForLightweightAsynchronousTask(); + + LightweightTaskHandler getLightweightTaskHandler(); + + boolean isLightweightAsynchronousTask(); + + Collection getLightweightAsynchronousSubtasks(); + + Collection getRunningLightweightAsynchronousSubtasks(); + + boolean lightweightHandlerStartRequested(); + + /** + * Starts execution of a transient task carrying a LightweightTaskHandler. + * (just a shortcut to analogous call in TaskManager) + */ + void startLightweightHandler(); + + void startCollectingOperationStats(@NotNull StatisticsCollectionStrategy strategy); + + void storeOperationStatsDeferred(); + + void storeOperationStats(); + + // stores operation statistics if the time has come + void storeOperationStatsIfNeeded(); + + Long getLastOperationStatsUpdateTimestamp(); + + void setOperationStatsUpdateInterval(long interval); + + long getOperationStatsUpdateInterval(); + + void incrementProgressAndStoreStatsIfNeeded(); + + +} diff --git a/repo/task-api/src/main/java/com/evolveum/midpoint/task/api/Task.java b/repo/task-api/src/main/java/com/evolveum/midpoint/task/api/Task.java index ec36848290c..78f0b0aaf3c 100644 --- a/repo/task-api/src/main/java/com/evolveum/midpoint/task/api/Task.java +++ b/repo/task-api/src/main/java/com/evolveum/midpoint/task/api/Task.java @@ -18,14 +18,12 @@ import java.util.Collection; import java.util.List; import java.util.Map; -import java.util.Set; import javax.xml.namespace.QName; import com.evolveum.midpoint.prism.*; import com.evolveum.midpoint.prism.delta.ItemDelta; import com.evolveum.midpoint.prism.path.ItemName; -import com.evolveum.midpoint.prism.path.ItemPath; import com.evolveum.midpoint.schema.result.OperationResult; import com.evolveum.midpoint.schema.statistics.StatisticsCollector; import com.evolveum.midpoint.util.DebugDumpable; @@ -52,7 +50,7 @@ * - A setter (set) writes data to the in-memory representation, and prepares a PropertyDelta to be * written into repository later (of course, only for persistent tasks). * - * PropertyDeltas should be then written by calling savePendingModifications method. + * PropertyDeltas should be then written by calling flushPendingModifications method. * * In case you want to write property change into the repository immediately, you have to use * setImmediate method. In that case, the property change does not go into @@ -65,6 +63,8 @@ */ public interface Task extends DebugDumpable, StatisticsCollector { + String DOT_INTERFACE = Task.class.getName() + "."; + // =================================================================== Basic information (ID, owner) /** @@ -144,7 +144,7 @@ void setNameImmediate(PolyStringType value, OperationResult parentResult) void setDescriptionImmediate(String value, OperationResult parentResult) throws ObjectNotFoundException, SchemaException; /** - * Gets the policy rule defined for the task + * Gets the policy rule defined for the task (for running task the returned value is a clone). */ PolicyRuleType getPolicyRule(); @@ -218,17 +218,6 @@ void setNameImmediate(PolyStringType value, OperationResult parentResult) String getNodeAsObserved(); - /** - * Returns true if the task can run (was not interrupted). - * - * Will return false e.g. if shutdown was signaled. - * - * BEWARE: this flag is present only on the instance of the task that is being "executed", i.e. passed to - * task execution routine and task handler(s). - * - * @return true if the task can run - */ - boolean canRun(); // =================================================================== Persistence and asynchrony @@ -286,7 +275,7 @@ void setNameImmediate(PolyStringType value, OperationResult parentResult) /** * Checks whether the task is a cyclic (recurrent) one. */ - boolean isCycle(); + boolean isRecurring(); /** * Makes a task recurring, with a given schedule. @@ -530,42 +519,50 @@ void setBindingImmediate(TaskBinding value, OperationResult parentResult) * business state or similar data that are out of scope of this * interface definition. * + * To maintain thread safety, for RunningTask this method returns extension clone. + * (So don't use the return value to modify the task extension.) + * * @return task extension */ - PrismContainer getExtension(); + PrismContainer getExtension(); + PrismContainer getExtensionClone(); + + boolean hasExtension(); /** * Returns specified property from the extension * @param propertyName * @return null if extension or property does not exist. */ - PrismProperty getExtensionProperty(QName propertyName); + PrismProperty getExtensionProperty(ItemName propertyName); /** * Returns specified single-valued property real value from the extension * @param propertyName * @return null if extension or property does not exist. */ - T getExtensionPropertyRealValue(QName propertyName); + T getExtensionPropertyRealValue(ItemName propertyName); /** * Returns specified single-valued container real value from the extension - * @param containerName - * @return null if extension or property does not exist. + * To ensure thread safety, in the case of running tasks the returned value is a clone of the live one. + * + * @return null if extension or container does not exist. */ - T getExtensionContainerRealValue(QName containerName); + T getExtensionContainerRealValue(ItemName containerName); /** * Returns specified reference from the extension. * @param name * @return null if extension or reference does not exist. */ - PrismReference getExtensionReference(QName name); + PrismReference getExtensionReference(ItemName name); /** * Returns specified item (property, reference or container) from the extension. - * @param propertyName * @return null if extension or item does not exist + * + * To maintain thread safety, for running tasks returns a clone of the original item. */ Item getExtensionItem(ItemName itemName); @@ -775,15 +772,16 @@ void setResultImmediate(OperationResult result, OperationResult parentResult) /** * Record progress of the task, storing it persistently if needed. + * @param value */ - void setProgress(long value); + void setProgress(Long value); /** * "Immediate" version of the above method. */ - void setProgressImmediate(long progress, OperationResult parentResult) throws ObjectNotFoundException, SchemaException; + void setProgressImmediate(Long progress, OperationResult parentResult) throws ObjectNotFoundException, SchemaException; - void setProgressTransient(long value); + void setProgressTransient(Long value); OperationStatsType getStoredOperationStats(); @@ -815,15 +813,6 @@ void setResultImmediate(OperationResult result, OperationResult parentResult) */ Task createSubtask(); - /** - * Creates a transient subtask, ready to execute a given LightweightTaskHandler. - * - * Owner is inherited from parent task to subtask. - * - * @return - */ - Task createSubtask(LightweightTaskHandler handler); - /** * Returns the identifier of the task's parent (or null of there is no parent task). * @return @@ -835,12 +824,6 @@ void setResultImmediate(OperationResult result, OperationResult parentResult) */ Task getParentTask(OperationResult result) throws SchemaException, ObjectNotFoundException; - /** - * Returns the in-memory version of the parent task. Applicable only to lightweight subtasks. - * EXPERIMENTAL (use with care) - */ - Task getParentForLightweightAsynchronousTask(); - /** * Lists the (direct) subtasks of a given task. * @@ -955,6 +938,7 @@ default List listSubtasksDeeply(OperationResult result) throws SchemaExcep void setRequesteeTransient(PrismObject user); + // not thread-safe! LensContextType getModelOperationContext(); void setModelOperationContext(LensContextType modelOperationContext) throws SchemaException; @@ -967,11 +951,19 @@ void initializeWorkflowContextImmediate(String processInstanceId, OperationResul /** * Returns backing task prism object. - * @return + * AVOID use of this method if possible. + * - for regular tasks it has to update operation result in the prism object (might be costly) + * - for running tasks it provides a clone of the actual prism object (even more costly and leads to lost changes + * if the returned value is changed) */ PrismObject getTaskPrismObject(); - TaskType getTaskType(); + /** + * AVOID using this method for the same reasons as above. + */ + default TaskType getTaskType() { + return getTaskPrismObject().asObjectable(); + } /** * Re-reads the task state from the persistent storage. @@ -991,8 +983,8 @@ void initializeWorkflowContextImmediate(String processInstanceId, OperationResul * @param delta * @throws SchemaException */ - void addModification(ItemDelta delta) throws SchemaException; - void addModifications(Collection> deltas) throws SchemaException; + void modify(ItemDelta delta) throws SchemaException; + void modify(Collection> deltas) throws SchemaException; /** * Changes in-memory and in-repo representations immediately. @@ -1000,12 +992,12 @@ void initializeWorkflowContextImmediate(String processInstanceId, OperationResul * @param parentResult * @throws SchemaException */ - void addModificationImmediate(ItemDelta delta, OperationResult parentResult) throws SchemaException, ObjectAlreadyExistsException, ObjectNotFoundException; + void modifyAndFlush(ItemDelta delta, OperationResult parentResult) throws SchemaException, ObjectAlreadyExistsException, ObjectNotFoundException; /** * Saves modifications done against the in-memory version of the task into the repository. */ - void savePendingModifications(OperationResult parentResult) throws ObjectNotFoundException, + void flushPendingModifications(OperationResult parentResult) throws ObjectNotFoundException, SchemaException, ObjectAlreadyExistsException; /** @@ -1014,47 +1006,18 @@ void savePendingModifications(OperationResult parentResult) throws ObjectNotFoun */ Collection> getPendingModifications(); - LightweightTaskHandler getLightweightTaskHandler(); - - boolean isLightweightAsynchronousTask(); - - Collection getLightweightAsynchronousSubtasks(); - - Collection getRunningLightweightAsynchronousSubtasks(); - - boolean lightweightHandlerStartRequested(); - - /** - * Starts execution of a transient task carrying a LightweightTaskHandler. - * (just a shortcut to analogous call in TaskManager) - */ - void startLightweightHandler(); - - void startCollectingOperationStats(@NotNull StatisticsCollectionStrategy strategy); - - void storeOperationStatsDeferred(); - - void storeOperationStats(); - - // stores operation statistics if the time has come - void storeOperationStatsIfNeeded(); - - Long getLastOperationStatsUpdateTimestamp(); - - void setOperationStatsUpdateInterval(long interval); - - long getOperationStatsUpdateInterval(); - + // not thread-safe! WfContextType getWorkflowContext(); void setWorkflowContext(WfContextType context) throws SchemaException; - void incrementProgressAndStoreStatsIfNeeded(); - + // TODO move into RunningTask? void close(OperationResult taskResult, boolean saveState, OperationResult parentResult) throws ObjectNotFoundException, SchemaException; + // not thread-safe! TaskWorkManagementType getWorkManagement(); + // not thread-safe! TaskWorkStateType getWorkState(); TaskKindType getKind(); @@ -1066,4 +1029,20 @@ void savePendingModifications(OperationResult parentResult) throws ObjectNotFoun boolean isPartitionedMaster(); String getExecutionGroup(); + + /** + * Gets information from the current task and - for running task - its transient subtasks (aka worker threads). + */ + OperationStatsType getAggregatedLiveOperationStats(); + + ObjectReferenceType getSelfReference(); + + String getVersion(); + + // not thread-safe! + Collection getTriggers(); + + Collection getAssignments(); + + ObjectReferenceType getOwnerRef(); } diff --git a/repo/task-api/src/main/java/com/evolveum/midpoint/task/api/TaskHandler.java b/repo/task-api/src/main/java/com/evolveum/midpoint/task/api/TaskHandler.java index 5dc1ce84323..824f57e23b9 100644 --- a/repo/task-api/src/main/java/com/evolveum/midpoint/task/api/TaskHandler.java +++ b/repo/task-api/src/main/java/com/evolveum/midpoint/task/api/TaskHandler.java @@ -25,7 +25,7 @@ */ public interface TaskHandler { - TaskRunResult run(Task task); + TaskRunResult run(RunningTask task); default Long heartbeat(Task task) { return null; diff --git a/repo/task-api/src/main/java/com/evolveum/midpoint/task/api/TaskManager.java b/repo/task-api/src/main/java/com/evolveum/midpoint/task/api/TaskManager.java index 6559752bc6f..5885c5ac38f 100644 --- a/repo/task-api/src/main/java/com/evolveum/midpoint/task/api/TaskManager.java +++ b/repo/task-api/src/main/java/com/evolveum/midpoint/task/api/TaskManager.java @@ -87,7 +87,7 @@ public interface TaskManager { */ int countObjects(Class type, ObjectQuery query, OperationResult parentResult) throws SchemaException; - void waitForTransientChildren(Task task, OperationResult result); + void waitForTransientChildren(RunningTask task, OperationResult result); /** * TODO @@ -295,7 +295,7 @@ void modifyTask(String oid, Collection modifications, Opera * @param closedTasksPolicy specifies which tasks are to be deleted, e.g. how old they have to be * @param task task, within which context the cleanup executes (used to test for interruptions) */ - void cleanupTasks(CleanupPolicyType closedTasksPolicy, Task task, OperationResult opResult) throws SchemaException; + void cleanupTasks(CleanupPolicyType closedTasksPolicy, RunningTask task, OperationResult opResult) throws SchemaException; /** * This is a signal to task manager that a new task was created in the repository. @@ -376,7 +376,7 @@ void modifyTask(String oid, Collection modifications, Opera * * EXPERIMENTAL. Should be replaced by something like "get operational information". */ - Task getLocallyRunningTaskByIdentifier(String lightweightIdentifier); + RunningTask getLocallyRunningTaskByIdentifier(String lightweightIdentifier); //endregion @@ -725,4 +725,9 @@ ObjectQuery narrowQueryForWorkBucket(ObjectQuery query, Class> listPersistentSubtasksRaw(OperationResult parentResult) throws SchemaException; + + @NotNull + List listSubtasksInternal(boolean persistentOnly, OperationResult result) throws SchemaException; + + void applyDeltasImmediate(Collection> itemDeltas, OperationResult result) + throws ObjectAlreadyExistsException, ObjectNotFoundException, SchemaException; + + // no F_RESULT modifications! + void applyModificationsTransient(Collection> modifications) throws SchemaException; + + void addSubtask(TaskType subtaskBean); +} diff --git a/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/RunningTaskQuartzImpl.java b/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/RunningTaskQuartzImpl.java new file mode 100644 index 00000000000..0d157d29674 --- /dev/null +++ b/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/RunningTaskQuartzImpl.java @@ -0,0 +1,266 @@ +/* + * Copyright (c) 2010-2019 Evolveum + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.evolveum.midpoint.task.quartzimpl; + +import com.evolveum.midpoint.prism.PrismObject; +import com.evolveum.midpoint.repo.api.RepositoryService; +import com.evolveum.midpoint.schema.result.OperationResult; +import com.evolveum.midpoint.task.api.*; +import com.evolveum.midpoint.task.quartzimpl.statistics.Statistics; +import com.evolveum.midpoint.util.exception.ObjectAlreadyExistsException; +import com.evolveum.midpoint.util.exception.ObjectNotFoundException; +import com.evolveum.midpoint.util.exception.SchemaException; +import com.evolveum.midpoint.util.logging.LoggingUtils; +import com.evolveum.midpoint.util.logging.Trace; +import com.evolveum.midpoint.util.logging.TraceManager; +import com.evolveum.midpoint.xml.ns._public.common.common_3.OperationStatsType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.TaskType; +import org.jetbrains.annotations.NotNull; + +import java.util.*; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.Future; +import java.util.stream.Collectors; + +/** + * + */ +public class RunningTaskQuartzImpl extends TaskQuartzImpl implements RunningTask { + + private static final Trace LOGGER = TraceManager.getTrace(RunningTaskQuartzImpl.class); + + private static final long DEFAULT_OPERATION_STATS_UPDATE_INTERVAL = 3000L; + + private long operationStatsUpdateInterval = DEFAULT_OPERATION_STATS_UPDATE_INTERVAL; + private Long lastOperationStatsUpdateTimestamp; + + /** + * Lightweight asynchronous subtasks. + * Each task here is a LAT, i.e. transient and with assigned lightweight handler. + *

+ * This must be concurrent, because interrupt() method uses it. + */ + private Map lightweightAsynchronousSubtasks = new ConcurrentHashMap<>(); + private RunningTaskQuartzImpl parentForLightweightAsynchronousTask; // EXPERIMENTAL + + /** + * Is the task handler allowed to run, or should it stop as soon as possible? + */ + private volatile boolean canRun = true; + + /** + * The code that should be run for asynchronous transient tasks. + * (As opposed to asynchronous persistent tasks, where the handler is specified + * via Handler URI in task prism object.) + */ + private LightweightTaskHandler lightweightTaskHandler; + + /** + * Future representing executing (or submitted-to-execution) lightweight task handler. + */ + private Future lightweightHandlerFuture; + + /** + * An indication whether lightweight handler is currently executing or not. + * Used for waiting upon its completion (because java.util.concurrent facilities are not able + * to show this for cancelled/interrupted tasks). + */ + private volatile boolean lightweightHandlerExecuting; + + /** + * Thread in which this task's lightweight handler is executing. + */ + private volatile Thread lightweightThread; + + RunningTaskQuartzImpl(TaskManagerQuartzImpl taskManager, PrismObject taskPrism, RepositoryService repositoryService) { + super(taskManager, taskPrism, repositoryService); + } + + @Override + public RunningTaskQuartzImpl getParentForLightweightAsynchronousTask() { + return parentForLightweightAsynchronousTask; + } + + /** + * Signal the task to shut down. + * It may not stop immediately, but it should stop eventually. + *

+ * BEWARE, this method has to be invoked on the same Task instance that is executing. + * If called e.g. on a Task just retrieved from the repository, it will have no effect whatsoever. + */ + + public void unsetCanRun() { + // beware: Do not touch task prism here, because this method can be called asynchronously + canRun = false; + } + + @Override + public boolean canRun() { + return canRun; + } + + @Override + public RunningTask createSubtask(LightweightTaskHandler handler) { + RunningTaskQuartzImpl sub = taskManager.createRunningTask(createSubtask()); + sub.setLightweightTaskHandler(handler); + assert sub.getTaskIdentifier() != null; + lightweightAsynchronousSubtasks.put(sub.getTaskIdentifier(), sub); + sub.parentForLightweightAsynchronousTask = this; + return sub; + } + + public void setLightweightTaskHandler(LightweightTaskHandler lightweightTaskHandler) { + this.lightweightTaskHandler = lightweightTaskHandler; + } + + @Override + public LightweightTaskHandler getLightweightTaskHandler() { + return lightweightTaskHandler; + } + + @Override + public boolean isLightweightAsynchronousTask() { + return lightweightTaskHandler != null; + } + + void setLightweightHandlerFuture(Future lightweightHandlerFuture) { + this.lightweightHandlerFuture = lightweightHandlerFuture; + } + + public Future getLightweightHandlerFuture() { + return lightweightHandlerFuture; + } + + @Override + public Collection getLightweightAsynchronousSubtasks() { + return Collections.unmodifiableList(new ArrayList<>(lightweightAsynchronousSubtasks.values())); + } + + @Override + public Collection getRunningLightweightAsynchronousSubtasks() { + // beware: Do not touch task prism here, because this method can be called asynchronously + List retval = new ArrayList<>(); + for (RunningTaskQuartzImpl subtask : getLightweightAsynchronousSubtasks()) { + if (subtask.getExecutionStatus() == TaskExecutionStatus.RUNNABLE && subtask.lightweightHandlerStartRequested()) { + retval.add(subtask); + } + } + return Collections.unmodifiableList(retval); + } + + @Override + public boolean lightweightHandlerStartRequested() { + return lightweightHandlerFuture != null; + } + + // just a shortcut + @Override + public void startLightweightHandler() { + taskManager.startLightweightTask(this); + } + + public void setLightweightHandlerExecuting(boolean lightweightHandlerExecuting) { + this.lightweightHandlerExecuting = lightweightHandlerExecuting; + } + + public boolean isLightweightHandlerExecuting() { + return lightweightHandlerExecuting; + } + + public Thread getLightweightThread() { + return lightweightThread; + } + + public void setLightweightThread(Thread lightweightThread) { + this.lightweightThread = lightweightThread; + } + + // Operational data + + @Override + public void storeOperationStatsDeferred() { + setOperationStats(getAggregatedLiveOperationStats()); + } + + @Override + public void storeOperationStats() { + try { + storeOperationStatsDeferred(); + addPendingModification(createPropertyDeltaIfPersistent(TaskType.F_PROGRESS, getProgress())); + addPendingModification(createPropertyDeltaIfPersistent(TaskType.F_EXPECTED_TOTAL, getExpectedTotal())); + flushPendingModifications(new OperationResult(DOT_INTERFACE + ".storeOperationStats")); // TODO fixme + lastOperationStatsUpdateTimestamp = System.currentTimeMillis(); + } catch (SchemaException | ObjectNotFoundException | ObjectAlreadyExistsException | RuntimeException e) { + LoggingUtils.logUnexpectedException(LOGGER, "Couldn't store statistical information into task {}", e, this); + } + } + + @Override + public void storeOperationStatsIfNeeded() { + if (lastOperationStatsUpdateTimestamp == null || + System.currentTimeMillis() - lastOperationStatsUpdateTimestamp > operationStatsUpdateInterval) { + storeOperationStats(); + } + } + + @Override + public Long getLastOperationStatsUpdateTimestamp() { + return lastOperationStatsUpdateTimestamp; + } + + @Override + public void setOperationStatsUpdateInterval(long interval) { + this.operationStatsUpdateInterval = interval; + } + + @Override + public long getOperationStatsUpdateInterval() { + return operationStatsUpdateInterval; + } + + @Override + public void incrementProgressAndStoreStatsIfNeeded() { + setProgress(getProgress() + 1); + storeOperationStatsIfNeeded(); + } + + @Override + public boolean isAsynchronous() { + return getPersistenceStatus() == TaskPersistenceStatus.PERSISTENT + || isLightweightAsynchronousTask(); // note: if it has lightweight task handler, it must be transient + } + + @Override + public OperationStatsType getAggregatedLiveOperationStats() { + List subCollectors = getLightweightAsynchronousSubtasks().stream() + .map(task -> task.getStatistics()).collect(Collectors.toList()); + return statistics.getAggregatedLiveOperationStats(subCollectors); + } + + @Override + public void startCollectingOperationStats(@NotNull StatisticsCollectionStrategy strategy) { + super.startCollectingOperationStats(strategy); + if (strategy.isStartFromZero()) { + storeOperationStats(); + } + } + + Statistics getStatistics() { + return statistics; + } + +} diff --git a/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/TaskManagerQuartzImpl.java b/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/TaskManagerQuartzImpl.java index b282f67eefd..35f512919f7 100644 --- a/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/TaskManagerQuartzImpl.java +++ b/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/TaskManagerQuartzImpl.java @@ -37,7 +37,6 @@ import com.evolveum.midpoint.prism.ItemDefinition; import com.evolveum.midpoint.prism.crypto.Protector; import com.evolveum.midpoint.prism.path.ItemPath; -import com.evolveum.midpoint.prism.util.CloneUtil; import com.evolveum.midpoint.repo.api.*; import com.evolveum.midpoint.schema.*; import com.evolveum.midpoint.task.api.*; @@ -164,7 +163,7 @@ public class TaskManagerQuartzImpl implements TaskManager, BeanFactoryAware, Sys // Use ONLY for those actions that need to work with these instances, e.g. when calling heartbeat() methods on them. // For any other business please use LocalNodeManager.getLocallyRunningTasks(...). // Maps task id -> task - private final HashMap locallyRunningTaskInstancesMap = new HashMap<>(); + private final HashMap locallyRunningTaskInstancesMap = new HashMap<>(); private ExecutorService lightweightHandlersExecutor = Executors.newCachedThreadPool(); @@ -537,7 +536,7 @@ private boolean suspendTasksInternalQuietly(Collection tasks, long waitFor for (Task task : tasks) { try { closeTask(task, result); - ((TaskQuartzImpl) task).checkDependentTasksOnClose(parentResult); + ((InternalTaskInterface) task).checkDependentTasksOnClose(parentResult); } catch (ObjectNotFoundException | SchemaException e) { LoggingUtils.logUnexpectedException(LOGGER, "Cannot close suspended task {}", e, task); } @@ -568,7 +567,7 @@ private void suspendTaskInternal(Task task, OperationResult result) .item(TaskType.F_EXECUTION_STATUS).replace(TaskExecutionStatusType.SUSPENDED) .item(TaskType.F_STATE_BEFORE_SUSPEND).replace(task.getExecutionStatus().toTaskType()) .asItemDeltas(); - ((TaskQuartzImpl) task).applyDeltasImmediate(itemDeltas, result); + ((InternalTaskInterface) task).applyDeltasImmediate(itemDeltas, result); } catch (ObjectAlreadyExistsException e) { throw new SystemException("Unexpected ObjectAlreadyExistsException while suspending a task: " + e.getMessage(), e); } @@ -606,8 +605,8 @@ public void pauseTask(Task task, TaskWaitingReason reason, OperationResult paren return; } try { - ((TaskQuartzImpl) task).setExecutionStatusImmediate(TaskExecutionStatus.WAITING, result); - ((TaskQuartzImpl) task).setWaitingReasonImmediate(reason, result); + ((InternalTaskInterface) task).setExecutionStatusImmediate(TaskExecutionStatus.WAITING, result); + ((InternalTaskInterface) task).setWaitingReasonImmediate(reason, result); } catch (ObjectNotFoundException e) { String message = "A task cannot be paused, because it does not exist; task = " + task; LoggingUtils.logException(LOGGER, message, e); @@ -619,7 +618,7 @@ public void pauseTask(Task task, TaskWaitingReason reason, OperationResult paren } // make the trigger as it should be - executionManager.synchronizeTask((TaskQuartzImpl) task, result); + executionManager.synchronizeTask(task, result); if (result.isUnknown()) { result.computeStatus(); @@ -650,7 +649,7 @@ public void unpauseTask(Task task, OperationResult parentResult) if (task.getHandlerUri() == null) { LOGGER.trace("No handler in task being unpaused - closing it: {}", task); closeTask(task, result); - ((TaskQuartzImpl) task).checkDependentTasksOnClose(parentResult); // TODO + ((InternalTaskInterface) task).checkDependentTasksOnClose(parentResult); // TODO result.computeStatusIfUnknown(); return; } @@ -662,19 +661,19 @@ public void unpauseTask(Task task, OperationResult parentResult) scheduleWaitingTaskNow(task, result); break; case RESCHEDULE: - if (task.isCycle()) { + if (task.isRecurring()) { LOGGER.trace("Unpausing recurring task using 'reschedule' action (making it runnable): {}", task); makeWaitingTaskRunnable(task, result); } else { LOGGER.trace("Unpausing task using 'reschedule' action (closing it, because the task is single-run): {}", task); closeTask(task, result); - ((TaskQuartzImpl) task).checkDependentTasksOnClose(parentResult); // TODO + ((InternalTaskInterface) task).checkDependentTasksOnClose(parentResult); // TODO } break; case CLOSE: LOGGER.trace("Unpausing task using 'close' action: {}", task); closeTask(task, result); - ((TaskQuartzImpl) task).checkDependentTasksOnClose(parentResult); // TODO + ((InternalTaskInterface) task).checkDependentTasksOnClose(parentResult); // TODO break; default: throw new IllegalStateException("Unsupported unpause action: " + action); @@ -721,7 +720,7 @@ public void resumeTask(Task task, OperationResult parentResult) throws ObjectNot try { if (task.getExecutionStatus() != TaskExecutionStatus.SUSPENDED && - !(task.getExecutionStatus() == TaskExecutionStatus.CLOSED && task.isCycle())) { + !(task.getExecutionStatus() == TaskExecutionStatus.CLOSED && task.isRecurring())) { String message = "Attempted to resume a task that is not in the SUSPENDED state (or CLOSED for recurring tasks) (task = " + task + ", state = " + task.getExecutionStatus(); @@ -735,14 +734,14 @@ public void resumeTask(Task task, OperationResult parentResult) throws ObjectNot .item(TaskType.F_EXECUTION_STATUS).replace(TaskExecutionStatusType.WAITING) .item(TaskType.F_STATE_BEFORE_SUSPEND).replace() .asItemDeltas(); - ((TaskQuartzImpl) task).applyDeltasImmediate(itemDeltas, result); + ((InternalTaskInterface) task).applyDeltasImmediate(itemDeltas, result); } else { List> itemDeltas = prismContext.deltaFor(TaskType.class) .item(TaskType.F_EXECUTION_STATUS).replace(TaskExecutionStatusType.RUNNABLE) .item(TaskType.F_STATE_BEFORE_SUSPEND).replace() .asItemDeltas(); - ((TaskQuartzImpl) task).applyDeltasImmediate(itemDeltas, result); - executionManager.synchronizeTask((TaskQuartzImpl) task, result); + ((InternalTaskInterface) task).applyDeltasImmediate(itemDeltas, result); + executionManager.synchronizeTask(task, result); } } catch (ObjectAlreadyExistsException t) { result.recordFatalError("Couldn't resume task: " + t.getMessage(), t); @@ -759,7 +758,7 @@ private void makeWaitingTaskRunnable(Task task, OperationResult result) throws ObjectNotFoundException, SchemaException, PreconditionViolationException { try { - ((TaskQuartzImpl) task).setExecutionStatusImmediate(TaskExecutionStatus.RUNNABLE, TaskExecutionStatusType.WAITING, result); + ((InternalTaskInterface) task).setExecutionStatusImmediate(TaskExecutionStatus.RUNNABLE, TaskExecutionStatusType.WAITING, result); } catch (ObjectNotFoundException e) { String message = "A task cannot be made runnable, because it does not exist; task = " + task; LoggingUtils.logException(LOGGER, message, e); @@ -771,7 +770,7 @@ private void makeWaitingTaskRunnable(Task task, OperationResult result) } // make the trigger as it should be - executionManager.synchronizeTask((TaskQuartzImpl) task, result); + executionManager.synchronizeTask(task, result); } //endregion @@ -781,12 +780,12 @@ private void makeWaitingTaskRunnable(Task task, OperationResult result) */ @Override - public Task createTaskInstance() { + public TaskQuartzImpl createTaskInstance() { return createTaskInstance(null); } @Override - public Task createTaskInstance(String operationName) { + public TaskQuartzImpl createTaskInstance(String operationName) { LightweightIdentifier taskIdentifier = generateTaskIdentifier(); return new TaskQuartzImpl(this, taskIdentifier, operationName); } @@ -810,7 +809,7 @@ public TaskQuartzImpl createTaskInstance(PrismObject taskPrism, String //Note: we need to be Spring Bean Factory Aware, because some repo implementations are in scope prototype RepositoryService repoService = (RepositoryService) this.beanFactory.getBean("repositoryService"); - TaskQuartzImpl task = new TaskQuartzImpl(this, taskPrism, repoService, operationName); + TaskQuartzImpl task = new TaskQuartzImpl(this, taskPrism, repoService); task.resolveOwnerRef(result); result.recordSuccessIfUnknown(); return task; @@ -824,7 +823,7 @@ public TaskQuartzImpl getTask(String taskOid, OperationResult parentResult) thro @Override @NotNull - public Task getTaskWithResult(String taskOid, OperationResult parentResult) throws ObjectNotFoundException, SchemaException { + public TaskQuartzImpl getTaskWithResult(String taskOid, OperationResult parentResult) throws ObjectNotFoundException, SchemaException { Collection> options = schemaHelper.getOperationOptionsBuilder() .item(TaskType.F_RESULT).retrieve() .build(); @@ -887,6 +886,10 @@ private void persist(Task task, OperationResult parentResult) { return; } + if (task instanceof RunningTask) { + throw new UnsupportedOperationException("Running task cannot be made persistent"); + } + TaskQuartzImpl taskImpl = (TaskQuartzImpl) task; if (task.getName() == null) { @@ -926,9 +929,9 @@ private void persist(Task task, OperationResult parentResult) { @Override public String addTask(PrismObject taskPrism, RepoAddOptions options, OperationResult parentResult) throws ObjectAlreadyExistsException, SchemaException { OperationResult result = parentResult.createSubresult(DOT_INTERFACE + "addTask"); - Task task = createTaskInstance(taskPrism, result); // perhaps redundant, but it's more convenient to work with Task than with Task prism + TaskQuartzImpl task = createTaskInstance(taskPrism, result); // perhaps redundant, but it's more convenient to work with Task than with Task prism if (task.getTaskIdentifier() == null) { - task.getTaskPrismObject().asObjectable().setTaskIdentifier(generateTaskIdentifier().toString()); + task.setTaskIdentifier(generateTaskIdentifier().toString()); } String oid = addTaskToRepositoryAndQuartz(task, options, result); result.computeStatus(); @@ -938,7 +941,7 @@ public String addTask(PrismObject taskPrism, RepoAddOptions options, O private String addTaskToRepositoryAndQuartz(Task task, RepoAddOptions options, OperationResult parentResult) throws ObjectAlreadyExistsException, SchemaException { - if (task.isLightweightAsynchronousTask()) { + if (task instanceof RunningTask && ((RunningTask) task).isLightweightAsynchronousTask()) { throw new IllegalStateException("A task with lightweight task handler cannot be made persistent; task = " + task); // otherwise, there would be complications on task restart: the task handler is not stored in the repository, // so it is just not possible to restart such a task @@ -947,18 +950,17 @@ private String addTaskToRepositoryAndQuartz(Task task, RepoAddOptions options, OperationResult result = parentResult.createSubresult(DOT_IMPL_CLASS + "addTaskToRepositoryAndQuartz"); result.addArbitraryObjectAsParam("task", task); - PrismObject taskPrism = task.getTaskPrismObject(); String oid; try { - oid = repositoryService.addObject(taskPrism, options, result); + oid = repositoryService.addObject(task.getTaskPrismObject(), options, result); } catch (ObjectAlreadyExistsException | SchemaException e) { result.recordFatalError("Couldn't add task to repository: " + e.getMessage(), e); throw e; } - ((TaskQuartzImpl) task).setOid(oid); + ((InternalTaskInterface) task).setOid(oid); - synchronizeTaskWithQuartz((TaskQuartzImpl) task, result); + synchronizeTaskWithQuartz(task, result); result.computeStatus(); return oid; @@ -1117,14 +1119,14 @@ public void deleteTask(String oid, OperationResult parentResult) throws ObjectNo } } - public void registerRunningTask(TaskQuartzImpl task) { + public void registerRunningTask(RunningTaskQuartzImpl task) { synchronized (locallyRunningTaskInstancesMap) { locallyRunningTaskInstancesMap.put(task.getTaskIdentifier(), task); LOGGER.trace("Registered task {}, locally running instances = {}", task, locallyRunningTaskInstancesMap); } } - public void unregisterRunningTask(TaskQuartzImpl task) { + public void unregisterRunningTask(RunningTaskQuartzImpl task) { synchronized (locallyRunningTaskInstancesMap) { locallyRunningTaskInstancesMap.remove(task.getTaskIdentifier()); LOGGER.trace("Unregistered task {}, locally running instances = {}", task, locallyRunningTaskInstancesMap); @@ -1149,7 +1151,7 @@ public void unregisterRunningTask(TaskQuartzImpl task) { // registeredTransientTasks.put(task.getTaskIdentifier(), task); // } - public void startLightweightTask(final TaskQuartzImpl task) { + public void startLightweightTask(final RunningTaskQuartzImpl task) { if (task.isPersistent()) { throw new IllegalStateException("An attempt to start LightweightTaskHandler in a persistent task; task = " + task); } @@ -1208,9 +1210,9 @@ public void startLightweightTask(final TaskQuartzImpl task) { } @Override - public void waitForTransientChildren(Task task, OperationResult result) { - for (Task subtask : task.getRunningLightweightAsynchronousSubtasks()) { - Future future = ((TaskQuartzImpl) subtask).getLightweightHandlerFuture(); + public void waitForTransientChildren(RunningTask task, OperationResult result) { + for (RunningTaskQuartzImpl subtask : ((RunningTaskQuartzImpl) task).getRunningLightweightAsynchronousSubtasks()) { + Future future = subtask.getLightweightHandlerFuture(); if (future != null) { // should always be LOGGER.debug("Waiting for subtask {} to complete.", subtask); try { @@ -1218,7 +1220,7 @@ public void waitForTransientChildren(Task task, OperationResult result) { } catch (CancellationException e) { // the Future was cancelled; however, the run() method may be still executing // we want to be sure it is already done - while (((TaskQuartzImpl) subtask).isLightweightHandlerExecuting()) { + while (subtask.isLightweightHandlerExecuting()) { LOGGER.debug("Subtask {} was cancelled, waiting for its real completion.", subtask); try { Thread.sleep(500); @@ -1280,8 +1282,8 @@ private PrismObject getTaskAsObject(String oid, Collection> options, OperationResult result) throws SchemaException { - boolean retrieveNextRunStartTime = SelectorOptions.hasToLoadPath(TaskType.F_NEXT_RUN_START_TIMESTAMP, options); - boolean retrieveRetryTime = SelectorOptions.hasToLoadPath(TaskType.F_NEXT_RETRY_TIMESTAMP, options); - boolean retrieveNodeAsObserved = SelectorOptions.hasToLoadPath(TaskType.F_NODE_AS_OBSERVED, options); + // task is Task or TaskType + // returns List or List> + private List getSubtasks(Object task, OperationResult result) throws SchemaException { + if (task instanceof Task) { + return ((Task) task).listSubtasks(result); + } else if (task instanceof TaskType) { + return listPersistentSubtasksForTask(((TaskType) task).getTaskIdentifier(), result); + } else { + throw new IllegalArgumentException("task: " + task); + } + } - List subtasks = task.listSubtasks(result); + // task is Task or TaskType + // subtask is Task or PrismObject + private void addSubtask(Object task, Object subtask) { + TaskType subtaskBean; + if (subtask instanceof Task) { + subtaskBean = ((Task) subtask).getTaskType(); + } else if (subtask instanceof PrismObject) { + //noinspection unchecked + subtaskBean = ((PrismObject) subtask).asObjectable(); + } else { + throw new IllegalArgumentException("subtask: " + task); + } - for (Task subtask : subtasks) { + if (task instanceof Task) { + ((InternalTaskInterface) task).addSubtask(subtaskBean); + } else if (task instanceof TaskType) { + ((TaskType) task).getSubtask().add(subtaskBean); + } else { + throw new IllegalArgumentException("task: " + task); + } + } - if (subtask.isPersistent()) { - addTransientTaskInformation(subtask.getTaskPrismObject(), - clusterStatusInformation, - retrieveNextRunStartTime, - retrieveRetryTime, - retrieveNodeAsObserved, - result); + private boolean isPersistent(Object task) { + if (task instanceof Task) { + return ((Task) task).isPersistent(); + } else if (task instanceof PrismObject) { + return ((PrismObject) task).getOid() != null; + } else { + throw new IllegalArgumentException("task: " + task); + } + } + // task is Task or TaskType + private void fillInSubtasks(Object task, ClusterStatusInformation clusterStatusInformation, Collection> options, OperationResult result) throws SchemaException { + boolean retrieveNextRunStartTime = SelectorOptions.hasToLoadPath(TaskType.F_NEXT_RUN_START_TIMESTAMP, options); + boolean retrieveRetryTime = SelectorOptions.hasToLoadPath(TaskType.F_NEXT_RETRY_TIMESTAMP, options); + boolean retrieveNodeAsObserved = SelectorOptions.hasToLoadPath(TaskType.F_NODE_AS_OBSERVED, options); + + for (Object subtask : getSubtasks(task, result)) { + if (isPersistent(subtask)) { + addTransientTaskInformation(subtask, clusterStatusInformation, retrieveNextRunStartTime, retrieveRetryTime, + retrieveNodeAsObserved, result); fillInSubtasks(subtask, clusterStatusInformation, options, result); } - TaskType subTaskType = subtask.getTaskPrismObject().asObjectable(); - task.getTaskPrismObject().asObjectable().getSubtask().add(subTaskType); + addSubtask(task, subtask); } } - // retrieves only "heavyweight" subtasks - private void fillInSubtasks(TaskType task, ClusterStatusInformation clusterStatusInformation, Collection> options, OperationResult result) throws SchemaException { - - boolean retrieveNextRunStartTime = SelectorOptions.hasToLoadPath(TaskType.F_NEXT_RUN_START_TIMESTAMP, options); - boolean retrieveRetryTime = SelectorOptions.hasToLoadPath(TaskType.F_NEXT_RETRY_TIMESTAMP, options); - boolean retrieveNodeAsObserved = SelectorOptions.hasToLoadPath(TaskType.F_NODE_AS_OBSERVED, options); - - List> subtasks = listPersistentSubtasksForTask(task.getTaskIdentifier(), result); - - for (PrismObject subtask : subtasks) { - - if (subtask.getOid() != null) { - addTransientTaskInformation(subtask, - clusterStatusInformation, - retrieveNextRunStartTime, - retrieveRetryTime, - retrieveNodeAsObserved, - result); - - fillInSubtasks(subtask.asObjectable(), clusterStatusInformation, options, result); - } - task.getSubtask().add(subtask.asObjectable()); - } - } - - public List> listPersistentSubtasksForTask(String taskIdentifier, OperationResult result) throws SchemaException { - + List> listPersistentSubtasksForTask(String taskIdentifier, OperationResult result) throws SchemaException { if (StringUtils.isEmpty(taskIdentifier)) { return new ArrayList<>(); } @@ -1559,39 +1570,53 @@ public SearchResultList> searchTasks(ObjectQuery query, Co List> retval = new ArrayList<>(); for (PrismObject taskInRepository : tasksInRepository) { - TaskType taskInResult = addTransientTaskInformation(taskInRepository, clusterStatusInformation, + addTransientTaskInformation(taskInRepository, clusterStatusInformation, retrieveNextRunStartTime, retrieveRetryTime, retrieveNodeAsObserved, result); - retval.add(taskInResult.asPrismObject()); + retval.add(taskInRepository); } result.computeStatus(); return new SearchResultList<>(retval); } - private TaskType addTransientTaskInformation(PrismObject taskInRepository, ClusterStatusInformation clusterStatusInformation, + // task is Task or PrismObject + private void addTransientTaskInformation(Object task, ClusterStatusInformation clusterStatusInformation, boolean retrieveNextRunStartTime, boolean retrieveRetryTime, boolean retrieveNodeAsObserved, OperationResult result) { - Validate.notNull(taskInRepository.getOid(), "Task OID is null"); - TaskType taskInResult = taskInRepository.asObjectable(); + if (!isPersistent(task)) { + throw new IllegalStateException("Task " + task + " is not persistent"); + } + if (task instanceof RunningTask) { + throw new UnsupportedOperationException("addTransientTaskInformation is not available for running tasks"); + } + TaskType taskBean; + if (task instanceof TaskQuartzImpl) { + taskBean = ((TaskQuartzImpl) task).getLiveTaskPrismObject().asObjectable(); + } else if (task instanceof PrismObject) { + //noinspection unchecked + taskBean = ((PrismObject) task).asObjectable(); + } else { + throw new IllegalArgumentException("task: " + task); + } + if (clusterStatusInformation != null && retrieveNodeAsObserved) { - NodeType runsAt = clusterStatusInformation.findNodeInfoForTask(taskInResult.getOid()); + NodeType runsAt = clusterStatusInformation.findNodeInfoForTask(taskBean.getOid()); if (runsAt != null) { - taskInResult.setNodeAsObserved(runsAt.getNodeIdentifier()); + taskBean.setNodeAsObserved(runsAt.getNodeIdentifier()); } } if (retrieveNextRunStartTime || retrieveRetryTime) { - NextStartTimes times = getNextStartTimes(taskInResult.getOid(), retrieveNextRunStartTime, retrieveRetryTime, result); + NextStartTimes times = getNextStartTimes(taskBean.getOid(), retrieveNextRunStartTime, retrieveRetryTime, result); if (retrieveNextRunStartTime && times.nextScheduledRun != null) { - taskInResult.setNextRunStartTimestamp(XmlTypeConverter.createXMLGregorianCalendar(times.nextScheduledRun)); + taskBean.setNextRunStartTimestamp(XmlTypeConverter.createXMLGregorianCalendar(times.nextScheduledRun)); } if (retrieveRetryTime && times.nextRetry != null) { - taskInResult.setNextRetryTimestamp(XmlTypeConverter.createXMLGregorianCalendar(times.nextRetry)); + taskBean.setNextRetryTimestamp(XmlTypeConverter.createXMLGregorianCalendar(times.nextRetry)); } } - Long stalledSince = stalledTasksWatcher.getStalledSinceForTask(taskInResult); + Long stalledSince = stalledTasksWatcher.getStalledSinceForTask(taskBean); if (stalledSince != null) { - taskInResult.setStalledSince(XmlTypeConverter.createXMLGregorianCalendar(stalledSince)); + taskBean.setStalledSince(XmlTypeConverter.createXMLGregorianCalendar(stalledSince)); } - return taskInResult; } @@ -1813,6 +1838,7 @@ public TaskManagerConfiguration getConfiguration() { return configuration; } + @NotNull public PrismContext getPrismContext() { return prismContext; } @@ -1865,7 +1891,7 @@ public ExecutionManager getExecutionManager() { * ********************* DELEGATIONS ********************* */ - void synchronizeTaskWithQuartz(TaskQuartzImpl task, OperationResult parentResult) { + void synchronizeTaskWithQuartz(Task task, OperationResult parentResult) { executionManager.synchronizeTask(task, parentResult); } @@ -1905,7 +1931,7 @@ public void stopLocalTask(String oid, OperationResult parentResult) { } @Override - public Task getLocallyRunningTaskByIdentifier(String lightweightIdentifier) { + public RunningTask getLocallyRunningTaskByIdentifier(String lightweightIdentifier) { synchronized (locallyRunningTaskInstancesMap) { return locallyRunningTaskInstancesMap.get(lightweightIdentifier); } @@ -2133,7 +2159,7 @@ List resolveTasksFromTaskTypes(List> taskPrisms, Ope } @Override - public void cleanupTasks(CleanupPolicyType policy, Task executionTask, OperationResult parentResult) throws SchemaException { + public void cleanupTasks(CleanupPolicyType policy, RunningTask executionTask, OperationResult parentResult) throws SchemaException { OperationResult result = parentResult.createSubresult(CLEANUP_TASKS); if (policy.getMaxAge() == null) { @@ -2302,7 +2328,7 @@ public void checkWaitingTasks(OperationResult result) throws SchemaException { List tasks = listWaitingTasks(TaskWaitingReason.OTHER_TASKS, result); for (Task task : tasks) { try { - ((TaskQuartzImpl) task).checkDependencies(result); + ((InternalTaskInterface) task).checkDependencies(result); count++; } catch (SchemaException | ObjectNotFoundException e) { LoggingUtils.logUnexpectedException(LOGGER, "Couldn't check dependencies for task {}", e, task); @@ -2326,17 +2352,19 @@ private List listWaitingTasks(TaskWaitingReason reason, OperationResult re } // returns map task lightweight id -> task - public Map getLocallyRunningTaskInstances() { + public Map getLocallyRunningTaskInstances() { synchronized (locallyRunningTaskInstancesMap) { // must be synchronized while iterating over it (addAll) return new HashMap<>(locallyRunningTaskInstancesMap); } } - public Collection getTransientSubtasks(TaskQuartzImpl task) { + public Collection getTransientSubtasks(String identifier) { List retval = new ArrayList<>(); - Task runningInstance = locallyRunningTaskInstancesMap.get(task.getTaskIdentifier()); + RunningTaskQuartzImpl runningInstance = locallyRunningTaskInstancesMap.get(identifier); if (runningInstance != null) { - retval.addAll(runningInstance.getLightweightAsynchronousSubtasks()); + for (RunningTaskQuartzImpl subtask : runningInstance.getLightweightAsynchronousSubtasks()) { + retval.add(subtask.cloneAsStaticTask()); + } } return retval; } @@ -2430,4 +2458,25 @@ public String recordTaskThreadsDump(String taskOid, String cause, OperationResul throws SchemaException, ObjectNotFoundException, ObjectAlreadyExistsException { return executionManager.recordTaskThreadsDump(taskOid, cause, parentResult); } + + /** + * Creates a running task from a regular one. + * Should be used ONLY when creating running task instance for handler (standard or lightweight) run. + */ + public RunningTaskQuartzImpl createRunningTask(Task task) { + if (task instanceof RunningTask) { + LOGGER.warn("Task {} is already a RunningTask: {}", task); + return ((RunningTaskQuartzImpl) task); + } else { + PrismObject taskPrismObject = task.getTaskPrismObject(); + return new RunningTaskQuartzImpl(this, taskPrismObject, repositoryService); + } + } + + @Override + public RunningTaskQuartzImpl createFakeRunningTask(Task task) { + return createRunningTask(task); + } + + } diff --git a/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/TaskQuartzImpl.java b/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/TaskQuartzImpl.java index 230aa765189..6e299be6a47 100644 --- a/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/TaskQuartzImpl.java +++ b/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/TaskQuartzImpl.java @@ -17,9 +17,8 @@ import com.evolveum.midpoint.prism.*; import com.evolveum.midpoint.prism.delta.*; -import com.evolveum.midpoint.prism.path.ItemPath; import com.evolveum.midpoint.prism.path.ItemName; -import com.evolveum.midpoint.prism.polystring.PolyString; +import com.evolveum.midpoint.prism.path.ItemPath; import com.evolveum.midpoint.prism.query.ObjectQuery; import com.evolveum.midpoint.prism.util.CloneUtil; import com.evolveum.midpoint.prism.xml.XmlTypeConverter; @@ -32,15 +31,12 @@ import com.evolveum.midpoint.schema.SelectorOptions; import com.evolveum.midpoint.schema.constants.SchemaConstants; import com.evolveum.midpoint.schema.result.OperationResult; -import com.evolveum.midpoint.schema.statistics.EnvironmentalPerformanceInformation; -import com.evolveum.midpoint.schema.statistics.IterativeTaskInformation; import com.evolveum.midpoint.schema.statistics.ProvisioningOperation; -import com.evolveum.midpoint.schema.statistics.ActionsExecutedInformation; -import com.evolveum.midpoint.schema.statistics.StatisticsUtil; import com.evolveum.midpoint.schema.statistics.SynchronizationInformation; import com.evolveum.midpoint.task.api.*; import com.evolveum.midpoint.task.quartzimpl.handlers.WaitForSubtasksByPollingTaskHandler; import com.evolveum.midpoint.task.quartzimpl.handlers.WaitForTasksTaskHandler; +import com.evolveum.midpoint.task.quartzimpl.statistics.Statistics; import com.evolveum.midpoint.util.DebugUtil; import com.evolveum.midpoint.util.exception.ObjectAlreadyExistsException; import com.evolveum.midpoint.util.exception.ObjectNotFoundException; @@ -61,14 +57,13 @@ import javax.xml.datatype.XMLGregorianCalendar; import javax.xml.namespace.QName; import java.util.*; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.Future; import static com.evolveum.midpoint.prism.xml.XmlTypeConverter.createXMLGregorianCalendar; import static com.evolveum.midpoint.xml.ns._public.common.common_3.TaskType.F_MODEL_OPERATION_CONTEXT; import static com.evolveum.midpoint.xml.ns._public.common.common_3.TaskType.F_WORKFLOW_CONTEXT; import static java.util.Collections.*; import static org.apache.commons.collections4.CollectionUtils.addIgnoreNull; +import static org.apache.commons.lang3.ObjectUtils.defaultIfNull; /** * Implementation of a Task. @@ -82,38 +77,48 @@ * @author Radovan Semancik * @author Pavol Mederly * + * A few notes about concurrency: + * + * This class is a frequent source of concurrency-related issues: see e.g. MID-3954, MID-4088, MID-5111, MID-5113, + * MID-5131, MID-5135. Therefore we decided to provide more explicit synchronization to it starting in midPoint 4.0. + * There are three synchronization objects: + * - PRISM_ACCESS: synchronizes access to the prism object (that is not thread-safe by itself; and that caused all mentioned issues) + * - QUARTZ_ACCESS: synchronizes execution of Quartz-related actions + * - pendingModification: synchronizes modifications queue + * - HANDLER_URI_STACK: manipulation of the URI stack (probably obsolete as URI stack is not used much) + * + * Note that PRISM_ACCESS could be replaced by taskPrism object; but unfortunately taskPrism is changed in updateTaskInstance(). + * Quartz and Pending modification synchronization is perhaps not so useful, because we do not expact two threads to modify + * a task at the same time. But let's play it safe. + * + * PRISM_ACCESS by itself is NOT sufficient, though. TODO explain + * + * TODO notes for developers (do not nest synchronization blocks) + * + * Order of synchronization: + * 1) HANDLER_URI_STACK + * 2) QUARTZ_ACCESS + * 3) pendingModification + * 4) PRISM_ACCESS + * + * TODO what about the situation where a task tries to close/suspend itself and (at the same time) task manager tries to do the same? + * Maybe the task manager should act on a clone of the task */ -public class TaskQuartzImpl implements Task { +public class TaskQuartzImpl implements InternalTaskInterface { - public static final String DOT_INTERFACE = Task.class.getName() + "."; - - private TaskBinding DEFAULT_BINDING_TYPE = TaskBinding.TIGHT; + private static final TaskBinding DEFAULT_BINDING_TYPE = TaskBinding.TIGHT; private static final int TIGHT_BINDING_INTERVAL_LIMIT = 10; - public static final long DEFAULT_OPERATION_STATS_UPDATE_INTERVAL = 3000L; - - private Long lastOperationStatsUpdateTimestamp; + private final Object QUARTZ_ACCESS = new Object(); + private final Object PRISM_ACCESS = new Object(); + private final Object HANDLER_URI_STACK = new Object(); - private long operationStatsUpdateInterval = DEFAULT_OPERATION_STATS_UPDATE_INTERVAL; + @NotNull protected final Statistics statistics; private PrismObject taskPrism; private PrismObject requestee; // temporary information - private EnvironmentalPerformanceInformation environmentalPerformanceInformation = new EnvironmentalPerformanceInformation(); - private SynchronizationInformation synchronizationInformation; // has to be explicitly enabled - private IterativeTaskInformation iterativeTaskInformation; // has to be explicitly enabled - private ActionsExecutedInformation actionsExecutedInformation; // has to be explicitly enabled - - /** - * Lightweight asynchronous subtasks. - * Each task here is a LAT, i.e. transient and with assigned lightweight handler. - *

- * This must be concurrent, because interrupt() method uses it. - */ - private Map lightweightAsynchronousSubtasks = new ConcurrentHashMap<>(); - private Task parentForLightweightAsynchronousTask; // EXPERIMENTAL - /* * Task result is stored here as well as in task prism. * @@ -133,67 +138,40 @@ public class TaskQuartzImpl implements Task { * Basically, the result should be initialized only when a new transient task is created. It should be then persisted * into the repository. Tasks that are to execute handlers should be fetched from the repository with their results. */ - private OperationResult taskResult; - - /** - * Is the task handler allowed to run, or should it stop as soon as possible? - */ - private volatile boolean canRun; - - private TaskManagerQuartzImpl taskManager; - private RepositoryService repositoryService; - - /** - * The code that should be run for asynchronous transient tasks. - * (As opposed to asynchronous persistent tasks, where the handler is specified - * via Handler URI in task prism object.) - */ - private LightweightTaskHandler lightweightTaskHandler; + protected OperationResult taskResult; - /** - * Future representing executing (or submitted-to-execution) lightweight task handler. - */ - private Future lightweightHandlerFuture; + protected TaskManagerQuartzImpl taskManager; + protected RepositoryService repositoryService; - /** - * An indication whether lightweight handler is currently executing or not. - * Used for waiting upon its completion (because java.util.concurrent facilities are not able - * to show this for cancelled/interrupted tasks). - */ - private volatile boolean lightweightHandlerExecuting; + private boolean recreateQuartzTrigger = false; // whether to recreate quartz trigger on next flushPendingModifications and/or synchronizeWithQuartz - /** - * Thread in which this task's lightweight handler is executing. - */ - private volatile Thread lightweightThread; + @NotNull // beware, we still have to synchronize on pendingModifications while iterating over it + private final List> pendingModifications = Collections.synchronizedList(new ArrayList<>()); private static final Trace LOGGER = TraceManager.getTrace(TaskQuartzImpl.class); - private static final Trace PERFORMANCE_ADVISOR = TraceManager.getPerformanceAdvisorTrace(); + + //region Constructors private TaskQuartzImpl(TaskManagerQuartzImpl taskManager) { this.taskManager = taskManager; - this.canRun = true; + statistics = new Statistics(taskManager.getPrismContext()); } - //region Constructors - /** * Note: This constructor assumes that the task is transient. * - * @param taskManager - * @param taskIdentifier * @param operationName if null, default op. name will be used */ TaskQuartzImpl(TaskManagerQuartzImpl taskManager, LightweightIdentifier taskIdentifier, String operationName) { this(taskManager); this.repositoryService = taskManager.getRepositoryService(); - this.taskPrism = createPrism(); + this.taskPrism = new TaskType(getPrismContext()).asPrismObject(); setTaskIdentifier(taskIdentifier.toString()); setExecutionStatusTransient(TaskExecutionStatus.RUNNABLE); setRecurrenceStatusTransient(TaskRecurrence.SINGLE); setBindingTransient(DEFAULT_BINDING_TYPE); - setProgressTransient(0); + setProgressTransient(0L); setObjectTransient(null); createOrUpdateTaskResult(operationName, true); @@ -205,65 +183,94 @@ private TaskQuartzImpl(TaskManagerQuartzImpl taskManager) { * * NOTE: if the result in prism is null, task result will be kept null as well (meaning it was not fetched from the repository). * - * @param operationName if null, default op. name will be used */ - TaskQuartzImpl(TaskManagerQuartzImpl taskManager, PrismObject taskPrism, RepositoryService repositoryService, - String operationName) { + TaskQuartzImpl(TaskManagerQuartzImpl taskManager, PrismObject taskPrism, RepositoryService repositoryService) { this(taskManager); this.repositoryService = repositoryService; this.taskPrism = taskPrism; - createOrUpdateTaskResult(operationName, false); + createOrUpdateTaskResult(null, false); setDefaults(); } - private PrismObject createPrism() { - try { - return getPrismContext().createObject(TaskType.class); - } catch (SchemaException e) { - throw new SystemException(e.getMessage(), e); - } - } - private void setDefaults() { if (getBinding() == null) { setBindingTransient(DEFAULT_BINDING_TYPE); } } + //endregion + + //region Result handling private void createOrUpdateTaskResult(String operationName, boolean create) { - OperationResultType resultInPrism = taskPrism.asObjectable().getResult(); - if (resultInPrism == null && create) { - if (operationName == null) { - resultInPrism = createUnnamedTaskResult().createOperationResultType(); - } else { - resultInPrism = new OperationResult(operationName).createOperationResultType(); + synchronized (PRISM_ACCESS) { + OperationResultType resultInPrism = taskPrism.asObjectable().getResult(); + if (resultInPrism == null && create) { + if (operationName == null) { + resultInPrism = createUnnamedTaskResult().createOperationResultType(); + } else { + resultInPrism = new OperationResult(operationName).createOperationResultType(); + } + taskPrism.asObjectable().setResult(resultInPrism); + } + if (resultInPrism != null) { + try { + taskResult = OperationResult.createOperationResult(resultInPrism); + } catch (SchemaException e) { + throw new SystemException(e.getMessage(), e); + } } - taskPrism.asObjectable().setResult(resultInPrism); } - if (resultInPrism != null) { - try { - taskResult = OperationResult.createOperationResult(resultInPrism); - } catch (SchemaException e) { - throw new SystemException(e.getMessage(), e); + } + + private void updateTaskPrismResult(PrismObject target) { + synchronized (PRISM_ACCESS) { + if (taskResult != null) { + target.asObjectable().setResult(taskResult.createOperationResultType()); + target.asObjectable().setResultStatus(taskResult.getStatus().createStatusType()); } } } //endregion - public PrismObject getTaskPrismObject() { + //region Main getters and setters + + private boolean isLiveRunningInstance() { + return this instanceof RunningTask; + } - if (taskResult != null) { - taskPrism.asObjectable().setResult(taskResult.createOperationResultType()); - taskPrism.asObjectable().setResultStatus(taskResult.getStatus().createStatusType()); - } - return taskPrism; + /** + * TODO TODO TODO + */ + PrismObject getLiveTaskPrismObject() { + if (isLiveRunningInstance()) { + throw new UnsupportedOperationException("It is not possible to get live task prism object from the running task instance: " + this); + } else { + return taskPrism; + } } @Override - public TaskType getTaskType() { - return getTaskPrismObject().asObjectable(); + public PrismObject getTaskPrismObject() { + if (isLiveRunningInstance()) { + return getTaskPrismObjectClone(); + } else { + updateTaskPrismResult(taskPrism); + return taskPrism; + } + } + + Task cloneAsStaticTask() { + return new TaskQuartzImpl(taskManager, getTaskPrismObjectClone(), repositoryService); + } + + public PrismObject getTaskPrismObjectClone() { + synchronized (PRISM_ACCESS) { + PrismObject rv = taskPrism.clone(); + updateTaskPrismResult(rv); + return rv; + } } RepositoryService getRepositoryService() { @@ -275,52 +282,51 @@ void setRepositoryService(RepositoryService repositoryService) { } @Override - public boolean isAsynchronous() { - return getPersistenceStatus() == TaskPersistenceStatus.PERSISTENT - || isLightweightAsynchronousTask(); // note: if it has lightweight task handler, it must be transient - } - - private boolean recreateQuartzTrigger = false; // whether to recreate quartz trigger on next savePendingModifications and/or synchronizeWithQuartz - public boolean isRecreateQuartzTrigger() { return recreateQuartzTrigger; } + @Override public void setRecreateQuartzTrigger(boolean recreateQuartzTrigger) { this.recreateQuartzTrigger = recreateQuartzTrigger; } + //endregion - @NotNull - private final Collection> pendingModifications = new ArrayList<>(); - + //region Pending modifications public void addPendingModification(ItemDelta delta) { - ItemDeltaCollectionsUtil.merge(pendingModifications, delta); + if (delta != null) { + synchronized (pendingModifications) { + ItemDeltaCollectionsUtil.merge(pendingModifications, delta); + } + } } @Override - public void addModification(ItemDelta delta) throws SchemaException { + public void modify(ItemDelta delta) throws SchemaException { addPendingModification(delta); - delta.applyTo(taskPrism); + synchronized (PRISM_ACCESS) { + delta.applyTo(taskPrism); + } } @Override - public void addModifications(Collection> deltas) throws SchemaException { + public void modify(Collection> deltas) throws SchemaException { for (ItemDelta delta : deltas) { - addPendingModification(delta); - delta.applyTo(taskPrism); + modify(delta); } } @Override - public void addModificationImmediate(ItemDelta delta, OperationResult parentResult) + public void modifyAndFlush(ItemDelta delta, OperationResult parentResult) throws SchemaException, ObjectAlreadyExistsException, ObjectNotFoundException { - addPendingModification(delta); - delta.applyTo(taskPrism); - savePendingModifications(parentResult); + synchronized (pendingModifications) { + modify(delta); + flushPendingModifications(parentResult); + } } @Override - public void savePendingModifications(OperationResult parentResult) + public void flushPendingModifications(OperationResult parentResult) throws ObjectNotFoundException, SchemaException, ObjectAlreadyExistsException { if (isTransient()) { synchronized (pendingModifications) { @@ -330,7 +336,6 @@ public void savePendingModifications(OperationResult parentResult) } synchronized (pendingModifications) { // todo perhaps we should put something like this at more places here... if (!pendingModifications.isEmpty()) { - try { repositoryService.modifyObject(TaskType.class, getOid(), pendingModifications, parentResult); } finally { // todo reconsider this (it's not ideal but we need at least to reset pendingModifications to stop repeating applying this change) @@ -350,41 +355,14 @@ public void savePendingModifications(OperationResult parentResult) return pendingModifications; } - public void synchronizeWithQuartz(OperationResult parentResult) { - taskManager.synchronizeTaskWithQuartz(this, parentResult); - setRecreateQuartzTrigger(false); - } - - private static Set quartzRelatedProperties = new HashSet<>(); - - static { - quartzRelatedProperties.add(TaskType.F_BINDING); - quartzRelatedProperties.add(TaskType.F_RECURRENCE); - quartzRelatedProperties.add(TaskType.F_SCHEDULE); - quartzRelatedProperties.add(TaskType.F_HANDLER_URI); - } - - private void synchronizeWithQuartzIfNeeded(Collection> deltas, OperationResult parentResult) { - if (isRecreateQuartzTrigger()) { - synchronizeWithQuartz(parentResult); - return; - } - for (ItemDelta delta : deltas) { - if (delta.getParentPath().isEmpty() && quartzRelatedProperties.contains(delta.getElementName())) { - synchronizeWithQuartz(parentResult); - return; - } - } - } - - private void processModificationNow(ItemDelta delta, OperationResult parentResult) + private void modifyRepository(ItemDelta delta, OperationResult parentResult) throws ObjectNotFoundException, SchemaException, ObjectAlreadyExistsException { if (delta != null) { - processModificationsNow(singleton(delta), parentResult); + modifyRepository(singleton(delta), parentResult); } } - private void processModificationsNow(Collection> deltas, OperationResult parentResult) + private void modifyRepository(Collection> deltas, OperationResult parentResult) throws ObjectNotFoundException, SchemaException, ObjectAlreadyExistsException { if (isPersistent()) { repositoryService.modifyObject(TaskType.class, getOid(), deltas, parentResult); @@ -392,139 +370,212 @@ private void processModificationsNow(Collection> deltas, Operati } } - private void processModificationsNow(Collection> deltas, ModificationPrecondition precondition, OperationResult parentResult) + private void modifyRepository(Collection> deltas, ModificationPrecondition precondition, OperationResult parentResult) throws ObjectNotFoundException, SchemaException, ObjectAlreadyExistsException, PreconditionViolationException { if (isPersistent()) { repositoryService.modifyObject(TaskType.class, getOid(), deltas, precondition, null, parentResult); synchronizeWithQuartzIfNeeded(deltas, parentResult); } } + //endregion - private void processModificationBatched(ItemDelta delta) { - if (delta != null) { - addPendingModification(delta); + //region Quartz integration + void synchronizeWithQuartz(OperationResult parentResult) { + synchronized (QUARTZ_ACCESS) { + taskManager.synchronizeTaskWithQuartz(this, parentResult); + setRecreateQuartzTrigger(false); } } + private static final Set QUARTZ_RELATED_PROPERTIES = new HashSet<>(); - /* - * Getters and setters - * =================== - */ + static { + QUARTZ_RELATED_PROPERTIES.add(TaskType.F_BINDING); + QUARTZ_RELATED_PROPERTIES.add(TaskType.F_RECURRENCE); + QUARTZ_RELATED_PROPERTIES.add(TaskType.F_SCHEDULE); + QUARTZ_RELATED_PROPERTIES.add(TaskType.F_HANDLER_URI); + } - /* - * Progress / expectedTotal - */ + private void synchronizeWithQuartzIfNeeded(Collection> deltas, OperationResult parentResult) { + synchronized (QUARTZ_ACCESS) { + if (isRecreateQuartzTrigger()) { + synchronizeWithQuartz(parentResult); + } else { + for (ItemDelta delta : deltas) { + if (delta.getParentPath().isEmpty() && QUARTZ_RELATED_PROPERTIES.contains(delta.getElementName())) { + synchronizeWithQuartz(parentResult); + break; + } + } + } + } + } - @Override - public long getProgress() { - Long value = taskPrism.getPropertyRealValue(TaskType.F_PROGRESS, Long.class); - return value != null ? value : 0; + //endregion + + @Nullable + PropertyDelta createPropertyDeltaIfPersistent(ItemName name, X value) { + return isPersistent() ? deltaFactory().property().createReplaceDeltaOrEmptyDelta( + taskManager.getTaskObjectDefinition(), name, value) : null; } - @Override - public void setProgress(long value) { - processModificationBatched(setProgressAndPrepareDelta(value)); + @Nullable + ReferenceDelta createReferenceDeltaIfPersistent(ItemName name, ObjectReferenceType value) { + return isPersistent() ? deltaFactory().reference().createModificationReplace(name, + taskManager.getTaskObjectDefinition(), value != null ? value.clone().asReferenceValue() : null) : null; } - @Override - public void setProgressImmediate(long value, OperationResult parentResult) - throws ObjectNotFoundException, SchemaException { + + //region Getting and setting task properties, references and containers + + private T cloneIfRunning(T value) { + return isLiveRunningInstance() ? CloneUtil.clone(value) : value; + } + + private X getProperty(ItemName name) { + synchronized (PRISM_ACCESS) { + PrismProperty property = taskPrism.findProperty(name); + return property != null ? property.getRealValue() : null; + } + } + + private void setProperty(ItemName name, X value) { + addPendingModification(setPropertyAndCreateDeltaIfPersistent(name, value)); + } + + private void setPropertyTransient(ItemName name, X value) { + synchronized (PRISM_ACCESS) { + try { + taskPrism.setPropertyRealValue(name, value); + } catch (SchemaException e) { + throw new SystemException("Couldn't set the task property '" + name + "': " + e.getMessage(), e); + } + } + } + + private void setPropertyImmediate(ItemName name, X value, OperationResult result) + throws SchemaException, ObjectNotFoundException { try { - processModificationNow(setProgressAndPrepareDelta(value), parentResult); + modifyRepository(setPropertyAndCreateDeltaIfPersistent(name, value), result); } catch (ObjectAlreadyExistsException ex) { - throw new SystemException(ex); + throw new SystemException("Unexpected ObjectAlreadyExistsException while modifying '" + name + "' property: " + + ex.getMessage(), ex); } } - @Override - public void setProgressTransient(long value) { - try { - taskPrism.setPropertyRealValue(TaskType.F_PROGRESS, value); - } catch (SchemaException e) { - // This should not happen - throw new IllegalStateException("Internal schema error: " + e.getMessage(), e); + private PropertyDelta setPropertyAndCreateDeltaIfPersistent(ItemName name, X value) { + setPropertyTransient(name, value); + return createPropertyDeltaIfPersistent(name, value); + } + + private PrismReferenceValue getReferenceValue(ItemName name) { + synchronized (PRISM_ACCESS) { + PrismReference reference = taskPrism.findReference(name); + return reference != null ? reference.getValue() : null; } } - private PropertyDelta setProgressAndPrepareDelta(long value) { - setProgressTransient(value); - return createProgressDelta(value); + private ObjectReferenceType getReference(ItemName name) { + PrismReferenceValue value = getReferenceValue(name); + return value != null ? new ObjectReferenceType().setupReferenceValue(value) : null; } - @Nullable - private PropertyDelta createProgressDelta(long value) { - return isPersistent() ? deltaFactory().property().createReplaceDeltaOrEmptyDelta( - taskManager.getTaskObjectDefinition(), TaskType.F_PROGRESS, value) : null; + private void setReference(ItemName name, ObjectReferenceType value) { + addPendingModification(setReferenceAndCreateDeltaIfPersistent(name, value)); } - @Override - public OperationStatsType getStoredOperationStats() { - return taskPrism.asObjectable().getOperationStats(); + private void setReferenceTransient(ItemName name, ObjectReferenceType value) { + synchronized (PRISM_ACCESS) { + try { + taskPrism.findOrCreateReference(name).replace(value != null ? value.clone().asReferenceValue() : null); + } catch (SchemaException e) { + throw new SystemException("Couldn't set the task reference '" + name + "': " + e.getMessage(), e); + } + } } - public void setOperationStatsTransient(OperationStatsType value) { + private void setReferenceImmediate(ItemName name, ObjectReferenceType value, OperationResult result) + throws SchemaException, ObjectNotFoundException { try { - taskPrism.setPropertyRealValue(TaskType.F_OPERATION_STATS, value); - } catch (SchemaException e) { - // This should not happen - throw new IllegalStateException("Internal schema error: " + e.getMessage(), e); + modifyRepository(setReferenceAndCreateDeltaIfPersistent(name, value), result); + } catch (ObjectAlreadyExistsException ex) { + throw new SystemException("Unexpected ObjectAlreadyExistsException while modifying '" + name + "' property: " + + ex.getMessage(), ex); } } - public void setOperationStats(OperationStatsType value) { - processModificationBatched(setOperationStatsAndPrepareDelta(value)); + private ReferenceDelta setReferenceAndCreateDeltaIfPersistent(ItemName name, ObjectReferenceType value) { + setReferenceTransient(name, value); + return createReferenceDeltaIfPersistent(name, value); } - private PropertyDelta setOperationStatsAndPrepareDelta(OperationStatsType value) { - setOperationStatsTransient(value); - return isPersistent() ? deltaFactory().property().createReplaceDeltaOrEmptyDelta( - taskManager.getTaskObjectDefinition(), TaskType.F_OPERATION_STATS, value) : null; + /* + * progress + */ + + @Override + public long getProgress() { + return defaultIfNull(getProperty(TaskType.F_PROGRESS), 0L); } @Override - @Nullable - public Long getExpectedTotal() { - return taskPrism.getPropertyRealValue(TaskType.F_EXPECTED_TOTAL, Long.class); + public void setProgress(Long value) { + setProperty(TaskType.F_PROGRESS, value); } @Override - public void setExpectedTotal(Long value) { - processModificationBatched(setExpectedTotalAndPrepareDelta(value)); + public void setProgressImmediate(Long value, OperationResult result) throws ObjectNotFoundException, SchemaException { + setPropertyImmediate(TaskType.F_PROGRESS, value, result); } @Override - public void setExpectedTotalImmediate(Long value, OperationResult parentResult) - throws ObjectNotFoundException, SchemaException { - try { - processModificationNow(setExpectedTotalAndPrepareDelta(value), parentResult); - } catch (ObjectAlreadyExistsException ex) { - throw new SystemException(ex); - } + public void setProgressTransient(Long value) { + setPropertyTransient(TaskType.F_PROGRESS, value); } - public void setExpectedTotalTransient(Long value) { - try { - taskPrism.setPropertyRealValue(TaskType.F_EXPECTED_TOTAL, value); - } catch (SchemaException e) { - // This should not happen - throw new IllegalStateException("Internal schema error: " + e.getMessage(), e); - } + /* + * storedOperationStats + */ + + @Override + public OperationStatsType getStoredOperationStats() { + return getProperty(TaskType.F_OPERATION_STATS); + } + + public void setOperationStats(OperationStatsType value) { + setProperty(TaskType.F_OPERATION_STATS, value); } - private PropertyDelta setExpectedTotalAndPrepareDelta(Long value) { - setExpectedTotalTransient(value); - return createExpectedTotalDelta(value); + public void setOperationStatsTransient(OperationStatsType value) { + setPropertyTransient(TaskType.F_OPERATION_STATS, value); } + /* + * expectedTotal + */ + + @Override @Nullable - private PropertyDelta createExpectedTotalDelta(Long value) { - return isPersistent() ? deltaFactory().property().createReplaceDeltaOrEmptyDelta( - taskManager.getTaskObjectDefinition(), TaskType.F_EXPECTED_TOTAL, value) : null; + public Long getExpectedTotal() { + return getProperty(TaskType.F_EXPECTED_TOTAL); + } + + @Override + public void setExpectedTotal(Long value) { + setProperty(TaskType.F_EXPECTED_TOTAL, value); + } + + public void setExpectedTotalTransient(Long value) { + setPropertyTransient(TaskType.F_EXPECTED_TOTAL, value); + } + + @Override + public void setExpectedTotalImmediate(Long value, OperationResult result) throws ObjectNotFoundException, SchemaException { + setPropertyImmediate(TaskType.F_EXPECTED_TOTAL, value, result); } /* - * Result + * result * * setters set also result status type! */ @@ -536,37 +587,34 @@ public OperationResult getResult() { @Override public void setResult(OperationResult result) { - processModificationBatched(setResultAndPrepareDelta(result)); - setResultStatusType(result != null ? result.getStatus().createStatusType() : null); + addPendingModification(setResultAndPrepareDelta(result)); + setProperty(TaskType.F_RESULT_STATUS, result != null ? result.getStatus().createStatusType() : null); } @Override - public void setResultImmediate(OperationResult result, OperationResult parentResult) + public void setResultImmediate(OperationResult result, OperationResult opResult) throws ObjectNotFoundException, SchemaException { try { - processModificationNow(setResultAndPrepareDelta(result), parentResult); - setResultStatusTypeImmediate(result != null ? result.getStatus().createStatusType() : null, parentResult); + modifyRepository(setResultAndPrepareDelta(result), opResult); + setPropertyImmediate(TaskType.F_RESULT_STATUS, result != null ? result.getStatus().createStatusType() : null, opResult); } catch (ObjectAlreadyExistsException ex) { throw new SystemException(ex); } } - public void updateStoredTaskResult() throws SchemaException, ObjectNotFoundException { - setResultImmediate(getResult(), new OperationResult("dummy")); - } - @Override public void setResultTransient(OperationResult result) { - this.taskResult = result; - this.taskPrism.asObjectable().setResult(result != null ? result.createOperationResultType() : null); - setResultStatusTypeTransient(result != null ? result.getStatus().createStatusType() : null); + synchronized (PRISM_ACCESS) { + taskResult = result; + taskPrism.asObjectable().setResult(result != null ? result.createOperationResultType() : null); + taskPrism.asObjectable().setResultStatus(result != null ? result.getStatus().createStatusType() : null); + } } private PropertyDelta setResultAndPrepareDelta(OperationResult result) { setResultTransient(result); if (isPersistent()) { - return deltaFactory().property().createReplaceDeltaOrEmptyDelta(taskManager.getTaskObjectDefinition(), - TaskType.F_RESULT, result != null ? result.createOperationResultType() : null); + return createPropertyDeltaIfPersistent(TaskType.F_RESULT, result != null ? result.createOperationResultType() : null); } else { return null; } @@ -578,86 +626,42 @@ private PropertyDelta setResultAndPrepareDelta(OperationResult result) { * We read the status from current 'taskResult', not from prism - to be sure to get the most current value. * However, when updating, we update the result in prism object in order for the result to be stored correctly in * the repo (useful for displaying the result in task list). - * - * So, setting result type to a value that contradicts current taskResult leads to problems. - * Anyway, result type should not be set directly, only when updating OperationResult. */ @Override public OperationResultStatusType getResultStatus() { if (taskResult == null) { - if (taskPrism != null) { + // TODO is it OK to fall back to task prism here? + synchronized (PRISM_ACCESS) { return taskPrism.asObjectable().getResultStatus(); - } else { - return null; } } else { return taskResult.getStatus().createStatusType(); } } - public void setResultStatusType(OperationResultStatusType value) { - processModificationBatched(setResultStatusTypeAndPrepareDelta(value)); - } - - public void setResultStatusTypeImmediate(OperationResultStatusType value, OperationResult parentResult) - throws ObjectNotFoundException, SchemaException, ObjectAlreadyExistsException { - processModificationNow(setResultStatusTypeAndPrepareDelta(value), parentResult); - } - - public void setResultStatusTypeTransient(OperationResultStatusType value) { - taskPrism.asObjectable().setResultStatus(value); - } - - private PropertyDelta setResultStatusTypeAndPrepareDelta(OperationResultStatusType value) { - setResultStatusTypeTransient(value); - if (isPersistent()) { - return deltaFactory().property().createReplaceDeltaOrEmptyDelta(taskManager.getTaskObjectDefinition(), - TaskType.F_RESULT_STATUS, value); - } else { - return null; - } - } - /* * Handler URI */ @Override public String getHandlerUri() { - return taskPrism.getPropertyRealValue(TaskType.F_HANDLER_URI, String.class); - } - - public void setHandlerUriTransient(String handlerUri) { - try { - taskPrism.setPropertyRealValue(TaskType.F_HANDLER_URI, handlerUri); - } catch (SchemaException e) { - // This should not happen - throw new IllegalStateException("Internal schema error: " + e.getMessage(), e); - } - } - - @Override - public void setHandlerUriImmediate(String value, OperationResult parentResult) - throws ObjectNotFoundException, SchemaException { - try { - processModificationNow(setHandlerUriAndPrepareDelta(value), parentResult); - } catch (ObjectAlreadyExistsException ex) { - throw new SystemException(ex); - } + return getProperty(TaskType.F_HANDLER_URI); } @Override public void setHandlerUri(String value) { - processModificationBatched(setHandlerUriAndPrepareDelta(value)); + setProperty(TaskType.F_HANDLER_URI, value); } - private PropertyDelta setHandlerUriAndPrepareDelta(String value) { - setHandlerUriTransient(value); - return isPersistent() ? deltaFactory().property().createReplaceDeltaOrEmptyDelta( - taskManager.getTaskObjectDefinition(), TaskType.F_HANDLER_URI, value) : null; + public void setHandlerUriTransient(String value) { + setPropertyTransient(TaskType.F_HANDLER_URI, value); } + @Override + public void setHandlerUriImmediate(String value, OperationResult result) throws ObjectNotFoundException, SchemaException { + setPropertyImmediate(TaskType.F_HANDLER_URI, value, result); + } /* * Other handlers URI stack @@ -665,86 +669,40 @@ private PropertyDelta setHandlerUriAndPrepareDelta(String value) { @Override public UriStack getOtherHandlersUriStack() { - checkHandlerUriConsistency(); - return taskPrism.asObjectable().getOtherHandlersUriStack(); + synchronized (HANDLER_URI_STACK) { + return getProperty(TaskType.F_OTHER_HANDLERS_URI_STACK); + } } - public void setOtherHandlersUriStackTransient(UriStack value) { - try { - taskPrism.setPropertyRealValue(TaskType.F_OTHER_HANDLERS_URI_STACK, value); - } catch (SchemaException e) { - // This should not happen - throw new IllegalStateException("Internal schema error: " + e.getMessage(), e); + public void setOtherHandlersUriStack(UriStack value) { + synchronized (HANDLER_URI_STACK) { + setProperty(TaskType.F_OTHER_HANDLERS_URI_STACK, value); + checkHandlerUriConsistency(); } - checkHandlerUriConsistency(); } - public void setOtherHandlersUriStackImmediate(UriStack value, OperationResult parentResult) - throws ObjectNotFoundException, SchemaException { - try { - processModificationNow(setOtherHandlersUriStackAndPrepareDelta(value), parentResult); + private UriStackEntry popFromOtherHandlersUriStack() { + synchronized (HANDLER_URI_STACK) { checkHandlerUriConsistency(); - } catch (ObjectAlreadyExistsException ex) { - throw new SystemException(ex); + UriStack stack = getOtherHandlersUriStack(); + if (stack == null || stack.getUriStackEntry().isEmpty()) + throw new IllegalStateException("Couldn't pop from OtherHandlersUriStack, because it is null or empty"); + int last = stack.getUriStackEntry().size() - 1; + UriStackEntry retval = stack.getUriStackEntry().get(last); + stack.getUriStackEntry().remove(last); + setOtherHandlersUriStack(stack); + return retval; } } - public void setOtherHandlersUriStack(UriStack value) { - processModificationBatched(setOtherHandlersUriStackAndPrepareDelta(value)); - checkHandlerUriConsistency(); + @Override + public void pushHandlerUri(String uri, ScheduleType schedule, TaskBinding binding) { + pushHandlerUri(uri, schedule, binding, (Collection>) null); } - private PropertyDelta setOtherHandlersUriStackAndPrepareDelta(UriStack value) { - setOtherHandlersUriStackTransient(value); - return isPersistent() ? deltaFactory().property().createReplaceDeltaOrEmptyDelta( - taskManager.getTaskObjectDefinition(), TaskType.F_OTHER_HANDLERS_URI_STACK, value) : null; - } - - private UriStackEntry popFromOtherHandlersUriStack() { - - checkHandlerUriConsistency(); - - UriStack stack = taskPrism.getPropertyRealValue(TaskType.F_OTHER_HANDLERS_URI_STACK, UriStack.class); - // is this a live value or a copy? (should be live) - - if (stack == null || stack.getUriStackEntry().isEmpty()) - throw new IllegalStateException("Couldn't pop from OtherHandlersUriStack, because it is null or empty"); - int last = stack.getUriStackEntry().size() - 1; - UriStackEntry retval = stack.getUriStackEntry().get(last); - stack.getUriStackEntry().remove(last); - - // UriStack stack2 = taskPrism.getPropertyRealValue(TaskType.F_OTHER_HANDLERS_URI_STACK, UriStack.class); - // LOGGER.info("Stack size after popping: " + stack.getUriStackEntry().size() - // + ", freshly got stack size: " + stack2.getUriStackEntry().size()); - - setOtherHandlersUriStack(stack); - - return retval; - } - - // @Override - // public void pushHandlerUri(String uri) { - // pushHandlerUri(uri, null, null); - // } - // - // @Override - // public void pushHandlerUri(String uri, ScheduleType schedule) { - // pushHandlerUri(uri, schedule, null); - // } - - @Override - public void pushHandlerUri(String uri, ScheduleType schedule, TaskBinding binding) { - pushHandlerUri(uri, schedule, binding, (Collection>) null); - } - - @Override - public void pushHandlerUri(String uri, ScheduleType schedule, TaskBinding binding, ItemDelta delta) { - Collection> deltas = null; - if (delta != null) { - deltas = new ArrayList<>(); - deltas.add(delta); - } - pushHandlerUri(uri, schedule, binding, deltas); + @Override + public void pushHandlerUri(String uri, ScheduleType schedule, TaskBinding binding, ItemDelta delta) { + pushHandlerUri(uri, schedule, binding, delta != null ? singletonList(delta) : null); } /** @@ -756,45 +714,46 @@ public void pushHandlerUri(String uri, ScheduleType schedule, TaskBinding bindin * @param binding New binding */ @Override - public void pushHandlerUri(String uri, ScheduleType schedule, TaskBinding binding, - Collection> extensionDeltas) { - + public void pushHandlerUri(String uri, ScheduleType schedule, TaskBinding binding, Collection> extensionDeltas) { Validate.notNull(uri); - if (binding == null) { - binding = bindingFromSchedule(schedule); - } - checkHandlerUriConsistency(); + synchronized (HANDLER_URI_STACK) { + if (binding == null) { + binding = bindingFromSchedule(schedule); + } - if (this.getHandlerUri() != null) { + checkHandlerUriConsistency(); - UriStack stack = taskPrism.getPropertyRealValue(TaskType.F_OTHER_HANDLERS_URI_STACK, UriStack.class); - if (stack == null) { - stack = new UriStack(); - } + if (this.getHandlerUri() != null) { + UriStack stack = getOtherHandlersUriStack(); + if (stack == null) { + stack = new UriStack(); + } - UriStackEntry use = new UriStackEntry(); - use.setHandlerUri(getHandlerUri()); - use.setRecurrence(getRecurrenceStatus().toTaskType()); - use.setSchedule(getSchedule()); - use.setBinding(getBinding().toTaskType()); - if (extensionDeltas != null) { - storeExtensionDeltas(use.getExtensionDelta(), extensionDeltas); + UriStackEntry entry = new UriStackEntry(); + entry.setHandlerUri(getHandlerUri()); + entry.setRecurrence(getRecurrenceStatus().toTaskType()); + entry.setSchedule(getSchedule()); + entry.setBinding(getBinding().toTaskType()); + if (extensionDeltas != null) { + storeExtensionDeltas(entry.getExtensionDelta(), extensionDeltas); + } + stack.getUriStackEntry().add(entry); + setOtherHandlersUriStack(stack); } - stack.getUriStackEntry().add(use); - setOtherHandlersUriStack(stack); - } - setHandlerUri(uri); - setSchedule(schedule); - setRecurrenceStatus(recurrenceFromSchedule(schedule)); - setBinding(binding); + setHandlerUri(uri); + setSchedule(schedule); + setRecurrenceStatus(recurrenceFromSchedule(schedule)); + setBinding(binding); - this.setRecreateQuartzTrigger(true); // will be applied on modifications save + setRecreateQuartzTrigger(true); // will be applied on modifications save + } } - private void storeExtensionDeltas(List result, Collection> extensionDeltas) { + // the following methods are static to be sure there are no concurrency issues + private static void storeExtensionDeltas(List result, Collection> extensionDeltas) { for (ItemDelta itemDelta : extensionDeltas) { Collection deltaTypes; try { @@ -807,7 +766,7 @@ private void storeExtensionDeltas(List result, Collection previousValue == null || previousValue == t.asObjectable().getExecutionStatus(), parentResult); } catch (ObjectAlreadyExistsException ex) { throw new SystemException(ex); } } - public void setExecutionStatus(TaskExecutionStatus value) { - processModificationBatched(setExecutionStatusAndPrepareDelta(value)); - } - private PropertyDelta setExecutionStatusAndPrepareDelta(TaskExecutionStatus value) { setExecutionStatusTransient(value); - return isPersistent() ? deltaFactory().property().createReplaceDeltaOrEmptyDelta( - taskManager.getTaskObjectDefinition(), TaskType.F_EXECUTION_STATUS, value.toTaskType()) : null; + return createPropertyDeltaIfPersistent(TaskType.F_EXECUTION_STATUS, value.toTaskType()); } @Override @@ -1074,9 +1016,6 @@ public void makeRunnable() { @Override public void makeWaiting() { -// if (!isTransient()) { -// throw new IllegalStateException("makeWaiting can be invoked only on transient tasks; task = " + this); -// } setExecutionStatus(TaskExecutionStatus.WAITING); } @@ -1102,48 +1041,25 @@ public boolean isClosed() { @Override public TaskWaitingReason getWaitingReason() { - TaskWaitingReasonType xmlValue = taskPrism.asObjectable().getWaitingReason(); - if (xmlValue == null) { - return null; - } - return TaskWaitingReason.fromTaskType(xmlValue); - } - - public void setWaitingReasonTransient(TaskWaitingReason value) { - taskPrism.asObjectable().setWaitingReason(value != null ? value.toTaskType() : null); + return TaskWaitingReason.fromTaskType(getProperty(TaskType.F_WAITING_REASON)); } public void setWaitingReason(TaskWaitingReason value) { - processModificationBatched(setWaitingReasonAndPrepareDelta(value)); + setProperty(TaskType.F_WAITING_REASON, value != null ? value.toTaskType() : null); } - public void setWaitingReasonImmediate(TaskWaitingReason value, OperationResult parentResult) + @Override + public void setWaitingReasonImmediate(TaskWaitingReason value, OperationResult result) throws ObjectNotFoundException, SchemaException { - try { - processModificationNow(setWaitingReasonAndPrepareDelta(value), parentResult); - } catch (ObjectAlreadyExistsException ex) { - throw new SystemException(ex); - } - } - - private PropertyDelta setWaitingReasonAndPrepareDelta(TaskWaitingReason value) { - setWaitingReasonTransient(value); - return isPersistent() ? deltaFactory().property().createReplaceDeltaOrEmptyDelta( - taskManager.getTaskObjectDefinition(), TaskType.F_WAITING_REASON, value.toTaskType()) : null; + setPropertyImmediate(TaskType.F_WAITING_REASON, value != null ? value.toTaskType() : null, result); } - public void setUnpauseActionTransient(TaskUnpauseActionType value) { - taskPrism.asObjectable().setUnpauseAction(value); - } - - public void setUnpauseAction(TaskUnpauseActionType value) { - processModificationBatched(setUnpauseActionAndPrepareDelta(value)); - } + /* + * Unpause action + */ - private PropertyDelta setUnpauseActionAndPrepareDelta(TaskUnpauseActionType value) { - setUnpauseActionTransient(value); - return isPersistent() ? deltaFactory().property().createReplaceDeltaOrEmptyDelta( - taskManager.getTaskObjectDefinition(), TaskType.F_UNPAUSE_ACTION, value) : null; + private void setUnpauseAction(TaskUnpauseActionType value) { + setProperty(TaskType.F_UNPAUSE_ACTION, value); } // "safe" method @@ -1158,55 +1074,31 @@ public void startWaitingForTasksImmediate(OperationResult result) throws SchemaE checkDependencies(result); } - /* - * Recurrence status - */ + /* + * Recurrence status + */ public TaskRecurrence getRecurrenceStatus() { - TaskRecurrenceType xmlValue = taskPrism.getPropertyRealValue(TaskType.F_RECURRENCE, TaskRecurrenceType.class); - if (xmlValue == null) { - return null; - } - return TaskRecurrence.fromTaskType(xmlValue); + return TaskRecurrence.fromTaskType(getProperty(TaskType.F_RECURRENCE)); } @Override public boolean isSingle() { - return (getRecurrenceStatus() == TaskRecurrence.SINGLE); + return getRecurrenceStatus() == TaskRecurrence.SINGLE; } @Override - public boolean isCycle() { - // TODO: binding - return (getRecurrenceStatus() == TaskRecurrence.RECURRING); + public boolean isRecurring() { + return getRecurrenceStatus() == TaskRecurrence.RECURRING; } - public void setRecurrenceStatus(TaskRecurrence value) { - processModificationBatched(setRecurrenceStatusAndPrepareDelta(value)); + void setRecurrenceStatus(@NotNull TaskRecurrence value) { + setProperty(TaskType.F_RECURRENCE, value.toTaskType()); } - public void setRecurrenceStatusImmediate(TaskRecurrence value, OperationResult parentResult) - throws ObjectNotFoundException, SchemaException { - try { - processModificationNow(setRecurrenceStatusAndPrepareDelta(value), parentResult); - } catch (ObjectAlreadyExistsException ex) { - throw new SystemException(ex); - } - } - - public void setRecurrenceStatusTransient(TaskRecurrence value) { - try { - taskPrism.setPropertyRealValue(TaskType.F_RECURRENCE, value.toTaskType()); - } catch (SchemaException e) { - // This should not happen - throw new IllegalStateException("Internal schema error: " + e.getMessage(), e); - } - } - - private PropertyDelta setRecurrenceStatusAndPrepareDelta(TaskRecurrence value) { - setRecurrenceStatusTransient(value); - return isPersistent() ? deltaFactory().property().createReplaceDeltaOrEmptyDelta( - taskManager.getTaskObjectDefinition(), TaskType.F_RECURRENCE, value.toTaskType()) : null; + @SuppressWarnings("SameParameterValue") + private void setRecurrenceStatusTransient(TaskRecurrence value) { + setPropertyTransient(TaskType.F_RECURRENCE, value.toTaskType()); } @Override @@ -1230,89 +1122,79 @@ public void makeRecurring(ScheduleType schedule) { @Override public void makeRecurringSimple(int interval) { setRecurrenceStatus(TaskRecurrence.RECURRING); - - ScheduleType schedule = new ScheduleType(); - schedule.setInterval(interval); - - setSchedule(schedule); + setSchedule(new ScheduleType().interval(interval)); } @Override public void makeRecurringCron(String cronLikeSpecification) { setRecurrenceStatus(TaskRecurrence.RECURRING); - - ScheduleType schedule = new ScheduleType(); - schedule.setCronLikePattern(cronLikeSpecification); - - setSchedule(schedule); + setSchedule(new ScheduleType().cronLikePattern(cronLikeSpecification)); } + /* + * executionConstraints + */ + @Override public TaskExecutionConstraintsType getExecutionConstraints() { - return taskPrism.asObjectable().getExecutionConstraints(); + synchronized (PRISM_ACCESS) { + return taskPrism.asObjectable().getExecutionConstraints(); + } } @Override public String getGroup() { - TaskExecutionConstraintsType executionConstraints = getExecutionConstraints(); - return executionConstraints != null ? executionConstraints.getGroup() : null; + synchronized (PRISM_ACCESS) { + TaskExecutionConstraintsType executionConstraints = getExecutionConstraints(); + return executionConstraints != null ? executionConstraints.getGroup() : null; + } } @NotNull @Override public Collection getGroups() { - return getGroupsWithLimits().keySet(); + synchronized (PRISM_ACCESS) { + return new HashSet<>(getGroupsWithLimits().keySet()); + } } @NotNull @Override public Map getGroupsWithLimits() { - TaskExecutionConstraintsType executionConstraints = getExecutionConstraints(); - if (executionConstraints == null) { - return emptyMap(); - } - Map rv = new HashMap<>(); - if (executionConstraints.getGroup() != null) { - rv.put(executionConstraints.getGroup(), executionConstraints.getGroupTaskLimit()); - } - for (TaskExecutionGroupConstraintType sg : executionConstraints.getSecondaryGroup()) { - if (sg.getGroup() != null) { // shouldn't occur but it's a user configurable field, so be prepared for the worst - rv.put(sg.getGroup(), sg.getGroupTaskLimit()); + synchronized (PRISM_ACCESS) { + TaskExecutionConstraintsType executionConstraints = getExecutionConstraints(); + if (executionConstraints == null) { + return emptyMap(); } + Map rv = new HashMap<>(); + if (executionConstraints.getGroup() != null) { + rv.put(executionConstraints.getGroup(), executionConstraints.getGroupTaskLimit()); + } + for (TaskExecutionGroupConstraintType sg : executionConstraints.getSecondaryGroup()) { + if (sg.getGroup() + != null) { // shouldn't occur but it's a user configurable field, so be prepared for the worst + rv.put(sg.getGroup(), sg.getGroupTaskLimit()); + } + } + return rv; } - return rv; } /* - * Schedule - */ + * Schedule + */ @Override public ScheduleType getSchedule() { - return taskPrism.asObjectable().getSchedule(); + return getProperty(TaskType.F_SCHEDULE); } public void setSchedule(ScheduleType value) { - processModificationBatched(setScheduleAndPrepareDelta(value)); - } - - public void setScheduleImmediate(ScheduleType value, OperationResult parentResult) - throws ObjectNotFoundException, SchemaException { - try { - processModificationNow(setScheduleAndPrepareDelta(value), parentResult); - } catch (ObjectAlreadyExistsException ex) { - throw new SystemException(ex); - } + setProperty(TaskType.F_SCHEDULE, value); } - private void setScheduleTransient(ScheduleType schedule) { - taskPrism.asObjectable().setSchedule(schedule); - } - - private PropertyDelta setScheduleAndPrepareDelta(ScheduleType value) { - setScheduleTransient(value); - return isPersistent() ? deltaFactory().property().createReplaceDeltaOrEmptyDelta( - taskManager.getTaskObjectDefinition(), TaskType.F_SCHEDULE, value) : null; + private void setScheduleTransient(ScheduleType value) { + setPropertyTransient(TaskType.F_SCHEDULE, value); } /* @@ -1321,50 +1203,27 @@ private PropertyDelta setScheduleAndPrepareDelta(ScheduleType value) { @Override public ThreadStopActionType getThreadStopAction() { - return taskPrism.asObjectable().getThreadStopAction(); + return getProperty(TaskType.F_THREAD_STOP_ACTION); } @Override public void setThreadStopAction(ThreadStopActionType value) { - processModificationBatched(setThreadStopActionAndPrepareDelta(value)); - } - - public void setThreadStopActionImmediate(ThreadStopActionType value, OperationResult parentResult) - throws ObjectNotFoundException, SchemaException { - try { - processModificationNow(setThreadStopActionAndPrepareDelta(value), parentResult); - } catch (ObjectAlreadyExistsException ex) { - throw new SystemException(ex); - } - } - - private void setThreadStopActionTransient(ThreadStopActionType value) { - taskPrism.asObjectable().setThreadStopAction(value); - } - - private PropertyDelta setThreadStopActionAndPrepareDelta(ThreadStopActionType value) { - setThreadStopActionTransient(value); - return isPersistent() ? deltaFactory().property().createReplaceDeltaOrEmptyDelta( - taskManager.getTaskObjectDefinition(), TaskType.F_THREAD_STOP_ACTION, value) : null; + setProperty(TaskType.F_THREAD_STOP_ACTION, value); } @Override public boolean isResilient() { - ThreadStopActionType tsa = getThreadStopAction(); - return tsa == null || tsa == ThreadStopActionType.RESCHEDULE || tsa == ThreadStopActionType.RESTART; + ThreadStopActionType action = getThreadStopAction(); + return action == null || action == ThreadStopActionType.RESCHEDULE || action == ThreadStopActionType.RESTART; } -/* - * Binding - */ + /* + * Binding + */ @Override public TaskBinding getBinding() { - TaskBindingType xmlValue = taskPrism.getPropertyRealValue(TaskType.F_BINDING, TaskBindingType.class); - if (xmlValue == null) { - return null; - } - return TaskBinding.fromTaskType(xmlValue); + return TaskBinding.fromTaskType(getProperty(TaskType.F_BINDING)); } @Override @@ -1378,33 +1237,19 @@ public boolean isLooselyBound() { } @Override - public void setBinding(TaskBinding value) { - processModificationBatched(setBindingAndPrepareDelta(value)); + public void setBinding(@NotNull TaskBinding value) { + setProperty(TaskType.F_BINDING, value.toTaskType()); } @Override - public void setBindingImmediate(TaskBinding value, OperationResult parentResult) + public void setBindingImmediate(@NotNull TaskBinding value, OperationResult result) throws ObjectNotFoundException, SchemaException { - try { - processModificationNow(setBindingAndPrepareDelta(value), parentResult); - } catch (ObjectAlreadyExistsException ex) { - throw new SystemException(ex); - } - } - - public void setBindingTransient(TaskBinding value) { - try { - taskPrism.setPropertyRealValue(TaskType.F_BINDING, value.toTaskType()); - } catch (SchemaException e) { - // This should not happen - throw new IllegalStateException("Internal schema error: " + e.getMessage(), e); - } + setPropertyImmediate(TaskType.F_BINDING, value.toTaskType(), result); } - private PropertyDelta setBindingAndPrepareDelta(TaskBinding value) { - setBindingTransient(value); - return isPersistent() ? deltaFactory().property().createReplaceDeltaOrEmptyDelta( - taskManager.getTaskObjectDefinition(), TaskType.F_BINDING, value.toTaskType()) : null; + @SuppressWarnings("SameParameterValue") + private void setBindingTransient(TaskBinding value) { + setPropertyTransient(TaskType.F_BINDING, value.toTaskType()); } /* @@ -1413,11 +1258,9 @@ private PropertyDelta setBindingAndPrepareDelta(TaskBinding value) { @Override public PrismObject getOwner() { - PrismReference ownerRef = taskPrism.findReference(TaskType.F_OWNER_REF); - if (ownerRef == null) { - return null; - } - return ownerRef.getValue().getObject(); + PrismReferenceValue ownerRef = getReferenceValue(TaskType.F_OWNER_REF); + //noinspection unchecked + return ownerRef != null ? ownerRef.getObject() : null; } @Override @@ -1426,128 +1269,92 @@ public void setOwner(PrismObject owner) { throw new IllegalStateException("setOwner method can be called only on transient tasks!"); } - PrismReference ownerRef; - try { - ownerRef = taskPrism.findOrCreateReference(TaskType.F_OWNER_REF); - } catch (SchemaException e) { - // This should not happen - throw new IllegalStateException("Internal schema error: " + e.getMessage(), e); + synchronized (PRISM_ACCESS) { + PrismReference ownerRef; + try { + ownerRef = taskPrism.findOrCreateReference(TaskType.F_OWNER_REF); + } catch (SchemaException e) { + throw new IllegalStateException("Internal schema error: " + e.getMessage(), e); + } + ownerRef.getValue().setObject(owner); } - ownerRef.getValue().setObject(owner); } - PrismObject resolveOwnerRef(OperationResult result) throws SchemaException { - PrismReference ownerRef = taskPrism.findReference(TaskType.F_OWNER_REF); + void resolveOwnerRef(OperationResult result) throws SchemaException { + PrismReferenceValue ownerRef = getReferenceValue(TaskType.F_OWNER_REF); if (ownerRef == null) { throw new SchemaException("Task " + getOid() + " does not have an owner (missing ownerRef)"); } try { PrismObject owner = repositoryService.getObject(UserType.class, ownerRef.getOid(), null, result); - ownerRef.getValue().setObject(owner); - return owner; + synchronized (PRISM_ACCESS) { + ownerRef.setObject(owner); + } } catch (ObjectNotFoundException e) { LoggingUtils.logExceptionAsWarning(LOGGER, "The owner of task {} cannot be found (owner OID: {})", e, getOid(), ownerRef.getOid()); - return null; } } + /* + * channel + */ + @Override public String getChannel() { - return taskPrism.asObjectable().getChannel(); + return getProperty(TaskType.F_CHANNEL); } @Override public void setChannel(String value) { - processModificationBatched(setChannelAndPrepareDelta(value)); + setProperty(TaskType.F_CHANNEL, value); } @Override - public void setChannelImmediate(String value, OperationResult parentResult) - throws ObjectNotFoundException, SchemaException { - try { - processModificationNow(setChannelAndPrepareDelta(value), parentResult); - } catch (ObjectAlreadyExistsException ex) { - throw new SystemException(ex); - } - } - - public void setChannelTransient(String name) { - taskPrism.asObjectable().setChannel(name); + public void setChannelImmediate(String value, OperationResult result) throws ObjectNotFoundException, SchemaException { + setPropertyImmediate(TaskType.F_CHANNEL, value, result); } - private PropertyDelta setChannelAndPrepareDelta(String value) { - setChannelTransient(value); - return isPersistent() ? deltaFactory().property().createReplaceDeltaOrEmptyDelta( - taskManager.getTaskObjectDefinition(), TaskType.F_CHANNEL, value) : null; - } - - // @Override - // public String getChannel() { - // PrismProperty channelProperty = taskPrism.findProperty(TaskType.F_CHANNEL); - // if (channelProperty == null) { - // return null; - // } - // return channelProperty.getRealValue(); - // } - // @Override - // public void setChannel(String channelUri) { - // // TODO: Is this OK? - // PrismProperty channelProperty; - // try { - // channelProperty = taskPrism.findOrCreateProperty(TaskType.F_CHANNEL); - // } catch (SchemaException e) { - // // This should not happen - // throw new IllegalStateException("Internal schema error: "+e.getMessage(),e); - // } - // channelProperty.setRealValue(channelUri); - // } - /* * Object */ + /** + * Beware: this returns cloned object reference! + */ @Override public ObjectReferenceType getObjectRef() { - return taskPrism.asObjectable().getObjectRef(); + return cloneIfRunning(getObjectRefInternal()); + } + + private ObjectReferenceType getObjectRefInternal() { + return getReference(TaskType.F_OBJECT_REF); } @Override public void setObjectRef(ObjectReferenceType value) { - processModificationBatched(setObjectRefAndPrepareDelta(value)); + setReference(TaskType.F_OBJECT_REF, value); } @Override public void setObjectRef(String oid, QName type) { - ObjectReferenceType objectReferenceType = new ObjectReferenceType(); - objectReferenceType.setOid(oid); - objectReferenceType.setType(type); - setObjectRef(objectReferenceType); + setObjectRef(new ObjectReferenceType().oid(oid).type(type)); } @Override - public void setObjectRefImmediate(ObjectReferenceType value, OperationResult parentResult) - throws ObjectNotFoundException, SchemaException, ObjectAlreadyExistsException { - processModificationNow(setObjectRefAndPrepareDelta(value), parentResult); - } - - public void setObjectRefTransient(ObjectReferenceType objectRefType) { - taskPrism.asObjectable().setObjectRef(objectRefType != null ? objectRefType.clone() : null); + public void setObjectRefImmediate(ObjectReferenceType value, OperationResult result) + throws ObjectNotFoundException, SchemaException { + setReferenceImmediate(TaskType.F_OBJECT_REF, value, result); } - private ReferenceDelta setObjectRefAndPrepareDelta(ObjectReferenceType value) { - setObjectRefTransient(value); - return isPersistent() ? deltaFactory().reference().createModificationReplace(TaskType.F_OBJECT_REF, - taskManager.getTaskObjectDefinition(), value.clone().asReferenceValue()) : null; + private void setObjectRefTransient(ObjectReferenceType value) { + setReferenceTransient(TaskType.F_OBJECT_REF, value); } @Override public String getObjectOid() { - PrismReference objectRef = taskPrism.findReference(TaskType.F_OBJECT_REF); - if (objectRef == null) { - return null; - } - return objectRef.getValue().getOid(); + ObjectReferenceType ref = getObjectRefInternal(); + return ref != null ? ref.getOid() : null; } @Override @@ -1555,13 +1362,14 @@ public PrismObject getObject(Class type, OperationR throws ObjectNotFoundException, SchemaException { // Shortcut - PrismReference objectRef = taskPrism.findReference(TaskType.F_OBJECT_REF); + ObjectReferenceType objectRef = getObjectRefInternal(); if (objectRef == null) { return null; } - if (objectRef.getValue().getObject() != null) { - PrismObject object = objectRef.getValue().getObject(); + if (objectRef.asReferenceValue().getObject() != null) { + PrismObject object = objectRef.asReferenceValue().getObject(); if (object.canRepresent(type)) { + //noinspection CastCanBeRemovedNarrowingVariableType,unchecked return (PrismObject) object; } else { throw new IllegalArgumentException( @@ -1575,9 +1383,11 @@ public PrismObject getObject(Class type, OperationR try { PrismObject object = repositoryService.getObject(type, objectRef.getOid(), null, result); - objectRef.getValue().setObject(object); - result.recordSuccess(); - return object; + synchronized (PRISM_ACCESS) { + objectRef.asReferenceValue().setObject(object); + result.recordSuccess(); + return object.clone(); + } } catch (ObjectNotFoundException ex) { result.recordFatalError("Object not found", ex); throw ex; @@ -1589,20 +1399,22 @@ public PrismObject getObject(Class type, OperationR @Override public void setObjectTransient(PrismObject object) { - if (object == null) { - PrismReference objectRef = taskPrism.findReference(TaskType.F_OBJECT_REF); - if (objectRef != null) { - taskPrism.getValue().remove(objectRef); - } - } else { - PrismReference objectRef; - try { - objectRef = taskPrism.findOrCreateReference(TaskType.F_OBJECT_REF); - } catch (SchemaException e) { - // This should not happen - throw new IllegalStateException("Internal schema error: " + e.getMessage(), e); + synchronized (PRISM_ACCESS) { + if (object == null) { + PrismReference objectRef = taskPrism.findReference(TaskType.F_OBJECT_REF); + if (objectRef != null) { + taskPrism.getValue().remove(objectRef); + } + } else { + PrismReference objectRef; + try { + objectRef = taskPrism.findOrCreateReference(TaskType.F_OBJECT_REF); + } catch (SchemaException e) { + // This should not happen + throw new IllegalStateException("Internal schema error: " + e.getMessage(), e); + } + objectRef.getValue().setObject(object.clone()); } - objectRef.getValue().setObject(object); } } @@ -1612,33 +1424,37 @@ public void setObjectTransient(PrismObject object) { @Override public PolyStringType getName() { - return taskPrism.asObjectable().getName(); + synchronized (PRISM_ACCESS) { + // not using getProperty because of PolyString vs PolyStringType dichotomy + return taskPrism.asObjectable().getName(); + } } @Override public void setName(PolyStringType value) { - processModificationBatched(setNameAndPrepareDelta(value)); + addPendingModification(setNameAndPrepareDelta(value)); } @Override public void setName(String value) { - processModificationBatched(setNameAndPrepareDelta(new PolyStringType(value))); + addPendingModification(setNameAndPrepareDelta(new PolyStringType(value))); } @Override public void setNameImmediate(PolyStringType value, OperationResult parentResult) throws ObjectNotFoundException, SchemaException, ObjectAlreadyExistsException { - processModificationNow(setNameAndPrepareDelta(value), parentResult); + modifyRepository(setNameAndPrepareDelta(value), parentResult); } public void setNameTransient(PolyStringType name) { - taskPrism.asObjectable().setName(name); + synchronized (PRISM_ACCESS) { + taskPrism.asObjectable().setName(name); + } } private PropertyDelta setNameAndPrepareDelta(PolyStringType value) { setNameTransient(value); - return isPersistent() ? deltaFactory().property().createReplaceDeltaOrEmptyDelta( - taskManager.getTaskObjectDefinition(), TaskType.F_NAME, value.toPolyString()) : null; + return createPropertyDeltaIfPersistent(TaskType.F_NAME, value.toPolyString()); } /* @@ -1647,37 +1463,35 @@ private PropertyDelta setNameAndPrepareDelta(PolyStringType value) { @Override public String getDescription() { - return taskPrism.asObjectable().getDescription(); + return getProperty(TaskType.F_DESCRIPTION); } @Override public void setDescription(String value) { - processModificationBatched(setDescriptionAndPrepareDelta(value)); + setProperty(TaskType.F_DESCRIPTION, value); } @Override - public void setDescriptionImmediate(String value, OperationResult parentResult) - throws ObjectNotFoundException, SchemaException { - try { - processModificationNow(setDescriptionAndPrepareDelta(value), parentResult); - } catch (ObjectAlreadyExistsException ex) { - throw new SystemException(ex); - } + public void setDescriptionImmediate(String value, OperationResult result) throws ObjectNotFoundException, SchemaException { + setPropertyImmediate(TaskType.F_DESCRIPTION, value, result); } - public void setDescriptionTransient(String name) { - taskPrism.asObjectable().setDescription(name); + public void setDescriptionTransient(String value) { + setPropertyTransient(TaskType.F_DESCRIPTION, value); } - private PropertyDelta setDescriptionAndPrepareDelta(String value) { - setDescriptionTransient(value); - return isPersistent() ? deltaFactory().property().createReplaceDeltaOrEmptyDelta( - taskManager.getTaskObjectDefinition(), TaskType.F_DESCRIPTION, value) : null; - } + /* + * policyRule + */ + /** + * BEWARE: this returns a clone + */ @Override public PolicyRuleType getPolicyRule() { - return taskPrism.asObjectable().getPolicyRule(); + synchronized (PRISM_ACCESS) { + return cloneIfRunning(taskPrism.asObjectable().getPolicyRule()); + } } /* @@ -1686,7 +1500,7 @@ public PolicyRuleType getPolicyRule() { @Override public String getParent() { - return taskPrism.asObjectable().getParent(); + return getProperty(TaskType.F_PARENT); } @Override @@ -1698,32 +1512,8 @@ public Task getParentTask(OperationResult result) throws SchemaException, Object } } - @Override - public Task getParentForLightweightAsynchronousTask() { - return parentForLightweightAsynchronousTask; - } - public void setParent(String value) { - processModificationBatched(setParentAndPrepareDelta(value)); - } - - public void setParentImmediate(String value, OperationResult parentResult) - throws ObjectNotFoundException, SchemaException { - try { - processModificationNow(setParentAndPrepareDelta(value), parentResult); - } catch (ObjectAlreadyExistsException ex) { - throw new SystemException(ex); - } - } - - public void setParentTransient(String name) { - taskPrism.asObjectable().setParent(name); - } - - private PropertyDelta setParentAndPrepareDelta(String value) { - setParentTransient(value); - return isPersistent() ? deltaFactory().property().createReplaceDeltaOrEmptyDelta( - taskManager.getTaskObjectDefinition(), TaskType.F_PARENT, value) : null; + setProperty(TaskType.F_PARENT, value); } /* @@ -1732,7 +1522,9 @@ private PropertyDelta setParentAndPrepareDelta(String value) { @Override public List getDependents() { - return taskPrism.asObjectable().getDependent(); + synchronized (PRISM_ACCESS) { + return taskPrism.asObjectable().getDependent(); + } } @Override @@ -1742,11 +1534,11 @@ public List listDependents(OperationResult parentResult) throws SchemaExce result.addContext(OperationResult.CONTEXT_OID, getOid()); result.addContext(OperationResult.CONTEXT_IMPLEMENTATION_CLASS, TaskQuartzImpl.class); - List dependents = new ArrayList<>(getDependents().size()); - for (String dependentId : getDependents()) { + List dependentsIdentifiers = getDependents(); + List dependents = new ArrayList<>(dependentsIdentifiers.size()); + for (String dependentId : dependentsIdentifiers) { try { - Task dependent = taskManager.getTaskByIdentifier(dependentId, result); - dependents.add(dependent); + dependents.add(taskManager.getTaskByIdentifier(dependentId, result)); } catch (ObjectNotFoundException e) { LOGGER.trace("Dependent task {} was not found. Probably it was not yet stored to repo; we just ignore it.", dependentId); @@ -1759,11 +1551,13 @@ public List listDependents(OperationResult parentResult) throws SchemaExce @Override public void addDependent(String value) { - processModificationBatched(addDependentAndPrepareDelta(value)); + addPendingModification(addDependentAndPrepareDelta(value)); } public void addDependentTransient(String name) { - taskPrism.asObjectable().getDependent().add(name); + synchronized (PRISM_ACCESS) { + taskPrism.asObjectable().getDependent().add(name); + } } private PropertyDelta addDependentAndPrepareDelta(String value) { @@ -1774,11 +1568,13 @@ private PropertyDelta addDependentAndPrepareDelta(String value) { @Override public void deleteDependent(String value) { - processModificationBatched(deleteDependentAndPrepareDelta(value)); + addPendingModification(deleteDependentAndPrepareDelta(value)); } public void deleteDependentTransient(String name) { - taskPrism.asObjectable().getDependent().remove(name); + synchronized (PRISM_ACCESS) { + taskPrism.asObjectable().getDependent().remove(name); + } } private PropertyDelta deleteDependentAndPrepareDelta(String value) { @@ -1792,7 +1588,9 @@ private PropertyDelta deleteDependentAndPrepareDelta(String value) { */ public void addTriggerTransient(TriggerType trigger) { - taskPrism.asObjectable().getTrigger().add(trigger); + synchronized (PRISM_ACCESS) { + taskPrism.asObjectable().getTrigger().add(trigger); + } } private ItemDelta addTriggerAndPrepareDelta(TriggerType trigger) throws SchemaException { @@ -1804,57 +1602,85 @@ public void addTriggerTransient(TriggerType trigger) { : null; } + //endregion + + //region Dealing with extension + /* * Extension */ @Override - public PrismContainer getExtension() { - return taskPrism.getExtension(); + public PrismContainer getExtension() { + synchronized (PRISM_ACCESS) { + //noinspection unchecked + return cloneIfRunning((PrismContainer) taskPrism.getExtension()); + } } + @Nullable @Override - public PrismProperty getExtensionProperty(QName propertyName) { - if (getExtension() != null) { - return getExtension().findProperty(ItemName.fromQName(propertyName)); - } else { - return null; - } + public PrismContainer getExtensionClone() { + //noinspection unchecked + return CloneUtil.clone((PrismContainer) taskPrism.getExtension()); } @Override - public T getExtensionPropertyRealValue(QName propertyName) { - PrismProperty property = getExtensionProperty(propertyName); - if (property == null || property.isEmpty()) { - return null; - } else { - return property.getRealValue(); + public boolean hasExtension() { + synchronized (PRISM_ACCESS) { + return taskPrism.getExtension() != null && !taskPrism.getExtension().isEmpty(); } } @Override - public T getExtensionContainerRealValue(QName containerName) { - Item item = getExtensionItem(ItemName.fromQName(containerName)); - if (item == null || item.getValues().isEmpty()) { - return null; - } else { - return ((PrismContainer) item).getRealValue(); + public PrismProperty getExtensionProperty(ItemName name) { + synchronized (PRISM_ACCESS) { + return cloneIfRunning(getExtensionPropertyUnsynchronized(name)); } } + private PrismProperty getExtensionPropertyUnsynchronized(ItemName name) { + PrismContainer extension = taskPrism.getExtension(); + return extension != null ? extension.findProperty(name) : null; + } + + + // todo should return clone for running task? @Override - public Item getExtensionItem(ItemName propertyName) { - if (getExtension() != null) { - return getExtension().findItem(propertyName); - } else { - return null; + public T getExtensionPropertyRealValue(ItemName propertyName) { + synchronized (PRISM_ACCESS) { + PrismProperty property = getExtensionPropertyUnsynchronized(propertyName); + return property != null && !property.isEmpty() ? property.getRealValue() : null; + } + } + + @Override + public T getExtensionContainerRealValue(ItemName name) { + synchronized (PRISM_ACCESS) { + Item item = getExtensionItemUnsynchronized(name); + if (item == null || item.getValues().isEmpty()) { + return null; + } else { + return cloneIfRunning(((PrismContainer) item).getRealValue()); + } } } @Override - public PrismReference getExtensionReference(QName propertyName) { - Item item = getExtensionItem(ItemName.fromQName(propertyName)); - return (PrismReference) item; + public Item getExtensionItem(ItemName name) { + synchronized (PRISM_ACCESS) { + return cloneIfRunning(getExtensionItemUnsynchronized(name)); + } + } + + private Item getExtensionItemUnsynchronized(ItemName name) { + PrismContainer extension = getExtension(); + return extension != null ? extension.findItem(name) : null; + } + + @Override + public PrismReference getExtensionReference(ItemName name) { + return (PrismReference) (Item) getExtensionItem(name); } @Override @@ -1872,25 +1698,25 @@ public void setExtensionItem(Item item) throws SchemaException { @Override public void setExtensionProperty(PrismProperty property) throws SchemaException { - processModificationBatched(setExtensionPropertyAndPrepareDelta(property.getElementName(), property.getDefinition(), + addPendingModification(setExtensionPropertyAndPrepareDelta(property.getElementName(), property.getDefinition(), PrismValueCollectionsUtil.cloneCollection(property.getValues()))); } @Override public void setExtensionReference(PrismReference reference) throws SchemaException { - processModificationBatched(setExtensionReferenceAndPrepareDelta(reference.getElementName(), reference.getDefinition(), + addPendingModification(setExtensionReferenceAndPrepareDelta(reference.getElementName(), reference.getDefinition(), PrismValueCollectionsUtil.cloneCollection(reference.getValues()))); } @Override public void addExtensionReference(PrismReference reference) throws SchemaException { - processModificationBatched(addExtensionReferenceAndPrepareDelta(reference.getElementName(), reference.getDefinition(), + addPendingModification(addExtensionReferenceAndPrepareDelta(reference.getElementName(), reference.getDefinition(), PrismValueCollectionsUtil.cloneCollection(reference.getValues()))); } @Override public void setExtensionContainer(PrismContainer container) throws SchemaException { - processModificationBatched(setExtensionContainerAndPrepareDelta(container.getElementName(), container.getDefinition(), + addPendingModification(setExtensionContainerAndPrepareDelta(container.getElementName(), container.getDefinition(), PrismValueCollectionsUtil.cloneCollection(container.getValues()))); } @@ -1902,12 +1728,9 @@ public void setExtensionPropertyValue(QName propertyName, T value) throws Sc if (propertyDef == null) { throw new SchemaException("Unknown property " + propertyName); } - - ArrayList> values = new ArrayList<>(1); - if (value != null) { - values.add(getPrismContext().itemFactory().createPropertyValue(value)); - } - processModificationBatched(setExtensionPropertyAndPrepareDelta(propertyName, propertyDef, values)); + addPendingModification( + setExtensionPropertyAndPrepareDelta(propertyName, propertyDef, + singletonList(getPrismContext().itemFactory().createPropertyValue(value)))); } @Override @@ -1922,7 +1745,7 @@ public void setExtensionPropertyValueTransient(QName propertyName, T value) //noinspection unchecked delta.setRealValuesToReplace(value); - ItemDeltaCollectionsUtil.applyTo(singletonList(delta), taskPrism); + applyModificationsTransient(singletonList(delta)); } // use this method to avoid cloning the value @@ -1933,21 +1756,19 @@ public void setExtensionContainerValue(QName container if (containerDef == null) { throw new SchemaException("Unknown container item " + containerName); } - - ArrayList> values = new ArrayList<>(1); - values.add(value.asPrismContainerValue()); - processModificationBatched(setExtensionContainerAndPrepareDelta(containerName, containerDef, values)); + addPendingModification(setExtensionContainerAndPrepareDelta(containerName, containerDef, + singletonList(value.asPrismContainerValue()))); } @Override public void addExtensionProperty(PrismProperty property) throws SchemaException { - processModificationBatched(addExtensionPropertyAndPrepareDelta(property.getElementName(), property.getDefinition(), + addPendingModification(addExtensionPropertyAndPrepareDelta(property.getElementName(), property.getDefinition(), PrismValueCollectionsUtil.cloneCollection(property.getValues()))); } @Override public void deleteExtensionProperty(PrismProperty property) throws SchemaException { - processModificationBatched(deleteExtensionPropertyAndPrepareDelta(property.getElementName(), property.getDefinition(), + addPendingModification(deleteExtensionPropertyAndPrepareDelta(property.getElementName(), property.getDefinition(), PrismValueCollectionsUtil.cloneCollection(property.getValues()))); } @@ -1957,14 +1778,14 @@ public void modifyExtension(ItemDelta itemDelta) throws SchemaException { throw new IllegalArgumentException( "modifyExtension must modify the Task extension element; however, the path is " + itemDelta.getPath()); } - processModificationBatched(modifyExtensionAndPrepareDelta(itemDelta)); + addPendingModification(modifyExtensionAndPrepareDelta(itemDelta)); } @Override public void setExtensionPropertyImmediate(PrismProperty property, OperationResult parentResult) throws ObjectNotFoundException, SchemaException { try { - processModificationNow(setExtensionPropertyAndPrepareDelta(property.getElementName(), property.getDefinition(), + modifyRepository(setExtensionPropertyAndPrepareDelta(property.getElementName(), property.getDefinition(), PrismValueCollectionsUtil.cloneCollection(property.getValues())), parentResult); } catch (ObjectAlreadyExistsException ex) { throw new SystemException(ex); @@ -1995,66 +1816,49 @@ public void setExtensionPropertyImmediate(PrismProperty property, OperationRe return setExtensionItemAndPrepareDeltaCommon(delta, values); } - private ItemDelta setExtensionItemAndPrepareDeltaCommon(ItemDelta delta, Collection values) + private ItemDelta setExtensionItemAndPrepareDeltaCommon(ItemDelta delta, Collection values) throws SchemaException { - // these values should have no parent, otherwise the following will fail - delta.setValuesToReplace(values); - - Collection> modifications = new ArrayList<>(1); - modifications.add(delta); - ItemDeltaCollectionsUtil.applyTo(modifications, taskPrism); // i.e. here we apply changes only locally (in memory) - + //noinspection unchecked + ((ItemDelta) delta).setValuesToReplace(values); + applyModificationsTransient(singletonList(delta)); // i.e. here we apply changes only locally (in memory) return isPersistent() ? delta : null; } - private ItemDelta addExtensionItemAndPrepareDeltaCommon(ItemDelta delta, Collection values) + private ItemDelta addExtensionItemAndPrepareDeltaCommon(ItemDelta delta, Collection values) throws SchemaException { - // these values should have no parent, otherwise the following will fail - delta.addValuesToAdd(values); - - Collection> modifications = new ArrayList<>(1); - modifications.add(delta); - ItemDeltaCollectionsUtil.applyTo(modifications, taskPrism); // i.e. here we apply changes only locally (in memory) - + //noinspection unchecked + ((ItemDelta) delta).addValuesToAdd(values); + applyModificationsTransient(singletonList(delta)); // i.e. here we apply changes only locally (in memory) return isPersistent() ? delta : null; } private ItemDelta modifyExtensionAndPrepareDelta(ItemDelta delta) throws SchemaException { - - Collection> modifications = new ArrayList<>(1); - modifications.add(delta); - ItemDeltaCollectionsUtil.applyTo(modifications, taskPrism); // i.e. here we apply changes only locally (in memory) - + applyModificationsTransient(singletonList(delta)); // i.e. here we apply changes only locally (in memory) return isPersistent() ? delta : null; } private ItemDelta addExtensionPropertyAndPrepareDelta(QName itemName, PrismPropertyDefinition definition, Collection values) throws SchemaException { - ItemDelta delta = deltaFactory().property().create(ItemPath.create(TaskType.F_EXTENSION, itemName), definition); - - delta.addValuesToAdd(values); - - Collection> modifications = new ArrayList<>(1); - modifications.add(delta); - ItemDeltaCollectionsUtil.applyTo(modifications, taskPrism); // i.e. here we apply changes only locally (in memory) - + ItemDelta delta = deltaFactory().property().create(ItemPath.create(TaskType.F_EXTENSION, itemName), definition); + //noinspection unchecked + ((ItemDelta) delta).addValuesToAdd(values); + applyModificationsTransient(singletonList(delta)); // i.e. here we apply changes only locally (in memory) return isPersistent() ? delta : null; } private ItemDelta deleteExtensionPropertyAndPrepareDelta(QName itemName, PrismPropertyDefinition definition, Collection values) throws SchemaException { - ItemDelta delta = deltaFactory().property().create(ItemPath.create(TaskType.F_EXTENSION, itemName), definition); - - delta.addValuesToDelete(values); - - Collection> modifications = new ArrayList<>(1); - modifications.add(delta); - ItemDeltaCollectionsUtil.applyTo(modifications, taskPrism); // i.e. here we apply changes only locally (in memory) - + ItemDelta delta = deltaFactory().property().create(ItemPath.create(TaskType.F_EXTENSION, itemName), definition); + //noinspection unchecked + ((ItemDelta)delta).addValuesToDelete(values); + applyModificationsTransient(singletonList(delta)); // i.e. here we apply changes only locally (in memory) return isPersistent() ? delta : null; } + //endregion + + //region Other getters and setters /* * Requestee @@ -2074,28 +1878,25 @@ public void setRequesteeTransient(PrismObject user) { * Model operation context */ + // todo thread safety @Override public LensContextType getModelOperationContext() { - return taskPrism.asObjectable().getModelOperationContext(); + synchronized (PRISM_ACCESS) { + return taskPrism.asObjectable().getModelOperationContext(); + } } @Override public void setModelOperationContext(LensContextType value) throws SchemaException { - processModificationBatched(setModelOperationContextAndPrepareDelta(value)); - } - - //@Override - public void setModelOperationContextImmediate(LensContextType value, OperationResult parentResult) - throws ObjectNotFoundException, SchemaException { - try { - processModificationNow(setModelOperationContextAndPrepareDelta(value), parentResult); - } catch (ObjectAlreadyExistsException ex) { - throw new SystemException(ex); + synchronized (PRISM_ACCESS) { + addPendingModification(setModelOperationContextAndPrepareDelta(value)); } } public void setModelOperationContextTransient(LensContextType value) { - taskPrism.asObjectable().setModelOperationContext(value); + synchronized (PRISM_ACCESS) { + taskPrism.asObjectable().setModelOperationContext(value); + } } private ItemDelta setModelOperationContextAndPrepareDelta(LensContextType value) @@ -2118,23 +1919,24 @@ public void setModelOperationContextTransient(LensContextType value) { /* * Workflow context */ - public void setWorkflowContext(WfContextType value) throws SchemaException { - processModificationBatched(setWorkflowContextAndPrepareDelta(value)); + addPendingModification(setWorkflowContextAndPrepareDelta(value)); } //@Override public void setWorkflowContextImmediate(WfContextType value, OperationResult parentResult) throws ObjectNotFoundException, SchemaException { try { - processModificationNow(setWorkflowContextAndPrepareDelta(value), parentResult); + modifyRepository(setWorkflowContextAndPrepareDelta(value), parentResult); } catch (ObjectAlreadyExistsException ex) { throw new SystemException(ex); } } public void setWorkflowContextTransient(WfContextType value) { - taskPrism.asObjectable().setWorkflowContext(value); + synchronized (PRISM_ACCESS) { + taskPrism.asObjectable().setWorkflowContext(value); + } } private ItemDelta setWorkflowContextAndPrepareDelta(WfContextType value) throws SchemaException { @@ -2153,9 +1955,12 @@ public void setWorkflowContextTransient(WfContextType value) { } } + // todo thread safety @Override public WfContextType getWorkflowContext() { - return taskPrism.asObjectable().getWorkflowContext(); + synchronized (PRISM_ACCESS) { + return taskPrism.asObjectable().getWorkflowContext(); + } } @Override @@ -2166,96 +1971,30 @@ public void initializeWorkflowContextImmediate(String processInstanceId, Operati setWorkflowContextImmediate(wfContextType, result); } - // @Override - // public PrismReference getRequesteeRef() { - // return (PrismReference) getExtensionItem(SchemaConstants.C_TASK_REQUESTEE_REF); - // } - - // @Override - // public String getRequesteeOid() { - // PrismProperty property = (PrismProperty) getExtensionProperty(SchemaConstants.C_TASK_REQUESTEE_OID); - // if (property != null) { - // return property.getRealValue(); - // } else { - // return null; - // } - // } - - // @Override - // public void setRequesteeRef(PrismReferenceValue requesteeRef) throws SchemaException { - // PrismReferenceDefinition itemDefinition = new PrismReferenceDefinition(SchemaConstants.C_TASK_REQUESTEE_REF, - // SchemaConstants.C_TASK_REQUESTEE_REF, ObjectReferenceType.COMPLEX_TYPE, taskManager.getPrismContext()); - // itemDefinition.setTargetTypeName(UserType.COMPLEX_TYPE); - // - // PrismReference ref = new PrismReference(SchemaConstants.C_TASK_REQUESTEE_REF); - // ref.setDefinition(itemDefinition); - // ref.add(requesteeRef); - // setExtensionReference(ref); - // } - - // @Override - // public void setRequesteeRef(PrismObject requestee) throws SchemaException { - // Validate.notNull(requestee.getOid()); - // PrismReferenceValue value = new PrismReferenceValueImpl(requestee.getOid()); - // value.setTargetType(UserType.COMPLEX_TYPE); - // setRequesteeRef(value); - // } - - // @Override - // public void setRequesteeOid(String oid) throws SchemaException { - // setExtensionProperty(prepareRequesteeProperty(oid)); - // } - - // @Override - // public void setRequesteeOidImmediate(String oid, OperationResult result) throws SchemaException, ObjectNotFoundException { - // setExtensionPropertyImmediate(prepareRequesteeProperty(oid), result); - // } - - // private PrismProperty prepareRequesteeProperty(String oid) { - // PrismPropertyDefinition definition = taskManager.getPrismContext().getSchemaRegistry().findPropertyDefinitionByElementName(SchemaConstants.C_TASK_REQUESTEE_OID); - // if (definition == null) { - // throw new SystemException("No definition for " + SchemaConstants.C_TASK_REQUESTEE_OID); - // } - // PrismProperty property = definition.instantiate(); - // property.setRealValue(oid); - // return property; - // } - /* * Node */ @Override public String getNode() { - return taskPrism.asObjectable().getNode(); + return getProperty(TaskType.F_NODE); } @Override public String getNodeAsObserved() { - return taskPrism.asObjectable().getNodeAsObserved(); + return getProperty(TaskType.F_NODE_AS_OBSERVED); } public void setNode(String value) { - processModificationBatched(setNodeAndPrepareDelta(value)); + setProperty(TaskType.F_NODE, value); } - public void setNodeImmediate(String value, OperationResult parentResult) - throws ObjectNotFoundException, SchemaException { - try { - processModificationNow(setNodeAndPrepareDelta(value), parentResult); - } catch (ObjectAlreadyExistsException ex) { - throw new SystemException(ex); - } + public void setNodeImmediate(String value, OperationResult result) throws ObjectNotFoundException, SchemaException { + setPropertyImmediate(TaskType.F_NODE, value, result); } public void setNodeTransient(String value) { - taskPrism.asObjectable().setNode(value); - } - - private PropertyDelta setNodeAndPrepareDelta(String value) { - setNodeTransient(value); - return isPersistent() ? deltaFactory().property().createReplaceDeltaOrEmptyDelta( - taskManager.getTaskObjectDefinition(), TaskType.F_NODE, value) : null; + setPropertyTransient(TaskType.F_NODE, value); } /* @@ -2263,35 +2002,12 @@ private PropertyDelta setNodeAndPrepareDelta(String value) { */ @Override public Long getLastRunStartTimestamp() { - XMLGregorianCalendar gc = taskPrism.asObjectable().getLastRunStartTimestamp(); + XMLGregorianCalendar gc = getProperty(TaskType.F_LAST_RUN_START_TIMESTAMP); return gc != null ? XmlTypeConverter.toMillis(gc) : null; } public void setLastRunStartTimestamp(Long value) { - processModificationBatched(setLastRunStartTimestampAndPrepareDelta(value)); - } - - public void setLastRunStartTimestampImmediate(Long value, OperationResult parentResult) - throws ObjectNotFoundException, SchemaException { - try { - processModificationNow(setLastRunStartTimestampAndPrepareDelta(value), parentResult); - } catch (ObjectAlreadyExistsException ex) { - throw new SystemException(ex); - } - } - - public void setLastRunStartTimestampTransient(Long value) { - taskPrism.asObjectable().setLastRunStartTimestamp( - createXMLGregorianCalendar(value)); - } - - private PropertyDelta setLastRunStartTimestampAndPrepareDelta(Long value) { - setLastRunStartTimestampTransient(value); - return isPersistent() ? deltaFactory().property().createReplaceDeltaOrEmptyDelta( - taskManager.getTaskObjectDefinition(), - TaskType.F_LAST_RUN_START_TIMESTAMP, - taskPrism.asObjectable().getLastRunStartTimestamp()) - : null; + setProperty(TaskType.F_LAST_RUN_START_TIMESTAMP, createXMLGregorianCalendar(value)); } /* @@ -2300,35 +2016,12 @@ private PropertyDelta setLastRunStartTimestampAndPrepareDelta(Long value) { @Override public Long getLastRunFinishTimestamp() { - XMLGregorianCalendar gc = taskPrism.asObjectable().getLastRunFinishTimestamp(); + XMLGregorianCalendar gc = getProperty(TaskType.F_LAST_RUN_FINISH_TIMESTAMP); return gc != null ? XmlTypeConverter.toMillis(gc) : null; } public void setLastRunFinishTimestamp(Long value) { - processModificationBatched(setLastRunFinishTimestampAndPrepareDelta(value)); - } - - public void setLastRunFinishTimestampImmediate(Long value, OperationResult parentResult) - throws ObjectNotFoundException, SchemaException { - try { - processModificationNow(setLastRunFinishTimestampAndPrepareDelta(value), parentResult); - } catch (ObjectAlreadyExistsException ex) { - throw new SystemException(ex); - } - } - - public void setLastRunFinishTimestampTransient(Long value) { - taskPrism.asObjectable().setLastRunFinishTimestamp( - createXMLGregorianCalendar(value)); - } - - private PropertyDelta setLastRunFinishTimestampAndPrepareDelta(Long value) { - setLastRunFinishTimestampTransient(value); - return isPersistent() ? deltaFactory().property().createReplaceDeltaOrEmptyDelta( - taskManager.getTaskObjectDefinition(), - TaskType.F_LAST_RUN_FINISH_TIMESTAMP, - taskPrism.asObjectable().getLastRunFinishTimestamp()) - : null; + setProperty(TaskType.F_LAST_RUN_FINISH_TIMESTAMP, createXMLGregorianCalendar(value)); } /* @@ -2337,60 +2030,30 @@ private PropertyDelta setLastRunFinishTimestampAndPrepareDelta(Long value) { @Override public Long getCompletionTimestamp() { - XMLGregorianCalendar gc = taskPrism.asObjectable().getCompletionTimestamp(); + XMLGregorianCalendar gc = getProperty(TaskType.F_COMPLETION_TIMESTAMP); return gc != null ? XmlTypeConverter.toMillis(gc) : null; } public void setCompletionTimestamp(Long value) { - processModificationBatched(setCompletionTimestampAndPrepareDelta(value)); - } - - public void setCompletionTimestampImmediate(Long value, OperationResult parentResult) - throws ObjectNotFoundException, SchemaException { - try { - processModificationNow(setCompletionTimestampAndPrepareDelta(value), parentResult); - } catch (ObjectAlreadyExistsException ex) { - throw new SystemException(ex); - } + setProperty(TaskType.F_COMPLETION_TIMESTAMP, createXMLGregorianCalendar(value)); } public void setCompletionTimestampTransient(Long value) { - taskPrism.asObjectable().setCompletionTimestamp( - createXMLGregorianCalendar(value)); + setPropertyTransient(TaskType.F_COMPLETION_TIMESTAMP, createXMLGregorianCalendar(value)); } private PropertyDelta setCompletionTimestampAndPrepareDelta(Long value) { setCompletionTimestampTransient(value); - return isPersistent() ? deltaFactory().property().createReplaceDeltaOrEmptyDelta( - taskManager.getTaskObjectDefinition(), - TaskType.F_COMPLETION_TIMESTAMP, - taskPrism.asObjectable().getCompletionTimestamp()) - : null; + return createPropertyDeltaIfPersistent(TaskType.F_COMPLETION_TIMESTAMP, createXMLGregorianCalendar(value)); } - /* * Next run start time */ @Override - public Long getNextRunStartTime(OperationResult parentResult) { - return taskManager.getNextRunStartTime(getOid(), parentResult); - } - - @Override - public String debugDump(int indent) { - StringBuilder sb = new StringBuilder(); - DebugUtil.indentDebugDump(sb, indent); - sb.append("Task("); - sb.append(TaskQuartzImpl.class.getName()); - sb.append(")\n"); - DebugUtil.debugDumpLabelLn(sb, "prism", indent + 1); - sb.append(taskPrism.debugDump(indent + 2)); - sb.append("\n"); - DebugUtil.debugDumpWithLabelToStringLn(sb, "persistenceStatus", getPersistenceStatus(), indent); - DebugUtil.debugDumpWithLabelLn(sb, "taskResult", taskResult, indent); - return sb.toString(); + public Long getNextRunStartTime(OperationResult result) { + return taskManager.getNextRunStartTime(getOid(), result); } /* @@ -2398,56 +2061,33 @@ public String debugDump(int indent) { */ public TaskHandler getHandler() { - String handlerUri = taskPrism.asObjectable().getHandlerUri(); + String handlerUri = getHandlerUri(); return handlerUri != null ? taskManager.getHandler(handlerUri) : null; } @Override - public void setCategory(String value) { - processModificationBatched(setCategoryAndPrepareDelta(value)); + public String getCategory() { + return getProperty(TaskType.F_CATEGORY); } - public void setCategoryImmediate(String value, OperationResult parentResult) - throws ObjectNotFoundException, SchemaException { - try { - processModificationNow(setCategoryAndPrepareDelta(value), parentResult); - } catch (ObjectAlreadyExistsException ex) { - throw new SystemException(ex); - } - } - public void setCategoryTransient(String value) { - try { - taskPrism.setPropertyRealValue(TaskType.F_CATEGORY, value); - } catch (SchemaException e) { - // This should not happen - throw new IllegalStateException("Internal schema error: " + e.getMessage(), e); - } - } - - private PropertyDelta setCategoryAndPrepareDelta(String value) { - setCategoryTransient(value); - return isPersistent() ? deltaFactory().property().createReplaceDeltaOrEmptyDelta( - taskManager.getTaskObjectDefinition(), TaskType.F_CATEGORY, value) : null; + @Override + public void setCategory(String value) { + setProperty(TaskType.F_CATEGORY, value); } - @Override - public String getCategory() { - return taskPrism.asObjectable().getCategory(); + public void setCategoryTransient(String value) { + setPropertyTransient(TaskType.F_CATEGORY, value); } public String getCategoryFromHandler() { TaskHandler h = getHandler(); - if (h != null) { - return h.getCategoryName(this); - } else { - return null; - } + return h != null ? h.getCategoryName(this) : null; } /* - * Other methods - */ + * Other methods + */ @Override public void refresh(OperationResult parentResult) throws ObjectNotFoundException, SchemaException { @@ -2474,61 +2114,41 @@ public void refresh(OperationResult parentResult) throws ObjectNotFoundException result.recordFatalError("Schema error", ex); throw ex; } - updateTaskInstance(repoObj, result); - result.recordSuccess(); - } - - private void updateTaskInstance(PrismObject taskPrism, OperationResult parentResult) throws SchemaException { - OperationResult result = parentResult.createMinorSubresult(DOT_INTERFACE + "updateTaskInstance"); - result.addArbitraryObjectAsParam("task", this); - result.addParam("taskPrism", taskPrism); - - this.taskPrism = taskPrism; + this.taskPrism = repoObj; createOrUpdateTaskResult(null, false); setDefaults(); resolveOwnerRef(result); - result.recordSuccessIfUnknown(); - } - - // public void modify(Collection modifications, OperationResult parentResult) throws ObjectNotFoundException, SchemaException { - // throw new UnsupportedOperationException("Generic task modification is not supported. Please use concrete setter methods to modify a task"); - // PropertyDelta.applyTo(modifications, taskPrism); - // if (isPersistent()) { - // getRepositoryService().modifyObject(TaskType.class, getOid(), modifications, parentResult); - // } - // } - - /** - * Signal the task to shut down. - * It may not stop immediately, but it should stop eventually. - *

- * BEWARE, this method has to be invoked on the same Task instance that is executing. - * If called e.g. on a Task just retrieved from the repository, it will have no effect whatsoever. - */ - - public void unsetCanRun() { - // beware: Do not touch task prism here, because this method can be called asynchronously - canRun = false; - } - - @Override - public boolean canRun() { - return canRun; + result.recordSuccess(); } // checks latest start time (useful for recurring tightly coupled tasks) public boolean stillCanStart() { - if (getSchedule() != null && getSchedule().getLatestStartTime() != null) { - long lst = getSchedule().getLatestStartTime().toGregorianCalendar().getTimeInMillis(); + ScheduleType schedule = getSchedule(); + if (schedule != null && schedule.getLatestStartTime() != null) { + long lst = schedule.getLatestStartTime().toGregorianCalendar().getTimeInMillis(); return lst >= System.currentTimeMillis(); } else { return true; } } - /* (non-Javadoc) - * @see java.lang.Object#toString() - */ + @Override + public String debugDump(int indent) { + StringBuilder sb = new StringBuilder(); + DebugUtil.indentDebugDump(sb, indent); + sb.append("Task("); + sb.append(TaskQuartzImpl.class.getName()); + sb.append(")\n"); + DebugUtil.debugDumpLabelLn(sb, "prism", indent + 1); + synchronized (PRISM_ACCESS) { + sb.append(taskPrism.debugDump(indent + 2)); + } + sb.append("\n"); + DebugUtil.debugDumpWithLabelToStringLn(sb, "persistenceStatus", getPersistenceStatus(), indent); + DebugUtil.debugDumpWithLabelLn(sb, "taskResult", taskResult, indent); + return sb.toString(); + } + @Override public String toString() { return "Task(id:" + getTaskIdentifier() + ", name:" + getName() + ", oid:" + getOid() + ")"; @@ -2536,34 +2156,36 @@ public String toString() { @Override public int hashCode() { - return taskPrism.hashCode(); + synchronized (PRISM_ACCESS) { + return taskPrism.hashCode(); + } } @Override public boolean equals(Object obj) { - if (this == obj) - return true; - if (obj == null) - return false; - if (getClass() != obj.getClass()) - return false; - TaskQuartzImpl other = (TaskQuartzImpl) obj; - // if (persistenceStatus != other.persistenceStatus) - // return false; - if (taskResult == null) { - if (other.taskResult != null) + synchronized (PRISM_ACCESS) { + if (this == obj) + return true; + if (obj == null) return false; - } else if (!taskResult.equals(other.taskResult)) - return false; - if (taskPrism == null) { - if (other.taskPrism != null) + if (getClass() != obj.getClass()) return false; - } else if (!taskPrism.equals(other.taskPrism)) - return false; - return true; + TaskQuartzImpl other = (TaskQuartzImpl) obj; + if (taskResult == null) { + if (other.taskResult != null) + return false; + } else if (!taskResult.equals(other.taskResult)) + return false; + if (taskPrism == null) { + if (other.taskPrism != null) + return false; + } else if (!taskPrism.equals(other.taskPrism)) + return false; + return true; + } } - private PrismContext getPrismContext() { + protected PrismContext getPrismContext() { return taskManager.getPrismContext(); } @@ -2572,29 +2194,15 @@ private SchemaHelper getSchemaHelper() { } @Override - public Task createSubtask() { - - TaskQuartzImpl sub = (TaskQuartzImpl) taskManager.createTaskInstance(); + public TaskQuartzImpl createSubtask() { + TaskQuartzImpl sub = taskManager.createTaskInstance(); sub.setParent(this.getTaskIdentifier()); sub.setOwner(this.getOwner()); sub.setChannel(this.getChannel()); - - // taskManager.registerTransientSubtask(sub, this); - LOGGER.trace("New subtask {} has been created.", sub.getTaskIdentifier()); return sub; } - @Override - public Task createSubtask(LightweightTaskHandler handler) { - TaskQuartzImpl sub = ((TaskQuartzImpl) createSubtask()); - sub.setLightweightTaskHandler(handler); - assert sub.getTaskIdentifier() != null; - lightweightAsynchronousSubtasks.put(sub.getTaskIdentifier(), sub); - sub.parentForLightweightAsynchronousTask = this; - return sub; - } - @Deprecated public TaskRunResult waitForSubtasks(Integer interval, OperationResult parentResult) throws ObjectNotFoundException, SchemaException, ObjectAlreadyExistsException { @@ -2621,46 +2229,22 @@ public TaskRunResult waitForSubtasks(Integer interval, Collection> listPersistentSubtasksRaw(OperationResult parentResult) throws SchemaException { OperationResult result = parentResult.createMinorSubresult(DOT_INTERFACE + "listPersistentSubtasksRaw"); result.addContext(OperationResult.CONTEXT_OID, getOid()); result.addContext(OperationResult.CONTEXT_IMPLEMENTATION_CLASS, TaskQuartzImpl.class); - if (!isPersistent()) { + if (isPersistent()) { + return taskManager.listPersistentSubtasksForTask(getTaskIdentifier(), result); + } else { result.recordSuccessIfUnknown(); return new ArrayList<>(0); } - - return taskManager.listPersistentSubtasksForTask(getTaskIdentifier(), result); } public List> listPrerequisiteTasksRaw(OperationResult parentResult) throws SchemaException { @@ -2687,13 +2271,14 @@ public List listSubtasks(boolean persistentOnly, OperationResult parentRes return listSubtasksInternal(persistentOnly, result); } + @Override @NotNull - private List listSubtasksInternal(boolean persistentOnly, OperationResult result) throws SchemaException { + public List listSubtasksInternal(boolean persistentOnly, OperationResult result) throws SchemaException { // persistent subtasks List retval = new ArrayList<>(taskManager.resolveTasksFromTaskTypes(listPersistentSubtasksRaw(result), result)); // transient asynchronous subtasks - must be taken from the running task instance! if (!persistentOnly) { - retval.addAll(taskManager.getTransientSubtasks(this)); + retval.addAll(taskManager.getTransientSubtasks(getTaskIdentifier())); } return retval; } @@ -2711,10 +2296,10 @@ public List listSubtasksDeeply(boolean persistentOnly, OperationResult par return retval; } - private void addSubtasks(ArrayList tasks, TaskQuartzImpl taskToProcess, boolean persistentOnly, OperationResult result) throws SchemaException { + private void addSubtasks(ArrayList tasks, InternalTaskInterface taskToProcess, boolean persistentOnly, OperationResult result) throws SchemaException { for (Task task : taskToProcess.listSubtasksInternal(persistentOnly, result)) { tasks.add(task); - addSubtasks(tasks, (TaskQuartzImpl) task, persistentOnly, result); + addSubtasks(tasks, (InternalTaskInterface) task, persistentOnly, result); } } @@ -2728,523 +2313,290 @@ public List listPrerequisiteTasks(OperationResult parentResult) throws Sch return taskManager.resolveTasksFromTaskTypes(listPrerequisiteTasksRaw(result), result); } - // private List resolveTasksFromIdentifiers(OperationResult result, List identifiers) throws SchemaException { - // List tasks = new ArrayList(identifiers.size()); - // for (String identifier : identifiers) { - // tasks.add(taskManager.getTaskByIdentifier(result)); - // } - // - // result.recordSuccessIfUnknown(); - // return tasks; - // } - @Override public void pushWaitForTasksHandlerUri() { pushHandlerUri(WaitForTasksTaskHandler.HANDLER_URI, new ScheduleType(), null); } - public void setLightweightTaskHandler(LightweightTaskHandler lightweightTaskHandler) { - this.lightweightTaskHandler = lightweightTaskHandler; - } @Override - public LightweightTaskHandler getLightweightTaskHandler() { - return lightweightTaskHandler; + public void close(OperationResult taskResult, boolean saveState, OperationResult parentResult) + throws ObjectNotFoundException, SchemaException { + List> deltas = new ArrayList<>(); + if (taskResult != null) { + addIgnoreNull(deltas, setResultAndPrepareDelta(taskResult)); + // result status was set in task during the previous call + addIgnoreNull(deltas, createPropertyDeltaIfPersistent(TaskType.F_RESULT_STATUS, taskResult.getStatus() != null ? taskResult.getStatus().createStatusType() : null)); + } + addIgnoreNull(deltas, setExecutionStatusAndPrepareDelta(TaskExecutionStatus.CLOSED)); + addIgnoreNull(deltas, setCompletionTimestampAndPrepareDelta(System.currentTimeMillis())); + Duration cleanupAfterCompletion = taskPrism.asObjectable().getCleanupAfterCompletion(); + if (cleanupAfterCompletion != null) { + TriggerType trigger = new TriggerType(getPrismContext()) + .timestamp(XmlTypeConverter.fromNow(cleanupAfterCompletion)) + .handlerUri(SchemaConstants.COMPLETED_TASK_CLEANUP_TRIGGER_HANDLER_URI); + addIgnoreNull(deltas, addTriggerAndPrepareDelta( + trigger)); // we just ignore any other triggers (they will do nothing if launched too early) + } + if (saveState) { + try { + modifyRepository(deltas, parentResult); + } catch (ObjectAlreadyExistsException e) { + throw new SystemException(e); + } + } else { + pendingModifications.addAll(deltas); + } } + // todo thread safety (creating a clone?) @Override - public boolean isLightweightAsynchronousTask() { - return lightweightTaskHandler != null; - } - - void setLightweightHandlerFuture(Future lightweightHandlerFuture) { - this.lightweightHandlerFuture = lightweightHandlerFuture; - } - - public Future getLightweightHandlerFuture() { - return lightweightHandlerFuture; + public TaskWorkManagementType getWorkManagement() { + synchronized (PRISM_ACCESS) { + return taskPrism.asObjectable().getWorkManagement(); + } } + // todo thread safety (creating a clone?) @Override - public Collection getLightweightAsynchronousSubtasks() { - return Collections.unmodifiableList(new ArrayList<>(lightweightAsynchronousSubtasks.values())); + public TaskWorkStateType getWorkState() { + synchronized (PRISM_ACCESS) { + return taskPrism.asObjectable().getWorkState(); + } } @Override - public Collection getRunningLightweightAsynchronousSubtasks() { - // beware: Do not touch task prism here, because this method can be called asynchronously - List retval = new ArrayList<>(); - for (TaskQuartzImpl subtask : getLightweightAsynchronousSubtasks()) { - if (subtask.getExecutionStatus() == TaskExecutionStatus.RUNNABLE && subtask.lightweightHandlerStartRequested()) { - retval.add(subtask); - } + public TaskKindType getKind() { + synchronized (PRISM_ACCESS) { + TaskWorkManagementType workManagement = getWorkManagement(); + return workManagement != null ? workManagement.getTaskKind() : null; } - return Collections.unmodifiableList(retval); } @Override - public boolean lightweightHandlerStartRequested() { - return lightweightHandlerFuture != null; + public TaskUnpauseActionType getUnpauseAction() { + return getProperty(TaskType.F_UNPAUSE_ACTION); } - // just a shortcut @Override - public void startLightweightHandler() { - taskManager.startLightweightTask(this); - } - - public void setLightweightHandlerExecuting(boolean lightweightHandlerExecuting) { - this.lightweightHandlerExecuting = lightweightHandlerExecuting; - } - - public boolean isLightweightHandlerExecuting() { - return lightweightHandlerExecuting; - } - - public Thread getLightweightThread() { - return lightweightThread; - } - - public void setLightweightThread(Thread lightweightThread) { - this.lightweightThread = lightweightThread; - } - - // Operational data - - private EnvironmentalPerformanceInformation getEnvironmentalPerformanceInformation() { - return environmentalPerformanceInformation; - } - - private SynchronizationInformation getSynchronizationInformation() { - return synchronizationInformation; - } - - private IterativeTaskInformation getIterativeTaskInformation() { - return iterativeTaskInformation; - } - - public ActionsExecutedInformation getActionsExecutedInformation() { - return actionsExecutedInformation; + public TaskExecutionStatusType getStateBeforeSuspend() { + return getProperty(TaskType.F_STATE_BEFORE_SUSPEND); } @Override - public OperationStatsType getAggregatedLiveOperationStats() { - EnvironmentalPerformanceInformationType env = getAggregateEnvironmentalPerformanceInformation(); - IterativeTaskInformationType itit = getAggregateIterativeTaskInformation(); - SynchronizationInformationType sit = getAggregateSynchronizationInformation(); - ActionsExecutedInformationType aeit = getAggregateActionsExecutedInformation(); - if (env == null && itit == null && sit == null && aeit == null) { - return null; + public void applyDeltasImmediate(Collection> itemDeltas, OperationResult result) + throws ObjectAlreadyExistsException, ObjectNotFoundException, SchemaException { + if (isPersistent()) { + repositoryService.modifyObject(TaskType.class, getOid(), CloneUtil.cloneCollectionMembers(itemDeltas), result); } - OperationStatsType rv = new OperationStatsType(); - rv.setEnvironmentalPerformanceInformation(env); - rv.setIterativeTaskInformation(itit); - rv.setSynchronizationInformation(sit); - rv.setActionsExecutedInformation(aeit); - rv.setTimestamp(createXMLGregorianCalendar(new Date())); - return rv; + applyModificationsTransient(itemDeltas); + synchronizeWithQuartzIfNeeded(pendingModifications, result); } - @NotNull @Override - public List getLastFailures() { - return iterativeTaskInformation != null ? iterativeTaskInformation.getLastFailures() : Collections.emptyList(); + public boolean isPartitionedMaster() { + synchronized (PRISM_ACCESS) { + TaskWorkManagementType workManagement = getWorkManagement(); + return workManagement != null && workManagement.getTaskKind() == TaskKindType.PARTITIONED_MASTER; + } } - private EnvironmentalPerformanceInformationType getAggregateEnvironmentalPerformanceInformation() { - if (environmentalPerformanceInformation == null) { - return null; - } - EnvironmentalPerformanceInformationType rv = new EnvironmentalPerformanceInformationType(); - EnvironmentalPerformanceInformation.addTo(rv, environmentalPerformanceInformation.getAggregatedValue()); - for (Task subtask : getLightweightAsynchronousSubtasks()) { - EnvironmentalPerformanceInformation info = ((TaskQuartzImpl) subtask).getEnvironmentalPerformanceInformation(); - if (info != null) { - EnvironmentalPerformanceInformation.addTo(rv, info.getAggregatedValue()); - } + @Override + public String getExecutionGroup() { + synchronized (PRISM_ACCESS) { + TaskExecutionConstraintsType executionConstraints = getExecutionConstraints(); + return executionConstraints != null ? executionConstraints.getGroup() : null; } - return rv; } - private IterativeTaskInformationType getAggregateIterativeTaskInformation() { - if (iterativeTaskInformation == null) { - return null; - } - IterativeTaskInformationType rv = new IterativeTaskInformationType(); - IterativeTaskInformation.addTo(rv, iterativeTaskInformation.getAggregatedValue(), false); - for (Task subtask : getLightweightAsynchronousSubtasks()) { - IterativeTaskInformation info = ((TaskQuartzImpl) subtask).getIterativeTaskInformation(); - if (info != null) { - IterativeTaskInformation.addTo(rv, info.getAggregatedValue(), false); - } - } - return rv; + @Override + public OperationStatsType getAggregatedLiveOperationStats() { + return statistics.getAggregatedLiveOperationStats(emptyList()); } - private SynchronizationInformationType getAggregateSynchronizationInformation() { - if (synchronizationInformation == null) { - return null; - } - SynchronizationInformationType rv = new SynchronizationInformationType(); - SynchronizationInformation.addTo(rv, synchronizationInformation.getAggregatedValue()); - for (Task subtask : getLightweightAsynchronousSubtasks()) { - SynchronizationInformation info = ((TaskQuartzImpl) subtask).getSynchronizationInformation(); - if (info != null) { - SynchronizationInformation.addTo(rv, info.getAggregatedValue()); - } - } - return rv; + @NotNull + public OperationResult createUnnamedTaskResult() { + return new OperationResult(DOT_INTERFACE + "run"); } - private ActionsExecutedInformationType getAggregateActionsExecutedInformation() { - if (actionsExecutedInformation == null) { - return null; - } - ActionsExecutedInformationType rv = new ActionsExecutedInformationType(); - ActionsExecutedInformation.addTo(rv, actionsExecutedInformation.getAggregatedValue()); - for (Task subtask : getLightweightAsynchronousSubtasks()) { - ActionsExecutedInformation info = ((TaskQuartzImpl) subtask).getActionsExecutedInformation(); - if (info != null) { - ActionsExecutedInformation.addTo(rv, info.getAggregatedValue()); - } - } - return rv; + private DeltaFactory deltaFactory() { + return getPrismContext().deltaFactory(); } + //region Statistics collection + + /* + * Here we simply delegate statistics collection and retrieval methods calls to the collector. + */ @Override public void recordState(String message) { - if (LOGGER.isTraceEnabled()) { - LOGGER.trace("{}", message); - } - if (PERFORMANCE_ADVISOR.isDebugEnabled()) { - PERFORMANCE_ADVISOR.debug("{}", message); - } - environmentalPerformanceInformation.recordState(message); + statistics.recordState(message); } @Override public void recordProvisioningOperation(String resourceOid, String resourceName, QName objectClassName, ProvisioningOperation operation, boolean success, int count, long duration) { - environmentalPerformanceInformation - .recordProvisioningOperation(resourceOid, resourceName, objectClassName, operation, success, count, duration); + statistics.recordProvisioningOperation(resourceOid, resourceName, objectClassName, operation, success, count, duration); } @Override public void recordNotificationOperation(String transportName, boolean success, long duration) { - environmentalPerformanceInformation.recordNotificationOperation(transportName, success, duration); + statistics.recordNotificationOperation(transportName, success, duration); } @Override public void recordMappingOperation(String objectOid, String objectName, String objectTypeName, String mappingName, long duration) { - environmentalPerformanceInformation.recordMappingOperation(objectOid, objectName, objectTypeName, mappingName, duration); + statistics.recordMappingOperation(objectOid, objectName, objectTypeName, mappingName, duration); } @Override - public synchronized void recordSynchronizationOperationEnd(String objectName, String objectDisplayName, QName objectType, - String objectOid, - long started, Throwable exception, SynchronizationInformation.Record originalStateIncrement, - SynchronizationInformation.Record newStateIncrement) { - if (synchronizationInformation != null) { - synchronizationInformation - .recordSynchronizationOperationEnd(objectName, objectDisplayName, objectType, objectOid, started, exception, - originalStateIncrement, newStateIncrement); - } + public void recordIterativeOperationStart(String objectName, String objectDisplayName, QName objectType, String objectOid) { + statistics.recordIterativeOperationStart(objectName, objectDisplayName, objectType, objectOid); } @Override - public synchronized void recordSynchronizationOperationStart(String objectName, String objectDisplayName, QName objectType, - String objectOid) { - if (synchronizationInformation != null) { - synchronizationInformation.recordSynchronizationOperationStart(objectName, objectDisplayName, objectType, objectOid); - } + public void recordIterativeOperationStart(ShadowType shadow) { + statistics.recordIterativeOperationStart(shadow); } @Override - public synchronized void recordIterativeOperationEnd(String objectName, String objectDisplayName, QName objectType, - String objectOid, long started, Throwable exception) { - if (iterativeTaskInformation != null) { - iterativeTaskInformation.recordOperationEnd(objectName, objectDisplayName, objectType, objectOid, started, exception); - } + public void recordIterativeOperationEnd(String objectName, String objectDisplayName, QName objectType, String objectOid, + long started, Throwable exception) { + statistics.recordIterativeOperationEnd(objectName, objectDisplayName, objectType, objectOid, started, exception); } @Override public void recordIterativeOperationEnd(ShadowType shadow, long started, Throwable exception) { - recordIterativeOperationEnd(PolyString.getOrig(shadow.getName()), StatisticsUtil.getDisplayName(shadow), - ShadowType.COMPLEX_TYPE, shadow.getOid(), started, exception); + statistics.recordIterativeOperationEnd(shadow, started, exception); } @Override - public void recordIterativeOperationStart(ShadowType shadow) { - recordIterativeOperationStart(PolyString.getOrig(shadow.getName()), StatisticsUtil.getDisplayName(shadow), - ShadowType.COMPLEX_TYPE, shadow.getOid()); + public void recordSynchronizationOperationStart(String objectName, String objectDisplayName, QName objectType, + String objectOid) { + statistics.recordSynchronizationOperationStart(objectName, objectDisplayName, objectType, objectOid); } @Override - public synchronized void recordIterativeOperationStart(String objectName, String objectDisplayName, QName objectType, - String objectOid) { - if (iterativeTaskInformation != null) { - iterativeTaskInformation.recordOperationStart(objectName, objectDisplayName, objectType, objectOid); - } + public void recordSynchronizationOperationEnd(String objectName, String objectDisplayName, QName objectType, String objectOid, + long started, Throwable exception, SynchronizationInformation.Record originalStateIncrement, + SynchronizationInformation.Record newStateIncrement) { + statistics.recordSynchronizationOperationEnd(objectName, objectDisplayName, objectType, objectOid, started, exception, originalStateIncrement, newStateIncrement); } @Override public void recordObjectActionExecuted(String objectName, String objectDisplayName, QName objectType, String objectOid, ChangeType changeType, String channel, Throwable exception) { - if (actionsExecutedInformation != null) { - actionsExecutedInformation - .recordObjectActionExecuted(objectName, objectDisplayName, objectType, objectOid, changeType, channel, - exception); - } + statistics.recordObjectActionExecuted(objectName, objectDisplayName, objectType, objectOid, changeType, channel, exception); } @Override public void recordObjectActionExecuted(PrismObject object, ChangeType changeType, Throwable exception) { - recordObjectActionExecuted(object, null, null, changeType, getChannel(), exception); + statistics.recordObjectActionExecuted(object, changeType, getChannel(), exception); } @Override public void recordObjectActionExecuted(PrismObject object, Class objectTypeClass, String defaultOid, ChangeType changeType, String channel, Throwable exception) { - if (actionsExecutedInformation != null) { - String name, displayName, oid; - PrismObjectDefinition definition; - Class clazz; - if (object != null) { - name = PolyString.getOrig(object.getName()); - displayName = StatisticsUtil.getDisplayName(object); - definition = object.getDefinition(); - clazz = object.getCompileTimeClass(); - oid = object.getOid(); - if (oid == null) { // in case of ADD operation - oid = defaultOid; - } - } else { - name = null; - displayName = null; - definition = null; - clazz = objectTypeClass; - oid = defaultOid; - } - if (definition == null && clazz != null) { - definition = getPrismContext().getSchemaRegistry().findObjectDefinitionByCompileTimeClass(clazz); - } - QName typeQName; - if (definition != null) { - typeQName = definition.getTypeName(); - } else { - typeQName = ObjectType.COMPLEX_TYPE; - } - actionsExecutedInformation - .recordObjectActionExecuted(name, displayName, typeQName, oid, changeType, channel, exception); - } + statistics.recordObjectActionExecuted(object, objectTypeClass, defaultOid, changeType, channel, exception); } @Override public void markObjectActionExecutedBoundary() { - if (actionsExecutedInformation != null) { - actionsExecutedInformation.markObjectActionExecutedBoundary(); - } + statistics.markObjectActionExecutedBoundary(); } @Override public void resetEnvironmentalPerformanceInformation(EnvironmentalPerformanceInformationType value) { - environmentalPerformanceInformation = new EnvironmentalPerformanceInformation(value); + statistics.resetEnvironmentalPerformanceInformation(value); } @Override public void resetSynchronizationInformation(SynchronizationInformationType value) { - synchronizationInformation = new SynchronizationInformation(value); + statistics.resetSynchronizationInformation(value); } @Override public void resetIterativeTaskInformation(IterativeTaskInformationType value) { - iterativeTaskInformation = new IterativeTaskInformation(value); + statistics.resetIterativeTaskInformation(value); } @Override public void resetActionsExecutedInformation(ActionsExecutedInformationType value) { - actionsExecutedInformation = new ActionsExecutedInformation(value); - } - - private void startCollectingOperationStatsFromZero(boolean enableIterationStatistics, boolean enableSynchronizationStatistics, - boolean enableActionsExecutedStatistics) { - resetEnvironmentalPerformanceInformation(null); - if (enableIterationStatistics) { - resetIterativeTaskInformation(null); - } - if (enableSynchronizationStatistics) { - resetSynchronizationInformation(null); - } - if (enableActionsExecutedStatistics) { - resetActionsExecutedInformation(null); - } - setProgress(0); + statistics.resetActionsExecutedInformation(value); } - private void startCollectingOperationStatsFromStoredValues(boolean enableIterationStatistics, - boolean enableSynchronizationStatistics, boolean enableActionsExecutedStatistics) { - OperationStatsType stored = getStoredOperationStats(); - if (stored == null) { - stored = new OperationStatsType(); - } - resetEnvironmentalPerformanceInformation(stored.getEnvironmentalPerformanceInformation()); - if (enableIterationStatistics) { - resetIterativeTaskInformation(stored.getIterativeTaskInformation()); - } else { - iterativeTaskInformation = null; - } - if (enableSynchronizationStatistics) { - resetSynchronizationInformation(stored.getSynchronizationInformation()); - } else { - synchronizationInformation = null; - } - if (enableActionsExecutedStatistics) { - resetActionsExecutedInformation(stored.getActionsExecutedInformation()); - } else { - actionsExecutedInformation = null; - } + @NotNull + @Override + public List getLastFailures() { + return statistics.getLastFailures(); } - @Override public void startCollectingOperationStats(@NotNull StatisticsCollectionStrategy strategy) { if (strategy.isStartFromZero()) { - startCollectingOperationStatsFromZero(strategy.isMaintainIterationStatistics(), strategy.isMaintainSynchronizationStatistics(), strategy.isMaintainActionsExecutedStatistics()); - storeOperationStats(); + statistics.startCollectingOperationStatsFromZero(strategy.isMaintainIterationStatistics(), strategy.isMaintainSynchronizationStatistics(), strategy.isMaintainActionsExecutedStatistics()); + setProgress(0L); } else { - startCollectingOperationStatsFromStoredValues(strategy.isMaintainIterationStatistics(), strategy.isMaintainSynchronizationStatistics(), strategy.isMaintainActionsExecutedStatistics()); + OperationStatsType stored = getStoredOperationStats(); + statistics.startCollectingOperationStatsFromStoredValues(stored, strategy.isMaintainIterationStatistics(), strategy.isMaintainSynchronizationStatistics(), strategy.isMaintainActionsExecutedStatistics()); } } + //endregion @Override - public void storeOperationStatsDeferred() { - setOperationStats(getAggregatedLiveOperationStats()); - } - - @Override - public void storeOperationStats() { - try { - storeOperationStatsDeferred(); - processModificationBatched(createProgressDelta(getProgress())); - processModificationBatched(createExpectedTotalDelta(getExpectedTotal())); - savePendingModifications(new OperationResult(DOT_INTERFACE + ".storeOperationStats")); // TODO fixme - lastOperationStatsUpdateTimestamp = System.currentTimeMillis(); - } catch (SchemaException | ObjectNotFoundException | ObjectAlreadyExistsException | RuntimeException e) { - LoggingUtils.logUnexpectedException(LOGGER, "Couldn't store statistical information into task {}", e, this); + public ObjectReferenceType getSelfReference() { + if (getOid() != null) { + return new ObjectReferenceType() + .type(TaskType.COMPLEX_TYPE) + .oid(getOid()) + .relation(getPrismContext().getDefaultRelation()) + .targetName(getName()); + } else { + throw new IllegalStateException("Reference cannot be created for a transient task: " + this); } } @Override - public void storeOperationStatsIfNeeded() { - if (lastOperationStatsUpdateTimestamp == null || - System.currentTimeMillis() - lastOperationStatsUpdateTimestamp > operationStatsUpdateInterval) { - storeOperationStats(); + public String getVersion() { + synchronized (PRISM_ACCESS) { + return taskPrism.getVersion(); } } + // todo thread-safety @Override - public Long getLastOperationStatsUpdateTimestamp() { - return lastOperationStatsUpdateTimestamp; - } - - @Override - public void setOperationStatsUpdateInterval(long interval) { - this.operationStatsUpdateInterval = interval; - } - - @Override - public long getOperationStatsUpdateInterval() { - return operationStatsUpdateInterval; - } - - @Override - public void incrementProgressAndStoreStatsIfNeeded() { - setProgress(getProgress() + 1); - storeOperationStatsIfNeeded(); - } - - @Override - public void close(OperationResult taskResult, boolean saveState, OperationResult parentResult) - throws ObjectNotFoundException, SchemaException { - List> deltas = new ArrayList<>(); - if (taskResult != null) { - addIgnoreNull(deltas, setResultAndPrepareDelta(taskResult)); - addIgnoreNull(deltas, setResultStatusTypeAndPrepareDelta(taskResult.getStatus() != null ? taskResult.getStatus().createStatusType() : null)); + public Collection getTriggers() { + synchronized (PRISM_ACCESS) { + return taskPrism.asObjectable().getTrigger(); } - addIgnoreNull(deltas, setExecutionStatusAndPrepareDelta(TaskExecutionStatus.CLOSED)); - addIgnoreNull(deltas, setCompletionTimestampAndPrepareDelta(System.currentTimeMillis())); - Duration cleanupAfterCompletion = taskPrism.asObjectable().getCleanupAfterCompletion(); - if (cleanupAfterCompletion != null) { - TriggerType trigger = new TriggerType(getPrismContext()) - .timestamp(XmlTypeConverter.fromNow(cleanupAfterCompletion)) - .handlerUri(SchemaConstants.COMPLETED_TASK_CLEANUP_TRIGGER_HANDLER_URI); - addIgnoreNull(deltas, addTriggerAndPrepareDelta( - trigger)); // we just ignore any other triggers (they will do nothing if launched too early) - } - if (saveState) { - try { - processModificationsNow(deltas, parentResult); - } catch (ObjectAlreadyExistsException e) { - throw new SystemException(e); - } - } else { - pendingModifications.addAll(deltas); - } - } - - @Override - public TaskWorkManagementType getWorkManagement() { - return taskPrism.asObjectable().getWorkManagement(); - } - - @Override - public TaskWorkStateType getWorkState() { - return taskPrism.asObjectable().getWorkState(); - } - - @Override - public TaskKindType getKind() { - TaskWorkManagementType workManagement = getWorkManagement(); - return workManagement != null ? workManagement.getTaskKind() : null; } + // todo thread-safety @Override - public TaskUnpauseActionType getUnpauseAction() { - return taskPrism.asObjectable().getUnpauseAction(); + public Collection getAssignments() { + synchronized (PRISM_ACCESS) { + return taskPrism.asObjectable().getAssignment(); + } } @Override - public TaskExecutionStatusType getStateBeforeSuspend() { - return taskPrism.asObjectable().getStateBeforeSuspend(); - } - - public void applyDeltasImmediate(Collection> itemDeltas, OperationResult result) - throws ObjectAlreadyExistsException, ObjectNotFoundException, SchemaException { - if (isPersistent()) { - repositoryService.modifyObject(TaskType.class, getOid(), CloneUtil.cloneCollectionMembers(itemDeltas), result); + public ObjectReferenceType getOwnerRef() { + synchronized (PRISM_ACCESS) { + return cloneIfRunning(taskPrism.asObjectable().getOwnerRef()); } - ItemDeltaCollectionsUtil.applyTo(itemDeltas, taskPrism); - synchronizeWithQuartzIfNeeded(pendingModifications, result); } @Override - public boolean isPartitionedMaster() { - TaskWorkManagementType workManagement = getWorkManagement(); - return workManagement != null && workManagement.getTaskKind() == TaskKindType.PARTITIONED_MASTER; + public void applyModificationsTransient(Collection> modifications) throws SchemaException { + synchronized (PRISM_ACCESS) { + ItemDeltaCollectionsUtil.applyTo(modifications, taskPrism); + } } @Override - public String getExecutionGroup() { - TaskExecutionConstraintsType executionConstraints = getExecutionConstraints(); - return executionConstraints != null ? executionConstraints.getGroup() : null; - } - - @NotNull - public OperationResult createUnnamedTaskResult() { - return new OperationResult(DOT_INTERFACE + "run"); - } - - private DeltaFactory deltaFactory() { - return getPrismContext().deltaFactory(); + public void addSubtask(TaskType subtaskBean) { + synchronized (PRISM_ACCESS) { + taskPrism.asObjectable().getSubtask().add(subtaskBean); + } } } diff --git a/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/TaskQuartzImplUtil.java b/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/TaskQuartzImplUtil.java index 0b00a1474c8..76cbba543df 100644 --- a/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/TaskQuartzImplUtil.java +++ b/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/TaskQuartzImplUtil.java @@ -29,7 +29,7 @@ import com.evolveum.midpoint.util.logging.Trace; import com.evolveum.midpoint.util.logging.TraceManager; -import com.evolveum.midpoint.xml.ns._public.common.common_3.TaskType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.TaskExecutionConstraintsType; import org.quartz.*; import com.evolveum.midpoint.task.api.Task; @@ -79,7 +79,7 @@ public static Trigger createTriggerForTask(Task task) throws ParseException { } // special case - recurrent task with no schedule (means "run on demand only") - if (task.isCycle() && (task.getSchedule() == null || + if (task.isRecurring() && (task.getSchedule() == null || (task.getSchedule().getInterval() == null && task.getSchedule().getCronLikePattern() == null))) { return null; } @@ -123,7 +123,7 @@ public static Trigger createTriggerForTask(Task task) throws ParseException { boolean looselyBoundRecurrent; - if (task.isCycle() && task.isLooselyBound()) { + if (task.isRecurring() && task.isLooselyBound()) { looselyBoundRecurrent = true; @@ -177,9 +177,9 @@ public static Trigger createTriggerForTask(Task task) throws ParseException { } private static TriggerBuilder createBasicTriggerBuilderForTask(Task task) { - TaskType taskType = task.getTaskPrismObject().asObjectable(); - String executionGroup = taskType.getExecutionConstraints() != null - ? MiscUtil.nullIfEmpty(taskType.getExecutionConstraints().getGroup()) + TaskExecutionConstraintsType executionConstraints = task.getExecutionConstraints(); + String executionGroup = executionConstraints != null + ? MiscUtil.nullIfEmpty(executionConstraints.getGroup()) : null; return TriggerBuilder.newTrigger() .forJob(createJobKeyForTask(task)) diff --git a/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/execution/ExecutionManager.java b/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/execution/ExecutionManager.java index 7f63a8ebf65..1e85cbaf65c 100644 --- a/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/execution/ExecutionManager.java +++ b/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/execution/ExecutionManager.java @@ -484,7 +484,7 @@ public boolean stopSchedulerAndTasksLocally(long timeToWait, OperationResult res return localNodeManager.stopSchedulerAndTasks(timeToWait, result); } - public void synchronizeTask(TaskQuartzImpl task, OperationResult result) { + public void synchronizeTask(Task task, OperationResult result) { taskSynchronizer.synchronizeTask(task, result); } @@ -643,9 +643,9 @@ public void reRunClosedTask(Task task, OperationResult parentResult) throws Sche LOGGER.warn(message); return; } - taskSynchronizer.synchronizeTask((TaskQuartzImpl) task, result); // this should remove any triggers - ((TaskQuartzImpl) task).setRecreateQuartzTrigger(true); - ((TaskQuartzImpl) task).setExecutionStatusImmediate(TaskExecutionStatus.RUNNABLE, result); // this will create the trigger + taskSynchronizer.synchronizeTask(task, result); // this should remove any triggers + ((InternalTaskInterface) task).setRecreateQuartzTrigger(true); + ((InternalTaskInterface) task).setExecutionStatusImmediate(TaskExecutionStatus.RUNNABLE, result); // this will create the trigger result.recordSuccess(); // note that if scheduling (not executes before/after) prevents the task from running, it will not run! @@ -663,12 +663,12 @@ public void scheduleRunnableTaskNow(Task task, OperationResult parentResult) { // for loosely-bound, recurring, interval-based tasks we reschedule the task in order to start immediately // and then continue after specified interval (i.e. NOT continue according to original schedule) - MID-1410 - if (!getConfiguration().isRunNowKeepsOriginalSchedule() && task.isLooselyBound() && task.isCycle() && task.getSchedule() != null + if (!getConfiguration().isRunNowKeepsOriginalSchedule() && task.isLooselyBound() && task.isRecurring() && task.getSchedule() != null && task.getSchedule().getInterval() != null && task.getSchedule().getInterval() != 0) { LOGGER.trace("'Run now' for task invoked: unscheduling and rescheduling it; task = {}", task); unscheduleTask(task, result); - ((TaskQuartzImpl) task).setRecreateQuartzTrigger(true); - synchronizeTask((TaskQuartzImpl) task, result); + ((InternalTaskInterface) task).setRecreateQuartzTrigger(true); + synchronizeTask(task, result); } else { // otherwise, we simply add another trigger to this task addTriggerNowForTask(task, result); @@ -691,7 +691,7 @@ public void scheduleWaitingTaskNow(Task task, OperationResult parentResult) { if (!quartzScheduler.checkExists(TaskQuartzImplUtil.createJobKeyForTask(task))) { quartzScheduler.addJob(TaskQuartzImplUtil.createJobDetailForTask(task), false); } - ((TaskQuartzImpl) task).setExecutionStatusImmediate(TaskExecutionStatus.RUNNABLE, TaskExecutionStatusType.WAITING, parentResult); + ((InternalTaskInterface) task).setExecutionStatusImmediate(TaskExecutionStatus.RUNNABLE, TaskExecutionStatusType.WAITING, parentResult); } catch (SchedulerException | ObjectNotFoundException | SchemaException | PreconditionViolationException e) { String message = "Waiting task " + task + " cannot be scheduled: " + e.getMessage(); result.recordFatalError(message, e); @@ -815,7 +815,7 @@ public String getTaskThreadsDump(String taskOid, OperationResult parentResult) OperationResult result = parentResult.createSubresult(ExecutionManager.DOT_CLASS + "getTaskThreadsDump"); try { TaskQuartzImpl task = taskManager.getTask(taskOid, parentResult); - Task localTask = taskManager.getLocallyRunningTaskByIdentifier(task.getTaskIdentifier()); + RunningTask localTask = taskManager.getLocallyRunningTaskByIdentifier(task.getTaskIdentifier()); Thread rootThread = taskManager.getTaskThread(taskOid); if (localTask == null || rootThread == null) { result.recordStatus(OperationResultStatus.NOT_APPLICABLE, "Task " + task + " is not running locally"); @@ -823,9 +823,8 @@ public String getTaskThreadsDump(String taskOid, OperationResult parentResult) } output.append("*** Root thread for task ").append(task).append(":\n\n"); addTaskInfo(output, localTask, rootThread); - for (Task subtask : localTask.getLightweightAsynchronousSubtasks()) { - TaskQuartzImpl subtaskImpl = (TaskQuartzImpl) subtask; - Thread thread = subtaskImpl.getLightweightThread(); + for (RunningTask subtask : localTask.getLightweightAsynchronousSubtasks()) { + Thread thread = ((RunningTaskQuartzImpl) subtask).getLightweightThread(); output.append("** Information for lightweight asynchronous subtask ").append(subtask).append(":\n\n"); addTaskInfo(output, subtask, thread); } @@ -837,7 +836,7 @@ public String getTaskThreadsDump(String taskOid, OperationResult parentResult) return output.toString(); } - private void addTaskInfo(StringBuilder output, Task localTask, Thread thread) { + private void addTaskInfo(StringBuilder output, RunningTask localTask, Thread thread) { output.append("Execution state: ").append(localTask.getExecutionStatus()).append("\n"); output.append("Progress: ").append(localTask.getProgress()); if (localTask.getExpectedTotal() != null) { diff --git a/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/execution/JobExecutor.java b/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/execution/JobExecutor.java index a23ed2175bd..41c1e3ac61a 100644 --- a/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/execution/JobExecutor.java +++ b/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/execution/JobExecutor.java @@ -25,8 +25,8 @@ import com.evolveum.midpoint.schema.result.OperationResultStatus; import com.evolveum.midpoint.task.api.*; import com.evolveum.midpoint.task.api.TaskRunResult.TaskRunResultStatus; +import com.evolveum.midpoint.task.quartzimpl.RunningTaskQuartzImpl; import com.evolveum.midpoint.task.quartzimpl.TaskManagerQuartzImpl; -import com.evolveum.midpoint.task.quartzimpl.TaskQuartzImpl; import com.evolveum.midpoint.task.quartzimpl.TaskQuartzImplUtil; import com.evolveum.midpoint.task.quartzimpl.cluster.ClusterStatusInformation; import com.evolveum.midpoint.task.quartzimpl.work.WorkStateManager; @@ -85,7 +85,7 @@ public static void setTaskManagerQuartzImpl(TaskManagerQuartzImpl managerImpl) { * "Each (and every) time the scheduler executes the job, it creates a new instance of * the class before calling its execute(..) method." */ - private volatile TaskQuartzImpl task; + private volatile RunningTaskQuartzImpl task; private volatile Thread executingThread; // used for interruptions @Override @@ -103,7 +103,7 @@ public void execute(JobExecutionContext context) throws JobExecutionException { try { Collection> options = taskManagerImpl.getSchemaHelper().getOperationOptionsBuilder() .item(TaskType.F_RESULT).retrieve().build(); - task = taskManagerImpl.getTask(oid, options, executionResult); + task = taskManagerImpl.createRunningTask(taskManagerImpl.getTask(oid, options, executionResult)); } catch (ObjectNotFoundException e) { LoggingUtils.logException(LOGGER, "Task with OID {} no longer exists, removing Quartz job and exiting the execution routine.", e, oid); taskManagerImpl.getExecutionManager().removeTaskFromQuartz(oid, executionResult); @@ -192,7 +192,7 @@ public void execute(JobExecutionContext context) throws JobExecutionException { return; } - if (task.isCycle()) { + if (task.isRecurring()) { executeRecurrentTask(handler); } else if (task.isSingle()) { executeSingleTask(handler, executionResult); @@ -248,7 +248,7 @@ public String toString() { } // returns false if constraints are not met (i.e. execution should finish immediately) - private boolean checkExecutionConstraints(TaskQuartzImpl task, OperationResult result) throws JobExecutionException { + private boolean checkExecutionConstraints(RunningTaskQuartzImpl task, OperationResult result) throws JobExecutionException { TaskExecutionConstraintsType executionConstraints = task.getExecutionConstraints(); if (executionConstraints == null) { return true; @@ -284,7 +284,7 @@ private boolean checkExecutionConstraints(TaskQuartzImpl task, OperationResult r } @NotNull - private Map createGroupMap(TaskQuartzImpl task, OperationResult result) { + private Map createGroupMap(RunningTaskQuartzImpl task, OperationResult result) { Map groupMap = new HashMap<>(); Map groupsWithLimits = task.getGroupsWithLimits(); if (!groupsWithLimits.isEmpty()) { @@ -354,7 +354,7 @@ private RescheduleTime getRescheduleTime(TaskExecutionConstraintsType executionC } } - private void rescheduleLater(TaskQuartzImpl task, long startAt) throws JobExecutionException { + private void rescheduleLater(RunningTaskQuartzImpl task, long startAt) throws JobExecutionException { Trigger trigger = TaskQuartzImplUtil.createTriggerForTask(task, startAt); try { taskManagerImpl.getExecutionManager().getQuartzScheduler().scheduleJob(trigger); @@ -369,11 +369,11 @@ private void waitForTransientChildrenAndCloseThem(OperationResult result) { taskManagerImpl.waitForTransientChildren(task, result); // at this moment, there should be no executing child tasks... we just clean-up all runnables that had not started - for (Task subtask : task.getLightweightAsynchronousSubtasks()) { + for (RunningTaskQuartzImpl subtask : task.getLightweightAsynchronousSubtasks()) { if (subtask.getExecutionStatus() == TaskExecutionStatus.RUNNABLE) { - if (((TaskQuartzImpl) subtask).getLightweightHandlerFuture() == null) { + if (subtask.getLightweightHandlerFuture() == null) { LOGGER.trace("Lightweight task handler for subtask {} has not started yet; closing the task.", subtask); - closeTask((TaskQuartzImpl) subtask, result); + closeTask(subtask, result); } } } @@ -445,7 +445,7 @@ private void processTaskStop(OperationResult executionResult) { } } - private void closeFlawedTask(TaskQuartzImpl task, OperationResult result) { + private void closeFlawedTask(RunningTaskQuartzImpl task, OperationResult result) { LOGGER.info("Closing flawed task {}", task); try { task.setResultImmediate(result, result); @@ -457,7 +457,7 @@ private void closeFlawedTask(TaskQuartzImpl task, OperationResult result) { closeTask(task, result); } - private void closeTask(TaskQuartzImpl task, OperationResult result) { + private void closeTask(RunningTaskQuartzImpl task, OperationResult result) { try { taskManagerImpl.closeTask(task, result); } catch (ObjectNotFoundException e) { @@ -836,7 +836,7 @@ private void recordCycleRunStart(OperationResult result, TaskHandler handler) { OperationResult newResult = new OperationResult("run"); newResult.setStatus(OperationResultStatus.IN_PROGRESS); task.setResult(newResult); // MID-4033 - task.savePendingModifications(result); + task.flushPendingModifications(result); } catch (Exception e) { // TODO: implement correctly after clarification LoggingUtils.logUnexpectedException(LOGGER, "Cannot record run start for task {}", e, task); } @@ -867,7 +867,7 @@ private boolean recordCycleRunFinish(TaskRunResult runResult, TaskHandler handle } task.setNode(null); task.storeOperationStatsDeferred(); - task.savePendingModifications(result); + task.flushPendingModifications(result); return true; } catch (ObjectNotFoundException ex) { @@ -890,7 +890,7 @@ public void interrupt() { boolean interruptsMaybe = taskManagerImpl.getConfiguration().getUseThreadInterrupt() != UseThreadInterrupt.NEVER; if (task != null) { task.unsetCanRun(); - for (TaskQuartzImpl subtask : task.getRunningLightweightAsynchronousSubtasks()) { + for (RunningTaskQuartzImpl subtask : task.getRunningLightweightAsynchronousSubtasks()) { subtask.unsetCanRun(); // if we want to cancel the Future using interrupts, we have to do it now // because after calling cancel(false) subsequent calls to cancel(true) have no effect whatsoever @@ -914,9 +914,9 @@ private void sendThreadInterrupt(boolean alsoSubtasks) { LOGGER.trace("Thread.interrupt was called on thread {}.", executingThread); } if (alsoSubtasks) { - for (Task subtask : task.getRunningLightweightAsynchronousSubtasks()) { + for (RunningTaskQuartzImpl subtask : task.getRunningLightweightAsynchronousSubtasks()) { //LOGGER.trace("Calling Future.cancel(mayInterruptIfRunning:=true) on a future for LAT subtask {}", subtask); - ((TaskQuartzImpl) subtask).getLightweightHandlerFuture().cancel(true); + subtask.getLightweightHandlerFuture().cancel(true); } } } diff --git a/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/execution/StalledTasksWatcher.java b/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/execution/StalledTasksWatcher.java index 65a0c8c4e7e..973af4cae17 100644 --- a/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/execution/StalledTasksWatcher.java +++ b/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/execution/StalledTasksWatcher.java @@ -18,8 +18,8 @@ import com.evolveum.midpoint.schema.constants.SchemaConstants; import com.evolveum.midpoint.schema.result.OperationResult; +import com.evolveum.midpoint.task.quartzimpl.RunningTaskQuartzImpl; import com.evolveum.midpoint.task.quartzimpl.TaskManagerQuartzImpl; -import com.evolveum.midpoint.task.quartzimpl.TaskQuartzImpl; import com.evolveum.midpoint.task.quartzimpl.TaskQuartzImplUtil; import com.evolveum.midpoint.util.exception.ObjectAlreadyExistsException; import com.evolveum.midpoint.util.exception.ObjectNotFoundException; @@ -78,10 +78,10 @@ public void checkStalledTasks(OperationResult parentResult) { OperationResult result = parentResult.createSubresult(DOT_CLASS + "checkStalledTasks"); - Map runningTasks = taskManager.getLocallyRunningTaskInstances(); + Map runningTasks = taskManager.getLocallyRunningTaskInstances(); LOGGER.trace("checkStalledTasks: running tasks = {}", runningTasks); - for (TaskQuartzImpl task : runningTasks.values()) { + for (RunningTaskQuartzImpl task : runningTasks.values()) { long currentTimestamp = System.currentTimeMillis(); long lastStartedTimestamp = task.getLastRunStartTimestamp() != null ? task.getLastRunStartTimestamp() : 0L; Long heartbeatProgressInfo = task.getHandler().heartbeat(task); diff --git a/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/execution/TaskSynchronizer.java b/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/execution/TaskSynchronizer.java index dc3b7b78705..36a5ae9711e 100644 --- a/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/execution/TaskSynchronizer.java +++ b/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/execution/TaskSynchronizer.java @@ -22,6 +22,8 @@ import java.util.List; import java.util.Set; +import com.evolveum.midpoint.task.api.Task; +import com.evolveum.midpoint.task.quartzimpl.InternalTaskInterface; import org.quartz.JobKey; import org.quartz.Scheduler; import org.quartz.SchedulerException; @@ -180,7 +182,7 @@ boolean synchronizeJobStores(OperationResult parentResult) { * * @return true if task info in Quartz was updated */ - public boolean synchronizeTask(TaskQuartzImpl task, OperationResult parentResult) { + public boolean synchronizeTask(Task task, OperationResult parentResult) { if (!task.isPersistent()) { return false; // transient tasks are not scheduled via Quartz! @@ -194,7 +196,7 @@ public boolean synchronizeTask(TaskQuartzImpl task, OperationResult parentResult try { - LOGGER.trace("Synchronizing task {}; isRecreateQuartzTrigger = {}", task, task.isRecreateQuartzTrigger()); + LOGGER.trace("Synchronizing task {}; isRecreateQuartzTrigger = {}", task, isRecreateQuartzTrigger(task)); Scheduler scheduler = taskManager.getExecutionManager().getQuartzScheduler(); String oid = task.getOid(); @@ -268,7 +270,7 @@ public boolean synchronizeTask(TaskQuartzImpl task, OperationResult parentResult } else { // we have to compare trigger parameters with the task's ones Trigger triggerAsIs = scheduler.getTrigger(standardTriggerKey); - if (task.isRecreateQuartzTrigger() || TaskQuartzImplUtil.triggersDiffer(triggerAsIs, triggerToBe)) { + if (isRecreateQuartzTrigger(task) || TaskQuartzImplUtil.triggersDiffer(triggerAsIs, triggerToBe)) { String m1 = "Existing trigger has incompatible parameters or was explicitly requested to be recreated; recreating it. Task = " + task; LOGGER.trace(" - " + m1); message += "[" + m1 + "] "; @@ -304,6 +306,10 @@ public boolean synchronizeTask(TaskQuartzImpl task, OperationResult parentResult return changed; } + private boolean isRecreateQuartzTrigger(Task task) { + return ((InternalTaskInterface) task).isRecreateQuartzTrigger(); + } + private RepositoryService getRepositoryService() { return taskManager.getRepositoryService(); } diff --git a/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/handlers/JdbcPingTaskHandler.java b/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/handlers/JdbcPingTaskHandler.java index 88ef16de576..aa28de20823 100644 --- a/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/handlers/JdbcPingTaskHandler.java +++ b/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/handlers/JdbcPingTaskHandler.java @@ -17,6 +17,7 @@ package com.evolveum.midpoint.task.quartzimpl.handlers; import com.evolveum.midpoint.prism.PrismProperty; +import com.evolveum.midpoint.prism.path.ItemName; import com.evolveum.midpoint.repo.sql.SqlRepositoryConfiguration; import com.evolveum.midpoint.repo.sql.SqlRepositoryFactory; import com.evolveum.midpoint.schema.constants.SchemaConstants; @@ -32,7 +33,6 @@ import javax.annotation.PostConstruct; import javax.xml.namespace.QName; import java.sql.*; -import java.util.List; /** * @author Pavol Mederly @@ -84,7 +84,7 @@ public String toString() { } @Override - public TaskRunResult run(Task task) { + public TaskRunResult run(RunningTask task) { OperationResult opResult = new OperationResult(JdbcPingTaskHandler.class.getName()+".run"); @@ -180,7 +180,7 @@ public TaskRunResult run(Task task) { return runResult; } - private T get(Task task, QName propertyName, T defaultValue) { + private T get(Task task, ItemName propertyName, T defaultValue) { PrismProperty property = task.getExtensionProperty(propertyName); if (property == null) { return defaultValue; diff --git a/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/handlers/NoOpTaskHandler.java b/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/handlers/NoOpTaskHandler.java index d15eb44f9cf..48e1c182451 100644 --- a/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/handlers/NoOpTaskHandler.java +++ b/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/handlers/NoOpTaskHandler.java @@ -57,7 +57,7 @@ public static void instantiateAndRegister(TaskManagerQuartzImpl taskManager) { } @Override - public TaskWorkBucketProcessingResult run(Task task, WorkBucketType workBucket, + public TaskWorkBucketProcessingResult run(RunningTask task, WorkBucketType workBucket, TaskWorkBucketProcessingResult previousRunResult) { String partition = task.getHandlerUri().substring(TaskConstants.NOOP_TASK_HANDLER_URI.length()); // empty or #1..#4 @@ -69,10 +69,8 @@ public TaskWorkBucketProcessingResult run(Task task, WorkBucketType workBucket, runResult.setBucketComplete(false); // overridden later runResult.setShouldContinue(false); // overridden later - PrismContainer taskExtension = task.getExtension(); - - PrismProperty delayProp = taskExtension != null ? taskExtension.findProperty(SchemaConstants.NOOP_DELAY_QNAME) : null; - PrismProperty stepsProp = taskExtension != null ? taskExtension.findProperty(SchemaConstants.NOOP_STEPS_QNAME) : null; + PrismProperty delayProp = task.getExtensionProperty(SchemaConstants.NOOP_DELAY_QNAME); + PrismProperty stepsProp = task.getExtensionProperty(SchemaConstants.NOOP_STEPS_QNAME); PrismPropertyDefinition delayPropDef = taskManagerImpl.getPrismContext().getSchemaRegistry().findPropertyDefinitionByElementName(SchemaConstants.NOOP_DELAY_QNAME); PrismPropertyDefinition stepsPropDef = taskManagerImpl.getPrismContext().getSchemaRegistry().findPropertyDefinitionByElementName(SchemaConstants.NOOP_STEPS_QNAME); diff --git a/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/handlers/PartitioningTaskHandler.java b/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/handlers/PartitioningTaskHandler.java index cde2eba1a2b..aa3d5ed021c 100644 --- a/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/handlers/PartitioningTaskHandler.java +++ b/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/handlers/PartitioningTaskHandler.java @@ -62,7 +62,7 @@ public PartitioningTaskHandler(TaskManagerQuartzImpl taskManager, Function subtasksToResume = subtasksCreated.stream() .filter(t -> t.getExecutionStatus() == TaskExecutionStatus.SUSPENDED) .collect(Collectors.toList()); @@ -175,14 +175,14 @@ private List checkSubtasksClosed(Task masterTask, OperationResult opResult private void scheduleSubtasksNow(List subtasks, Task masterTask, OperationResult opResult) throws SchemaException, ObjectAlreadyExistsException, ObjectNotFoundException { masterTask.makeWaiting(TaskWaitingReason.OTHER_TASKS, TaskUnpauseActionType.RESCHEDULE); // i.e. close for single-run tasks - masterTask.savePendingModifications(opResult); + masterTask.flushPendingModifications(opResult); Set dependents = getDependentTasksIdentifiers(subtasks); // first set dependents to waiting, and only after that start runnables for (Task subtask : subtasks) { if (dependents.contains(subtask.getTaskIdentifier())) { subtask.makeWaiting(TaskWaitingReason.OTHER_TASKS, TaskUnpauseActionType.EXECUTE_IMMEDIATELY); - subtask.savePendingModifications(opResult); + subtask.flushPendingModifications(opResult); } } for (Task subtask : subtasks) { @@ -229,10 +229,10 @@ private List createSubtasks(TaskPartitionsDefinition partitionsDefinition, subtask.addDependent(dependent.getTaskIdentifier()); if (dependent.getExecutionStatus() == TaskExecutionStatus.SUSPENDED) { dependent.makeWaiting(TaskWaitingReason.OTHER_TASKS, TaskUnpauseActionType.EXECUTE_IMMEDIATELY); - dependent.savePendingModifications(opResult); + dependent.flushPendingModifications(opResult); } } - subtask.savePendingModifications(opResult); + subtask.flushPendingModifications(opResult); } return subtasks; } @@ -246,7 +246,6 @@ private String createSubtask(int index, TaskPartitionsDefinition partitionsDefin TaskPartitionDefinition partition = partitionsDefinition.getPartition(masterTask, index); - TaskType masterTaskBean = masterTask.getTaskType(); TaskType subtask = new TaskType(getPrismContext()); String nameTemplate = applyDefaults( @@ -285,9 +284,9 @@ private String createSubtask(int index, TaskPartitionsDefinition partitionsDefin subtask.setWorkManagement(workManagement); subtask.setExecutionStatus(TaskExecutionStatusType.SUSPENDED); - subtask.setOwnerRef(CloneUtil.clone(masterTaskBean.getOwnerRef())); + subtask.setOwnerRef(CloneUtil.clone(masterTask.getOwnerRef())); subtask.setCategory(masterTask.getCategory()); - subtask.setObjectRef(CloneUtil.clone(masterTaskBean.getObjectRef())); + subtask.setObjectRef(CloneUtil.clone(masterTask.getObjectRef())); subtask.setRecurrence(TaskRecurrenceType.SINGLE); subtask.setParent(masterTask.getTaskIdentifier()); boolean copyMasterExtension = applyDefaults( @@ -295,9 +294,9 @@ private String createSubtask(int index, TaskPartitionsDefinition partitionsDefin ps -> ps.isCopyMasterExtension(masterTask), false, partition, partitionsDefinition); if (copyMasterExtension) { - PrismContainer masterExtension = masterTaskBean.asPrismObject().findContainer(TaskType.F_EXTENSION); - if (masterTaskBean.getExtension() != null) { - subtask.asPrismObject().add(masterExtension.clone()); + PrismContainer masterExtension = masterTask.getExtensionClone(); + if (masterExtension != null) { + subtask.asPrismObject().add(masterExtension); } } diff --git a/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/handlers/WaitForSubtasksByPollingTaskHandler.java b/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/handlers/WaitForSubtasksByPollingTaskHandler.java index d2d543dd74f..52695c5fe71 100644 --- a/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/handlers/WaitForSubtasksByPollingTaskHandler.java +++ b/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/handlers/WaitForSubtasksByPollingTaskHandler.java @@ -20,10 +20,12 @@ import com.evolveum.midpoint.prism.PrismObject; import com.evolveum.midpoint.schema.result.OperationResult; +import com.evolveum.midpoint.task.api.RunningTask; import com.evolveum.midpoint.task.api.Task; import com.evolveum.midpoint.task.api.TaskHandler; import com.evolveum.midpoint.task.api.TaskRunResult; import com.evolveum.midpoint.task.api.TaskRunResult.TaskRunResultStatus; +import com.evolveum.midpoint.task.quartzimpl.InternalTaskInterface; import com.evolveum.midpoint.task.quartzimpl.TaskManagerQuartzImpl; import com.evolveum.midpoint.task.quartzimpl.TaskQuartzImpl; import com.evolveum.midpoint.util.exception.SchemaException; @@ -56,16 +58,16 @@ public static void instantiateAndRegister(TaskManagerQuartzImpl taskManager) { } @Override - public TaskRunResult run(Task task) { + public TaskRunResult run(RunningTask task) { OperationResult opResult = new OperationResult(WaitForSubtasksByPollingTaskHandler.class.getName()+".run"); TaskRunResult runResult = new TaskRunResult(); LOGGER.info("WaitForSubtasksByPollingTaskHandler run starting; in task " + task.getName()); - List> subtasks = null; + List> subtasks; try { - subtasks = ((TaskQuartzImpl) task).listPersistentSubtasksRaw(opResult); + subtasks = ((InternalTaskInterface) task).listPersistentSubtasksRaw(opResult); } catch (SchemaException e) { throw new SystemException("Couldn't list subtasks of " + task + " due to schema exception", e); } diff --git a/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/handlers/WaitForTasksTaskHandler.java b/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/handlers/WaitForTasksTaskHandler.java index 02a1ed0ea9c..07939399817 100644 --- a/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/handlers/WaitForTasksTaskHandler.java +++ b/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/handlers/WaitForTasksTaskHandler.java @@ -50,7 +50,7 @@ public static void instantiateAndRegister(TaskManagerQuartzImpl taskManager) { } @Override - public TaskRunResult run(Task task) { + public TaskRunResult run(RunningTask task) { OperationResult result = task.getResult().createSubresult(WaitForTasksTaskHandler.class.getName()+".run"); result.recordInProgress(); diff --git a/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/handlers/WorkersCreationTaskHandler.java b/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/handlers/WorkersCreationTaskHandler.java index 6fcec83a617..ecd6b2cfb49 100644 --- a/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/handlers/WorkersCreationTaskHandler.java +++ b/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/handlers/WorkersCreationTaskHandler.java @@ -56,7 +56,7 @@ private void initialize() { } @Override - public TaskRunResult run(Task task) { + public TaskRunResult run(RunningTask task) { OperationResult opResult = new OperationResult(WorkersCreationTaskHandler.class.getName()+".run"); TaskRunResult runResult = new TaskRunResult(); @@ -96,7 +96,7 @@ public TaskRunResult run(Task task) { options.setDontCloseWorkersWhenWorkDone(true); taskManager.reconcileWorkers(task.getOid(), options, opResult); task.makeWaiting(TaskWaitingReason.OTHER_TASKS, TaskUnpauseActionType.RESCHEDULE); // i.e. close for single-run tasks - task.savePendingModifications(opResult); + task.flushPendingModifications(opResult); taskManager.resumeTasks(TaskUtil.tasksToOids(task.listSubtasks(true, opResult)), opResult); LOGGER.info("Worker tasks were successfully created for coordinator {}", task); } catch (SchemaException | ObjectNotFoundException | ObjectAlreadyExistsException e) { @@ -119,7 +119,7 @@ private void setOrCheckTaskKind(Task task, OperationResult opResult) .item(TaskType.F_WORK_MANAGEMENT, TaskWorkManagementType.F_TASK_KIND) .replace(TaskKindType.COORDINATOR) .asItemDelta(); - task.addModificationImmediate(itemDelta, opResult); + task.modifyAndFlush(itemDelta, opResult); } else if (taskKind != TaskKindType.COORDINATOR) { throw new IllegalStateException("Task has incompatible task kind; expected " + TaskKindType.COORDINATOR + " but having: " + task.getWorkManagement() + " in " + task); diff --git a/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/handlers/WorkersRestartTaskHandler.java b/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/handlers/WorkersRestartTaskHandler.java index 1a96af780e5..7d1dd2f2a4c 100644 --- a/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/handlers/WorkersRestartTaskHandler.java +++ b/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/handlers/WorkersRestartTaskHandler.java @@ -59,7 +59,7 @@ private void initialize() { } @Override - public TaskRunResult run(Task task) { + public TaskRunResult run(RunningTask task) { OperationResult opResult = new OperationResult(WorkersRestartTaskHandler.class.getName()+".run"); TaskRunResult runResult = new TaskRunResult(); diff --git a/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/statistics/Statistics.java b/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/statistics/Statistics.java new file mode 100644 index 00000000000..d82632ee55a --- /dev/null +++ b/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/statistics/Statistics.java @@ -0,0 +1,334 @@ +/* + * Copyright (c) 2010-2019 Evolveum + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.evolveum.midpoint.task.quartzimpl.statistics; + +import com.evolveum.midpoint.prism.PrismContext; +import com.evolveum.midpoint.prism.PrismObject; +import com.evolveum.midpoint.prism.PrismObjectDefinition; +import com.evolveum.midpoint.prism.delta.ChangeType; +import com.evolveum.midpoint.prism.polystring.PolyString; +import com.evolveum.midpoint.schema.statistics.*; +import com.evolveum.midpoint.util.logging.Trace; +import com.evolveum.midpoint.util.logging.TraceManager; +import com.evolveum.midpoint.xml.ns._public.common.common_3.*; +import org.jetbrains.annotations.NotNull; + +import javax.xml.namespace.QName; +import java.util.Collection; +import java.util.Collections; +import java.util.Date; +import java.util.List; + +import static com.evolveum.midpoint.prism.xml.XmlTypeConverter.createXMLGregorianCalendar; + +/** + * Code to manage operational statistics. Originally it was a part of the TaskQuartzImpl + * but it is cleaner to keep it separate. + * + * It is used for + * 1) running background tasks (RunningTask) - both heavyweight and lightweight + * 2) transient tasks e.g. those invoked from GUI + */ +public class Statistics { + + private static final Trace LOGGER = TraceManager.getTrace(Statistics.class); + private static final Trace PERFORMANCE_ADVISOR = TraceManager.getPerformanceAdvisorTrace(); + + @NotNull private final PrismContext prismContext; + + public Statistics(@NotNull PrismContext prismContext) { + this.prismContext = prismContext; + } + + private EnvironmentalPerformanceInformation environmentalPerformanceInformation = new EnvironmentalPerformanceInformation(); + private SynchronizationInformation synchronizationInformation; // has to be explicitly enabled + private IterativeTaskInformation iterativeTaskInformation; // has to be explicitly enabled + private ActionsExecutedInformation actionsExecutedInformation; // has to be explicitly enabled + + private EnvironmentalPerformanceInformation getEnvironmentalPerformanceInformation() { + return environmentalPerformanceInformation; + } + + private SynchronizationInformation getSynchronizationInformation() { + return synchronizationInformation; + } + + private IterativeTaskInformation getIterativeTaskInformation() { + return iterativeTaskInformation; + } + + public ActionsExecutedInformation getActionsExecutedInformation() { + return actionsExecutedInformation; + } + + @NotNull + public List getLastFailures() { + return iterativeTaskInformation != null ? iterativeTaskInformation.getLastFailures() : Collections.emptyList(); + } + + private EnvironmentalPerformanceInformationType getAggregateEnvironmentalPerformanceInformation(Collection children) { + if (environmentalPerformanceInformation == null) { + return null; + } + EnvironmentalPerformanceInformationType rv = new EnvironmentalPerformanceInformationType(); + EnvironmentalPerformanceInformation.addTo(rv, environmentalPerformanceInformation.getAggregatedValue()); + for (Statistics child : children) { + EnvironmentalPerformanceInformation info = child.getEnvironmentalPerformanceInformation(); + if (info != null) { + EnvironmentalPerformanceInformation.addTo(rv, info.getAggregatedValue()); + } + } + return rv; + } + + private IterativeTaskInformationType getAggregateIterativeTaskInformation(Collection children) { + if (iterativeTaskInformation == null) { + return null; + } + IterativeTaskInformationType rv = new IterativeTaskInformationType(); + IterativeTaskInformation.addTo(rv, iterativeTaskInformation.getAggregatedValue(), false); + for (Statistics child : children) { + IterativeTaskInformation info = child.getIterativeTaskInformation(); + if (info != null) { + IterativeTaskInformation.addTo(rv, info.getAggregatedValue(), false); + } + } + return rv; + } + + private SynchronizationInformationType getAggregateSynchronizationInformation(Collection children) { + if (synchronizationInformation == null) { + return null; + } + SynchronizationInformationType rv = new SynchronizationInformationType(); + SynchronizationInformation.addTo(rv, synchronizationInformation.getAggregatedValue()); + for (Statistics child : children) { + SynchronizationInformation info = child.getSynchronizationInformation(); + if (info != null) { + SynchronizationInformation.addTo(rv, info.getAggregatedValue()); + } + } + return rv; + } + + private ActionsExecutedInformationType getAggregateActionsExecutedInformation(Collection children) { + if (actionsExecutedInformation == null) { + return null; + } + ActionsExecutedInformationType rv = new ActionsExecutedInformationType(); + ActionsExecutedInformation.addTo(rv, actionsExecutedInformation.getAggregatedValue()); + for (Statistics child : children) { + ActionsExecutedInformation info = child.getActionsExecutedInformation(); + if (info != null) { + ActionsExecutedInformation.addTo(rv, info.getAggregatedValue()); + } + } + return rv; + } + + public OperationStatsType getAggregatedLiveOperationStats(Collection children) { + EnvironmentalPerformanceInformationType env = getAggregateEnvironmentalPerformanceInformation(children); + IterativeTaskInformationType itit = getAggregateIterativeTaskInformation(children); + SynchronizationInformationType sit = getAggregateSynchronizationInformation(children); + ActionsExecutedInformationType aeit = getAggregateActionsExecutedInformation(children); + if (env == null && itit == null && sit == null && aeit == null) { + return null; + } + OperationStatsType rv = new OperationStatsType(); + rv.setEnvironmentalPerformanceInformation(env); + rv.setIterativeTaskInformation(itit); + rv.setSynchronizationInformation(sit); + rv.setActionsExecutedInformation(aeit); + rv.setTimestamp(createXMLGregorianCalendar(new Date())); + return rv; + } + + public void recordState(String message) { + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("{}", message); + } + if (PERFORMANCE_ADVISOR.isDebugEnabled()) { + PERFORMANCE_ADVISOR.debug("{}", message); + } + environmentalPerformanceInformation.recordState(message); + } + + public void recordProvisioningOperation(String resourceOid, String resourceName, QName objectClassName, + ProvisioningOperation operation, boolean success, int count, long duration) { + environmentalPerformanceInformation + .recordProvisioningOperation(resourceOid, resourceName, objectClassName, operation, success, count, duration); + } + + public void recordNotificationOperation(String transportName, boolean success, long duration) { + environmentalPerformanceInformation.recordNotificationOperation(transportName, success, duration); + } + + public void recordMappingOperation(String objectOid, String objectName, String objectTypeName, String mappingName, + long duration) { + environmentalPerformanceInformation.recordMappingOperation(objectOid, objectName, objectTypeName, mappingName, duration); + } + + public synchronized void recordSynchronizationOperationEnd(String objectName, String objectDisplayName, QName objectType, + String objectOid, + long started, Throwable exception, SynchronizationInformation.Record originalStateIncrement, + SynchronizationInformation.Record newStateIncrement) { + if (synchronizationInformation != null) { + synchronizationInformation + .recordSynchronizationOperationEnd(objectName, objectDisplayName, objectType, objectOid, started, exception, + originalStateIncrement, newStateIncrement); + } + } + + public synchronized void recordSynchronizationOperationStart(String objectName, String objectDisplayName, QName objectType, + String objectOid) { + if (synchronizationInformation != null) { + synchronizationInformation.recordSynchronizationOperationStart(objectName, objectDisplayName, objectType, objectOid); + } + } + + public synchronized void recordIterativeOperationEnd(String objectName, String objectDisplayName, QName objectType, + String objectOid, long started, Throwable exception) { + if (iterativeTaskInformation != null) { + iterativeTaskInformation.recordOperationEnd(objectName, objectDisplayName, objectType, objectOid, started, exception); + } + } + + public void recordIterativeOperationEnd(ShadowType shadow, long started, Throwable exception) { + recordIterativeOperationEnd(PolyString.getOrig(shadow.getName()), StatisticsUtil.getDisplayName(shadow), + ShadowType.COMPLEX_TYPE, shadow.getOid(), started, exception); + } + + public void recordIterativeOperationStart(ShadowType shadow) { + recordIterativeOperationStart(PolyString.getOrig(shadow.getName()), StatisticsUtil.getDisplayName(shadow), + ShadowType.COMPLEX_TYPE, shadow.getOid()); + } + + public synchronized void recordIterativeOperationStart(String objectName, String objectDisplayName, QName objectType, + String objectOid) { + if (iterativeTaskInformation != null) { + iterativeTaskInformation.recordOperationStart(objectName, objectDisplayName, objectType, objectOid); + } + } + + public void recordObjectActionExecuted(String objectName, String objectDisplayName, QName objectType, String objectOid, + ChangeType changeType, String channel, Throwable exception) { + if (actionsExecutedInformation != null) { + actionsExecutedInformation + .recordObjectActionExecuted(objectName, objectDisplayName, objectType, objectOid, changeType, channel, + exception); + } + } + + public void recordObjectActionExecuted(PrismObject object, ChangeType changeType, String channel, Throwable exception) { + recordObjectActionExecuted(object, null, null, changeType, channel, exception); + } + + public void recordObjectActionExecuted(PrismObject object, Class objectTypeClass, + String defaultOid, ChangeType changeType, String channel, Throwable exception) { + if (actionsExecutedInformation != null) { + String name, displayName, oid; + PrismObjectDefinition definition; + Class clazz; + if (object != null) { + name = PolyString.getOrig(object.getName()); + displayName = StatisticsUtil.getDisplayName(object); + definition = object.getDefinition(); + clazz = object.getCompileTimeClass(); + oid = object.getOid(); + if (oid == null) { // in case of ADD operation + oid = defaultOid; + } + } else { + name = null; + displayName = null; + definition = null; + clazz = objectTypeClass; + oid = defaultOid; + } + if (definition == null && clazz != null) { + definition = prismContext.getSchemaRegistry().findObjectDefinitionByCompileTimeClass(clazz); + } + QName typeQName; + if (definition != null) { + typeQName = definition.getTypeName(); + } else { + typeQName = ObjectType.COMPLEX_TYPE; + } + actionsExecutedInformation + .recordObjectActionExecuted(name, displayName, typeQName, oid, changeType, channel, exception); + } + } + + public void markObjectActionExecutedBoundary() { + if (actionsExecutedInformation != null) { + actionsExecutedInformation.markObjectActionExecutedBoundary(); + } + } + + public void resetEnvironmentalPerformanceInformation(EnvironmentalPerformanceInformationType value) { + environmentalPerformanceInformation = new EnvironmentalPerformanceInformation(value); + } + + public void resetSynchronizationInformation(SynchronizationInformationType value) { + synchronizationInformation = new SynchronizationInformation(value); + } + + public void resetIterativeTaskInformation(IterativeTaskInformationType value) { + iterativeTaskInformation = new IterativeTaskInformation(value); + } + + public void resetActionsExecutedInformation(ActionsExecutedInformationType value) { + actionsExecutedInformation = new ActionsExecutedInformation(value); + } + + public void startCollectingOperationStatsFromZero(boolean enableIterationStatistics, boolean enableSynchronizationStatistics, + boolean enableActionsExecutedStatistics) { + resetEnvironmentalPerformanceInformation(null); + if (enableIterationStatistics) { + resetIterativeTaskInformation(null); + } + if (enableSynchronizationStatistics) { + resetSynchronizationInformation(null); + } + if (enableActionsExecutedStatistics) { + resetActionsExecutedInformation(null); + } + } + + public void startCollectingOperationStatsFromStoredValues(OperationStatsType stored, boolean enableIterationStatistics, + boolean enableSynchronizationStatistics, boolean enableActionsExecutedStatistics) { + if (stored == null) { + stored = new OperationStatsType(); + } + resetEnvironmentalPerformanceInformation(stored.getEnvironmentalPerformanceInformation()); + if (enableIterationStatistics) { + resetIterativeTaskInformation(stored.getIterativeTaskInformation()); + } else { + iterativeTaskInformation = null; + } + if (enableSynchronizationStatistics) { + resetSynchronizationInformation(stored.getSynchronizationInformation()); + } else { + synchronizationInformation = null; + } + if (enableActionsExecutedStatistics) { + resetActionsExecutedInformation(stored.getActionsExecutedInformation()); + } else { + actionsExecutedInformation = null; + } + } +} diff --git a/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/work/WorkStateManager.java b/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/work/WorkStateManager.java index 67b04a7b52b..f8e4cfd968a 100644 --- a/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/work/WorkStateManager.java +++ b/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/work/WorkStateManager.java @@ -34,6 +34,7 @@ import com.evolveum.midpoint.task.api.Task; import com.evolveum.midpoint.task.api.TaskExecutionStatus; import com.evolveum.midpoint.task.api.TaskManager; +import com.evolveum.midpoint.task.quartzimpl.InternalTaskInterface; import com.evolveum.midpoint.task.quartzimpl.TaskManagerConfiguration; import com.evolveum.midpoint.task.quartzimpl.TaskManagerQuartzImpl; import com.evolveum.midpoint.task.quartzimpl.work.segmentation.content.WorkBucketContentHandler; @@ -162,7 +163,7 @@ public WorkBucketType getWorkBucket(@NotNull String workerTaskOid, long freeBuck } private WorkBucketType findSelfAllocatedBucket(Context ctx) { - TaskWorkStateType workState = ctx.workerTask.getTaskType().getWorkState(); + TaskWorkStateType workState = ctx.workerTask.getWorkState(); if (workState == null || workState.getBucket().isEmpty()) { return null; } @@ -190,7 +191,7 @@ private WorkBucketType getWorkBucketMultiNode(Context ctx, long freeBucketWaitTi int retry = 0; waitForConflictLessUpdate: // this cycle exits when coordinator task update succeeds for (;;) { - TaskWorkStateType coordinatorWorkState = getWorkStateOrNew(ctx.coordinatorTask.getTaskPrismObject()); + TaskWorkStateType coordinatorWorkState = getWorkStateOrNew(ctx.coordinatorTask); globalAttempt++; GetBucketResult response = workStateStrategy.getBucket(coordinatorWorkState); LOGGER.trace("getWorkBucketMultiNode: workStateStrategy returned {} for worker task {}, coordinator {}", response, ctx.workerTask, ctx.coordinatorTask); @@ -371,7 +372,7 @@ private boolean reclaimWronglyAllocatedBuckets(Task coordinatorTask, OperationRe // the whole task tree. repositoryService.modifyObject(TaskType.class, coordinatorTask.getOid(), bucketsReplaceDeltas(newState.getBucket()), - new VersionPrecondition<>(coordinatorTask.getTaskPrismObject().getVersion()), null, result); + new VersionPrecondition<>(coordinatorTask.getVersion()), null, result); } return reclaiming > 0; } @@ -380,7 +381,7 @@ private WorkBucketType getWorkBucketStandalone(Context ctx, OperationResult resu throws SchemaException, ObjectAlreadyExistsException, ObjectNotFoundException { WorkSegmentationStrategy workStateStrategy = strategyFactory.createStrategy(ctx.workerTask.getWorkManagement()); setOrUpdateEstimatedNumberOfBuckets(ctx.workerTask, workStateStrategy, result); - TaskWorkStateType workState = getWorkStateOrNew(ctx.workerTask.getTaskPrismObject()); + TaskWorkStateType workState = getWorkStateOrNew(ctx.workerTask); GetBucketResult response = workStateStrategy.getBucket(workState); LOGGER.trace("getWorkBucketStandalone: workStateStrategy returned {} for standalone task {}", response, ctx.workerTask); if (response instanceof FoundExisting) { @@ -465,7 +466,7 @@ private void completeWorkBucketMultiNode(Context ctx, int sequentialNumber, Oper } catch (PreconditionViolationException e) { throw new IllegalStateException("Unexpected concurrent modification of work bucket " + bucket + " in " + ctx.coordinatorTask, e); } - ItemDeltaCollectionsUtil.applyTo(modifications, ctx.coordinatorTask.getTaskPrismObject()); + ((InternalTaskInterface) ctx.coordinatorTask).applyModificationsTransient(modifications); compressCompletedBuckets(ctx.coordinatorTask, result); TaskWorkStateType workerWorkState = getWorkState(ctx.workerTask); @@ -492,7 +493,7 @@ private void completeWorkBucketStandalone(Context ctx, int sequentialNumber, Ope } Collection> modifications = bucketStateChangeDeltas(bucket, WorkBucketStateType.COMPLETE); repositoryService.modifyObject(TaskType.class, ctx.workerTask.getOid(), modifications, null, result); - ItemDeltaCollectionsUtil.applyTo(modifications, ctx.workerTask.getTaskPrismObject()); + ((InternalTaskInterface) ctx.workerTask).applyModificationsTransient(modifications); compressCompletedBuckets(ctx.workerTask, result); } @@ -580,7 +581,7 @@ private void compressCompletedBuckets(Task task, OperationResult result) private ModificationPrecondition bucketsReplacePrecondition(List originalBuckets) { // performance is not optimal but OK for precondition checking - return taskObject -> cloneNoId(originalBuckets).equals(cloneNoId(getWorkStateOrNew(taskObject).getBucket())); + return taskObject -> cloneNoId(originalBuckets).equals(cloneNoId(getWorkStateOrNew(taskObject.asObjectable()).getBucket())); } private Collection> bucketStateChangeDeltas(WorkBucketType bucket, WorkBucketStateType newState) throws SchemaException { @@ -597,7 +598,7 @@ private ModificationPrecondition bucketsReplacePrecondition(List bucketUnchangedPrecondition(WorkBucketType originalBucket) { return taskObject -> { - WorkBucketType currentBucket = findBucketByNumber(getWorkStateOrNew(taskObject).getBucket(), + WorkBucketType currentBucket = findBucketByNumber(getWorkStateOrNew(taskObject.asObjectable()).getBucket(), originalBucket.getSequentialNumber()); // performance is not optimal but OK for precondition checking return currentBucket != null && cloneNoId(currentBucket).equals(cloneNoId(originalBucket)); @@ -614,9 +615,18 @@ private List cloneNoId(List buckets) { } @NotNull - private TaskWorkStateType getWorkStateOrNew(PrismObject task) { - if (task.asObjectable().getWorkState() != null) { - return task.asObjectable().getWorkState(); + private TaskWorkStateType getWorkStateOrNew(Task task) { + if (task.getWorkState() != null) { + return task.getWorkState(); + } else { + return new TaskWorkStateType(prismContext); + } + } + + @NotNull + private TaskWorkStateType getWorkStateOrNew(TaskType task) { + if (task.getWorkState() != null) { + return task.getWorkState(); } else { return new TaskWorkStateType(prismContext); } diff --git a/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/work/workers/WorkersManager.java b/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/work/workers/WorkersManager.java index ce975d7c246..5eabc79ff1f 100644 --- a/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/work/workers/WorkersManager.java +++ b/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/work/workers/WorkersManager.java @@ -257,7 +257,6 @@ private int createWorkers(Task coordinatorTask, MultiValuedMap coordinatorExtension = coordinatorTaskBean.asPrismObject().findContainer(TaskType.F_EXTENSION); - if (coordinatorTaskBean.getExtension() != null) { - worker.asPrismObject().add(coordinatorExtension.clone()); + PrismContainer coordinatorExtension = coordinatorTask.getExtensionClone(); + if (coordinatorExtension != null) { + worker.asPrismObject().add(coordinatorExtension); } LOGGER.info("Creating worker task on {}: {}", keyToCreate.group, keyToCreate.name); taskManager.addTask(worker.asPrismObject(), result); diff --git a/repo/task-quartz-impl/src/test/java/com/evolveum/midpoint/task/quartzimpl/AbstractTaskManagerTest.java b/repo/task-quartz-impl/src/test/java/com/evolveum/midpoint/task/quartzimpl/AbstractTaskManagerTest.java index ac05bc78494..828e472145f 100644 --- a/repo/task-quartz-impl/src/test/java/com/evolveum/midpoint/task/quartzimpl/AbstractTaskManagerTest.java +++ b/repo/task-quartz-impl/src/test/java/com/evolveum/midpoint/task/quartzimpl/AbstractTaskManagerTest.java @@ -245,7 +245,7 @@ protected void waitForTaskProgress(String taskOid, OperationResult result, long } protected void waitForTaskNextRun(String taskOid, OperationResult result, long timeoutInterval, long sleepInterval) throws Exception { - TaskQuartzImpl taskBefore = (TaskQuartzImpl) taskManager.getTaskWithResult(taskOid, result); + TaskQuartzImpl taskBefore = taskManager.getTaskWithResult(taskOid, result); waitFor("Waiting for task manager to execute the task", () -> { Task task = taskManager.getTaskWithResult(taskOid, result); IntegrationTestTools.display("Task while waiting for task manager to execute the task", task); diff --git a/repo/task-quartz-impl/src/test/java/com/evolveum/midpoint/task/quartzimpl/CleanupTest.java b/repo/task-quartz-impl/src/test/java/com/evolveum/midpoint/task/quartzimpl/CleanupTest.java index 774cf680cf0..c1ce69f55a7 100644 --- a/repo/task-quartz-impl/src/test/java/com/evolveum/midpoint/task/quartzimpl/CleanupTest.java +++ b/repo/task-quartz-impl/src/test/java/com/evolveum/midpoint/task/quartzimpl/CleanupTest.java @@ -85,7 +85,7 @@ public void testTasksCleanup() throws Exception { Calendar when = create_2013_05_07_12_00_00_Calendar(); CleanupPolicyType policy = createPolicy(when, NOW); - taskManager.cleanupTasks(policy, taskManager.createTaskInstance(), result); + taskManager.cleanupTasks(policy, taskManager.createFakeRunningTask(taskManager.createTaskInstance()), result); // THEN List> tasks = repositoryService.searchObjects(TaskType.class, null, null, result); diff --git a/repo/task-quartz-impl/src/test/java/com/evolveum/midpoint/task/quartzimpl/MockCycleTaskHandler.java b/repo/task-quartz-impl/src/test/java/com/evolveum/midpoint/task/quartzimpl/MockCycleTaskHandler.java index bcdbbdbe196..a4888f9dacc 100644 --- a/repo/task-quartz-impl/src/test/java/com/evolveum/midpoint/task/quartzimpl/MockCycleTaskHandler.java +++ b/repo/task-quartz-impl/src/test/java/com/evolveum/midpoint/task/quartzimpl/MockCycleTaskHandler.java @@ -16,16 +16,11 @@ package com.evolveum.midpoint.task.quartzimpl; import com.evolveum.midpoint.schema.result.OperationResult; -import com.evolveum.midpoint.task.api.Task; -import com.evolveum.midpoint.task.api.TaskCategory; -import com.evolveum.midpoint.task.api.TaskHandler; -import com.evolveum.midpoint.task.api.TaskRunResult; +import com.evolveum.midpoint.task.api.*; import com.evolveum.midpoint.task.api.TaskRunResult.TaskRunResultStatus; import com.evolveum.midpoint.util.logging.Trace; import com.evolveum.midpoint.util.logging.TraceManager; -import java.util.List; - /** * @author Radovan Semancik * @@ -43,7 +38,7 @@ public MockCycleTaskHandler(boolean finishTheHandler) { * @see com.evolveum.midpoint.task.api.TaskHandler#run(com.evolveum.midpoint.task.api.Task) */ @Override - public TaskRunResult run(Task task) { + public TaskRunResult run(RunningTask task) { LOGGER.info("MockCycle.run starting"); diff --git a/repo/task-quartz-impl/src/test/java/com/evolveum/midpoint/task/quartzimpl/MockLongTaskHandler.java b/repo/task-quartz-impl/src/test/java/com/evolveum/midpoint/task/quartzimpl/MockLongTaskHandler.java index 0e834bc98e1..7317f555027 100644 --- a/repo/task-quartz-impl/src/test/java/com/evolveum/midpoint/task/quartzimpl/MockLongTaskHandler.java +++ b/repo/task-quartz-impl/src/test/java/com/evolveum/midpoint/task/quartzimpl/MockLongTaskHandler.java @@ -16,16 +16,11 @@ package com.evolveum.midpoint.task.quartzimpl; import com.evolveum.midpoint.schema.result.OperationResult; -import com.evolveum.midpoint.task.api.Task; -import com.evolveum.midpoint.task.api.TaskCategory; -import com.evolveum.midpoint.task.api.TaskHandler; -import com.evolveum.midpoint.task.api.TaskRunResult; +import com.evolveum.midpoint.task.api.*; import com.evolveum.midpoint.task.api.TaskRunResult.TaskRunResultStatus; import com.evolveum.midpoint.util.logging.Trace; import com.evolveum.midpoint.util.logging.TraceManager; -import java.util.List; - /** * @author Radovan Semancik * @author mederly @@ -45,7 +40,7 @@ public class MockLongTaskHandler implements TaskHandler { } @Override - public TaskRunResult run(Task task) { + public TaskRunResult run(RunningTask task) { LOGGER.info("MockLong.run starting (id = {}, progress = {})", id, task.getProgress()); OperationResult opResult = new OperationResult(MockLongTaskHandler.class.getName()+".run"); diff --git a/repo/task-quartz-impl/src/test/java/com/evolveum/midpoint/task/quartzimpl/MockParallelTaskHandler.java b/repo/task-quartz-impl/src/test/java/com/evolveum/midpoint/task/quartzimpl/MockParallelTaskHandler.java index 6e0196e1e49..8800719af08 100644 --- a/repo/task-quartz-impl/src/test/java/com/evolveum/midpoint/task/quartzimpl/MockParallelTaskHandler.java +++ b/repo/task-quartz-impl/src/test/java/com/evolveum/midpoint/task/quartzimpl/MockParallelTaskHandler.java @@ -15,21 +15,21 @@ */ package com.evolveum.midpoint.task.quartzimpl; +import com.evolveum.midpoint.prism.PrismObject; import com.evolveum.midpoint.prism.PrismProperty; import com.evolveum.midpoint.prism.PrismPropertyDefinition; +import com.evolveum.midpoint.prism.path.ItemName; import com.evolveum.midpoint.schema.result.OperationResult; -import com.evolveum.midpoint.task.api.LightweightTaskHandler; -import com.evolveum.midpoint.task.api.Task; -import com.evolveum.midpoint.task.api.TaskCategory; -import com.evolveum.midpoint.task.api.TaskHandler; -import com.evolveum.midpoint.task.api.TaskRunResult; +import com.evolveum.midpoint.task.api.*; import com.evolveum.midpoint.task.api.TaskRunResult.TaskRunResultStatus; import com.evolveum.midpoint.util.logging.Trace; import com.evolveum.midpoint.util.logging.TraceManager; +import com.evolveum.midpoint.xml.ns._public.common.common_3.TaskType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.UserType; import org.apache.commons.lang.Validate; +import org.jetbrains.annotations.NotNull; import javax.xml.namespace.QName; -import java.util.List; import static org.testng.AssertJUnit.assertEquals; import static org.testng.AssertJUnit.assertFalse; @@ -42,15 +42,15 @@ public class MockParallelTaskHandler implements TaskHandler { private static final transient Trace LOGGER = TraceManager.getTrace(MockParallelTaskHandler.class); - public static final int NUM_SUBTASKS = 5; + public static final int NUM_SUBTASKS = 500; public static String NS_EXT = "http://myself.me/schemas/whatever"; - public static QName DURATION_QNAME = new QName(NS_EXT, "duration", "m"); + public static ItemName DURATION_QNAME = new ItemName(NS_EXT, "duration", "m"); private final PrismPropertyDefinition durationDefinition; private TaskManagerQuartzImpl taskManager; // a bit of hack - to reach in-memory version of last task executed - private Task lastTaskExecuted; + private RunningTask lastTaskExecuted; private String id; @@ -66,29 +66,39 @@ public class MockParallelTaskHandler implements TaskHandler { public class MyLightweightTaskHandler implements LightweightTaskHandler { private boolean hasRun = false; private boolean hasExited = false; - private Integer duration; + private long duration; + private static final long STEP = 100; public MyLightweightTaskHandler(Integer duration) { - this.duration = duration; + this.duration = duration != null ? duration : 86400L * 1000L * 365000L; // 1000 years } @Override - public void run(Task task) { + public void run(RunningTask task) { LOGGER.trace("Handler for task {} running", task); hasRun = true; - try { - if (duration == null) { - for (; ; ) { - Thread.sleep(3600000L); + long end = System.currentTimeMillis() + duration; + RunningTask parentTask = task.getParentForLightweightAsynchronousTask(); + parentTask.setOperationStatsUpdateInterval(1000L); + while (System.currentTimeMillis() < end) { + // hoping to get ConcurrentModificationException when setting operation result here (MID-5113) + task.getParentForLightweightAsynchronousTask().getTaskPrismObject(); + long started = System.currentTimeMillis(); + task.recordIterativeOperationStart("o1", null, UserType.COMPLEX_TYPE, "oid1"); + try { + Thread.sleep(STEP); + task.recordIterativeOperationEnd("o1", null, UserType.COMPLEX_TYPE, "oid1", started, null); + //noinspection SynchronizationOnLocalVariableOrMethodParameter + synchronized (parentTask) { + parentTask.incrementProgressAndStoreStatsIfNeeded(); } - } else { - Thread.sleep(duration); + } catch (InterruptedException e) { + LOGGER.trace("Handler for task {} interrupted", task); + task.recordIterativeOperationEnd("o1", null, UserType.COMPLEX_TYPE, "oid1", started, e); + break; } - } catch (InterruptedException e) { - LOGGER.trace("Handler for tash {} interrupted", task); - } finally { - hasExited = true; } + hasExited = true; } public boolean hasRun() { @@ -100,7 +110,7 @@ public boolean hasExited() { } @Override - public TaskRunResult run(Task task) { + public TaskRunResult run(RunningTask task) { LOGGER.info("MockParallelTaskHandler.run starting (id = " + id + ")"); OperationResult opResult = new OperationResult(MockParallelTaskHandler.class.getName()+".run"); @@ -112,11 +122,13 @@ public TaskRunResult run(Task task) { durationValue = duration.getRealValue(); } LOGGER.info("Duration value = {}", durationValue); + System.out.println("task result is " + task.getResult()); // we create and start some subtasks for (int i = 0; i < NUM_SUBTASKS; i++) { MyLightweightTaskHandler handler = new MyLightweightTaskHandler(durationValue); - TaskQuartzImpl subtask = (TaskQuartzImpl) task.createSubtask(handler); + RunningTaskQuartzImpl subtask = (RunningTaskQuartzImpl) task.createSubtask(handler); + subtask.resetIterativeTaskInformation(null); assertTrue("Subtask is not transient", subtask.isTransient()); assertTrue("Subtask is not asynchronous", subtask.isAsynchronous()); assertTrue("Subtask is not a LAT", subtask.isLightweightAsynchronousTask()); @@ -172,7 +184,13 @@ public void setTaskManager(TaskManagerQuartzImpl taskManager) { this.taskManager = taskManager; } - public Task getLastTaskExecuted() { + public RunningTask getLastTaskExecuted() { return lastTaskExecuted; } + + @NotNull + @Override + public StatisticsCollectionStrategy getStatisticsCollectionStrategy() { + return new StatisticsCollectionStrategy().maintainIterationStatistics().fromZero(); + } } diff --git a/repo/task-quartz-impl/src/test/java/com/evolveum/midpoint/task/quartzimpl/MockSingleTaskHandler.java b/repo/task-quartz-impl/src/test/java/com/evolveum/midpoint/task/quartzimpl/MockSingleTaskHandler.java index 3720cbe3b92..faf734e9fb0 100644 --- a/repo/task-quartz-impl/src/test/java/com/evolveum/midpoint/task/quartzimpl/MockSingleTaskHandler.java +++ b/repo/task-quartz-impl/src/test/java/com/evolveum/midpoint/task/quartzimpl/MockSingleTaskHandler.java @@ -18,6 +18,7 @@ import com.evolveum.midpoint.prism.PrismProperty; import com.evolveum.midpoint.prism.PrismPropertyDefinition; import com.evolveum.midpoint.prism.delta.ItemDelta; +import com.evolveum.midpoint.prism.path.ItemName; import com.evolveum.midpoint.schema.result.OperationResult; import com.evolveum.midpoint.task.api.*; import com.evolveum.midpoint.task.api.TaskRunResult.TaskRunResultStatus; @@ -43,8 +44,8 @@ public class MockSingleTaskHandler implements TaskHandler { private static final transient Trace LOGGER = TraceManager.getTrace(MockSingleTaskHandler.class); private String MOCK_HANDLER_URI = "http://midpoint.evolveum.com/test/mock"; private String NS_EXT = "http://myself.me/schemas/whatever"; - private QName L1_FLAG_QNAME = new QName(NS_EXT, "l1Flag", "m"); - private QName WFS_FLAG_QNAME = new QName(NS_EXT, "wfsFlag", "m"); + private ItemName L1_FLAG_QNAME = new ItemName(NS_EXT, "l1Flag", "m"); + private ItemName WFS_FLAG_QNAME = new ItemName(NS_EXT, "wfsFlag", "m"); private TaskManagerQuartzImpl taskManager; @@ -68,7 +69,7 @@ public class MockSingleTaskHandler implements TaskHandler { private int executions = 0; @Override - public TaskRunResult run(Task task) { + public TaskRunResult run(RunningTask task) { LOGGER.info("MockSingle.run starting (id = " + id + ")"); OperationResult opResult = new OperationResult(MockSingleTaskHandler.class.getName()+".run"); @@ -98,7 +99,7 @@ public TaskRunResult run(Task task) { task.pushHandlerUri(AbstractTaskManagerTest.L2_TASK_HANDLER_URI, l2Schedule, TaskBinding.TIGHT, createExtensionDelta(l1FlagDefinition, true, taskManager.getPrismContext())); try { - task.savePendingModifications(opResult); + task.flushPendingModifications(opResult); } catch(Exception e) { throw new SystemException("Cannot schedule L2 handler", e); } @@ -111,7 +112,7 @@ public TaskRunResult run(Task task) { LOGGER.info("L2 handler, fourth run - scheduling L3 handler"); task.pushHandlerUri(AbstractTaskManagerTest.L3_TASK_HANDLER_URI, new ScheduleType(), null); try { - task.savePendingModifications(opResult); + task.flushPendingModifications(opResult); } catch(Exception e) { throw new SystemException("Cannot schedule L3 handler", e); } diff --git a/repo/task-quartz-impl/src/test/java/com/evolveum/midpoint/task/quartzimpl/MockWorkBucketsTaskHandler.java b/repo/task-quartz-impl/src/test/java/com/evolveum/midpoint/task/quartzimpl/MockWorkBucketsTaskHandler.java index c89cd56e973..7d3b8822b20 100644 --- a/repo/task-quartz-impl/src/test/java/com/evolveum/midpoint/task/quartzimpl/MockWorkBucketsTaskHandler.java +++ b/repo/task-quartz-impl/src/test/java/com/evolveum/midpoint/task/quartzimpl/MockWorkBucketsTaskHandler.java @@ -51,7 +51,7 @@ public class MockWorkBucketsTaskHandler implements WorkBucketAwareTaskHandler { @FunctionalInterface public interface Processor { - void process(Task task, WorkBucketType bucket, int index); + void process(RunningTask task, WorkBucketType bucket, int index); } private Processor processor; @@ -77,7 +77,7 @@ public StatisticsCollectionStrategy getStatisticsCollectionStrategy() { } @Override - public TaskWorkBucketProcessingResult run(Task task, WorkBucketType workBucket, + public TaskWorkBucketProcessingResult run(RunningTask task, WorkBucketType workBucket, TaskWorkBucketProcessingResult previousRunResult) { LOGGER.info("Run starting (id = {}); task = {}", id, task); diff --git a/repo/task-quartz-impl/src/test/java/com/evolveum/midpoint/task/quartzimpl/TestQuartzTaskManagerContract.java b/repo/task-quartz-impl/src/test/java/com/evolveum/midpoint/task/quartzimpl/TestQuartzTaskManagerContract.java index ff1e033356d..def12043154 100644 --- a/repo/task-quartz-impl/src/test/java/com/evolveum/midpoint/task/quartzimpl/TestQuartzTaskManagerContract.java +++ b/repo/task-quartz-impl/src/test/java/com/evolveum/midpoint/task/quartzimpl/TestQuartzTaskManagerContract.java @@ -126,7 +126,7 @@ public void test003GetProgress() throws Exception { addObjectFromFile(taskFilename(TEST_NAME)); - logger.trace("Retrieving the task and getting its progress..."); + LOGGER.trace("Retrieving the task and getting its progress..."); TaskQuartzImpl task = getTask(taskOid(TEST_NAME), result); AssertJUnit.assertEquals("Progress is not 0", 0, task.getProgress()); @@ -156,7 +156,7 @@ public void test004aTaskBigProperty() throws Exception { TaskQuartzImpl task = getTask(taskOid(TEST_NAME), result); // property definition - QName bigStringQName = new QName("http://midpoint.evolveum.com/repo/test", "bigString"); + ItemName bigStringQName = new ItemName("http://midpoint.evolveum.com/repo/test", "bigString"); MutablePrismPropertyDefinition bigStringDefinition = prismContext.definitionFactory().createPropertyDefinition(bigStringQName, DOMUtil.XSD_STRING); bigStringDefinition.setIndexed(false); bigStringDefinition.setMinOccurs(0); @@ -167,11 +167,11 @@ public void test004aTaskBigProperty() throws Exception { bigStringProperty.setRealValue(string300); task.setExtensionProperty(bigStringProperty); - task.savePendingModifications(result); + task.flushPendingModifications(result); System.out.println("1st round: Task = " + task.debugDump()); - logger.trace("Retrieving the task and comparing its properties..."); + LOGGER.trace("Retrieving the task and comparing its properties..."); Task task001 = getTask(taskOid(TEST_NAME), result); System.out.println("1st round: Task from repo: " + task001.debugDump()); @@ -188,7 +188,7 @@ public void test004aTaskBigProperty() throws Exception { task001.getExtensionProperty(bigStringQName).getDefinition().toMutable().setIndexed(false); System.out.println("2nd round: Task before save = " + task001.debugDump()); - task001.savePendingModifications(result); // however, this does not work, because 'modifyObject' in repo first reads object, overwriting any existing definitions ... + task001.flushPendingModifications(result); // however, this does not work, because 'modifyObject' in repo first reads object, overwriting any existing definitions ... Task task002 = getTask(taskOid(TEST_NAME), result); System.out.println("2nd round: Task from repo: " + task002.debugDump()); @@ -220,7 +220,7 @@ public void test004bTaskBigProperty() throws Exception { TaskQuartzImpl task = getTask(taskOid(TEST_NAME), result); // property definition - QName shipStateQName = new QName("http://myself.me/schemas/whatever", "shipState"); + ItemName shipStateQName = new ItemName("http://myself.me/schemas/whatever", "shipState"); PrismPropertyDefinition shipStateDefinition = prismContext.getSchemaRegistry().findPropertyDefinitionByElementName(shipStateQName); assertNotNull("Cannot find property definition for shipState", shipStateDefinition); @@ -228,11 +228,11 @@ public void test004bTaskBigProperty() throws Exception { shipStateProperty.setRealValue(string300); task.setExtensionProperty(shipStateProperty); - task.savePendingModifications(result); + task.flushPendingModifications(result); System.out.println("1st round: Task = " + task.debugDump()); - logger.trace("Retrieving the task and comparing its properties..."); + LOGGER.trace("Retrieving the task and comparing its properties..."); Task task001 = getTask(taskOid(TEST_NAME), result); System.out.println("1st round: Task from repo: " + task001.debugDump()); @@ -246,7 +246,7 @@ public void test004bTaskBigProperty() throws Exception { task001.setExtensionProperty(shipStateProperty); System.out.println("2nd round: Task before save = " + task001.debugDump()); - task001.savePendingModifications(result); + task001.flushPendingModifications(result); Task task002 = getTask(taskOid(TEST_NAME), result); System.out.println("2nd round: Task from repo: " + task002.debugDump()); @@ -268,12 +268,12 @@ public void test004cReferenceInExtension() throws Exception { // o //PrismObject requestee = task.getOwner(); //task.setRequesteeRef(requestee); - //logger.trace("Saving modifications..."); - //task.savePendingModifications(result); // here it crashes + //LOGGER.trace("Saving modifications..."); + //task.flushPendingModifications(result); // here it crashes - //logger.trace("Retrieving the task and comparing its properties..."); + //LOGGER.trace("Retrieving the task and comparing its properties..."); //Task task001 = getTask(taskOid(test), result); - //logger.trace("Task from repo: " + task001.debugDump()); + //LOGGER.trace("Task from repo: " + task001.debugDump()); //AssertJUnit.assertEquals("RequesteeRef was not stored/retrieved correctly", requestee.getOid(), task001.getRequesteeRef().getOid()); } @@ -314,7 +314,7 @@ public void test004TaskProperties() throws Exception { // task.modifyExtension(id2); // } - task.savePendingModifications(result); + task.flushPendingModifications(result); System.out.println("Task = " + task.debugDump()); repositoryService.getObject(UserType.class, TASK_OWNER2_OID, null, result); @@ -324,7 +324,7 @@ public void test004TaskProperties() throws Exception { // other properties will be set in batched mode String newname = "Test task, name changed"; task.setName(PrismTestUtil.createPolyStringType(newname)); - task.setProgress(10); + task.setProgress(10L); long currentTime = System.currentTimeMillis(); long currentTime1 = currentTime + 10000; long currentTime2 = currentTime + 25000; @@ -364,14 +364,14 @@ public void test004TaskProperties() throws Exception { objectReferenceType.setOid(objectOid); task.setObjectRef(objectReferenceType); - logger.trace("Saving modifications..."); + LOGGER.trace("Saving modifications..."); - task.savePendingModifications(result); + task.flushPendingModifications(result); - logger.trace("Retrieving the task (second time) and comparing its properties..."); + LOGGER.trace("Retrieving the task (second time) and comparing its properties..."); Task task001 = getTask(taskOid(TEST_NAME), result); - logger.trace("Task from repo: " + task001.debugDump()); + LOGGER.trace("Task from repo: " + task001.debugDump()); AssertJUnit.assertEquals(TaskBinding.LOOSE, task001.getBinding()); PrismAsserts.assertEqualsPolyString("Name not", newname, task001.getName()); // AssertJUnit.assertEquals(newname, task001.getName()); @@ -390,7 +390,7 @@ public void test004TaskProperties() throws Exception { AssertJUnit.assertEquals("First schedule from the handler stack does not match", st0, us.getUriStackEntry().get(0).getSchedule()); AssertJUnit.assertEquals("Second handler from the handler stack does not match", "http://no-handler.org/1", us.getUriStackEntry().get(1).getHandlerUri()); AssertJUnit.assertEquals("Second schedule from the handler stack does not match", st1, us.getUriStackEntry().get(1).getSchedule()); - AssertJUnit.assertTrue(task001.isCycle()); + AssertJUnit.assertTrue(task001.isRecurring()); OperationResult r001 = task001.getResult(); AssertJUnit.assertNotNull(r001); //AssertJUnit.assertEquals("Owner OID is not correct", TASK_OWNER2_OID, task001.getOwner().getOid()); @@ -453,11 +453,11 @@ public void test005Single() throws Exception { // Add single task. This will get picked by task scanner and executed addObjectFromFile(taskFilename(TEST_NAME)); - logger.trace("Retrieving the task..."); + LOGGER.trace("Retrieving the task..."); TaskQuartzImpl task = getTask(taskOid(TEST_NAME), result); AssertJUnit.assertNotNull(task); - logger.trace("Task retrieval OK."); + LOGGER.trace("Task retrieval OK."); // We need to wait for a sync interval, so the task scanner has a chance // to pick up this @@ -465,7 +465,7 @@ public void test005Single() throws Exception { waitForTaskClose(taskOid(TEST_NAME), result, 10000, 1000); - logger.info("... done"); + LOGGER.info("... done"); // Check task status @@ -1306,16 +1306,19 @@ public void test100LightweightSubtasks() throws Exception { addObjectFromFile(taskFilename(TEST_NAME)); - Task task = getTask(taskOid(TEST_NAME), result); + String taskOid = taskOid(TEST_NAME); + Task task = getTask(taskOid, result); System.out.println("After setup: " + task.debugDump()); - waitForTaskClose(taskOid(TEST_NAME), result, 15000, 500); + checkTaskStateRepeatedly(taskOid, result, 15000, 20); + + waitForTaskClose(taskOid, result, 15000, 500); task.refresh(result); System.out.println("After refresh (task was executed): " + task.debugDump()); - Collection subtasks = parallelTaskHandler.getLastTaskExecuted().getLightweightAsynchronousSubtasks(); + Collection subtasks = parallelTaskHandler.getLastTaskExecuted().getLightweightAsynchronousSubtasks(); assertEquals("Wrong number of subtasks", MockParallelTaskHandler.NUM_SUBTASKS, subtasks.size()); - for (Task subtask : subtasks) { + for (RunningTask subtask : subtasks) { assertEquals("Wrong subtask state", TaskExecutionStatus.CLOSED, subtask.getExecutionStatus()); MockParallelTaskHandler.MyLightweightTaskHandler handler = (MockParallelTaskHandler.MyLightweightTaskHandler) subtask.getLightweightTaskHandler(); assertTrue("Handler has not run", handler.hasRun()); @@ -1323,6 +1326,27 @@ public void test100LightweightSubtasks() throws Exception { } } + private void checkTaskStateRepeatedly(String taskOid, OperationResult result, int duration, int checkInterval) + throws SchemaException, ObjectNotFoundException, InterruptedException { + long start = System.currentTimeMillis(); + while (System.currentTimeMillis() < start + duration) { + Collection> options = schemaHelper.getOperationOptionsBuilder() + .item(TaskType.F_SUBTASK).retrieve() + .build(); + TaskType task = taskManager.getObject(TaskType.class, taskOid, options, result).asObjectable(); + OperationStatsType stats = task.getOperationStats(); + Integer totalSuccessCount = stats != null && stats.getIterativeTaskInformation() != null ? + stats.getIterativeTaskInformation().getTotalSuccessCount() : null; + System.out.println((System.currentTimeMillis()-start) + ": subtasks: " + task.getSubtask().size() + + ", progress = " + task.getProgress() + ", objects = " + totalSuccessCount); + if (task.getExecutionStatus() != TaskExecutionStatusType.RUNNABLE) { + System.out.println("Done. Status = " + task.getExecutionStatus()); + break; + } + Thread.sleep(checkInterval); + } + } + @Test public void test105LightweightSubtasksSuspension() throws Exception { final String TEST_NAME = "test105LightweightSubtasksSuspension"; @@ -1345,7 +1369,8 @@ public void test105LightweightSubtasksSuspension() throws Exception { JobExecutionContext found = null; for (JobExecutionContext jobExecutionContext : jobExecutionContexts) { if (task.getOid().equals(jobExecutionContext.getJobDetail().getKey().getName())) { - found = jobExecutionContext; break; + found = jobExecutionContext; + break; } } assertNotNull("Job for the task was not found", found); @@ -1361,9 +1386,9 @@ public void test105LightweightSubtasksSuspension() throws Exception { AssertJUnit.assertTrue("Task is not stopped", stopped); AssertJUnit.assertEquals("Task is not suspended", TaskExecutionStatus.SUSPENDED, task.getExecutionStatus()); - Collection subtasks = parallelTaskHandler.getLastTaskExecuted().getLightweightAsynchronousSubtasks(); + Collection subtasks = parallelTaskHandler.getLastTaskExecuted().getLightweightAsynchronousSubtasks(); assertEquals("Wrong number of subtasks", MockParallelTaskHandler.NUM_SUBTASKS, subtasks.size()); - for (Task subtask : subtasks) { + for (RunningTask subtask : subtasks) { assertEquals("Wrong subtask state", TaskExecutionStatus.CLOSED, subtask.getExecutionStatus()); MockParallelTaskHandler.MyLightweightTaskHandler handler = (MockParallelTaskHandler.MyLightweightTaskHandler) subtask.getLightweightTaskHandler(); assertTrue("Handler has not run", handler.hasRun()); diff --git a/repo/task-quartz-impl/src/test/java/com/evolveum/midpoint/task/quartzimpl/TestWorkDistribution.java b/repo/task-quartz-impl/src/test/java/com/evolveum/midpoint/task/quartzimpl/TestWorkDistribution.java index ee5f3135a30..a38ec20ba65 100644 --- a/repo/task-quartz-impl/src/test/java/com/evolveum/midpoint/task/quartzimpl/TestWorkDistribution.java +++ b/repo/task-quartz-impl/src/test/java/com/evolveum/midpoint/task/quartzimpl/TestWorkDistribution.java @@ -144,9 +144,9 @@ public void test100AllocateBucket() throws Exception { display("worker task after", workerAfter); assertNumericBucket(bucket, null, 1, 0, 1000); - List wBuckets = workerAfter.getTaskType().getWorkState().getBucket(); + List wBuckets = workerAfter.getWorkState().getBucket(); assertNumericBucket(wBuckets.get(0), WorkBucketStateType.READY, 1, 0, 1000); - List cBuckets = coordinatorAfter.getTaskType().getWorkState().getBucket(); + List cBuckets = coordinatorAfter.getWorkState().getBucket(); assertNumericBucket(cBuckets.get(0), WorkBucketStateType.DELEGATED, 1, 0, 1000); assertNumberOfBuckets(coordinatorAfter, 100); @@ -173,7 +173,7 @@ public void test105AllocateBucketStandalone() throws Exception { TaskQuartzImpl standaloneAfter = taskManager.getTask(standalone.getOid(), result); display("task after", standaloneAfter); - List wBuckets = standaloneAfter.getTaskType().getWorkState().getBucket(); + List wBuckets = standaloneAfter.getWorkState().getBucket(); assertEquals("Wrong # of buckets", 1, wBuckets.size()); assertBucket(wBuckets.get(0), WorkBucketStateType.READY, 1); assertNull(wBuckets.get(0).getContent()); @@ -200,7 +200,7 @@ public void test107AllocateBucketStandaloneBatched() throws Exception { TaskQuartzImpl standaloneAfter = taskManager.getTask(standalone.getOid(), result); display("task after", standaloneAfter); - List wBuckets = standaloneAfter.getTaskType().getWorkState().getBucket(); + List wBuckets = standaloneAfter.getWorkState().getBucket(); assertEquals("Wrong # of buckets", 7, wBuckets.size()); assertBucket(wBuckets.get(0), WorkBucketStateType.READY, 1); assertNumberOfBuckets(standaloneAfter, 1000); @@ -342,7 +342,7 @@ public void test130AllocateReleaseCompleteSequence() throws Exception { assertNumericBucket(bucket3, null, 3, 2, 3); assertNumericBucket(bucket4, null, 4, 3, 4); assertNumericBucket(bucket4a, null, 4, 3, 4); - List buckets = new ArrayList<>(coordinator.getTaskType().getWorkState().getBucket()); + List buckets = new ArrayList<>(coordinator.getWorkState().getBucket()); sortBucketsBySequentialNumber(buckets); assertEquals(5, buckets.size()); assertNumericBucket(buckets.get(0), WorkBucketStateType.DELEGATED, 1, 0, 1); @@ -351,16 +351,16 @@ public void test130AllocateReleaseCompleteSequence() throws Exception { assertNumericBucket(buckets.get(3), WorkBucketStateType.DELEGATED, 4, 3, 4); assertNumericBucket(buckets.get(4), WorkBucketStateType.READY, 5, 4, 5); // pre-created - buckets = new ArrayList<>(worker1.getTaskType().getWorkState().getBucket()); + buckets = new ArrayList<>(worker1.getWorkState().getBucket()); assertEquals(1, buckets.size()); assertNumericBucket(buckets.get(0), WorkBucketStateType.READY, 1, 0, 1); - buckets = new ArrayList<>(worker2.getTaskType().getWorkState().getBucket()); + buckets = new ArrayList<>(worker2.getWorkState().getBucket()); assertEquals(1, buckets.size()); assertNumericBucket(buckets.get(0), WorkBucketStateType.READY, 2, 1, 2); - buckets = new ArrayList<>(worker3.getTaskType().getWorkState().getBucket()); + buckets = new ArrayList<>(worker3.getWorkState().getBucket()); assertEquals(1, buckets.size()); assertNumericBucket(buckets.get(0), WorkBucketStateType.READY, 3, 2, 3); - buckets = new ArrayList<>(worker4.getTaskType().getWorkState().getBucket()); + buckets = new ArrayList<>(worker4.getWorkState().getBucket()); assertEquals(1, buckets.size()); assertNumericBucket(buckets.get(0), WorkBucketStateType.READY, 4, 3, 4); @@ -373,7 +373,7 @@ public void test130AllocateReleaseCompleteSequence() throws Exception { coordinator = taskManager.getTask(coordinator.getOid(), result); display("coordinator after completion of 2nd bucket", coordinator); - buckets = new ArrayList<>(coordinator.getTaskType().getWorkState().getBucket()); + buckets = new ArrayList<>(coordinator.getWorkState().getBucket()); sortBucketsBySequentialNumber(buckets); assertEquals(5, buckets.size()); @@ -383,7 +383,7 @@ public void test130AllocateReleaseCompleteSequence() throws Exception { assertNumericBucket(buckets.get(3), WorkBucketStateType.DELEGATED, 4, 3, 4); assertNumericBucket(buckets.get(4), WorkBucketStateType.READY, 5, 4, 5); // pre-created - assertNoWorkBuckets(worker2.getTaskType().getWorkState()); + assertNoWorkBuckets(worker2.getWorkState()); // WHEN workStateManager.completeWorkBucket(worker1.getOid(), 1, result); @@ -406,7 +406,7 @@ public void test130AllocateReleaseCompleteSequence() throws Exception { assertNumericBucket(buckets.get(2), WorkBucketStateType.DELEGATED, 4, 3, 4); assertNumericBucket(buckets.get(3), WorkBucketStateType.DELEGATED, 5, 4, 5); - buckets = new ArrayList<>(worker1.getTaskType().getWorkState().getBucket()); + buckets = new ArrayList<>(worker1.getWorkState().getBucket()); assertEquals(1, buckets.size()); assertNumericBucket(buckets.get(0), WorkBucketStateType.READY, 5, 4, 5); @@ -426,7 +426,7 @@ public void test130AllocateReleaseCompleteSequence() throws Exception { coordinator = taskManager.getTask(coordinator.getOid(), result); display("coordinator after releasing of 4th bucket", coordinator); - buckets = new ArrayList<>(coordinator.getTaskType().getWorkState().getBucket()); + buckets = new ArrayList<>(coordinator.getWorkState().getBucket()); sortBucketsBySequentialNumber(buckets); assertEquals(4, buckets.size()); @@ -435,7 +435,7 @@ public void test130AllocateReleaseCompleteSequence() throws Exception { assertNumericBucket(buckets.get(2), WorkBucketStateType.READY, 4, 3, 4); assertNumericBucket(buckets.get(3), WorkBucketStateType.DELEGATED, 5, 4, 5); - assertNoWorkBuckets(worker4.getTaskType().getWorkState()); + assertNoWorkBuckets(worker4.getWorkState()); // WHEN workStateManager.completeWorkBucket(worker3.getOid(), 3, result); @@ -458,7 +458,7 @@ public void test130AllocateReleaseCompleteSequence() throws Exception { assertNumericBucket(buckets.get(1), WorkBucketStateType.DELEGATED, 4, 3, 4); assertNumericBucket(buckets.get(2), WorkBucketStateType.DELEGATED, 5, 4, 5); - assertNoWorkBuckets(worker3.getTaskType().getWorkState()); + assertNoWorkBuckets(worker3.getWorkState()); buckets = new ArrayList<>(worker5.getWorkState().getBucket()); assertEquals(1, buckets.size()); @@ -476,12 +476,12 @@ public void test130AllocateReleaseCompleteSequence() throws Exception { coordinator = taskManager.getTask(coordinator.getOid(), result); display("coordinator after completion of 5th bucket and closing worker5", coordinator); - buckets = new ArrayList<>(coordinator.getTaskType().getWorkState().getBucket()); + buckets = new ArrayList<>(coordinator.getWorkState().getBucket()); assertEquals(2, buckets.size()); assertNumericBucket(buckets.get(0), WorkBucketStateType.DELEGATED, 4, 3, 4); assertNumericBucket(buckets.get(1), WorkBucketStateType.COMPLETE, 5, 4, 5); - assertNoWorkBuckets(worker1.getTaskType().getWorkState()); + assertNoWorkBuckets(worker1.getWorkState()); // WHEN bucket = workStateManager.getWorkBucket(worker1.getOid(), 100, null, result); @@ -494,7 +494,7 @@ public void test130AllocateReleaseCompleteSequence() throws Exception { assertNumericBucket(bucket, null, 4, 3, 4); - buckets = new ArrayList<>(coordinator.getTaskType().getWorkState().getBucket()); + buckets = new ArrayList<>(coordinator.getWorkState().getBucket()); assertEquals(2, buckets.size()); assertNumericBucket(buckets.get(0), WorkBucketStateType.DELEGATED, 4, 3, 4); assertNumericBucket(buckets.get(1), WorkBucketStateType.COMPLETE, 5, 4, 5); @@ -512,11 +512,11 @@ public void test130AllocateReleaseCompleteSequence() throws Exception { coordinator = taskManager.getTask(coordinator.getOid(), result); display("coordinator after completion of 4th bucket", coordinator); - buckets = new ArrayList<>(coordinator.getTaskType().getWorkState().getBucket()); + buckets = new ArrayList<>(coordinator.getWorkState().getBucket()); assertEquals(1, buckets.size()); assertNumericBucket(buckets.get(0), WorkBucketStateType.COMPLETE, 5, 4, 5); - assertNoWorkBuckets(worker1.getTaskType().getWorkState()); + assertNoWorkBuckets(worker1.getWorkState()); } finally { suspendAndDeleteTasks(coordinatorTaskOid(TEST_NAME)); } diff --git a/repo/task-quartz-impl/src/test/resources/basic/task-100LightweightSubtasks.xml b/repo/task-quartz-impl/src/test/resources/basic/task-100LightweightSubtasks.xml index 17cc1096725..8880d6aa2ce 100644 --- a/repo/task-quartz-impl/src/test/resources/basic/task-100LightweightSubtasks.xml +++ b/repo/task-quartz-impl/src/test/resources/basic/task-100LightweightSubtasks.xml @@ -28,7 +28,7 @@ Testing single task 0100 - 500 + 3000 91919191-76e0-59e2-86d6-3d4f02d30100 From 2140665202bd586df90b371644468205086ef18b Mon Sep 17 00:00:00 2001 From: Pavol Mederly Date: Fri, 15 Feb 2019 15:20:14 +0100 Subject: [PATCH 036/224] Fix memory leak in tests --- .../midpoint/task/quartzimpl/TaskManagerQuartzImpl.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/TaskManagerQuartzImpl.java b/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/TaskManagerQuartzImpl.java index 35f512919f7..2b68c25f2ae 100644 --- a/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/TaskManagerQuartzImpl.java +++ b/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/TaskManagerQuartzImpl.java @@ -240,7 +240,12 @@ public void init() { } } - @Override + @PreDestroy + public void destroy() { + systemConfigurationChangeDispatcher.unregisterListener(this); + } + + @Override public void postInit(OperationResult parentResult) { OperationResult result = parentResult.createSubresult(DOT_IMPL_CLASS + "postInit"); From a559b2e659d8f2282ee3a9107597461fcb0d57ea Mon Sep 17 00:00:00 2001 From: Pavol Mederly Date: Fri, 15 Feb 2019 16:58:33 +0100 Subject: [PATCH 037/224] Fix compilation issues after merging --- .../repo/common/task/AbstractSearchIterativeResultHandler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/repo/repo-common/src/main/java/com/evolveum/midpoint/repo/common/task/AbstractSearchIterativeResultHandler.java b/repo/repo-common/src/main/java/com/evolveum/midpoint/repo/common/task/AbstractSearchIterativeResultHandler.java index a38c6dd14a6..ff21d0471bb 100644 --- a/repo/repo-common/src/main/java/com/evolveum/midpoint/repo/common/task/AbstractSearchIterativeResultHandler.java +++ b/repo/repo-common/src/main/java/com/evolveum/midpoint/repo/common/task/AbstractSearchIterativeResultHandler.java @@ -99,7 +99,7 @@ public AbstractSearchIterativeResultHandler(RunningTask coordinatorTask, String this(coordinatorTask, taskOperationPrefix, processShortName, contextDesc, null, taskManager); } - public AbstractSearchIterativeResultHandler(Task coordinatorTask, String taskOperationPrefix, String processShortName, + public AbstractSearchIterativeResultHandler(RunningTask coordinatorTask, String taskOperationPrefix, String processShortName, String contextDesc, TaskStageType taskStageType, TaskManager taskManager) { super(); this.coordinatorTask = coordinatorTask; From d0eb77e88b350a89d17f07841be954b78c5de42a Mon Sep 17 00:00:00 2001 From: Pavol Mederly Date: Fri, 15 Feb 2019 19:36:33 +0100 Subject: [PATCH 038/224] Adapt CleanupTest to fix for MID-5033 (only tasks that are closed can be cleaned up) --- .../src/test/resources/basic/tasks-for-cleanup.xml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/repo/task-quartz-impl/src/test/resources/basic/tasks-for-cleanup.xml b/repo/task-quartz-impl/src/test/resources/basic/tasks-for-cleanup.xml index 8c3a7b35e48..1a90caf5c3f 100644 --- a/repo/task-quartz-impl/src/test/resources/basic/tasks-for-cleanup.xml +++ b/repo/task-quartz-impl/src/test/resources/basic/tasks-for-cleanup.xml @@ -41,7 +41,7 @@ 1238546 - runnable + closed http://midpoint.evolveum.com/xml/ns/public/model/synchronization/task/live-sync/handler-3 recurring @@ -57,6 +57,7 @@ 1238546-1 1238546 + closed 2013-05-07T10:38:21.350+02:00 @@ -65,6 +66,7 @@ 1238546-2 1238546 + closed 2013-05-07T10:38:21.350+02:00 @@ -76,7 +78,7 @@ 1238547 - runnable + closed http://midpoint.evolveum.com/xml/ns/public/model/synchronization/task/live-sync/handler-3 recurring @@ -94,7 +96,7 @@ 1238548 - runnable + closed http://midpoint.evolveum.com/xml/ns/public/model/synchronization/task/live-sync/handler-3 recurring From c23ee93e92832b6343bd0727c76778401a509c95 Mon Sep 17 00:00:00 2001 From: Pavol Mederly Date: Fri, 15 Feb 2019 22:11:05 +0100 Subject: [PATCH 039/224] Adapt provisioning test (ConnID version) --- .../midpoint/provisioning/impl/TestConnectorManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/impl/TestConnectorManager.java b/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/impl/TestConnectorManager.java index ab471f7cc97..e699e88dcc8 100644 --- a/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/impl/TestConnectorManager.java +++ b/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/impl/TestConnectorManager.java @@ -44,7 +44,7 @@ @DirtiesContext public class TestConnectorManager extends AbstractIntegrationTest { - private static final String CONNID_FRAMEWORK_VERSION = "1.5.0.0"; + private static final String CONNID_FRAMEWORK_VERSION = "1.5.0.8"; @Autowired private ProvisioningService provisioningService; @Autowired private ConnectorManager connectorManager; From bfd8b184db2e757a62bd5fa5a4e7d038eec65c18 Mon Sep 17 00:00:00 2001 From: Pavol Mederly Date: Sat, 16 Feb 2019 07:45:19 +0100 Subject: [PATCH 040/224] Adapt sanity test to changes in task manager --- .../java/com/evolveum/midpoint/testing/sanity/TestSanity.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/sanity/src/test/java/com/evolveum/midpoint/testing/sanity/TestSanity.java b/testing/sanity/src/test/java/com/evolveum/midpoint/testing/sanity/TestSanity.java index 3cf1ca7cff1..5d4cf8bad38 100644 --- a/testing/sanity/src/test/java/com/evolveum/midpoint/testing/sanity/TestSanity.java +++ b/testing/sanity/src/test/java/com/evolveum/midpoint/testing/sanity/TestSanity.java @@ -3985,7 +3985,7 @@ public void timeout() { } }, 10000); AssertJUnit.assertEquals("Some tasks left running after shutdown", new HashSet(), - taskManager.getLocallyRunningTasks(new OperationResult("dummy"))); + new HashSet<>(taskManager.getLocallyRunningTasks(new OperationResult("dummy")))); } // TODO: test for missing/corrupt system configuration From 1f736ad3f6ea275dbc57e97bda71518ff74106a4 Mon Sep 17 00:00:00 2001 From: kate Date: Mon, 18 Feb 2019 13:08:40 +0100 Subject: [PATCH 041/224] summary panel little clean up --- .../web/component/FocusSummaryPanel.java | 6 +- .../web/component/util/SummaryTag.java | 27 ++-- .../web/component/util/SummaryTagSimple.html | 19 --- .../web/component/util/SummaryTagSimple.java | 135 ------------------ .../admin/resources/ResourceSummaryPanel.java | 12 +- .../page/admin/server/TaskSummaryPanel.java | 10 +- .../users/component/UserSummaryPanel.java | 15 +- .../admin/workflow/WorkItemSummaryPanel.java | 4 +- 8 files changed, 33 insertions(+), 195 deletions(-) delete mode 100644 gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/util/SummaryTagSimple.html delete mode 100644 gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/util/SummaryTagSimple.java diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/FocusSummaryPanel.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/FocusSummaryPanel.java index 6a54f76f993..1fc73c79bc7 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/FocusSummaryPanel.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/FocusSummaryPanel.java @@ -59,13 +59,13 @@ public FocusSummaryPanel(String id, Class type, final IModel this.wrapperModel = model; initLayoutCommon(serviceLocator); // calls getParentOrgModel that depends on wrapperModel - SummaryTag tagActivation = new SummaryTag(ID_ACTIVATION_TAG, model) { + SummaryTag tagActivation = new SummaryTag(ID_ACTIVATION_TAG, Model.of(model.getObject().getObject().asObjectable())) { private static final long serialVersionUID = 1L; @Override - protected void initialize(ObjectWrapper wrapper) { + protected void initialize(O object) { ActivationType activation = null; - O object = wrapper.getObject().asObjectable(); +// O object = object.asObjectable(); if (object instanceof FocusType) { activation = ((FocusType)object).getActivation(); } diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/util/SummaryTag.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/util/SummaryTag.java index 35c1c9dd6a7..6096ed54d9d 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/util/SummaryTag.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/util/SummaryTag.java @@ -15,6 +15,7 @@ */ package com.evolveum.midpoint.web.component.util; +import com.evolveum.midpoint.prism.Containerable; import org.apache.wicket.AttributeModifier; import org.apache.wicket.markup.html.basic.Label; import org.apache.wicket.markup.html.panel.Panel; @@ -22,13 +23,12 @@ import com.evolveum.midpoint.web.component.prism.ObjectWrapper; import com.evolveum.midpoint.web.model.ReadOnlyWrapperModel; -import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType; /** * @author semancik * */ -public abstract class SummaryTag extends Panel { +public abstract class SummaryTag extends Panel { private static final String ID_TAG_ICON = "summaryTagIcon"; private static final String ID_TAG_LABEL = "summaryTagLabel"; @@ -40,11 +40,11 @@ public abstract class SummaryTag extends Panel { private String color = null; private boolean hideTag = false; - public SummaryTag(String id, final IModel> model) { + public SummaryTag(String id, final IModel model) { super(id, model); Label tagIcon = new Label(ID_TAG_ICON, ""); - tagIcon.add(new AttributeModifier("class", new SummaryTagWrapperModel(model) { + tagIcon.add(new AttributeModifier("class", new SummaryTagModel(model) { @Override protected String getValue() { return getIconCssClass(); @@ -52,14 +52,14 @@ protected String getValue() { })); add(tagIcon); - add(new Label(ID_TAG_LABEL, new SummaryTagWrapperModel(model) { + add(new Label(ID_TAG_LABEL, new SummaryTagModel(model) { @Override protected String getValue() { return getLabel(); } })); - add(new AttributeModifier("style", new SummaryTagWrapperModel(model) { + add(new AttributeModifier("style", new SummaryTagModel(model) { @Override protected String getValue() { if (getColor() == null) { @@ -69,7 +69,7 @@ protected String getValue() { } })); - add(new AttributeModifier("class", new SummaryTagWrapperModel(model) { + add(new AttributeModifier("class", new SummaryTagModel(model) { @Override protected String getValue() { return getCssClass(); @@ -127,18 +127,20 @@ public void setHideTag(boolean hideTag) { this.hideTag = hideTag; } - protected abstract void initialize(ObjectWrapper objectWrapper); + protected abstract void initialize(C objectWrapper); - abstract class SummaryTagWrapperModel extends ReadOnlyWrapperModel { + abstract class SummaryTagModel implements IModel { - public SummaryTagWrapperModel(IModel> wrapperModel) { - super(wrapperModel); + IModel objectModel; + + public SummaryTagModel(IModel objectModel) { + this.objectModel = objectModel; } @Override public T getObject() { if (!initialized) { - initialize(getWrapper()); + initialize(objectModel.getObject()); } return getValue(); } @@ -146,4 +148,5 @@ public T getObject() { protected abstract T getValue(); } + } diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/util/SummaryTagSimple.html b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/util/SummaryTagSimple.html deleted file mode 100644 index c99809c4bcf..00000000000 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/util/SummaryTagSimple.html +++ /dev/null @@ -1,19 +0,0 @@ - - - - - \ No newline at end of file diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/util/SummaryTagSimple.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/util/SummaryTagSimple.java deleted file mode 100644 index d2cb1ce13fb..00000000000 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/util/SummaryTagSimple.java +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Copyright (c) 2010-2017 Evolveum - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.evolveum.midpoint.web.component.util; - -import com.evolveum.midpoint.prism.Containerable; -import org.apache.wicket.AttributeModifier; -import org.apache.wicket.markup.html.basic.Label; -import org.apache.wicket.markup.html.panel.Panel; -import org.apache.wicket.model.IModel; - -/** - * The same as SummaryTag, but based on Containerable model, not ObjectWrapper one. - * TODO fix somehow - * - * @author semancik - * @author mederly - */ -public abstract class SummaryTagSimple extends Panel { - - private static final String ID_TAG_ICON = "summaryTagIcon"; - private static final String ID_TAG_LABEL = "summaryTagLabel"; - - private boolean initialized = false; - private String iconCssClass; - private String label; - private String color = null; - private boolean hideTag = false; - - public SummaryTagSimple(String id, final IModel model) { - super(id, model); - - Label tagIcon = new Label(ID_TAG_ICON, ""); - tagIcon.add(new AttributeModifier("class", new SummaryTagModel(model) { - @Override - protected String getValue() { - return getIconCssClass(); - } - })); - add(tagIcon); - - add(new Label(ID_TAG_LABEL, new SummaryTagModel(model) { - @Override - protected String getValue() { - return getLabel(); - } - })); - - add(new AttributeModifier("style", new SummaryTagModel(model) { - @Override - protected String getValue() { - if (getColor() == null) { - return null; - } - return "color: " + getColor(); - } - })); - - add(new VisibleEnableBehaviour(){ - @Override - public boolean isVisible(){ - if (!initialized) { - initialize(model.getObject()); - } - return !isHideTag(); - } - }); - } - - public String getIconCssClass() { - return iconCssClass; - } - - public void setIconCssClass(String iconCssClass) { - this.iconCssClass = iconCssClass; - } - - public String getLabel() { - return label; - } - - public void setLabel(String label) { - this.label = label; - } - - public String getColor() { - return color; - } - - public void setColor(String color) { - this.color = color; - } - - public boolean isHideTag() { - return hideTag; - } - - public void setHideTag(boolean hideTag) { - this.hideTag = hideTag; - } - - protected abstract void initialize(C object); - - abstract class SummaryTagModel implements IModel { - - IModel objectModel; - - public SummaryTagModel(IModel objectModel) { - this.objectModel = objectModel; - } - - @Override - public T getObject() { - if (!initialized) { - initialize(objectModel.getObject()); - } - return getValue(); - } - - protected abstract T getValue(); - - } -} diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/resources/ResourceSummaryPanel.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/resources/ResourceSummaryPanel.java index f73603d1fbe..8f13739d28e 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/resources/ResourceSummaryPanel.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/resources/ResourceSummaryPanel.java @@ -15,26 +15,16 @@ */ package com.evolveum.midpoint.web.page.admin.resources; -import org.apache.wicket.markup.html.basic.Label; import org.apache.wicket.model.IModel; -import org.apache.wicket.model.Model; import com.evolveum.midpoint.gui.api.GuiStyleConstants; import com.evolveum.midpoint.gui.api.util.ModelServiceLocator; import com.evolveum.midpoint.prism.PrismObject; import com.evolveum.midpoint.schema.util.ResourceTypeUtil; import com.evolveum.midpoint.web.component.ObjectSummaryPanel; -import com.evolveum.midpoint.web.component.prism.ContainerStatus; -import com.evolveum.midpoint.web.component.prism.ObjectWrapper; -import com.evolveum.midpoint.web.component.util.ObjectWrapperUtil; import com.evolveum.midpoint.web.component.util.SummaryTag; -import com.evolveum.midpoint.web.component.util.SummaryTagSimple; import com.evolveum.midpoint.web.model.ContainerableFromPrismObjectModel; -import com.evolveum.midpoint.xml.ns._public.common.common_3.ActivationStatusType; -import com.evolveum.midpoint.xml.ns._public.common.common_3.ActivationType; -import com.evolveum.midpoint.xml.ns._public.common.common_3.FocusType; import com.evolveum.midpoint.xml.ns._public.common.common_3.ResourceType; -import com.evolveum.midpoint.xml.ns._public.common.common_3.TaskType; public class ResourceSummaryPanel extends ObjectSummaryPanel { private static final long serialVersionUID = 1L; @@ -53,7 +43,7 @@ protected void onBeforeRender() { super.onBeforeRender(); boolean down = ResourceTypeUtil.isDown(model.getObject().asObjectable()); IModel containerModel = new ContainerableFromPrismObjectModel<>(model); - SummaryTagSimple summaryTag = new SummaryTagSimple(ID_UP_DOWN_TAG, containerModel) { + SummaryTag summaryTag = new SummaryTag(ID_UP_DOWN_TAG, containerModel) { private static final long serialVersionUID = 1L; @Override diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/server/TaskSummaryPanel.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/server/TaskSummaryPanel.java index 65149c2bbc7..3e6764215b8 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/server/TaskSummaryPanel.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/server/TaskSummaryPanel.java @@ -22,11 +22,10 @@ import com.evolveum.midpoint.prism.PrismObject; import com.evolveum.midpoint.prism.xml.XmlTypeConverter; import com.evolveum.midpoint.schema.util.WfContextUtil; -import com.evolveum.midpoint.web.component.DateLabelComponent; import com.evolveum.midpoint.web.component.ObjectSummaryPanel; import com.evolveum.midpoint.web.component.refresh.AutoRefreshDto; import com.evolveum.midpoint.web.component.refresh.AutoRefreshPanel; -import com.evolveum.midpoint.web.component.util.SummaryTagSimple; +import com.evolveum.midpoint.web.component.util.SummaryTag; import com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour; import com.evolveum.midpoint.web.component.wf.WfGuiUtil; import com.evolveum.midpoint.web.model.ContainerableFromPrismObjectModel; @@ -36,7 +35,6 @@ import com.evolveum.midpoint.web.page.admin.server.dto.TaskDtoExecutionStatus; import com.evolveum.midpoint.xml.ns._public.common.common_3.*; import org.apache.commons.lang3.time.DurationFormatUtils; -import org.apache.wicket.datetime.PatternDateConverter; import org.apache.wicket.model.IModel; import java.util.Date; @@ -62,7 +60,7 @@ public TaskSummaryPanel(String id, IModel> model, IModel containerModel = new ContainerableFromPrismObjectModel<>(model); - SummaryTagSimple tagExecutionStatus = new SummaryTagSimple(ID_TAG_EXECUTION_STATUS, containerModel) { + SummaryTag tagExecutionStatus = new SummaryTag(ID_TAG_EXECUTION_STATUS, containerModel) { @Override protected void initialize(TaskType taskType) { TaskDtoExecutionStatus status = TaskDtoExecutionStatus.fromTaskExecutionStatus(taskType.getExecutionStatus(), taskType.getNodeAsObserved() != null); @@ -76,7 +74,7 @@ protected void initialize(TaskType taskType) { }; addTag(tagExecutionStatus); - SummaryTagSimple tagResult = new SummaryTagSimple(ID_TAG_RESULT, containerModel) { + SummaryTag tagResult = new SummaryTag(ID_TAG_RESULT, containerModel) { @Override protected void initialize(TaskType taskType) { OperationResultStatusType resultStatus = taskType.getResultStatus(); @@ -90,7 +88,7 @@ protected void initialize(TaskType taskType) { }; addTag(tagResult); - SummaryTagSimple tagOutcome = new SummaryTagSimple(ID_TAG_WF_OUTCOME, containerModel) { + SummaryTag tagOutcome = new SummaryTag(ID_TAG_WF_OUTCOME, containerModel) { @Override protected void initialize(TaskType taskType) { String icon, name; diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/users/component/UserSummaryPanel.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/users/component/UserSummaryPanel.java index d36b0c29ec2..19ac7507c59 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/users/component/UserSummaryPanel.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/users/component/UserSummaryPanel.java @@ -32,6 +32,7 @@ import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectReferenceType; import com.evolveum.midpoint.xml.ns._public.common.common_3.SystemObjectsType; import com.evolveum.midpoint.xml.ns._public.common.common_3.UserType; +import org.apache.wicket.model.Model; /** * @author semancik @@ -46,12 +47,12 @@ public class UserSummaryPanel extends FocusSummaryPanel { public UserSummaryPanel(String id, IModel> model, ModelServiceLocator serviceLocator) { super(id, UserType.class, model, serviceLocator); - SummaryTag tagSecurity = new SummaryTag(ID_TAG_SECURITY, model) { + SummaryTag tagSecurity = new SummaryTag(ID_TAG_SECURITY, Model.of(model.getObject().getObject().asObjectable())) { private static final long serialVersionUID = 1L; @Override - protected void initialize(ObjectWrapper wrapper) { - List assignments = wrapper.getObject().asObjectable().getAssignment(); + protected void initialize(UserType object) { + List assignments = object.getAssignment(); if (assignments.isEmpty()) { setIconCssClass(GuiStyleConstants.CLASS_ICON_NO_OBJECTS); setLabel(getString("user.noAssignments")); @@ -89,12 +90,12 @@ protected void initialize(ObjectWrapper wrapper) { }; addTag(tagSecurity); - SummaryTag tagOrg = new SummaryTag(ID_TAG_ORG, model) { + SummaryTag tagOrg = new SummaryTag(ID_TAG_ORG, Model.of(model.getObject().getObject().asObjectable())) { private static final long serialVersionUID = 1L; @Override - protected void initialize(ObjectWrapper wrapper) { - List parentOrgRefs = wrapper.getObject().asObjectable().getParentOrgRef(); + protected void initialize(UserType object) { + List parentOrgRefs = object.getParentOrgRef(); if (parentOrgRefs.isEmpty()) { setIconCssClass(GuiStyleConstants.CLASS_ICON_NO_OBJECTS); setLabel(getString("user.noOrgs")); @@ -103,7 +104,7 @@ protected void initialize(ObjectWrapper wrapper) { } boolean isManager = false; boolean isMember = false; - for (ObjectReferenceType parentOrgRef: wrapper.getObject().asObjectable().getParentOrgRef()) { + for (ObjectReferenceType parentOrgRef: object.getParentOrgRef()) { if (WebComponentUtil.isManagerRelation(parentOrgRef.getRelation())) { isManager = true; } else { diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/workflow/WorkItemSummaryPanel.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/workflow/WorkItemSummaryPanel.java index 144e93bb256..e40ac22e71e 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/workflow/WorkItemSummaryPanel.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/workflow/WorkItemSummaryPanel.java @@ -21,7 +21,7 @@ import com.evolveum.midpoint.gui.api.util.WebComponentUtil; import com.evolveum.midpoint.schema.util.WfContextUtil; import com.evolveum.midpoint.web.component.AbstractSummaryPanel; -import com.evolveum.midpoint.web.component.util.SummaryTagSimple; +import com.evolveum.midpoint.web.component.util.SummaryTag; import com.evolveum.midpoint.web.component.wf.WfGuiUtil; import com.evolveum.midpoint.web.page.admin.workflow.dto.WorkItemDto; import com.evolveum.midpoint.xml.ns._public.common.common_3.UserType; @@ -47,7 +47,7 @@ public WorkItemSummaryPanel(String id, IModel model, IModel isAssignedTag = new SummaryTagSimple(ID_ASSIGNED_TAG, model) { + SummaryTag isAssignedTag = new SummaryTag(ID_ASSIGNED_TAG, model) { @Override protected void initialize(WorkItemType workItem) { if (workItem.getAssigneeRef() != null) { From 736468f8d9bffc26f47f7c0349f2018a343946cd Mon Sep 17 00:00:00 2001 From: kate Date: Mon, 18 Feb 2019 14:51:53 +0100 Subject: [PATCH 042/224] subscription id fix --- .../com/evolveum/midpoint/gui/api/util/WebComponentUtil.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/gui/api/util/WebComponentUtil.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/gui/api/util/WebComponentUtil.java index 7758c5f4b75..0a0f0e6876a 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/gui/api/util/WebComponentUtil.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/gui/api/util/WebComponentUtil.java @@ -2556,8 +2556,11 @@ public static boolean isSubscriptionIdCorrect(String subscriptionId){ String expDateStr = subscriptionId.substring(2, 6); dateFormat = new SimpleDateFormat("MMyy"); Date expDate = dateFormat.parse(expDateStr); + Calendar expireCalendarValue = Calendar.getInstance(); + expireCalendarValue.setTime(expDate); + expireCalendarValue.add(Calendar.MONTH, 1); Date currentDate = new Date(System.currentTimeMillis()); - if (expDate.before(currentDate)) { + if (expireCalendarValue.getTime().before(currentDate) || expireCalendarValue.getTime().equals(currentDate)) { return false; } } catch (Exception ex) { From 5d8fc7ddd3df6888570245065a42c69cc6fe0c0e Mon Sep 17 00:00:00 2001 From: kate Date: Mon, 18 Feb 2019 23:53:23 +0100 Subject: [PATCH 043/224] summary panel refactoring, not finished --- .../gui/api/util/WebComponentUtil.java | 10 ++ .../SystemConfigurationSummaryPanel.java | 3 +- .../web/component/AbstractSummaryPanel.java | 53 ++++++---- .../web/component/FocusSummaryPanel.java | 63 ++++++------ .../web/component/ObjectSummaryPanel.java | 4 +- .../component/data/column/ColumnUtils.java | 13 +-- .../CertDefinitionSummaryPanel.java | 3 +- .../PageSystemConfiguration.java | 2 +- .../page/admin/resources/PageResource.java | 3 +- .../admin/resources/ResourceSummaryPanel.java | 13 +-- .../admin/resources/ShadowSummaryPanel.java | 4 +- .../web/page/admin/roles/PageRole.java | 3 +- .../roles/component/RoleSummaryPanel.java | 2 +- .../web/page/admin/server/PageTaskEdit.java | 97 +++++++++---------- .../page/admin/server/TaskSummaryPanel.java | 17 ++-- .../web/page/admin/services/PageService.java | 2 +- .../web/page/admin/users/PageOrgUnit.java | 2 +- .../web/page/admin/users/PageUser.java | 3 +- .../users/component/OrgSummaryPanel.java | 2 +- .../users/component/ServiceSummaryPanel.java | 2 +- .../users/component/UserSummaryPanel.java | 10 +- .../admin/valuePolicy/PageValuePolicy.java | 3 +- .../component/ValuePolicySummaryPanel.java | 3 +- .../admin/workflow/WorkItemSummaryPanel.java | 9 +- 24 files changed, 171 insertions(+), 155 deletions(-) diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/gui/api/util/WebComponentUtil.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/gui/api/util/WebComponentUtil.java index 0a0f0e6876a..fc952e89330 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/gui/api/util/WebComponentUtil.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/gui/api/util/WebComponentUtil.java @@ -3154,6 +3154,16 @@ public static DisplayType createDisplayType(String iconCssClass, String iconColo return displayType; } + public static DisplayType getArchetypePolicyDisplayType(O object, PageBase pageBase) { + if (object != null) { + ArchetypePolicyType archetypePolicy = WebComponentUtil.getArchetypeSpecification(object.asPrismObject(), pageBase); + if (archetypePolicy != null) { + return archetypePolicy.getDisplay(); + } + } + return null; + } + public static IModel getIconUrlModel(IconType icon){ if (icon == null || StringUtils.isEmpty(icon.getImageUrl())){ return Model.of(); diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/gui/impl/page/admin/configuration/component/SystemConfigurationSummaryPanel.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/gui/impl/page/admin/configuration/component/SystemConfigurationSummaryPanel.java index 35d68a7692f..26868f1b90a 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/gui/impl/page/admin/configuration/component/SystemConfigurationSummaryPanel.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/gui/impl/page/admin/configuration/component/SystemConfigurationSummaryPanel.java @@ -12,9 +12,8 @@ public class SystemConfigurationSummaryPanel extends ObjectSummaryPanel> model, ModelServiceLocator serviceLocator) { + public SystemConfigurationSummaryPanel(String id, Class type, IModel model, ModelServiceLocator serviceLocator) { super(id, type, model, serviceLocator); - initLayoutCommon(serviceLocator); } @Override diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/AbstractSummaryPanel.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/AbstractSummaryPanel.java index e003a3a398b..0f884e5a28a 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/AbstractSummaryPanel.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/AbstractSummaryPanel.java @@ -17,17 +17,16 @@ import com.evolveum.midpoint.gui.api.component.BasePanel; import com.evolveum.midpoint.gui.api.util.ModelServiceLocator; +import com.evolveum.midpoint.gui.api.util.WebComponentUtil; import com.evolveum.midpoint.gui.impl.model.FlexibleLabelModel; import com.evolveum.midpoint.prism.Containerable; import com.evolveum.midpoint.prism.PrismContainer; import com.evolveum.midpoint.prism.path.ItemName; import com.evolveum.midpoint.repo.common.expression.ExpressionVariables; import com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour; -import com.evolveum.midpoint.xml.ns._public.common.common_3.FocusType; -import com.evolveum.midpoint.xml.ns._public.common.common_3.GuiFlexibleLabelType; -import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType; -import com.evolveum.midpoint.xml.ns._public.common.common_3.SummaryPanelSpecificationType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.*; +import org.apache.commons.lang.StringUtils; import org.apache.wicket.AttributeModifier; import org.apache.wicket.Component; import org.apache.wicket.markup.html.WebMarkupContainer; @@ -69,13 +68,15 @@ public abstract class AbstractSummaryPanel extends Base protected WebMarkupContainer tagBox; protected WebMarkupContainer iconBox; - public AbstractSummaryPanel(String id, IModel model, ModelServiceLocator serviceLocator, SummaryPanelSpecificationType configuration) { + public AbstractSummaryPanel(String id, IModel model, SummaryPanelSpecificationType configuration) { super(id, model); this.configuration = configuration; setOutputMarkupId(true); } - protected void initLayoutCommon(ModelServiceLocator serviceLocator) { + @Override + protected void onInitialize() { + super.onInitialize(); box = new WebMarkupContainer(ID_BOX); add(box); @@ -85,13 +86,13 @@ protected void initLayoutCommon(ModelServiceLocator serviceLocator) { if (getDisplayNameModel() != null) { box.add(new Label(ID_DISPLAY_NAME, getDisplayNameModel())); } else if (getDisplayNamePropertyName() != null) { - box.add(new Label(ID_DISPLAY_NAME, createLabelModel(getDisplayNamePropertyName(), SummaryPanelSpecificationType.F_DISPLAY_NAME, serviceLocator))); + box.add(new Label(ID_DISPLAY_NAME, createLabelModel(getDisplayNamePropertyName(), SummaryPanelSpecificationType.F_DISPLAY_NAME))); } else { box.add(new Label(ID_DISPLAY_NAME, " ")); } WebMarkupContainer identifierPanel = new WebMarkupContainer(ID_IDENTIFIER_PANEL); - identifierPanel.add(new Label(ID_IDENTIFIER, createLabelModel(getIdentifierPropertyName(), SummaryPanelSpecificationType.F_IDENTIFIER, serviceLocator))); + identifierPanel.add(new Label(ID_IDENTIFIER, createLabelModel(getIdentifierPropertyName(), SummaryPanelSpecificationType.F_IDENTIFIER))); identifierPanel.add(new VisibleEnableBehaviour() { private static final long serialVersionUID = 1L; @@ -105,7 +106,7 @@ public boolean isVisible() { if (getTitleModel() != null) { box.add(new Label(ID_TITLE, getTitleModel())); } else if (getTitlePropertyName() != null) { - box.add(new Label(ID_TITLE, createLabelModel(getTitlePropertyName(), SummaryPanelSpecificationType.F_TITLE_1, serviceLocator))); + box.add(new Label(ID_TITLE, createLabelModel(getTitlePropertyName(), SummaryPanelSpecificationType.F_TITLE_1))); } else { box.add(new Label(ID_TITLE, " ")); } @@ -113,7 +114,7 @@ public boolean isVisible() { if (getTitle2Model() != null) { box.add(new Label(ID_TITLE2, getTitle2Model())); } else if (getTitle2PropertyName() != null) { - box.add(new Label(ID_TITLE, createLabelModel(getTitle2PropertyName(), SummaryPanelSpecificationType.F_TITLE_2, serviceLocator))); + box.add(new Label(ID_TITLE, createLabelModel(getTitle2PropertyName(), SummaryPanelSpecificationType.F_TITLE_2))); } else { Label label = new Label(ID_TITLE2, " "); label.setVisible(false); @@ -123,14 +124,14 @@ public boolean isVisible() { if (getTitle3Model() != null) { box.add(new Label(ID_TITLE3, getTitle3Model())); } else if (getTitle3PropertyName() != null) { - box.add(new Label(ID_TITLE, createLabelModel(getTitle3PropertyName(), SummaryPanelSpecificationType.F_TITLE_3, serviceLocator))); + box.add(new Label(ID_TITLE, createLabelModel(getTitle3PropertyName(), SummaryPanelSpecificationType.F_TITLE_3))); } else { Label label = new Label(ID_TITLE3, " "); label.setVisible(false); box.add(label); } - final IModel parentOrgModel = getParentOrgModel(serviceLocator); + final IModel parentOrgModel = getParentOrgModel(); Label parentOrgLabel = new Label(ID_ORGANIZATION, parentOrgModel); parentOrgLabel.add(new VisibleEnableBehaviour() { private static final long serialVersionUID = 1L; @@ -144,8 +145,12 @@ public boolean isVisible() { iconBox = new WebMarkupContainer(ID_ICON_BOX); box.add(iconBox); - if (getIconBoxAdditionalCssClass() != null) { - iconBox.add(new AttributeModifier("class", ICON_BOX_CSS_CLASS + " " + getIconBoxAdditionalCssClass())); + String archetypePolicyAdditionalCssClass = getArchetypePolicyAdditionalCssClass(); + String iconAdditionalCssClass = getIconBoxAdditionalCssClass(); + if (StringUtils.isNotEmpty(archetypePolicyAdditionalCssClass)){ + iconBox.add(AttributeModifier.append("style", "color: " + archetypePolicyAdditionalCssClass + ";")); + } else if (StringUtils.isNotEmpty(iconAdditionalCssClass)) { + iconBox.add(new AttributeModifier("class", ICON_BOX_CSS_CLASS + " " + iconAdditionalCssClass)); } Label icon = new Label(ID_ICON, ""); @@ -174,12 +179,12 @@ public boolean isVisible() { box.add(tagBox); } - private FlexibleLabelModel createLabelModel(QName modelPropertyName, QName configurationPropertyName, ModelServiceLocator serviceLocator) { - return createFlexibleLabelModel(modelPropertyName, serviceLocator, getLabelConfiguration(configurationPropertyName)); + private FlexibleLabelModel createLabelModel(QName modelPropertyName, QName configurationPropertyName) { + return createFlexibleLabelModel(modelPropertyName, getLabelConfiguration(configurationPropertyName)); } - private FlexibleLabelModel createFlexibleLabelModel(QName modelPropertyName, ModelServiceLocator serviceLocator, GuiFlexibleLabelType configuration) { - return new FlexibleLabelModel(getModel(), ItemName.fromQName(modelPropertyName), serviceLocator, configuration) { + private FlexibleLabelModel createFlexibleLabelModel(QName modelPropertyName, GuiFlexibleLabelType configuration) { + return new FlexibleLabelModel(getModel(), ItemName.fromQName(modelPropertyName), getPageBase(), configuration) { private static final long serialVersionUID = 1L; @Override protected void addAdditionalExpressionVariables(ExpressionVariables variables) { @@ -217,6 +222,14 @@ public Component getTag(String id) { return tagBox.get(id); } + protected String getArchetypePolicyAdditionalCssClass(){ + if (getModelObject() instanceof ObjectType){ + DisplayType displayType = WebComponentUtil.getArchetypePolicyDisplayType((ObjectType) getModelObject(), getPageBase()); + return WebComponentUtil.getIconColor(displayType); + } + return ""; + } + protected abstract String getIconCssClass(); protected abstract String getIconBoxAdditionalCssClass(); @@ -263,10 +276,10 @@ protected boolean isIdentifierVisible() { return true; } - protected IModel getParentOrgModel(ModelServiceLocator serviceLocator) { + protected IModel getParentOrgModel() { GuiFlexibleLabelType config = getLabelConfiguration(SummaryPanelSpecificationType.F_ORGANIZATION); if (config != null) { - return createFlexibleLabelModel(ObjectType.F_PARENT_ORG_REF, serviceLocator, config); + return createFlexibleLabelModel(ObjectType.F_PARENT_ORG_REF, config); } else { return getDefaltParentOrgModel(); } diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/FocusSummaryPanel.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/FocusSummaryPanel.java index 1fc73c79bc7..1cad2f6d780 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/FocusSummaryPanel.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/FocusSummaryPanel.java @@ -16,6 +16,7 @@ package com.evolveum.midpoint.web.component; import com.evolveum.midpoint.gui.api.GuiStyleConstants; +import com.evolveum.midpoint.gui.api.model.ReadOnlyModel; import com.evolveum.midpoint.gui.api.util.ModelServiceLocator; import com.evolveum.midpoint.prism.PrismObject; import com.evolveum.midpoint.prism.polystring.PolyString; @@ -40,6 +41,7 @@ import org.apache.wicket.request.resource.ByteArrayResource; import java.util.Collection; +import java.util.List; import java.util.stream.Collectors; /** @@ -51,15 +53,19 @@ public abstract class FocusSummaryPanel extends ObjectSumm private static final String ID_ACTIVATION_TAG = "activationTag"; - private IModel> wrapperModel; +// private IModel> wrapperModel; - public FocusSummaryPanel(String id, Class type, final IModel> model, ModelServiceLocator serviceLocator) { - super(id, type, new ReadOnlyPrismObjectFromObjectWrapperModel<>(model), serviceLocator); + public FocusSummaryPanel(String id, Class type, final IModel model, ModelServiceLocator serviceLocator) { + super(id, type, model, serviceLocator); - this.wrapperModel = model; - initLayoutCommon(serviceLocator); // calls getParentOrgModel that depends on wrapperModel +// this.wrapperModel = model; + } + + @Override + protected void onInitialize(){ + super.onInitialize(); - SummaryTag tagActivation = new SummaryTag(ID_ACTIVATION_TAG, Model.of(model.getObject().getObject().asObjectable())) { + SummaryTag tagActivation = new SummaryTag(ID_ACTIVATION_TAG, getModel()) { private static final long serialVersionUID = 1L; @Override @@ -102,34 +108,27 @@ public boolean isVisible() { @Override protected IModel getDefaltParentOrgModel() { - return new ReadOnlyWrapperModel(wrapperModel) { - private static final long serialVersionUID = 1L; - - @Override - public String getObject() { - Collection> parentOrgs = getWrapper().getParentOrgs(); - if (parentOrgs.isEmpty()) { - return ""; - } - // Kinda hack now .. "functional" orgType always has preference - // this whole thing should be driven by an expression later on - for (PrismObject org: parentOrgs) { - OrgType orgType = org.asObjectable(); - if (FocusTypeUtil.determineSubTypes(org).contains("functional")) { - return PolyString.getOrig(orgType.getDisplayName()); - } + return new ReadOnlyModel(() -> { + List parentOrgs = FocusSummaryPanel.this.getModel().getObject().getParentOrg(); + if (parentOrgs.isEmpty()) { + return ""; + } + // Kinda hack now .. "functional" orgType always has preference + // this whole thing should be driven by an expression later on + for (OrgType orgType : parentOrgs) { + if (FocusTypeUtil.determineSubTypes(orgType).contains("functional")) { + return PolyString.getOrig(orgType.getDisplayName()); } - // Just use the first one as a fallback - return PolyString.getOrig(parentOrgs.iterator().next().asObjectable().getDisplayName()); } - }; + // Just use the first one as a fallback + return PolyString.getOrig(parentOrgs.iterator().next().getDisplayName()); + }); } @Override protected void addAdditionalExpressionVariables(ExpressionVariables variables) { - Collection> parentOrgs = wrapperModel.getObject().getParentOrgs(); - Collection parentOrgTypes = parentOrgs.stream().map(o -> o.asObjectable()).collect(Collectors.toList()); - variables.addVariableDefinition(ExpressionConstants.VAR_ORGS, parentOrgTypes); + List parentOrgs = getModelObject().getParentOrg(); + variables.addVariableDefinition(ExpressionConstants.VAR_ORGS, parentOrgs); } @Override @@ -160,16 +159,16 @@ protected boolean isActivationVisible() { public static void addSummaryPanel(MarkupContainer parentComponent, PrismObject focus, ObjectWrapper focusWrapper, String id, ModelServiceLocator serviceLocator) { if (focus.getCompileTimeClass().equals(UserType.class)) { parentComponent.add(new UserSummaryPanel(id, - new Model>((ObjectWrapper) focusWrapper), serviceLocator)); + Model.of((UserType)focus.asObjectable()), serviceLocator)); } else if (focus.getCompileTimeClass().equals(RoleType.class)) { parentComponent.add(new RoleSummaryPanel(id, - new Model>((ObjectWrapper) focusWrapper), serviceLocator)); + Model.of((RoleType)focus.asObjectable()), serviceLocator)); } else if (focus.getCompileTimeClass().equals(OrgType.class)) { parentComponent.add(new OrgSummaryPanel(id, - new Model>((ObjectWrapper) focusWrapper), serviceLocator)); + Model.of((OrgType)focus.asObjectable()), serviceLocator)); } else if (focus.getCompileTimeClass().equals(ServiceType.class)) { parentComponent.add(new ServiceSummaryPanel(id, - new Model>((ObjectWrapper) focusWrapper), serviceLocator)); + Model.of((ServiceType)focus.asObjectable()), serviceLocator)); } } } diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/ObjectSummaryPanel.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/ObjectSummaryPanel.java index 10b57bc2a2b..f5d6f68419b 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/ObjectSummaryPanel.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/ObjectSummaryPanel.java @@ -28,8 +28,8 @@ public abstract class ObjectSummaryPanel extends AbstractSummaryPanel { private static final long serialVersionUID = -3755521482914447912L; - public ObjectSummaryPanel(String id, Class type, final IModel> model, ModelServiceLocator serviceLocator) { - super(id, new ContainerableFromPrismObjectModel<>(model), serviceLocator, determineConfig(type, serviceLocator.getCompiledUserProfile())); + public ObjectSummaryPanel(String id, Class type, final IModel model, ModelServiceLocator serviceLocator) { + super(id, model, determineConfig(type, serviceLocator.getCompiledUserProfile())); } private static SummaryPanelSpecificationType determineConfig(Class type, CompiledUserProfile compiledUserProfile) { diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/data/column/ColumnUtils.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/data/column/ColumnUtils.java index 7d39ebb10e5..d8bb8d99789 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/data/column/ColumnUtils.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/data/column/ColumnUtils.java @@ -121,7 +121,7 @@ public static IColumn, String> createIc @Override public void populateItem(Item>> cellItem, String componentId, IModel> rowModel) { - DisplayType displayType = getDisplayTypeForRowObject(rowModel, pageBase); + DisplayType displayType = WebComponentUtil.getArchetypePolicyDisplayType(rowModel.getObject().getValue(), pageBase); if (displayType != null){ String disabledStyle = ""; if (rowModel.getObject().getValue() instanceof FocusType) { @@ -156,17 +156,6 @@ public IModel getDataModel(IModel> rowModel) { } - private static DisplayType getDisplayTypeForRowObject(IModel> rowModel, PageBase pageBase){ - O object = rowModel.getObject().getValue(); - if (object != null) { - ArchetypePolicyType archetypePolicy = WebComponentUtil.getArchetypeSpecification(object.asPrismObject(), pageBase); - if (archetypePolicy != null) { - return archetypePolicy.getDisplay(); - } - } - return null; - } - private static String getIconColumnValue(IModel> rowModel){ T object = rowModel.getObject().getValue(); if (object == null){ diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/certification/CertDefinitionSummaryPanel.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/certification/CertDefinitionSummaryPanel.java index 4c6a012c829..6564bbc01af 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/certification/CertDefinitionSummaryPanel.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/certification/CertDefinitionSummaryPanel.java @@ -31,9 +31,8 @@ public class CertDefinitionSummaryPanel extends ObjectSummaryPanel> model, ModelServiceLocator serviceLocator) { + IModel model, ModelServiceLocator serviceLocator) { super(id, AccessCertificationDefinitionType.class, model, serviceLocator); - initLayoutCommon(serviceLocator); } @Override diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/configuration/PageSystemConfiguration.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/configuration/PageSystemConfiguration.java index 6ee1c5d25f4..ed35c436b23 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/configuration/PageSystemConfiguration.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/configuration/PageSystemConfiguration.java @@ -322,7 +322,7 @@ protected SystemConfigurationType createNewObject() { @Override protected ObjectSummaryPanel createSummaryPanel() { - return new SystemConfigurationSummaryPanel(ID_SUMM_PANEL, SystemConfigurationType.class, Model.of(getObjectModel().getObject().getObject()), this); + return new SystemConfigurationSummaryPanel(ID_SUMM_PANEL, SystemConfigurationType.class, Model.of(getObjectModel().getObject().getObject().asObjectable()), this); } @Override diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/resources/PageResource.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/resources/PageResource.java index ee160ef78f3..1b6fa6cd000 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/resources/PageResource.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/resources/PageResource.java @@ -47,6 +47,7 @@ import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow; import org.apache.wicket.extensions.markup.html.tabs.ITab; import org.apache.wicket.markup.html.WebMarkupContainer; +import org.apache.wicket.model.Model; import org.apache.wicket.request.mapper.parameter.PageParameters; import java.util.ArrayList; @@ -279,7 +280,7 @@ private void startWizard(boolean configOnly, boolean readOnly) { private ResourceSummaryPanel createResourceSummaryPanel(){ ResourceSummaryPanel resourceSummaryPanel = new ResourceSummaryPanel(PANEL_RESOURCE_SUMMARY, - resourceModel, this); + Model.of(resourceModel.getObject().asObjectable()), this); resourceSummaryPanel.setOutputMarkupId(true); return resourceSummaryPanel; } diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/resources/ResourceSummaryPanel.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/resources/ResourceSummaryPanel.java index 8f13739d28e..60b05ca45fb 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/resources/ResourceSummaryPanel.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/resources/ResourceSummaryPanel.java @@ -30,20 +30,17 @@ public class ResourceSummaryPanel extends ObjectSummaryPanel { private static final long serialVersionUID = 1L; private static final String ID_UP_DOWN_TAG = "upDownTag"; - private IModel> model; + private IModel model; - public ResourceSummaryPanel(String id, IModel> model, ModelServiceLocator serviceLocator) { + public ResourceSummaryPanel(String id, IModel model, ModelServiceLocator serviceLocator) { super(id, ResourceType.class, model, serviceLocator); - initLayoutCommon(serviceLocator); - this.model = model; } - + @Override protected void onBeforeRender() { super.onBeforeRender(); - boolean down = ResourceTypeUtil.isDown(model.getObject().asObjectable()); - IModel containerModel = new ContainerableFromPrismObjectModel<>(model); - SummaryTag summaryTag = new SummaryTag(ID_UP_DOWN_TAG, containerModel) { + boolean down = ResourceTypeUtil.isDown(getModelObject()); + SummaryTag summaryTag = new SummaryTag(ID_UP_DOWN_TAG, getModel()) { private static final long serialVersionUID = 1L; @Override diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/resources/ShadowSummaryPanel.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/resources/ShadowSummaryPanel.java index 2454ca1ebce..45cfa1fbf47 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/resources/ShadowSummaryPanel.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/resources/ShadowSummaryPanel.java @@ -30,10 +30,8 @@ public class ShadowSummaryPanel extends ObjectSummaryPanel { private static final long serialVersionUID = 1L; - public ShadowSummaryPanel(String id, IModel> model, ModelServiceLocator locator) { + public ShadowSummaryPanel(String id, IModel model, ModelServiceLocator locator) { super(id, ShadowType.class, model, locator); - - initLayoutCommon(locator); } @Override diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/roles/PageRole.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/roles/PageRole.java index a225bb2e14e..9d182e0e893 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/roles/PageRole.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/roles/PageRole.java @@ -30,6 +30,7 @@ import com.evolveum.midpoint.web.util.OnePageParameterEncoder; import com.evolveum.midpoint.xml.ns._public.common.common_3.RoleType; import org.apache.wicket.ajax.AjaxRequestTarget; +import org.apache.wicket.model.Model; import org.apache.wicket.request.mapper.parameter.PageParameters; /** @@ -87,7 +88,7 @@ protected Class getRestartResponsePage() { @Override protected FocusSummaryPanel createSummaryPanel() { - return new RoleSummaryPanel(ID_SUMMARY_PANEL, getObjectModel(), this); + return new RoleSummaryPanel(ID_SUMMARY_PANEL, Model.of(getObjectModel().getObject().getObject().asObjectable()), this); } @Override diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/roles/component/RoleSummaryPanel.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/roles/component/RoleSummaryPanel.java index f657b89535e..331b362f4e4 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/roles/component/RoleSummaryPanel.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/roles/component/RoleSummaryPanel.java @@ -31,7 +31,7 @@ public class RoleSummaryPanel extends FocusSummaryPanel { private static final long serialVersionUID = 8087858942603720878L; - public RoleSummaryPanel(String id, IModel model, ModelServiceLocator serviceLocator) { + public RoleSummaryPanel(String id, IModel model, ModelServiceLocator serviceLocator) { super(id, RoleType.class, model, serviceLocator); } diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/server/PageTaskEdit.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/server/PageTaskEdit.java index 5a64625b63e..245ddf906f9 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/server/PageTaskEdit.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/server/PageTaskEdit.java @@ -106,48 +106,6 @@ public class PageTaskEdit extends PageAdmin implements Refreshable { public PageTaskEdit(PageParameters parameters) { taskOid = parameters.get(OnePageParameterEncoder.PARAMETER).toString(); - taskDtoModel = new LoadableModel(false) { - @Override - protected TaskDto load() { - try { - previousTaskDto = currentTaskDto; - final OperationResult result = new OperationResult(OPERATION_LOAD_TASK); - final Task operationTask = getTaskManager().createTaskInstance(OPERATION_LOAD_TASK); - final TaskType taskType = loadTaskTypeChecked(taskOid, operationTask, result); - currentTaskDto = prepareTaskDto(taskType, true, operationTask, result); - result.computeStatusIfUnknown(); - if (!result.isSuccess()) { - showResult(result); - } - return currentTaskDto; - } catch (SchemaException e) { - throw new SystemException("Couldn't prepare task DTO: " + e.getMessage(), e); - } - } - }; - objectWrapperModel = new LoadableModel>() { - @Override - protected ObjectWrapper load() { - final Task operationTask = getTaskManager().createTaskInstance(OPERATION_LOAD_TASK); - return loadObjectWrapper(taskDtoModel.getObject().getTaskType().asPrismObject(), operationTask, new OperationResult("loadObjectWrapper")); - } - }; - showAdvancedFeaturesModel = new Model<>(false); // todo save setting in session - nodeListModel = new LoadableModel>(false) { - @Override - protected List load() { - OperationResult result = new OperationResult(OPERATION_LOAD_NODES); - Task opTask = getTaskManager().createTaskInstance(OPERATION_LOAD_NODES); - try { - return PrismObject.asObjectableList( - getModelService().searchObjects(NodeType.class, null, null, opTask, result)); - } catch (Throwable t) { - LoggingUtils.logUnexpectedException(LOGGER, "Couldn't retrieve nodes", t); - return Collections.emptyList(); - } - } - }; - initLayout(); } @Override @@ -206,17 +164,58 @@ private TaskDto prepareTaskDto(TaskType task, boolean subtasksLoaded, Task opera } - protected void initLayout() { - refreshModel = new Model<>(new AutoRefreshDto()); - refreshModel.getObject().setInterval(getRefreshInterval()); + @Override + protected void onInitialize() { + super.onInitialize(); - IModel> prismObjectModel = new IModel>() { + taskDtoModel = new LoadableModel(false) { @Override - public PrismObject getObject() { - return objectWrapperModel.getObject().getObject(); + protected TaskDto load() { + try { + previousTaskDto = currentTaskDto; + final OperationResult result = new OperationResult(OPERATION_LOAD_TASK); + final Task operationTask = getTaskManager().createTaskInstance(OPERATION_LOAD_TASK); + final TaskType taskType = loadTaskTypeChecked(taskOid, operationTask, result); + currentTaskDto = prepareTaskDto(taskType, true, operationTask, result); + result.computeStatusIfUnknown(); + if (!result.isSuccess()) { + showResult(result); + } + return currentTaskDto; + } catch (SchemaException e) { + throw new SystemException("Couldn't prepare task DTO: " + e.getMessage(), e); + } } }; - final TaskSummaryPanel summaryPanel = new TaskSummaryPanel(ID_SUMMARY_PANEL, prismObjectModel, refreshModel, this); + objectWrapperModel = new LoadableModel>() { + @Override + protected ObjectWrapper load() { + final Task operationTask = getTaskManager().createTaskInstance(OPERATION_LOAD_TASK); + return loadObjectWrapper(taskDtoModel.getObject().getTaskType().asPrismObject(), operationTask, new OperationResult("loadObjectWrapper")); + } + }; + showAdvancedFeaturesModel = new Model<>(false); // todo save setting in session + nodeListModel = new LoadableModel>(false) { + @Override + protected List load() { + OperationResult result = new OperationResult(OPERATION_LOAD_NODES); + Task opTask = getTaskManager().createTaskInstance(OPERATION_LOAD_NODES); + try { + return PrismObject.asObjectableList( + getModelService().searchObjects(NodeType.class, null, null, opTask, result)); + } catch (Throwable t) { + LoggingUtils.logUnexpectedException(LOGGER, "Couldn't retrieve nodes", t); + return Collections.emptyList(); + } + } + }; + refreshModel = new Model<>(new AutoRefreshDto()); + refreshModel.getObject().setInterval(getRefreshInterval()); + + + + final TaskSummaryPanel summaryPanel = new TaskSummaryPanel(ID_SUMMARY_PANEL, + Model.of(objectWrapperModel.getObject().getObject().asObjectable()), refreshModel, this); summaryPanel.setOutputMarkupId(true); add(summaryPanel); diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/server/TaskSummaryPanel.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/server/TaskSummaryPanel.java index 3e6764215b8..fc23126e546 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/server/TaskSummaryPanel.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/server/TaskSummaryPanel.java @@ -53,14 +53,19 @@ public class TaskSummaryPanel extends ObjectSummaryPanel { private static final String ID_TAG_REFRESH = "refreshTag"; private PageTaskEdit parentPage; + private IModel refreshModel; - public TaskSummaryPanel(String id, IModel> model, IModel refreshModel, final PageTaskEdit parentPage) { + public TaskSummaryPanel(String id, IModel model, IModel refreshModel, final PageTaskEdit parentPage) { super(id, TaskType.class, model, parentPage); - initLayoutCommon(parentPage); this.parentPage = parentPage; - IModel containerModel = new ContainerableFromPrismObjectModel<>(model); + this.refreshModel = refreshModel; + } + + @Override + protected void onInitialize(){ + super.onInitialize(); - SummaryTag tagExecutionStatus = new SummaryTag(ID_TAG_EXECUTION_STATUS, containerModel) { + SummaryTag tagExecutionStatus = new SummaryTag(ID_TAG_EXECUTION_STATUS, getModel()) { @Override protected void initialize(TaskType taskType) { TaskDtoExecutionStatus status = TaskDtoExecutionStatus.fromTaskExecutionStatus(taskType.getExecutionStatus(), taskType.getNodeAsObserved() != null); @@ -74,7 +79,7 @@ protected void initialize(TaskType taskType) { }; addTag(tagExecutionStatus); - SummaryTag tagResult = new SummaryTag(ID_TAG_RESULT, containerModel) { + SummaryTag tagResult = new SummaryTag(ID_TAG_RESULT, getModel()) { @Override protected void initialize(TaskType taskType) { OperationResultStatusType resultStatus = taskType.getResultStatus(); @@ -88,7 +93,7 @@ protected void initialize(TaskType taskType) { }; addTag(tagResult); - SummaryTag tagOutcome = new SummaryTag(ID_TAG_WF_OUTCOME, containerModel) { + SummaryTag tagOutcome = new SummaryTag(ID_TAG_WF_OUTCOME, getModel()) { @Override protected void initialize(TaskType taskType) { String icon, name; diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/services/PageService.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/services/PageService.java index 338ae6bad3f..4b22d23a1a2 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/services/PageService.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/services/PageService.java @@ -90,7 +90,7 @@ protected Class getRestartResponsePage() { @Override protected FocusSummaryPanel createSummaryPanel() { - return new ServiceSummaryPanel(ID_SUMMARY_PANEL, getObjectModel(), this); + return new ServiceSummaryPanel(ID_SUMMARY_PANEL, Model.of(getObjectModel().getObject().getObject().asObjectable()), this); } @Override diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/users/PageOrgUnit.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/users/PageOrgUnit.java index d357133a7f3..01d2eba1dd9 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/users/PageOrgUnit.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/users/PageOrgUnit.java @@ -96,7 +96,7 @@ protected Class getRestartResponsePage() { @Override protected FocusSummaryPanel createSummaryPanel() { - return new OrgSummaryPanel(ID_SUMMARY_PANEL, getObjectModel(), this); + return new OrgSummaryPanel(ID_SUMMARY_PANEL, Model.of(getObjectModel().getObject().getObject().asObjectable()), this); } @Override diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/users/PageUser.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/users/PageUser.java index b446a6e43a6..eb24175491c 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/users/PageUser.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/users/PageUser.java @@ -63,6 +63,7 @@ import org.apache.wicket.markup.html.WebMarkupContainer; import org.apache.wicket.markup.html.list.ListItem; import org.apache.wicket.model.IModel; +import org.apache.wicket.model.Model; import org.apache.wicket.request.mapper.parameter.PageParameters; import java.util.*; @@ -140,7 +141,7 @@ protected List load() { @Override protected FocusSummaryPanel createSummaryPanel() { - return new UserSummaryPanel(ID_SUMMARY_PANEL, getObjectModel(), this); + return new UserSummaryPanel(ID_SUMMARY_PANEL, Model.of(getObjectModel().getObject().getObject().asObjectable()), this); } protected void cancelPerformed(AjaxRequestTarget target) { diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/users/component/OrgSummaryPanel.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/users/component/OrgSummaryPanel.java index f116602c804..c7b8ff296c1 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/users/component/OrgSummaryPanel.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/users/component/OrgSummaryPanel.java @@ -31,7 +31,7 @@ public class OrgSummaryPanel extends FocusSummaryPanel { private static final long serialVersionUID = -5457446213855746564L; - public OrgSummaryPanel(String id, IModel model, ModelServiceLocator serviceLocator) { + public OrgSummaryPanel(String id, IModel model, ModelServiceLocator serviceLocator) { super(id, OrgType.class, model, serviceLocator); } diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/users/component/ServiceSummaryPanel.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/users/component/ServiceSummaryPanel.java index 6e2a4d66617..e936913f3e7 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/users/component/ServiceSummaryPanel.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/users/component/ServiceSummaryPanel.java @@ -32,7 +32,7 @@ public class ServiceSummaryPanel extends FocusSummaryPanel { private static final long serialVersionUID = -5457446213855746564L; - public ServiceSummaryPanel(String id, IModel model, ModelServiceLocator serviceLocator) { + public ServiceSummaryPanel(String id, IModel model, ModelServiceLocator serviceLocator) { super(id, ServiceType.class, model, serviceLocator); } diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/users/component/UserSummaryPanel.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/users/component/UserSummaryPanel.java index 19ac7507c59..1a4509505e2 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/users/component/UserSummaryPanel.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/users/component/UserSummaryPanel.java @@ -44,10 +44,14 @@ public class UserSummaryPanel extends FocusSummaryPanel { private static final String ID_TAG_SECURITY = "summaryTagSecurity"; private static final String ID_TAG_ORG = "summaryTagOrg"; - public UserSummaryPanel(String id, IModel> model, ModelServiceLocator serviceLocator) { + public UserSummaryPanel(String id, IModel model, ModelServiceLocator serviceLocator) { super(id, UserType.class, model, serviceLocator); + } - SummaryTag tagSecurity = new SummaryTag(ID_TAG_SECURITY, Model.of(model.getObject().getObject().asObjectable())) { + @Override + protected void onInitialize(){ + super.onInitialize(); + SummaryTag tagSecurity = new SummaryTag(ID_TAG_SECURITY, getModel()) { private static final long serialVersionUID = 1L; @Override @@ -90,7 +94,7 @@ protected void initialize(UserType object) { }; addTag(tagSecurity); - SummaryTag tagOrg = new SummaryTag(ID_TAG_ORG, Model.of(model.getObject().getObject().asObjectable())) { + SummaryTag tagOrg = new SummaryTag(ID_TAG_ORG, getModel()) { private static final long serialVersionUID = 1L; @Override diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/valuePolicy/PageValuePolicy.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/valuePolicy/PageValuePolicy.java index 78cd4719df6..738a5802c74 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/valuePolicy/PageValuePolicy.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/valuePolicy/PageValuePolicy.java @@ -163,7 +163,8 @@ private ObjectWrapper loadValuePolicy(String policyOid) { protected void initLayout() { // TODO should be used if valuePolicyObject is edited - ValuePolicySummaryPanel summaryPanel = new ValuePolicySummaryPanel(ID_SUMMARY_PANEL, Model.of(valuePolicyModel.getObject().getObject()), this); + ValuePolicySummaryPanel summaryPanel = new ValuePolicySummaryPanel(ID_SUMMARY_PANEL, + Model.of(valuePolicyModel.getObject().getObject().asObjectable()), this); add(summaryPanel); Form mainForm = new Form(ID_MAIN_FORM); diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/valuePolicy/component/ValuePolicySummaryPanel.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/valuePolicy/component/ValuePolicySummaryPanel.java index 81a4141a738..195d5cb38cd 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/valuePolicy/component/ValuePolicySummaryPanel.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/valuePolicy/component/ValuePolicySummaryPanel.java @@ -27,9 +27,8 @@ */ public class ValuePolicySummaryPanel extends ObjectSummaryPanel { - public ValuePolicySummaryPanel(String id, IModel> model, ModelServiceLocator serviceLocator) { + public ValuePolicySummaryPanel(String id, IModel model, ModelServiceLocator serviceLocator) { super(id, ValuePolicyType.class, model, serviceLocator); - initLayoutCommon(serviceLocator); } @Override diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/workflow/WorkItemSummaryPanel.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/workflow/WorkItemSummaryPanel.java index e40ac22e71e..16ed07253e7 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/workflow/WorkItemSummaryPanel.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/workflow/WorkItemSummaryPanel.java @@ -42,12 +42,13 @@ public class WorkItemSummaryPanel extends AbstractSummaryPanel { private final IModel dtoModel; public WorkItemSummaryPanel(String id, IModel model, IModel dtoModel, ModelServiceLocator serviceLocator) { - super(id, model, serviceLocator, null); + super(id, model, null); this.dtoModel = dtoModel; + } - initLayoutCommon(serviceLocator); - - SummaryTag isAssignedTag = new SummaryTag(ID_ASSIGNED_TAG, model) { + @Override + protected void onInitialize(){ + SummaryTag isAssignedTag = new SummaryTag(ID_ASSIGNED_TAG, getModel()) { @Override protected void initialize(WorkItemType workItem) { if (workItem.getAssigneeRef() != null) { From 1dd110f7394f24544ca17043e0ebc88e5c29d84f Mon Sep 17 00:00:00 2001 From: kate Date: Tue, 19 Feb 2019 12:57:08 +0100 Subject: [PATCH 044/224] work item summary panel fix --- .../midpoint/web/page/admin/workflow/WorkItemSummaryPanel.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/workflow/WorkItemSummaryPanel.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/workflow/WorkItemSummaryPanel.java index 16ed07253e7..c760d782908 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/workflow/WorkItemSummaryPanel.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/workflow/WorkItemSummaryPanel.java @@ -48,6 +48,8 @@ public WorkItemSummaryPanel(String id, IModel model, IModel isAssignedTag = new SummaryTag(ID_ASSIGNED_TAG, getModel()) { @Override protected void initialize(WorkItemType workItem) { From 39d8daded94cf1a4854aae69f68565843dc288d9 Mon Sep 17 00:00:00 2001 From: Viliam Repan Date: Tue, 19 Feb 2019 13:01:57 +0100 Subject: [PATCH 045/224] ninja fixed '@' sign expanding when used as cmd option --- .../midpoint/ninja/util/NinjaUtils.java | 1 + .../com/evolveum/midpoint/ninja/BaseTest.java | 4 +- .../midpoint/ninja/ImportRepositoryTest.java | 79 +++++- tools/ninja/src/test/resources/filter.xml | 4 + .../ninja/src/test/resources/logback-test.xml | 35 +++ .../resources/org-monkey-island-simple.xml | 245 ++++++++++++++++++ .../org-monkey-island-simple.xml.zip | Bin 0 -> 1892 bytes 7 files changed, 358 insertions(+), 10 deletions(-) create mode 100644 tools/ninja/src/test/resources/filter.xml create mode 100644 tools/ninja/src/test/resources/logback-test.xml create mode 100644 tools/ninja/src/test/resources/org-monkey-island-simple.xml create mode 100644 tools/ninja/src/test/resources/org-monkey-island-simple.xml.zip diff --git a/tools/ninja/src/main/java/com/evolveum/midpoint/ninja/util/NinjaUtils.java b/tools/ninja/src/main/java/com/evolveum/midpoint/ninja/util/NinjaUtils.java index 32c7974018c..39ad2f74342 100644 --- a/tools/ninja/src/main/java/com/evolveum/midpoint/ninja/util/NinjaUtils.java +++ b/tools/ninja/src/main/java/com/evolveum/midpoint/ninja/util/NinjaUtils.java @@ -54,6 +54,7 @@ public static JCommander setupCommandLineParser() { ConnectionOptions connection = new ConnectionOptions(); JCommander.Builder builder = JCommander.newBuilder() + .expandAtSign(false) .addObject(base) .addObject(connection); diff --git a/tools/ninja/src/test/java/com/evolveum/midpoint/ninja/BaseTest.java b/tools/ninja/src/test/java/com/evolveum/midpoint/ninja/BaseTest.java index 4882250a294..487bca1645c 100644 --- a/tools/ninja/src/test/java/com/evolveum/midpoint/ninja/BaseTest.java +++ b/tools/ninja/src/test/java/com/evolveum/midpoint/ninja/BaseTest.java @@ -27,7 +27,7 @@ public class BaseTest { private static final File TARGET_HOME = new File("./target/home"); - public static final String RESOURCES_FOLDER = "./target/test-classes/xml"; + public static final String RESOURCES_FOLDER = "./target/test-classes"; private List systemOut; private List systemErr; @@ -140,6 +140,8 @@ protected void postExecute(NinjaContext context) { } } catch (IOException ex) { } + systemOut.forEach(s -> System.out.println(s)); + systemErr.forEach(s -> System.err.println(s)); } } diff --git a/tools/ninja/src/test/java/com/evolveum/midpoint/ninja/ImportRepositoryTest.java b/tools/ninja/src/test/java/com/evolveum/midpoint/ninja/ImportRepositoryTest.java index 7f5048b1f2f..84254934be7 100644 --- a/tools/ninja/src/test/java/com/evolveum/midpoint/ninja/ImportRepositoryTest.java +++ b/tools/ninja/src/test/java/com/evolveum/midpoint/ninja/ImportRepositoryTest.java @@ -3,7 +3,7 @@ import com.evolveum.midpoint.repo.api.RepositoryService; import com.evolveum.midpoint.schema.result.OperationResult; import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType; -import com.evolveum.midpoint.xml.ns._public.common.common_3.UserType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.OrgType; import org.testng.AssertJUnit; import org.testng.annotations.Test; @@ -22,9 +22,9 @@ protected void beforeMethodInternal(Method method) throws Exception { } @Test - public void importByOid() { - String[] input = new String[]{"-m", getMidpointHome(), "import", "-o", "00000000-0000-0000-0000-111100000002", - "-i", RESOURCES_FOLDER + "/objects.zip", "-z"}; + public void test100ImportByOid() { + String[] input = new String[]{"-m", getMidpointHome(), "import", "-o", "00000000-8888-6666-0000-100000000001", + "-i", RESOURCES_FOLDER + "/org-monkey-island-simple.xml.zip", "-z"}; ByteArrayOutputStream bos = new ByteArrayOutputStream(); @@ -40,8 +40,12 @@ public void importByOid() { context -> { RepositoryService repo = context.getRepository(); - OperationResult result = new OperationResult("count users"); - int count = repo.countObjects(UserType.class, null, null, result); + OperationResult result = new OperationResult("count"); + int count = repo.countObjects(ObjectType.class, null, null, result); + + AssertJUnit.assertEquals(1, count); + + count = repo.countObjects(OrgType.class, null, null, result); AssertJUnit.assertEquals(1, count); }, @@ -53,17 +57,74 @@ public void importByOid() { } @Test - public void importByFilter() throws Exception { + public void test110ImportByFilterAsOption() throws Exception { + String[] input = new String[]{"-m", getMidpointHome(), "import", "-f", "nameF0002", + "-i", RESOURCES_FOLDER + "/org-monkey-island-simple.xml.zip", "-z"}; + + ByteArrayOutputStream bos = new ByteArrayOutputStream(); + + executeTest(null, + context -> { + RepositoryService repo = context.getRepository(); + + OperationResult result = new OperationResult("count objects"); + int count = repo.countObjects(ObjectType.class, null, null, result); + AssertJUnit.assertEquals(0, count); + }, + context -> { + RepositoryService repo = context.getRepository(); + + OperationResult result = new OperationResult("count objects"); + int count = repo.countObjects(ObjectType.class, null, null, result); + + AssertJUnit.assertEquals(1, count); + }, + true, true, input); + + List out = getSystemOut(); + AssertJUnit.assertEquals(out.toString(), 5, out.size()); + AssertJUnit.assertTrue(getSystemErr().isEmpty()); } @Test - public void importRaw() throws Exception { + public void test120ImportByFilterAsFile() throws Exception { + String[] input = new String[]{"-m", getMidpointHome(), "import", "-f", "@src/test/resources/filter.xml", + "-i", RESOURCES_FOLDER + "/org-monkey-island-simple.xml.zip", "-z"}; + + ByteArrayOutputStream bos = new ByteArrayOutputStream(); + + executeTest(null, + context -> { + RepositoryService repo = context.getRepository(); + OperationResult result = new OperationResult("count objects"); + int count = repo.countObjects(ObjectType.class, null, null, result); + + AssertJUnit.assertEquals(0, count); + }, + context -> { + RepositoryService repo = context.getRepository(); + + OperationResult result = new OperationResult("count users"); + int count = repo.countObjects(ObjectType.class, null, null, result); + + AssertJUnit.assertEquals(1, count); + }, + true, true, input); + + List out = getSystemOut(); + AssertJUnit.assertEquals(out.toString(), 5, out.size()); + AssertJUnit.assertTrue(getSystemErr().isEmpty()); } @Test - public void importFromZipFileByFilterAllowOverwrite() throws Exception { + public void test130ImportRaw() throws Exception { + // todo implement + } + @Test + public void test140ImportFromZipFileByFilterAllowOverwrite() throws Exception { + // todo implement } } diff --git a/tools/ninja/src/test/resources/filter.xml b/tools/ninja/src/test/resources/filter.xml new file mode 100644 index 00000000000..091e4388057 --- /dev/null +++ b/tools/ninja/src/test/resources/filter.xml @@ -0,0 +1,4 @@ + + name + F0002 + \ No newline at end of file diff --git a/tools/ninja/src/test/resources/logback-test.xml b/tools/ninja/src/test/resources/logback-test.xml new file mode 100644 index 00000000000..7eec3491b25 --- /dev/null +++ b/tools/ninja/src/test/resources/logback-test.xml @@ -0,0 +1,35 @@ + + + + + + ./target/test.log + + %date [%thread] %-5level \(%logger{46}\): %message%n + + + + + + + + + + + + + \ No newline at end of file diff --git a/tools/ninja/src/test/resources/org-monkey-island-simple.xml b/tools/ninja/src/test/resources/org-monkey-island-simple.xml new file mode 100644 index 00000000000..6925b5070a8 --- /dev/null +++ b/tools/ninja/src/test/resources/org-monkey-island-simple.xml @@ -0,0 +1,245 @@ + + + + + + + + + F0001 + The office of the most respectful Governor. + Governor Office + 0001 + functional + CC0 + The Governor's Mansion + + + + F0002 + Defending the scum since the ancient times. + + + + + Ministry of Defense + 0002 + functional + The towers, bastions and bars + + + + + F0003 + Offending. Anyone. Anywhere. + + + + + Ministry of Offense + 0003 + functional + CC666 + + + + F0004 + Why is the rum always gone? + + + + + Ministry of Rum + 0004 + functional + CCRUM + + + + F0005 + Swashing, buckling and insulting. Hard. + + + + + Swashbuckler Section + 0005 + functional + + + + F0006 + Hosting the worst scumm of the Caribbean. + + + + + + + + + Scumm Bar + 0006 + functional + Mêlée Island + + + + + + PRoot + Project organizational structure root + Projects + project + + + + P0001 + + + + + Save Elaine + 0001 + project + + + + P0002 + + + + + Kidnap and marry Elaine + 0002 + project + + + + + + elaine + + + + + + + + + Elaine Marley + Elaine + Marley + Governor + + + + cheese + The owner of Scumm Bar + + + + + + + + + Ignatius Cheese + Ignatius + Cheese + + + + chef + + + + + Scumm Bar Chef + Chef + Scumm + + + + barkeeper + + + + + Horridly Scarred Barkeep + Barkeeper + Scumm + + + + guybrush + + + + + + + + + + Guybrush Threepwood + Guybrush + Threepwood + + + + carla + + + + + + + + + + + + + Carla the Swordmaster + Carla + + + + lechuck + + + + + + Captain LeChuck + LeChuck + + + + bob + + + + + Ghost Pirate Bob + Bob + + + diff --git a/tools/ninja/src/test/resources/org-monkey-island-simple.xml.zip b/tools/ninja/src/test/resources/org-monkey-island-simple.xml.zip new file mode 100644 index 0000000000000000000000000000000000000000..ec78c8da020c14160577dff90049b368136d2940 GIT binary patch literal 1892 zcmaKtX*e4Q8pop{;@E2Asz_Tx-7!dt4n^HZO2k=A2`P$1)Wlgw)KOQRb;eCn6s4G8 zh+1_G25pu)sx1?BwP{^Zi|Ow3?CyNp|L?>9eV_Mv-mgE54Ukt10RB#Y(UvvfFM$Eh z0fO)OAqc_5z&nwMyP-iiA|4TXmp}@-qaHyBa&i?02zCT`960;l+T#%eEV(U(&Fh}) zJ8P%8S*pFpi?%G;9)(0fN>EhoY|)YZU2G@cla4Db@+obSM+QAD(~=80L82!xh|D%I z<~;nazFf@Cguna~<{>nRWKrjxP@#MDxB-}d1oyg6`mngKKGssElZibpyw}Cckwls4 z7X)d%=FBW7xsjP}Lx#+O!!qz^e~6T~Ow1W}xWU~i=-6w=r@3~; zkoR{JzVa?VY-Lpx@K!5|>imw`TYV4EdtXvXd44lf-MUf_UWKZ<%p;WuuJ%7kL z3CbVK;UI`X}Bp z>N4-cys=zEvT#EodV(l5@zI3pKO4Z_M;&`OcQJ)=FgFP8ABx1KM+Lz9?WFwrdm z>&U&-q4>&Y=+rHP6#533rBt>i6J&YS|idoH_UaqibVVl^^Ca06wJ=3_BwaJ=m;g`f2JCNeM;Bh(G)+x<}(ELJ!n+cCQ zECk}hQkv_wIfmw0?SYdK1mwzZvs^II&9MA@S6a5kri+Bj@`(WR_-0idXHZnkF`q_b z77V~}+CO{@Jm`0%E5*jhC8}3)truqcjxfp<^_X-F``KXqUxu}hNK>;rlVb^IkLORJF%Fpq87I*aB*?-=eK;hrU^udxtI_r@ zwd~N5)X0&^9gePUJ3x$~kbR)l#trRfoeO7Rsm|zZJ@(kBMEw)J0fa3@bb6#_ruF$k zb>s-4T=(H%h^ekrWpO0Dh%J!?PcM&?a1c=^#)6LJg%NaY`3vzJ*^9GFR?PFzXL@7w z+Ko>!Sx&}q3Ez&elarXjoGEn5fusgmhaj!so9JFyZdmI$ozk3W4hz&*OQ#*M2#%%} z?oAI1{G)yM#V6yAwxTya2)>zxlI|WcL!fYt>_K z2R}wvZ_a-FS4&iXw!v$6?cgkAB>b>@3Y7 zcVQS@#5D1WmJQJgTU$V$ry$&e#I;GakJa<17&LY<<|fg845jxPNzsVh%3Lc@j$i;Q|pz4kh`5d90~<-qPM z`PSncW6&JchNd;r+h5a`rugekyZt2Go*Jjg`jyGf#l5R}rVhHubX67T_?#B|Q$DAt z{A9Ay{+lGmh97(@1-4!e0s#2r004{)&lz#x|IGK-8w?=)9}gPUQvNmme-DEH>p_eS R-}nCj0MB=vzc=^a+n;&_c=!MS literal 0 HcmV?d00001 From 5c8c23e9b01d38f82762b07d2609aa4d82686b85 Mon Sep 17 00:00:00 2001 From: kate Date: Tue, 19 Feb 2019 14:31:43 +0100 Subject: [PATCH 046/224] summary panel styles changes (archetype is applied) --- .../web/component/AbstractSummaryPanel.java | 34 +++++++++++++------ 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/AbstractSummaryPanel.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/AbstractSummaryPanel.java index 0f884e5a28a..7e6222caca1 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/AbstractSummaryPanel.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/AbstractSummaryPanel.java @@ -81,7 +81,11 @@ protected void onInitialize() { box = new WebMarkupContainer(ID_BOX); add(box); - box.add(new AttributeModifier("class", BOX_CSS_CLASS + " " + getBoxAdditionalCssClass())); + String archetypePolicyAdditionalCssClass = getArchetypePolicyAdditionalCssClass(); + box.add(new AttributeModifier("class", BOX_CSS_CLASS + " " + getBoxAdditionalCssClass())); + if (StringUtils.isNotEmpty(archetypePolicyAdditionalCssClass)){ + box.add(AttributeModifier.append("style", "border-color: " + archetypePolicyAdditionalCssClass + ";")); + } if (getDisplayNameModel() != null) { box.add(new Label(ID_DISPLAY_NAME, getDisplayNameModel())); @@ -145,16 +149,18 @@ public boolean isVisible() { iconBox = new WebMarkupContainer(ID_ICON_BOX); box.add(iconBox); - String archetypePolicyAdditionalCssClass = getArchetypePolicyAdditionalCssClass(); String iconAdditionalCssClass = getIconBoxAdditionalCssClass(); + if (StringUtils.isNotEmpty(iconAdditionalCssClass)) { + iconBox.add(new AttributeModifier("class", ICON_BOX_CSS_CLASS + " " + iconAdditionalCssClass)); + } if (StringUtils.isNotEmpty(archetypePolicyAdditionalCssClass)){ - iconBox.add(AttributeModifier.append("style", "color: " + archetypePolicyAdditionalCssClass + ";")); - } else if (StringUtils.isNotEmpty(iconAdditionalCssClass)) { - iconBox.add(new AttributeModifier("class", ICON_BOX_CSS_CLASS + " " + iconAdditionalCssClass)); - } + iconBox.add(AttributeModifier.append("style", "background-color: " + archetypePolicyAdditionalCssClass + ";")); + } Label icon = new Label(ID_ICON, ""); - icon.add(new AttributeModifier("class", getIconCssClass())); + + String archetypeIconCssClass = getArchetypeIconCssClass(); + icon.add(new AttributeModifier("class", StringUtils.isNotEmpty(archetypeIconCssClass) ? archetypeIconCssClass : getIconCssClass())); icon.add(new VisibleEnableBehaviour() { @Override public boolean isVisible(){ @@ -222,14 +228,22 @@ public Component getTag(String id) { return tagBox.get(id); } - protected String getArchetypePolicyAdditionalCssClass(){ - if (getModelObject() instanceof ObjectType){ - DisplayType displayType = WebComponentUtil.getArchetypePolicyDisplayType((ObjectType) getModelObject(), getPageBase()); + private String getArchetypePolicyAdditionalCssClass(){ + if (getModelObject() instanceof AssignmentHolderType){ + DisplayType displayType = WebComponentUtil.getArchetypePolicyDisplayType((AssignmentHolderType) getModelObject(), getPageBase()); return WebComponentUtil.getIconColor(displayType); } return ""; } + private String getArchetypeIconCssClass(){ + if (getModelObject() instanceof AssignmentHolderType){ + DisplayType displayType = WebComponentUtil.getArchetypePolicyDisplayType((AssignmentHolderType) getModelObject(), getPageBase()); + return WebComponentUtil.getIconCssClass(displayType); + } + return ""; + } + protected abstract String getIconCssClass(); protected abstract String getIconBoxAdditionalCssClass(); From 34cb16eecaf80d244f413bf286cf75bbc8452640 Mon Sep 17 00:00:00 2001 From: Pavol Mederly Date: Wed, 20 Feb 2019 12:14:34 +0100 Subject: [PATCH 047/224] Fix progress reporting for bulk actions (MID-5015) In-memory statistics are now regularly flushed into task object in the repository. --- .../scripting/helpers/OperationsHelper.java | 17 ++++-- .../bulk-actions/script-objects-delay.xml | 54 +++++++++++++++++++ 2 files changed, 66 insertions(+), 5 deletions(-) create mode 100644 samples/tasks/bulk-actions/script-objects-delay.xml diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/scripting/helpers/OperationsHelper.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/scripting/helpers/OperationsHelper.java index eee9e684cb7..198e1506473 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/scripting/helpers/OperationsHelper.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/scripting/helpers/OperationsHelper.java @@ -29,6 +29,8 @@ import com.evolveum.midpoint.schema.result.OperationResult; import com.evolveum.midpoint.schema.statistics.StatisticsUtil; import com.evolveum.midpoint.schema.util.MiscSchemaUtil; +import com.evolveum.midpoint.task.api.RunningTask; +import com.evolveum.midpoint.task.api.Task; import com.evolveum.midpoint.util.exception.CommunicationException; import com.evolveum.midpoint.util.exception.ConfigurationException; import com.evolveum.midpoint.util.exception.ExpressionEvaluationException; @@ -134,8 +136,9 @@ public long recordStart(ExecutionContext context, ObjectType objectType) { public void recordEnd(ExecutionContext context, ObjectType objectType, long started, Throwable ex) { if (context.isRecordProgressAndIterationStatistics()) { - if (context.getTask() != null && objectType != null) { - context.getTask().recordIterativeOperationEnd( + Task task = context.getTask(); + if (task != null && objectType != null) { + task.recordIterativeOperationEnd( PolyString.getOrig(objectType.getName()), StatisticsUtil.getDisplayName(objectType.asPrismObject()), StatisticsUtil.getObjectType(objectType, prismContext), @@ -143,10 +146,14 @@ public void recordEnd(ExecutionContext context, ObjectType objectType, long star started, ex); } else { LOGGER.warn("Couldn't record operation end in script execution; task = {}, objectType = {}", - context.getTask(), objectType); + task, objectType); } - if (context.getTask() != null) { - context.getTask().setProgress(context.getTask().getProgress() + 1); + if (task != null) { + if (task instanceof RunningTask) { + ((RunningTask) task).incrementProgressAndStoreStatsIfNeeded(); + } else { + task.setProgress(task.getProgress() + 1); + } } } } diff --git a/samples/tasks/bulk-actions/script-objects-delay.xml b/samples/tasks/bulk-actions/script-objects-delay.xml new file mode 100644 index 00000000000..327116bf228 --- /dev/null +++ b/samples/tasks/bulk-actions/script-objects-delay.xml @@ -0,0 +1,54 @@ + + + + + + + Waits on each object + + + + ObjectType + + execute-script + + script + + + log.info('Waiting on: {}', input) + Thread.sleep(15000) + log.info('Done waiting on: {}', input) + + + + + + + + + runnable + + BulkActions + http://midpoint.evolveum.com/xml/ns/public/model/scripting/handler-3 + single + + + From 5a824d1c9bd4283bc23814979deccca43c3f5d99 Mon Sep 17 00:00:00 2001 From: kate Date: Wed, 20 Feb 2019 13:29:13 +0100 Subject: [PATCH 048/224] improving the code for new (archetype) object creation --- .../gui/api/util/WebComponentUtil.java | 53 +++++++++++++++---- .../web/component/FocusSummaryPanel.java | 8 ++- .../web/page/admin/PageAdminObjectList.java | 17 +++++- .../page/admin/resources/PageResources.java | 6 --- .../admin/roles/AbstractRoleMemberPanel.java | 3 +- .../admin/roles/MemberOperationsHelper.java | 30 ----------- .../web/page/admin/roles/PageRoles.java | 5 -- .../web/page/admin/services/PageServices.java | 5 -- .../web/page/admin/users/PageUser.java | 3 +- .../web/page/admin/users/PageUsers.java | 17 +----- .../admin/valuePolicy/PageValuePolicies.java | 5 -- 11 files changed, 70 insertions(+), 82 deletions(-) diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/gui/api/util/WebComponentUtil.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/gui/api/util/WebComponentUtil.java index fc952e89330..ee2802036b8 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/gui/api/util/WebComponentUtil.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/gui/api/util/WebComponentUtil.java @@ -73,6 +73,8 @@ import com.evolveum.midpoint.web.component.menu.cog.InlineMenuItem; import com.evolveum.midpoint.web.component.menu.cog.InlineMenuItemAction; import com.evolveum.midpoint.web.component.prism.*; +import com.evolveum.midpoint.web.page.admin.resources.PageResourceWizard; +import com.evolveum.midpoint.web.page.admin.valuePolicy.PageValuePolicy; import com.evolveum.midpoint.web.util.ObjectTypeGuiDescriptor; import com.evolveum.midpoint.xml.ns._public.common.common_3.*; import com.evolveum.prism.xml.ns._public.types_3.ObjectDeltaType; @@ -192,6 +194,7 @@ public final class WebComponentUtil { private static RelationRegistry staticallyProvidedRelationRegistry; private static Map, Class> objectDetailsPageMap; + private static Map, Class> createNewObjectPageMap; static { objectDetailsPageMap = new HashMap<>(); @@ -202,6 +205,12 @@ public final class WebComponentUtil { objectDetailsPageMap.put(ResourceType.class, PageResource.class); objectDetailsPageMap.put(TaskType.class, PageTaskEdit.class); objectDetailsPageMap.put(ReportType.class, PageReport.class); + objectDetailsPageMap.put(ValuePolicyType.class, PageValuePolicy.class); + } + + static{ + createNewObjectPageMap = new HashMap<>(); + createNewObjectPageMap.put(ResourceType.class, PageResourceWizard.class); } // only pages that support 'advanced search' are currently listed here (TODO: generalize) @@ -1970,16 +1979,36 @@ public static String createShadowIcon(PrismObject object) { return GuiStyleConstants.CLASS_SHADOW_ICON_UNKNOWN; } - public static AHT createNewObjectWithCollectionRef(Class type, PrismContext context, - ObjectReferenceType collectionRef){ - if (UserType.class.equals(type) && collectionRef != null && ArchetypeType.COMPLEX_TYPE.equals(collectionRef.getType())){ - UserType user = new UserType(context); - AssignmentType assignment = new AssignmentType(); - assignment.setTargetRef(collectionRef.clone()); - user.getAssignment().add(assignment); - return (AHT) user; + public static void initNewObjectWithReference(PageBase pageBase, O targetObject, QName type, Collection relations) throws SchemaException { + List newReferences = new ArrayList<>(); + for (QName relation : relations) { + newReferences.add(ObjectTypeUtil.createObjectRef(targetObject, relation)); } - return null; + initNewObjectWithReference(pageBase, type, newReferences); + } + + public static void initNewObjectWithReference(PageBase pageBase, QName type, List newReferences) throws SchemaException { + PrismContext prismContext = pageBase.getPrismContext(); + PrismObjectDefinition def = prismContext.getSchemaRegistry().findObjectDefinitionByType(type); + PrismObject obj = def.instantiate(); + AHT assignmentHolder = obj.asObjectable(); + if (newReferences != null) { + newReferences.stream().forEach(ref -> { + AssignmentType assignment = new AssignmentType(); + assignment.setTargetRef(ref); + assignmentHolder.getAssignment().add(assignment); + + // Set parentOrgRef in any case. This is not strictly correct. + // The parentOrgRef should be added by the projector. But + // this is needed to successfully pass through security + // TODO: fix MID-3234 + if (ref.getType() != null && OrgType.COMPLEX_TYPE.equals(ref.getType())) { + assignmentHolder.getParentOrgRef().add(ref.clone()); + } + }); + } + + WebComponentUtil.dispatchToObjectDetailsPage(obj, true, pageBase); } public static String createUserIconTitle(PrismObject object) { @@ -2304,7 +2333,7 @@ public static void dispatchToObjectDetailsPage(PrismObject obj, Component compon // shows the actual object that is passed via parameter (not its state in repository) public static void dispatchToObjectDetailsPage(PrismObject obj, boolean isNewObject, Component component) { - Class newObjectPageClass = getObjectDetailsPage(obj.getCompileTimeClass()); + Class newObjectPageClass = isNewObject ? getNewlyCreatedObjectPage(obj.getCompileTimeClass()) : getObjectDetailsPage(obj.getCompileTimeClass()); if (newObjectPageClass == null) { throw new IllegalArgumentException("Cannot determine details page for "+obj.getCompileTimeClass()); } @@ -2378,6 +2407,10 @@ public static Class getObjectDetailsPage(Class getNewlyCreatedObjectPage(Class type) { + return createNewObjectPageMap.get(type); + } + public static Class getObjectListPage(Class type) { return objectListPageMap.get(type); } diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/FocusSummaryPanel.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/FocusSummaryPanel.java index 1cad2f6d780..c8714ad6b2f 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/FocusSummaryPanel.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/FocusSummaryPanel.java @@ -109,8 +109,9 @@ public boolean isVisible() { @Override protected IModel getDefaltParentOrgModel() { return new ReadOnlyModel(() -> { - List parentOrgs = FocusSummaryPanel.this.getModel().getObject().getParentOrg(); - if (parentOrgs.isEmpty()) { + O focusObject = FocusSummaryPanel.this.getModel().getObject(); + List parentOrgs = focusObject != null ? focusObject.getParentOrg() : null; + if (parentOrgs == null || parentOrgs.isEmpty()) { return ""; } // Kinda hack now .. "functional" orgType always has preference @@ -140,6 +141,9 @@ protected IModel getPhotoModel() { public AbstractResource getObject() { byte[] jpegPhoto = null; O object = getModel().getObject(); + if (object == null){ + return null; + } if (object instanceof FocusType) { jpegPhoto = ((FocusType) object).getJpegPhoto(); } diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/PageAdminObjectList.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/PageAdminObjectList.java index dfeaabc344d..df989250ef4 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/PageAdminObjectList.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/PageAdminObjectList.java @@ -25,6 +25,7 @@ import com.evolveum.midpoint.prism.util.PolyStringUtils; import com.evolveum.midpoint.schema.GetOperationOptions; import com.evolveum.midpoint.schema.SelectorOptions; +import com.evolveum.midpoint.util.exception.SchemaException; import com.evolveum.midpoint.util.logging.Trace; import com.evolveum.midpoint.util.logging.TraceManager; import com.evolveum.midpoint.web.component.menu.cog.InlineMenuItem; @@ -183,7 +184,21 @@ protected String getStorageKey() { protected void objectDetailsPerformed(AjaxRequestTarget target, O object){} - protected void newObjectActionPerformed(AjaxRequestTarget target, CompiledObjectCollectionView collectionView){} + protected void newObjectActionPerformed(AjaxRequestTarget target, CompiledObjectCollectionView collectionView){ + if (collectionView == null){ + collectionView = getCollectionViewObject(); + } + ObjectReferenceType collectionViewReference = collectionView != null && collectionView.getCollection() != null ? + collectionView.getCollection().getCollectionRef() : null; + try { + WebComponentUtil.initNewObjectWithReference(PageAdminObjectList.this, + WebComponentUtil.classToQName(getPrismContext(), getType()), + collectionViewReference != null ? Arrays.asList(collectionViewReference) : null); + } catch (SchemaException ex){ + getFeedbackPanel().getFeedbackMessages().error(PageAdminObjectList.this, ex.getUserFriendlyMessage()); + target.add(getFeedbackPanel()); + } + } protected ObjectFilter getArchetypeViewFilter(){ CompiledObjectCollectionView view = getCollectionViewObject(); diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/resources/PageResources.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/resources/PageResources.java index 793342ce511..d89f7210f8c 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/resources/PageResources.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/resources/PageResources.java @@ -151,12 +151,6 @@ protected void objectDetailsPerformed(AjaxRequestTarget target, ResourceType obj } - @Override - protected void newObjectActionPerformed(AjaxRequestTarget target, CompiledObjectCollectionView collectionView) { - navigateToNext(PageResourceWizard.class); - - } - @Override protected Class getType(){ return ResourceType.class; diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/roles/AbstractRoleMemberPanel.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/roles/AbstractRoleMemberPanel.java index 8c5f62580c5..1066c597793 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/roles/AbstractRoleMemberPanel.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/roles/AbstractRoleMemberPanel.java @@ -566,8 +566,9 @@ protected void okPerformed(QName type, Collection relations, AjaxRequestT target.add(getPageBase().getFeedbackPanel()); return; } + AbstractRoleMemberPanel.this.getPageBase().hideMainPopup(target); try { - MemberOperationsHelper.initObjectForAdd(AbstractRoleMemberPanel.this.getPageBase(), AbstractRoleMemberPanel.this.getModelObject(), type, relations, target); + WebComponentUtil.initNewObjectWithReference(AbstractRoleMemberPanel.this.getPageBase(), AbstractRoleMemberPanel.this.getModelObject(), type, relations); } catch (SchemaException e) { throw new SystemException(e.getMessage(), e); } diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/roles/MemberOperationsHelper.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/roles/MemberOperationsHelper.java index ac64dc74dc7..907ee7204ea 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/roles/MemberOperationsHelper.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/roles/MemberOperationsHelper.java @@ -124,37 +124,7 @@ protected OrgType getAssignmentTargetRefObject(){ browser.setOutputMarkupId(true); pageBase.showMainPopup(browser, target); } - - public static void initObjectForAdd(PageBase pageBase, R targetObject, QName type, Collection relations, AjaxRequestTarget target) throws SchemaException { - pageBase.hideMainPopup(target); - PrismContext prismContext = pageBase.getPrismContext(); - PrismObjectDefinition def = prismContext.getSchemaRegistry().findObjectDefinitionByType(type); - PrismObject obj = def.instantiate(); - List newReferences = new ArrayList<>(); - for (QName relation : relations) { - newReferences.add(createReference(targetObject, relation)); - } - ObjectType objType = (ObjectType) obj.asObjectable(); - if (FocusType.class.isAssignableFrom(obj.getCompileTimeClass())) { - newReferences.stream().forEach(ref -> { - AssignmentType assignment = new AssignmentType(); - assignment.setTargetRef(ref); - ((FocusType) objType).getAssignment().add(assignment); - - // Set parentOrgRef in any case. This is not strictly correct. - // The parentOrgRef should be added by the projector. But - // this is needed to successfully pass through security - // TODO: fix MID-3234 - if (ref.getType() != null && OrgType.COMPLEX_TYPE.equals(ref.getType())) { - objType.getParentOrgRef().add(ref.clone()); - } - }); - - } - WebComponentUtil.dispatchToObjectDetailsPage(obj, true, pageBase); - } - public static ObjectQuery createDirectMemberQuery(R targetObject, QName objectType, Collection relations, ObjectViewDto tenant, ObjectViewDto project, PrismContext prismContext) { // We assume tenantRef.relation and orgRef.relation are always default ones (see also MID-3581) S_FilterEntry q0; diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/roles/PageRoles.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/roles/PageRoles.java index 0618a96a7d9..cb9caca2f52 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/roles/PageRoles.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/roles/PageRoles.java @@ -92,11 +92,6 @@ protected void objectDetailsPerformed(AjaxRequestTarget target, RoleType object) PageRoles.this.roleDetailsPerformed(target, object.getOid()); } - @Override - protected void newObjectActionPerformed(AjaxRequestTarget target, CompiledObjectCollectionView collectionView) { - navigateToNext(PageRole.class); - } - @Override protected Class getType(){ return RoleType.class; diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/services/PageServices.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/services/PageServices.java index 134f972b2c8..91bb55732d9 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/services/PageServices.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/services/PageServices.java @@ -99,11 +99,6 @@ protected List createRowActions() { return listInlineMenuHelper.createRowActions(); } - @Override - protected void newObjectActionPerformed(AjaxRequestTarget target, CompiledObjectCollectionView collectionView) { - navigateToNext(PageService.class); - } - @Override protected Class getType(){ return ServiceType.class; diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/users/PageUser.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/users/PageUser.java index eb24175491c..561a288aeae 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/users/PageUser.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/users/PageUser.java @@ -141,7 +141,8 @@ protected List load() { @Override protected FocusSummaryPanel createSummaryPanel() { - return new UserSummaryPanel(ID_SUMMARY_PANEL, Model.of(getObjectModel().getObject().getObject().asObjectable()), this); + return new UserSummaryPanel(ID_SUMMARY_PANEL, isEditingFocus() ? + Model.of(getObjectModel().getObject().getObject().asObjectable()) : Model.of(), this); } protected void cancelPerformed(AjaxRequestTarget target) { diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/users/PageUsers.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/users/PageUsers.java index b2988077313..e1bcdc36957 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/users/PageUsers.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/users/PageUsers.java @@ -17,6 +17,7 @@ package com.evolveum.midpoint.web.page.admin.users; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collection; import java.util.List; @@ -24,12 +25,10 @@ import com.evolveum.midpoint.model.api.authentication.CompiledObjectCollectionView; import com.evolveum.midpoint.prism.path.ItemPath; import com.evolveum.midpoint.prism.query.ObjectFilter; -import com.evolveum.midpoint.prism.query.ObjectQuery; import com.evolveum.midpoint.util.exception.ObjectNotFoundException; import com.evolveum.midpoint.util.exception.SchemaException; import com.evolveum.midpoint.web.application.Url; import com.evolveum.midpoint.web.component.data.column.*; -import com.evolveum.midpoint.web.component.dialog.HelpInfoPanel; import com.evolveum.midpoint.web.component.menu.cog.ButtonInlineMenuItem; import com.evolveum.midpoint.web.component.menu.cog.InlineMenuItemAction; import com.evolveum.midpoint.web.component.search.SearchFactory; @@ -47,7 +46,6 @@ import org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn; import org.apache.wicket.extensions.markup.html.repeater.data.table.export.AbstractExportableColumn; import org.apache.wicket.markup.html.basic.Label; -import org.apache.wicket.markup.html.form.Form; import org.apache.wicket.markup.repeater.Item; import org.apache.wicket.model.IModel; import org.apache.wicket.model.Model; @@ -61,8 +59,6 @@ import com.evolveum.midpoint.model.api.ModelExecuteOptions; import com.evolveum.midpoint.prism.delta.ChangeType; import com.evolveum.midpoint.prism.delta.ObjectDelta; -import com.evolveum.midpoint.schema.GetOperationOptions; -import com.evolveum.midpoint.schema.SelectorOptions; import com.evolveum.midpoint.schema.result.OperationResult; import com.evolveum.midpoint.security.api.AuthorizationConstants; import com.evolveum.midpoint.task.api.Task; @@ -399,17 +395,6 @@ protected void objectDetailsPerformed(AjaxRequestTarget target, UserType user) { navigateToNext(PageUser.class, parameters); } - @Override - protected void newObjectActionPerformed(AjaxRequestTarget target, CompiledObjectCollectionView collectionView){ - if (collectionView == null){ - collectionView = getCollectionViewObject(); - } - UserType newUser = WebComponentUtil.createNewObjectWithCollectionRef(UserType.class, getPrismContext(), - collectionView != null && collectionView.getCollection() != null ? - collectionView.getCollection().getCollectionRef() : null); - navigateToNext(new PageUser(newUser != null ? newUser.asPrismObject() : null, true)); - } - @Override protected Class getType(){ return UserType.class; diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/valuePolicy/PageValuePolicies.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/valuePolicy/PageValuePolicies.java index a7759746186..a6afcc28b74 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/valuePolicy/PageValuePolicies.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/valuePolicy/PageValuePolicies.java @@ -74,11 +74,6 @@ protected void objectDetailsPerformed(AjaxRequestTarget target, ValuePolicyType PageValuePolicies.this.valuePolicyDetailsPerformed(target, valuePolicy); } - @Override - protected void newObjectActionPerformed(AjaxRequestTarget target, CompiledObjectCollectionView collectionView) { - navigateToNext(PageValuePolicy.class); - } - @Override protected List, String>> initColumns() { return PageValuePolicies.this.initValuePoliciesColumns(); From 07ce010712f94069e0e9c1de19ccbd4b36d86f1d Mon Sep 17 00:00:00 2001 From: kate Date: Wed, 20 Feb 2019 13:55:16 +0100 Subject: [PATCH 049/224] little fix for new object creation --- .../evolveum/midpoint/gui/api/util/WebComponentUtil.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/gui/api/util/WebComponentUtil.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/gui/api/util/WebComponentUtil.java index ee2802036b8..86f00f42920 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/gui/api/util/WebComponentUtil.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/gui/api/util/WebComponentUtil.java @@ -2408,7 +2408,11 @@ public static Class getObjectDetailsPage(Class getNewlyCreatedObjectPage(Class type) { - return createNewObjectPageMap.get(type); + if (ResourceType.class.equals(type)) { + return createNewObjectPageMap.get(type); + } else { + return objectDetailsPageMap.get(type); + } } public static Class getObjectListPage(Class type) { From 76fa7f5f520496db3beae2622bff2b760ac779ca Mon Sep 17 00:00:00 2001 From: kate Date: Wed, 20 Feb 2019 16:23:34 +0100 Subject: [PATCH 050/224] further summary panel refactoring (preparing for archetype summary tag panel) --- .../gui/impl/model/FlexibleLabelModel.java | 3 ++ .../web/component/AbstractSummaryPanel.html | 7 +++- .../web/component/AbstractSummaryPanel.java | 30 +++++++++++--- .../web/component/FocusSummaryPanel.html | 25 ------------ .../web/component/FocusSummaryPanel.java | 14 +++---- .../page/admin/PageAdminObjectDetails.java | 2 +- .../admin/resources/ResourceSummaryPanel.html | 25 ------------ .../admin/resources/ResourceSummaryPanel.java | 20 ++++++++-- .../admin/resources/ShadowSummaryPanel.html | 24 ----------- .../roles/component/RoleSummaryPanel.html | 24 ----------- .../page/admin/server/TaskSummaryPanel.html | 3 -- .../page/admin/server/TaskSummaryPanel.java | 40 +++++++++++-------- .../users/component/OrgSummaryPanel.html | 24 ----------- .../users/component/ServiceSummaryPanel.html | 24 ----------- .../users/component/UserSummaryPanel.html | 25 ------------ .../users/component/UserSummaryPanel.java | 16 +++++--- .../admin/workflow/WorkItemSummaryPanel.html | 24 ----------- .../admin/workflow/WorkItemSummaryPanel.java | 13 +++--- 18 files changed, 97 insertions(+), 246 deletions(-) delete mode 100644 gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/FocusSummaryPanel.html delete mode 100644 gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/resources/ResourceSummaryPanel.html delete mode 100644 gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/resources/ShadowSummaryPanel.html delete mode 100644 gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/roles/component/RoleSummaryPanel.html delete mode 100644 gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/users/component/OrgSummaryPanel.html delete mode 100644 gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/users/component/ServiceSummaryPanel.html delete mode 100644 gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/users/component/UserSummaryPanel.html delete mode 100644 gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/workflow/WorkItemSummaryPanel.html diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/gui/impl/model/FlexibleLabelModel.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/gui/impl/model/FlexibleLabelModel.java index f13154eb30a..5ada17fd371 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/gui/impl/model/FlexibleLabelModel.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/gui/impl/model/FlexibleLabelModel.java @@ -109,6 +109,9 @@ public String getObject() { private String getDefaultValue() { C object = model.getObject(); + if (object == null){ + return ""; + } PrismProperty property; try { property = object.asPrismContainerValue().findOrCreateProperty(path); diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/AbstractSummaryPanel.html b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/AbstractSummaryPanel.html index c451a736f52..739d595a241 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/AbstractSummaryPanel.html +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/AbstractSummaryPanel.html @@ -33,8 +33,11 @@ - - + + + + +

diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/AbstractSummaryPanel.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/AbstractSummaryPanel.java index 7e6222caca1..595ae42d0ba 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/AbstractSummaryPanel.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/AbstractSummaryPanel.java @@ -23,20 +23,26 @@ import com.evolveum.midpoint.prism.PrismContainer; import com.evolveum.midpoint.prism.path.ItemName; import com.evolveum.midpoint.repo.common.expression.ExpressionVariables; +import com.evolveum.midpoint.web.component.util.SummaryTag; +import com.evolveum.midpoint.web.component.util.VisibleBehaviour; import com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour; import com.evolveum.midpoint.xml.ns._public.common.common_3.*; +import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang.StringUtils; import org.apache.wicket.AttributeModifier; import org.apache.wicket.Component; import org.apache.wicket.markup.html.WebMarkupContainer; import org.apache.wicket.markup.html.basic.Label; import org.apache.wicket.markup.html.image.NonCachingImage; +import org.apache.wicket.markup.repeater.RepeatingView; import org.apache.wicket.model.IModel; import org.apache.wicket.model.Model; import org.apache.wicket.request.resource.AbstractResource; import javax.xml.namespace.QName; +import java.util.ArrayList; +import java.util.List; /** * @author semancik @@ -48,6 +54,7 @@ public abstract class AbstractSummaryPanel extends Base protected static final String ID_BOX = "summaryBox"; protected static final String ID_ICON_BOX = "summaryIconBox"; protected static final String ID_TAG_BOX = "summaryTagBox"; + protected static final String ID_SUMMARY_TAG = "summaryTag"; protected static final String ID_ICON = "summaryIcon"; protected static final String ID_DISPLAY_NAME = "summaryDisplayName"; protected static final String ID_IDENTIFIER = "summaryIdentifier"; @@ -65,7 +72,7 @@ public abstract class AbstractSummaryPanel extends Base protected SummaryPanelSpecificationType configuration; protected WebMarkupContainer box; - protected WebMarkupContainer tagBox; + protected RepeatingView tagBox; protected WebMarkupContainer iconBox; public AbstractSummaryPanel(String id, IModel model, SummaryPanelSpecificationType configuration) { @@ -178,10 +185,18 @@ public boolean isVisible() { }); iconBox.add(img); - tagBox = new WebMarkupContainer(ID_TAG_BOX); + tagBox = new RepeatingView(ID_TAG_BOX); + getSummaryTagComponentList().forEach(summaryTag -> { + WebMarkupContainer summaryTagPanel = new WebMarkupContainer(tagBox.newChildId()); + summaryTagPanel.setOutputMarkupId(true); + + summaryTagPanel.add(summaryTag); + tagBox.add(summaryTagPanel); + }); if (getTagBoxCssClass() != null) { tagBox.add(new AttributeModifier("class", getTagBoxCssClass())); } + tagBox.add(new VisibleBehaviour(() -> CollectionUtils.isNotEmpty(getSummaryTagComponentList()))); box.add(tagBox); } @@ -200,6 +215,10 @@ protected void addAdditionalExpressionVariables(ExpressionVariables variables) { }; } + protected List> getSummaryTagComponentList(){ + return new ArrayList<>(); + } + protected void addAdditionalExpressionVariables(ExpressionVariables variables) { } @@ -220,10 +239,6 @@ protected String getTagBoxCssClass() { return null; } - public void addTag(Component tag) { - tagBox.add(tag); - } - public Component getTag(String id) { return tagBox.get(id); } @@ -307,4 +322,7 @@ protected IModel getPhotoModel() { return new Model<>(null); } + protected WebMarkupContainer getSummaryBoxPanel(){ + return (WebMarkupContainer) get(ID_BOX); + } } diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/FocusSummaryPanel.html b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/FocusSummaryPanel.html deleted file mode 100644 index 8da3a8f4eea..00000000000 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/FocusSummaryPanel.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/FocusSummaryPanel.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/FocusSummaryPanel.java index c8714ad6b2f..ef2ff1bfd76 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/FocusSummaryPanel.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/FocusSummaryPanel.java @@ -40,6 +40,7 @@ import org.apache.wicket.request.resource.AbstractResource; import org.apache.wicket.request.resource.ByteArrayResource; +import java.util.ArrayList; import java.util.Collection; import java.util.List; import java.util.stream.Collectors; @@ -53,19 +54,15 @@ public abstract class FocusSummaryPanel extends ObjectSumm private static final String ID_ACTIVATION_TAG = "activationTag"; -// private IModel> wrapperModel; - public FocusSummaryPanel(String id, Class type, final IModel model, ModelServiceLocator serviceLocator) { super(id, type, model, serviceLocator); - -// this.wrapperModel = model; } @Override - protected void onInitialize(){ - super.onInitialize(); + protected List> getSummaryTagComponentList(){ + List> summaryTagList = new ArrayList<>(); - SummaryTag tagActivation = new SummaryTag(ID_ACTIVATION_TAG, getModel()) { + SummaryTag tagActivation = new SummaryTag(ID_SUMMARY_TAG, getModel()) { private static final long serialVersionUID = 1L; @Override @@ -103,7 +100,8 @@ public boolean isVisible() { return isActivationVisible(); } }); - addTag(tagActivation); + summaryTagList.add(tagActivation); + return summaryTagList; } @Override diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/PageAdminObjectDetails.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/PageAdminObjectDetails.java index 0fae1fc96d6..e61cf39bfba 100755 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/PageAdminObjectDetails.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/PageAdminObjectDetails.java @@ -198,7 +198,7 @@ protected void reviveModels() throws SchemaException { public void initialize(final PrismObject objectToEdit) { - boolean isNewObject = objectToEdit == null; + boolean isNewObject = objectToEdit == null && StringUtils.isEmpty(getObjectOidParameter()); initialize(objectToEdit, isNewObject, false); } diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/resources/ResourceSummaryPanel.html b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/resources/ResourceSummaryPanel.html deleted file mode 100644 index 01d908d2935..00000000000 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/resources/ResourceSummaryPanel.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/resources/ResourceSummaryPanel.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/resources/ResourceSummaryPanel.java index 60b05ca45fb..88e76e7054d 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/resources/ResourceSummaryPanel.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/resources/ResourceSummaryPanel.java @@ -26,6 +26,9 @@ import com.evolveum.midpoint.web.model.ContainerableFromPrismObjectModel; import com.evolveum.midpoint.xml.ns._public.common.common_3.ResourceType; +import java.util.ArrayList; +import java.util.List; + public class ResourceSummaryPanel extends ObjectSummaryPanel { private static final long serialVersionUID = 1L; @@ -36,11 +39,18 @@ public ResourceSummaryPanel(String id, IModel model, ModelServiceL super(id, ResourceType.class, model, serviceLocator); } +// @Override +// protected void onBeforeRender() { +// super.onBeforeRender(); +// } + @Override - protected void onBeforeRender() { - super.onBeforeRender(); + protected List> getSummaryTagComponentList(){ boolean down = ResourceTypeUtil.isDown(getModelObject()); - SummaryTag summaryTag = new SummaryTag(ID_UP_DOWN_TAG, getModel()) { + + List> summaryTagList = new ArrayList<>(); + + SummaryTag summaryTag = new SummaryTag(ID_SUMMARY_TAG, getModel()) { private static final long serialVersionUID = 1L; @Override @@ -54,9 +64,11 @@ protected void initialize(ResourceType object) { } } }; - addTag(summaryTag); + summaryTagList.add(summaryTag); + return summaryTagList; } + @Override protected String getIconCssClass() { return GuiStyleConstants.CLASS_OBJECT_RESOURCE_ICON; diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/resources/ShadowSummaryPanel.html b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/resources/ShadowSummaryPanel.html deleted file mode 100644 index 90f6c975190..00000000000 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/resources/ShadowSummaryPanel.html +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/roles/component/RoleSummaryPanel.html b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/roles/component/RoleSummaryPanel.html deleted file mode 100644 index 101f2209cbb..00000000000 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/roles/component/RoleSummaryPanel.html +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/server/TaskSummaryPanel.html b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/server/TaskSummaryPanel.html index 5da1a8c26d0..90f9451ce8e 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/server/TaskSummaryPanel.html +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/server/TaskSummaryPanel.html @@ -18,9 +18,6 @@ - - - diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/server/TaskSummaryPanel.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/server/TaskSummaryPanel.java index fc23126e546..f4683b87845 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/server/TaskSummaryPanel.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/server/TaskSummaryPanel.java @@ -37,7 +37,9 @@ import org.apache.commons.lang3.time.DurationFormatUtils; import org.apache.wicket.model.IModel; +import java.util.ArrayList; import java.util.Date; +import java.util.List; /** * @author mederly @@ -65,7 +67,21 @@ public TaskSummaryPanel(String id, IModel model, IModel tagExecutionStatus = new SummaryTag(ID_TAG_EXECUTION_STATUS, getModel()) { + final AutoRefreshPanel refreshTag = new AutoRefreshPanel(ID_TAG_REFRESH, refreshModel, parentPage, true); + refreshTag.setOutputMarkupId(true); + refreshTag.add(new VisibleEnableBehaviour() { + @Override + public boolean isVisible() { + return parentPage.getTaskDto().getWorkflowOutcome() == null; // because otherwise there are too many tags to fit into window + } + } ); + getSummaryBoxPanel().add(refreshTag); + } + + @Override + protected List> getSummaryTagComponentList(){ + List> summaryTagList = new ArrayList<>(); + SummaryTag tagExecutionStatus = new SummaryTag(ID_SUMMARY_TAG, getModel()) { @Override protected void initialize(TaskType taskType) { TaskDtoExecutionStatus status = TaskDtoExecutionStatus.fromTaskExecutionStatus(taskType.getExecutionStatus(), taskType.getNodeAsObserved() != null); @@ -77,9 +93,9 @@ protected void initialize(TaskType taskType) { // TODO setColor } }; - addTag(tagExecutionStatus); + summaryTagList.add(tagExecutionStatus); - SummaryTag tagResult = new SummaryTag(ID_TAG_RESULT, getModel()) { + SummaryTag tagResult = new SummaryTag(ID_SUMMARY_TAG, getModel()) { @Override protected void initialize(TaskType taskType) { OperationResultStatusType resultStatus = taskType.getResultStatus(); @@ -91,9 +107,9 @@ protected void initialize(TaskType taskType) { // TODO setColor } }; - addTag(tagResult); + summaryTagList.add(tagResult); - SummaryTag tagOutcome = new SummaryTag(ID_TAG_WF_OUTCOME, getModel()) { + SummaryTag tagOutcome = new SummaryTag(ID_SUMMARY_TAG, getModel()) { @Override protected void initialize(TaskType taskType) { String icon, name; @@ -119,17 +135,9 @@ public boolean isVisible() { return parentPage.getTaskDto().getWorkflowOutcome() != null; } }); - addTag(tagOutcome); + summaryTagList.add(tagOutcome); - final AutoRefreshPanel refreshTag = new AutoRefreshPanel(ID_TAG_REFRESH, refreshModel, parentPage, true); - refreshTag.setOutputMarkupId(true); - refreshTag.add(new VisibleEnableBehaviour() { - @Override - public boolean isVisible() { - return parentPage.getTaskDto().getWorkflowOutcome() == null; // because otherwise there are too many tags to fit into window - } - } ); - addTag(refreshTag); + return summaryTagList; } private String getIconForExecutionStatus(TaskDtoExecutionStatus status) { @@ -289,6 +297,6 @@ public String getObject() { } public AutoRefreshPanel getRefreshPanel() { - return (AutoRefreshPanel) getTag(ID_TAG_REFRESH); + return (AutoRefreshPanel) getSummaryBoxPanel().get(ID_TAG_REFRESH); } } diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/users/component/OrgSummaryPanel.html b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/users/component/OrgSummaryPanel.html deleted file mode 100644 index 101f2209cbb..00000000000 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/users/component/OrgSummaryPanel.html +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/users/component/ServiceSummaryPanel.html b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/users/component/ServiceSummaryPanel.html deleted file mode 100644 index 101f2209cbb..00000000000 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/users/component/ServiceSummaryPanel.html +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/users/component/UserSummaryPanel.html b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/users/component/UserSummaryPanel.html deleted file mode 100644 index 8e3b164891d..00000000000 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/users/component/UserSummaryPanel.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/users/component/UserSummaryPanel.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/users/component/UserSummaryPanel.java index 1a4509505e2..526e9226b9d 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/users/component/UserSummaryPanel.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/users/component/UserSummaryPanel.java @@ -15,6 +15,7 @@ */ package com.evolveum.midpoint.web.page.admin.users.component; +import java.util.ArrayList; import java.util.List; import javax.xml.namespace.QName; @@ -49,9 +50,10 @@ public UserSummaryPanel(String id, IModel model, ModelServiceLocator s } @Override - protected void onInitialize(){ - super.onInitialize(); - SummaryTag tagSecurity = new SummaryTag(ID_TAG_SECURITY, getModel()) { + protected List> getSummaryTagComponentList(){ + List> summaryTagList = super.getSummaryTagComponentList(); + + SummaryTag tagSecurity = new SummaryTag(ID_SUMMARY_TAG, getModel()) { private static final long serialVersionUID = 1L; @Override @@ -92,9 +94,9 @@ protected void initialize(UserType object) { } } }; - addTag(tagSecurity); + summaryTagList.add(tagSecurity); - SummaryTag tagOrg = new SummaryTag(ID_TAG_ORG, getModel()) { + SummaryTag tagOrg = new SummaryTag(ID_SUMMARY_TAG, getModel()) { private static final long serialVersionUID = 1L; @Override @@ -127,7 +129,9 @@ protected void initialize(UserType object) { } } }; - addTag(tagOrg); + summaryTagList.add(tagOrg); + + return summaryTagList; } @Override diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/workflow/WorkItemSummaryPanel.html b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/workflow/WorkItemSummaryPanel.html deleted file mode 100644 index 87c4e095687..00000000000 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/workflow/WorkItemSummaryPanel.html +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/workflow/WorkItemSummaryPanel.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/workflow/WorkItemSummaryPanel.java index c760d782908..a3cec7adde6 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/workflow/WorkItemSummaryPanel.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/workflow/WorkItemSummaryPanel.java @@ -28,6 +28,9 @@ import com.evolveum.midpoint.xml.ns._public.common.common_3.WorkItemType; import org.apache.wicket.model.IModel; +import java.util.ArrayList; +import java.util.List; + import static org.apache.commons.lang3.ObjectUtils.defaultIfNull; /** @@ -47,10 +50,9 @@ public WorkItemSummaryPanel(String id, IModel model, IModel isAssignedTag = new SummaryTag(ID_ASSIGNED_TAG, getModel()) { + protected List> getSummaryTagComponentList(){ + List> summaryTagList = new ArrayList<>(); + SummaryTag isAssignedTag = new SummaryTag(ID_SUMMARY_TAG, getModel()) { @Override protected void initialize(WorkItemType workItem) { if (workItem.getAssigneeRef() != null) { @@ -62,7 +64,8 @@ protected void initialize(WorkItemType workItem) { } } }; - addTag(isAssignedTag); + summaryTagList.add(isAssignedTag); + return summaryTagList; } @Override From f39ae0f9f8e0995f5ac2cb0d248faf613e69aaf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Ga=C5=A1par=C3=ADk?= Date: Thu, 21 Feb 2019 10:31:40 +0100 Subject: [PATCH 051/224] Translation, WIP --- .../localization/Midpoint_cs.properties | 29 ++- .../localization/Midpoint_de.properties | 15 +- .../localization/Midpoint_en.properties | 15 +- .../localization/Midpoint_es.properties | 95 ++++++---- .../localization/Midpoint_et.properties | 15 +- .../localization/Midpoint_fi.properties | 15 +- .../localization/Midpoint_fr.properties | 173 +++++++++-------- .../localization/Midpoint_hu.properties | 15 +- .../localization/Midpoint_it.properties | 15 +- .../localization/Midpoint_ja.properties | 177 ++++++++++-------- .../localization/Midpoint_lt.properties | 121 ++++++------ .../localization/Midpoint_pl.properties | 15 +- .../localization/Midpoint_pt_BR.properties | 15 +- .../localization/Midpoint_ru.properties | 15 +- .../localization/Midpoint_sk.properties | 15 +- .../localization/Midpoint_tr.properties | 15 +- .../localization/Midpoint_zh_CN.properties | 15 +- .../localization/schema_cs.properties | 18 ++ .../localization/schema_de.properties | 18 ++ .../localization/schema_en.properties | 18 ++ .../localization/schema_es.properties | 18 ++ .../localization/schema_et.properties | 18 ++ .../localization/schema_fi.properties | 18 ++ .../localization/schema_fr.properties | 128 +++++++------ .../localization/schema_hu.properties | 18 ++ .../localization/schema_it.properties | 18 ++ .../localization/schema_ja.properties | 40 ++-- .../localization/schema_lt.properties | 56 ++++-- .../localization/schema_pl.properties | 18 ++ .../localization/schema_pt_BR.properties | 18 ++ .../localization/schema_ru.properties | 18 ++ .../localization/schema_sk.properties | 18 ++ .../localization/schema_tr.properties | 18 ++ .../localization/schema_zh_CN.properties | 18 ++ 34 files changed, 889 insertions(+), 362 deletions(-) diff --git a/gui/admin-gui/src/main/resources/localization/Midpoint_cs.properties b/gui/admin-gui/src/main/resources/localization/Midpoint_cs.properties index 5da01018ef8..369b3b26cf7 100644 --- a/gui/admin-gui/src/main/resources/localization/Midpoint_cs.properties +++ b/gui/admin-gui/src/main/resources/localization/Midpoint_cs.properties @@ -70,12 +70,12 @@ MetadataPanel.requestTimestamp=Čas žádosti MetadataPanel.requestorRef=Žadatel MetadataPanel.createTimestamp=Čas vytvoření MetadataPanel.creatorRef=Vytvořil -MetadataPanel.createApproverRef=Stvořit schvalovatele -MetadataPanel.createApprovalTimestamp=Čas stvoření schvalovatele +MetadataPanel.createApproverRef=Vytvořit schvalovatele +MetadataPanel.createApprovalTimestamp=Čas vytvoření schvalovatele MetadataPanel.modifyTimestamp=Čas úpravy MetadataPanel.modifierRef=Upravil MetadataPanel.modifyApproverRef=Upravit schvalovatele -MetadataPanel.modifyApprovalTimestamp=Čas úpravy schvalovatele +MetadataPanel.modifyApprovalTimestamp=Čas úpravy schválení RelationTypes.MANAGER=Manažer RelationTypes.OWNER=Vlastník RelationTypes.APPROVER=Schvalovatel @@ -88,13 +88,13 @@ RelationTypes.default=Výchozí DelegationEditorPanel.from=Od DelegationEditorPanel.to=Do DelegationEditorPanel.meLabel=Aktuální uživatel -DelegationEditorPanel.limitPrivilegesButton=Omezit výsady -DelegationEditorPanel.privileges=Přiřazení výsad +DelegationEditorPanel.limitPrivilegesButton=Omezit oprávnění +DelegationEditorPanel.privileges=Přiřazení oprávnění DelegationEditorPanel.workflowApprovals=Schvalování ve workflow DelegationEditorPanel.delegateApprovalWorkItems=Delegovat dokončení schválení pracovních položek DelegationEditorPanel.delegateCertificationWorkItems=Delegovat ověření certifikace pracovních položek -DelegationEditorPanel.allPrivilegesLabel=Delegovat všechna/vybraná přiřazení výsad -DelegationEditorPanel.noPrivilegesLabel=Žádné výsady +DelegationEditorPanel.allPrivilegesLabel=Delegovat všechna/vybraná přiřazení oprávnění +DelegationEditorPanel.noPrivilegesLabel=Žádná oprávnění DelegationEditorPanel.delegateManagementWorkItems=Delegovat dokončení případu správy pracovních položek DelegationEditorPanel.assignmentLimitations=Omezení přiřazení DelegationEditorPanel.allowTransitive=Povolit tranzitivní delegace @@ -3805,7 +3805,7 @@ operation.com.evolveum.midpoint.web.page.admin.workflow.PageProcessInstances.sto ColumnUtils.getUserIconColumn.createTitleModel.normal=obvyklý ColumnUtils.getUserIconColumn.createTitleModel.disabled=zakázaný ColumnUtils.getUserIconColumn.createTitleModel.archived=archivovaný -ColumnUtils.getUserIconColumn.createTitleModel.privileged=výsadní +ColumnUtils.getUserIconColumn.createTitleModel.privileged=oprávněný ColumnUtils.getUserIconColumn.createTitleModel.end-user=koncový uživatel ColumnUtils.getUserIconColumn.createTitleModel.manager=manažer ColumnUtils.getUserIconColumn.createTitleModel.broken=rozbitý @@ -3872,6 +3872,7 @@ PageAssignmentConflicts.back=Zpět PageAssignmentConflicts.submit=Odeslat PageAssignmentsList.conflictsWarning=Ve spočítání konfliktů přiřazení z důvodu brání problém s autorizací. Důvod: AbstractShoppingCartTabPanel.addAllButton=Přidat vše +AbstractShoppingCartTabPanel.goToShoppingCartButton=Jít do nákupního košíku AbstractShoppingCartTabPanel.requestingForLabel=Žádáno pro: AbstractShoppingCartTabPanel.availableRelationsLabel=Dostupné vztahy AssignmentCatalogPanel.selectTargetUser=Vybrat cílového uživatele @@ -3906,7 +3907,11 @@ AssignmentViewType.USER_TYPE=Přiřazení uživatele PageAssignmentsList.requestButton = Žádost operation.com.evolveum.midpoint.web.page.self.PageAssignmentsList.requestAssignments=Žádost o přiřazení com.evolveum.midpoint.web.page.self.PageAssignmentsList.requestAssignments=Žádosti o přiřazení +PageAssignmentsList.requestInProgress=Vaše žádost se právě zpracovává. Žádost může podléhat schválení nebo jinému manuálnímu nebo asynchronnímu zpracování. Poskytněte dostatek času na její zpracování. +PageAssignmentsList.requestSuccess=Vaše žádost byla zpracována. Přiřazení jsou připravena k použití. +PageAssignmentsList.requestError=Při zpracování žádosti došlo k chybě. PageAssignmentsList.title=Seznam nových přiřazení +PageAssignmentsList.assignmentsToRequest=Přiřazení ke schválení PageAuditLogViewer.title=Prohlížeč auditního deníku PageAuditLogViewer.menuName=Prohlížeč auditního deníku PageAuditLogViewer.timeLabel=Čas @@ -4209,8 +4214,13 @@ DisplayNamePanel.viewObjectDetails=Zobrazit podrobnosti o objektu PageUsersView.title=Zobrazení uživatelů pageAdminFocus.dataProtection=Ochrana dat PageInternals.title.cache=Mezipaměti +PageInternals.title.threads=Vlákna PageInternals.tab.cache=Správa mezipaměti +PageInternals.tab.threads=Vlákna InternalsCachePanel.button.clearCaches=Vyčistit mezipaměť +InternalsThreadsPanel.button.showAllThreads=Ukázat všechny vlákna +InternalsThreadsPanel.button.showTasksThreads=Ukázat vlákna serverových úloh +InternalsThreadsPanel.button.recordTasksThreads=Zaznamenat vlákna serverových úloh PageAccountActivation.user.not.found=Vyskytl se neočekávaný problém, kontaktujte správce systému. propertyConstraintValidator.error=Není možno nastavit vymezení vlastnosti s nedefinovanou cestou. ReferencePopupPanel.oid=Oid: @@ -4313,3 +4323,6 @@ LoggingConfigurationTabPanel.appender.patternColumn=Šablona LoggingConfigurationTabPanel.appender.typeColumn=Typ ResourceSummaryPanel.UP=Běžící ResourceSummaryPanel.DOWN=Vypnutý +operation.com.evolveum.midpoint.web.page.admin.configuration.InternalsThreadsPanel.executeShowAllThreads=Zobrazit všechna vlákna (Gui) +operation.com.evolveum.midpoint.web.page.admin.configuration.InternalsThreadsPanel.executeShowTasksThreads=Ukázat běžící vlákna serverových úloh (Gui) +operation.com.evolveum.midpoint.web.page.admin.configuration.InternalsThreadsPanel.executeRecordTasksThreads=Zaznamenat běžící vlákna serverových úloh (Gui) diff --git a/gui/admin-gui/src/main/resources/localization/Midpoint_de.properties b/gui/admin-gui/src/main/resources/localization/Midpoint_de.properties index 7bef7ead21b..c8cc5b86591 100644 --- a/gui/admin-gui/src/main/resources/localization/Midpoint_de.properties +++ b/gui/admin-gui/src/main/resources/localization/Midpoint_de.properties @@ -1010,7 +1010,7 @@ PageAbout.button.testRepositoryCheckOrgClosure=Überprüfe und repariere Konsist PageAbout.button.reindexRepositoryObjects=Erneutes indexieren der Verzeichnisobjekte PageAbout.button.testRepository=Verzeichnis-Selbsttest PageAbout.button.clearCssJsCache=CSS und JS cache löschen -PageAbout.button.factoryDefault=Werkseinstellungen wiederherstellen +PageAbout.button.factoryDefault=Reset to factory default PageAbout.message.deleteAllObjects=Wollen Sie wirklich alle Objekte löschen? Diese Aktion kann mehrere Minuten dauern. PageAbout.message.couldntObtainJvmParams=JVM Parameter konnte nicht via JMX nicht ausgelesen werden. PageAbout.midPointRevision=${git.describe} @@ -3872,6 +3872,7 @@ PageAssignmentConflicts.back=Zurück PageAssignmentConflicts.submit=Absenden PageAssignmentsList.conflictsWarning=Unable to calculate assignment conflicts due to authorization problem. Reason: AbstractShoppingCartTabPanel.addAllButton=Add all +AbstractShoppingCartTabPanel.goToShoppingCartButton=Go to shopping cart AbstractShoppingCartTabPanel.requestingForLabel=Requesting for AbstractShoppingCartTabPanel.availableRelationsLabel=Available relations AssignmentCatalogPanel.selectTargetUser=Wähle Zielbenutzer @@ -3906,7 +3907,11 @@ AssignmentViewType.USER_TYPE=Benutzer Zuweisungen PageAssignmentsList.requestButton = Antrag operation.com.evolveum.midpoint.web.page.self.PageAssignmentsList.requestAssignments=Antrag zuweisen com.evolveum.midpoint.web.page.self.PageAssignmentsList.requestAssignments=Zuweisungen anfordern +PageAssignmentsList.requestInProgress=Processing of your request is in progress. Your request may be subject to approval or other manual or asynchronous processing. Please allow sufficient time for the request to be processed. +PageAssignmentsList.requestSuccess=Your request has been processed. Assignments are ready to use. +PageAssignmentsList.requestError=There was an error processing your request. PageAssignmentsList.title=Neue Zuweisungslisten +PageAssignmentsList.assignmentsToRequest=Assignments to request PageAuditLogViewer.title=Audit Log Betrachter PageAuditLogViewer.menuName=Audit Log Betrachter PageAuditLogViewer.timeLabel=Zeit @@ -4209,8 +4214,13 @@ DisplayNamePanel.viewObjectDetails=View object details PageUsersView.title=Users view pageAdminFocus.dataProtection=Absicherung der Daten PageInternals.title.cache=Caches +PageInternals.title.threads=Threads PageInternals.tab.cache=Cache management +PageInternals.tab.threads=Threads InternalsCachePanel.button.clearCaches=Clear caches +InternalsThreadsPanel.button.showAllThreads=Show all threads +InternalsThreadsPanel.button.showTasksThreads=Show tasks threads +InternalsThreadsPanel.button.recordTasksThreads=Record tasks threads PageAccountActivation.user.not.found=Unexpected problem occurs. Please contact system administrator. propertyConstraintValidator.error=Cannot set property constraint without path defined. ReferencePopupPanel.oid=Oid: @@ -4313,3 +4323,6 @@ LoggingConfigurationTabPanel.appender.patternColumn=Muster LoggingConfigurationTabPanel.appender.typeColumn=Typ ResourceSummaryPanel.UP=Auf ResourceSummaryPanel.DOWN=Ab +operation.com.evolveum.midpoint.web.page.admin.configuration.InternalsThreadsPanel.executeShowAllThreads=Show all threads (Gui) +operation.com.evolveum.midpoint.web.page.admin.configuration.InternalsThreadsPanel.executeShowTasksThreads=Show running tasks threads (Gui) +operation.com.evolveum.midpoint.web.page.admin.configuration.InternalsThreadsPanel.executeRecordTasksThreads=Record running tasks threads (Gui) diff --git a/gui/admin-gui/src/main/resources/localization/Midpoint_en.properties b/gui/admin-gui/src/main/resources/localization/Midpoint_en.properties index f4b31c627a5..77de9d5eb90 100644 --- a/gui/admin-gui/src/main/resources/localization/Midpoint_en.properties +++ b/gui/admin-gui/src/main/resources/localization/Midpoint_en.properties @@ -1010,7 +1010,7 @@ PageAbout.button.testRepositoryCheckOrgClosure=Check and repair org closure cons PageAbout.button.reindexRepositoryObjects=Reindex repository objects PageAbout.button.testRepository=Repository self test PageAbout.button.clearCssJsCache=Clear CSS/JS cache -PageAbout.button.factoryDefault=Switch to factory default +PageAbout.button.factoryDefault=Reset to factory default PageAbout.message.deleteAllObjects=Do you really want to delete all objects? It may take several minutes. PageAbout.message.couldntObtainJvmParams=Couldn't obtain JVM parameters from JMX. PageAbout.midPointRevision=${git.describe} @@ -3872,6 +3872,7 @@ PageAssignmentConflicts.back=Back PageAssignmentConflicts.submit=Submit PageAssignmentsList.conflictsWarning=Unable to calculate assignment conflicts due to authorization problem. Reason: AbstractShoppingCartTabPanel.addAllButton=Add all +AbstractShoppingCartTabPanel.goToShoppingCartButton=Go to shopping cart AbstractShoppingCartTabPanel.requestingForLabel=Requesting for AbstractShoppingCartTabPanel.availableRelationsLabel=Available relations AssignmentCatalogPanel.selectTargetUser=Select target user @@ -3906,7 +3907,11 @@ AssignmentViewType.USER_TYPE=User's assignments PageAssignmentsList.requestButton = Request operation.com.evolveum.midpoint.web.page.self.PageAssignmentsList.requestAssignments=Request assignment com.evolveum.midpoint.web.page.self.PageAssignmentsList.requestAssignments=Request assignments +PageAssignmentsList.requestInProgress=Processing of your request is in progress. Your request may be subject to approval or other manual or asynchronous processing. Please allow sufficient time for the request to be processed. +PageAssignmentsList.requestSuccess=Your request has been processed. Assignments are ready to use. +PageAssignmentsList.requestError=There was an error processing your request. PageAssignmentsList.title=New assignments list +PageAssignmentsList.assignmentsToRequest=Assignments to request PageAuditLogViewer.title=Audit Log Viewer PageAuditLogViewer.menuName=Audit Log Viewer PageAuditLogViewer.timeLabel=Time @@ -4209,8 +4214,13 @@ DisplayNamePanel.viewObjectDetails=View object details PageUsersView.title=Users view pageAdminFocus.dataProtection=Data protection PageInternals.title.cache=Caches +PageInternals.title.threads=Threads PageInternals.tab.cache=Cache management +PageInternals.tab.threads=Threads InternalsCachePanel.button.clearCaches=Clear caches +InternalsThreadsPanel.button.showAllThreads=Show all threads +InternalsThreadsPanel.button.showTasksThreads=Show tasks threads +InternalsThreadsPanel.button.recordTasksThreads=Record tasks threads PageAccountActivation.user.not.found=Unexpected problem occurs. Please contact system administrator. propertyConstraintValidator.error=Cannot set property constraint without path defined. ReferencePopupPanel.oid=Oid: @@ -4313,3 +4323,6 @@ LoggingConfigurationTabPanel.appender.patternColumn=Pattern LoggingConfigurationTabPanel.appender.typeColumn=Type ResourceSummaryPanel.UP=Up ResourceSummaryPanel.DOWN=Down +operation.com.evolveum.midpoint.web.page.admin.configuration.InternalsThreadsPanel.executeShowAllThreads=Show all threads (Gui) +operation.com.evolveum.midpoint.web.page.admin.configuration.InternalsThreadsPanel.executeShowTasksThreads=Show running tasks threads (Gui) +operation.com.evolveum.midpoint.web.page.admin.configuration.InternalsThreadsPanel.executeRecordTasksThreads=Record running tasks threads (Gui) diff --git a/gui/admin-gui/src/main/resources/localization/Midpoint_es.properties b/gui/admin-gui/src/main/resources/localization/Midpoint_es.properties index 2700d59c492..1a0188c33c1 100644 --- a/gui/admin-gui/src/main/resources/localization/Midpoint_es.properties +++ b/gui/admin-gui/src/main/resources/localization/Midpoint_es.properties @@ -143,13 +143,13 @@ capabilityActivationPanel.label.disableList=Habilitar lista capabilityActivationPanel.label.enabledDisabled=Habilitado/Deshabilitado capabilityActivationPanel.label.enabled=Habilitado capabilityActivationPanel.label.enableList=Deshabilitar lista -capabilityActivationPanel.label.normalList=Normal list -capabilityActivationPanel.label.lockedList=Locked list +capabilityActivationPanel.label.normalList=Lista normal +capabilityActivationPanel.label.lockedList=Lista bloqueados capabilityActivationPanel.label.ignoreAttribute=Ignorar atributo capabilityActivationPanel.label.returnedByDefault=Regresado por defecto capabilityActivationPanel.label.status.message=Lo mismo como Habilitado/Deshabilitado capabilityActivationPanel.label.status=Estado -capabilityActivationPanel.label.lockout=Lockout +capabilityActivationPanel.label.lockout=Bloqueado capabilityActivationPanel.label.validFrom=Válido desde capabilityActivationPanel.label.validTo=Válido hasta capabilityActivationPanel.list.placeholder=Insertar valor @@ -1010,11 +1010,11 @@ PageAbout.button.testRepositoryCheckOrgClosure=Check and repair org closure cons PageAbout.button.reindexRepositoryObjects=Reindex repository objects PageAbout.button.testRepository=Autocomprobación del repositorio PageAbout.button.clearCssJsCache=Limpiar el cache de CSS/JS -PageAbout.button.factoryDefault=Switch to factory default +PageAbout.button.factoryDefault=Restaurar a valores de fábrica PageAbout.message.deleteAllObjects=Do you really want to delete all objects? It may take several minutes. PageAbout.message.couldntObtainJvmParams=No se pudo obtener los parámetros JVM desde JMX. PageAbout.midPointRevision=${git.describe} -PageAbout.builtAt=Build at +PageAbout.builtAt=Construido el PageAbout.build=${timestamp} PageAbout.midPointRevisionTitle=Descripción Git PageAbout.midPointVersion=${pom.version} @@ -1027,7 +1027,7 @@ PageAbout.repoDiag.implementationDescription=Descripción de la Implementación PageAbout.repoDiag.implementationShortName=Nombre de la Implementación PageAbout.repoDiag.isEmbedded=Está embebido PageAbout.repoDiag.repositoryUrl=URL del repositorio -PageAbout.title=About this system +PageAbout.title=Acerca del sistema PageAbout.title.basic=Basico PageAbout.title.jvmProperties=Propiedades de JVM PageAbout.title.provisioning=Provisionamiento @@ -1045,13 +1045,13 @@ PageAccounts.accounts.intent=Intención PageAccounts.accounts.kind=Tipo PageAccounts.accounts.name=Nombre PageAccounts.accounts.objectClass=Clase de objeto -PageAccounts.accounts.failedOperationType=Failed operation +PageAccounts.accounts.failedOperationType=Operación fallida PageAccounts.accounts.oid=Oid PageAccounts.accounts.owner=Propietario PageAccounts.accounts.result=Resultado PageAccounts.accounts.synchronizationSituation=Situación PageAccounts.accounts.synchronizationTimestamp=Timestamp -PageAccounts.accounts.pendingOperations=Pending operations +PageAccounts.accounts.pendingOperations=Operaciones pendientes PageAccounts.button.clearExportFolder=Limpiar carpeta de exportación PageAccounts.button.export=Exportar PageAccounts.button.load=Cargar @@ -1065,7 +1065,7 @@ PageAccounts.message.cantShowOwner=No se pueden mostrar los detalles del propiet PageAccounts.message.ownerNotFound=No se puede encontrar un propietario para la sombra con oid {0}. PageAccounts.message.unsupportedOwnerType=Tipo de propietario no soportado. pageAccounts.message.resourceNotSelected=Recurso no seleccionado. Por favor seleccione el recurso para mostrar sus shadows. -PageAccounts.message.success.clearExport=Export folder was cleared successfully +PageAccounts.message.success.clearExport=La carpeta de Exports ha sido limpiada satisfactoriamente PageAccounts.message.success.export=Exportado correctamente. Archivo exportado: {0}. PageAccounts.message.validationError=Valor buscado de objectClass: '{0}' no es válido. Por favor provea un valor de objectClass valido. PageAccounts.nothing=Nada @@ -1080,7 +1080,7 @@ PageAccounts.unmatched=No coincidente PageAccount.title=Cuenta '{0}' on '{1}' PageAccount.tab.details=Detalles pageAdmin.certification=Certificación -pageAdmin.certification.description=Certifications, recertifications +pageAdmin.certification.description=Certificaciones, recertificaciones pageAdmin.configuration=Configuración pageAdmin.configuration.description=Securidad, logging, importación pageAdmin.home.description=Comenzar aquí @@ -1092,7 +1092,7 @@ PageAdmin.menu.top.certification.decisions=Mis elementos de trabajo PageAdmin.menu.top.certification.definitions=Definiciones de campaña PageAdmin.menu.top.certification.newDefinition=Nueva definición de campaña PageAdmin.menu.top.certification.viewDefinition=Ver definición de campaña -PageAdmin.menu.top.configuration.about=About +PageAdmin.menu.top.configuration.about=Acerca de PageAdmin.menu.top.configuration.basic=Sistema PageAdmin.menu.top.configuration.bulkActions=Acciones masivas PageAdmin.menu.top.configuration.repoQuery=Query playground @@ -1111,31 +1111,31 @@ PageAdmin.menu.top.configuration.workflow=Configuración de flujos de trabajo PageAdmin.menu.top.configuration.roleManagement=Administración de roles PageAdmin.menu.top.configuration.accessCertification=Certificación de accesos PageAdmin.menu.top.configuration.infrastructure=Infraestructura -PageAdmin.menu.top.configuration.fullTextSearch=Full text earch +PageAdmin.menu.top.configuration.fullTextSearch=Búsqueda de texto completo PageAdmin.menu.top.configuration.logging=Logging PageAdmin.menu.top.configuration.deploymentInformation=Información de implementación PageAdmin.menu.top.configuration.notifications=Notificaciones PageAdmin.menu.top.configuration.profiling=Profiling PageAdmin.menu.top.configuration.adminGui=Admin GUI PageAdmin.menu.top.configuration.repositoryObjects=Objetos del repositorio -PageAdmin.menu.top.configuration.repositoryObjectsList=All objects +PageAdmin.menu.top.configuration.repositoryObjectsList=Todos los objetos PageAdmin.menu.top.configuration.security=Securidad PageAdmin.menu.top.home=Inicio PageAdmin.menu.top.reports.created=Informes creados -PageAdmin.menu.top.reports.list=All reports +PageAdmin.menu.top.reports.list=Todos los reportes PageAdmin.menu.top.reports.new=Importar reporte Jasper PageAdmin.menu.top.reports=Informes PageAdmin.menu.top.resources.import=Importar definición de recurso -PageAdmin.menu.top.resources.list=All resources +PageAdmin.menu.top.resources.list=Todos los recursos PageAdmin.menu.top.resources.new=Nuevo recuros PageAdmin.menu.top.resources.view=Ver recurso PageAdmin.menu.top.resources.edit=Editar recurso PageAdmin.menu.top.resources=Recursos PageAdmin.menu.top.connectorHosts.list=All connector hosts -PageAdmin.menu.top.roles.list=All roles +PageAdmin.menu.top.roles.list=Todos los roles PageAdmin.menu.top.roles.new=Nuevo rol PageAdmin.menu.top.roles=Roles -PageAdmin.menu.top.serverTasks.list=All tasks +PageAdmin.menu.top.serverTasks.list=Todas las tareas PageAdmin.menu.top.serverTasks.new=Nueva tarea PageAdmin.menu.top.serverTasks=Tareas del servidor PageAdmin.menu.top.users.find=Encontrar usuarios @@ -1242,7 +1242,7 @@ pageAdmin.resources.description=Sistemas conectados pageAdminResources.detailsResource=Detalles del recurso pageAdminResources.editResource=Editar recurso pageAdminResources.importResource=Importar recurso -pageAdminResources.listResources=All resources +pageAdminResources.listResources=Todos los recursos pageAdminResources.message.cantLoadResource=No se pudo cargar los detalles del recurso. pageAdminResources.newResource=Nuevo recurso pageAdmin.resources=Recursos @@ -1269,25 +1269,25 @@ PageBase.button.update=Actualizar PageBase.clearCssCache=Limpiar el cache less/js pageBase.midPointVersion=${pom.version}, ${git.describe} pageBase.unknownBuildNumber=unknown -PageBase.subscriptionMessage=Non-subscription. -PageBase.nonActiveSubscriptionMessage=No active subscription. Please support midPoint by purchasing a subscription. -PageBase.demoSubscriptionMessage=Demo subscription. +PageBase.subscriptionMessage=Sin suscripción +PageBase.nonActiveSubscriptionMessage=No tiene ninguna suscripción activa. Por favor soporte midPoint comprando una suscripción. +PageBase.demoSubscriptionMessage=Suscripción Demo PageBulkAction.async=Asíncrono PageBulkAction.button.start=Iniciar PageBulkAction.message.emptyString=La acción de llenado está vacía. Por favor provea un script no vacío. PageBulkAction.options=Opciones PageBulkAction.title=Acciones de llenado de usuario -PageBulkAction.message.startPerformed.inProgress={0} has been successfully submitted to execution +PageBulkAction.message.startPerformed.inProgress={0} ha sido presentado para ejecución satisfactoriamente. PageBulkAction.message.startPerformed.success=Action executed. Returned {0} item(s). Console and data output available via 'Export to XML' function. -PageBulkAction.message.startPerformed.fatalError.execute=Couldn't execute bulk action -PageBulkAction.message.startPerformed.fatalError.submit=Couldn't submit bulk action to execution -PageBulkAction.message.startPerformed.fatalError.parse=Couldn't parse bulk action object -PageBulkAction.message.startPerformed.fatalError.provided=No bulk action object was provided. +PageBulkAction.message.startPerformed.fatalError.execute=No se ha podido ejecutar la acción masiva +PageBulkAction.message.startPerformed.fatalError.submit=No se ha podido enviar la acción masiva para su ejecución +PageBulkAction.message.startPerformed.fatalError.parse=No se ha podido procesar el objeto de acción masiva +PageBulkAction.message.startPerformed.fatalError.provided=No se ha proporcionado ningún objeto de acción masiva PageBulkAction.message.startPerformed.fatalError.notBulkAction=Provided text is not a bulk action object. An instance of {0} is expected; you have provided {1} instead. -PageRepositoryQuery.title=Repository query -PageRepositoryQuery.button.translateAndExecute=Translate and execute -PageRepositoryQuery.button.translate=Translate to hibernate query -PageRepositoryQuery.button.useInObjectList=Use in object list +PageRepositoryQuery.title=Consulta al repositorio +PageRepositoryQuery.button.translateAndExecute=Traducir y ejecutar +PageRepositoryQuery.button.translate=Traducir a una consulta hibernate +PageRepositoryQuery.button.useInObjectList=Usar en lista de objetos PageRepositoryQuery.button.execute=Ejecutar PageRepositoryQuery.message.emptyString=Entered query string is empty. Please provide non-empty query string. PageRepositoryQuery.result=Resultado @@ -1300,20 +1300,20 @@ PageRepositoryQuery.hibernateQuery=Hibernate query PageRepositoryQuery.hibernateParameters=Query parameters PageRepositoryQuery.hibernateParametersNote=Note: The parameters are shown here only to indicate how midPoint query is translated into hibernate query. They are not used when manually executing a hibernate query, so the query you enter here should contain no references to parameters. PageRepositoryQuery.incompleteResultsNote=Because you do not have administrator rights, results shown here were probably filtered by applying additional search conditions derived from your authorizations. These additional conditions are not visible in the hibernate query shown above. -PageRepositoryQuery.chooseSample=Or use a sample: +PageRepositoryQuery.chooseSample=O use un ejemplo: PageRepositoryQuery.sample.ObjectType_AllObjectsInAnOrg=All objects in an organization (directly) PageRepositoryQuery.sample.ObjectType_AllObjectsInASubtree=Todos los objetos en el sub-árbol PageRepositoryQuery.sample.OrgType_AllRootOrgs=All organizational roots PageRepositoryQuery.sample.OrgType_OrgOfType1=Organizations of type "type1" PageRepositoryQuery.sample.UserType_AllUsers=Todos los usuarios -PageRepositoryQuery.sample.UserType_UsersStartingWithA=Users starting with "a" (normalized) -PageRepositoryQuery.sample.UserType_UsersContainingJack=Users containing "jack" in a name (normalized) -PageRepositoryQuery.sample.UserType_UsersNamedJack=Users with a given name of "jack" (normalized) +PageRepositoryQuery.sample.UserType_UsersStartingWithA=Usuarios comenzando con "a" (normalizado) +PageRepositoryQuery.sample.UserType_UsersContainingJack=Usuarios conteniendo "jack" en el nombre (normalizado) +PageRepositoryQuery.sample.UserType_UsersNamedJack=Usuarios con el nombre "jack" (normalizado) PageRepositoryQuery.sample.UserType_First10UsersStartingWithA=Primeros 10 usuarios que empiecen con "a" -PageRepositoryQuery.sample.UserType_UsersWithAGivenMailDomain=Users with a given mail domain -PageRepositoryQuery.sample.UserType_UsersThatHaveAssignedRole=Users that have a direct assignment of a role -PageRepositoryQuery.sample.UserType_UsersThatHaveARole=Users that have active assignment of a role -PageRepositoryQuery.sample.UserType_SpecifiedCostCenters=Users in cost centers 100000-999999 or X100-X999 +PageRepositoryQuery.sample.UserType_UsersWithAGivenMailDomain=Usuarios con un dominio de correo determinado +PageRepositoryQuery.sample.UserType_UsersThatHaveAssignedRole=Usuarios que tienen una asignación directa a un rol +PageRepositoryQuery.sample.UserType_UsersThatHaveARole=Usuarios que tienen una asignación activa a un rol +PageRepositoryQuery.sample.UserType_SpecifiedCostCenters=Usuarios en centro de costos 100000-999999 o X100-X999 PageRepositoryQuery.sample.ShadowType_ShadowsOnGivenResource=Shadows on a given resource PageRepositoryQuery.sample.UserType_UsersWithShadowOnGivenResource=Users with linked shadow on a given resource PageRepositoryQuery.queryVsFilterNote=Note: midPoint query contains a filter along with paging instruction, wrapped together within the <query> element. In contrast, when used in "Advanced filter" in GUI, only the <filter> sub-element is applicable. Paging is managed by the GUI itself. @@ -2075,7 +2075,7 @@ pageServices.message.confirmationMessageForSingleObject.members=Do you really wa pageRoles.message.nothingSelected=No se ha seleccionado rol. pageRoles.message.queryError=Error ocurrido durante la búsqueda de la traducción consulta de búsqueda para filtrar. pageRoles.requestable=Solicitable -PageRoles.title=All roles +PageRoles.title=Todos los roles pageSecurityQuestions.message.WrongAnswer=Preguntas No Respondidas Correctamente pageSecurityQuestions.message.noPolicySet=No hay política de contraseñas configurada PageSecurityQuestions.title=Preguntas de Seguridad @@ -3309,7 +3309,7 @@ TreeTablePanel.warning.childrenExist=Organization which is going to be deleted h Type.AUDIT=Auditar type.nullValid=Elija uno Type.RECONCILIATION=Reconciliación -typeSelect.null=All roles +typeSelect.null=Todos los roles Type.USERS=Usuario TypedAssignablePanel.message.addFilterToContentQuery.fatalError=No se pudieron cargar los roles disponibles UploadPanel.delete.tooltip=Eliminar archivo @@ -3850,7 +3850,7 @@ PageEvaluateMapping.message.emptyString=Please provide a mapping to execute. PageEvaluateMapping.result=Resultado PageEvaluateMapping.mapping=Mapeo PageEvaluateMapping.request=Requerimiento -PageEvaluateMapping.chooseSample=Or use a sample: +PageEvaluateMapping.chooseSample=O use un ejemplo: PageEvaluateMapping.sample.FullName_NoDelta=Full name mapping (no change) PageEvaluateMapping.sample.FullName_Delta=Full name mapping (change in givenName) PageEvaluateMapping.sample.FullName_Delta_Ref=Full name mapping (change in givenName); source from repository @@ -3872,6 +3872,7 @@ PageAssignmentConflicts.back=Atrás PageAssignmentConflicts.submit=Confirmar PageAssignmentsList.conflictsWarning=No se puede calcular los conflictos de la asignación debido a problemas de autorización. Motivo: AbstractShoppingCartTabPanel.addAllButton=Agregar todos +AbstractShoppingCartTabPanel.goToShoppingCartButton=Go to shopping cart AbstractShoppingCartTabPanel.requestingForLabel=Solicitando para AbstractShoppingCartTabPanel.availableRelationsLabel=Relaciones disponibles AssignmentCatalogPanel.selectTargetUser=Seleccione el usuario objetivo @@ -3906,7 +3907,11 @@ AssignmentViewType.USER_TYPE=Asignaciones de usuarios PageAssignmentsList.requestButton = Solicitar operation.com.evolveum.midpoint.web.page.self.PageAssignmentsList.requestAssignments=Solicitar asignación com.evolveum.midpoint.web.page.self.PageAssignmentsList.requestAssignments=Solicitar asignaciones +PageAssignmentsList.requestInProgress=Processing of your request is in progress. Your request may be subject to approval or other manual or asynchronous processing. Please allow sufficient time for the request to be processed. +PageAssignmentsList.requestSuccess=Your request has been processed. Assignments are ready to use. +PageAssignmentsList.requestError=There was an error processing your request. PageAssignmentsList.title=Listado de nuevas asignaciones +PageAssignmentsList.assignmentsToRequest=Assignments to request PageAuditLogViewer.title=Vista del registro de auditoria PageAuditLogViewer.menuName=Vista del registro de auditoria PageAuditLogViewer.timeLabel=Tiempo @@ -4209,8 +4214,13 @@ DisplayNamePanel.viewObjectDetails=Ver detalles del objeto PageUsersView.title=Vista de usuarios pageAdminFocus.dataProtection=Protección de datos PageInternals.title.cache=Caché +PageInternals.title.threads=Threads PageInternals.tab.cache=Gestión de caché +PageInternals.tab.threads=Threads InternalsCachePanel.button.clearCaches=Limpiar caché +InternalsThreadsPanel.button.showAllThreads=Show all threads +InternalsThreadsPanel.button.showTasksThreads=Show tasks threads +InternalsThreadsPanel.button.recordTasksThreads=Record tasks threads PageAccountActivation.user.not.found=Unexpected problem occurs. Please contact system administrator. propertyConstraintValidator.error=Cannot set property constraint without path defined. ReferencePopupPanel.oid=Oid: @@ -4313,3 +4323,6 @@ LoggingConfigurationTabPanel.appender.patternColumn=Patrón LoggingConfigurationTabPanel.appender.typeColumn=Tipo ResourceSummaryPanel.UP=Arriba ResourceSummaryPanel.DOWN=Abajo +operation.com.evolveum.midpoint.web.page.admin.configuration.InternalsThreadsPanel.executeShowAllThreads=Show all threads (Gui) +operation.com.evolveum.midpoint.web.page.admin.configuration.InternalsThreadsPanel.executeShowTasksThreads=Show running tasks threads (Gui) +operation.com.evolveum.midpoint.web.page.admin.configuration.InternalsThreadsPanel.executeRecordTasksThreads=Record running tasks threads (Gui) diff --git a/gui/admin-gui/src/main/resources/localization/Midpoint_et.properties b/gui/admin-gui/src/main/resources/localization/Midpoint_et.properties index cf1ff905bce..1dde2e17396 100644 --- a/gui/admin-gui/src/main/resources/localization/Midpoint_et.properties +++ b/gui/admin-gui/src/main/resources/localization/Midpoint_et.properties @@ -1010,7 +1010,7 @@ PageAbout.button.testRepositoryCheckOrgClosure=Kontrolli ja paranda org-de sulun PageAbout.button.reindexRepositoryObjects=Reindekseeri hoidla objektid PageAbout.button.testRepository=Hoidla enesetest PageAbout.button.clearCssJsCache=Clear CSS/JS cache -PageAbout.button.factoryDefault=Switch to factory default +PageAbout.button.factoryDefault=Reset to factory default PageAbout.message.deleteAllObjects=Do you really want to delete all objects? It may take several minutes. PageAbout.message.couldntObtainJvmParams=JMX-st ei õnnestunud saada JVM parameetreid. PageAbout.midPointRevision=${git.describe} @@ -3872,6 +3872,7 @@ PageAssignmentConflicts.back=Tagasi PageAssignmentConflicts.submit=Edasta PageAssignmentsList.conflictsWarning=Unable to calculate assignment conflicts due to authorization problem. Reason: AbstractShoppingCartTabPanel.addAllButton=Add all +AbstractShoppingCartTabPanel.goToShoppingCartButton=Go to shopping cart AbstractShoppingCartTabPanel.requestingForLabel=Requesting for AbstractShoppingCartTabPanel.availableRelationsLabel=Available relations AssignmentCatalogPanel.selectTargetUser=Vali sihtkasutaja @@ -3906,7 +3907,11 @@ AssignmentViewType.USER_TYPE=Kasutaja omistused PageAssignmentsList.requestButton = Taotle operation.com.evolveum.midpoint.web.page.self.PageAssignmentsList.requestAssignments=Taotle omistus com.evolveum.midpoint.web.page.self.PageAssignmentsList.requestAssignments=Taotle omistused +PageAssignmentsList.requestInProgress=Processing of your request is in progress. Your request may be subject to approval or other manual or asynchronous processing. Please allow sufficient time for the request to be processed. +PageAssignmentsList.requestSuccess=Your request has been processed. Assignments are ready to use. +PageAssignmentsList.requestError=There was an error processing your request. PageAssignmentsList.title=Uute omistuste nimekiri +PageAssignmentsList.assignmentsToRequest=Assignments to request PageAuditLogViewer.title=Auditilogivaatur PageAuditLogViewer.menuName=Auditilogivaatur PageAuditLogViewer.timeLabel=Aeg @@ -4209,8 +4214,13 @@ DisplayNamePanel.viewObjectDetails=View object details PageUsersView.title=Users view pageAdminFocus.dataProtection=Data protection PageInternals.title.cache=Caches +PageInternals.title.threads=Threads PageInternals.tab.cache=Cache management +PageInternals.tab.threads=Threads InternalsCachePanel.button.clearCaches=Clear caches +InternalsThreadsPanel.button.showAllThreads=Show all threads +InternalsThreadsPanel.button.showTasksThreads=Show tasks threads +InternalsThreadsPanel.button.recordTasksThreads=Record tasks threads PageAccountActivation.user.not.found=Unexpected problem occurs. Please contact system administrator. propertyConstraintValidator.error=Cannot set property constraint without path defined. ReferencePopupPanel.oid=Oid: @@ -4313,3 +4323,6 @@ LoggingConfigurationTabPanel.appender.patternColumn=Muster LoggingConfigurationTabPanel.appender.typeColumn=Tüüp ResourceSummaryPanel.UP=Toimib ResourceSummaryPanel.DOWN=Ei toimi +operation.com.evolveum.midpoint.web.page.admin.configuration.InternalsThreadsPanel.executeShowAllThreads=Show all threads (Gui) +operation.com.evolveum.midpoint.web.page.admin.configuration.InternalsThreadsPanel.executeShowTasksThreads=Show running tasks threads (Gui) +operation.com.evolveum.midpoint.web.page.admin.configuration.InternalsThreadsPanel.executeRecordTasksThreads=Record running tasks threads (Gui) diff --git a/gui/admin-gui/src/main/resources/localization/Midpoint_fi.properties b/gui/admin-gui/src/main/resources/localization/Midpoint_fi.properties index f9367d4d5a9..a79d5f26405 100644 --- a/gui/admin-gui/src/main/resources/localization/Midpoint_fi.properties +++ b/gui/admin-gui/src/main/resources/localization/Midpoint_fi.properties @@ -1010,7 +1010,7 @@ PageAbout.button.testRepositoryCheckOrgClosure=Tarkista ja korjaa org sulkemisjo PageAbout.button.reindexRepositoryObjects=Luetteloi uudestaan säilö objektit PageAbout.button.testRepository=Säilön itse-testaus PageAbout.button.clearCssJsCache=Tyhennä CSS/js välimuisti -PageAbout.button.factoryDefault=Switch to factory default +PageAbout.button.factoryDefault=Reset to factory default PageAbout.message.deleteAllObjects=Do you really want to delete all objects? It may take several minutes. PageAbout.message.couldntObtainJvmParams=Ei pystytty noukkimaan JVM parametrejä JMXstä. PageAbout.midPointRevision=${git.describe} @@ -3872,6 +3872,7 @@ PageAssignmentConflicts.back=Takaisin PageAssignmentConflicts.submit=Kirjaa PageAssignmentsList.conflictsWarning=Unable to calculate assignment conflicts due to authorization problem. Reason: AbstractShoppingCartTabPanel.addAllButton=Add all +AbstractShoppingCartTabPanel.goToShoppingCartButton=Go to shopping cart AbstractShoppingCartTabPanel.requestingForLabel=Requesting for AbstractShoppingCartTabPanel.availableRelationsLabel=Available relations AssignmentCatalogPanel.selectTargetUser=Valitse kohteen käyttäjä @@ -3906,7 +3907,11 @@ AssignmentViewType.USER_TYPE=Käyttäjän toimeksiannot PageAssignmentsList.requestButton = Pyyntö operation.com.evolveum.midpoint.web.page.self.PageAssignmentsList.requestAssignments=Pyydä toimeksiantoa com.evolveum.midpoint.web.page.self.PageAssignmentsList.requestAssignments=Pyydä toimeksiantoja +PageAssignmentsList.requestInProgress=Processing of your request is in progress. Your request may be subject to approval or other manual or asynchronous processing. Please allow sufficient time for the request to be processed. +PageAssignmentsList.requestSuccess=Your request has been processed. Assignments are ready to use. +PageAssignmentsList.requestError=There was an error processing your request. PageAssignmentsList.title=Uudet toimeksiannot lista +PageAssignmentsList.assignmentsToRequest=Assignments to request PageAuditLogViewer.title=Tarkastuslogin Katselija PageAuditLogViewer.menuName=Tarkastuslogin Katselija PageAuditLogViewer.timeLabel=Aika @@ -4209,8 +4214,13 @@ DisplayNamePanel.viewObjectDetails=View object details PageUsersView.title=Users view pageAdminFocus.dataProtection=Data protection PageInternals.title.cache=Caches +PageInternals.title.threads=Threads PageInternals.tab.cache=Cache management +PageInternals.tab.threads=Threads InternalsCachePanel.button.clearCaches=Clear caches +InternalsThreadsPanel.button.showAllThreads=Show all threads +InternalsThreadsPanel.button.showTasksThreads=Show tasks threads +InternalsThreadsPanel.button.recordTasksThreads=Record tasks threads PageAccountActivation.user.not.found=Unexpected problem occurs. Please contact system administrator. propertyConstraintValidator.error=Cannot set property constraint without path defined. ReferencePopupPanel.oid=Oid: @@ -4313,3 +4323,6 @@ LoggingConfigurationTabPanel.appender.patternColumn=Kaava LoggingConfigurationTabPanel.appender.typeColumn=Tyyppi ResourceSummaryPanel.UP=Ylös ResourceSummaryPanel.DOWN=Alhaalla +operation.com.evolveum.midpoint.web.page.admin.configuration.InternalsThreadsPanel.executeShowAllThreads=Show all threads (Gui) +operation.com.evolveum.midpoint.web.page.admin.configuration.InternalsThreadsPanel.executeShowTasksThreads=Show running tasks threads (Gui) +operation.com.evolveum.midpoint.web.page.admin.configuration.InternalsThreadsPanel.executeRecordTasksThreads=Record running tasks threads (Gui) diff --git a/gui/admin-gui/src/main/resources/localization/Midpoint_fr.properties b/gui/admin-gui/src/main/resources/localization/Midpoint_fr.properties index e51c118e1ef..6d73ba31d22 100644 --- a/gui/admin-gui/src/main/resources/localization/Midpoint_fr.properties +++ b/gui/admin-gui/src/main/resources/localization/Midpoint_fr.properties @@ -51,7 +51,7 @@ AssignmentEditorPanel.member=Membre AssignmentEditorPanel.name.focus=(correspondance du foyer) AssignmentEditorPanel.name.noTarget=(aucune cible) AssignmentEditorPanel.orgRef=Entité organisationnelle / Projet -AssignmentEditorPanel.relation.notSpecified="Non spécifié" +AssignmentEditorPanel.relation.notSpecified=« Non spécifié » AssignmentEditorPanel.relation=Relation AssignmentEditorPanel.resource=Ressource AssignmentEditorPanel.showEmpty=Afficher si vide @@ -473,8 +473,8 @@ LimitationsEditorDialog.label.presentation=Présentation LimitationsEditorDialog.label.propertyAccess=Accès à la propriété LimitationsEditorDialog.label.read=Lire LimitationsEditorDialog.label.schema=Schéma -logger.duplicate=Un enregistreur avec le nom « {0} » est déjà défini -logger.emptyLogger=Un enregistreur ne doit pas être vide +logger.duplicate=Un consignateur avec le nom « {0} » est déjà défini +logger.emptyLogger=Un consignateur ne doit pas être vide LoggingConfigPanel.appender=Ajouteur LoggingConfigPanel.appenders=Ajouteurs LoggingConfigPanel.appenders.appending=Ajout @@ -487,20 +487,20 @@ LoggingConfigPanel.appenders.name=Nom LoggingConfigPanel.appenders.pattern=Motif LoggingConfigPanel.audit=Audit LoggingConfigPanel.auditLog=Journal d'audit -LoggingConfigPanel.button.addClassLogger=Ajouter un enregistreur -LoggingConfigPanel.button.addComponentLogger=Ajouter un enregistreur de composant +LoggingConfigPanel.button.addClassLogger=Ajouter un consignateur +LoggingConfigPanel.button.addComponentLogger=Ajouter un consignateur de composant LoggingConfigPanel.button.addConsoleAppender=Ajouter un ajouteur en console LoggingConfigPanel.button.addFileAppender=Ajouter un ajouteur en fichier -LoggingConfigPanel.button.addStandardLogger=Ajouter un enregistreur standard +LoggingConfigPanel.button.addStandardLogger=Ajouter un consignateur standard LoggingConfigPanel.button.deleteAppender=Supprimer l'ajouteur -LoggingConfigPanel.button.deleteLogger=Supprimer l'enregistreur +LoggingConfigPanel.button.deleteLogger=Supprimer le consignateur LoggingConfigPanel.button.reset=Réinitialiser LoggingConfigPanel.button.save=Enregistrer LoggingConfigPanel.details=Détails -LoggingConfigPanel.logger=Enregistreur +LoggingConfigPanel.logger=Consignateur LoggingConfigPanel.loggersAppender=Ajouteur LoggingConfigPanel.loggersLevel=Niveau -LoggingConfigPanel.loggers=Enregistreurs +LoggingConfigPanel.loggers=Consignateurs LoggingConfigPanel.profiling.dumpInterval=Intervalle de vidage LoggingConfigPanel.profiling.dumpInterval.placeholder=Intervalle de vidage LoggingConfigPanel.profiling.dumpInterval.tooltip=Spécifiez la valeur en minutes (la valeur par défaut est 30 min.) @@ -518,7 +518,7 @@ LoggingConfigPanel.profiling.subsystem.taskManager=Gestionnaire de tâches LoggingConfigPanel.profiling.subsystem.ucf=UCF LoggingConfigPanel.profiling.subsystem.workflow=Workflow LoggingConfigPanel.rootAppender=Ajouteur racine -LoggingConfigPanel.rootLogger=Enregistreur racine +LoggingConfigPanel.rootLogger=Consignateur racine LoggingConfigPanel.subsystem.appender=Ajouteur LoggingConfigPanel.subsystem.level=Niveau LoggingConfigurationTabPanel.loggers.package=Paquet @@ -527,7 +527,7 @@ LoggingConfigurationTabPanel.loggers.appender=Ajouteur lower.ActivationStatusType.ARCHIVED=archivé lower.ActivationStatusType.DISABLED=désactivé lower.ActivationStatusType.ENABLED=activé -lower.ActivationStatusType.null=Non défini +lower.ActivationStatusType.null=non défini mainForm.category.null=Tout mainForm.mailServer.nullValid=Choisissez... mainForm.state.null=Tout @@ -622,7 +622,7 @@ NavigatorPanel.lastLink=>> NavigatorPanel.nextLink=> NavigatorPanel.previousLink=< NodeExecutionStatus.COMMUNICATION_ERROR=Injoignable -NodeExecutionStatus.DOWN=éteint +NodeExecutionStatus.DOWN=Éteint NodeExecutionStatus.ERROR=Erreur NodeExecutionStatus.PAUSED=Arrêté NodeExecutionStatus.RUNNING=En cours d'exécution @@ -645,7 +645,7 @@ ObjectPolicyDialog.button.cancel=Annuler ObjectPolicyDialog.button.save=Enregistrer ObjectPolicyDialog.label=Éditer une politique d'objet ObjectPolicyDialog.label.oidBound.help=OID lié - La valeur de la propriété sera liée à l'OID. Cette propriété sera définie sur la valeur de l'OID et ne peut pas être changée. -ObjectPolicyDialog.propertyConstraint=Contrainte sur la propriété +ObjectPolicyDialog.propertyConstraint=Contraintes sur les propriétés ObjectPolicyDialog.conflictResolution=Résolution de conflit ObjectPolicyDialog.present=(présent) ObjectPolicyDialog.property.placeholder=Insérer un chemin de propriété @@ -1010,7 +1010,7 @@ PageAbout.button.testRepositoryCheckOrgClosure=Contrôler et réparer la cohére PageAbout.button.reindexRepositoryObjects=Réindexer les objets du dépôt PageAbout.button.testRepository=Autotest du dépôt PageAbout.button.clearCssJsCache=Vider le cache CSS/JS -PageAbout.button.factoryDefault=Basculer vers les réglages d'usine +PageAbout.button.factoryDefault=Reset to factory default PageAbout.message.deleteAllObjects=Voulez-vous vraiment supprimer tous les objets ? Cela peut prendre plusieurs minutes. PageAbout.message.couldntObtainJvmParams=Impossible d'obtenir les paramètres JVM depuis JMX. PageAbout.midPointRevision=${git.describe} @@ -1076,7 +1076,7 @@ PageAccounts.summary=Résumé PageAccounts.title=Détails de la synchronisation des reflets PageAccounts.total=Total PageAccounts.unlinked=Dissocié -PageAccounts.unmatched=Non-appariés +PageAccounts.unmatched=Non-apparié PageAccount.title=Compte « {0} » sur « {1} » PageAccount.tab.details=Détails pageAdmin.certification=Certification @@ -1118,24 +1118,24 @@ PageAdmin.menu.top.configuration.notifications=Notifications PageAdmin.menu.top.configuration.profiling=Profilage PageAdmin.menu.top.configuration.adminGui=Interface graphique d'administration PageAdmin.menu.top.configuration.repositoryObjects=Objets du dépôt -PageAdmin.menu.top.configuration.repositoryObjectsList=All objects +PageAdmin.menu.top.configuration.repositoryObjectsList=Tous les objets PageAdmin.menu.top.configuration.security=Sécurité PageAdmin.menu.top.home=Accueil PageAdmin.menu.top.reports.created=Rapports produits -PageAdmin.menu.top.reports.list=All reports +PageAdmin.menu.top.reports.list=Tous les rapports PageAdmin.menu.top.reports.new=Importer un rapport Jasper PageAdmin.menu.top.reports=Rapports PageAdmin.menu.top.resources.import=Importer une déf. de ressource -PageAdmin.menu.top.resources.list=All resources +PageAdmin.menu.top.resources.list=Toutes les ressources PageAdmin.menu.top.resources.new=Nouvelle ressource PageAdmin.menu.top.resources.view=Voir ressources PageAdmin.menu.top.resources.edit=Modifier la ressource PageAdmin.menu.top.resources=Ressources -PageAdmin.menu.top.connectorHosts.list=All connector hosts +PageAdmin.menu.top.connectorHosts.list=Tous les hôtes de connecteurs PageAdmin.menu.top.roles.list=Tous les rôles PageAdmin.menu.top.roles.new=Nouveau rôle PageAdmin.menu.top.roles=Rôles -PageAdmin.menu.top.serverTasks.list=All tasks +PageAdmin.menu.top.serverTasks.list=Toutes les tâches PageAdmin.menu.top.serverTasks.new=Nouvelle tâche PageAdmin.menu.top.serverTasks=Tâches serveur PageAdmin.menu.top.users.find=Trouver des utilisateurs @@ -1242,7 +1242,7 @@ pageAdmin.resources.description=Systèmes connectés pageAdminResources.detailsResource=Détails de la ressource pageAdminResources.editResource=Modifier la ressource pageAdminResources.importResource=Importer ressource -pageAdminResources.listResources=All resources +pageAdminResources.listResources=Toutes les ressources pageAdminResources.message.cantLoadResource=Impossible de charger les détails de la ressource pageAdminResources.newResource=Nouvelle ressource pageAdmin.resources=Ressources @@ -1509,7 +1509,7 @@ PageCert.message.textTenant=Locataire : {0}. PageCert.message.textValidFrom=Valide à partir du : {0}. PageCert.message.textValidTo=Valide jusqu'au : {0}. PageCert.now=maintenant -StageEditorPanel.stageDefinitionLabelName = Définition de la phase # +StageEditorPanel.stageDefinitionLabelName = Définition de la phase n° StageDefinitionPanel.stageName = Nom StageDefinitionPanel.stageDescription = Description StageDefinitionPanel.stageDuration = Durée @@ -1788,15 +1788,15 @@ pageLogging.appenders.name=Nom pageLogging.appenders.pattern=Motif pageLogging.audit=Audit pageLogging.auditLog=Fichier du journal d'audit : -pageLogging.button.addClassLogger=Ajouter un enregistreur -pageLogging.button.addComponentLogger=Ajouter un enregistreur de composants +pageLogging.button.addClassLogger=Ajouter un consignateur +pageLogging.button.addComponentLogger=Ajouter un consignateur de composants pageLogging.button.addConsoleAppender=Ajouter un ajouteur en console pageLogging.button.addFileAppender=Ajouter un ajouteur en fichier pageLogging.button.addFilter=Ajouter un filtre pageLogging.button.advanced=Avancé pageLogging.button.deleteAppender=Supprimer l'ajouteur pageLogging.button.deleteFilter=Supprimer le filtre -pageLogging.button.deleteLogger=Suppression de l'enregistreur +pageLogging.button.deleteLogger=Suppression du consignateur pageLogging.button.reset=Réinitialiser pageLogging.button.save=Enregistrer pageLogging.details=Détails : @@ -1813,25 +1813,25 @@ pageLogging.filtersTable=Table des filtres pageLogging.filter.TASKMANAGER=Filtre de gestionnaire de tâches pageLogging.filter.WORKFLOWS=Filtre de flux de travaux pageLogging.logger.ALL=Tout -pageLogging.logger.GUI=Enregistreur du composant Web -pageLogging.logger=Enregistreur -pageLogging.logger.MODEL=Enregistreur du composant Model -pageLogging.logger.NOTIFICATIONS=Enregistreur du composant Notifications -pageLogging.logger.PROVISIONING=Enregistreur du composant Provisioning -pageLogging.logger.REPOSITORY=Enregistreur du composant Repository -pageLogging.logger.RESOURCEOBJECTCHANGELISTENER=Enregistreur d'écouteur de changement d'objet de ressource +pageLogging.logger.GUI=Consignateur du composant Web +pageLogging.logger=Consignateur +pageLogging.logger.MODEL=Consignateur du composant Model +pageLogging.logger.NOTIFICATIONS=Consignateur du composant Notifications +pageLogging.logger.PROVISIONING=Consignateur du composant Provisioning +pageLogging.logger.REPOSITORY=Consignateur du composant Repository +pageLogging.logger.RESOURCEOBJECTCHANGELISTENER=Consignateur d'écouteur de changement d'objet de ressource pageLogging.loggersAppender=Ajouteur pageLogging.loggersLevel=Niveau -pageLogging.loggers=Enregistreurs -pageLogging.loggersTable=Table des enregistreurs -pageLogging.logger.TASKMANAGER=Enregistreur du gestionnaire de tâche -pageLogging.logger.WORKFLOWS=Enregistreur du composant Workflow +pageLogging.loggers=Consignateurs +pageLogging.loggersTable=Table des consignateurs +pageLogging.logger.TASKMANAGER=Consignateur du gestionnaire de tâche +pageLogging.logger.WORKFLOWS=Consignateur du composant Workflow pageLogging.logSubsystemEntryExit=Entrée dans le / sortie du sous-système de journalisation pageLogging.performanceStatistics=Statistiques de performance : pageLogging.profiling=Profilage pageLogging.requestFilter=Filtre de demande : pageLogging.rootAppender=Ajouteur racine : -pageLogging.rootLevel=Enregistreur racine : +pageLogging.rootLevel=Consignateur racine : pageLogging.subsystem.appender=Ajouteur pageLogging.subsystem.level=Niveau pageLogging.subsystem.model=Model @@ -1947,22 +1947,22 @@ PageResource.resource.up=La ressource est EN SERVICE PageResource.resource.down=La ressource est EN PANNE PageResource.resource.broken=La ressource est CASSÉE PageResource.resource.availabilityUnknown=L'état de la ressource est inconnu -PageResource.resource.objectTypes=types d'objets -PageResource.resource.schemaDefinitions=définitions de schémas +PageResource.resource.objectTypes=type(s) d'objets +PageResource.resource.schemaDefinitions=définition(s) de schéma(s) PageResource.resource.schema=Schéma PageResource.resource.noSchema=Aucun schéma PageResource.resource.schemaError=Erreur de schéma PageResource.tab.details=Détails pageResource.bundle=Paquet pageResource.button.back=Retour -pageResource.button.editXml=Éditer XML -pageResource.button.refreshSchema=Rafraichir le schéma +pageResource.button.editXml=Éditer en XML +pageResource.button.refreshSchema=Actualiser le schéma pageResource.button.wizard=Wizard pageResource.button.configurationEdit=Modifier la configuration pageResource.button.wizardShow=Montrer au moyen de l'assistant pageResource.button.wizardEdit=Modifier au moyen de l'assistant pageResource.button.importAccounts=Importer les comptes -pageResource.refreshSchema.failed=Échec du rafraichissement du schéma des ressources +pageResource.refreshSchema.failed=Échec de l'actualisation du schéma des ressources pageResource.button.save=Enregistrer pageResource.button.test=Tester la connexion pageResource.capabilities=Capacités @@ -2011,7 +2011,7 @@ pageResources.message.deleteHostConfirm=Voulez-vous vraiment supprimer l'hôte pageResources.message.deleteHostsConfirm=Voulez-vous vraiment supprimer {0} hôtes ? pageResources.message.deleteResourceConfirm=Voulez-vous vraiment supprimer la ressource « {0} » ? pageResources.message.deleteResourcesConfirm=Voulez-vous vraiment supprimer {0} ressources ? -pageResources.message.refreshResourceSchemaConfirm=Voulez-vous vraiment rafraîchir le schéma de la ressource ? +pageResources.message.refreshResourceSchemaConfirm=Voulez-vous vraiment actualiser le schéma de la ressource ? pageResources.message.noHostSelected=Aucun hôte de connecteur n'a été sélectionné. pageResources.message.noResourceSelected=Aucune ressource n'a été sélectionnée pageResources.message.queryError=Une erreur s'est produite lors de la requête de recherche de traduction à filtrer. @@ -2070,8 +2070,8 @@ pageRoles.message.confirmationMessageForMultipleObject.members=Voulez-vous vraim pageRoles.message.confirmationMessageForSingleObject.members=Voulez-vous vraiment {0} le rôle « {1} » ? Ce rôle est attribué à des utilisateurs. pageServices.message.confirmationMessageForMultipleObject=Voulez-vous vraiment {0} les {1} services sélectionnés ? pageServices.message.confirmationMessageForSingleObject=Voulez-vous vraiment {0} le service « {1} » ? -pageServices.message.confirmationMessageForMultipleObject.members=Do you really want to {0} selected {1} service(s)? Some of the services have member(s). -pageServices.message.confirmationMessageForSingleObject.members=Do you really want to {0} service '{1}'? Selected service has member(s). +pageServices.message.confirmationMessageForMultipleObject.members=Voulez-vous vraiment {0} les {1} services sélectionnés ? Certains de ces services sont attribués à des utilisateurs. +pageServices.message.confirmationMessageForSingleObject.members=Voulez-vous vraiment {0} le service « {1} » ? Le service sélectionné est attribué à des utilisateurs. pageRoles.message.nothingSelected=Aucune rôle n'a été sélectionné. pageRoles.message.queryError=Une erreur s'est produite lors de la requête de recherche de traduction à filtrer. pageRoles.requestable=Sur demande @@ -2118,7 +2118,7 @@ RichHyperlinkConfigDialog.icon=Icône (classe CSS) RichHyperlinkConfigDialog.description=Description RichHyperlinkConfigDialog.message.badUpdate=Impossible de montrer la configuration d'un lien de tableau de bord vide PageTaskAdd.title=Nouvelle tâche -pageTask.advancedOption=Option avancée +pageTask.advancedOption=Options avancées pageTask.basic=Base pageTask.boundHelp=Les tâches étroitement liées sont utilisées pour exécuter des actions courtes, répétées assez souvent (par exemple à intervalles inférieurs à 1 minute). Un exemple typique est la synchronisation en direct. La spécification en syntaxe "cron" n'est pas gérée pour ces tâches ; vous devez spécifier l'intervalle de temps. pageTask.bound=Étroitement lié (à utiliser si une tâche récurrente est exécutée souvent) @@ -2133,7 +2133,7 @@ pageTask.category.Reconciliation=Harmonisation pageTask.category.UserRecomputation=Recalcul de l'utilisateur pageTask.category.Workflow=Flux de travaux pageTask.category.Custom=Personnalisé -pageTask.createSuspended=Créé à l'état "suspendu" +pageTask.createSuspended=Créée à l'état « suspendu » pageTask.cronHelp=La spécification en syntaxe "cron" se présente sous la forme suivante: SECONDES MINUTES HEURES JOUR-DU-MOIS MOIS JOUR-DE-SEMAINE ANNÉE (facultatif), par exemple « 0 0 12 ? * WED » signifie « tous les mercredis à 12h00 ». pageTask.cronHelpLink=Pour plus d'informations, veuillez vous voir pageTask.cronHelpLinkTutorial=Tutoriel @@ -2254,7 +2254,7 @@ pageTasks.button.suspendCoordinatorOnly=Suspendre (coordinateur uniquement) pageTasks.button.resumeCoordinatorOnly=Reprendre (coordinateur uniquement) pageTasks.button.deleteAllClosedTasks=Supprimer toutes les tâches closes pageTasks.button.reactivateServiceThreads=Démarrer tous les exétrons -pageTasks.button.refreshTasks=Rafraîchir les tâches +pageTasks.button.refreshTasks=Actualiser les tâches pageTasks.button.resumeTask=Reprendre pageTasks.button.scheduleTask=Exécuter maintenant pageTasks.button.startScheduler=Démarrer @@ -2326,7 +2326,7 @@ pageTasks.message.confirmationMessageForMultipleNodeObject=Voulez-vous vraiment pageTasks.message.resumeTasksPerformed.success=La(les) tâche(s) a(ont) pu reprendre avec succès. pageTasks.message.resumeTasksPerformed.fatalError=Impossible de reprendre la(les) tâche(s) pageTasks.message.synchronizeTasksPerformed.fatalError=Impossible de synchroniser les tâches -pageTasks.message.deleteAllClosedTasksConfirmedPerformed.fatalError=Error dealing with schema +pageTasks.message.deleteAllClosedTasksConfirmedPerformed.fatalError=Erreur dans la gestion du schéma pageTask.scheduleHelp=Pour les tâches à exécution unique, n'indiquez ni intervalle de planification ni spécification en syntaxe "cron". Pour les tâches récurrentes, indiquez soit l'un soit l'autre (pas les deux). pageTask.scheduleInterval=Intervalle de planification (secondes) pageTask.scheduleTitle=Planification @@ -2496,7 +2496,7 @@ pageCases.table.openTimestamp=Ouvert pageCases.table.closeTimestamp=Fermé pageCases.button.delete=Supprimer PageCasesAllocatedToMe.title=Mes Cas -PageCasesAll.title=All Cases +PageCasesAll.title=Tous les cas MultipleAssignmentSelectorPanel.availableRoles=Rôles disponibles MultipleAssignmentSelectorPanel.parameters=Paramètres MultipleAssignmentSelectorPanel.currentRoles=Rôle actuel @@ -2537,7 +2537,7 @@ pageWorkItem.requestedOn=Demandé le : pageWorkItem.requester.description=Demandeur pageWorkItem.requestSpecific.description=Votre décision WebComponentUtil.message.createMenuItemsFromActions.warning=Il n'y a aucun objets sur lesquels exécuter l'action -WebComponentUtil.message.refreshResourceSchema.fatalError=Error refreshing resource schema +WebComponentUtil.message.refreshResourceSchema.fatalError=Erreur lors de l'actualisation du schéma de la ressource WebComponentUtil.message.getAssignableRolesFilter.fatalError=Impossible de charger les rôles disponibles WebComponentUtil.formatDurationWordsForLocal.seconds=secondes WebComponentUtil.formatDurationWordsForLocal.minutes=minutes @@ -2579,8 +2579,8 @@ TaskWfChildPanel.approvalHistoryHelp=Les décisions prises jusqu'à présent dan TaskWfChildPanel.currentWorkItemsHelp=Travaux pour les changements montrés ici qui sont actuellement actifs. TaskWfChildPanel.showNextStagesHelp=Affiche un aperçu des phases de validation suivantes. TaskWfChildPanel.nextStagesHelp=Ceci est un aperçu des phases de validation suivantes. -TaskWfChildPanel.showWholeProcessHelp=Affiche l'ensemble du processus de validation: les phases déjà finalisées, la phase actuelle et toutes les phases prévues encore à venir. -TaskWfChildPanel.wholeProcessHelp=Ceci vous informe de l'ensemble du processus de validation: les phases déjà finalisées, la phase actuelle et toutes les phases prévues encore à venir. +TaskWfChildPanel.showWholeProcessHelp=Affiche l'ensemble du processus de validation : les phases déjà achevées, la phase actuelle et toutes les phases prévues encore à venir. +TaskWfChildPanel.wholeProcessHelp=Ceci vous informe de l'ensemble du processus de validation : les phases déjà achevées, la phase actuelle et toutes les phases prévues encore à venir. workItemPanel.relatedRequestsHelp=Liste des requêtes de validation créées en même temps que celle-ci. Chaque requête dispose de son propre processus de validation et peut dès lors être approuvée ou refusée indépendamment des autres. Toutes ont été initiées par une même opération de changement qui contenait plusieurs modifications individuelles. TaskWfChildPanel.relatedRequestsHelp=Liste des requêtes de validation créées en même temps que celle-ci. Chaque requête dispose de son propre processus de validation et peut dès lors être approuvée ou refusée indépendamment des autres. Toutes ont été initiées par une même opération de changement qui contenait plusieurs modifications individuelles. workItemPanel.showRequestHelp=Affiche la requête de validation et le processus d'approbation correspondant relatifs aux changements montrés ici. @@ -2680,13 +2680,13 @@ processInstancePanel.tasks=Travaux actuellement actifs : processInstancePanel.title.edit=Détails pour « {0} » ProfilingLevel.ARGUMENTS=Arguments ProfilingLevel.ENTRY_EXIT=Entrée/Sortie -ProfilingLevel.OFF=éteint +ProfilingLevel.OFF=Éteint ProgressPanel.ExecutionTimeWhenFinished=Opération exécutée en {0} millisecondes. ProgressPanel.ExecutionTimeWhenRunning=Opération en cours d'exécution pour {0} seconde(s). ProgressPanel.abortRequested=Abandon demandé, veuillez patienter... ProgressPanel.abortRequestedFinished=Abandon demandé, mais l'exécution semble être déjà terminée. ProgressPanel.abortRequestedNoInterrupt=Abandon demandé, veuillez patienter... (NB: impossible d'interrompre l'exétron) -ProgressPanel.populateStatusItem.resourceObjectActivity={0} ({1}) on {2} +ProgressPanel.populateStatusItem.resourceObjectActivity={0} ({1}) sur {2} ProgressTableHeader.Activity=Activité ProgressTableHeader.ResourceObject=Objet de ressource (le cas échéant) ProgressTableHeader.Status=État @@ -2745,7 +2745,7 @@ ResourceAssociationEditor.label.description=Description ResourceAssociationEditor.label.direction=Direction ResourceAssociationEditor.label.displayName=Nom d'affichage ResourceAssociationEditor.label.edit=Modifier l'association -ResourceAssociationEditor.label.exclusiveStrong=Exclusive strong +ResourceAssociationEditor.label.exclusiveStrong=Fort exclusif ResourceAssociationEditor.label.explicitRefIntegrity=Intégrité référentielle explicite ResourceAssociationEditor.label.fetchStrategy=Stratégie d'obtention ResourceAssociationEditor.label.inbound=Correspondance entrante @@ -2766,7 +2766,7 @@ ResourceAttributeEditor.label.allow=Non-schema attribute ResourceAttributeEditor.label.description=Description ResourceAttributeEditor.label.displayName=Nom d'affichage ResourceAttributeEditor.label.edit=Modifier l'attribut -ResourceAttributeEditor.label.exclusiveStrong=Exclusive strong +ResourceAttributeEditor.label.exclusiveStrong=Fort exclusif ResourceAttributeEditor.label.fetchStrategy=Stratégie d'obtention ResourceAttributeEditor.label.inbound=Correspondances entrantes ResourceAttributeEditor.label.intolerantVP=Motif non toléré @@ -3548,10 +3548,10 @@ PageResource.tab.content.account=Comptes PageResource.tab.content.entitlement=Droits PageResource.tab.content.generic=Generics PageResource.tab.content.others=Non catégorisés -PageResource.tab.content.tasks=Tâches Définies +PageResource.tab.content.tasks=Tâches définies ResourceContentTabPanel.searchType.repository=Dépôt ResourceContentTabPanel.searchType.resource=Ressource -ResourceContentTabPanel.searchType=Chercher dans : +ResourceContentTabPanel.searchType=Chercher dans : PagePreviewChanges.primaryChangesOne=Principaux changements : {0} objet PagePreviewChanges.primaryChangesMore=Principaux changements : {0} objets PagePreviewChanges.secondaryChangesOne=Changements secondaires : {0} objet @@ -3578,8 +3578,8 @@ TaskSummaryPanel.progressIfWaiting=(en attente) TaskSummaryPanel.progressIfClosed=(close) TaskSummaryPanel.progressIfStalled=(bloqué depuis {0}) TaskSummaryPanel.lastProcessed=Dernier objet traité : {0} -ResourceContentResourcePanel.showExisting=Show existing -ResourceContentResourcePanel.newTask=Créer un nouveau +ResourceContentResourcePanel.showExisting=Montrer les tâches existantes +ResourceContentResourcePanel.newTask=Créer une nouvelle tâche SearchPanel.advanced=Avancé SearchPanel.basic=Base SearchPanel.search=Recherche @@ -3593,13 +3593,13 @@ TypedAssignablePanel.orgTreeView=Entités org. (vue arborescente) TypedAssignablePanel.Kind=Sorte TypedAssignablePanel.Intent=Finalité SearchPanel.insertFilterXml=Insérer un filtre XML (SearchFilterType) -autoRefreshPanel.refreshNow=Rafraîchir maintenant -autoRefreshPanel.resumeRefreshing=Reprendre rafraîchissant -autoRefreshPanel.pauseRefreshing=Suspendre le rafraîchissement -autoRefreshPanel.refreshingEach=Rafraîchir toutes les {0} sec -autoRefreshPanel.noRefreshing=(pas de rafraîchissement) +autoRefreshPanel.refreshNow=Actualiser maintenant +autoRefreshPanel.resumeRefreshing=Reprendre l'actualisation +autoRefreshPanel.pauseRefreshing=Suspendre l'actualisation +autoRefreshPanel.refreshingEach=Actualiser toutes les {0} secondes +autoRefreshPanel.noRefreshing=(pas d'actualisation) PageAdmin.menu.top.services=Services -PageAdmin.menu.top.services.list=All services +PageAdmin.menu.top.services.list=Tous les services PageAdmin.menu.top.services.new=Nouveau service PageAdmin.menu.top.services.edit=Modifier le service taskShowAdvancedFeaturesPanel.label=Montrer les fonctionnalités avancées @@ -3646,7 +3646,7 @@ ReportCreateHandlerPanel.reportParameters=Paramètres des rapports OperationResultPanel.showTask=(montrer la tâche) PageResources.inlineMenuItem.test=Tester la connexion PageRequestRole.title=Demander un rôle -MainObjectListPanel.refresh=Rafraîchir +MainObjectListPanel.refresh=Actualiser MainObjectListPanel.newObject=Nouveau MainObjectListPanel.import=Importer MainObjectListPanel.export=Exporter @@ -3872,6 +3872,7 @@ PageAssignmentConflicts.back=Retour PageAssignmentConflicts.submit=Soumettre PageAssignmentsList.conflictsWarning=Unable to calculate assignment conflicts due to authorization problem. Reason: AbstractShoppingCartTabPanel.addAllButton=Les ajouter tou(te)s +AbstractShoppingCartTabPanel.goToShoppingCartButton=Go to shopping cart AbstractShoppingCartTabPanel.requestingForLabel=Demande pour AbstractShoppingCartTabPanel.availableRelationsLabel=Relations disponibles AssignmentCatalogPanel.selectTargetUser=Sélectionner l'utilisateur cible @@ -3906,7 +3907,11 @@ AssignmentViewType.USER_TYPE=Attributions de l'utilisateur PageAssignmentsList.requestButton = Demander operation.com.evolveum.midpoint.web.page.self.PageAssignmentsList.requestAssignments=Demander une attribution com.evolveum.midpoint.web.page.self.PageAssignmentsList.requestAssignments=Demander des attributions +PageAssignmentsList.requestInProgress=Processing of your request is in progress. Your request may be subject to approval or other manual or asynchronous processing. Please allow sufficient time for the request to be processed. +PageAssignmentsList.requestSuccess=Your request has been processed. Assignments are ready to use. +PageAssignmentsList.requestError=There was an error processing your request. PageAssignmentsList.title=Liste des nouvelles attributions souhaitées +PageAssignmentsList.assignmentsToRequest=Assignments to request PageAuditLogViewer.title=Visionneur de journal d'audit PageAuditLogViewer.menuName=Visionneur de journal d'audit PageAuditLogViewer.timeLabel=Temps @@ -4063,10 +4068,10 @@ operation.com.evolveum.midpoint.web.page.admin.reports.PageCreatedReports.delete operation.com.evolveum.midpoint.report.impl.ReportManagerImpl.deleteReportOutput=Supprimer le rapport (Rapport) operation.com.evolveum.midpoint.web.page.admin.reports.PageCreatedReports.downloadReport=Télécharger un rapport (GUI) operation..com.evolveum.midpoint.report.impl.ReportManagerImpl.getReportOutputData=Charger le rapport (Rapport) -PageWorkItem.couldNotGetWorkItem=Impossible d'obtenir le travail. Il a peut-être déjà été complété ou supprimé. +PageWorkItem.couldNotGetWorkItem=Impossible d'obtenir le travail. Il a peut-être déjà été achevé ou supprimé. PageWorkItem.noRequest=Impossible d'afficher le travail, car il n'est associé à aucune demande d'approbation. Veuillez exécuter « Nettoyage des processus Activiti » si le problème persiste. -PageCaseWorkItem.couldNotGetCase=Impossible d'obtenir le cas. Il a peut-être déjà été complété ou supprimé. -PageCaseWorkItem.couldNotGetCaseWorkItem=Impossible d'obtenir le travail relatif au cas. Il a peut-être déjà été complété ou supprimé. +PageCaseWorkItem.couldNotGetCase=Impossible d'obtenir le cas. Il a peut-être déjà été achevé ou supprimé. +PageCaseWorkItem.couldNotGetCaseWorkItem=Impossible d'obtenir le travail relatif au cas. Il a peut-être déjà été achevé ou supprimé. CsvDownloadButtonPanel.export=Exporter en CSV CsvDownloadButtonPanel.confirmationMessage=La taille de l'export en CSV est limitée à {0} entrées. Continuer ? AssignmentEditorDto.policyRuleTitle=Règle de politique @@ -4209,8 +4214,13 @@ DisplayNamePanel.viewObjectDetails=View object details PageUsersView.title=Vue des utilisateurs pageAdminFocus.dataProtection=Protection des données PageInternals.title.cache=Caches +PageInternals.title.threads=Threads PageInternals.tab.cache=Gestion des caches +PageInternals.tab.threads=Threads InternalsCachePanel.button.clearCaches=Vider les caches +InternalsThreadsPanel.button.showAllThreads=Show all threads +InternalsThreadsPanel.button.showTasksThreads=Show tasks threads +InternalsThreadsPanel.button.recordTasksThreads=Record tasks threads PageAccountActivation.user.not.found=Un problème inattendu est survenu. Veuillez contacter le gestionnaire du système. propertyConstraintValidator.error=Impossible d'établir une contrainte sur la propriété sans qu'un chemin ne soit défini. ReferencePopupPanel.oid=Oid: @@ -4242,9 +4252,9 @@ operation.Delete.SELECTED.members=Supprimer les membres sélectionnés relationDropDownChoicePanel.relation=Relation relationDropDownChoicePanel.tooltip.relation=Relation de la référence, par exemple défaut, validateur, responsable... ItemPathPanel.button.reset=Réinitialiser le chemin -ApprovalPolicyActionType.details.newValue=New approval policy action +ApprovalPolicyActionType.details.newValue=Nouvelle action de politique de validation LifecycleStateType.details.newValue=État du nouveau cycle de vie -NotificationPolicyActionType.details.newValue=New notification policy action +NotificationPolicyActionType.details.newValue=Nouvelle action de politique de notification PropertyConstraintType.details.newValue=Nouvelle contrainte de propriété objectState.details.newValue=New object state assignmentState.details.newValue=Nouvel état d'attribution @@ -4272,7 +4282,7 @@ GuiObjectListViewType.details.newValue=Vue de la liste d'objets du nouvel objet DashboardWidgetType.details.newValue=Nouvelle vignette de tableau de bord RelationDefinitionType.details.newValue=Définition d'une nouvelle relation GuiActionType.details.newValue=Nouvelle action GUI -ApprovalStageDefinitionType.details.newValue=New approval stage definition +ApprovalStageDefinitionType.details.newValue=Nouvelle définition de phase de validation WorkItemTimedActionsType.details.newValue=Actions programmées pour un nouveau travail WorkItemNotificationActionType.details.newValue=Action de notification pour un nouveau travail ResourceObjectAssociationType.details.newValue=New resource object association @@ -4296,20 +4306,23 @@ ref.details=Référence ShowEmptyButton.showMore=Montrer les champs vides ShowEmptyButton.showLess=Masquer les champs vides TaskExecutionGroupConstraintType.details.newValue=Nouvelle définition d'un groupe d'exécution secondaire -PendingOperationPanel.pendingOperationType=Type : +PendingOperationPanel.pendingOperationType=Type : PendingOperationPanel.resultStatus=État du résultat : PendingOperationPanel.executionStatus=État d'exécution : PendingOperationPanel.operationReference=Référence de l'opération  -PendingOperationPanel.attempt=Tentative : -PendingOperationPanel.lastAttemptTimestamp=Dernière tentative : -PendingOperationPanel.completionTimestamp=Terminé : +PendingOperationPanel.attempt=Tentative : +PendingOperationPanel.lastAttemptTimestamp=Dernière tentative : +PendingOperationPanel.completionTimestamp=Fin : pageForgetPassword.message.user.not.found=La réinitialisation du mot de passe a échoué. Veuillez contacter le gestionnaire du système. PageCertDefinitions.campaignWasCreated=La campagne de certification « {0} » a été créée. StatisticsDto.getLastMessage.none=Aucun -LoggingConfigurationTabPanel.appendersChoice.SyslogAppenderConfigurationType=Syslog appender -LoggingConfigurationTabPanel.appendersChoice.FileAppenderConfigurationType=File appender +LoggingConfigurationTabPanel.appendersChoice.SyslogAppenderConfigurationType=Ajouteur syslog +LoggingConfigurationTabPanel.appendersChoice.FileAppenderConfigurationType=Ajouteur en fichier LoggingConfigurationTabPanel.appender.nameColumn=Nom LoggingConfigurationTabPanel.appender.patternColumn=Motif LoggingConfigurationTabPanel.appender.typeColumn=Type ResourceSummaryPanel.UP=En service ResourceSummaryPanel.DOWN=Hors service +operation.com.evolveum.midpoint.web.page.admin.configuration.InternalsThreadsPanel.executeShowAllThreads=Show all threads (Gui) +operation.com.evolveum.midpoint.web.page.admin.configuration.InternalsThreadsPanel.executeShowTasksThreads=Show running tasks threads (Gui) +operation.com.evolveum.midpoint.web.page.admin.configuration.InternalsThreadsPanel.executeRecordTasksThreads=Record running tasks threads (Gui) diff --git a/gui/admin-gui/src/main/resources/localization/Midpoint_hu.properties b/gui/admin-gui/src/main/resources/localization/Midpoint_hu.properties index f67160529f3..67c1c881e0b 100644 --- a/gui/admin-gui/src/main/resources/localization/Midpoint_hu.properties +++ b/gui/admin-gui/src/main/resources/localization/Midpoint_hu.properties @@ -1010,7 +1010,7 @@ PageAbout.button.testRepositoryCheckOrgClosure=Check and repair org closure cons PageAbout.button.reindexRepositoryObjects=Reindex repository objects PageAbout.button.testRepository=Repository self test PageAbout.button.clearCssJsCache=CSS/JS gyorsítótár törlése -PageAbout.button.factoryDefault=Switch to factory default +PageAbout.button.factoryDefault=Reset to factory default PageAbout.message.deleteAllObjects=Do you really want to delete all objects? It may take several minutes. PageAbout.message.couldntObtainJvmParams=Couldn't obtain JVM parameters from JMX. PageAbout.midPointRevision=${git.describe} @@ -3872,6 +3872,7 @@ PageAssignmentConflicts.back=Vissza PageAssignmentConflicts.submit=Submit PageAssignmentsList.conflictsWarning=Unable to calculate assignment conflicts due to authorization problem. Reason: AbstractShoppingCartTabPanel.addAllButton=Add all +AbstractShoppingCartTabPanel.goToShoppingCartButton=Go to shopping cart AbstractShoppingCartTabPanel.requestingForLabel=Requesting for AbstractShoppingCartTabPanel.availableRelationsLabel=Available relations AssignmentCatalogPanel.selectTargetUser=Select target user @@ -3906,7 +3907,11 @@ AssignmentViewType.USER_TYPE=Saját jogosultságok PageAssignmentsList.requestButton = Kérés operation.com.evolveum.midpoint.web.page.self.PageAssignmentsList.requestAssignments=Request assignment com.evolveum.midpoint.web.page.self.PageAssignmentsList.requestAssignments=Request assignments +PageAssignmentsList.requestInProgress=Processing of your request is in progress. Your request may be subject to approval or other manual or asynchronous processing. Please allow sufficient time for the request to be processed. +PageAssignmentsList.requestSuccess=Your request has been processed. Assignments are ready to use. +PageAssignmentsList.requestError=There was an error processing your request. PageAssignmentsList.title=New assignments list +PageAssignmentsList.assignmentsToRequest=Assignments to request PageAuditLogViewer.title=Audit Log Viewer PageAuditLogViewer.menuName=Audit Log Viewer PageAuditLogViewer.timeLabel=Idő @@ -4209,8 +4214,13 @@ DisplayNamePanel.viewObjectDetails=View object details PageUsersView.title=Users view pageAdminFocus.dataProtection=Adatvédelem PageInternals.title.cache=Caches +PageInternals.title.threads=Threads PageInternals.tab.cache=Cache management +PageInternals.tab.threads=Threads InternalsCachePanel.button.clearCaches=Clear caches +InternalsThreadsPanel.button.showAllThreads=Show all threads +InternalsThreadsPanel.button.showTasksThreads=Show tasks threads +InternalsThreadsPanel.button.recordTasksThreads=Record tasks threads PageAccountActivation.user.not.found=Unexpected problem occurs. Please contact system administrator. propertyConstraintValidator.error=Cannot set property constraint without path defined. ReferencePopupPanel.oid=Oid: @@ -4313,3 +4323,6 @@ LoggingConfigurationTabPanel.appender.patternColumn=Minta LoggingConfigurationTabPanel.appender.typeColumn=Típus ResourceSummaryPanel.UP=Fel ResourceSummaryPanel.DOWN=Le +operation.com.evolveum.midpoint.web.page.admin.configuration.InternalsThreadsPanel.executeShowAllThreads=Show all threads (Gui) +operation.com.evolveum.midpoint.web.page.admin.configuration.InternalsThreadsPanel.executeShowTasksThreads=Show running tasks threads (Gui) +operation.com.evolveum.midpoint.web.page.admin.configuration.InternalsThreadsPanel.executeRecordTasksThreads=Record running tasks threads (Gui) diff --git a/gui/admin-gui/src/main/resources/localization/Midpoint_it.properties b/gui/admin-gui/src/main/resources/localization/Midpoint_it.properties index 5139502b15c..f7d82466e2a 100644 --- a/gui/admin-gui/src/main/resources/localization/Midpoint_it.properties +++ b/gui/admin-gui/src/main/resources/localization/Midpoint_it.properties @@ -1010,7 +1010,7 @@ PageAbout.button.testRepositoryCheckOrgClosure=Controlla e ripara la coerenza de PageAbout.button.reindexRepositoryObjects=Reindicizza oggetti del repository PageAbout.button.testRepository=Repository self test PageAbout.button.clearCssJsCache=Pulisci cache CSS/JS -PageAbout.button.factoryDefault=Ritorna ai valori di fabbrica +PageAbout.button.factoryDefault=Ripristina impostazioni di fabbrica PageAbout.message.deleteAllObjects=Vuoi veramente cancellare tutti gli oggetti? Potrebbero essere necessari alcuni minuti. PageAbout.message.couldntObtainJvmParams=Impossibile ottenere i parametri JVM da JMX. PageAbout.midPointRevision=${git.describe} @@ -3872,6 +3872,7 @@ PageAssignmentConflicts.back=Indietro PageAssignmentConflicts.submit=Invia PageAssignmentsList.conflictsWarning=Impossibile calcolare i conflitti di assegnazione a causa di un problema di autorizzazione. Causa: AbstractShoppingCartTabPanel.addAllButton=Aggiungi tutto +AbstractShoppingCartTabPanel.goToShoppingCartButton=Vai al carrello AbstractShoppingCartTabPanel.requestingForLabel=Richiesto per AbstractShoppingCartTabPanel.availableRelationsLabel=Relazioni disponibili AssignmentCatalogPanel.selectTargetUser=Seleziona utente di destinazione @@ -3906,7 +3907,11 @@ AssignmentViewType.USER_TYPE=Abilitazioni dell'utente PageAssignmentsList.requestButton = Richiesta operation.com.evolveum.midpoint.web.page.self.PageAssignmentsList.requestAssignments=Richiedi abilitazione com.evolveum.midpoint.web.page.self.PageAssignmentsList.requestAssignments=Richiedi abilitazioni +PageAssignmentsList.requestInProgress=L'elaborazione della richiesta è in corso. La richiesta può essere soggetta ad approvazione o altra elaborazione manuale o asincrona. Si prega di lasciare un tempo sufficiente per gestire la richiesta. +PageAssignmentsList.requestSuccess=La tua richiesta è stata elaborata. Le assegnazioni sono pronte per l'uso. +PageAssignmentsList.requestError=Si è verificato un errore durante l'elaborazione della richiesta. PageAssignmentsList.title=Nuova lista di abilitazioni +PageAssignmentsList.assignmentsToRequest=Assegnazioni da richiedere PageAuditLogViewer.title=Audit Log Viewer PageAuditLogViewer.menuName=Audit Log Viewer PageAuditLogViewer.timeLabel=Orario @@ -4209,8 +4214,13 @@ DisplayNamePanel.viewObjectDetails=Visualizza dettagli oggetto PageUsersView.title=Vista utente pageAdminFocus.dataProtection=Protezione dati PageInternals.title.cache=Caches +PageInternals.title.threads=Threads PageInternals.tab.cache=Gestione della cache +PageInternals.tab.threads=Threads InternalsCachePanel.button.clearCaches=Pulisci cache +InternalsThreadsPanel.button.showAllThreads=Mostra tutti i threads +InternalsThreadsPanel.button.showTasksThreads=Mostra i tasks dei threads +InternalsThreadsPanel.button.recordTasksThreads=Registra i tasks dei threads PageAccountActivation.user.not.found=Si è verificato un problema imprevisto Si prega di contattare l'amministratore di sistema. propertyConstraintValidator.error=Impossibile impostare il vincolo di proprietà senza il path definito. ReferencePopupPanel.oid=Oid: @@ -4313,3 +4323,6 @@ LoggingConfigurationTabPanel.appender.patternColumn=Pattern LoggingConfigurationTabPanel.appender.typeColumn=Tipo ResourceSummaryPanel.UP=Sopra ResourceSummaryPanel.DOWN=Sotto +operation.com.evolveum.midpoint.web.page.admin.configuration.InternalsThreadsPanel.executeShowAllThreads=Mostra tutti i threads (GUI) +operation.com.evolveum.midpoint.web.page.admin.configuration.InternalsThreadsPanel.executeShowTasksThreads=Mostra tutti i task in esecuzione dei threads (GUI) +operation.com.evolveum.midpoint.web.page.admin.configuration.InternalsThreadsPanel.executeRecordTasksThreads=Registra tutti i task in esecuzione dei threads (GUI) diff --git a/gui/admin-gui/src/main/resources/localization/Midpoint_ja.properties b/gui/admin-gui/src/main/resources/localization/Midpoint_ja.properties index 05965f1b786..13d4f88827f 100644 --- a/gui/admin-gui/src/main/resources/localization/Midpoint_ja.properties +++ b/gui/admin-gui/src/main/resources/localization/Midpoint_ja.properties @@ -167,7 +167,7 @@ CapabilityStep.addCapabilities=能力を追加 CapabilityStep.disabled=(無効) CapabilityStep.activation.tooltip.attributeName=シミュレートされたadministrativeStatusの値を含む属性の名前。通常、これは何らかの有効/無効な情報を含む属性です。 典型的な例は、"enabled"、"ds-pwp-account-disabled"、"accountStatus"などの属性です。 CapabilityStep.activation.tooltip.disableList="無効"状態を表す属性値のリスト。 これらの値のいずれかが属性に存在する場合、オブジェクトは無効と見なされます。 典型的な値は、 "false"、 "無効"、 "0"または空の値です。 -CapabilityStep.activation.tooltip.enabled=このキャパビリティが有効な場合はTrue。 無効の場合はFalse。 無効にされたキャパビリティは、それがない場合と同じように機能します。 キャパビリティは無効にすることができます。 例えば、コネクターのバグを回避する、リソースを読み込み専用にするなど +CapabilityStep.activation.tooltip.enabled=この能力が有効な場合はTrue。 無効の場合はFalse。 無効にされた能力は、それがない場合と同じように機能します。 能力は無効にすることができます。 例えば、コネクターのバグを回避する。リソースを読み込み専用にするなど。 CapabilityStep.activation.tooltip.enableList="有効"状態を表す属性値のリスト。 これらの値のいずれかが属性に存在する場合、オブジェクトは有効であるとみなされます。 典型的な値は "true"、 "有効"、 "1"などです。 CapabilityStep.activation.tooltip.ignoreAttribute=trueに設定されている場合、シミュレート・アクティベーションに使用される属性はスキーマ内で無視されるようにマークされます。 すなわち システムはこの属性が存在しないと見せかけて、標準的な管理ステータスのみを使用します。 これがデフォルトです。 falseに設定すると、属性はスキーマにも表示され、管理ステータスと元の属性の両方が機能します。 属性が管理ステータス属性よりも豊富な状態のセットを持っている場合、これが必要になるかもしれません。 しかしこの場合、管理ステータスと元の属性の間の値の競合に注意してください。 CapabilityStep.activation.tooltip.lockoutAttributeName=シミュレートされたlockoutStatusの値を持つ属性の名前。通常、これは 何らかの ノーマル/ロック中 情報を持つ属性です。 @@ -179,34 +179,34 @@ CapabilityStep.activation.tooltip.validFromEnabled=リソースがvalidFromア CapabilityStep.activation.tooltip.validFromReturned=デフォルトでvalidFrom属性が返されるならTrue。明示的に要求する必要がある場合はFalse。 CapabilityStep.activation.tooltip.validToEnabled=リソースがvalidToアクティベーション属性をサポートするならばTrue CapabilityStep.activation.tooltip.validToReturned=デフォルトでvalidTo属性が返されるならTrue。明示的に要求する必要がある場合はFalse。 -CapabilityStep.capability.activation.tooltip=アクティベーション・キャパビリティ。アカウントの有効にする/無効にする、有効期限の設定など。 -CapabilityStep.capability.create.tooltip=リソースに新しいオブジェクトを作成(追加)するキャパビリティ。 -CapabilityStep.capability.credentials.tooltip=リソースアカウントのクレデンシャルを設定するキャパビリティ。 -CapabilityStep.capability.delete.tooltip=リソースの既存オブジェクトを削除するキャパビリティ。 -CapabilityStep.capability.liveSync.tooltip=Live同期キャパビリティ。 ほぼリアルタイムでデータ変更を効率的にフェッチする能力。 -CapabilityStep.capability.read.tooltip=リソースからデータを読み取るキャパビリティ。 -CapabilityStep.capability.script.tooltip=コネクターとリソースでスクリプトを実行するキャパビリティ。 -CapabilityStep.capability.testConnection.tooltip=リソースへの接続をテストするキャパビリティ。 -CapabilityStep.capability.update.tooltip=リソースの既存オブジェクトを更新(変更)するキャパビリティ。 +CapabilityStep.capability.activation.tooltip=アクティベーション能力。アカウントの有効にする/無効にする、有効期限の設定など。 +CapabilityStep.capability.create.tooltip=リソースに新しいオブジェクトを作成(追加)する能力。 +CapabilityStep.capability.credentials.tooltip=リソースアカウントのクレデンシャルを設定する能力。 +CapabilityStep.capability.delete.tooltip=リソースの既存オブジェクトを削除する能力。 +CapabilityStep.capability.liveSync.tooltip=Live同期能力。 ほぼリアルタイムでデータ変更を効率的にフェッチする能力。 +CapabilityStep.capability.read.tooltip=リソースからデータを読み取る能力。 +CapabilityStep.capability.script.tooltip=コネクターとリソースでスクリプトを実行する能力。 +CapabilityStep.capability.testConnection.tooltip=リソースへの接続をテストする能力。 +CapabilityStep.capability.update.tooltip=リソースの既存オブジェクトを更新(変更)する能力。 CapabilityStep.configured=設定済み -CapabilityStep.credentials.tooltip.enabled=このキャパビリティが有効な場合はTrue。 無効の場合はFalse。 無効にされたキャパビリティは、それがない場合と同じように機能します。 キャパビリティは無効にすることができます。 例えば、コネクタのバグを回避する、リソースを読み込み専用にするなど +CapabilityStep.credentials.tooltip.enabled=この能力が有効な場合はTrue。 無効の場合はFalse。 無効にされた能力は、それがない場合と同じように機能します。 能力は無効にすることができます。 例えば、コネクターのバグを回避する。リソースを読み込み専用にするなど。 CapabilityStep.credentials.tooltip.passEnabled=リソースがパスワード情報をサポートするならばTrue CapabilityStep.credentials.tooltip.passReturned=デフォルトでpasswordが返されるならTrue。明示的に要求する必要がある場合はFalse。 CapabilityStep.message.cantLoadCaps=キャパビリティをロードできませんでした。 CapabilityStep.native=ネイティブ -CapabilityStep.script.tooltip.enabled=このキャパビリティが有効な場合はTrue。 無効の場合はFalse。 無効にされたキャパビリティは、それがない場合と同じように機能します。 キャパビリティは無効にすることができます。 例えば、コネクタのバグを回避する、リソースを読み込み専用にするなど +CapabilityStep.script.tooltip.enabled=この能力が有効な場合はTrue。 無効の場合はFalse。 無効にされた能力は、それがない場合と同じように機能します。 能力は無効にすることができます。 例えば、コネクターのバグを回避する。リソースを読み込み専用にするなど。 CapabilityStep.script.tooltip.onConnector=”コネクタ上”でスクリプトを実行する能力。 これは、コネクターがインストールされているマシン上でスクリプトが実行されることを意味します。 これは通常、システムノードまたはコネクターサーバーです。 CapabilityStep.script.tooltip.onResource=”リソース上”でスクリプトを実行する能力。 これは、コネクターが接続されているマシン上でスクリプトが実行されることを意味します。 これは通常、リソースをホストするサーバーです(ADサーバー、リモートUnixマシン、データベースサーバーなど)。 CapabilityStep.title=能力 -capabilityValuePanel.label.capability.create=作成のキャパビリティ -capabilityValuePanel.label.capability.delete=削除のキャパビリティ -capabilityValuePanel.label.capability.liveSync=Live同期のキャパビリティ -capabilityValuePanel.label.capability.read=読込みのキャパビリティ -capabilityValuePanel.label.capability.testConnection=テスト接続のキャパビリティ -capabilityValuePanel.label.capability.update=更新のキャパビリティ +capabilityValuePanel.label.capability.create=作成の能力 +capabilityValuePanel.label.capability.delete=削除の能力 +capabilityValuePanel.label.capability.liveSync=Live同期の能力 +capabilityValuePanel.label.capability.read=読込みの能力 +capabilityValuePanel.label.capability.testConnection=テスト接続の能力 +capabilityValuePanel.label.capability.update=更新の能力 capabilityValuePanel.label.enabled=有効 -capabilityValuePanel.label.capability.addRemoveAttributeValues=値の追加またはリムーブのキャパビリティ -capabilityValuePanel.label.capability.auxiliaryObjectClasses=補助オブジェクトクラスのキャパビリティ +capabilityValuePanel.label.capability.addRemoveAttributeValues=値の追加またはリムーブの能力 +capabilityValuePanel.label.capability.auxiliaryObjectClasses=補助オブジェクトクラスの能力 CertDefinitionPage.message.cantSaveEmpty=空のXMLは保存できません CertDefinitionPage.message.cantSaveEmptyName=名前が空の定義は保存できません Channel.discovery=ディスカバリー @@ -690,10 +690,10 @@ ObjectTypeGuiDescriptor.task=タスク ObjectTypeGuiDescriptor.user=ユーザー ObjectTypeGuiDescriptor.service=サービス ObjectTypeGuiDescriptor.case=ケース -ObjectTypeGuiDescriptor.valuePolicy=バリューポリシー +ObjectTypeGuiDescriptor.valuePolicy=バリュー・ポリシー ObjectTypeGuiDescriptor.functionLibrary=関数ライブラリ ObjectTypeGuiDescriptor.objectCollection=オブジェクトコレクション -ObjectTypeGuiDescriptor.archetype=Archetype +ObjectTypeGuiDescriptor.archetype=アーキタイプ ObjectTypeGuiDescriptor.unknown=未定義 operation.com.evolveum.midpoint.common.crypto.CryptoUtil.securitySelfTest=セキュリティ自己診断 operation.com.evolveum.midpoint.common.operation.import.object=オブジェクトのインポート @@ -1010,7 +1010,7 @@ PageAbout.button.testRepositoryCheckOrgClosure=組織閉鎖の整合性確認と PageAbout.button.reindexRepositoryObjects=リポジトリ・オブジェクトの再インデックス PageAbout.button.testRepository=リポジトリ自己診断 PageAbout.button.clearCssJsCache=CSS/JSキャッシュの削除 -PageAbout.button.factoryDefault=工場出荷状態に切替 +PageAbout.button.factoryDefault=Reset to factory default PageAbout.message.deleteAllObjects=本当にすべてのオブジェクトを削除しますか?この操作は数分かかることがあります。 PageAbout.message.couldntObtainJvmParams=JMXからJVMパラメータを取得できませんでした。 PageAbout.midPointRevision=${git.describe} @@ -1118,24 +1118,24 @@ PageAdmin.menu.top.configuration.notifications=通知 PageAdmin.menu.top.configuration.profiling=プロファイリング PageAdmin.menu.top.configuration.adminGui=管理GUI PageAdmin.menu.top.configuration.repositoryObjects=リポジトリー・オブジェクト -PageAdmin.menu.top.configuration.repositoryObjectsList=All objects +PageAdmin.menu.top.configuration.repositoryObjectsList=すべてのオブジェクト PageAdmin.menu.top.configuration.security=セキュリティー PageAdmin.menu.top.home=ホーム PageAdmin.menu.top.reports.created=作成されたレポート -PageAdmin.menu.top.reports.list=All reports +PageAdmin.menu.top.reports.list=すべてのレポート PageAdmin.menu.top.reports.new=Jasperレポートのインポート PageAdmin.menu.top.reports=レポート PageAdmin.menu.top.resources.import=リソース定義のインポート -PageAdmin.menu.top.resources.list=All resources +PageAdmin.menu.top.resources.list=すべてのリソース PageAdmin.menu.top.resources.new=新規リソース PageAdmin.menu.top.resources.view=リソースを表示 PageAdmin.menu.top.resources.edit=リソースの編集 PageAdmin.menu.top.resources=リソース -PageAdmin.menu.top.connectorHosts.list=All connector hosts +PageAdmin.menu.top.connectorHosts.list=すべてのコネクター・ホスト PageAdmin.menu.top.roles.list=すべてのロール PageAdmin.menu.top.roles.new=新規ロール PageAdmin.menu.top.roles=ロール -PageAdmin.menu.top.serverTasks.list=All tasks +PageAdmin.menu.top.serverTasks.list=すべてのタスク PageAdmin.menu.top.serverTasks.new=新しいタスク PageAdmin.menu.top.serverTasks=サーバータスク PageAdmin.menu.top.users.find=ユーザー検索 @@ -1145,9 +1145,9 @@ PageAdmin.menu.top.users.org.new=新規組織 PageAdmin.menu.top.users.org=組織構造 PageAdmin.menu.top.users.org.tree=組織ツリー PageAdmin.menu.top.users=ユーザー -PageAdmin.menu.top.valuePolicies.list= バリーポリシー一覧 -PageAdmin.menu.top.valuePolicies.new = 新しいバリューポリシー -PageAdmin.menu.top.valuePolicies= バリューポリシー +PageAdmin.menu.top.valuePolicies.list= バリュー・ポリシー一覧 +PageAdmin.menu.top.valuePolicies.new = 新しいバリュー・ポリシー +PageAdmin.menu.top.valuePolicies= バリュー・ポリシー PageAdmin.menu.top.workItems.listClaimable=私の主張するアイテム PageAdmin.menu.top.workItems.list=私のアイテム PageAdmin.menu.top.workItems.listAll=すべてのアイテム @@ -1156,15 +1156,15 @@ PageAdmin.menu.top.workItems.listProcessInstancesRequestedBy=リクエスト PageAdmin.menu.top.workItems.listProcessInstancesRequestedFor=私宛のリクエスト PageAdmin.menu.top.workItems=作業アイテム PageAdmin.menu.top.workItems.listAttorney=代理人アイテム -PageAdmin.menu.top.caseWorkItems.list=My case work items -PageAdmin.menu.top.caseWorkItems.listAll=All case work items +PageAdmin.menu.top.caseWorkItems.list=私のケースの作業アイテム +PageAdmin.menu.top.caseWorkItems.listAll=すべての作業アイテムのケース PageAdmin.menu.top.caseWorkItems.view=View case work item PageAdmin.menu.top.case.new=New case PageAdmin.menu.top.cases.list=私のケース PageAdmin.menu.top.cases.listAll=すべてのケース pageAdmin.reports.description=レポートのエクスポート pageAdmin.reports=レポート -PageAdmin.menu.top.users.requestAssign=アサイン・リクエスト +PageAdmin.menu.top.users.requestAssign=アサイン要求 PageAdminObjectDetails.title.editUserType=ユーザー'{0}'の編集 PageAdminObjectDetails.title.viewUserType=ユーザー '{0}'の表示 PageAdminObjectDetails.title.newUserType=新規ユーザーの作成 @@ -1242,7 +1242,7 @@ pageAdmin.resources.description=接続先システム pageAdminResources.detailsResource=リソース詳細 pageAdminResources.editResource=リソースの編集 pageAdminResources.importResource=リソースのインポート -pageAdminResources.listResources=All resources +pageAdminResources.listResources=すべてのリソース pageAdminResources.message.cantLoadResource=リソースの詳細をロードできませんでした。 pageAdminResources.newResource=新規リソース pageAdmin.resources=リソース @@ -1277,7 +1277,7 @@ PageBulkAction.button.start=開始 PageBulkAction.message.emptyString=挿入された一括処理が空です。空でないスクリプトを提供してください。 PageBulkAction.options=オプション PageBulkAction.title=ユーザー・バルク・アクション -PageBulkAction.message.startPerformed.inProgress={0} has been successfully submitted to execution +PageBulkAction.message.startPerformed.inProgress={0}は実行へ正常に送信されました PageBulkAction.message.startPerformed.success=アクションが実行されました。 返された{0}つのアイテム。コンソールとデータの出力は、 'XMLにエクスポート'機能で利用できます。 PageBulkAction.message.startPerformed.fatalError.execute=バルク・アクションを実行できませんでした PageBulkAction.message.startPerformed.fatalError.submit=バルク・アクションを実行できませんでした @@ -1751,8 +1751,8 @@ PageInternals.title=内部設定 PageInternals.title.timeChange=時間変更 PageInternals.tolerateUndeclaredPrefixes=QNamesとパスで宣言されていない接頭辞を許容する PageInternals.title.counters=パフォーマンス・カウンター -PageInternals.title.traces=Performance traces -PageInternals.modelProfiling=Model profiling +PageInternals.title.traces=パフォーマンス・トレース +PageInternals.modelProfiling=モデル・プロファイリング InternalOperationClasses.resourceSchemaOperations=リソース・スキーマ操作 InternalOperationClasses.connectorOperations=コネクター操作 InternalOperationClasses.shadowFetchOperations=シャドウ・フェッチ操作 @@ -1767,10 +1767,10 @@ InternalCounters.connectorCapabilitiesFetchCount=コネクター・キャパビ InternalCounters.scriptCompileCount=スクリプトコンパイル InternalCounters.scriptExecutionCount=スクリプト実行 InternalCounters.connectorOperationCount=コネクター操作 -InternalCounters.connectorSimulatedPagingSearchCount=Connector simulated paging search +InternalCounters.connectorSimulatedPagingSearchCount=コネクター・シミュレート・ページング検索 InternalCounters.shadowFetchOperationCount=シャドウ・フェッチ操作 InternalCounters.shadowChangeOperationCount=シャドウ変更操作 -InternalCounters.provisioningAllExtOperationCount=All external provisioning operations +InternalCounters.provisioningAllExtOperationCount=すべての外部プロビジョニング操作 InternalCounters.repositoryReadCount=レポジトリー読込み InternalCounters.prismObjectCompareCount=プリズムオブジェクト比較 InternalCounters.prismObjectCloneCount=プリズムオブジェクト・クローン @@ -2350,7 +2350,7 @@ pageTasks.message.noTaskSelected=タスクが選択されていません。 pageTasks.node.clustered=クラスタ化 pageTasks.node.executionStatus=ステータス pageTasks.node.lastCheckInTime=最終チェックイン時間 -pageTasks.node.contact=Contact +pageTasks.node.contact=コンタクト pageTasks.node.name=名前 pageTasks.nodes=ノード pageTasks.node.statusMessage=ステータス・メッセージ @@ -2478,16 +2478,16 @@ PageCaseWorkItem.case.outcome=結果 PageCaseWorkItem.case.openTimestamp=オープン・タイムスタンプ PageCaseWorkItem.case.closeTimestamp=終了タイムスタンプ PageCaseWorkItem.case.state=状態 -PageCaseWorkItem.caseWorkItem=Case work item +PageCaseWorkItem.caseWorkItem=作業アイテムのケース PageCaseWorkItem.caseWorkItem.name=名前 PageCaseWorkItem.caseWorkItem.assignees=アクター(複数) -PageCaseWorkItem.caseWorkItem.originalAssignee=Original Actor +PageCaseWorkItem.caseWorkItem.originalAssignee=元のアクター PageCaseWorkItem.caseWorkItem.closeTimestamp=終了タイムスタンプ PageCaseWorkItem.caseWorkItem.deadline=デッドライン PageCaseWorkItem.caseWorkItem.outcome=結果 PageCaseWorkItem.caseWorkItem.comment=コメント PageCaseWorkItem.caseWorkItem.evidence=エビデンス -PageCaseWorkItem.button.closeCase=Close Case +PageCaseWorkItem.button.closeCase=ケースを閉じる pageCases.table.description=説明 pageCases.table.actors=アクター pageCases.table.objectRef=オブジェクト @@ -2496,7 +2496,7 @@ pageCases.table.openTimestamp=Opened pageCases.table.closeTimestamp=終了 pageCases.button.delete=削除 PageCasesAllocatedToMe.title=私のケース -PageCasesAll.title=All Cases +PageCasesAll.title=すべてのケース MultipleAssignmentSelectorPanel.availableRoles=利用可能なロール MultipleAssignmentSelectorPanel.parameters=パラメーター MultipleAssignmentSelectorPanel.currentRoles=現在のロール @@ -2506,8 +2506,8 @@ MultipleAssignmentSelector.orgUnit=組織ユニット AssignmentPopup.addButtonTitle=少なくとも1つのオブジェクトを選択してください。 pageValuePolicies.table.description=説明 pageValuePolicies.button.delete=削除 -PageValuePolicies.title=All value policies -PageValuePolicy.title = バリューポリシー +PageValuePolicies.title=すべてのバリュー・ポリシー +PageValuePolicy.title = バリュー・ポリシー PageValuePolicy.button.back=戻る PageValuePolicy.button.save=保存 PageValuePolicy.basic= 基本情報 @@ -2576,11 +2576,11 @@ TaskOperationUtils.message.resumePerformed.fatalError=タスクを再開でき TaskOperationUtils.message.runNowPerformed.success=タスクの実行が正常にスケジュールされました。 TaskOperationUtils.message.runNowPerformed.fatalError=タスクをスケジュールできませんでした。 TaskWfChildPanel.approvalHistoryHelp=Decisions that have been done so far in the process of approving the changes displayed here. -TaskWfChildPanel.currentWorkItemsHelp=Work items for the changes displayed here that are currently active. +TaskWfChildPanel.currentWorkItemsHelp=現在アクティブな、ここに表示された変更の作業アイテム。 TaskWfChildPanel.showNextStagesHelp=次の承認ステージのプレビューを表示します。 TaskWfChildPanel.nextStagesHelp=これは次の承認ステージのプレビューです。 -TaskWfChildPanel.showWholeProcessHelp=Displays the whole approval process: stages already completed, current stage, as well as any expected following stages. -TaskWfChildPanel.wholeProcessHelp=This is an information on the whole approval process: stages already completed, current stage, as well as any expected following stages. +TaskWfChildPanel.showWholeProcessHelp=承認プロセス全体を表示します。既に完了したステージ、現在のステージ、および、予想される後続のステージです。 +TaskWfChildPanel.wholeProcessHelp=これは承認プロセス全体に関する情報です。既に完了したステージ、現在のステージ、および、予想される後続のステージです。 workItemPanel.relatedRequestsHelp=List of approval requests that have been created along with this one. Each request has its own approval process, and therefore can be approved or rejected independently of other ones. They were all started by a single change operation attempt, which contained several simpler changes. TaskWfChildPanel.relatedRequestsHelp=List of approval requests that have been created along with this one. Each request has its own approval process, and therefore can be approved or rejected independently of other ones. They were all started by a single change operation attempt, which contained several simpler changes. workItemPanel.showRequestHelp=ここに表示されている変更の承認リクエストとそれに対応する承認プロセスを表示します。 @@ -2837,8 +2837,8 @@ ResourceWizard.expression.tooltip.expression=式のXML表現。 これは解釈 ResourceWizard.expression.tooltip.language=式スクリプトが書かれたプログラミング言語。 ResourceWizard.expression.tooltip.policyRef=バリュー・ポリシー・オブジェクトへの参照。 指定されたバリュー・ポリシーは、値を生成するためのテンプレートとして使用されます。 ResourceWizard.expression.tooltip.type=式のタイプ。 これは式がスクリプト、値ジェネレータなどのいずれであるかを指定します。 -ResourceWizard.help.capabilityStep=

Resource capabilities are the things that the resource can do. Not all the resource are equal in their capabilities. E.g. one resource supports account activation (enabling and disabling accounts) but other does not. One resource provides read-write access while other can support read-only access. One resource supports real-time synchronization while other does not. The capabilities define what features the resource supports so system can behave accordingly.

All the capabilities can be disabled (i.e. turned off). Disabling the capability will cause that system will not use that part of the connector and resource. The capabilities are usually disabled if they are faulty. E.g. if there is a bug in a connector or on the resource then the bug might be circumvented if appropriate capability is disabled. But the capabilities may be disabled also for administrative reasons. E.g. disabling Create, Update and Delete capabilities makes the resource efficiently read-only.

Some capabilities can be simulated. It means that system can pretend that the resource has specific capability even though it does not have it. E.g. an activation capability can be simulated by setting a specific account attribute to a specific value to disable an account. Such simulated capabilities usually require some configuration. This can also be configured on this page.

See Resource Capabilities wiki page for more details.

-ResourceWizard.help.configurationStep=

This stage of the wizard configures connector configuration properties. They usually define network parameters used to access the resource such as hostname and port numbers. Additional connection parameters such as operation network timeouts and connection pooling configuration can be specified here.

The connector configuration properties are unique for each connector. The specific set of configuration properties are determined by connector configuration schema. Therefore the content of this page depends on the connector type that was selected in the previous page.

+ResourceWizard.help.capabilityStep=

リソース機能はリソースができることです。すべてのリソースが機能的に同じというわけではありません。例えば、 1つのリソースはアカウントの有効化(アカウントの有効化と無効化)をサポートしますが、その他はサポートしません。 1つのリソースが読み書きアクセスを提供し、他のリソースが読み取り専用アクセスをサポートできます。一方のリソースはリアルタイム同期をサポートしますが、他方はサポートしません。機能は、リソースがサポートする機能を定義し、システムがそれに応じて動作できるようにします。

すべての機能を無効にする(つまりオフにする)ことができます。この機能を無効にすると、システムはコネクターとリソースのその部分を使用しません。これらの機能に問題があると、機能は通常無効になります。例えば、コネクターまたはリソースにバグがある場合、適切な機能が無効になっているとバグが回避される可能性があります。しかし、管理上の理由からも機能が無効になっている可能性があります。例えば、作成更新削除機能を無効にすると、リソースは効率的に読み取り専用になります。

一部の機能はシミュレートできます。つまり、システムにはリソースがなくてもリソースに特定の機能があると見せかけることができます。例えば、特定のアカウント属性を特定の値に設定してアカウントを無効にすることで、アクティブ化機能をシミュレートできます。そのようなシミュレートされた機能は通常何らかの設定を必要とします。これはこのページでも設定できます。

詳細はResource Capabilities wikiページを参照してください。

+ResourceWizard.help.configurationStep=

ウィザードのこのステージで、コネクター設定プロパティを設定します。 それらは通常、ホスト名やポート番号などのリソースへのアクセスに使用されるネットワーク・パラメーターを定義します。 操作ネットワークのタイムアウトや接続プーリングの設定など、追加の接続パラメータをここで指定できます。

コネクター設定プロパティは各コネクターに固有です。 特定の構成プロパティーのセットは、コネクター構成スキーマによって決まります。 したがって、このページの内容は前のページで選択されたコネクターの種類によって異なります。

ResourceWizard.help.nameStep=

ウィザードのこのステージでは、リソースの基本的なプロパティを設定します。 リソース名と説明を設定するために使用できます。 コネクター名は必須であり、一意である必要があります。 リソースへのアクセスに使用されるコネクターも設定する必要があります。 コネクターはコネクター・ホストにデプロイされます。 コネクター・ホストを空のままにすると、システム・インスタンスに直接デプロイされたコネクターが使用されます。

リソース設定の詳細な説明については、リソース設定のWikiページを参照してください。

ResourceWizard.help.schemaHandlingStep=

This step is used to provide configuration for handling of resource schema. The configuration displayed on this page tells system what to do with resource object classes and attributes. It contains the configuration of mappings between user properties and account attributes, configuration of account types, groups, provisioning dependencies, password mapping and so on.

The configuration is grouped into object types. Each object type defines the behavior for specific account type, entitlement type, OU, etc. The object type is uniquely identified by the combination of kind and intent. The kind defines what kind of the object it is:

  • kind=account means that the object is an account, i.e. that it represents a user.
  • kind=entitlement is applied to groups, roles, privileges, ACIs and similar objects that can be associated with accounts and which give privileges or access rights to the account.
  • kind=generic applies to other objects such as organizational units (OUs), domains, etc.
Intent is a plain string that can be used to distinguish several object types. E.g. it can be used to define several account types, e.g. "default user account", "administration account", "testing account" and so on. See Kind, Intent and ObjectClass wiki page for more details.

More details about schema handling configuration are provided on Resource Schema Handling wiki page. ResourceWizard.help.schemaStep=

This page shows resource schema. The resource schema defines object classes that the connector can manage, e.g. accounts, groups, organizational units and so on. The schema defines a set of attributes for each object class. The schema is presented here in read-only form so you can inspect it and familiarize yourself with the data model that the resource provides.

The resource schema presented at this page is usually retrieved from the resource and automatically generated by system. Resource schema defines what the resource can do, i.e. what object classes it defines and what attributes are used in the object classes. Therefore the schema is read-only. It is not a configuration. It does not defines how system uses the object classes and attributes. That is configured in next steps of the wizard.

See Resource Schema wiki page for detailed explanation of resource schema concepts

@@ -2885,8 +2885,8 @@ SchemaHandlingStep.association.tooltip.associationLocalPart=TODO: SchemaHandling SchemaHandlingStep.association.tooltip.associationNamespace=TODO: SchemaHandlingStep.association.tooltip.associationNamespace SchemaHandlingStep.association.tooltip.direction=アソシエーションの方向を定義します。 オブジェクト対サブジェクト:オブジェクト(例えば、グループ)は、サブジェクト(例えば、アカウント)の識別子を含む属性を有する。 サブジェクトからオブジェクトへ:サブジェクト(例えば、アカウント)には、オブジェクトの識別子(グループなど)を含む属性があります。 SchemaHandlingStep.association.tooltip.explicitRefIntegrity=明示的な参照整合性。falseに設定すると、システムはリソースが参照整合性を実装していると見なします。例えば、 システムは、アカウントの名前が変更され、システムが何もする必要がない場合に、リソースが自動的にアソシエーションIDを更新すると想定します。trueに設定すると、システムは明示的に参照整合性を取ります。この場合、システムは、アカウントの名前が変更されると、アソシエーション属性を明示的に更新します。 -SchemaHandlingStep.association.tooltip.intent=Intent of the association target object type. Target kind and intent identify an object type which is association target, e.g. a group, privilege, role, etc. -SchemaHandlingStep.association.tooltip.kind=Kind of the association target object type. This is usually "entitlement". Target kind and intent identify an object type which is association target, e.g. a group, privilege, role, etc. +SchemaHandlingStep.association.tooltip.intent=アソシエーションの対象オブジェクト・タイプの用途。 ターゲットの種類と用途は、アソシエーションの対象となるオブジェクト・タイプを識別します。 グループ、特権、ロールなど +SchemaHandlingStep.association.tooltip.kind=アソシエーションの対象オブジェクト・タイプの種類。 これは通常”エンタイトルメント”です。 ターゲットの種類と用途は、アソシエーションの対象となるオブジェクトタイプを識別します。例えば、 グループ、特権、ロールなど。 SchemaHandlingStep.association.tooltip.valueAttribute=Name of the attribute that is the source of a value for the association. The value of this attribute will be taken and stored into the association attribute to form an association. This is usually an attribute that contains an identifier or name such as "uid", "id", "name", etc. In subject-to-object associations this is an attribute of an object (e.g. group). In object-to-subject associations this is an attribute of a subject (e.g. account). SchemaHandlingStep.attribute.label.attributeName=属性名 SchemaHandlingStep.attribute.label.attributeNamespace=属性名前空間 @@ -2900,7 +2900,7 @@ SchemaHandlingStep.attribute.tooltip.intolerantVP=このパターンに一致す SchemaHandlingStep.attribute.tooltip.limitations=多重度、それを読み書きする能力などの属性制限を指定します。 SchemaHandlingStep.attribute.tooltip.matchingRule=二つの属性値が同じ意味を持つかを決定するルール。例:ルールを'stringIgnoreCase'に設定した場合、この属性値は大文字小文字が区別されなくなります。 SchemaHandlingStep.attribute.tooltip.outbound=アウトバウンド・マッピングは、リソース(通常はアカウント)へシステム(通常はユーザー)から値をマッピングします。 -SchemaHandlingStep.attribute.tooltip.reference=Name of the attribute to configure. All the settings and mappings below apply to this attribute. +SchemaHandlingStep.attribute.tooltip.reference=設定する属性の名前。以下のすべての設定とマッピングはこの属性に適用されます。 SchemaHandlingStep.attribute.tooltip.tolerant=許容属性は、システムの外部で設定された値を許容します。拒否属性は、システム内で定義されている値のみを許可します(例えば、リソースまたはロールのマッピングによって)。 SchemaHandlingStep.attribute.tooltip.tolerantVP=A value that matches this pattern will be tolerated. I.e. it will remain as the attribute value even if it is not a result of system processing (mappings). SchemaHandlingStep.button.add=オブジェクトタイプの追加 @@ -2913,7 +2913,7 @@ SchemaHandlingStep.dependency.tooltip.kind=私たちが依存するオブジェ SchemaHandlingStep.dependency.tooltip.order=通常はゼロです。 循環を形成し、他の方法では解決できない依存関係の順序を決定する整数を指定できます(別名、高位依存関係)。 SchemaHandlingStep.dependency.tooltip.resourceRef=私たちが依存するリソース。 SchemaHandlingStep.dependency.tooltip.strictness=Specifies how strictly will be the dependency resolved. Lax: if the dependency is not there continue as normal (only used to impose operation ordering); Relaxed: refuse to do operation unless the dependency is tried first, but if that fails then continue anyway; Strict: proceed only is the dependency is tried first and it succeeds. -SchemaHandlingStep.iteration.tooltip.maxIteration=Maximum number of iterations to try. The operation will end with a failure if the maximum number of iterations is tried without any success. +SchemaHandlingStep.iteration.tooltip.maxIteration=試行する最大反復回数。 最大反復回数を試行しても成功しなかった場合、操作は失敗して終了します。 SchemaHandlingStep.iteration.tooltip.returnMultiplicity=TODO: SchemaHandlingStep.iteration.tooltip.returnMultiplicity SchemaHandlingStep.iteration.tooltip.variable=TODO: SchemaHandlingStep.iteration.tooltip.variable SchemaHandlingStep.label.activation=アクティベーション @@ -2972,7 +2972,7 @@ SchemaHandlingStep.tooltip.dependency=Dependencies are object types that has to SchemaHandlingStep.tooltip.filterClause=TODO: SchemaHandlingStep.tooltip.filterClause SchemaHandlingStep.tooltip.intent=用途は、システムがオブジェクトに対して何をすべきかを指定します。用途は、同じ種類のオブジェクトをいくつかのカテゴリに分類します。 用途が異なるオブジェクトは、システムによって異なる方法で処理される可能性があります。 SchemaHandlingStep.tooltip.iteration=Iteratively find values for unique attributes such as identifiers. Identity Manager will try several times to find a unique value for such attributes. -SchemaHandlingStep.tooltip.kind=Kind specified what this object is, whether it is account, entitlement or something else. +SchemaHandlingStep.tooltip.kind=種類は、このオブジェクトが何であるか、それがアカウント、エンタイトルメント、または何か他のものであるかどうかを指定しました。 SchemaHandlingStep.tooltip.objectClass=このオブジェクト・タイプのインスタンスを構築するために使用されるスキーマのオブジェクトクラス。 SchemaHandlingStep.tooltip.protected=このオブジェクト型の保護されたインスタンスの指定 システムは保護されたインスタンスを見ることができますが、触れることはできません。 それらを変更しようとしても失敗します。 これは、 "root"や "administrator"などの緊急管理アカウントを保護するために使用されます。 SchemaHandlingStep.duplicateObjectTypeWarning=種類/用途の定義がさらにあります:{0}。 @@ -3003,8 +3003,8 @@ SchemaStep.schema=スキーマ SchemaStep.title=スキーマ SchemaStep.tooltip.intent=用途は、システムがオブジェクトに対して何をすべきかを指定します。用途は、同じ種類のオブジェクトをいくつかのカテゴリに分類します。 用途が異なるオブジェクトは、システムによって異なる方法で処理される可能性があります。 SchemaStep.tooltip.isDefault=trueに設定した場合、この定義はその種類のデフォルトです。すなわち、意図が明示的に指定されていない場合は、この定義が使用されます。 -SchemaStep.tooltip.kind=Kind specified what this object is, whether it is account, entitlement or something else. -SchemaStep.tooltip.nativeObjectClass=Object class name how it is natively known by the resource (or the connector). +SchemaStep.tooltip.kind=種類は、このオブジェクトが何であるか、それがアカウント、エンタイトルメント、または何か他のものであるかどうかを指定しました。 +SchemaStep.tooltip.nativeObjectClass=オブジェクト・クラス名は、リソース(またはコネクター)によってネイティブに認識される方法。 SchemaStep.xml=XML SearchFilterPanel.button.update=更新句 SearchFilterPanel.label.description=説明 @@ -3031,7 +3031,7 @@ StandardLoggerType.EXPRESSION=Expression (c.e.m.common.expression.Expression) StandardLoggerType.MAPPING=Mapping (c.e.m.common.mapping.Mapping) StandardLoggerType.PROJECTOR_DETAIL=Projector detailed (c.e.m.model.impl.lens.projector) StandardLoggerType.PROJECTOR=Projector (c.e.m.model.impl.lens.projector.Projector) -StandardLoggerType.SYNCHRONIZATION=Synchronization service (c.e.m.model.impl.sync) +StandardLoggerType.SYNCHRONIZATION=同期サービス(c.e.m.model.impl.sync) StandardLoggerType.AUTHORIZATION=認可(c.e.m.security.enforcer.impl.SecurityEnforcerImpl) StandardLoggerType.SCRIPT_EXPRESSION=Script expression (c.e.m.common.expression.script.ScriptExpression) SubtasksPanel.label.category=カテゴリー @@ -3346,7 +3346,7 @@ UserReportConfigPanel.dateTo=To UserReportConfigPanel.exportFileType=エクスポート・タイプ UserReportConfigPanel.title.basic=基本的なユーザー・レポート設定 user.enduser=エンドユーザー -user.noAssignments=No assignments +user.noAssignments=割当て無し user.superuser=スーパーユーザー user.orgManager=管理者 user.orgMember=メンバー @@ -3573,11 +3573,11 @@ SceneItemLinePanel.unknownLabel=(不明) operation.com.evolveum.midpoint.web.page.admin.resources.ResourceContentTabPanel.changeOwner=オーナーの変更(GUI) TaskSummaryPanel.progressWithTotalKnown=Progress: {0} out of {1} TaskSummaryPanel.progressWithTotalUnknown=Progress: {0} -TaskSummaryPanel.progressIfSuspended=(suspended) -TaskSummaryPanel.progressIfWaiting=(waiting) -TaskSummaryPanel.progressIfClosed=(closed) -TaskSummaryPanel.progressIfStalled=(stalled since {0}) -TaskSummaryPanel.lastProcessed=Last object processed: {0} +TaskSummaryPanel.progressIfSuspended=(一時停止済み) +TaskSummaryPanel.progressIfWaiting=(待機中) +TaskSummaryPanel.progressIfClosed=(終了) +TaskSummaryPanel.progressIfStalled=({0}以降に停止した) +TaskSummaryPanel.lastProcessed=最後に処理されたオブジェクト:{0} ResourceContentResourcePanel.showExisting=Show existing ResourceContentResourcePanel.newTask=新規作成 SearchPanel.advanced=高度 @@ -3599,7 +3599,7 @@ autoRefreshPanel.pauseRefreshing=リフレッシュを一時中断する autoRefreshPanel.refreshingEach={0} 秒毎にリフレッシュ autoRefreshPanel.noRefreshing=(リフレッシュしない) PageAdmin.menu.top.services=サービス -PageAdmin.menu.top.services.list=All services +PageAdmin.menu.top.services.list=すべてのサービス PageAdmin.menu.top.services.new=新規サービス PageAdmin.menu.top.services.edit=サービスの編集 taskShowAdvancedFeaturesPanel.label=高度な機能を表示 @@ -3672,8 +3672,8 @@ TreeTablePanel.recompute=再計算 TreeTablePanel.edit=編集 TreeTablePanel.viewDetails=詳細の表示 TreeTablePanel.createChild=子ノードを作成 -WorkItemSummaryPanel.allocated=Allocated -WorkItemSummaryPanel.notAllocated=Not allocated +WorkItemSummaryPanel.allocated=割当て済み +WorkItemSummaryPanel.notAllocated=未割当て WorkItemPanel.showRequest=承認リクエストを表示します。 DefinitionStagesPanel.confirmDelete=削除の確認 DefinitionStagesPanel.confirmDeleteText=本当にステージ'{0}'を削除しますか? @@ -3695,8 +3695,8 @@ StageDefinitionPanel.reviewerSpecificationObjectHelp=Selection of reviewers base StageDefinitionPanel.reviewerUseObjectManagerHelp=Selection of reviewers based on managers of object (typically a user) that has something assigned/induced to. E.g. you can specify that a manager is used to certify all assignments made to users in 'his' organization. StageDefinitionPanel.reviewerUseObjectManagerOrgTypeHelp=Influences determination of a manager of a user: First, we take all managers of all organizations the user belongs to. We exclude the user himself, if he is a manager of such organization (and if 'allow managers to approve their own assignments' below is unchecked). If the value in this field is filled-in, we use it to select only organizations with given organization type value - for example, 'functional' (if you have e.g. both functional-type and project-type organizations). If this field is empty, we take into account all organizations. If we find no suitable manager, we continue with all parent organizations (again, of the given type, if specified). StageDefinitionPanel.reviewerUseObjectManagerAllowSelfHelp=If a user is a manager in his organization, could he be selected as a reviewer for his own assignments? If unchecked (the default), a higher-level manager is searched for - see description for the above field. -StageDefinitionPanel.defaultReviewerRefHelp=This reviewer (or reviewers) will be used if the above condition would lead to no reviewer. -StageDefinitionPanel.additionalReviewerRefHelp=This reviewer (or reviewers) will be used in addition to any reviewers selected by the above conditions. +StageDefinitionPanel.defaultReviewerRefHelp=上記の条件でレビューワーを導けない場合は、このレビューワー(複数可)が使用されます。 +StageDefinitionPanel.additionalReviewerRefHelp=このレビューワー(複数可)は、上記の条件で選択されたレビューワーに加えて使用されます。 StageDefinitionPanel.outcomeStrategyHelp=If there is more than one reviewer selected, we need a strategy for combining their responses into stage-level outcome. For example, is it sufficient if any of them accepts the certification case? Or should all of them accept? Select the strategy using this field. StageDefinitionPanel.outcomeIfNoReviewersHelp=What should be the outcome if there are no reviewers assigned, e.g. if the reviewer is defined as the target role owner, but a particular role has no owner? This does NOT apply in situations when there are reviewers assigned, but they provide no response. StageDefinitionPanel.stopReviewOnHelp=ケースが次のステージに進むのを妨げるのはどのような結果ですか?通常はデフォルト値を変更する必要はありません。必要に応じて、XML設定を通じて変更できます。 @@ -3706,10 +3706,10 @@ NameStep.configurationWillBeLost=The selected connector configuration schema is resultsHandlerConfiguration=結果ハンドラー enableFilteredResultsHandler=結果の追加フィルタリングを有効にする enableFilteredResultsHandlerHelp=このハンドラーは、コネクター・フレームワークのレベルで、コネクターによってリソースから取得された結果をフィルターに掛けます。 それ自体では完全なフィルタリングを提供しないコネクタ実装によって使用されます。 このハンドラーを有効にするといくつかの欠点があります。 ページングの分野で。 そのため、本当に必要な場合にのみ使用してください。 よくわからない場合は、検証モードでフィルタリングを使用することをお勧めします。 ConnIdの現在のバージョンのデフォルト値:有効 -filteredResultsHandlerInValidationMode=Perform filtering in validation mode only +filteredResultsHandlerInValidationMode=検証モードでのみフィルタリングを実行する filteredResultsHandlerInValidationModeHelp=Switches the result filtering into validation mode: all data produced by the connector are checked by the connector framework to see if they are properly filtered. In case of improper filtering, an exception is raised. This mode is to be used for connectors that are expected to provide complete filtering, but their functionality in this area has to be verified. Default value for current version of ConnId: disabled. -enableCaseInsensitiveFilter=Make filtering case insensitive -enableCaseInsensitiveFilterHelp=This option makes filtering case insensitive, for all attributes on the resource. Used for case-insensitive resources. Default value for current version of ConnId: disabled. +enableCaseInsensitiveFilter=フィルタリングの大文字と小文字を区別しないようにする +enableCaseInsensitiveFilterHelp=このオプションを選択すると、リソース上のすべての属性について、大文字と小文字の区別がなくなります。 大文字と小文字を区別しないリソースに使用されます。 ConnIdの現在のバージョンのデフォルト値:無効。 enableNormalizingResultsHandler=返されたデータを正規化するハンドラーを有効にする enableNormalizingResultsHandlerHelp=このハンドラーは、リソースからシステムに渡される各属性を正規化します。 通常はオフにすることをお勧めします。 ConnIdの現在のバージョンのデフォルト値:有効 enableAttributesToGetSearchResultsHandler=「取得する属性」の結果ハンドラーを有効にします。 @@ -3720,7 +3720,7 @@ PageResourceWizard.readOnlySwitch=編集を有効にするにはここをクリ operation.com.evolveum.midpoint.web.page.admin.users.component.TreeTablePanel.recompute=再計算(GUI) Button.ok=OK Button.assign=アサイン -Note=Note +Note=注釈 Warning=警告 ProfilingConfigPanel.profilingMustBeEnabled=プロファイリングを使用するには、(config.xmlファイル内の)システム設定パラメータ'profilingEnabled'を 'true'に設定する必要があります。 OperationResultPanel.result=結果 @@ -3751,7 +3751,7 @@ PageResourceVisualization.seeOnlineLink=webgraphviz.com PageResourceVisualization.copyInstruction=次のDOTコードを貼り付けるだけです。 OrgMemberPanel.editUserTitle=詳細の編集/表示 OrgMemberPanel.unlinkTitle=Unlink manager -OrgMemberPanel.deleteTitle=Delete manager +OrgMemberPanel.deleteTitle=管理者の削除 PagePreviewChanges.title=変更のプレビュー operation.com.evolveum.midpoint.web.page.admin.PageAdminObjectDetails.previewChanges=変更のプレビュー operation.com.evolveum.midpoint.task.api.Task.run=タスク実行 @@ -3762,7 +3762,7 @@ operation.com.evolveum.midpoint.web.page.admin.certification.PageCertCampaign.op operation.com.evolveum.midpoint.web.page.admin.certification.PageCertCampaign.closeStage=ステージのクローズ operation.com.evolveum.midpoint.web.page.admin.certification.PageCertCampaign.closeCampaign=キャンペーンのクローズ operation.com.evolveum.midpoint.web.page.admin.certification.PageCertCampaign.startRemediation=修復の開始 -operation.com.evolveum.midpoint.web.page.admin.cases.PageCaseWorkItem.closeCaseWorkItem=Close Case +operation.com.evolveum.midpoint.web.page.admin.cases.PageCaseWorkItem.closeCaseWorkItem=ケースを閉じる operation.com.evolveum.midpoint.web.page.admin.cases.PageCase.saveCase=Case saved operation.com.evolveum.midpoint.certification.api.CertificationManager.openNextStage=次のステージをオープン @@ -3872,6 +3872,7 @@ PageAssignmentConflicts.back=戻る PageAssignmentConflicts.submit=送信 PageAssignmentsList.conflictsWarning=認可の問題による割当ての競合を計算できません。 理由: AbstractShoppingCartTabPanel.addAllButton=すべて追加 +AbstractShoppingCartTabPanel.goToShoppingCartButton=ショッピングカートへ行く AbstractShoppingCartTabPanel.requestingForLabel=要求の対象 AbstractShoppingCartTabPanel.availableRelationsLabel=Available relations AssignmentCatalogPanel.selectTargetUser=ターゲット・ユーザーの選択 @@ -3904,9 +3905,13 @@ AssignmentViewType.ORG_TYPE=すべての組織の表示 AssignmentViewType.SERVICE_TYPE=すべてのサービスの表示 AssignmentViewType.USER_TYPE=User's assignments PageAssignmentsList.requestButton = リクエスト -operation.com.evolveum.midpoint.web.page.self.PageAssignmentsList.requestAssignments=アサイン・リクエスト -com.evolveum.midpoint.web.page.self.PageAssignmentsList.requestAssignments=Request assignments +operation.com.evolveum.midpoint.web.page.self.PageAssignmentsList.requestAssignments=アサイン要求 +com.evolveum.midpoint.web.page.self.PageAssignmentsList.requestAssignments=アサイン要求 +PageAssignmentsList.requestInProgress=あなたのリクエストの処理は進行中です。あなたのリクエストは、承認、または、他の手動、または、非同期処理の対象となるかもしれません。 リクエストが処理されるのに十分な時間を見込んでください。 +PageAssignmentsList.requestSuccess=あなたのリクエストは処理されました。 割当てはすぐに使用できます。 +PageAssignmentsList.requestError=リクエストの処理中にエラーが発生しました。 PageAssignmentsList.title=新規アサインの一覧 +PageAssignmentsList.assignmentsToRequest=リクエストへの割当て PageAuditLogViewer.title=監査ログビューアー PageAuditLogViewer.menuName=監査ログビューアー PageAuditLogViewer.timeLabel=時刻 @@ -4000,7 +4005,7 @@ CaseType.event=イベント CaseType.workItem=作業アイテム CaseType.jpegPhoto=エビデンス AbstractWorkItemType.assigneeRef=担当者 -AbstractWorkItemType.originalAssigneeRef=Original Assignee +AbstractWorkItemType.originalAssigneeRef=元の担当者 AbstractWorkItemType.deadline=デッドライン AbstractWorkItemType.performerRef=Performer AbstractWorkItemType.closeTimestamp=終了 @@ -4114,7 +4119,7 @@ PolicyRulePropertiesPanel.exclusionConstraints=除外を追加 PolicyRulePropertiesPanel.minAssigneesConstraints=minAssignees PolicyRulePropertiesPanel.maxAssigneesConstraints=maxAssignees PolicyRulePropertiesPanel.modification=変更 -PolicyRulePropertiesPanel.assignmentConstraints=assignment +PolicyRulePropertiesPanel.assignmentConstraints=アサイン PolicyRulePropertiesPanel.timeValidityConstraints=timeValidity PolicyRulePropertiesPanel.situationConstraints=状況 AbstractPolicyConstraintType.name=名前 @@ -4209,8 +4214,13 @@ DisplayNamePanel.viewObjectDetails=オブジェクト詳細を表示 PageUsersView.title=ユーザー表示 pageAdminFocus.dataProtection=データ保護 PageInternals.title.cache=キャッシュ +PageInternals.title.threads=スレッド PageInternals.tab.cache=キャッシュの管理 +PageInternals.tab.threads=スレッド InternalsCachePanel.button.clearCaches=キャッシュの削除 +InternalsThreadsPanel.button.showAllThreads=すべてのスレッドを参照 +InternalsThreadsPanel.button.showTasksThreads=タスク・スレッドを参照 +InternalsThreadsPanel.button.recordTasksThreads=タスク・スレッドを記録 PageAccountActivation.user.not.found=予期しない問題が発生しました。システム管理者に連絡してください。 propertyConstraintValidator.error=パスが定義されていないプロパティー制約を設定できません。 ReferencePopupPanel.oid=Oid: @@ -4220,7 +4230,7 @@ chooseFocusTypeAndRelationDialogPanel.relation=リレーション: chooseFocusTypeAndRelationDialogPanel.type=タイプ chooseFocusTypeAndRelationDialogPanel.tooltip.type=割当てが終了するオブジェクトのタイプ abstractRoleMemberPanel.menu.assign=アサイン -abstractRoleMemberPanel.menu.assignMember=Assign member +abstractRoleMemberPanel.menu.assignMember=メンバーのアサイン abstractRoleMemberPanel.menu.unassign=アサイン解除 abstractRoleMemberPanel.menu.recompute=再計算 abstractRoleMemberPanel.menu.create=作成 @@ -4313,3 +4323,6 @@ LoggingConfigurationTabPanel.appender.patternColumn=パターン LoggingConfigurationTabPanel.appender.typeColumn=タイプ ResourceSummaryPanel.UP=アップ ResourceSummaryPanel.DOWN=ダウン +operation.com.evolveum.midpoint.web.page.admin.configuration.InternalsThreadsPanel.executeShowAllThreads=すべてのスレッドを参照する(Gui) +operation.com.evolveum.midpoint.web.page.admin.configuration.InternalsThreadsPanel.executeShowTasksThreads=実行中のタスク・スレッドを参照する(Gui) +operation.com.evolveum.midpoint.web.page.admin.configuration.InternalsThreadsPanel.executeRecordTasksThreads=実行中のタスク・スレッドを記録する(Gui) diff --git a/gui/admin-gui/src/main/resources/localization/Midpoint_lt.properties b/gui/admin-gui/src/main/resources/localization/Midpoint_lt.properties index e69dde9f114..f1d28daec67 100644 --- a/gui/admin-gui/src/main/resources/localization/Midpoint_lt.properties +++ b/gui/admin-gui/src/main/resources/localization/Midpoint_lt.properties @@ -22,7 +22,7 @@ addCapabilityDialog.button.Add=Pridėti addCapabilityDialog.button.cancel=Atšaukti addCapabilityDialog.column.name=Pavadinimas addCapabilityDialog.title=Pasirinkite pridedamus funkcionalumus -admStatusFetchStrategy.nullValid=Pasirinkite vieną +admStatusFetchStrategy.nullValid=Pasirinkite AEPlevel.FULL=Pilna AEPlevel.LEGALIZE=Santykinis AEPlevel.MARK=Pažymėti @@ -72,10 +72,10 @@ MetadataPanel.createTimestamp=Sukūrimo data MetadataPanel.creatorRef=Sukūręs asmuo MetadataPanel.createApproverRef=Sukurti tvirtinantį MetadataPanel.createApprovalTimestamp=Sukurti patvirtinimo datą -MetadataPanel.modifyTimestamp=Pakeitimų data +MetadataPanel.modifyTimestamp=Modifikuoti datą MetadataPanel.modifierRef=Modifikavimą atliko -MetadataPanel.modifyApproverRef=Redaguoti tvirtinantį -MetadataPanel.modifyApprovalTimestamp=Redaguoti patvirtinimo datą +MetadataPanel.modifyApproverRef=Modifikuoti tvirtinantį +MetadataPanel.modifyApprovalTimestamp=Modifikuoti patvirtinimo datą RelationTypes.MANAGER=Administratorius RelationTypes.OWNER=Savininkas RelationTypes.APPROVER=Tvirtinantysis @@ -127,7 +127,7 @@ AssignmentTablePanel.modal.message.deleteDelegation=Ar tikrai norite ištrinti { AssignmentTablePanel.modal.message.noDelegationWarning=Naudotojas neturi jokio deleguojamo elemento. AssignmentTablePanel.modal.title.confirmDeletion=Patvirtinti ištrynimą AssignmentTablePanel.modal.title.selectAssignment=Pasirinkite objektą(us) -associationAttribute.nullValid=Pasirinkite vieną +associationAttribute.nullValid=Pasirinkite AsyncDashboardPanel.loading=Įkeliami duomenys AuditPopulPanel.exportType.label=Išspausdinamų failų tipas AuditPopupPanel.auditEventType=Įvykio tipas @@ -212,8 +212,8 @@ CertDefinitionPage.message.cantSaveEmptyName=Negalima išsaugoti be pavadinimo. Channel.discovery=Aptikti Channel.import=Importuoti Channel.liveSync=Sinchronizacija realiu laiku -Channel.null=Pasirinkite vieną -channel.nullValid=Pasirinkite vieną +Channel.null=Pasirinkite +channel.nullValid=Pasirinkite Channel.reconciliation=Suderinimas Channel.recompute=Perskaičiuoti Channel.user=Naudotojas @@ -293,10 +293,10 @@ DeltaPanel.label.changeType=Pakeisti tipą: DeltaPanel.label.modifications=Modifikacijos: DeltaPanel.label.objectToAdd=Pridedami objektai: DeltaPanel.label.oid=Objektas kurio OID: -direction.nullvalid=Pasirinkite vieną +direction.nullvalid=Pasirinkite DoubleButtonPanel.button.default=Vykdyti DoubleButtonPanel.download=Parsisiųsti -DropDownChoicePanel.empty=Pasirinkite vieną +DropDownChoicePanel.empty=Pasirinkite DropDownChoicePanel.notDefined=Nenurodyta EmptyProcessDetailsPanel.message=Išsami informacija apie procesą nepasiekiama ExecuteChangeOptionsPanel.label.executeAfterAllApprovals=Vykdyti po visų patvirtinimų @@ -310,7 +310,7 @@ ExecuteChangeOptionsPanel.label.reconcileAffected.help=Suderinti paveiktus objek ExecuteChangeOptionsPanel.label.reconcile=Suderinti ExecuteChangeOptionsPanel.label.reconcile.help=Skirtas suderinti parinktajį objektą ir projekcijas pakeitimų metu. ExecuteChangeOptionsPanel.options=Nustatymai -existenceFetchStrategy.nullValid=Pasirinkite vieną +existenceFetchStrategy.nullValid=Pasirinkite ExportType.CSV=CSV ExportType.DOCX=DOCX ExportType.HTML=HTML @@ -336,7 +336,7 @@ ExpressionEditorPanel.message.expressionSuccess=Išraiška sėkmingai atnaujinta ExpressionEvaluatorType.AS_IS=Kaip yra ExpressionEvaluatorType.GENERATE=Generuoti ExpressionEvaluatorType.LITERAL=Paraidžiui -ExpressionEvaluatorType.null=Pasirinkite vieną +ExpressionEvaluatorType.null=Pasirinkite ExpressionEvaluatorType.PATH=Lokacijos kelias ExpressionEvaluatorType.SCRIPT=Scenarijus ExpressionReturnMultiplicityType.MULTI=Multi @@ -377,7 +377,7 @@ feedbackMessagePanel.param=Param. : feedbackMessagePanel.showStack=[ PARODYTI DĖKLO KLAIDĄ ] feedbackMessagePanel.times=Kartai feedtempMessagePanelbackMessagePanel.message.info=Informacija -fetchStrategy.nullValid=Pasirinkite vieną +fetchStrategy.nullValid=Pasirinkite filter.duplicate=Filtras '{0}' jau yra nurodytas filter.emptyFilter=Filtras negali buti tuščias FocusTypeAssignmentPopupTabPanel.message.addFilterToContentQuery.fatalError=Nepavyko įkelti galimas roles @@ -448,7 +448,7 @@ JasperReportParameterProperties.targetType=Adresato tipas JasperReportParameterProperties.multivalue=Daugiareikšmis JasperReportParameterProperties.config=Nustatymų konfigūracija JasperReportParameterProperties.title=Konfigūruoti -kind.nullValid=Pasirinkite vieną +kind.nullValid=Pasirinkite Language.GROOVY=Groovy (pagal nutylėjimą) Language.JAVASCRIPT=Javascript Language.XPATH=XPath @@ -529,7 +529,7 @@ lower.ActivationStatusType.DISABLED=Išjungtas lower.ActivationStatusType.ENABLED=Įjungtas lower.ActivationStatusType.null=Nenurodytas mainForm.category.null=Visi -mainForm.mailServer.nullValid=Pasirinkite vieną +mainForm.mailServer.nullValid=Pasirinkite mainForm.state.null=Visi mainForm.tabPanel.panel.aepChooser.null=Santykinis (pagal nutylėjimą) MappingEditorDialog.button.cancel=Atšaukti @@ -562,7 +562,7 @@ MappingsStatistics.MinTime=Min. MappingsStatistics.Object=Turintis objektą MappingsStatistics.TotalTime=Suminis laikas MappingType.label.placeholder=Sukurti naują susiejimą. -matchingRule.nullValid=Pasirinkite vieną +matchingRule.nullValid=Pasirinkite message.emptyLevel=Lygmuo negali būti tuščias message.emptyString=Įvedimo skydelis negali būti tuščias message.error=Pabandykite vėliau. @@ -633,7 +633,7 @@ NotificationsStatistics.MaxTime=Max NotificationsStatistics.MinTime=Min NotificationsStatistics.TotalTime=Suminis laikas NotificationsStatistics.Transport=Pokytis -nullValid=Pasirinkite vieną +nullValid=Pasirinkite ObjectDataProvider.message.listObjects.fatalError=Nepavyko pateikti objektų. ObjectDataProvider.message.countObjects.fatalError=Nepavyko suskaičiuoti objektų. ObjectDataProvider.message.loadResourceForAccount.fatalError=Nepavyko įkelti paskyrai skirtus resursus. @@ -659,10 +659,10 @@ ObjectPolicyConfigurationTabPanel.objectTemplate=Objekto šablonas ObjectPolicyConfigurationTabPanel.lifecycleState=Gyvavimo ciklas ObjectPolicyConfigurationTabPanel.lifecycleState.value.no=Ne ObjectPolicyConfigurationTabPanel.lifecycleState.value.yes=Taip -objectSyncConfig.editorFocus.nullValid=Pasirinkite vieną -objectSyncConfig.editorKind.nullValid=Pasirinkite vieną -objectSyncConfig.editorObjectTemplate.nullValid=Pasirinkite vieną -objectTemplateRef.nullValid=Pasirinkite vieną +objectSyncConfig.editorFocus.nullValid=Pasirinkite +objectSyncConfig.editorKind.nullValid=Pasirinkite +objectSyncConfig.editorObjectTemplate.nullValid=Pasirinkite +objectTemplateRef.nullValid=Pasirinkite ObjectTypeGuiDescriptor.abstractRole=Abstrakti rolė ObjectTypeGuiDescriptor.accessCertificationCampaign=Prieigos sertifikavimo proceso operacijos ObjectTypeGuiDescriptor.accessCertificationDefinition=Prieigos sertifikavimo proceso nustatymai @@ -693,7 +693,7 @@ ObjectTypeGuiDescriptor.case=Įvykis ObjectTypeGuiDescriptor.valuePolicy=Reikšmių politika ObjectTypeGuiDescriptor.functionLibrary=Funkcijų biblioteka ObjectTypeGuiDescriptor.objectCollection=Objektų kolekcija -ObjectTypeGuiDescriptor.archetype=Archetype +ObjectTypeGuiDescriptor.archetype=Prototipas ObjectTypeGuiDescriptor.unknown=Nenurodyta operation.com.evolveum.midpoint.common.crypto.CryptoUtil.securitySelfTest=Saugos testavimas operation.com.evolveum.midpoint.common.operation.import.object=Importuoti objektą @@ -997,7 +997,7 @@ orgUnitAddDeletePopup.button.add=Pridėti org. vienetą(us) orgUnitAddDeletePopup.button.cancel=Atšaukti orgUnitAddDeletePopup.button.remove=Pašalinti org. vienetą(us) orgUnitAddDeletePopup.column.name=Pavadinimas -orgUnitAddDeletePopup.title=Pasirinkite vieną +orgUnitAddDeletePopup.title=Pasirinkite org. vienetą OrgUnitBrowser.cancel=Atšaukti OrgUnitBrowser.createRoot=Padaryti šakniniu (root) OrgUnitBrowser.message.queryError=Įvyko klaida perkeliant paieškos užklausą į filtrą. @@ -1010,7 +1010,7 @@ PageAbout.button.testRepositoryCheckOrgClosure=Org. uždarymo nuoseklumo patikri PageAbout.button.reindexRepositoryObjects=Saugyklos objektų perindeksavimas PageAbout.button.testRepository=Saugyklos testavimas PageAbout.button.clearCssJsCache=Išvalyti CSS/JS podėlį -PageAbout.button.factoryDefault=Atstatyti į numatytąją gamyklinę reikšmę +PageAbout.button.factoryDefault=Atstatyti gamyklinius nustatymus PageAbout.message.deleteAllObjects=Ar tikrai norite ištrinti visus objektus? Tai gali užtrukti kelias minutes. PageAbout.message.couldntObtainJvmParams=Negalima gauti JVM parametrų iš JMX. PageAbout.midPointRevision=${git.describe} @@ -1118,24 +1118,24 @@ PageAdmin.menu.top.configuration.notifications=Pranešimai PageAdmin.menu.top.configuration.profiling=Profiliavimas PageAdmin.menu.top.configuration.adminGui=Administratoriaus GUI PageAdmin.menu.top.configuration.repositoryObjects=Saugyklos objektai -PageAdmin.menu.top.configuration.repositoryObjectsList=All objects +PageAdmin.menu.top.configuration.repositoryObjectsList=Visi objektai PageAdmin.menu.top.configuration.security=Sauga PageAdmin.menu.top.home=Pradžia PageAdmin.menu.top.reports.created=Sukurtos ataskaitos -PageAdmin.menu.top.reports.list=All reports +PageAdmin.menu.top.reports.list=Visos ataskaitos PageAdmin.menu.top.reports.new=Importuoti Jasper ataskaitas PageAdmin.menu.top.reports=Ataskaitos PageAdmin.menu.top.resources.import=Resursų importavimo apibrėžtis -PageAdmin.menu.top.resources.list=All resources +PageAdmin.menu.top.resources.list=Visi resursai PageAdmin.menu.top.resources.new=Naujas resursas PageAdmin.menu.top.resources.view=Peržiūrėti resursus PageAdmin.menu.top.resources.edit=Redaguoti resursus PageAdmin.menu.top.resources=Resursai -PageAdmin.menu.top.connectorHosts.list=All connector hosts +PageAdmin.menu.top.connectorHosts.list=Visi sąsajų serveriai PageAdmin.menu.top.roles.list=Visos rolės PageAdmin.menu.top.roles.new=Nauja rolė PageAdmin.menu.top.roles=Rolės -PageAdmin.menu.top.serverTasks.list=All tasks +PageAdmin.menu.top.serverTasks.list=Visos užduotys PageAdmin.menu.top.serverTasks.new=Nauja užduotis PageAdmin.menu.top.serverTasks=Serverio užduotys PageAdmin.menu.top.users.find=Naudotojų paieška @@ -1242,7 +1242,7 @@ pageAdmin.resources.description=Sujungtos sistemos pageAdminResources.detailsResource=Išsami informacija apie resursą pageAdminResources.editResource=Redaguoti resursą pageAdminResources.importResource=Importuoti resursą -pageAdminResources.listResources=All resources +pageAdminResources.listResources=Visi resursai pageAdminResources.message.cantLoadResource=Negalima įkelti detalios informacijos apie resursą. pageAdminResources.newResource=Naujas resursas pageAdmin.resources=Resursai @@ -1620,7 +1620,7 @@ PageDashboard.assignments=Mano priskyrimai PageDashboard.personalInfo=Asmeninė informacija PageDashboard.serverLoad=Serverio apkrova PageDashboard.systemInfo=Sistemos būsena -PageDashboard.title=Dashboards +PageDashboard.title=Darbalaukis PageDashboard.usedRam=Naudojamas RAM PageDashboard.workItems=Mano darbai PageDashboard.infobox.users.label=Naudotojai @@ -1645,18 +1645,18 @@ PageDashboard.infobox.resources.total=viso PageDashboard.infobox.tasks.label=Užduotys PageDashboard.infobox.tasks.number=aktyvios PageDashboard.infobox.tasks.total=viso -PageDashboard.infobox.modifications.label=Modifications -PageDashboard.infobox.modifications.number=success +PageDashboard.infobox.modifications.label=Modifikacijos +PageDashboard.infobox.modifications.number=sėkmingas PageDashboard.infobox.errors.label=Klaidos -PageDashboard.infobox.errors.number=failed -PageDashboard.infobox.moreInfo=More info +PageDashboard.infobox.errors.number=nepavykęs +PageDashboard.infobox.moreInfo=Daugiau informacijos PageDashboard.search.input=Įveskite ieškomo naudotojo prisijungimo vardą PageDashboard.search.users=Naudotojai PageDashboard.search.resources=Resursai PageDashboard.search.roles=Rolės PageDashboard.search.tasks=Užduotys -PageDashboardInfo.title=Info dashboard -PageDashboardAdmin.title=Admin dashboard +PageDashboardInfo.title=Informacinis darbalaukis +PageDashboardAdmin.title=Administratoriaus darbalaukis pageDebugList.button.clear=Išvalyti pageDebugList.button.search=Ieškoti pageDebugList.description=Aprašymas @@ -1752,7 +1752,7 @@ PageInternals.title.timeChange=Laiko keitimas PageInternals.tolerateUndeclaredPrefixes=Toleruoti, jei nepateikti prefiksai QNames ir lokacijos nuorodos PageInternals.title.counters=Veiklos našumo skaitikliai PageInternals.title.traces=Veiklos stebėjimas -PageInternals.modelProfiling=Model profiling +PageInternals.modelProfiling=Modelio profiliavimas InternalOperationClasses.resourceSchemaOperations=Resursų schemos operacijos InternalOperationClasses.connectorOperations=Sąsajos operacijos InternalOperationClasses.shadowFetchOperations="Šešėlių" gavimo operacijos @@ -2350,7 +2350,7 @@ pageTasks.message.noTaskSelected=Nepasirinkta užduotis. pageTasks.node.clustered=Klasterizuota pageTasks.node.executionStatus=Statusas pageTasks.node.lastCheckInTime=Paskutinis prisijungimas -pageTasks.node.contact=Contact +pageTasks.node.contact=Kontaktai pageTasks.node.name=Pavadinimas pageTasks.nodes=Mazgai pageTasks.node.statusMessage=Būsenos žinutė @@ -2496,7 +2496,7 @@ pageCases.table.openTimestamp=Atidaryta pageCases.table.closeTimestamp=Uždaryta pageCases.button.delete=Ištrinti PageCasesAllocatedToMe.title=Mano atvejai -PageCasesAll.title=All Cases +PageCasesAll.title=Visi atvejai MultipleAssignmentSelectorPanel.availableRoles=Galimos rolės MultipleAssignmentSelectorPanel.parameters=Nustatymai MultipleAssignmentSelectorPanel.currentRoles=Esamos rolės @@ -2506,7 +2506,7 @@ MultipleAssignmentSelector.orgUnit=Org. vienetas AssignmentPopup.addButtonTitle=Prašome pasirinkti bent 1 objektą pageValuePolicies.table.description=Aprašymas pageValuePolicies.button.delete=Ištrinti -PageValuePolicies.title=All value policies +PageValuePolicies.title=Visų reikšmių politika PageValuePolicy.title = Reikšmių politika PageValuePolicy.button.back=Atgal PageValuePolicy.button.save=Išsaugoti @@ -2641,7 +2641,7 @@ PersonalInfoPanel.never=Nenurodyta PersonalInfoPanel.other=Kita informacija PersonalInfoPanel.passwordExp=Paskyra galioja iki PersonalInfoPanel.undefined=Nenurodyta -policyRef.nullValid=Pasirinkite vieną +policyRef.nullValid=Pasirinkite prismContainer.mainPanelDisplayName=Nustatymai prismContainer.shadow.associations=Asociacijos prismContainer.shadow.mainPanelDisplayName=Atributai @@ -2723,7 +2723,7 @@ ReconciliationPopupPanel.exportFileType=Išspausdinimo tipas DownloadButtonPanel.download=Parsiųsti ReconciliationPopupPanel.resource=Resursas ReconciliationPopupPanel.title.basic=Pagrindinė ataskaitos konfigūracija -repeater.input.nullValid=Pasirinkite vieną +repeater.input.nullValid=Pasirinkite RepoInitialSetup.message.init.fatalError=Duomenų saugyklos post inicializavimas nepavyko. ReportConfigurationPanel.title.basic=Pagrindinė informacija ReportConfigurationPanel.title.advanced=Papildoma informacija @@ -3024,7 +3024,7 @@ simpleErrorPanel.label.showMore=Parodyti daugiau simpleErrorPanel.message.error=Paskyra neįkelta resurse '{0}'. SimpleRoleSelector.reset=Atstatyti į pradinę būseną MultipleAssignmentSelector.reset=Iš naujo nustatykite sąrašą -situation.nullValid=Pasirinkite vieną +situation.nullValid=Pasirinkite StandardLoggerType.CHANGE_EXECUTOR=Pakeitimų vykdytojas (c.e.m.model.impl.lens.ChangeExecutor) StandardLoggerType.CLOCKWORK=Laikrodžio mechanizmas (c.e.m.model.impl.lens.Clockwork) StandardLoggerType.EXPRESSION=Išraiška (c.e.m.common.expression.Expression) @@ -3307,7 +3307,7 @@ TreeTablePanel.fullName.displayName=Rodomas vardas TreeTablePanel.identifier.description=Identifikatorius/Aprašymas TreeTablePanel.warning.childrenExist=Ištrinama organizacija turi narių. Ar tikrai norite ją ištrinti? Type.AUDIT=Auditas -type.nullValid=Pasirinkite vieną +type.nullValid=Pasirinkite Type.RECONCILIATION=Suderinimas typeSelect.null=Visos rolės Type.USERS=Naudotojas @@ -3351,9 +3351,9 @@ user.superuser=Super naudotojas user.orgManager=Administratorius user.orgMember=Narys user.noOrgs=Organizacija nepriskirta -validFromFetchStrategy.nullValid=Pasirinkite vieną -validToFetchStrategy.nullValid=Pasirinkite vieną -valueAttribute.nullValid=Pasirinkite vieną +validFromFetchStrategy.nullValid=Pasirinkite +validToFetchStrategy.nullValid=Pasirinkite +valueAttribute.nullValid=Pasirinkite WebModelUtils.couldntRunTask=Nepavyko paleisti užduoties {0} WebModelUtils.couldntLoadPasswordPolicies=Nepavyko įkelti slaptažodžių politikos WebModelUtils.couldntAssumePowerAttorney=Nepavyko prisiimti įgaliojimų @@ -3412,9 +3412,9 @@ WorkItemsPanel.started=Pradėtas WorkItemsPanel.created=Sukurtas WorkItemsPanel.deadline=Galutinis terminas WorkItemsPanel.escalationLevel=Eskalavimo lygmuo -PageAdmin.menu.dashboard=Dashboards -PageAdmin.menu.dashboard.info=Info dashboard -PageAdmin.menu.dashboard.admin=Admin dashboard +PageAdmin.menu.dashboard=Darbalaukis +PageAdmin.menu.dashboard.info=Informacinis darbalaukis +PageAdmin.menu.dashboard.admin=Administratoriaus darbalaukis PageAdmin.menu.selfDashboard=Pradžia PageAdmin.menu.selfService=SAVITARNA PageAdmin.menu.mainNavigation=ADMINISTRAVIMAS @@ -3599,7 +3599,7 @@ autoRefreshPanel.pauseRefreshing=Sustabdyti atnaujinimą autoRefreshPanel.refreshingEach=Atnaujinti kas {0} sekundžių autoRefreshPanel.noRefreshing=(neatnaujinama) PageAdmin.menu.top.services=Paslaugos -PageAdmin.menu.top.services.list=All services +PageAdmin.menu.top.services.list=Visos paslaugos PageAdmin.menu.top.services.new=Nauja paslauga PageAdmin.menu.top.services.edit=Redaguoti paslaugą taskShowAdvancedFeaturesPanel.label=Rodyti papildomas funkcijas @@ -3729,7 +3729,7 @@ ResourceTasksPanel.noTasksSelected=Jokia užduotis nepasirinkta. ObjectBrowserPanel.chooseObject=Pasirinkite objektą TypedAssignablePanel.selectObjects=Pasirinkite objektą(us) OrgTreeAssignablePanel.selectOrg=Pasirinkite organizaciją(as) -ChooseFocusTypeDialogPanel.chooseType=Pasirinkite vieną +ChooseFocusTypeDialogPanel.chooseType=Pasirinkite TestConnectionResultPanel.testConnection.result=Ištestuoti prisijungimo rezultatus. TestConnectionResultPanel.message=Vyksta testavimas, prašome palaukti rezultatų. operation.com.evolveum.midpoint.web.page.admin.configuration.PageSystemConfiguration.updateSystemConfiguration=Atnaujinkite sistemos konfigūraciją (GUI) @@ -3872,6 +3872,7 @@ PageAssignmentConflicts.back=Atgal PageAssignmentConflicts.submit=Pateikti PageAssignmentsList.conflictsWarning=Nepavyko apskaičiuoti priskyrimo konfliktų dėl autorizacijos problemos. Priežastis: AbstractShoppingCartTabPanel.addAllButton=Pridėti visus +AbstractShoppingCartTabPanel.goToShoppingCartButton=Eiti į krepšelį AbstractShoppingCartTabPanel.requestingForLabel=Prašoma AbstractShoppingCartTabPanel.availableRelationsLabel=Galimi ryšiai AssignmentCatalogPanel.selectTargetUser=Pasirinkite adresatą @@ -3906,7 +3907,11 @@ AssignmentViewType.USER_TYPE=Naudotojo priskyrimai PageAssignmentsList.requestButton = Užklausa operation.com.evolveum.midpoint.web.page.self.PageAssignmentsList.requestAssignments=Prašyti priskyrimo com.evolveum.midpoint.web.page.self.PageAssignmentsList.requestAssignments=Užklausti priskyrimų +PageAssignmentsList.requestInProgress=Vyksta Jūsų užklausos apdorojimas. Jūsų prašymas gali būti patvirtintas rankiniu arba asinchroniniu būdu. Skirkite pakankamai laiko prašymui apdoroti. +PageAssignmentsList.requestSuccess=Jūsų prašymas buvo apdorotas. Priskyrimai yra paruošti naudojimui. +PageAssignmentsList.requestError=Apdorojant užklausą įvyko klaida. PageAssignmentsList.title=Naujų priskyrimų sąrašas +PageAssignmentsList.assignmentsToRequest=Prašomi priskyrimai PageAuditLogViewer.title=Audito žurnalo peržiūra PageAuditLogViewer.menuName=Audito žurnalas PageAuditLogViewer.timeLabel=Data @@ -4125,7 +4130,7 @@ ExclusionPolicyConstraintType.policy=Politika ExclusionPolicyConstraintPanel.exclusionTitle=Išimtis ValuePolicyBasicPanel.valuePolicy.name=Pavadinimas ValuePolicyBasicPanel.valuePolicy.description=Aprašymas -comboInput.nullValid=Pasirinkite vieną +comboInput.nullValid=Pasirinkite ContainerPanel.containerProperties=Nustatymai PageOperationResult.title=Operacijos rezultatas PageOperationResult.noResultAvailable=Nėra operacijos rezultatų. Tikriausiai jie buvo "ištrinti" skripto vykdymo metu. @@ -4209,8 +4214,13 @@ DisplayNamePanel.viewObjectDetails=Peržiūrėti objekto išsamią informaciją PageUsersView.title=Naudotojo vaizdas pageAdminFocus.dataProtection=Duomenų apsauga PageInternals.title.cache=Podeliai +PageInternals.title.threads=Gijos PageInternals.tab.cache=Podelio administravimas +PageInternals.tab.threads=Gijos InternalsCachePanel.button.clearCaches=Išvalyti podėlį +InternalsThreadsPanel.button.showAllThreads=Rodyti visas gijas +InternalsThreadsPanel.button.showTasksThreads=Rodyti užduočių gijas +InternalsThreadsPanel.button.recordTasksThreads=Įrašyti užduočių gijas PageAccountActivation.user.not.found=Įvyko nenumatyta problema. Prašome susisiekti su administratoriumi. propertyConstraintValidator.error=Negalima nustatyti parametro apribojimo nenurodžius kelio. ReferencePopupPanel.oid=Oid: @@ -4220,7 +4230,7 @@ chooseFocusTypeAndRelationDialogPanel.relation=Santykis: chooseFocusTypeAndRelationDialogPanel.type=Tipas chooseFocusTypeAndRelationDialogPanel.tooltip.type=Objekto tipas į kurį priskyrimas išeina abstractRoleMemberPanel.menu.assign=Priskirti -abstractRoleMemberPanel.menu.assignMember=Assign member +abstractRoleMemberPanel.menu.assignMember=Priskirti narį abstractRoleMemberPanel.menu.unassign=Pašalinti abstractRoleMemberPanel.menu.recompute=Perskaičiuoti abstractRoleMemberPanel.menu.create=Sukurti @@ -4313,3 +4323,6 @@ LoggingConfigurationTabPanel.appender.patternColumn=Šablonas LoggingConfigurationTabPanel.appender.typeColumn=Tipas ResourceSummaryPanel.UP=Veikia ResourceSummaryPanel.DOWN=Žemyn +operation.com.evolveum.midpoint.web.page.admin.configuration.InternalsThreadsPanel.executeShowAllThreads=Rodyti visas gijas (Gui) +operation.com.evolveum.midpoint.web.page.admin.configuration.InternalsThreadsPanel.executeShowTasksThreads=Rodyti vykdomų užduočių gijas (Gui) +operation.com.evolveum.midpoint.web.page.admin.configuration.InternalsThreadsPanel.executeRecordTasksThreads=Įrašyti vykdomų užduočių gijas (Gui) diff --git a/gui/admin-gui/src/main/resources/localization/Midpoint_pl.properties b/gui/admin-gui/src/main/resources/localization/Midpoint_pl.properties index e7c6db012f3..849d7e75d6e 100644 --- a/gui/admin-gui/src/main/resources/localization/Midpoint_pl.properties +++ b/gui/admin-gui/src/main/resources/localization/Midpoint_pl.properties @@ -1010,7 +1010,7 @@ PageAbout.button.testRepositoryCheckOrgClosure=Sprawdź i napraw stan struktury PageAbout.button.reindexRepositoryObjects=Reindeksacja obiektów repozytorium PageAbout.button.testRepository=Autotest repozytorium PageAbout.button.clearCssJsCache=Wyczyść pamięć podręczną CSS/JS -PageAbout.button.factoryDefault=Przełącz do ustawień fabrycznych +PageAbout.button.factoryDefault=Reset do ustawień fabrycznych PageAbout.message.deleteAllObjects=Naprawdę chcesz usunąć wszystkie obiekty? Może to zająć kilka minut. PageAbout.message.couldntObtainJvmParams=Nie można uzyskać parametrów JVM z JMX. PageAbout.midPointRevision=${git.describe} @@ -3872,6 +3872,7 @@ PageAssignmentConflicts.back=Wstecz PageAssignmentConflicts.submit=Prześlij PageAssignmentsList.conflictsWarning=Nie można obliczyć konfliktów przypisać z powodu problemu z autoryzacją. Powód: AbstractShoppingCartTabPanel.addAllButton=Dodaj wszystko +AbstractShoppingCartTabPanel.goToShoppingCartButton=Przejdź do koszyka AbstractShoppingCartTabPanel.requestingForLabel=Wnioskuj dla AbstractShoppingCartTabPanel.availableRelationsLabel=Dostępne relacje AssignmentCatalogPanel.selectTargetUser=Wybierz docelowego użytkownika @@ -3906,7 +3907,11 @@ AssignmentViewType.USER_TYPE=Przypisania użytkownika PageAssignmentsList.requestButton = Złóż zamówienie operation.com.evolveum.midpoint.web.page.self.PageAssignmentsList.requestAssignments=Wnioskuj o przypisanie com.evolveum.midpoint.web.page.self.PageAssignmentsList.requestAssignments=Wnioskuj o przypisania +PageAssignmentsList.requestInProgress=Trwa przetwarzanie Twoich wniosków. Twoje żądanie może być przekazane do zatwierdzenia lub innych ręcznych albo asynchronicznych czynności. Proszę odczekać odpowiedni czas aby Twój wniosek mógł zostać przetworzony. +PageAssignmentsList.requestSuccess=Twój wniosek został przetworzony. Przypisania są gotowe do użycia. +PageAssignmentsList.requestError=Wystąpił błąd podczas przetwarzania Twojego wniosku. PageAssignmentsList.title=Nowa lista przypisań +PageAssignmentsList.assignmentsToRequest=Przypisania do zawnioskowania PageAuditLogViewer.title=Podgląd logu z audytu PageAuditLogViewer.menuName=Podgląd logu z audytu PageAuditLogViewer.timeLabel=Czas @@ -4209,8 +4214,13 @@ DisplayNamePanel.viewObjectDetails=Zobacz szczegóły obiektu PageUsersView.title=Widok użytkowników pageAdminFocus.dataProtection=Ochrona danych PageInternals.title.cache=Pamięci podręczne +PageInternals.title.threads=Wątki PageInternals.tab.cache=Zarządzanie pamięcią podręczną +PageInternals.tab.threads=Wątki InternalsCachePanel.button.clearCaches=Wyczyść pamięci podręczne +InternalsThreadsPanel.button.showAllThreads=Pokaż wszystkie wątki +InternalsThreadsPanel.button.showTasksThreads=Pokaż wątki zadań +InternalsThreadsPanel.button.recordTasksThreads=Nagraj wątki zadań PageAccountActivation.user.not.found=Wystąpił nieoczekiwany błąd. Proszę o kontakt z administratorem systemu. propertyConstraintValidator.error=Nie można ustawić ograniczenia właściwości bez zdefiniowanej ścieżki. ReferencePopupPanel.oid=Oid: @@ -4313,3 +4323,6 @@ LoggingConfigurationTabPanel.appender.patternColumn=Wzorzec LoggingConfigurationTabPanel.appender.typeColumn=Typ ResourceSummaryPanel.UP=Działa ResourceSummaryPanel.DOWN=Nie działa +operation.com.evolveum.midpoint.web.page.admin.configuration.InternalsThreadsPanel.executeShowAllThreads=Pokaż wszystkie wątki (Gui) +operation.com.evolveum.midpoint.web.page.admin.configuration.InternalsThreadsPanel.executeShowTasksThreads=Pokaż uruchomione wątki zadań (Gui) +operation.com.evolveum.midpoint.web.page.admin.configuration.InternalsThreadsPanel.executeRecordTasksThreads=Nagraj uruchomione wątki zadań (Gui) diff --git a/gui/admin-gui/src/main/resources/localization/Midpoint_pt_BR.properties b/gui/admin-gui/src/main/resources/localization/Midpoint_pt_BR.properties index cf8a2bc83ed..f889c219332 100644 --- a/gui/admin-gui/src/main/resources/localization/Midpoint_pt_BR.properties +++ b/gui/admin-gui/src/main/resources/localization/Midpoint_pt_BR.properties @@ -1010,7 +1010,7 @@ PageAbout.button.testRepositoryCheckOrgClosure=Verificar e reparar consistência PageAbout.button.reindexRepositoryObjects=Reindexar objetos do repositório PageAbout.button.testRepository=Auto-teste de repositório PageAbout.button.clearCssJsCache=Clear CSS/JS cache -PageAbout.button.factoryDefault=Switch to factory default +PageAbout.button.factoryDefault=Reset to factory default PageAbout.message.deleteAllObjects=Do you really want to delete all objects? It may take several minutes. PageAbout.message.couldntObtainJvmParams=Não foi possível obter parâmetro JVM de JMX. PageAbout.midPointRevision=${git.describe} @@ -3872,6 +3872,7 @@ PageAssignmentConflicts.back=Voltar PageAssignmentConflicts.submit=Enviar PageAssignmentsList.conflictsWarning=Unable to calculate assignment conflicts due to authorization problem. Reason: AbstractShoppingCartTabPanel.addAllButton=Add all +AbstractShoppingCartTabPanel.goToShoppingCartButton=Go to shopping cart AbstractShoppingCartTabPanel.requestingForLabel=Requesting for AbstractShoppingCartTabPanel.availableRelationsLabel=Available relations AssignmentCatalogPanel.selectTargetUser=Selecionar usuário alvo @@ -3906,7 +3907,11 @@ AssignmentViewType.USER_TYPE=tribuições do usuário PageAssignmentsList.requestButton = Solicitação operation.com.evolveum.midpoint.web.page.self.PageAssignmentsList.requestAssignments=Solicitar atribuição com.evolveum.midpoint.web.page.self.PageAssignmentsList.requestAssignments=Solicitar atribuições +PageAssignmentsList.requestInProgress=Processing of your request is in progress. Your request may be subject to approval or other manual or asynchronous processing. Please allow sufficient time for the request to be processed. +PageAssignmentsList.requestSuccess=Your request has been processed. Assignments are ready to use. +PageAssignmentsList.requestError=There was an error processing your request. PageAssignmentsList.title=Lista de novas atribuições +PageAssignmentsList.assignmentsToRequest=Assignments to request PageAuditLogViewer.title=Visualizador de log de auditoria PageAuditLogViewer.menuName=Visualizador de log de auditoria PageAuditLogViewer.timeLabel=Hora @@ -4209,8 +4214,13 @@ DisplayNamePanel.viewObjectDetails=View object details PageUsersView.title=Users view pageAdminFocus.dataProtection=Data protection PageInternals.title.cache=Caches +PageInternals.title.threads=Threads PageInternals.tab.cache=Cache management +PageInternals.tab.threads=Threads InternalsCachePanel.button.clearCaches=Clear caches +InternalsThreadsPanel.button.showAllThreads=Show all threads +InternalsThreadsPanel.button.showTasksThreads=Show tasks threads +InternalsThreadsPanel.button.recordTasksThreads=Record tasks threads PageAccountActivation.user.not.found=Unexpected problem occurs. Please contact system administrator. propertyConstraintValidator.error=Cannot set property constraint without path defined. ReferencePopupPanel.oid=Oid: @@ -4313,3 +4323,6 @@ LoggingConfigurationTabPanel.appender.patternColumn=Modelo LoggingConfigurationTabPanel.appender.typeColumn=Tipo ResourceSummaryPanel.UP=No ar ResourceSummaryPanel.DOWN=Para baixo +operation.com.evolveum.midpoint.web.page.admin.configuration.InternalsThreadsPanel.executeShowAllThreads=Show all threads (Gui) +operation.com.evolveum.midpoint.web.page.admin.configuration.InternalsThreadsPanel.executeShowTasksThreads=Show running tasks threads (Gui) +operation.com.evolveum.midpoint.web.page.admin.configuration.InternalsThreadsPanel.executeRecordTasksThreads=Record running tasks threads (Gui) diff --git a/gui/admin-gui/src/main/resources/localization/Midpoint_ru.properties b/gui/admin-gui/src/main/resources/localization/Midpoint_ru.properties index d9c1a5a17dc..68f089281c7 100644 --- a/gui/admin-gui/src/main/resources/localization/Midpoint_ru.properties +++ b/gui/admin-gui/src/main/resources/localization/Midpoint_ru.properties @@ -1010,7 +1010,7 @@ PageAbout.button.testRepositoryCheckOrgClosure=Проверить и восст PageAbout.button.reindexRepositoryObjects=Переиндексировать объекты репозитория PageAbout.button.testRepository=Автотест репозитория PageAbout.button.clearCssJsCache=Clear CSS/JS cache -PageAbout.button.factoryDefault=Switch to factory default +PageAbout.button.factoryDefault=Reset to factory default PageAbout.message.deleteAllObjects=Do you really want to delete all objects? It may take several minutes. PageAbout.message.couldntObtainJvmParams=Невозможно получить параметры виртуальной машины от JMX. PageAbout.midPointRevision=${git.describe} @@ -3872,6 +3872,7 @@ PageAssignmentConflicts.back=Назад PageAssignmentConflicts.submit=Подтвердить PageAssignmentsList.conflictsWarning=Unable to calculate assignment conflicts due to authorization problem. Reason: AbstractShoppingCartTabPanel.addAllButton=Add all +AbstractShoppingCartTabPanel.goToShoppingCartButton=Go to shopping cart AbstractShoppingCartTabPanel.requestingForLabel=Requesting for AbstractShoppingCartTabPanel.availableRelationsLabel=Available relations AssignmentCatalogPanel.selectTargetUser=Выберите целевого пользователя @@ -3906,7 +3907,11 @@ AssignmentViewType.USER_TYPE=Пользовательские назначени PageAssignmentsList.requestButton = Заявка operation.com.evolveum.midpoint.web.page.self.PageAssignmentsList.requestAssignments=Запрос на назначение прав com.evolveum.midpoint.web.page.self.PageAssignmentsList.requestAssignments=Запрос назначений +PageAssignmentsList.requestInProgress=Processing of your request is in progress. Your request may be subject to approval or other manual or asynchronous processing. Please allow sufficient time for the request to be processed. +PageAssignmentsList.requestSuccess=Your request has been processed. Assignments are ready to use. +PageAssignmentsList.requestError=There was an error processing your request. PageAssignmentsList.title=Список новых назначений +PageAssignmentsList.assignmentsToRequest=Assignments to request PageAuditLogViewer.title=Просмотр лога аудита PageAuditLogViewer.menuName=Просмотр лога аудита PageAuditLogViewer.timeLabel=Время @@ -4209,8 +4214,13 @@ DisplayNamePanel.viewObjectDetails=View object details PageUsersView.title=Users view pageAdminFocus.dataProtection=Data protection PageInternals.title.cache=Caches +PageInternals.title.threads=Threads PageInternals.tab.cache=Cache management +PageInternals.tab.threads=Threads InternalsCachePanel.button.clearCaches=Clear caches +InternalsThreadsPanel.button.showAllThreads=Show all threads +InternalsThreadsPanel.button.showTasksThreads=Show tasks threads +InternalsThreadsPanel.button.recordTasksThreads=Record tasks threads PageAccountActivation.user.not.found=Unexpected problem occurs. Please contact system administrator. propertyConstraintValidator.error=Cannot set property constraint without path defined. ReferencePopupPanel.oid=Oid: @@ -4313,3 +4323,6 @@ LoggingConfigurationTabPanel.appender.patternColumn=Шаблон LoggingConfigurationTabPanel.appender.typeColumn=Тип ResourceSummaryPanel.UP=Вверх ResourceSummaryPanel.DOWN=Вниз +operation.com.evolveum.midpoint.web.page.admin.configuration.InternalsThreadsPanel.executeShowAllThreads=Show all threads (Gui) +operation.com.evolveum.midpoint.web.page.admin.configuration.InternalsThreadsPanel.executeShowTasksThreads=Show running tasks threads (Gui) +operation.com.evolveum.midpoint.web.page.admin.configuration.InternalsThreadsPanel.executeRecordTasksThreads=Record running tasks threads (Gui) diff --git a/gui/admin-gui/src/main/resources/localization/Midpoint_sk.properties b/gui/admin-gui/src/main/resources/localization/Midpoint_sk.properties index bda4b658de1..454edbc272d 100644 --- a/gui/admin-gui/src/main/resources/localization/Midpoint_sk.properties +++ b/gui/admin-gui/src/main/resources/localization/Midpoint_sk.properties @@ -1010,7 +1010,7 @@ PageAbout.button.testRepositoryCheckOrgClosure=Skontrolovať a opraviť konziste PageAbout.button.reindexRepositoryObjects=Reindex repository objects PageAbout.button.testRepository=Auto - test repozitára PageAbout.button.clearCssJsCache=Clear CSS/JS cache -PageAbout.button.factoryDefault=Switch to factory default +PageAbout.button.factoryDefault=Reset to factory default PageAbout.message.deleteAllObjects=Do you really want to delete all objects? It may take several minutes. PageAbout.message.couldntObtainJvmParams=Nebolo možné získať JVM parametre z JMX. PageAbout.midPointRevision=${git.describe} @@ -3872,6 +3872,7 @@ PageAssignmentConflicts.back=Späť PageAssignmentConflicts.submit=Submit PageAssignmentsList.conflictsWarning=Unable to calculate assignment conflicts due to authorization problem. Reason: AbstractShoppingCartTabPanel.addAllButton=Add all +AbstractShoppingCartTabPanel.goToShoppingCartButton=Go to shopping cart AbstractShoppingCartTabPanel.requestingForLabel=Requesting for AbstractShoppingCartTabPanel.availableRelationsLabel=Available relations AssignmentCatalogPanel.selectTargetUser=Select target user @@ -3906,7 +3907,11 @@ AssignmentViewType.USER_TYPE=User's assignments PageAssignmentsList.requestButton = Požiadavka operation.com.evolveum.midpoint.web.page.self.PageAssignmentsList.requestAssignments=Request assignment com.evolveum.midpoint.web.page.self.PageAssignmentsList.requestAssignments=Request assignments +PageAssignmentsList.requestInProgress=Processing of your request is in progress. Your request may be subject to approval or other manual or asynchronous processing. Please allow sufficient time for the request to be processed. +PageAssignmentsList.requestSuccess=Your request has been processed. Assignments are ready to use. +PageAssignmentsList.requestError=There was an error processing your request. PageAssignmentsList.title=New assignments list +PageAssignmentsList.assignmentsToRequest=Assignments to request PageAuditLogViewer.title=Audit Log Viewer PageAuditLogViewer.menuName=Audit Log Viewer PageAuditLogViewer.timeLabel=Čas @@ -4209,8 +4214,13 @@ DisplayNamePanel.viewObjectDetails=View object details PageUsersView.title=Users view pageAdminFocus.dataProtection=Data protection PageInternals.title.cache=Caches +PageInternals.title.threads=Threads PageInternals.tab.cache=Cache management +PageInternals.tab.threads=Threads InternalsCachePanel.button.clearCaches=Clear caches +InternalsThreadsPanel.button.showAllThreads=Show all threads +InternalsThreadsPanel.button.showTasksThreads=Show tasks threads +InternalsThreadsPanel.button.recordTasksThreads=Record tasks threads PageAccountActivation.user.not.found=Unexpected problem occurs. Please contact system administrator. propertyConstraintValidator.error=Cannot set property constraint without path defined. ReferencePopupPanel.oid=Oid: @@ -4313,3 +4323,6 @@ LoggingConfigurationTabPanel.appender.patternColumn=Formát LoggingConfigurationTabPanel.appender.typeColumn=Typ ResourceSummaryPanel.UP=Hore ResourceSummaryPanel.DOWN=Dolu +operation.com.evolveum.midpoint.web.page.admin.configuration.InternalsThreadsPanel.executeShowAllThreads=Show all threads (Gui) +operation.com.evolveum.midpoint.web.page.admin.configuration.InternalsThreadsPanel.executeShowTasksThreads=Show running tasks threads (Gui) +operation.com.evolveum.midpoint.web.page.admin.configuration.InternalsThreadsPanel.executeRecordTasksThreads=Record running tasks threads (Gui) diff --git a/gui/admin-gui/src/main/resources/localization/Midpoint_tr.properties b/gui/admin-gui/src/main/resources/localization/Midpoint_tr.properties index d8c7946d607..c14492549c4 100644 --- a/gui/admin-gui/src/main/resources/localization/Midpoint_tr.properties +++ b/gui/admin-gui/src/main/resources/localization/Midpoint_tr.properties @@ -1010,7 +1010,7 @@ PageAbout.button.testRepositoryCheckOrgClosure=Org. kapsanımının tutarlığı PageAbout.button.reindexRepositoryObjects=Depo nesnelerini yeniden indeksle PageAbout.button.testRepository=Depo testi PageAbout.button.clearCssJsCache=CSS / JS ön belleğini temizle -PageAbout.button.factoryDefault=Switch to factory default +PageAbout.button.factoryDefault=Reset to factory default PageAbout.message.deleteAllObjects=Do you really want to delete all objects? It may take several minutes. PageAbout.message.couldntObtainJvmParams=JMX'ten JVM parametreleri alınamadı. PageAbout.midPointRevision=${git.describe} @@ -3872,6 +3872,7 @@ PageAssignmentConflicts.back=Geri PageAssignmentConflicts.submit=Gönder PageAssignmentsList.conflictsWarning=Unable to calculate assignment conflicts due to authorization problem. Reason: AbstractShoppingCartTabPanel.addAllButton=Add all +AbstractShoppingCartTabPanel.goToShoppingCartButton=Go to shopping cart AbstractShoppingCartTabPanel.requestingForLabel=Requesting for AbstractShoppingCartTabPanel.availableRelationsLabel=Available relations AssignmentCatalogPanel.selectTargetUser=Hedef kullanıcıyı seç @@ -3906,7 +3907,11 @@ AssignmentViewType.USER_TYPE=Kullanıcının atamaları PageAssignmentsList.requestButton = Talep operation.com.evolveum.midpoint.web.page.self.PageAssignmentsList.requestAssignments=Atama talep et com.evolveum.midpoint.web.page.self.PageAssignmentsList.requestAssignments=Atamalar talebi +PageAssignmentsList.requestInProgress=Processing of your request is in progress. Your request may be subject to approval or other manual or asynchronous processing. Please allow sufficient time for the request to be processed. +PageAssignmentsList.requestSuccess=Your request has been processed. Assignments are ready to use. +PageAssignmentsList.requestError=There was an error processing your request. PageAssignmentsList.title=Yeni atamalar listesi +PageAssignmentsList.assignmentsToRequest=Assignments to request PageAuditLogViewer.title=Denetim Günlüğü Görüntüleyici PageAuditLogViewer.menuName=Denetim Günlüğü Görüntüleyici PageAuditLogViewer.timeLabel=Zaman @@ -4209,8 +4214,13 @@ DisplayNamePanel.viewObjectDetails=View object details PageUsersView.title=Users view pageAdminFocus.dataProtection=Veri koruma PageInternals.title.cache=Caches +PageInternals.title.threads=Threads PageInternals.tab.cache=Cache management +PageInternals.tab.threads=Threads InternalsCachePanel.button.clearCaches=Clear caches +InternalsThreadsPanel.button.showAllThreads=Show all threads +InternalsThreadsPanel.button.showTasksThreads=Show tasks threads +InternalsThreadsPanel.button.recordTasksThreads=Record tasks threads PageAccountActivation.user.not.found=Unexpected problem occurs. Please contact system administrator. propertyConstraintValidator.error=Cannot set property constraint without path defined. ReferencePopupPanel.oid=Oid: @@ -4313,3 +4323,6 @@ LoggingConfigurationTabPanel.appender.patternColumn=Şekil LoggingConfigurationTabPanel.appender.typeColumn=Tip ResourceSummaryPanel.UP=Ayakta ResourceSummaryPanel.DOWN=Kapalı +operation.com.evolveum.midpoint.web.page.admin.configuration.InternalsThreadsPanel.executeShowAllThreads=Show all threads (Gui) +operation.com.evolveum.midpoint.web.page.admin.configuration.InternalsThreadsPanel.executeShowTasksThreads=Show running tasks threads (Gui) +operation.com.evolveum.midpoint.web.page.admin.configuration.InternalsThreadsPanel.executeRecordTasksThreads=Record running tasks threads (Gui) diff --git a/gui/admin-gui/src/main/resources/localization/Midpoint_zh_CN.properties b/gui/admin-gui/src/main/resources/localization/Midpoint_zh_CN.properties index b56406de289..81d6a8c53ba 100644 --- a/gui/admin-gui/src/main/resources/localization/Midpoint_zh_CN.properties +++ b/gui/admin-gui/src/main/resources/localization/Midpoint_zh_CN.properties @@ -1010,7 +1010,7 @@ PageAbout.button.testRepositoryCheckOrgClosure=检查并修复组织闭环一致 PageAbout.button.reindexRepositoryObjects=重建存储库中的对象索引 PageAbout.button.testRepository=存储库自检 PageAbout.button.clearCssJsCache=清楚CSS/JS缓存 -PageAbout.button.factoryDefault=Switch to factory default +PageAbout.button.factoryDefault=Reset to factory default PageAbout.message.deleteAllObjects=Do you really want to delete all objects? It may take several minutes. PageAbout.message.couldntObtainJvmParams=不能从JMX获取JVM参数。 PageAbout.midPointRevision=${git.describe} @@ -3872,6 +3872,7 @@ PageAssignmentConflicts.back=返回 PageAssignmentConflicts.submit=提交 PageAssignmentsList.conflictsWarning=Unable to calculate assignment conflicts due to authorization problem. Reason: AbstractShoppingCartTabPanel.addAllButton=Add all +AbstractShoppingCartTabPanel.goToShoppingCartButton=Go to shopping cart AbstractShoppingCartTabPanel.requestingForLabel=Requesting for AbstractShoppingCartTabPanel.availableRelationsLabel=Available relations AssignmentCatalogPanel.selectTargetUser=选择目标用户 @@ -3906,7 +3907,11 @@ AssignmentViewType.USER_TYPE=用户的分配 PageAssignmentsList.requestButton = 请求 operation.com.evolveum.midpoint.web.page.self.PageAssignmentsList.requestAssignments=请求分配 com.evolveum.midpoint.web.page.self.PageAssignmentsList.requestAssignments=请求分配 +PageAssignmentsList.requestInProgress=Processing of your request is in progress. Your request may be subject to approval or other manual or asynchronous processing. Please allow sufficient time for the request to be processed. +PageAssignmentsList.requestSuccess=Your request has been processed. Assignments are ready to use. +PageAssignmentsList.requestError=There was an error processing your request. PageAssignmentsList.title=新分配列表 +PageAssignmentsList.assignmentsToRequest=Assignments to request PageAuditLogViewer.title=审计日志查看 PageAuditLogViewer.menuName=审计日志查看 PageAuditLogViewer.timeLabel=时间 @@ -4209,8 +4214,13 @@ DisplayNamePanel.viewObjectDetails=View object details PageUsersView.title=Users view pageAdminFocus.dataProtection=数据保护 PageInternals.title.cache=Caches +PageInternals.title.threads=Threads PageInternals.tab.cache=Cache management +PageInternals.tab.threads=Threads InternalsCachePanel.button.clearCaches=Clear caches +InternalsThreadsPanel.button.showAllThreads=Show all threads +InternalsThreadsPanel.button.showTasksThreads=Show tasks threads +InternalsThreadsPanel.button.recordTasksThreads=Record tasks threads PageAccountActivation.user.not.found=Unexpected problem occurs. Please contact system administrator. propertyConstraintValidator.error=Cannot set property constraint without path defined. ReferencePopupPanel.oid=Oid: @@ -4313,3 +4323,6 @@ LoggingConfigurationTabPanel.appender.patternColumn=模式 LoggingConfigurationTabPanel.appender.typeColumn=类型 ResourceSummaryPanel.UP=启动 ResourceSummaryPanel.DOWN=关闭 +operation.com.evolveum.midpoint.web.page.admin.configuration.InternalsThreadsPanel.executeShowAllThreads=Show all threads (Gui) +operation.com.evolveum.midpoint.web.page.admin.configuration.InternalsThreadsPanel.executeShowTasksThreads=Show running tasks threads (Gui) +operation.com.evolveum.midpoint.web.page.admin.configuration.InternalsThreadsPanel.executeRecordTasksThreads=Record running tasks threads (Gui) diff --git a/infra/schema/src/main/resources/localization/schema_cs.properties b/infra/schema/src/main/resources/localization/schema_cs.properties index 3c3731ffbea..ec8f4eb19de 100644 --- a/infra/schema/src/main/resources/localization/schema_cs.properties +++ b/infra/schema/src/main/resources/localization/schema_cs.properties @@ -331,6 +331,17 @@ GuiObjectListViewType.disableSorting=Zakázat třídění GuiObjectListViewType.action=Akce GuiObjectListViewsType.default=Výchozí GuiObjectListViewsType.objectList=Seznam objektů +GuiObjectListViewsType.objectCollectionView=Pohled na sbírku objektů +GuiObjectListViewType.collection=Sbírka objektů +GuiObjectListViewType.details=Podrobnosti +CollectionSpecificationType.collectionRef=Odkaz na sbírku objektů +CollectionSpecificationType.depth=Hloubka +CollectionSpecificationType.interpretation=Výklad +CollectionSpecificationType.relation=Vztah +UserInterfaceFeatureType.display=Zobrazit +DisplayType.pluralLabel=Jmenovka množného čísla +DisplayType.icon=Ikona +IconType.color=Barva HasAssignmentPolicyConstraintType.targetRef=Cíl HasAssignmentPolicyConstraintType.enabled=Povolit HasAssignmentPolicyConstraintType.direct=Přímé @@ -623,6 +634,8 @@ RoleManagementConfigurationType.defaultExecuteAfterAllApprovals=Výchozí nastav RoleManagementConfigurationType.autoassignEnabled=Povoleno automatické přiřazení RoleManagementConfigurationType.relations=Vztahy SearchBoxConfigurationType.defaultMode=Výchozí režim +SearchBoxConfigurationType.defaultObjectType=Výchozí typ objektu +SearchBoxConfigurationType.defaultScope=Výchozí rozsah ShadowType.dead=Mrtvé ShadowType.kind=Typ ShadowType.failedOperationType=Typ neúspěšné operace @@ -742,6 +755,8 @@ ObjectTypes.FORM=Formulář ObjectTypes.CASE=Případ ObjectTypes.FUNCTION_LIBRARY=Knihovna funkcí ObjectTypes.OBJECT_COLLECTION=Sbírka objektů +ObjectTypes.ARCHETYPE=Pravzor +ObjectTypes.ASSIGNMENT_HOLDER_TYPE=Typ nositele přiřazení OrgType.parentOrganization=Rodičovská organizace ObjectType.extension=Rozšíření FocusType.assignmentKey=Přiřazení @@ -865,6 +880,8 @@ AdminGuiConfigurationType.defaultExportSettings=Výchozí nastavení exportu AdminGuiConfigurationType.feature=Vlastnost AdminGuiConfigurationType.feedbackMessagesHook=Zaháčkování do zpráv zpětné vazby AdminGuiConfigurationType.roleManagement=Správa rolí +AdminGuiConfigurationType.displayFormats=Formát zobrazení +AdminGuiConfigurationType.objectCollectionViews=Pohledy na sbírku objektů midPointVersion=${pom.version} midPointRevision=${git.describe} IdempotenceType.CONSERVATIVE=Umírněná @@ -1227,3 +1244,4 @@ ArchetypePolicyType.display=Zobrazit ArchetypePolicyType.conflictResolution=Vyhodnocení konfliktu ArchetypePolicyType.lifecycleStateModel=Model fáze životního cyklu ArchetypePolicyType.applicablePolicies=Použitelné politiky +ConfigurationType.configurationProperties=Vlastnosti konfigurace diff --git a/infra/schema/src/main/resources/localization/schema_de.properties b/infra/schema/src/main/resources/localization/schema_de.properties index a3797ea5671..67f4b708d91 100644 --- a/infra/schema/src/main/resources/localization/schema_de.properties +++ b/infra/schema/src/main/resources/localization/schema_de.properties @@ -331,6 +331,17 @@ GuiObjectListViewType.disableSorting=Sotrierung ausschalten GuiObjectListViewType.action=Aktion GuiObjectListViewsType.default=Standardmässig GuiObjectListViewsType.objectList=Objektliste +GuiObjectListViewsType.objectCollectionView=Object collection view +GuiObjectListViewType.collection=Collection +GuiObjectListViewType.details=Details +CollectionSpecificationType.collectionRef=Collection ref +CollectionSpecificationType.depth=Depth +CollectionSpecificationType.interpretation=Interpretation +CollectionSpecificationType.relation=Beziehung +UserInterfaceFeatureType.display=Display +DisplayType.pluralLabel=Plural label +DisplayType.icon=Icon +IconType.color=Farbe HasAssignmentPolicyConstraintType.targetRef=Ziel HasAssignmentPolicyConstraintType.enabled=Freigeben HasAssignmentPolicyConstraintType.direct=Direkt @@ -623,6 +634,8 @@ RoleManagementConfigurationType.defaultExecuteAfterAllApprovals=Default execute RoleManagementConfigurationType.autoassignEnabled=Autoassign enabled RoleManagementConfigurationType.relations=Relations SearchBoxConfigurationType.defaultMode=Default mode +SearchBoxConfigurationType.defaultObjectType=Default object type +SearchBoxConfigurationType.defaultScope=Default scope ShadowType.dead=tot ShadowType.kind=freundlich ShadowType.failedOperationType=Fehlgeschlagener Operationstyp @@ -742,6 +755,8 @@ ObjectTypes.FORM=Formular ObjectTypes.CASE=Fall ObjectTypes.FUNCTION_LIBRARY=Funktionsbibliothek ObjectTypes.OBJECT_COLLECTION=Objektsammlung +ObjectTypes.ARCHETYPE=Archetype +ObjectTypes.ASSIGNMENT_HOLDER_TYPE=Assignment holder type OrgType.parentOrganization=Übergeordnete Organisation ObjectType.extension=Erweiterung FocusType.assignmentKey=Aufgabe @@ -865,6 +880,8 @@ AdminGuiConfigurationType.defaultExportSettings=Default export settings AdminGuiConfigurationType.feature=Feature AdminGuiConfigurationType.feedbackMessagesHook=Feedback messages hook AdminGuiConfigurationType.roleManagement=Rollen bearbeiten +AdminGuiConfigurationType.displayFormats=Display formats +AdminGuiConfigurationType.objectCollectionViews=Object collection views midPointVersion=${pom.version} midPointRevision=${git.describe} IdempotenceType.CONSERVATIVE=konservativ @@ -1227,3 +1244,4 @@ ArchetypePolicyType.display=Display ArchetypePolicyType.conflictResolution=Konfliktlösung ArchetypePolicyType.lifecycleStateModel=Lifecycle state model ArchetypePolicyType.applicablePolicies=Applicable policies +ConfigurationType.configurationProperties=Configuration properties diff --git a/infra/schema/src/main/resources/localization/schema_en.properties b/infra/schema/src/main/resources/localization/schema_en.properties index 9c60d358f29..7744d241078 100644 --- a/infra/schema/src/main/resources/localization/schema_en.properties +++ b/infra/schema/src/main/resources/localization/schema_en.properties @@ -331,6 +331,17 @@ GuiObjectListViewType.disableSorting=Disable sorting GuiObjectListViewType.action=Action GuiObjectListViewsType.default=Default GuiObjectListViewsType.objectList=Object list +GuiObjectListViewsType.objectCollectionView=Object collection view +GuiObjectListViewType.collection=Collection +GuiObjectListViewType.details=Details +CollectionSpecificationType.collectionRef=Collection ref +CollectionSpecificationType.depth=Depth +CollectionSpecificationType.interpretation=Interpretation +CollectionSpecificationType.relation=Relation +UserInterfaceFeatureType.display=Display +DisplayType.pluralLabel=Plural label +DisplayType.icon=Icon +IconType.color=Color HasAssignmentPolicyConstraintType.targetRef=Target HasAssignmentPolicyConstraintType.enabled=Enable HasAssignmentPolicyConstraintType.direct=Direct @@ -623,6 +634,8 @@ RoleManagementConfigurationType.defaultExecuteAfterAllApprovals=Default execute RoleManagementConfigurationType.autoassignEnabled=Autoassign enabled RoleManagementConfigurationType.relations=Relations SearchBoxConfigurationType.defaultMode=Default mode +SearchBoxConfigurationType.defaultObjectType=Default object type +SearchBoxConfigurationType.defaultScope=Default scope ShadowType.dead=Dead ShadowType.kind=Kind ShadowType.failedOperationType=Failed operation type @@ -742,6 +755,8 @@ ObjectTypes.FORM=Form ObjectTypes.CASE=Case ObjectTypes.FUNCTION_LIBRARY=Function library ObjectTypes.OBJECT_COLLECTION=Object collection +ObjectTypes.ARCHETYPE=Archetype +ObjectTypes.ASSIGNMENT_HOLDER_TYPE=Assignment holder type OrgType.parentOrganization=Parent Organization ObjectType.extension=Extension FocusType.assignmentKey=Assignment @@ -865,6 +880,8 @@ AdminGuiConfigurationType.defaultExportSettings=Default export settings AdminGuiConfigurationType.feature=Feature AdminGuiConfigurationType.feedbackMessagesHook=Feedback messages hook AdminGuiConfigurationType.roleManagement=Role management +AdminGuiConfigurationType.displayFormats=Display formats +AdminGuiConfigurationType.objectCollectionViews=Object collection views midPointVersion=${pom.version} midPointRevision=${git.describe} IdempotenceType.CONSERVATIVE=Conservative @@ -1227,3 +1244,4 @@ ArchetypePolicyType.display=Display ArchetypePolicyType.conflictResolution=Conflict resolution ArchetypePolicyType.lifecycleStateModel=Lifecycle state model ArchetypePolicyType.applicablePolicies=Applicable policies +ConfigurationType.configurationProperties=Configuration properties diff --git a/infra/schema/src/main/resources/localization/schema_es.properties b/infra/schema/src/main/resources/localization/schema_es.properties index 6a6fe1f923a..314c979bc74 100644 --- a/infra/schema/src/main/resources/localization/schema_es.properties +++ b/infra/schema/src/main/resources/localization/schema_es.properties @@ -331,6 +331,17 @@ GuiObjectListViewType.disableSorting=Des-habilitar ordenado GuiObjectListViewType.action=Acción GuiObjectListViewsType.default=Defecto GuiObjectListViewsType.objectList=Lista de objetos +GuiObjectListViewsType.objectCollectionView=Object collection view +GuiObjectListViewType.collection=Collection +GuiObjectListViewType.details=Detalles +CollectionSpecificationType.collectionRef=Collection ref +CollectionSpecificationType.depth=Depth +CollectionSpecificationType.interpretation=Interpretation +CollectionSpecificationType.relation=Relación +UserInterfaceFeatureType.display=Mostrar +DisplayType.pluralLabel=Plural label +DisplayType.icon=Icono +IconType.color=Color HasAssignmentPolicyConstraintType.targetRef=Objetivo HasAssignmentPolicyConstraintType.enabled=Habilitar HasAssignmentPolicyConstraintType.direct=Directo @@ -623,6 +634,8 @@ RoleManagementConfigurationType.defaultExecuteAfterAllApprovals=Ejecutar despué RoleManagementConfigurationType.autoassignEnabled=Autoasignación habilitada RoleManagementConfigurationType.relations=Relaciones SearchBoxConfigurationType.defaultMode=Default mode +SearchBoxConfigurationType.defaultObjectType=Default object type +SearchBoxConfigurationType.defaultScope=Default scope ShadowType.dead=Dead ShadowType.kind=Tipo ShadowType.failedOperationType=Failed operation type @@ -742,6 +755,8 @@ ObjectTypes.FORM=Formulario ObjectTypes.CASE=Caso ObjectTypes.FUNCTION_LIBRARY=Librería de funciones ObjectTypes.OBJECT_COLLECTION=Colección de objetos +ObjectTypes.ARCHETYPE=Archetype +ObjectTypes.ASSIGNMENT_HOLDER_TYPE=Assignment holder type OrgType.parentOrganization=Parent Organization ObjectType.extension=Extensión FocusType.assignmentKey=Asignación @@ -865,6 +880,8 @@ AdminGuiConfigurationType.defaultExportSettings=Default export settings AdminGuiConfigurationType.feature=Característica AdminGuiConfigurationType.feedbackMessagesHook=Feedback messages hook AdminGuiConfigurationType.roleManagement=Administración de roles +AdminGuiConfigurationType.displayFormats=Display formats +AdminGuiConfigurationType.objectCollectionViews=Object collection views midPointVersion=${pom.version} midPointRevision=${git.describe} IdempotenceType.CONSERVATIVE=Conservativo @@ -1227,3 +1244,4 @@ ArchetypePolicyType.display=Mostrar ArchetypePolicyType.conflictResolution=Resolución de conflictos ArchetypePolicyType.lifecycleStateModel=Lifecycle state model ArchetypePolicyType.applicablePolicies=Applicable policies +ConfigurationType.configurationProperties=Configuration properties diff --git a/infra/schema/src/main/resources/localization/schema_et.properties b/infra/schema/src/main/resources/localization/schema_et.properties index 5de059b0128..a06083eae94 100644 --- a/infra/schema/src/main/resources/localization/schema_et.properties +++ b/infra/schema/src/main/resources/localization/schema_et.properties @@ -331,6 +331,17 @@ GuiObjectListViewType.disableSorting=Disable sorting GuiObjectListViewType.action=Tegevus GuiObjectListViewsType.default=Liigi vaikeväärtus GuiObjectListViewsType.objectList=Object list +GuiObjectListViewsType.objectCollectionView=Object collection view +GuiObjectListViewType.collection=Collection +GuiObjectListViewType.details=Üksikasjad +CollectionSpecificationType.collectionRef=Collection ref +CollectionSpecificationType.depth=Depth +CollectionSpecificationType.interpretation=Interpretation +CollectionSpecificationType.relation=Relatsioon +UserInterfaceFeatureType.display=Display +DisplayType.pluralLabel=Plural label +DisplayType.icon=Icon +IconType.color=Värv HasAssignmentPolicyConstraintType.targetRef=Sihtüksus HasAssignmentPolicyConstraintType.enabled=Luba HasAssignmentPolicyConstraintType.direct=Otsene @@ -623,6 +634,8 @@ RoleManagementConfigurationType.defaultExecuteAfterAllApprovals=Default execute RoleManagementConfigurationType.autoassignEnabled=Autoassign enabled RoleManagementConfigurationType.relations=Relations SearchBoxConfigurationType.defaultMode=Default mode +SearchBoxConfigurationType.defaultObjectType=Default object type +SearchBoxConfigurationType.defaultScope=Default scope ShadowType.dead=Surnud ShadowType.kind=Liik ShadowType.failedOperationType=Nurjunud toimingu tüüp @@ -742,6 +755,8 @@ ObjectTypes.FORM=Vorm ObjectTypes.CASE=Case ObjectTypes.FUNCTION_LIBRARY=Function library ObjectTypes.OBJECT_COLLECTION=Object collection +ObjectTypes.ARCHETYPE=Archetype +ObjectTypes.ASSIGNMENT_HOLDER_TYPE=Assignment holder type OrgType.parentOrganization=Emaorganisatsioon ObjectType.extension=Laiendus FocusType.assignmentKey=Omistus @@ -865,6 +880,8 @@ AdminGuiConfigurationType.defaultExportSettings=Default export settings AdminGuiConfigurationType.feature=Feature AdminGuiConfigurationType.feedbackMessagesHook=Feedback messages hook AdminGuiConfigurationType.roleManagement=Role management +AdminGuiConfigurationType.displayFormats=Display formats +AdminGuiConfigurationType.objectCollectionViews=Object collection views midPointVersion=${pom.version} midPointRevision=${git.describe} IdempotenceType.CONSERVATIVE=Konservatiivne @@ -1227,3 +1244,4 @@ ArchetypePolicyType.display=Display ArchetypePolicyType.conflictResolution=Conflict resolution ArchetypePolicyType.lifecycleStateModel=Lifecycle state model ArchetypePolicyType.applicablePolicies=Applicable policies +ConfigurationType.configurationProperties=Configuration properties diff --git a/infra/schema/src/main/resources/localization/schema_fi.properties b/infra/schema/src/main/resources/localization/schema_fi.properties index 94f1e05bcf3..f49740c3321 100644 --- a/infra/schema/src/main/resources/localization/schema_fi.properties +++ b/infra/schema/src/main/resources/localization/schema_fi.properties @@ -331,6 +331,17 @@ GuiObjectListViewType.disableSorting=Disable sorting GuiObjectListViewType.action=Toiminta GuiObjectListViewsType.default=Oletus GuiObjectListViewsType.objectList=Object list +GuiObjectListViewsType.objectCollectionView=Object collection view +GuiObjectListViewType.collection=Collection +GuiObjectListViewType.details=Yksityiskohdat +CollectionSpecificationType.collectionRef=Collection ref +CollectionSpecificationType.depth=Depth +CollectionSpecificationType.interpretation=Interpretation +CollectionSpecificationType.relation=Yhteys +UserInterfaceFeatureType.display=Display +DisplayType.pluralLabel=Plural label +DisplayType.icon=Icon +IconType.color=Väri HasAssignmentPolicyConstraintType.targetRef=Kohde HasAssignmentPolicyConstraintType.enabled=Ota käyttöön HasAssignmentPolicyConstraintType.direct=Suora @@ -623,6 +634,8 @@ RoleManagementConfigurationType.defaultExecuteAfterAllApprovals=Default execute RoleManagementConfigurationType.autoassignEnabled=Autoassign enabled RoleManagementConfigurationType.relations=Relations SearchBoxConfigurationType.defaultMode=Default mode +SearchBoxConfigurationType.defaultObjectType=Default object type +SearchBoxConfigurationType.defaultScope=Default scope ShadowType.dead=Kuollut ShadowType.kind=Tyyppiluokka ShadowType.failedOperationType=Failed operation type @@ -742,6 +755,8 @@ ObjectTypes.FORM=Lomake ObjectTypes.CASE=Asia ObjectTypes.FUNCTION_LIBRARY=Function library ObjectTypes.OBJECT_COLLECTION=Object collection +ObjectTypes.ARCHETYPE=Archetype +ObjectTypes.ASSIGNMENT_HOLDER_TYPE=Assignment holder type OrgType.parentOrganization=Parent Organization ObjectType.extension=Laajennos FocusType.assignmentKey=Toimeksianto @@ -865,6 +880,8 @@ AdminGuiConfigurationType.defaultExportSettings=Default export settings AdminGuiConfigurationType.feature=Feature AdminGuiConfigurationType.feedbackMessagesHook=Feedback messages hook AdminGuiConfigurationType.roleManagement=Role management +AdminGuiConfigurationType.displayFormats=Display formats +AdminGuiConfigurationType.objectCollectionViews=Object collection views midPointVersion=${pom.version} midPointRevision=${git.describe} IdempotenceType.CONSERVATIVE=Conservative @@ -1227,3 +1244,4 @@ ArchetypePolicyType.display=Display ArchetypePolicyType.conflictResolution=Ristiriidan ratkaisu ArchetypePolicyType.lifecycleStateModel=Lifecycle state model ArchetypePolicyType.applicablePolicies=Applicable policies +ConfigurationType.configurationProperties=Configuration properties diff --git a/infra/schema/src/main/resources/localization/schema_fr.properties b/infra/schema/src/main/resources/localization/schema_fr.properties index 4bba699fd88..67ed0c83ad8 100644 --- a/infra/schema/src/main/resources/localization/schema_fr.properties +++ b/infra/schema/src/main/resources/localization/schema_fr.properties @@ -59,7 +59,7 @@ ActivityType.WORKFLOWS=Envisager ou démarrer des flux de travaux de validation AdminGuiConfigurationRoleManagementType.assignmentApprovalRequestLimit=Limite de demande de validation d'attribution AppenderConfigurationType.pattern=Motif AppenderConfigurationType.name=Nom -ApplicablePoliciesType.policyGroupRef=Groupe de politique +ApplicablePoliciesType.policyGroupRef=Groupe de politiques ApprovalCompositionStrategyType.order=Ordre ApprovalCompositionStrategyType.exclusive=Exclusive ApprovalCompositionStrategyType.mergeable=Fusionnable @@ -71,7 +71,7 @@ ApprovalSchemaType.name=Nom ApprovalSchemaType.description=Description ApprovalSchemaType.stage=Phases ApprovalStageDefinitionType.order=Ordre -ApprovalStageDefinitionType.number=Nombre +ApprovalStageDefinitionType.number=Numéro ApprovalStageDefinitionType.name=Nom ApprovalStageDefinitionType.displayName=Nom d'affichage ApprovalStageDefinitionType.description=Description @@ -84,7 +84,7 @@ ApprovalStageDefinitionType.groupExpansion=Expansion du groupe ApprovalStageDefinitionType.formRef=Formulaire ApprovalStageDefinitionType.additionalInformation=Information supplémentaire ApprovalStageDefinitionType.automaticallyApproved=Approuvé automatiquement -ApprovalStageDefinitionType.automaticallyCompleted=Complété automatiquement +ApprovalStageDefinitionType.automaticallyCompleted=Achevé automatiquement ApprovalStageDefinitionType.duration=Durée ApprovalStageDefinitionType.timedActions=Actions programmées AreaCategoryType.ADMINISTRATION=Administration @@ -214,8 +214,8 @@ ConnectorOperationalStatus.poolConfigMaxSize=Taille maximale du groupe ConnectorOperationalStatus.poolConfigMinIdle=Nombre minimal de connecteurs désœuvrés ConnectorOperationalStatus.poolConfigMaxIdle=Nombre maximal de connecteurs désœuvrés ConnectorOperationalStatus.poolConfigWaitTimeout=Attendre le délai d'attente -ConnectorOperationalStatus.poolConfigMinEvictableIdleTime=Temps mort éjectable minimal -ConnectorOperationalStatus.poolStatusNumIdle=Nombre de connecteurs inoccupés +ConnectorOperationalStatus.poolConfigMinEvictableIdleTime=Durée d'inactivité minimale avant éviction +ConnectorOperationalStatus.poolStatusNumIdle=Nombre de connecteurs désœuvrés ConnectorOperationalStatus.poolStatusNumActive=Nombre de connecteurs actifs AbstractConstructionType.description=Description AbstractConstructionType.strength=Force @@ -264,11 +264,11 @@ DistinctSearchOptionType.NEVER=Jamais EscalateWorkItemActionType.escalationLevelName=Nom du niveau d'escalade EscalateWorkItemActionType.escalationLevelDisplayName=Nom d'affichage du niveau d'escalade FeedbackMessagesHookType.operationResultHook=Point d'attache au résultat d'opération -FileAppenderConfigurationType.details=File appender configuration +FileAppenderConfigurationType.details=Configuration de l'ajouteur en fichier FileAppenderConfigurationType.fileName=Nom de fichier FileAppenderConfigurationType.filePattern=Motif de fichier -FileAppenderConfigurationType.maxHistory=Max history -FileAppenderConfigurationType.maxFileSize=Max file size +FileAppenderConfigurationType.maxHistory=Historique maximal +FileAppenderConfigurationType.maxFileSize=Taille maximale de fichier FileAppenderConfigurationType.append=Append FileAppenderConfigurationType.prudent=Prudent FileConfigurationType.details=Configuration du fichier @@ -331,6 +331,17 @@ GuiObjectListViewType.disableSorting=Désactiver le tri GuiObjectListViewType.action=Action GuiObjectListViewsType.default=Défaut GuiObjectListViewsType.objectList=Liste d'objets +GuiObjectListViewsType.objectCollectionView=Object collection view +GuiObjectListViewType.collection=Collection +GuiObjectListViewType.details=Détails +CollectionSpecificationType.collectionRef=Collection ref +CollectionSpecificationType.depth=Depth +CollectionSpecificationType.interpretation=Interpretation +CollectionSpecificationType.relation=Relation +UserInterfaceFeatureType.display=Affichage +DisplayType.pluralLabel=Plural label +DisplayType.icon=Icône +IconType.color=Couleur HasAssignmentPolicyConstraintType.targetRef=Cible HasAssignmentPolicyConstraintType.enabled=Activer HasAssignmentPolicyConstraintType.direct=Direct @@ -340,7 +351,7 @@ IconType.imageUrl=URL de l'image IconType.cssClass=Classe CSS InfrastructureConfigurationType.defaultHostname=Nom d'hôte par défaut InfrastructureConfigurationType.intraClusterHttpUrlPattern=Motif d'URL HTTP interne à la grappe -InfrastructureConfigurationType.remoteHostAddressHeader=Remote host address header +InfrastructureConfigurationType.remoteHostAddressHeader=Entête pour déterminer l'adresse du client InternalsConfigurationType.enableExperimentalCode=Activer le code expérimental InternalsConfigurationType.maxModelClicks=Clics max du modèle InternalsConfigurationType.polyStringNormalizer=Poly string normalizer @@ -361,7 +372,7 @@ ItemRefinedDefinitionType.experimental=Expérimental ItemRefinedDefinitionType.validation=Validation LegacyApproversSpecificationUsageType.NEVER=Jamais LegacyApproversSpecificationUsageType.ALWAYS=Toujours -LegacyApproversSpecificationUsageType.IF_NO_EXPLICIT_APPROVAL_POLICY_ACTION=If no explicit approval policy action +LegacyApproversSpecificationUsageType.IF_NO_EXPLICIT_APPROVAL_POLICY_ACTION=S'il n'y a pas d'action de politique de validation explicite LifecycleStateTransitionType.name=Nom LifecycleStateTransitionType.description=Description LifecycleStateTransitionType.targetState=État cible @@ -387,21 +398,21 @@ LockoutStatusType.LOCKED=Verrouillé LockoutStatusType.NORMAL=Normal LockoutStatusType.UNDEFINED=Indéterminé LoggingComponentType.ALL=Tout -LoggingComponentType.GUI=Enregistreur du composant GUI -LoggingComponentType.WEB=Enregistreur du composant Web -LoggingComponentType.MODEL=Enregistreur du composant Model -LoggingComponentType.NOTIFICATIONS = Enregistreur du composant Notifications -LoggingComponentType.PROVISIONING=Enregistreur du composant Provisioning -LoggingComponentType.REPOSITORY=Enregistreur du composant Repository -LoggingComponentType.RESOURCEOBJECTCHANGELISTENER=Enregistreur d'écouteur de changement d'objet de ressource -LoggingComponentType.TASKMANAGER=Enregistreur du gestionnaire de tâche -LoggingComponentType.WORKFLOWS = Enregistreur du composant Workflow -LoggingComponentType.ACCESS_CERTIFICATION = Enregistreur de certification des accès -LoggingComponentType.SECURITY = Enregistreur de sécurité -LoggingConfigurationType.classLogger=Enregistreurs +LoggingComponentType.GUI=Consignateur du composant GUI +LoggingComponentType.WEB=Consignateur du composant Web +LoggingComponentType.MODEL=Consignateur du composant Model +LoggingComponentType.NOTIFICATIONS = Consignateur du composant Notifications +LoggingComponentType.PROVISIONING=Consignateur du composant Provisioning +LoggingComponentType.REPOSITORY=Consignateur du composant Repository +LoggingComponentType.RESOURCEOBJECTCHANGELISTENER=Consignateur d'écouteur de changement d'objet de ressource +LoggingComponentType.TASKMANAGER=Consignateur du gestionnaire de tâche +LoggingComponentType.WORKFLOWS = Consignateur du composant Workflow +LoggingComponentType.ACCESS_CERTIFICATION = Consignateur de certification des accès +LoggingComponentType.SECURITY = Consignateur de sécurité +LoggingConfigurationType.classLogger=Consignateurs LoggingConfigurationType.appender=Ajouteurs LoggingConfigurationType.rootLoggerAppender=Ajouteur racine -LoggingConfigurationType.rootLoggerLevel=Enregistreur racine +LoggingConfigurationType.rootLoggerLevel=Consignateur racine LoggingConfigurationType.auditing=Audit LoggingLevelType.ALL=Tout LoggingLevelType.DEBUG=Débogage @@ -466,7 +477,7 @@ NodeExecutionStatusType.ERROR=Erreur NodeExecutionStatusType.PAUSED=Arrêté NodeExecutionStatusType.RUNNING=En cours d'exécution NotificationConfigurationType.details=Configuration des notifications -NotificationPolicyActionType.details=Notification policy action +NotificationPolicyActionType.details=Action de politique de notification ObjectFormsType.objectForm=Formulaire d'objets ObjectFormType.details=Formulaire d'objets ObjectFormType.formSpecification=Spécification de formulaire @@ -565,8 +576,8 @@ PcpAspectConfigurationType.approvalSchema=Schéma de validation PcpAspectConfigurationType.applicabilityCondition=Condition d'applicabilité PcpAspectConfigurationType.approverRef=Validateurs PcpAspectConfigurationType.enabled=Activé -PrimaryChangeProcessorConfigurationType.policyRuleBasedAspect=Policy rule based approvals -PrimaryChangeProcessorConfigurationType.addAssociationAspect=Add association approvals +PrimaryChangeProcessorConfigurationType.policyRuleBasedAspect=Validations sur base de règle de politique +PrimaryChangeProcessorConfigurationType.addAssociationAspect=Validations pour l'ajout d'attributions PolicyConstraintEnforcementType.ENFORCE=Imposer PolicyConstraintEnforcementType.REMEDIATE=Réhabiliter PolicyConstraintEnforcementType.REPORT=Signaler @@ -623,6 +634,8 @@ RoleManagementConfigurationType.defaultExecuteAfterAllApprovals=Default execute RoleManagementConfigurationType.autoassignEnabled=Autoassign enabled RoleManagementConfigurationType.relations=Relations SearchBoxConfigurationType.defaultMode=Default mode +SearchBoxConfigurationType.defaultObjectType=Default object type +SearchBoxConfigurationType.defaultScope=Default scope ShadowType.dead=Mort ShadowType.kind=Sorte ShadowType.failedOperationType=Failed operation type @@ -631,8 +644,8 @@ ShadowType.intent=Finalité ShadowType.objectClass=Classe d'objet ShadowType.synchronizationSituation=Situation ShadowType.synchronizationTimestamp=Horodatage de synchronisation -ShadowType.fullSynchronizationTimestamp=Full synchronization timestamp -ShadowType.synchronizationSituationDescription=Situation description +ShadowType.fullSynchronizationTimestamp=Horodatage de la synchronisation complète +ShadowType.synchronizationSituationDescription=Description de la situation ShadowType.resourceRef=Ressource ShadowType.pendingOperation=Pending operation ShadowType.iteration=Itération @@ -640,22 +653,22 @@ ShadowType.iterationToken=Iteration token PendingOperationType.details=Détails PendingOperationType.delta= PendingOperationType.requestTimestamp=Demandé -PendingOperationType.operationStartTimestamp=Operation started +PendingOperationType.operationStartTimestamp=Début PendingOperationType.lastAttemptTimestamp=Dernière tentative -PendingOperationType.completionTimestamp=Terminé +PendingOperationType.completionTimestamp=Fin PendingOperationType.executionStatus=Exécution PendingOperationType.resultStatus=Résultat -PendingOperationType.asynchronousOperationReference=Asynchronous operation reference -PendingOperationType.attemptNumber=Attempt -PendingOperationType.id=Id +PendingOperationType.asynchronousOperationReference=Référence d'opération asynchrone +PendingOperationType.attemptNumber=Tentative n* +PendingOperationType.id=ID PendingOperationType.type=Type CredentialsType.nonce=Nonce NonceType.value=Valeur -SecurityQuestionsCredentialsType.questionAnswer=Question/Answer +SecurityQuestionsCredentialsType.questionAnswer=Question / Réponse SecurityQuestionAnswerType.questionIdentifier=Identifiant SecurityQuestionAnswerType.answer=Réponse SecurityQuestionAnswerType.enabled=Activé -SecurityQuestionAnswerType.id=Id +SecurityQuestionAnswerType.id=ID ShadowKindType.ACCOUNT=Compte ShadowKindType.ENTITLEMENT=Droit ShadowKindType.GENERIC=Générique @@ -675,13 +688,13 @@ SynchronizationSituationType.DISPUTED=Contesté SynchronizationSituationType.LINKED=Lié SynchronizationSituationType.null=Choisissez... SynchronizationSituationType.UNLINKED=Non lié -SynchronizationSituationType.UNMATCHED=Non-appariés -SyslogAppenderConfigurationType.details=Syslog appender configuration -SyslogAppenderConfigurationType.syslogHost=Syslog host +SynchronizationSituationType.UNMATCHED=Non-apparié +SyslogAppenderConfigurationType.details=Configuration de l'ajouteur syslog +SyslogAppenderConfigurationType.syslogHost=Hôte syslog SyslogAppenderConfigurationType.port=Port SyslogAppenderConfigurationType.facility=Facility -SyslogAppenderConfigurationType.suffixPattern=Suffix pattern -SyslogAppenderConfigurationType.stackTracePattern=Stack trace pattern +SyslogAppenderConfigurationType.suffixPattern=Motif de suffixe +SyslogAppenderConfigurationType.stackTracePattern=Motif de trace de la pile SyslogAppenderConfigurationType.throwableExcluded=Throwable excluded ThreadStopActionType.CLOSE=Fermer ThreadStopActionType.RESCHEDULE=Replanifier @@ -742,6 +755,8 @@ ObjectTypes.FORM=Formulaire ObjectTypes.CASE=Cas ObjectTypes.FUNCTION_LIBRARY=Bibliothèque de fonctions ObjectTypes.OBJECT_COLLECTION=Collection de l'objet +ObjectTypes.ARCHETYPE=Archetype +ObjectTypes.ASSIGNMENT_HOLDER_TYPE=Assignment holder type OrgType.parentOrganization=Entité org. parente ObjectType.extension=Extension FocusType.assignmentKey=Attribution @@ -780,12 +795,12 @@ AbstractRoleType.owner=Propriétaire AbstractRoleType.approver=Validateur AbstractRoleType.idempotent=Idempotence RoleType.roleType=Type de rôle -ObjectPolicyConfigurationType.details=Object policy configuration +ObjectPolicyConfigurationType.details=Configuration d'une politique d'objets ObjectPolicyConfigurationType.type=Type ObjectPolicyConfigurationType.subtype=Sous-type -ObjectPolicyConfigurationType.objectTemplateRef=Politique des objets -ObjectPolicyConfigurationType.propertyConstraint=Contrainte sur la propriété -ObjectPolicyConfigurationType.conflictResolution=Résolution de Conflit +ObjectPolicyConfigurationType.objectTemplateRef=Politiques des objets +ObjectPolicyConfigurationType.propertyConstraint=Contraintes sur les propriétés +ObjectPolicyConfigurationType.conflictResolution=Résolution de conflit ObjectPolicyConfigurationType.lifecycleStateModel=Modèle des états du cycle de vie ObjectPolicyConfigurationType.applicablePolicies=Politiques applicables OrgType.type=Type @@ -809,7 +824,7 @@ SystemConfigurationType.internals=Internals SystemConfigurationType.deploymentInformation=Informations de déploiement SystemConfigurationType.infrastructure=Infrastructure SystemConfigurationType.fullTextSearch=Recherche en texte intégral -PropertyConstraintType.details=Contrainte sur la propriété +PropertyConstraintType.details=Contrainte de propriété PropertyConstraintType.path=Chemin ResourceAttribute.connIdName=Nom ConnId ResourceAttribute.connIdUID=UID ConnId @@ -865,6 +880,8 @@ AdminGuiConfigurationType.defaultExportSettings=Paramètres d'export par défaut AdminGuiConfigurationType.feature=Fonctionnalité AdminGuiConfigurationType.feedbackMessagesHook=Point d'attache aux messages de réaction AdminGuiConfigurationType.roleManagement=Gestion des rôles +AdminGuiConfigurationType.displayFormats=Display formats +AdminGuiConfigurationType.objectCollectionViews=Object collection views midPointVersion=${pom.version} midPointRevision=${git.describe} IdempotenceType.CONSERVATIVE=Prudente @@ -1001,7 +1018,7 @@ PolicyConstraintsType.objectMaxAssigneesViolation=Violation du nombre maximal d' ExclusionPolicyConstraintType.details=Exclusion policy constraint type ExclusionPolicyConstraintType.targetRef=Cible ExclusionPolicyConstraintType.targetRef.help=Cible de l'exclusion : l'objet qui définit cette exclusion et l'objet défini comme cible ne peuvent pas être attribués concomitamment. -ExclusionPolicyConstraintType.orderConstraint=Order constraint +ExclusionPolicyConstraintType.orderConstraint=Contrainte d'ordre ExclusionPolicyConstraintType.targetOrderConstraint=Target order constraint ExclusionPolicyConstraintType.policy=Politique PolicyActionsType.enforcement=Mise en application @@ -1024,9 +1041,9 @@ PolicyActionType.description=Description PolicyActionType.description.help=Description de l'action de politique (commentaire en texte libre). PolicyActionType.condition=Condition PolicyActionType.condition.help=Condition spécifiant quand cette action doit être appliquée. -ApprovalPolicyActionType.details=Approval policy action +ApprovalPolicyActionType.details=Action de politique de validation ApprovalPolicyActionType.compositionStrategy=Stratégie de composition -ApprovalPolicyActionType.compositionStrategy.help=How should be this approval policy action composed with other ones that might be related to the same item (object or assignment). +ApprovalPolicyActionType.compositionStrategy.help=Comment cette action de politique de validation doit être combinée avec d'autres pouvant être liées au même élément (objet ou attribution). ApprovalPolicyActionType.approvalDisplayName=Nom d'affichage de la validation ApprovalPolicyActionType.approvalDisplayName.help=Le nom sous lequel cette définition de validation sera présentée. S'il n'est pas spécifié, le nom sera dérivé des contraintes déclenchées (messages courts). ApprovalPolicyActionType.approverRelation=Relation du validateur @@ -1118,7 +1135,7 @@ MetadataType.certifierComment=Commentaire du certificateur MetadataType.originMappingName=Nom de la correspondance d'origine MetadataType.createTaskRef=Créé par tâche MetadataType.modifyTaskRef=Modifié par tâche -ResourceItemDefinitionType.exclusiveStrong=Exclusive strong +ResourceItemDefinitionType.exclusiveStrong=Fort exclusif ResourceItemDefinitionType.modificationPriority=Priorité de modification ResourceItemDefinitionType.readReplaceMode=Read replace mode ResourceItemDefinitionType.secondaryIdentifier=Identifiant secondaire @@ -1148,9 +1165,9 @@ AbstractCredentialType.forceChange=Changement obligatoire à la prochaine connex PasswordType.value=Valeur AdminGuiConfigurationType.enableExperimentalFeature=Activer les fonctionnalités expérimentales de l'interface graphique WfConfigurationType.modelHookEnabled=Points d'attache au modèle activés -WfConfigurationType.processCheckInterval=Process check interval -WfConfigurationType.useLegacyApproversSpecification=Use legacy approvers specification -WfConfigurationType.useDefaultApprovalPolicyRules=Use default approval policy rules +WfConfigurationType.processCheckInterval=Intervalle de contrôle de processus +WfConfigurationType.useLegacyApproversSpecification=Utiliser l'ancienne spécification des validateurs +WfConfigurationType.useDefaultApprovalPolicyRules=Utiliser les règles de politique de validation par défaut WfConfigurationType.executionTasks=Execution tasks WfConfigurationType.approverCommentsFormatting=Formatage des commentaires du validateur WfConfigurationType.primaryChangeProcessor=Processeur de changement primaire @@ -1181,10 +1198,10 @@ WfProcessSpecificationType.deltaFrom=Delta de WfProcessSpecificationType.includeAction=Inclure l'action WfProcessSpecificationType.includeActionIfPresent= Inclure l'action si présente WfProcessSpecificationType.approvalDisplayName=Nom d'affichage de la validation -WorkItemActionsType.complete=Achevée +WorkItemActionsType.complete=Achever WorkItemActionsType.notify=Notifier WorkItemActionsType.delegate=Déléguer -WorkItemActionsType.escalate=Intensifier +WorkItemActionsType.escalate=Intensifier (escalade) WorkItemNotificationActionType.perAssignee=Par attributaire WorkItemNotificationActionType.handler=Gestionnaire WorkItemTimedActionsType.name=Nom @@ -1198,7 +1215,7 @@ WorkItemTimedActionsType.escalationLevelTo=Niveau d'escalade jusqu'à PendingOperationExecutionStatusType.REQUESTED=Demandé PendingOperationExecutionStatusType.EXECUTION_PENDING=Execution pending PendingOperationExecutionStatusType.EXECUTING=En cous d'exécution -PendingOperationExecutionStatusType.COMPLETED=Terminé +PendingOperationExecutionStatusType.COMPLETED=Achevé PendingOperationTypeType.MANUAL=Manuel PendingOperationTypeType.RETRY=Réessayer UserType.roleMembershipRef=Role Membership @@ -1227,3 +1244,4 @@ ArchetypePolicyType.display=Affichage ArchetypePolicyType.conflictResolution=Résolution de conflit ArchetypePolicyType.lifecycleStateModel=Lifecycle state model ArchetypePolicyType.applicablePolicies=Applicable policies +ConfigurationType.configurationProperties=Configuration properties diff --git a/infra/schema/src/main/resources/localization/schema_hu.properties b/infra/schema/src/main/resources/localization/schema_hu.properties index bf7cca9943f..9c2f5e0ebbc 100644 --- a/infra/schema/src/main/resources/localization/schema_hu.properties +++ b/infra/schema/src/main/resources/localization/schema_hu.properties @@ -331,6 +331,17 @@ GuiObjectListViewType.disableSorting=Rendezés kikapcsolása GuiObjectListViewType.action=Művelet GuiObjectListViewsType.default=Alapértelmezett GuiObjectListViewsType.objectList=Objektum lista +GuiObjectListViewsType.objectCollectionView=Object collection view +GuiObjectListViewType.collection=Collection +GuiObjectListViewType.details=Részletek +CollectionSpecificationType.collectionRef=Collection ref +CollectionSpecificationType.depth=Depth +CollectionSpecificationType.interpretation=Interpretation +CollectionSpecificationType.relation=Kapcsolat +UserInterfaceFeatureType.display=Display +DisplayType.pluralLabel=Plural label +DisplayType.icon=Ikon +IconType.color=Color HasAssignmentPolicyConstraintType.targetRef=Cél HasAssignmentPolicyConstraintType.enabled=Enable HasAssignmentPolicyConstraintType.direct=Közvetlen @@ -623,6 +634,8 @@ RoleManagementConfigurationType.defaultExecuteAfterAllApprovals=Default execute RoleManagementConfigurationType.autoassignEnabled=Autoassign enabled RoleManagementConfigurationType.relations=Relations SearchBoxConfigurationType.defaultMode=Default mode +SearchBoxConfigurationType.defaultObjectType=Default object type +SearchBoxConfigurationType.defaultScope=Default scope ShadowType.dead=Halott ShadowType.kind=Fajta ShadowType.failedOperationType=Failed operation type @@ -742,6 +755,8 @@ ObjectTypes.FORM=Űrlap ObjectTypes.CASE=Case ObjectTypes.FUNCTION_LIBRARY=Function library ObjectTypes.OBJECT_COLLECTION=Object collection +ObjectTypes.ARCHETYPE=Archetype +ObjectTypes.ASSIGNMENT_HOLDER_TYPE=Assignment holder type OrgType.parentOrganization=Parent Organization ObjectType.extension=Kiterjesztés FocusType.assignmentKey=Assignment @@ -865,6 +880,8 @@ AdminGuiConfigurationType.defaultExportSettings=Default export settings AdminGuiConfigurationType.feature=Feature AdminGuiConfigurationType.feedbackMessagesHook=Feedback messages hook AdminGuiConfigurationType.roleManagement=Role management +AdminGuiConfigurationType.displayFormats=Display formats +AdminGuiConfigurationType.objectCollectionViews=Object collection views midPointVersion=${pom.version} midPointRevision=${git.describe} IdempotenceType.CONSERVATIVE=Conservative @@ -1227,3 +1244,4 @@ ArchetypePolicyType.display=Display ArchetypePolicyType.conflictResolution=Conflict resolution ArchetypePolicyType.lifecycleStateModel=Lifecycle state model ArchetypePolicyType.applicablePolicies=Applicable policies +ConfigurationType.configurationProperties=Configuration properties diff --git a/infra/schema/src/main/resources/localization/schema_it.properties b/infra/schema/src/main/resources/localization/schema_it.properties index d197f4907a6..2e6724c4ddf 100644 --- a/infra/schema/src/main/resources/localization/schema_it.properties +++ b/infra/schema/src/main/resources/localization/schema_it.properties @@ -331,6 +331,17 @@ GuiObjectListViewType.disableSorting=Disabilita ordinamento GuiObjectListViewType.action=Azione GuiObjectListViewsType.default=Default GuiObjectListViewsType.objectList=Lista oggetti +GuiObjectListViewsType.objectCollectionView=Vista collezione oggetti +GuiObjectListViewType.collection=Collezione +GuiObjectListViewType.details=Dettagli +CollectionSpecificationType.collectionRef=Rif. collezione +CollectionSpecificationType.depth=Profondità +CollectionSpecificationType.interpretation=Interpretazione +CollectionSpecificationType.relation=Relazione +UserInterfaceFeatureType.display=Mostra +DisplayType.pluralLabel=Etichetta plurale +DisplayType.icon=Icon +IconType.color=Colore HasAssignmentPolicyConstraintType.targetRef=Target HasAssignmentPolicyConstraintType.enabled=Abilita HasAssignmentPolicyConstraintType.direct=Diretto @@ -623,6 +634,8 @@ RoleManagementConfigurationType.defaultExecuteAfterAllApprovals=Esecuzione prede RoleManagementConfigurationType.autoassignEnabled=Auto-assegnazione abilitata RoleManagementConfigurationType.relations=Relazioni SearchBoxConfigurationType.defaultMode=Modalità di default +SearchBoxConfigurationType.defaultObjectType=Default object type +SearchBoxConfigurationType.defaultScope=Ambito di default ShadowType.dead=Fuori uso ShadowType.kind=Genere ShadowType.failedOperationType=Tipo di operazione fallita @@ -742,6 +755,8 @@ ObjectTypes.FORM=Form ObjectTypes.CASE=Caso ObjectTypes.FUNCTION_LIBRARY=Libreria di funzioni ObjectTypes.OBJECT_COLLECTION=Collezione di oggetti +ObjectTypes.ARCHETYPE=Archetipo +ObjectTypes.ASSIGNMENT_HOLDER_TYPE=Tipo di assegnatario dell'incarico OrgType.parentOrganization=Organizzazione padre ObjectType.extension=Estensione FocusType.assignmentKey=Assegnazione @@ -865,6 +880,8 @@ AdminGuiConfigurationType.defaultExportSettings=Impostazioni di esportazione pre AdminGuiConfigurationType.feature=Funzionalità AdminGuiConfigurationType.feedbackMessagesHook=Feedback messages hook AdminGuiConfigurationType.roleManagement=Gestione Ruoli +AdminGuiConfigurationType.displayFormats=Visualizza i formati +AdminGuiConfigurationType.objectCollectionViews=Viste collezione oggetti midPointVersion=${pom.version} midPointRevision=${git.describe} IdempotenceType.CONSERVATIVE=Conservativo @@ -1227,3 +1244,4 @@ ArchetypePolicyType.display=Mostra ArchetypePolicyType.conflictResolution=Conflitti nella risoluzione ArchetypePolicyType.lifecycleStateModel=Modello dello stato del ciclo di vita ArchetypePolicyType.applicablePolicies=Policy applicabili +ConfigurationType.configurationProperties=Configurazione delle proprietà diff --git a/infra/schema/src/main/resources/localization/schema_ja.properties b/infra/schema/src/main/resources/localization/schema_ja.properties index d0393553868..ca28f77f159 100644 --- a/infra/schema/src/main/resources/localization/schema_ja.properties +++ b/infra/schema/src/main/resources/localization/schema_ja.properties @@ -119,7 +119,7 @@ AssignmentType.target.help=割当てまたはインデュースメントの対 AssignmentType.focusType=フォーカスタイプ AssignmentType.focusType.help=この割当て/インデュースメントが適用されるフォーカル・オブジェクトのタイプ。 例えば、UserType、RoleType、OrgType、... AssignmentType.tenant=テナント -AssignmentType.focusMappings=Focus mappings +AssignmentType.focusMappings=フォーカス・マッピング AssignmentType.tenantReference=テナント・リファレンス AssignmentType.tenantReference.help=この割当てが関連付けられているテナントへの参照。 これはこの割当てのターゲットに対する引数です。 例えば、この割当てによって割当てられるロールをパラメーター化するために頻繁に使用される場合です。 AssignmentType.orgReference=組織リファレンス @@ -331,6 +331,17 @@ GuiObjectListViewType.disableSorting=ソートを無効にする GuiObjectListViewType.action=アクション GuiObjectListViewsType.default=デフォルト GuiObjectListViewsType.objectList=オブジェクトリスト +GuiObjectListViewsType.objectCollectionView=オブジェクト・コレクション・ビュー +GuiObjectListViewType.collection=コレクション +GuiObjectListViewType.details=詳細 +CollectionSpecificationType.collectionRef=コレクション参照 +CollectionSpecificationType.depth=Depth +CollectionSpecificationType.interpretation=解釈 +CollectionSpecificationType.relation=リレーション +UserInterfaceFeatureType.display=表示 +DisplayType.pluralLabel=複数ラベル +DisplayType.icon=アイコン +IconType.color=色 HasAssignmentPolicyConstraintType.targetRef=ターゲット HasAssignmentPolicyConstraintType.enabled=有効 HasAssignmentPolicyConstraintType.direct=直接的 @@ -505,9 +516,9 @@ ObjectType.SystemConfigurationType=システム設定 ObjectType.TaskType=タスク ObjectType.UserType=ユーザー ObjectType.ServiceType=サービス -ObjectType.ValuePolicyType=バリューポリシー -ObjectType.ArchetypeType=Archetype -ObjectType.AssignmentHolderType=Assignment holder +ObjectType.ValuePolicyType=バリュー・ポリシー +ObjectType.ArchetypeType=アーキタイプ +ObjectType.AssignmentHolderType=アサイン・フォルダー ObjectType.CaseType=ケース ObjectTypeLowercase.AbstractRoleType=抽象ロール ObjectTypeLowercase.AccessCertificationCampaignType=認定キャンペーンのアクセス @@ -534,7 +545,7 @@ ObjectTypeLowercase.SystemConfigurationType=システム設定 ObjectTypeLowercase.TaskType=タスク ObjectTypeLowercase.UserType=ユーザー ObjectTypeLowercase.ServiceType=サービス -ObjectTypeLowercase.ValuePolicyType=バリューポリシー +ObjectTypeLowercase.ValuePolicyType=バリュー・ポリシー ObjectType.name=名前 ObjectType.parentOrgRef=組織ユニットの親 ObjectType.subtype=サブタイプ @@ -623,6 +634,8 @@ RoleManagementConfigurationType.defaultExecuteAfterAllApprovals=すべての承 RoleManagementConfigurationType.autoassignEnabled=自動アサインが有効 RoleManagementConfigurationType.relations=リレーション SearchBoxConfigurationType.defaultMode=デフォルトモード +SearchBoxConfigurationType.defaultObjectType=デフォルト・オブジェクト・タイプ +SearchBoxConfigurationType.defaultScope=デフォルト・スコープ ShadowType.dead=Dead ShadowType.kind=種類 ShadowType.failedOperationType=失敗した操作タイプ @@ -679,7 +692,7 @@ SynchronizationSituationType.UNMATCHED=Unmatched SyslogAppenderConfigurationType.details=Syslogアペンダー設定 SyslogAppenderConfigurationType.syslogHost=Syslogホスト SyslogAppenderConfigurationType.port=ポート -SyslogAppenderConfigurationType.facility=Facility +SyslogAppenderConfigurationType.facility=ファシリティー SyslogAppenderConfigurationType.suffixPattern=接尾語パターン SyslogAppenderConfigurationType.stackTracePattern=スタックトレース・パターン SyslogAppenderConfigurationType.throwableExcluded=Throwableを除外する @@ -742,6 +755,8 @@ ObjectTypes.FORM=フォーム ObjectTypes.CASE=ケース ObjectTypes.FUNCTION_LIBRARY=関数ライブラリ ObjectTypes.OBJECT_COLLECTION=オブジェクトコレクション +ObjectTypes.ARCHETYPE=アーキタイプ +ObjectTypes.ASSIGNMENT_HOLDER_TYPE=アサイン・フォルダー・タイプ OrgType.parentOrganization=親組織 ObjectType.extension=拡張 FocusType.assignmentKey=アサイン @@ -787,7 +802,7 @@ ObjectPolicyConfigurationType.objectTemplateRef=オブジェクト・ポリシ ObjectPolicyConfigurationType.propertyConstraint=プロパティー制約 ObjectPolicyConfigurationType.conflictResolution=コンフリクトの解消 ObjectPolicyConfigurationType.lifecycleStateModel=ライフサイクル状態モデル -ObjectPolicyConfigurationType.applicablePolicies=適用ポリシー +ObjectPolicyConfigurationType.applicablePolicies=適用されるポリシー OrgType.type=タイプ OrgType.isTenant=テナント OrgType.displayOrder=表示順 @@ -865,6 +880,8 @@ AdminGuiConfigurationType.defaultExportSettings=デフォルトのエクスポ AdminGuiConfigurationType.feature=機能 AdminGuiConfigurationType.feedbackMessagesHook=フィードバックメッセージ・フック AdminGuiConfigurationType.roleManagement=ロール管理 +AdminGuiConfigurationType.displayFormats=表示フォーマット +AdminGuiConfigurationType.objectCollectionViews=オブジェクト・コレクション・ビュー midPointVersion=${pom.version} midPointRevision=${git.describe} IdempotenceType.CONSERVATIVE=保守的 @@ -1025,7 +1042,7 @@ PolicyActionType.description.help=ポリシーアクションの自由形式の PolicyActionType.condition=条件 PolicyActionType.condition.help=このアクションをいつ適用するかを指定する条件。 ApprovalPolicyActionType.details=承認ポリシー・アクション -ApprovalPolicyActionType.compositionStrategy=Composition strategy +ApprovalPolicyActionType.compositionStrategy=構成ストラテジー ApprovalPolicyActionType.compositionStrategy.help=この承認ポリシー・アクションは、同じアイテム(オブジェクトまたは割当て)に関連する可能性のある他のものとどのように構成されるべきですか。 ApprovalPolicyActionType.approvalDisplayName=承認表示名 ApprovalPolicyActionType.approvalDisplayName.help=この承認定義の表示名。 指定されていない場合、名前はトリガーされた制約(ショートメッセージ)から派生します。 @@ -1222,8 +1239,9 @@ Channel.INIT=初期化 Channel.USER=ユーザー Channel.SELF_REGISTRATION=セルフ登録 Channel.RESET_PASSWORD=パスワードのリセット -ArchetypePolicyType.objectTemplateRef=Object template reference +ArchetypePolicyType.objectTemplateRef=オブジェクト・テンプレート参照 ArchetypePolicyType.display=表示 ArchetypePolicyType.conflictResolution=コンフリクトの解消 -ArchetypePolicyType.lifecycleStateModel=Lifecycle state model -ArchetypePolicyType.applicablePolicies=Applicable policies +ArchetypePolicyType.lifecycleStateModel=ライフサイクル状態モデル +ArchetypePolicyType.applicablePolicies=適用されるポリシー +ConfigurationType.configurationProperties=プロパティーの設定 diff --git a/infra/schema/src/main/resources/localization/schema_lt.properties b/infra/schema/src/main/resources/localization/schema_lt.properties index 29865316f20..d49a40a519a 100644 --- a/infra/schema/src/main/resources/localization/schema_lt.properties +++ b/infra/schema/src/main/resources/localization/schema_lt.properties @@ -115,11 +115,11 @@ AssignmentType.policySituation.help=Politikos situacija(-os) šiam priskyrimui. AssignmentType.order=Eiliškumas AssignmentType.order.help=Nurodomas užduočių, kurias reikia įvertinti, kad taikyti poveikius, skaičių. AssignmentType.target=Adresatas -AssignmentType.target.help=Priskyrimų ar poveikių adresatas: rolė, organizacija ar paslauga. +AssignmentType.target.help=Nurodo, priskyrimų paskirtį: ar tai rolė, organizacija ar paslauga. AssignmentType.focusType=Parinktasis tipas AssignmentType.focusType.help=Objekto, kuriam taikomas priskyrimas/poveikis tipas, pvz.: UserType, RoleType, OrgType . AssignmentType.tenant=Paslaugos gavėjas -AssignmentType.focusMappings=Focus mappings +AssignmentType.focusMappings=Parinktojo objekto susiejimas AssignmentType.tenantReference=Paslaugos gavėjo nuoroda AssignmentType.tenantReference.help=Nuoroda į paslaugos gavėją, su kuriuo susijęs priskyrimas. AssignmentType.orgReference=Organizacijos nuoroda @@ -322,7 +322,7 @@ GuiObjectDetailsPageType.saveMethod=Išsaugojimo metodas GuiObjectDetailsSetType.objectDetailsPage=Objekto informacijos puslapis GuiObjectListViewType.name=Pavadinimas GuiObjectListViewType.type=Tipas -GuiObjectListViewType.collectionRef=Nuoroda į objekto rinkimą +GuiObjectListViewType.collectionRef=Nuoroda į objekto surinkimą GuiObjectListViewType.display=Nustatymų rodymas GuiObjectListViewType.searchBoxConfiguration=Paieškos lauko konfigūravimas GuiObjectListViewType.distinct=Atskiras @@ -331,6 +331,17 @@ GuiObjectListViewType.disableSorting=Išjungti rūšiavimą GuiObjectListViewType.action=Veiksmas GuiObjectListViewsType.default=Numatytoji reikšmė GuiObjectListViewsType.objectList=Objektų sąrašas +GuiObjectListViewsType.objectCollectionView=Objektų surinkimo atvaizdavimas +GuiObjectListViewType.collection=Surinkimas +GuiObjectListViewType.details=Išsami informacija +CollectionSpecificationType.collectionRef=Surinkimo nuoroda +CollectionSpecificationType.depth=Gylis +CollectionSpecificationType.interpretation=Interpretavimas +CollectionSpecificationType.relation=Ryšys +UserInterfaceFeatureType.display=Atvaizdavimas +DisplayType.pluralLabel=Daugiskaitos etiketė +DisplayType.icon=Ikona +IconType.color=Spalva HasAssignmentPolicyConstraintType.targetRef=Adresatas HasAssignmentPolicyConstraintType.enabled=Aktyvuoti HasAssignmentPolicyConstraintType.direct=Tiesioginis @@ -489,7 +500,7 @@ ObjectType.FunctionLibraryType=Funkcijų biblioteka ObjectType.GenericObjectType=Bendrinis objektas ObjectType.LookupTableType=Paieškos lentelė ObjectType.NodeType=Mazgas -ObjectType.ObjectCollectionType=Objektų kolekcija +ObjectType.ObjectCollectionType=Objektų surinkimas ObjectType.ObjectType=Objetas ObjectType.ObjectTemplateType=Objekto šablonas ObjectType.OrgManagerType=Org. administratorius @@ -506,8 +517,8 @@ ObjectType.TaskType=Užduotis ObjectType.UserType=Naudotojas ObjectType.ServiceType=Paslauga ObjectType.ValuePolicyType=Reikšmių politika -ObjectType.ArchetypeType=Archetype -ObjectType.AssignmentHolderType=Assignment holder +ObjectType.ArchetypeType=Prototipas +ObjectType.AssignmentHolderType=Priskyrimų turėtojas ObjectType.CaseType=Byla ObjectTypeLowercase.AbstractRoleType=abstrakti rolė ObjectTypeLowercase.AccessCertificationCampaignType=prieigos sertifikavimo procesas @@ -623,6 +634,8 @@ RoleManagementConfigurationType.defaultExecuteAfterAllApprovals=Numatytasis vykd RoleManagementConfigurationType.autoassignEnabled=Įgalintas automatinis priskyrimas RoleManagementConfigurationType.relations=Ryšiai SearchBoxConfigurationType.defaultMode=Numatytasis režimas +SearchBoxConfigurationType.defaultObjectType=Numatytasis objekto tipas +SearchBoxConfigurationType.defaultScope=Numatytoji taikymo sritis ShadowType.dead=Nebegaliojanti ShadowType.kind=Rūšis ShadowType.failedOperationType=Nepavykusios operacijos tipas @@ -673,7 +686,7 @@ SummaryPanelSpecificationType.organization=Organizacija SynchronizationSituationType.DELETED=Ištrinta SynchronizationSituationType.DISPUTED=Svarstoma SynchronizationSituationType.LINKED=Sujungiama -SynchronizationSituationType.null=Pasirinkite vieną +SynchronizationSituationType.null=Pasirinkite SynchronizationSituationType.UNLINKED=Atjungiame SynchronizationSituationType.UNMATCHED=Neatinkanti SyslogAppenderConfigurationType.details=Syslog sisteminių žurnalų tvarkyklės konfigūracija @@ -741,7 +754,9 @@ ObjectTypes.OBJECT=Objektas ObjectTypes.FORM=Forma ObjectTypes.CASE=Byla ObjectTypes.FUNCTION_LIBRARY=Funkcijų biblioteka -ObjectTypes.OBJECT_COLLECTION=Objektų kolekcija +ObjectTypes.OBJECT_COLLECTION=Objektų surinkimas +ObjectTypes.ARCHETYPE=Prototipas +ObjectTypes.ASSIGNMENT_HOLDER_TYPE=Priskyrimų turėtojo tipas OrgType.parentOrganization="Tėvinė" organizacija ObjectType.extension=Papildomi nustatymai FocusType.assignmentKey=Priskyrimas @@ -865,6 +880,8 @@ AdminGuiConfigurationType.defaultExportSettings=Numatytieji eksportavimo nustaty AdminGuiConfigurationType.feature=Ypatybė AdminGuiConfigurationType.feedbackMessagesHook=Atsiliepimų žinučių gaudyklė AdminGuiConfigurationType.roleManagement=Rolių valdymas +AdminGuiConfigurationType.displayFormats=Rodyti formatus +AdminGuiConfigurationType.objectCollectionViews= Objektų surinkimo atvaizdavimas midPointVersion=${pom.version} midPointRevision=${git.describe} IdempotenceType.CONSERVATIVE=Konservatyvus @@ -1103,13 +1120,13 @@ MetadataType.creatorRef=Sukūrė MetadataType.createApproverRef=Sukūrimą patvirtinęs asmuo MetadataType.createApprovalComment=Sūkurimą patvirtinusio asmens komentaras MetadataType.createApprovalTimestamp=Sukūrimo patvirtinimo data -MetadataType.createChannel=Sukūrimo kanalas -MetadataType.modifyTimestamp=Keitimų data -MetadataType.modifierRef=Keitimą atliko -MetadataType.modifyApproverRef=Paskutinius pakeitimus patvirtino -MetadataType.modifyApprovalComment=Keitimus patvirtinusio asmens komentaras -MetadataType.modifyApprovalTimestamp=Sukūrimo patvirtinimo data -MetadataType.modifyChannel=Modifikavimo kanalas +MetadataType.createChannel=Sukurta per +MetadataType.modifyTimestamp=Modifikavimo data +MetadataType.modifierRef=Modifikavimą atliko +MetadataType.modifyApproverRef=Paskutines modifikacijas patvirtino +MetadataType.modifyApprovalComment=Modifikacijas patvirtinusio asmens komentaras +MetadataType.modifyApprovalTimestamp=Modifikacijos patvirtinimo data +MetadataType.modifyChannel=Modifikuota per MetadataType.lastProvisioningTimestamp=Paskutinio teikimo data MetadataType.certificationFinishedTimestamp=Paskutinio sertifikavimo pabaigos data MetadataType.certificationOutcome=Paskutinio sertifikavimo rezultatas @@ -1119,7 +1136,7 @@ MetadataType.originMappingName=Pradinio susiejimo pavadinimas MetadataType.createTaskRef=Sukurta pagal užduotį MetadataType.modifyTaskRef=Modifikuota pagal užduotį ResourceItemDefinitionType.exclusiveStrong=Išskirtinai stiprus -ResourceItemDefinitionType.modificationPriority=Modifikacijos prioritetas +ResourceItemDefinitionType.modificationPriority=Modifikacijų prioritetas ResourceItemDefinitionType.readReplaceMode=Perskaitykite pakeitimo režimą ResourceItemDefinitionType.secondaryIdentifier=Antrinis identifikatorius ResourceItemDefinitionType.volatilityTrigger=Kintamumo trigeris @@ -1222,8 +1239,9 @@ Channel.INIT=Inicijavimas Channel.USER=Naudotojas Channel.SELF_REGISTRATION=Registracija Channel.RESET_PASSWORD=Iš naujo nustatyti slaptažodį -ArchetypePolicyType.objectTemplateRef=Object template reference +ArchetypePolicyType.objectTemplateRef=Objekto šablono nuoroda ArchetypePolicyType.display=Atvaizdavimas ArchetypePolicyType.conflictResolution=Konfliktų sprendimas -ArchetypePolicyType.lifecycleStateModel=Lifecycle state model -ArchetypePolicyType.applicablePolicies=Applicable policies +ArchetypePolicyType.lifecycleStateModel=Gyvavimo ciklo modelis +ArchetypePolicyType.applicablePolicies=Taikoma politika +ConfigurationType.configurationProperties=Konfigūravimo ypatybės diff --git a/infra/schema/src/main/resources/localization/schema_pl.properties b/infra/schema/src/main/resources/localization/schema_pl.properties index bf178056d00..132e07fb0b0 100644 --- a/infra/schema/src/main/resources/localization/schema_pl.properties +++ b/infra/schema/src/main/resources/localization/schema_pl.properties @@ -331,6 +331,17 @@ GuiObjectListViewType.disableSorting=Zablokuj sortowanie GuiObjectListViewType.action=Akcja GuiObjectListViewsType.default=Domyślnie GuiObjectListViewsType.objectList=Lista obiektów +GuiObjectListViewsType.objectCollectionView=Widok kolekcji obiektów +GuiObjectListViewType.collection=Kolekcja +GuiObjectListViewType.details=Szczegóły +CollectionSpecificationType.collectionRef=Referencja kolekcji +CollectionSpecificationType.depth=Głębokość +CollectionSpecificationType.interpretation=Interpretacja +CollectionSpecificationType.relation=Relacja +UserInterfaceFeatureType.display=Wyświetl +DisplayType.pluralLabel=Etykieta liczby mnogiej +DisplayType.icon=Ikona +IconType.color=Kolor HasAssignmentPolicyConstraintType.targetRef=Cel HasAssignmentPolicyConstraintType.enabled=Aktywuj HasAssignmentPolicyConstraintType.direct=Bezpośredni @@ -623,6 +634,8 @@ RoleManagementConfigurationType.defaultExecuteAfterAllApprovals=Domyślne wykona RoleManagementConfigurationType.autoassignEnabled=Aktywne automatyczne przypisywanie RoleManagementConfigurationType.relations=Relacje SearchBoxConfigurationType.defaultMode=Tryb domyślny +SearchBoxConfigurationType.defaultObjectType=Domyślny typ obiektu +SearchBoxConfigurationType.defaultScope=Domyślny zakres ShadowType.dead=Martwy ShadowType.kind=Rodzaj ShadowType.failedOperationType=Typ nieudanej operacji @@ -742,6 +755,8 @@ ObjectTypes.FORM=Formatka ObjectTypes.CASE=Przypadek ObjectTypes.FUNCTION_LIBRARY=Biblioteka funkcji ObjectTypes.OBJECT_COLLECTION=Kolekcja obiektów +ObjectTypes.ARCHETYPE=Archetyp +ObjectTypes.ASSIGNMENT_HOLDER_TYPE=Typ posiadacza przypisania OrgType.parentOrganization=Organizacja nadrzędna ObjectType.extension=Rozszerzenie FocusType.assignmentKey=Przypisanie @@ -865,6 +880,8 @@ AdminGuiConfigurationType.defaultExportSettings=Domyślne ustawienia eksportu AdminGuiConfigurationType.feature=Funkcjonalność AdminGuiConfigurationType.feedbackMessagesHook=Hak komunikatów zwrotnych AdminGuiConfigurationType.roleManagement=Zarządzanie rolą +AdminGuiConfigurationType.displayFormats=Formaty wyświetlania +AdminGuiConfigurationType.objectCollectionViews=Widoki kolekcji obiektów midPointVersion=${pom.version} midPointRevision=${git.describe} IdempotenceType.CONSERVATIVE=Konserwatywny @@ -1227,3 +1244,4 @@ ArchetypePolicyType.display=Wyświetl ArchetypePolicyType.conflictResolution=Rozwiązywanie konfliktów ArchetypePolicyType.lifecycleStateModel=Model stanu cyklu życia ArchetypePolicyType.applicablePolicies=Możliwe polityki +ConfigurationType.configurationProperties=Właściwości konfiguracyjne diff --git a/infra/schema/src/main/resources/localization/schema_pt_BR.properties b/infra/schema/src/main/resources/localization/schema_pt_BR.properties index 314ce84ce6a..3bde6d71128 100644 --- a/infra/schema/src/main/resources/localization/schema_pt_BR.properties +++ b/infra/schema/src/main/resources/localization/schema_pt_BR.properties @@ -331,6 +331,17 @@ GuiObjectListViewType.disableSorting=Disable sorting GuiObjectListViewType.action=Ação GuiObjectListViewsType.default=Default GuiObjectListViewsType.objectList=Object list +GuiObjectListViewsType.objectCollectionView=Object collection view +GuiObjectListViewType.collection=Collection +GuiObjectListViewType.details=Detalhes +CollectionSpecificationType.collectionRef=Collection ref +CollectionSpecificationType.depth=Depth +CollectionSpecificationType.interpretation=Interpretation +CollectionSpecificationType.relation=Relação +UserInterfaceFeatureType.display=Display +DisplayType.pluralLabel=Plural label +DisplayType.icon=Icon +IconType.color=Cor HasAssignmentPolicyConstraintType.targetRef=Alvo HasAssignmentPolicyConstraintType.enabled=Habilitar HasAssignmentPolicyConstraintType.direct=Direta @@ -623,6 +634,8 @@ RoleManagementConfigurationType.defaultExecuteAfterAllApprovals=Default execute RoleManagementConfigurationType.autoassignEnabled=Autoassign enabled RoleManagementConfigurationType.relations=Relations SearchBoxConfigurationType.defaultMode=Default mode +SearchBoxConfigurationType.defaultObjectType=Default object type +SearchBoxConfigurationType.defaultScope=Default scope ShadowType.dead=Morto ShadowType.kind=Tipo ShadowType.failedOperationType=Tipo de operação falha @@ -742,6 +755,8 @@ ObjectTypes.FORM=Formulário ObjectTypes.CASE=Caso ObjectTypes.FUNCTION_LIBRARY=Function library ObjectTypes.OBJECT_COLLECTION=Object collection +ObjectTypes.ARCHETYPE=Archetype +ObjectTypes.ASSIGNMENT_HOLDER_TYPE=Assignment holder type OrgType.parentOrganization=Organização pai ObjectType.extension=Extensao FocusType.assignmentKey=Atribuição @@ -865,6 +880,8 @@ AdminGuiConfigurationType.defaultExportSettings=Default export settings AdminGuiConfigurationType.feature=Feature AdminGuiConfigurationType.feedbackMessagesHook=Feedback messages hook AdminGuiConfigurationType.roleManagement=Role management +AdminGuiConfigurationType.displayFormats=Display formats +AdminGuiConfigurationType.objectCollectionViews=Object collection views midPointVersion=${pom.version} midPointRevision=${git.describe} IdempotenceType.CONSERVATIVE=Conservador @@ -1227,3 +1244,4 @@ ArchetypePolicyType.display=Display ArchetypePolicyType.conflictResolution=Conflict resolution ArchetypePolicyType.lifecycleStateModel=Lifecycle state model ArchetypePolicyType.applicablePolicies=Applicable policies +ConfigurationType.configurationProperties=Configuration properties diff --git a/infra/schema/src/main/resources/localization/schema_ru.properties b/infra/schema/src/main/resources/localization/schema_ru.properties index c38c86a715d..b2923008882 100644 --- a/infra/schema/src/main/resources/localization/schema_ru.properties +++ b/infra/schema/src/main/resources/localization/schema_ru.properties @@ -331,6 +331,17 @@ GuiObjectListViewType.disableSorting=Disable sorting GuiObjectListViewType.action=Действие GuiObjectListViewsType.default=По умолчанию GuiObjectListViewsType.objectList=Object list +GuiObjectListViewsType.objectCollectionView=Object collection view +GuiObjectListViewType.collection=Collection +GuiObjectListViewType.details=Детали +CollectionSpecificationType.collectionRef=Collection ref +CollectionSpecificationType.depth=Depth +CollectionSpecificationType.interpretation=Interpretation +CollectionSpecificationType.relation=Связь +UserInterfaceFeatureType.display=Display +DisplayType.pluralLabel=Plural label +DisplayType.icon=Icon +IconType.color=Цвет HasAssignmentPolicyConstraintType.targetRef=Целевая система HasAssignmentPolicyConstraintType.enabled=Включить HasAssignmentPolicyConstraintType.direct=Прямой @@ -623,6 +634,8 @@ RoleManagementConfigurationType.defaultExecuteAfterAllApprovals=Default execute RoleManagementConfigurationType.autoassignEnabled=Autoassign enabled RoleManagementConfigurationType.relations=Relations SearchBoxConfigurationType.defaultMode=Default mode +SearchBoxConfigurationType.defaultObjectType=Default object type +SearchBoxConfigurationType.defaultScope=Default scope ShadowType.dead=Неактивный ShadowType.kind=Дочерний элемент ShadowType.failedOperationType=Ошибочный тип операции @@ -742,6 +755,8 @@ ObjectTypes.FORM=Форма ObjectTypes.CASE=Дело ObjectTypes.FUNCTION_LIBRARY=Function library ObjectTypes.OBJECT_COLLECTION=Object collection +ObjectTypes.ARCHETYPE=Archetype +ObjectTypes.ASSIGNMENT_HOLDER_TYPE=Assignment holder type OrgType.parentOrganization=Родительская организация ObjectType.extension=Расширение FocusType.assignmentKey=Назначение @@ -865,6 +880,8 @@ AdminGuiConfigurationType.defaultExportSettings=Default export settings AdminGuiConfigurationType.feature=Feature AdminGuiConfigurationType.feedbackMessagesHook=Feedback messages hook AdminGuiConfigurationType.roleManagement=Role management +AdminGuiConfigurationType.displayFormats=Display formats +AdminGuiConfigurationType.objectCollectionViews=Object collection views midPointVersion=${pom.version} midPointRevision=${git.describe} IdempotenceType.CONSERVATIVE=Консервативный @@ -1227,3 +1244,4 @@ ArchetypePolicyType.display=Display ArchetypePolicyType.conflictResolution=Conflict resolution ArchetypePolicyType.lifecycleStateModel=Lifecycle state model ArchetypePolicyType.applicablePolicies=Applicable policies +ConfigurationType.configurationProperties=Configuration properties diff --git a/infra/schema/src/main/resources/localization/schema_sk.properties b/infra/schema/src/main/resources/localization/schema_sk.properties index 1120737a3b2..30c6b7f1c79 100644 --- a/infra/schema/src/main/resources/localization/schema_sk.properties +++ b/infra/schema/src/main/resources/localization/schema_sk.properties @@ -331,6 +331,17 @@ GuiObjectListViewType.disableSorting=Disable sorting GuiObjectListViewType.action=Akcia GuiObjectListViewsType.default=Predvolené GuiObjectListViewsType.objectList=Object list +GuiObjectListViewsType.objectCollectionView=Object collection view +GuiObjectListViewType.collection=Collection +GuiObjectListViewType.details=Detaily +CollectionSpecificationType.collectionRef=Collection ref +CollectionSpecificationType.depth=Depth +CollectionSpecificationType.interpretation=Interpretation +CollectionSpecificationType.relation=Vzťah +UserInterfaceFeatureType.display=Display +DisplayType.pluralLabel=Plural label +DisplayType.icon=Icon +IconType.color=Color HasAssignmentPolicyConstraintType.targetRef=Cieľ HasAssignmentPolicyConstraintType.enabled=Povoliť HasAssignmentPolicyConstraintType.direct=Priame @@ -623,6 +634,8 @@ RoleManagementConfigurationType.defaultExecuteAfterAllApprovals=Default execute RoleManagementConfigurationType.autoassignEnabled=Autoassign enabled RoleManagementConfigurationType.relations=Relations SearchBoxConfigurationType.defaultMode=Default mode +SearchBoxConfigurationType.defaultObjectType=Default object type +SearchBoxConfigurationType.defaultScope=Default scope ShadowType.dead=Dead ShadowType.kind=Druh ShadowType.failedOperationType=Failed operation type @@ -742,6 +755,8 @@ ObjectTypes.FORM=Form ObjectTypes.CASE=Case ObjectTypes.FUNCTION_LIBRARY=Function library ObjectTypes.OBJECT_COLLECTION=Object collection +ObjectTypes.ARCHETYPE=Archetype +ObjectTypes.ASSIGNMENT_HOLDER_TYPE=Assignment holder type OrgType.parentOrganization=Rodičovská organizácia ObjectType.extension=Rozšírenia FocusType.assignmentKey=Priradenie @@ -865,6 +880,8 @@ AdminGuiConfigurationType.defaultExportSettings=Default export settings AdminGuiConfigurationType.feature=Feature AdminGuiConfigurationType.feedbackMessagesHook=Feedback messages hook AdminGuiConfigurationType.roleManagement=Role management +AdminGuiConfigurationType.displayFormats=Display formats +AdminGuiConfigurationType.objectCollectionViews=Object collection views midPointVersion=${pom.version} midPointRevision=${git.describe} IdempotenceType.CONSERVATIVE=Conservative @@ -1227,3 +1244,4 @@ ArchetypePolicyType.display=Display ArchetypePolicyType.conflictResolution=Conflict resolution ArchetypePolicyType.lifecycleStateModel=Lifecycle state model ArchetypePolicyType.applicablePolicies=Applicable policies +ConfigurationType.configurationProperties=Configuration properties diff --git a/infra/schema/src/main/resources/localization/schema_tr.properties b/infra/schema/src/main/resources/localization/schema_tr.properties index ab86550a1c6..cf74defd3a1 100644 --- a/infra/schema/src/main/resources/localization/schema_tr.properties +++ b/infra/schema/src/main/resources/localization/schema_tr.properties @@ -331,6 +331,17 @@ GuiObjectListViewType.disableSorting=Disable sorting GuiObjectListViewType.action=Eylem GuiObjectListViewsType.default=Varsayılan GuiObjectListViewsType.objectList=Object list +GuiObjectListViewsType.objectCollectionView=Object collection view +GuiObjectListViewType.collection=Collection +GuiObjectListViewType.details=Detaylar +CollectionSpecificationType.collectionRef=Collection ref +CollectionSpecificationType.depth=Depth +CollectionSpecificationType.interpretation=Interpretation +CollectionSpecificationType.relation=İlişki +UserInterfaceFeatureType.display=Display +DisplayType.pluralLabel=Plural label +DisplayType.icon=Icon +IconType.color=Renk HasAssignmentPolicyConstraintType.targetRef=Hedef HasAssignmentPolicyConstraintType.enabled=Aktifleştir HasAssignmentPolicyConstraintType.direct=Doğrudan @@ -623,6 +634,8 @@ RoleManagementConfigurationType.defaultExecuteAfterAllApprovals=Default execute RoleManagementConfigurationType.autoassignEnabled=Autoassign enabled RoleManagementConfigurationType.relations=Relations SearchBoxConfigurationType.defaultMode=Default mode +SearchBoxConfigurationType.defaultObjectType=Default object type +SearchBoxConfigurationType.defaultScope=Default scope ShadowType.dead=Ölü ShadowType.kind=Tür ShadowType.failedOperationType=Başarısız işlem tipi @@ -742,6 +755,8 @@ ObjectTypes.FORM=Biçim ObjectTypes.CASE=Durum ObjectTypes.FUNCTION_LIBRARY=Fonksiyon sözlüğü ObjectTypes.OBJECT_COLLECTION=Nesne Koleksiyonu +ObjectTypes.ARCHETYPE=Archetype +ObjectTypes.ASSIGNMENT_HOLDER_TYPE=Assignment holder type OrgType.parentOrganization=Ana organizasyon ObjectType.extension=Uzantı FocusType.assignmentKey=Atama @@ -865,6 +880,8 @@ AdminGuiConfigurationType.defaultExportSettings=Default export settings AdminGuiConfigurationType.feature=Feature AdminGuiConfigurationType.feedbackMessagesHook=Feedback messages hook AdminGuiConfigurationType.roleManagement=Rol Yönetimi +AdminGuiConfigurationType.displayFormats=Display formats +AdminGuiConfigurationType.objectCollectionViews=Object collection views midPointVersion=${pom.version} midPointRevision=${git.describe} IdempotenceType.CONSERVATIVE=Tutucu @@ -1227,3 +1244,4 @@ ArchetypePolicyType.display=Display ArchetypePolicyType.conflictResolution=Çatışma çözümü ArchetypePolicyType.lifecycleStateModel=Lifecycle state model ArchetypePolicyType.applicablePolicies=Applicable policies +ConfigurationType.configurationProperties=Configuration properties diff --git a/infra/schema/src/main/resources/localization/schema_zh_CN.properties b/infra/schema/src/main/resources/localization/schema_zh_CN.properties index 932648c85cc..13bbf617a21 100644 --- a/infra/schema/src/main/resources/localization/schema_zh_CN.properties +++ b/infra/schema/src/main/resources/localization/schema_zh_CN.properties @@ -331,6 +331,17 @@ GuiObjectListViewType.disableSorting=Disable sorting GuiObjectListViewType.action=操作 GuiObjectListViewsType.default=默认 GuiObjectListViewsType.objectList=Object list +GuiObjectListViewsType.objectCollectionView=Object collection view +GuiObjectListViewType.collection=Collection +GuiObjectListViewType.details=详细信息 +CollectionSpecificationType.collectionRef=Collection ref +CollectionSpecificationType.depth=Depth +CollectionSpecificationType.interpretation=Interpretation +CollectionSpecificationType.relation=关系 +UserInterfaceFeatureType.display=Display +DisplayType.pluralLabel=Plural label +DisplayType.icon=Icon +IconType.color=颜色 HasAssignmentPolicyConstraintType.targetRef=目标 HasAssignmentPolicyConstraintType.enabled=启用 HasAssignmentPolicyConstraintType.direct=直接 @@ -623,6 +634,8 @@ RoleManagementConfigurationType.defaultExecuteAfterAllApprovals=Default execute RoleManagementConfigurationType.autoassignEnabled=Autoassign enabled RoleManagementConfigurationType.relations=Relations SearchBoxConfigurationType.defaultMode=Default mode +SearchBoxConfigurationType.defaultObjectType=Default object type +SearchBoxConfigurationType.defaultScope=Default scope ShadowType.dead=僵死 ShadowType.kind=类型 ShadowType.failedOperationType=失败的操作类型 @@ -742,6 +755,8 @@ ObjectTypes.FORM=表单 ObjectTypes.CASE=场景 ObjectTypes.FUNCTION_LIBRARY=Function library ObjectTypes.OBJECT_COLLECTION=Object collection +ObjectTypes.ARCHETYPE=Archetype +ObjectTypes.ASSIGNMENT_HOLDER_TYPE=Assignment holder type OrgType.parentOrganization=父级组织 ObjectType.extension=扩展 FocusType.assignmentKey=分配 @@ -865,6 +880,8 @@ AdminGuiConfigurationType.defaultExportSettings=Default export settings AdminGuiConfigurationType.feature=Feature AdminGuiConfigurationType.feedbackMessagesHook=Feedback messages hook AdminGuiConfigurationType.roleManagement=Role management +AdminGuiConfigurationType.displayFormats=Display formats +AdminGuiConfigurationType.objectCollectionViews=Object collection views midPointVersion=${pom.version} midPointRevision=${git.describe} IdempotenceType.CONSERVATIVE=保守的 @@ -1227,3 +1244,4 @@ ArchetypePolicyType.display=Display ArchetypePolicyType.conflictResolution=冲突解决规则 ArchetypePolicyType.lifecycleStateModel=Lifecycle state model ArchetypePolicyType.applicablePolicies=Applicable policies +ConfigurationType.configurationProperties=Configuration properties From 064cdd804bba5ac345ecc706bcefa74e55b15028 Mon Sep 17 00:00:00 2001 From: kate Date: Thu, 21 Feb 2019 12:37:53 +0100 Subject: [PATCH 052/224] archetype summary tag panel --- .../web/component/AbstractSummaryPanel.java | 46 +++++++++++++++++-- 1 file changed, 42 insertions(+), 4 deletions(-) diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/AbstractSummaryPanel.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/AbstractSummaryPanel.java index 595ae42d0ba..809dc81ecb6 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/AbstractSummaryPanel.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/AbstractSummaryPanel.java @@ -16,7 +16,6 @@ package com.evolveum.midpoint.web.component; import com.evolveum.midpoint.gui.api.component.BasePanel; -import com.evolveum.midpoint.gui.api.util.ModelServiceLocator; import com.evolveum.midpoint.gui.api.util.WebComponentUtil; import com.evolveum.midpoint.gui.impl.model.FlexibleLabelModel; import com.evolveum.midpoint.prism.Containerable; @@ -68,6 +67,7 @@ public abstract class AbstractSummaryPanel extends Base protected static final String BOX_CSS_CLASS = "col-xs-12 info-box"; protected static final String ICON_BOX_CSS_CLASS = "info-box-icon"; + protected static final String ARCHETYPE_ICON_FONT_SIZE = "font-size: 45px !important;"; protected SummaryPanelSpecificationType configuration; @@ -167,7 +167,12 @@ public boolean isVisible() { Label icon = new Label(ID_ICON, ""); String archetypeIconCssClass = getArchetypeIconCssClass(); - icon.add(new AttributeModifier("class", StringUtils.isNotEmpty(archetypeIconCssClass) ? archetypeIconCssClass : getIconCssClass())); + if (StringUtils.isNotEmpty(archetypeIconCssClass)){ + icon.add(AttributeModifier.append("class", archetypeIconCssClass)); + icon.add(AttributeModifier.append("style", ARCHETYPE_ICON_FONT_SIZE)); + } else { + icon.add(AttributeModifier.append("class", getIconCssClass())); + } icon.add(new VisibleEnableBehaviour() { @Override public boolean isVisible(){ @@ -186,7 +191,12 @@ public boolean isVisible() { iconBox.add(img); tagBox = new RepeatingView(ID_TAG_BOX); - getSummaryTagComponentList().forEach(summaryTag -> { + List> summaryTags = getSummaryTagComponentList(); + + if (getArchetypeSummaryTag() != null){ + summaryTags.add(getArchetypeSummaryTag()); + } + summaryTags.forEach(summaryTag -> { WebMarkupContainer summaryTagPanel = new WebMarkupContainer(tagBox.newChildId()); summaryTagPanel.setOutputMarkupId(true); @@ -196,7 +206,7 @@ public boolean isVisible() { if (getTagBoxCssClass() != null) { tagBox.add(new AttributeModifier("class", getTagBoxCssClass())); } - tagBox.add(new VisibleBehaviour(() -> CollectionUtils.isNotEmpty(getSummaryTagComponentList()))); + tagBox.add(new VisibleBehaviour(() -> CollectionUtils.isNotEmpty(summaryTags))); box.add(tagBox); } @@ -219,6 +229,26 @@ protected List> getSummaryTagComponentList(){ return new ArrayList<>(); } + private SummaryTag getArchetypeSummaryTag(){ + String archetypeIconCssClass = getArchetypeIconCssClass(); + String archetypeIconColor = getArchetypePolicyAdditionalCssClass(); + String archetypeLabel = getArchetypeLabel(); + if (StringUtils.isNotEmpty(archetypeLabel)){ + SummaryTag archetypeSummaryTag = new SummaryTag(ID_SUMMARY_TAG, getModel()) { + private static final long serialVersionUID = 1L; + + @Override + protected void initialize(C object) { + setIconCssClass(archetypeIconCssClass); + setLabel(createStringResource(archetypeLabel).getString()); + setColor(archetypeIconColor); + } + }; + return archetypeSummaryTag; + } + return null; + } + protected void addAdditionalExpressionVariables(ExpressionVariables variables) { } @@ -251,6 +281,14 @@ private String getArchetypePolicyAdditionalCssClass(){ return ""; } + private String getArchetypeLabel(){ + if (getModelObject() instanceof AssignmentHolderType){ + DisplayType displayType = WebComponentUtil.getArchetypePolicyDisplayType((AssignmentHolderType) getModelObject(), getPageBase()); + return displayType == null || displayType.getLabel() == null ? "" : displayType.getLabel().getOrig(); + } + return ""; + } + private String getArchetypeIconCssClass(){ if (getModelObject() instanceof AssignmentHolderType){ DisplayType displayType = WebComponentUtil.getArchetypePolicyDisplayType((AssignmentHolderType) getModelObject(), getPageBase()); From a0d1da30e24dc804c3c43e87c41832a3a8a3e0cf Mon Sep 17 00:00:00 2001 From: Viliam Repan Date: Thu, 21 Feb 2019 20:49:25 +0100 Subject: [PATCH 053/224] moved scripted sql old files to deprecated folder --- .../resources/scriptedsql/TestScript.groovy | 32 ++++++++++++------- .../{ => deprecated}/CreateScript.groovy | 0 .../{ => deprecated}/DeleteScript.groovy | 0 .../RunOnConnectorScript.groovy | 0 .../{ => deprecated}/SchemaScript.groovy | 0 .../{ => deprecated}/SearchScript.groovy | 0 .../{ => deprecated}/SyncScript.groovy | 0 .../{ => deprecated}/UpdateScript.groovy | 0 ...eate-scripted-idm-db-and-tables-sync.mysql | 0 ...create-scripted-idm-db-sync-postgresql.sql | 0 ...te-scripted-idm-tables-sync-postgresql.sql | 0 .../localhost-scriptedsql-advanced-nosync.xml | 0 .../localhost-scriptedsql-advanced-sync.xml | 0 .../localhost-scriptedsql-simple.xml | 0 14 files changed, 20 insertions(+), 12 deletions(-) mode change 100644 => 100755 samples/resources/scriptedsql/TestScript.groovy rename samples/resources/scriptedsql/{ => deprecated}/CreateScript.groovy (100%) rename samples/resources/scriptedsql/{ => deprecated}/DeleteScript.groovy (100%) rename samples/resources/scriptedsql/{ => deprecated}/RunOnConnectorScript.groovy (100%) rename samples/resources/scriptedsql/{ => deprecated}/SchemaScript.groovy (100%) rename samples/resources/scriptedsql/{ => deprecated}/SearchScript.groovy (100%) rename samples/resources/scriptedsql/{ => deprecated}/SyncScript.groovy (100%) rename samples/resources/scriptedsql/{ => deprecated}/UpdateScript.groovy (100%) rename samples/resources/scriptedsql/{ => deprecated}/create-scripted-idm-db-and-tables-sync.mysql (100%) rename samples/resources/scriptedsql/{ => deprecated}/create-scripted-idm-db-sync-postgresql.sql (100%) rename samples/resources/scriptedsql/{ => deprecated}/create-scripted-idm-tables-sync-postgresql.sql (100%) rename samples/resources/scriptedsql/{ => deprecated}/localhost-scriptedsql-advanced-nosync.xml (100%) rename samples/resources/scriptedsql/{ => deprecated}/localhost-scriptedsql-advanced-sync.xml (100%) rename samples/resources/scriptedsql/{ => deprecated}/localhost-scriptedsql-simple.xml (100%) diff --git a/samples/resources/scriptedsql/TestScript.groovy b/samples/resources/scriptedsql/TestScript.groovy old mode 100644 new mode 100755 index bbf96ac901e..7537a9c7a29 --- a/samples/resources/scriptedsql/TestScript.groovy +++ b/samples/resources/scriptedsql/TestScript.groovy @@ -1,11 +1,11 @@ /* - * Copyright (c) 2010-2013 Evolveum + * Copyright (c) 2010-2019 Evolveum * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,18 +13,26 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import groovy.sql.Sql; -import groovy.sql.DataSet; -// Parameters: -// The connector sends the following: -// connection: handler to the SQL connection -// action: a string describing the action ("TEST" here) -// log: a handler to the Log facility +import org.forgerock.openicf.connectors.scriptedsql.ScriptedSQLConfiguration +import org.forgerock.openicf.misc.scriptedcommon.OperationType +import org.identityconnectors.common.logging.Log -log.info("Entering "+action+" Script"); -def sql = new Sql(connection); +import java.sql.Connection -sql.eachRow("select * from Users", { println it.id} ); +def log = log as Log +def operation = operation as OperationType +def connection = connection as Connection +def configuration = configuration as ScriptedSQLConfiguration + +log.info("Entering " + operation + " Script") + +log.info("Using driver: {0} version: {1}", + connection.getMetaData().getDriverName(), + connection.getMetaData().getDriverVersion()) + +Sql sql = new Sql(connection) + +sql.eachRow("SELECT 1", {}) diff --git a/samples/resources/scriptedsql/CreateScript.groovy b/samples/resources/scriptedsql/deprecated/CreateScript.groovy similarity index 100% rename from samples/resources/scriptedsql/CreateScript.groovy rename to samples/resources/scriptedsql/deprecated/CreateScript.groovy diff --git a/samples/resources/scriptedsql/DeleteScript.groovy b/samples/resources/scriptedsql/deprecated/DeleteScript.groovy similarity index 100% rename from samples/resources/scriptedsql/DeleteScript.groovy rename to samples/resources/scriptedsql/deprecated/DeleteScript.groovy diff --git a/samples/resources/scriptedsql/RunOnConnectorScript.groovy b/samples/resources/scriptedsql/deprecated/RunOnConnectorScript.groovy similarity index 100% rename from samples/resources/scriptedsql/RunOnConnectorScript.groovy rename to samples/resources/scriptedsql/deprecated/RunOnConnectorScript.groovy diff --git a/samples/resources/scriptedsql/SchemaScript.groovy b/samples/resources/scriptedsql/deprecated/SchemaScript.groovy similarity index 100% rename from samples/resources/scriptedsql/SchemaScript.groovy rename to samples/resources/scriptedsql/deprecated/SchemaScript.groovy diff --git a/samples/resources/scriptedsql/SearchScript.groovy b/samples/resources/scriptedsql/deprecated/SearchScript.groovy similarity index 100% rename from samples/resources/scriptedsql/SearchScript.groovy rename to samples/resources/scriptedsql/deprecated/SearchScript.groovy diff --git a/samples/resources/scriptedsql/SyncScript.groovy b/samples/resources/scriptedsql/deprecated/SyncScript.groovy similarity index 100% rename from samples/resources/scriptedsql/SyncScript.groovy rename to samples/resources/scriptedsql/deprecated/SyncScript.groovy diff --git a/samples/resources/scriptedsql/UpdateScript.groovy b/samples/resources/scriptedsql/deprecated/UpdateScript.groovy similarity index 100% rename from samples/resources/scriptedsql/UpdateScript.groovy rename to samples/resources/scriptedsql/deprecated/UpdateScript.groovy diff --git a/samples/resources/scriptedsql/create-scripted-idm-db-and-tables-sync.mysql b/samples/resources/scriptedsql/deprecated/create-scripted-idm-db-and-tables-sync.mysql similarity index 100% rename from samples/resources/scriptedsql/create-scripted-idm-db-and-tables-sync.mysql rename to samples/resources/scriptedsql/deprecated/create-scripted-idm-db-and-tables-sync.mysql diff --git a/samples/resources/scriptedsql/create-scripted-idm-db-sync-postgresql.sql b/samples/resources/scriptedsql/deprecated/create-scripted-idm-db-sync-postgresql.sql similarity index 100% rename from samples/resources/scriptedsql/create-scripted-idm-db-sync-postgresql.sql rename to samples/resources/scriptedsql/deprecated/create-scripted-idm-db-sync-postgresql.sql diff --git a/samples/resources/scriptedsql/create-scripted-idm-tables-sync-postgresql.sql b/samples/resources/scriptedsql/deprecated/create-scripted-idm-tables-sync-postgresql.sql similarity index 100% rename from samples/resources/scriptedsql/create-scripted-idm-tables-sync-postgresql.sql rename to samples/resources/scriptedsql/deprecated/create-scripted-idm-tables-sync-postgresql.sql diff --git a/samples/resources/scriptedsql/localhost-scriptedsql-advanced-nosync.xml b/samples/resources/scriptedsql/deprecated/localhost-scriptedsql-advanced-nosync.xml similarity index 100% rename from samples/resources/scriptedsql/localhost-scriptedsql-advanced-nosync.xml rename to samples/resources/scriptedsql/deprecated/localhost-scriptedsql-advanced-nosync.xml diff --git a/samples/resources/scriptedsql/localhost-scriptedsql-advanced-sync.xml b/samples/resources/scriptedsql/deprecated/localhost-scriptedsql-advanced-sync.xml similarity index 100% rename from samples/resources/scriptedsql/localhost-scriptedsql-advanced-sync.xml rename to samples/resources/scriptedsql/deprecated/localhost-scriptedsql-advanced-sync.xml diff --git a/samples/resources/scriptedsql/localhost-scriptedsql-simple.xml b/samples/resources/scriptedsql/deprecated/localhost-scriptedsql-simple.xml similarity index 100% rename from samples/resources/scriptedsql/localhost-scriptedsql-simple.xml rename to samples/resources/scriptedsql/deprecated/localhost-scriptedsql-simple.xml From 34215d737a627a05013e44f58c1783e2cb2a31e7 Mon Sep 17 00:00:00 2001 From: Viliam Repan Date: Thu, 21 Feb 2019 20:49:38 +0100 Subject: [PATCH 054/224] moved scripted sql old files to deprecated folder --- .../scriptedsql/deprecated/TestScript.groovy | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 samples/resources/scriptedsql/deprecated/TestScript.groovy diff --git a/samples/resources/scriptedsql/deprecated/TestScript.groovy b/samples/resources/scriptedsql/deprecated/TestScript.groovy new file mode 100644 index 00000000000..bbf96ac901e --- /dev/null +++ b/samples/resources/scriptedsql/deprecated/TestScript.groovy @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2010-2013 Evolveum + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import groovy.sql.Sql; +import groovy.sql.DataSet; + +// Parameters: +// The connector sends the following: +// connection: handler to the SQL connection +// action: a string describing the action ("TEST" here) +// log: a handler to the Log facility + +log.info("Entering "+action+" Script"); +def sql = new Sql(connection); + +sql.eachRow("select * from Users", { println it.id} ); + + From b236f4f6b73d964b3d728c4e11bccb4fa70fb0e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Va=C5=88=C3=A1=C4=8Dek?= Date: Fri, 22 Feb 2019 09:36:51 +0100 Subject: [PATCH 055/224] adding a tooltip with assignemntParent for indirect assignment column in popup dialog "View direct & indirect assignments" --- .../midpoint/web/page/admin/PageAdminFocus.java | 16 ++++++++-------- .../admin/users/component/AssignmentInfoDto.java | 12 ++++++++++++ .../users/component/AssignmentsInfoDialog.java | 6 ++++++ .../resources/localization/Midpoint.properties | 1 + .../localization/Midpoint_cs.properties | 1 + .../localization/Midpoint_en.properties | 1 + .../model/api/context/EvaluatedConstruction.java | 4 +++- .../impl/lens/EvaluatedConstructionImpl.java | 11 +++++++++-- 8 files changed, 41 insertions(+), 11 deletions(-) diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/PageAdminFocus.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/PageAdminFocus.java index a27d66f937e..39ae9f9f218 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/PageAdminFocus.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/PageAdminFocus.java @@ -19,6 +19,7 @@ import com.evolveum.midpoint.gui.api.util.WebComponentUtil; import com.evolveum.midpoint.gui.api.util.WebModelServiceUtils; import com.evolveum.midpoint.model.api.ModelExecuteOptions; +import com.evolveum.midpoint.model.api.context.AssignmentPath; import com.evolveum.midpoint.model.api.context.EvaluatedAssignment; import com.evolveum.midpoint.model.api.context.EvaluatedAssignmentTarget; import com.evolveum.midpoint.model.api.context.EvaluatedConstruction; @@ -848,16 +849,13 @@ public List showAllAssignmentsPerformed(AjaxRequestTarget aja private AssignmentInfoDto createAssignmentsPreviewDto(EvaluatedAssignmentTarget evaluatedAbstractRole, Task task, OperationResult result) { return createAssignmentsPreviewDto(evaluatedAbstractRole.getTarget(), evaluatedAbstractRole.isDirectlyAssigned(), - evaluatedAbstractRole.getAssignment(), task, result); + evaluatedAbstractRole.getAssignmentPath(), evaluatedAbstractRole.getAssignment(), task, result); } - protected AssignmentInfoDto createAssignmentsPreviewDto(ObjectReferenceType reference, - Task task, OperationResult result) { + protected AssignmentInfoDto createAssignmentsPreviewDto(ObjectReferenceType reference, Task task, OperationResult result) { PrismObject targetObject = WebModelServiceUtils.resolveReferenceNoFetch(reference, PageAdminFocus.this, task, result); - - return createAssignmentsPreviewDto(targetObject, true, - null, task, result); + return createAssignmentsPreviewDto(targetObject, true, null, null, task, result); } protected AssignmentInfoDto createDelegableAssignmentsPreviewDto(AssignmentType assignment, Task task, OperationResult result) { @@ -872,7 +870,7 @@ protected AssignmentInfoDto createDelegableAssignmentsPreviewDto(AssignmentType isDelegable = targetObject.asObjectable().isDelegable(); } if (Boolean.TRUE.equals(isDelegable)) { - return createAssignmentsPreviewDto(targetObject, true, assignment, task, result); + return createAssignmentsPreviewDto(targetObject, true, null, assignment, task, result); } } } @@ -880,7 +878,7 @@ protected AssignmentInfoDto createDelegableAssignmentsPreviewDto(AssignmentType } private AssignmentInfoDto createAssignmentsPreviewDto(PrismObject targetObject, - boolean isDirectlyAssigned, AssignmentType assignment, + boolean isDirectlyAssigned, AssignmentPath assignmentPath, AssignmentType assignment, Task task, OperationResult result) { AssignmentInfoDto dto = new AssignmentInfoDto(); dto.setTargetOid(targetObject.getOid()); @@ -889,6 +887,7 @@ private AssignmentInfoDto createAssignmentsPreviewDto(PrismObject implements private String targetDescription; private Class targetClass; private boolean direct; // true if directly assigned; used only in some contexts + private ObjectType assignmentParent; private QName targetType; // for resource assignments private ShadowKindType kind; @@ -107,6 +109,16 @@ public void setDirect(boolean direct) { this.direct = direct; } + public void setAssignmentParent(AssignmentPath assignmentPath) { + if (assignmentPath.size() > 1 ) { + assignmentParent = assignmentPath.last().getSource(); + } + } + + public ObjectType getAssignmentParent() { + return assignmentParent; + } + public ShadowKindType getKind() { return kind; } diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/users/component/AssignmentsInfoDialog.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/users/component/AssignmentsInfoDialog.java index 7a20c6a0892..c4044c908ba 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/users/component/AssignmentsInfoDialog.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/users/component/AssignmentsInfoDialog.java @@ -33,6 +33,7 @@ import com.evolveum.midpoint.web.page.admin.users.PageOrgUnit; import com.evolveum.midpoint.web.util.ObjectTypeGuiDescriptor; import com.evolveum.midpoint.web.util.OnePageParameterEncoder; +import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType;; import com.evolveum.midpoint.xml.ns._public.common.common_3.OrgType; import com.evolveum.midpoint.xml.ns._public.common.common_3.ResourceType; import com.evolveum.midpoint.xml.ns._public.common.common_3.RoleType; @@ -54,6 +55,7 @@ import java.util.ArrayList; import java.util.List; import java.util.stream.Collectors; +import org.apache.wicket.AttributeModifier; /** * Abstract superclass for dialogs that display a list of assignments. @@ -155,6 +157,10 @@ public String getObject() { createStringResource("AssignmentPreviewDialog.type.indirect").getString(); } })); + ObjectType assignmentParent = rowModel.getObject().getAssignmentParent(); + if (assignmentParent != null) { + cellItem.add(AttributeModifier.replace("title", createStringResource("AssignmentPreviewDialog.tooltip.indirect.parent").getString() + ": " + assignmentParent.getName())); + } } }); } diff --git a/gui/admin-gui/src/main/resources/localization/Midpoint.properties b/gui/admin-gui/src/main/resources/localization/Midpoint.properties index ab21e53a0b7..3d2b6ace63d 100755 --- a/gui/admin-gui/src/main/resources/localization/Midpoint.properties +++ b/gui/admin-gui/src/main/resources/localization/Midpoint.properties @@ -110,6 +110,7 @@ AssignmentPreviewDialog.label=View direct & indirect assignments AssignmentPreviewDialog.delegationPreviewLabel=Limit privileges AssignmentPreviewDialog.type.direct=Direct AssignmentPreviewDialog.type.indirect=Indirect +AssignmentPreviewDialog.tooltip.indirect.parent=Parent AssignmentTablePanel.menu.assign=Assign AssignmentTablePanel.menu.assignOrg=Assign Org. AssignmentTablePanel.menu.assignOrg.noorgs=No organization structure defined. diff --git a/gui/admin-gui/src/main/resources/localization/Midpoint_cs.properties b/gui/admin-gui/src/main/resources/localization/Midpoint_cs.properties index 369b3b26cf7..f55b11e8182 100644 --- a/gui/admin-gui/src/main/resources/localization/Midpoint_cs.properties +++ b/gui/admin-gui/src/main/resources/localization/Midpoint_cs.properties @@ -110,6 +110,7 @@ AssignmentPreviewDialog.label=Zobrazit přímá i nepřímá přiřazení AssignmentPreviewDialog.delegationPreviewLabel=Omezit výsady AssignmentPreviewDialog.type.direct=Přímé AssignmentPreviewDialog.type.indirect=Nepřímé +AssignmentPreviewDialog.tooltip.indirect.parent=Předchůdce AssignmentTablePanel.menu.assign=Přidat přiřazení AssignmentTablePanel.menu.assignOrg=Přiřadit organizaci AssignmentTablePanel.menu.assignOrg.noorgs=Organizační struktura není definovaná. diff --git a/gui/admin-gui/src/main/resources/localization/Midpoint_en.properties b/gui/admin-gui/src/main/resources/localization/Midpoint_en.properties index 77de9d5eb90..4fe0b069fee 100644 --- a/gui/admin-gui/src/main/resources/localization/Midpoint_en.properties +++ b/gui/admin-gui/src/main/resources/localization/Midpoint_en.properties @@ -110,6 +110,7 @@ AssignmentPreviewDialog.label=View direct & indirect assignments AssignmentPreviewDialog.delegationPreviewLabel=Limit privileges AssignmentPreviewDialog.type.direct=Direct AssignmentPreviewDialog.type.indirect=Indirect +AssignmentPreviewDialog.tooltip.indirect.parent=Parent AssignmentTablePanel.menu.assign=Assign AssignmentTablePanel.menu.assignOrg=Assign Org. AssignmentTablePanel.menu.assignOrg.noorgs=No organization structure defined. diff --git a/model/model-api/src/main/java/com/evolveum/midpoint/model/api/context/EvaluatedConstruction.java b/model/model-api/src/main/java/com/evolveum/midpoint/model/api/context/EvaluatedConstruction.java index d41b8e2ff4b..d107b6b21aa 100644 --- a/model/model-api/src/main/java/com/evolveum/midpoint/model/api/context/EvaluatedConstruction.java +++ b/model/model-api/src/main/java/com/evolveum/midpoint/model/api/context/EvaluatedConstruction.java @@ -33,6 +33,8 @@ public interface EvaluatedConstruction extends DebugDumpable { String getIntent(); boolean isDirectlyAssigned(); - + + AssignmentPath getAssignmentPath(); + boolean isWeak(); } diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/EvaluatedConstructionImpl.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/EvaluatedConstructionImpl.java index 39c77e6b3ba..58576703d78 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/EvaluatedConstructionImpl.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/EvaluatedConstructionImpl.java @@ -16,6 +16,7 @@ package com.evolveum.midpoint.model.impl.lens; +import com.evolveum.midpoint.model.api.context.AssignmentPath; import com.evolveum.midpoint.model.api.context.EvaluatedConstruction; import com.evolveum.midpoint.prism.PrismObject; import com.evolveum.midpoint.schema.result.OperationResult; @@ -24,7 +25,6 @@ import com.evolveum.midpoint.util.exception.ObjectNotFoundException; import com.evolveum.midpoint.util.exception.SchemaException; import com.evolveum.midpoint.xml.ns._public.common.common_3.AssignmentHolderType; -import com.evolveum.midpoint.xml.ns._public.common.common_3.FocusType; import com.evolveum.midpoint.xml.ns._public.common.common_3.ResourceType; import com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowKindType; @@ -37,13 +37,15 @@ public class EvaluatedConstructionImpl implements EvaluatedConstruction { final private ShadowKindType kind; final private String intent; final private boolean directlyAssigned; + final private AssignmentPath assignmentPath; final private boolean weak; public EvaluatedConstructionImpl(Construction construction, Task task, OperationResult result) throws SchemaException, ObjectNotFoundException { resource = construction.getResource(task, result).asPrismObject(); kind = construction.getKind(); intent = construction.getIntent(); - directlyAssigned = construction.getAssignmentPath() == null || construction.getAssignmentPath().size() == 1; + assignmentPath = construction.getAssignmentPath(); + directlyAssigned = assignmentPath == null || assignmentPath.size() == 1; weak = construction.isWeak(); } @@ -67,6 +69,11 @@ public boolean isDirectlyAssigned() { return directlyAssigned; } + @Override + public AssignmentPath getAssignmentPath() { + return assignmentPath; + } + @Override public boolean isWeak() { return weak; From 3ba4f5730435a283662c8afc2339ee000e65dfcc Mon Sep 17 00:00:00 2001 From: kate Date: Fri, 22 Feb 2019 10:31:41 +0100 Subject: [PATCH 056/224] data protection panel fix --- .../api/component/AbstractPopupTabPanel.java | 15 ++++-- .../gui/api/component/AssignmentPopup.java | 15 ++++++ .../component/assignment/AssignmentPanel.java | 9 ++++ .../GenericAbstractRoleAssignmentPanel.java | 25 +++++++++ .../assignment/SwitchAssignmentTypePanel.html | 1 + .../assignment/SwitchAssignmentTypePanel.java | 32 ++++++++++++ .../objectdetails/FocusMainPanel.java | 51 ------------------- 7 files changed, 94 insertions(+), 54 deletions(-) diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/gui/api/component/AbstractPopupTabPanel.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/gui/api/component/AbstractPopupTabPanel.java index ada1796ebb2..057c63a6d15 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/gui/api/component/AbstractPopupTabPanel.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/gui/api/component/AbstractPopupTabPanel.java @@ -92,6 +92,9 @@ protected IModel getCheckBoxEnableModel(IModel> rowMo @Override protected ObjectQuery addFilterToContentQuery(ObjectQuery query) { ObjectQuery queryWithFilters = AbstractPopupTabPanel.this.addFilterToContentQuery(query); + if (queryWithFilters == null){ + queryWithFilters = getPrismContext().queryFactory().createQuery(); + } List archetypeRefList = getArchetypeRefList(); if (!CollectionUtils.isEmpty(archetypeRefList)){ List archetypeRefFilterList = new ArrayList<>(); @@ -105,14 +108,16 @@ protected ObjectQuery addFilterToContentQuery(ObjectQuery query) { archetypeRefFilterList.add(filter); } if (!CollectionUtils.isEmpty(archetypeRefFilterList)){ - if (queryWithFilters == null){ - queryWithFilters = getPrismContext().queryFactory().createQuery(); - } OrFilter archetypeRefOrFilter = AbstractPopupTabPanel.this.getPageBase().getPrismContext().queryFactory().createOr(archetypeRefFilterList); queryWithFilters.addFilter(archetypeRefOrFilter); } } + + ObjectFilter subTypeFilter = getSubtypeFilter(); + if (subTypeFilter != null){ + queryWithFilters.addFilter(subTypeFilter); + } return queryWithFilters; } @@ -160,6 +165,10 @@ protected List getArchetypeRefList(){ return null; } + protected ObjectFilter getSubtypeFilter(){ + return null; + } + protected boolean isObjectListPanelVisible(){ return true; } diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/gui/api/component/AssignmentPopup.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/gui/api/component/AssignmentPopup.java index ae9709d2826..f4389b1d155 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/gui/api/component/AssignmentPopup.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/gui/api/component/AssignmentPopup.java @@ -19,6 +19,7 @@ import com.evolveum.midpoint.gui.api.model.LoadableModel; import com.evolveum.midpoint.gui.api.util.WebComponentUtil; import com.evolveum.midpoint.prism.PrismObject; +import com.evolveum.midpoint.prism.query.ObjectFilter; import com.evolveum.midpoint.schema.constants.ObjectTypes; import com.evolveum.midpoint.web.component.AjaxButton; import com.evolveum.midpoint.web.component.TabbedPanel; @@ -201,6 +202,11 @@ protected QName getPredefinedRelation() { protected List getArchetypeRefList(){ return AssignmentPopup.this.getArchetypeRefList(); } + + @Override + protected ObjectFilter getSubtypeFilter(){ + return AssignmentPopup.this.getSubtypeFilter(); + } }; } @@ -246,6 +252,11 @@ protected QName getPredefinedRelation() { protected List getArchetypeRefList(){ return AssignmentPopup.this.getArchetypeRefList(); } + + @Override + protected ObjectFilter getSubtypeFilter(){ + return AssignmentPopup.this.getSubtypeFilter(); + } }; } @@ -345,6 +356,10 @@ protected List getArchetypeRefList(){ return null; } + protected ObjectFilter getSubtypeFilter(){ + return null; + } + private boolean isTabVisible(ObjectTypes objectType){ List availableObjectTypesList = getAvailableObjectTypesList(); return availableObjectTypesList == null || availableObjectTypesList.size() == 0 || availableObjectTypesList.contains(objectType); diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/assignment/AssignmentPanel.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/assignment/AssignmentPanel.java index 3c611c552cd..3551b96d040 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/assignment/AssignmentPanel.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/assignment/AssignmentPanel.java @@ -422,6 +422,11 @@ protected List getArchetypeRefList(){ return assignmentTargetRelation != null ? assignmentTargetRelation.getArchetypeRefs() : null; } + @Override + protected ObjectFilter getSubtypeFilter(){ + return AssignmentPanel.this.getSubtypeFilter(); + } + @Override protected boolean isEntitlementAssignment(){ return AssignmentPanel.this.isEntitlementAssignment(); @@ -936,4 +941,8 @@ protected boolean isAssignmentsLimitReached(int selectedAssignmentsCount, boolea return actionPerformed ? (changedItems + selectedAssignmentsCount) > assignmentsRequestsLimit : (changedItems + selectedAssignmentsCount) >= assignmentsRequestsLimit; } + + protected ObjectFilter getSubtypeFilter(){ + return null; + } } diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/assignment/GenericAbstractRoleAssignmentPanel.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/assignment/GenericAbstractRoleAssignmentPanel.java index b6b8e889ad6..1f2712f188b 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/assignment/GenericAbstractRoleAssignmentPanel.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/assignment/GenericAbstractRoleAssignmentPanel.java @@ -16,10 +16,17 @@ package com.evolveum.midpoint.web.component.assignment; import java.util.ArrayList; +import java.util.Collection; import java.util.Iterator; import java.util.List; +import com.evolveum.midpoint.prism.PrismConstants; +import com.evolveum.midpoint.prism.query.ObjectFilter; +import com.evolveum.midpoint.prism.query.ObjectQuery; +import com.evolveum.midpoint.prism.query.RefFilter; import com.evolveum.midpoint.schema.util.FocusTypeUtil; +import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectReferenceType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.RelationKindType; import org.apache.wicket.model.IModel; import com.evolveum.midpoint.gui.api.util.WebModelServiceUtils; @@ -71,4 +78,22 @@ protected List> customPostSearch(List
+
diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/assignment/SwitchAssignmentTypePanel.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/assignment/SwitchAssignmentTypePanel.java index 532c769cb3f..fca0aa6dad8 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/assignment/SwitchAssignmentTypePanel.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/assignment/SwitchAssignmentTypePanel.java @@ -18,6 +18,7 @@ import com.evolveum.midpoint.gui.api.component.BasePanel; import com.evolveum.midpoint.gui.api.model.LoadableModel; import com.evolveum.midpoint.gui.api.util.WebComponentUtil; +import com.evolveum.midpoint.gui.api.util.WebModelServiceUtils; import com.evolveum.midpoint.prism.PrismObject; import com.evolveum.midpoint.prism.query.ObjectFilter; import com.evolveum.midpoint.prism.query.ObjectQuery; @@ -65,6 +66,7 @@ public class SwitchAssignmentTypePanel extends BasePanel + WebModelServiceUtils.isEnableExperimentalFeature(SwitchAssignmentTypePanel.this.getPageBase()))); + buttonsContainer.add(dataProtectionButton); + AjaxButton entitlementAssignmentsButton = new AjaxButton(ID_ENTITLEMENT_ASSIGNMENTS, createStringResource("AbstractRoleMainPanel.inducedEntitlements")) { private static final long serialVersionUID = 1L; diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/objectdetails/FocusMainPanel.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/objectdetails/FocusMainPanel.java index 1febd3f4999..434573533ad 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/objectdetails/FocusMainPanel.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/objectdetails/FocusMainPanel.java @@ -209,18 +209,6 @@ protected WebMarkupContainer createFocusAssignmentsTabPanel(String panelId, Page assignmentsTabPanel = new FocusAssignmentsTabPanel<>(panelId, getMainForm(), getObjectModel(), parentPage); return assignmentsTabPanel; } - -// protected WebMarkupContainer createFocusDataProtectionTabPanel(String panelId, PageAdminObjectDetails parentPage) { -// assignmentsTabPanel = new FocusAssignmentsTabPanel(panelId, getMainForm(), getObjectModel(), parentPage) { -// -// @Override -// protected SwitchAssignmentTypePanel createPanel(String panelId, ContainerWrapperFromObjectWrapperModel model) { -// return new GenericAbstractRoleAssignmentPanel(panelId, model); -// } -// -// }; -// return assignmentsTabPanel; -// } protected WebMarkupContainer createObjectHistoryTabPanel(String panelId, PageAdminObjectDetails parentPage) { return new ObjectHistoryTabPanel(panelId, getMainForm(), getObjectModel(), parentPage){ @@ -294,45 +282,6 @@ public String getCount() { return Integer.toString(countAssignments()); } }); - - authorization = new FocusTabVisibleBehavior<>(unwrapModel(), ComponentConstants.UI_FOCUS_TAB_ASSIGNMENTS_URL, false, isFocusHistoryPage(), parentPage); - - if (WebModelServiceUtils.isEnableExperimentalFeature(parentPage)) { -// tabs.add(new CountablePanelTab(parentPage.createStringResource("pageAdminFocus.dataProtection"), authorization) { -// -// private static final long serialVersionUID = 1L; -// -// @Override -// public WebMarkupContainer createPanel(String panelId) { -// return createFocusDataProtectionTabPanel(panelId, parentPage); -// } -// -// @Override -// public String getCount() { -// PrismObject focus = getObjectModel().getObject().getObject(); -// List assignments = focus.asObjectable().getAssignment(); -// int count = 0; -// for (AssignmentType assignment : assignments) { -// if (assignment.getTargetRef() == null) { -// continue; -// } -// if (QNameUtil.match(assignment.getTargetRef().getType(), OrgType.COMPLEX_TYPE)) { -// Task task = parentPage.createSimpleTask("load data protection obejcts"); -// PrismObject org = WebModelServiceUtils.loadObject(assignment.getTargetRef(), parentPage, -// task, task.getResult()); -// -// if (org != null) { -// if (FocusTypeUtil.determineSubTypes(org).contains("access")) { -// count++; -// } -// } -// } -// } -// -// return String.valueOf(count); -// } -// }); - } if (WebComponentUtil.isAuthorized(ModelAuthorizationAction.AUDIT_READ.getUrl()) && getObjectWrapper().getStatus() != ContainerStatus.ADDING){ authorization = new FocusTabVisibleBehavior<>(unwrapModel(), ComponentConstants.UI_FOCUS_TAB_OBJECT_HISTORY_URL, false, isFocusHistoryPage(), parentPage); From ede8085af63fe04c5afade57c0f3dd38caccc6e0 Mon Sep 17 00:00:00 2001 From: Viliam Repan Date: Fri, 22 Feb 2019 11:58:12 +0100 Subject: [PATCH 057/224] samples for new scripted connector, not finished yet --- .../resources/scriptedsql/BaseScript.groovy | 17 ++ .../resources/scriptedsql/CreateScript.groovy | 80 +++++++++ .../resources/scriptedsql/SchemaScript.groovy | 50 ++++++ .../resources/scriptedsql/SearchScript.groovy | 158 ++++++++++++++++++ 4 files changed, 305 insertions(+) create mode 100644 samples/resources/scriptedsql/BaseScript.groovy create mode 100644 samples/resources/scriptedsql/CreateScript.groovy create mode 100755 samples/resources/scriptedsql/SchemaScript.groovy create mode 100755 samples/resources/scriptedsql/SearchScript.groovy diff --git a/samples/resources/scriptedsql/BaseScript.groovy b/samples/resources/scriptedsql/BaseScript.groovy new file mode 100644 index 00000000000..f6039286bf3 --- /dev/null +++ b/samples/resources/scriptedsql/BaseScript.groovy @@ -0,0 +1,17 @@ +import org.identityconnectors.framework.common.objects.ObjectClass + +class BaseScript extends Script { + + public static final String GROUP_NAME = "Group" + + public static final ObjectClass GROUP = new ObjectClass(BaseScript.GROUP_NAME) + + public static final String ORGANIZATION_NAME = "Organization" + + public static final ObjectClass ORGANIZATION = new ObjectClass(BaseScript.ORGANIZATION_NAME) + + @Override + Object run() { + return null + } +} \ No newline at end of file diff --git a/samples/resources/scriptedsql/CreateScript.groovy b/samples/resources/scriptedsql/CreateScript.groovy new file mode 100644 index 00000000000..57045bf7654 --- /dev/null +++ b/samples/resources/scriptedsql/CreateScript.groovy @@ -0,0 +1,80 @@ +import groovy.sql.Sql +import org.forgerock.openicf.connectors.scriptedsql.ScriptedSQLConfiguration +import org.forgerock.openicf.misc.scriptedcommon.OperationType +import org.identityconnectors.common.logging.Log +import org.identityconnectors.framework.common.exceptions.ConnectorException +import org.identityconnectors.framework.common.objects.Attribute +import org.identityconnectors.framework.common.objects.ObjectClass +import org.identityconnectors.framework.common.objects.OperationOptions +import org.identityconnectors.framework.common.objects.Uid +import org.identityconnectors.framework.common.objects.AttributeUtil + +import java.sql.Connection + +def log = log as Log +def operation = operation as OperationType +def options = options as OperationOptions +def objectClass = objectClass as ObjectClass +def attributes = attributes as Set +def connection = connection as Connection +def id = id as String +def configuration = configuration as ScriptedSQLConfiguration + +log.info("Entering " + operation + " Script") + +def sql = new Sql(connection) + +switch (objectClass) { + case ObjectClass.ACCOUNT: + return handleAccount(sql) + case BaseScript.GROUP: + return handleGroup(sql) + case BaseScript.ORGANIZATION: + return handleOrganization(sql) + default: + throw new ConnectorException("Unknown object class " + objectClass) +} + +Uid handleAccount(Sql sql) { + def keys = sql.executeInsert("INSERT INTO Users (login, firstname,lastname,fullname,email,organization,password,disabled) values (?,?,?,?,?,?,?,?)", + [ + id, + AttributeUtil.getSingleValue("firstname"), + AttributeUtil.getSingleValue("lastname"), + AttributeUtil.getSingleValue("fullname"), + AttributeUtil.getSingleValue("email"), + AttributeUtil.getSingleValue("organization"), + // decrypt password + SecurityUtil.decrypt(AttributeUtil.getPasswordValue(attributes)), + // negate __ENABLE__ attribute + !(AttributeUtil.getSingleValue("__ENABLE__") as Boolean) + + //attributes.get("firstname") ? attributes.get("firstname").get(0) : "", + //attributes.get("lastname") ? attributes.get("lastname").get(0) : "", + //attributes.get("fullname") ? attributes.get("fullname").get(0) : "", + //attributes.get("email") ? attributes.get("email").get(0) : "", + //attributes.get("organization") ? attributes.get("organization").get(0) : "" + ]) + + return new Uid(keys[0][0]) +} + +Uid handleGroup(Sql sql) { + def keys = sql.executeInsert("INSERT INTO Groups (name,description) values (?,?)", + [ + id, + AttributeUtil.getSingleValue("description") + ]) + + return new Uid(keys[0][0]) +} + +Uid handleOrganization(Sql sql) { + def keys = sql.executeInsert("INSERT INTO Organizations (name,description) values (?,?)", + [ + id, + AttributeUtil.getSingleValue("description") + ]) + + return new Uid(keys[0][0]) +} \ No newline at end of file diff --git a/samples/resources/scriptedsql/SchemaScript.groovy b/samples/resources/scriptedsql/SchemaScript.groovy new file mode 100755 index 00000000000..80abd13c197 --- /dev/null +++ b/samples/resources/scriptedsql/SchemaScript.groovy @@ -0,0 +1,50 @@ +import org.forgerock.openicf.connectors.scriptedsql.ScriptedSQLConfiguration +import org.forgerock.openicf.misc.scriptedcommon.ICFObjectBuilder +import org.forgerock.openicf.misc.scriptedcommon.OperationType +import org.identityconnectors.common.logging.Log +import org.identityconnectors.framework.common.objects.ObjectClass +import org.identityconnectors.framework.common.objects.OperationOptionInfoBuilder +import org.identityconnectors.framework.spi.operations.SearchOp +import org.identityconnectors.framework.common.objects.OperationalAttributeInfos + +import static org.identityconnectors.framework.common.objects.AttributeInfo.Flags.MULTIVALUED + +def log = log as Log +def operation = operation as OperationType +def builder = builder as ICFObjectBuilder +def configuration = configuration as ScriptedSQLConfiguration + +log.info("Entering " + operation + " Script") + +builder.schema({ + objectClass { + type ObjectClass.ACCOUNT_NAME + attributes { + firstname() + lastname() + fullname() + email() + organization() + OperationalAttributeInfos.ENABLE + OperationalAttributeInfos.PASSWORD + OperationalAttributeInfos.LOCK_OUT + } + } + objectClass { + type BaseScript.GROUP + attributes { + name String.class, MULTIVALUED + description() + } + } + objectClass { + type BaseScript.ORGANIZATION + attributes { + name() + description() + } + } + + defineOperationOption OperationOptionInfoBuilder.buildPagedResultsOffset(), SearchOp + defineOperationOption OperationOptionInfoBuilder.buildPageSize(), SearchOp +}) \ No newline at end of file diff --git a/samples/resources/scriptedsql/SearchScript.groovy b/samples/resources/scriptedsql/SearchScript.groovy new file mode 100755 index 00000000000..abcb01700e5 --- /dev/null +++ b/samples/resources/scriptedsql/SearchScript.groovy @@ -0,0 +1,158 @@ +import groovy.sql.Sql +import org.forgerock.openicf.connectors.scriptedsql.ScriptedSQLConfiguration +import org.forgerock.openicf.misc.scriptedcommon.ICFObjectBuilder +import org.forgerock.openicf.misc.scriptedcommon.MapFilterVisitor +import org.forgerock.openicf.misc.scriptedcommon.OperationType +import org.identityconnectors.common.logging.Log +import org.identityconnectors.framework.common.exceptions.ConnectorException +import org.identityconnectors.framework.common.objects.ObjectClass +import org.identityconnectors.framework.common.objects.OperationOptions +import org.identityconnectors.framework.common.objects.ResultsHandler +import org.identityconnectors.framework.common.objects.SearchResult +import org.identityconnectors.framework.common.objects.filter.Filter + +import java.sql.Connection + +def log = log as Log +def operation = operation as OperationType +def options = options as OperationOptions +def objectClass = objectClass as ObjectClass +def configuration = configuration as ScriptedSQLConfiguration +def filter = filter as Filter +def connection = connection as Connection +def query = query as Closure +def handler = handler as ResultsHandler + +log.info("Entering " + operation + " Script") + +def sql = new Sql(connection) + +switch (objectClass) { + case ObjectClass.ACCOUNT: + handleAccount(sql) + break + case BaseScript.GROUP: + handleGroup(sql) + break + case BaseScript.ORGANIZATION: + handleOrganization(sql) + break + default: + throw new ConnectorException("Unknown object class " + objectClass) +} + +return new SearchResult() + +// ================================================================================= + +void handleAccount(Sql sql) { + Closure closure = { row -> + ICFObjectBuilder.co { + uid row.id as String + id row.login + attribute '__ENABLE__', !row.disabled + attribute 'fullname', row.fullname + attribute 'firstname', row.firstname + attribute 'lastname', row.lastname + attribute 'email', row.email + attribute 'organization', row.organization + } + } + + Map params = [:] + String where = buildWhereClause(filter, params, 'id', 'login') + + sql.eachRow(params, "SELECT * FROM Users " + where, closure); +} + + +void handleGroup(Sql sql) { + Closure closure = { row -> + ICFObjectBuilder.co { + uid row.id as String + id row.name + attribute 'description', row.description + } + } + + Map params = [:] + String where = buildWhereClause(filter, params, 'id', 'name') + + sql.eachRow(params, "SELECT * FROM Groups " + where, closure) +} + +void handleOrganization(Sql sql) { + Closure closure = { row -> + ICFObjectBuilder.co { + uid row.id as String + id row.name + attribute 'description', row.description + } + } + + Map params = [:] + String where = buildWhereClause(filter, params, 'id', 'name') + + sql.eachRow(params, "SELECT * FROM Organizations " + where, closure) +} + +static String buildWhereClause(Filter filter, Map sqlParams, String uidColumn, String nameColumn) { + if (filter == null) { + log.info("Returning empty where clause") + return "" + } + + Map query = filter.accept(MapFilterVisitor.INSTANCE, null) + + log.info("Building where clause, query {0}, uidcolumn {1}, nameColumn {2}", query, uidColumn, nameColumn) + + String columnName = uidColumn.replaceFirst("[\\w]+\\.", "") + + String left = query.get("left") + if (Uid.NAME.equals(left)) { + left = uidColumn + } else if (Name.NAME.equals(left)) { + left = nameColumn + } + + String right = query.get("right") + + String operation = query.get("operation") + switch (operation) { + case "CONTAINS": + right = '%' + right + '%' + break; + case "ENDSWITH": + right = '%' + right + break; + case "STARTSWITH": + right = right + '%' + break; + } + + sqlParams.put(columnName, right) + right = ":" + columnName + + def engine = new groovy.text.SimpleTemplateEngine() + + def whereTemplates = [ + CONTAINS : ' $left ${not ? "not " : ""}like $right', + ENDSWITH : ' $left ${not ? "not " : ""}like $right', + STARTSWITH : ' $left ${not ? "not " : ""}like $right', + EQUALS : ' $left ${not ? "<>" : "="} $right', + GREATERTHAN : ' $left ${not ? "<=" : ">"} $right', + GREATERTHANOREQUAL: ' $left ${not ? "<" : ">="} $right', + LESSTHAN : ' $left ${not ? ">=" : "<"} $right', + LESSTHANOREQUAL : ' $left ${not ? ">" : "<="} $right' + ] + + def wt = whereTemplates.get(operation) + def binding = [left: left, right: right, not: query.get("not")] + def template = engine.createTemplate(wt).make(binding) + def where = template.toString() + + log.info("Where clause: {0}, with parameters {1}", where, sqlParams) + + return where +} + From b74a747861a18f67631c11ebe7537abb88ab4d42 Mon Sep 17 00:00:00 2001 From: kate Date: Fri, 22 Feb 2019 16:03:12 +0100 Subject: [PATCH 058/224] hiding archetype assignments on the assignments tab --- .../assignment/AbstractRoleAssignmentPanel.java | 2 +- .../component/assignment/AssignmentPanel.java | 17 ++++++++++++++++- .../component/assignment/AssignmentsUtil.java | 5 +++++ .../component/objectdetails/FocusMainPanel.java | 2 +- 4 files changed, 23 insertions(+), 3 deletions(-) diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/assignment/AbstractRoleAssignmentPanel.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/assignment/AbstractRoleAssignmentPanel.java index a47a958b2e9..8f379195c85 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/assignment/AbstractRoleAssignmentPanel.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/assignment/AbstractRoleAssignmentPanel.java @@ -200,7 +200,7 @@ protected ObjectQuery createObjectQuery() { RefFilter targetRefFilter = null; if (targetType != null){ ObjectReferenceType ort = new ObjectReferenceType(); - ort.setType(getAssignmentType()); + ort.setType(targetType); ort.setRelation(new QName(PrismConstants.NS_QUERY, "any")); targetRefFilter = (RefFilter) getParentPage().getPrismContext().queryFor(AssignmentType.class) .item(AssignmentType.F_TARGET_REF) diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/assignment/AssignmentPanel.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/assignment/AssignmentPanel.java index 3551b96d040..eb774d36e60 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/assignment/AssignmentPanel.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/assignment/AssignmentPanel.java @@ -280,11 +280,26 @@ protected boolean isNewObjectButtonVisible(PrismObject focusObject){ protected ObjectQuery createObjectQuery(){ Collection delegationRelations = getParentPage().getRelationRegistry() .getAllRelationsFor(RelationKindType.DELEGATION); - return getParentPage().getPrismContext().queryFor(AssignmentType.class) + + + //do not show archetype assignments + ObjectReferenceType archetypeRef = new ObjectReferenceType(); + archetypeRef.setType(ArchetypeType.COMPLEX_TYPE); + archetypeRef.setRelation(new QName(PrismConstants.NS_QUERY, "any")); + RefFilter archetypeFilter = (RefFilter) getParentPage().getPrismContext().queryFor(AssignmentType.class) + .item(AssignmentType.F_TARGET_REF) + .ref(archetypeRef.asReferenceValue()) + .buildFilter(); + archetypeFilter.setOidNullAsAny(true); + archetypeFilter.setRelationNullAsAny(true); + + ObjectQuery query = getParentPage().getPrismContext().queryFor(AssignmentType.class) .not() .item(AssignmentType.F_TARGET_REF) .ref(delegationRelations.toArray(new QName[0])) .build(); + query.addFilter(getPrismContext().queryFactory().createNot(archetypeFilter)); + return query; } protected void cancelAssignmentDetailsPerformed(AjaxRequestTarget target){ diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/assignment/AssignmentsUtil.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/assignment/AssignmentsUtil.java index 8e0b2976af2..1135d09e256 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/assignment/AssignmentsUtil.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/assignment/AssignmentsUtil.java @@ -363,6 +363,11 @@ public static boolean isPolicyRuleAssignment(AssignmentType assignment) { && assignment.asPrismContainerValue().findContainer(AssignmentType.F_POLICY_RULE) != null; } + public static boolean isArchetypeAssignment(AssignmentType assignment) { + return assignment.getTargetRef() != null + && ArchetypeType.COMPLEX_TYPE.equals(assignment.getTargetRef().getType()); + } + public static boolean isConsentAssignment(AssignmentType assignment) { if (assignment.getTargetRef() == null) { return false; diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/objectdetails/FocusMainPanel.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/objectdetails/FocusMainPanel.java index 434573533ad..cadd78b79fd 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/objectdetails/FocusMainPanel.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/objectdetails/FocusMainPanel.java @@ -359,7 +359,7 @@ protected int countAssignments() { List assignments = focus.asObjectable().getAssignment(); for (AssignmentType assignment : assignments) { if (!AssignmentsUtil.isPolicyRuleAssignment(assignment) && !AssignmentsUtil.isConsentAssignment(assignment) - && AssignmentsUtil.isAssignmentRelevant(assignment)) { + && AssignmentsUtil.isAssignmentRelevant(assignment) && !AssignmentsUtil.isArchetypeAssignment(assignment)) { rv++; } } From 79928a89f26ad9785f2204aae29680e8c40df007 Mon Sep 17 00:00:00 2001 From: kate Date: Fri, 22 Feb 2019 16:27:17 +0100 Subject: [PATCH 059/224] fixing query for new data protection assignment (org tree panel) --- .../OrgTreeAssignmentPopupTabPanel.java | 6 +++ .../admin/orgs/OrgTreeAssignablePanel.java | 38 ++++++++++++++----- 2 files changed, 34 insertions(+), 10 deletions(-) diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/gui/api/component/OrgTreeAssignmentPopupTabPanel.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/gui/api/component/OrgTreeAssignmentPopupTabPanel.java index 6d79e0f3614..e2a494b91aa 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/gui/api/component/OrgTreeAssignmentPopupTabPanel.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/gui/api/component/OrgTreeAssignmentPopupTabPanel.java @@ -15,6 +15,7 @@ */ package com.evolveum.midpoint.gui.api.component; +import com.evolveum.midpoint.prism.query.ObjectFilter; import com.evolveum.midpoint.schema.constants.ObjectTypes; import com.evolveum.midpoint.web.component.util.SelectableBean; import com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour; @@ -68,6 +69,11 @@ protected List getPreselectedOrgsList(){ protected boolean isInducement(){ return OrgTreeAssignmentPopupTabPanel.this.isInducement(); } + + @Override + protected ObjectFilter getSubtypeFilter(){ + return OrgTreeAssignmentPopupTabPanel.this.getSubtypeFilter(); + } }; orgTreePanel.setOutputMarkupId(true); add(orgTreePanel); diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/orgs/OrgTreeAssignablePanel.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/orgs/OrgTreeAssignablePanel.java index beafb51f80d..896601980ad 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/orgs/OrgTreeAssignablePanel.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/orgs/OrgTreeAssignablePanel.java @@ -20,6 +20,7 @@ import com.evolveum.midpoint.gui.api.model.LoadableModel; import com.evolveum.midpoint.gui.api.util.WebComponentUtil; import com.evolveum.midpoint.prism.query.ObjectFilter; +import com.evolveum.midpoint.prism.query.ObjectQuery; import com.evolveum.midpoint.schema.result.OperationResult; import com.evolveum.midpoint.task.api.Task; import com.evolveum.midpoint.web.session.OrgTreeStateStorage; @@ -126,7 +127,7 @@ protected OrgTreeStateStorage getOrgTreeStateStorage(){ @Override protected ObjectFilter getCustomFilter(){ - return getAssignableItemsFilter(); + return OrgTreeAssignablePanel.this.getCustomFilter(); } }; @@ -141,7 +142,7 @@ protected boolean isWarnMessageVisible(){ @Override protected ObjectFilter getAssignableItemsFilter(){ - return OrgTreeAssignablePanel.this.getAssignableItemsFilter(); + return OrgTreeAssignablePanel.this.getCustomFilter(); } @Override @@ -193,15 +194,32 @@ protected void onItemSelect(SelectableBean selected, AjaxRequestTarget } - private ObjectFilter getAssignableItemsFilter(){ - if (getAssignmentOwnerObject() == null){ - return null; + private ObjectFilter getCustomFilter(){ + ObjectFilter assignableItemsFilter = null; + if (getAssignmentOwnerObject() != null){ + Task task = getPageBase().createSimpleTask(OPERATION_LOAD_ASSIGNABLE_ITEMS); + OperationResult result = task.getResult(); + assignableItemsFilter = WebComponentUtil.getAssignableRolesFilter(getAssignmentOwnerObject().asPrismObject(), OrgType.class, + isInducement() ? WebComponentUtil.AssignmentOrder.INDUCEMENT : WebComponentUtil.AssignmentOrder.ASSIGNMENT, + result, task, getPageBase()); } - Task task = getPageBase().createSimpleTask(OPERATION_LOAD_ASSIGNABLE_ITEMS); - OperationResult result = task.getResult(); - return WebComponentUtil.getAssignableRolesFilter(getAssignmentOwnerObject().asPrismObject(), OrgType.class, - isInducement() ? WebComponentUtil.AssignmentOrder.INDUCEMENT : WebComponentUtil.AssignmentOrder.ASSIGNMENT, - result, task, getPageBase()); + + ObjectFilter subTypeFilter = getSubtypeFilter(); + if (subTypeFilter == null){ + return assignableItemsFilter; + } else if (assignableItemsFilter == null) { + return subTypeFilter; + } else { + ObjectQuery query = getPageBase().getPrismContext().queryFactory().createQuery(); + + query.addFilter(assignableItemsFilter); + query.addFilter(subTypeFilter); + return query.getFilter(); + } + } + + protected ObjectFilter getSubtypeFilter(){ + return null; } protected boolean isInducement(){ From aa8ddede355dc5afcef7061c21b20e4f27503cdb Mon Sep 17 00:00:00 2001 From: kate Date: Mon, 25 Feb 2019 11:00:31 +0100 Subject: [PATCH 060/224] certification definition summary panel fix --- .../web/page/admin/certification/PageCertDefinition.java | 4 +++- .../web/page/admin/certification/dto/CertDefinitionDto.java | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/certification/PageCertDefinition.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/certification/PageCertDefinition.java index 9a6e8cc21e9..22aabfbc24a 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/certification/PageCertDefinition.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/certification/PageCertDefinition.java @@ -41,6 +41,7 @@ import com.evolveum.midpoint.web.component.AjaxButton; import com.evolveum.midpoint.web.component.AjaxSubmitButton; import com.evolveum.midpoint.web.component.TabbedPanel; +import com.evolveum.midpoint.web.component.util.VisibleBehaviour; import com.evolveum.midpoint.web.page.admin.certification.dto.CertDefinitionDto; import com.evolveum.midpoint.web.util.OnePageParameterEncoder; import com.evolveum.midpoint.xml.ns._public.common.common_3.*; @@ -152,7 +153,8 @@ private CertDefinitionDto createDefinition() throws SchemaException { //region Layout private void initLayout() { CertDefinitionSummaryPanel summaryPanel = new CertDefinitionSummaryPanel(ID_SUMMARY_PANEL, - new PropertyModel<>(definitionModel, CertDefinitionDto.F_PRISM_OBJECT), this); + new PropertyModel<>(definitionModel, CertDefinitionDto.F_DEFINITION), this); + summaryPanel.add(new VisibleBehaviour(() -> StringUtils.isNotEmpty(definitionModel.getObject().getOldDefinition().getOid()))); add(summaryPanel); Form mainForm = new com.evolveum.midpoint.web.component.form.Form(ID_MAIN_FORM); diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/certification/dto/CertDefinitionDto.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/certification/dto/CertDefinitionDto.java index fc01418eb73..3bdab8cf094 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/certification/dto/CertDefinitionDto.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/certification/dto/CertDefinitionDto.java @@ -51,6 +51,7 @@ public class CertDefinitionDto implements Serializable { public static final String F_PRISM_OBJECT = "prismObject"; + public static final String F_DEFINITION = "definition"; public static final String F_NAME = "name"; public static final String F_DESCRIPTION = "description"; public static final String F_NUMBER_OF_STAGES = "numberOfStages"; From 843ef43ee97464cd7a98d3888f3173ab4e5c6a1d Mon Sep 17 00:00:00 2001 From: kate Date: Mon, 25 Feb 2019 14:29:33 +0100 Subject: [PATCH 061/224] MID-3843 certification definition new parameters --- .../GenericMultiValueLabelEditPanel.html | 4 +- .../certification/DefinitionScopePanel.html | 10 +++++ .../certification/DefinitionScopePanel.java | 42 ++++++++++++++++++- .../certification/dto/CertDefinitionDto.java | 1 + .../certification/dto/DefinitionScopeDto.java | 2 + .../localization/Midpoint.properties | 3 ++ 6 files changed, 58 insertions(+), 4 deletions(-) diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/form/multivalue/GenericMultiValueLabelEditPanel.html b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/form/multivalue/GenericMultiValueLabelEditPanel.html index 613cecae59d..5e94596c14a 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/form/multivalue/GenericMultiValueLabelEditPanel.html +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/form/multivalue/GenericMultiValueLabelEditPanel.html @@ -41,8 +41,8 @@
- - + +
diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/certification/DefinitionScopePanel.html b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/certification/DefinitionScopePanel.html index 50f48498f4d..8367070120b 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/certification/DefinitionScopePanel.html +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/certification/DefinitionScopePanel.html @@ -76,6 +76,10 @@ + + + + @@ -87,6 +91,12 @@ + + + +
+ +
diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/certification/DefinitionScopePanel.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/certification/DefinitionScopePanel.java index 54f4e00a02f..4757df01192 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/certification/DefinitionScopePanel.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/certification/DefinitionScopePanel.java @@ -17,21 +17,41 @@ package com.evolveum.midpoint.web.page.admin.certification; import com.evolveum.midpoint.gui.api.component.BasePanel; +import com.evolveum.midpoint.gui.api.model.LoadableModel; +import com.evolveum.midpoint.gui.api.model.NonEmptyLoadableModel; import com.evolveum.midpoint.gui.api.util.WebComponentUtil; +import com.evolveum.midpoint.prism.PrismConstants; +import com.evolveum.midpoint.web.component.form.multivalue.GenericMultiValueLabelEditPanel; +import com.evolveum.midpoint.web.component.form.multivalue.MultiValueTextEditPanel; +import com.evolveum.midpoint.web.component.form.multivalue.MultiValueTextPanel; import com.evolveum.midpoint.web.component.input.DropDownChoicePanel; +import com.evolveum.midpoint.web.component.input.ListMultipleChoicePanel; +import com.evolveum.midpoint.web.component.input.QNameObjectTypeChoiceRenderer; import com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour; import com.evolveum.midpoint.web.page.admin.certification.dto.DefinitionScopeDto; import com.evolveum.midpoint.web.page.admin.certification.dto.DefinitionScopeObjectType; +import com.evolveum.midpoint.web.page.admin.roles.component.MultiplicityPolicyPanel; +import com.evolveum.midpoint.xml.ns._public.common.common_3.MultiplicityPolicyConstraintType; +import org.apache.wicket.ajax.AjaxRequestTarget; import org.apache.wicket.markup.html.form.*; +import org.apache.wicket.markup.html.list.ListItem; +import org.apache.wicket.markup.html.list.ListView; import org.apache.wicket.model.IModel; +import org.apache.wicket.model.Model; import org.apache.wicket.model.PropertyModel; +import org.apache.wicket.model.util.ListModel; +import org.jetbrains.annotations.NotNull; + +import javax.xml.namespace.QName; +import java.util.List; /** * @author mederly */ public class DefinitionScopePanel extends BasePanel { + private static final long serialVersionUID = 1L; private static final String ID_NAME = "name"; private static final String ID_DESCRIPTION = "description"; @@ -45,14 +65,22 @@ public class DefinitionScopePanel extends BasePanel { private static final String ID_INCLUDE_RESOURCES = "includeResources"; private static final String ID_INCLUDE_ROLES = "includeRoles"; private static final String ID_INCLUDE_ORGS = "includeOrgs"; + private static final String ID_INCLUDE_USERS = "includeUsers"; private static final String ID_INCLUDE_SERVICES = "includeServices"; private static final String ID_INCLUDE_TARGET_TYPES_HELP = "scopeIncludeTargetTypesHelp"; private static final String ID_INCLUDE_ENABLED_ITEMS_ONLY = "includeEnabledItemsOnly"; private static final String ID_INCLUDE_BY_STATUS_HELP = "scopeIncludeByStatusHelp"; + private static final String ID_SCOPE_RELATIONS = "relations"; + private static final String ID_SCOPE_RELATION_HELP = "scopeRelationHelp"; public DefinitionScopePanel(String id, IModel model) { super(id, model); - initLayout(); + } + + @Override + protected void onInitialize(){ + super.onInitialize(); + initLayout(); } protected void initLayout() { @@ -77,7 +105,7 @@ public boolean isEnabled() { DropDownChoicePanel objectTypeChooser = new DropDownChoicePanel(ID_OBJECT_TYPE_CHOOSER, new PropertyModel(getModel(), DefinitionScopeDto.F_OBJECT_TYPE), WebComponentUtil.createReadonlyModelFromEnum(DefinitionScopeObjectType.class), - new EnumChoiceRenderer() ); + new EnumChoiceRenderer()); add(objectTypeChooser); add(WebComponentUtil.createHelp(ID_OBJECT_TYPE_HELP)); @@ -94,9 +122,19 @@ public boolean isEnabled() { add(new CheckBox(ID_INCLUDE_ROLES, new PropertyModel<>(getModel(), DefinitionScopeDto.F_INCLUDE_ROLES))); add(new CheckBox(ID_INCLUDE_ORGS, new PropertyModel<>(getModel(), DefinitionScopeDto.F_INCLUDE_ORGS))); add(new CheckBox(ID_INCLUDE_SERVICES, new PropertyModel<>(getModel(), DefinitionScopeDto.F_INCLUDE_SERVICES))); + add(new CheckBox(ID_INCLUDE_USERS, new PropertyModel<>(getModel(), DefinitionScopeDto.F_INCLUDE_USERS))); add(WebComponentUtil.createHelp(ID_INCLUDE_TARGET_TYPES_HELP)); add(new CheckBox(ID_INCLUDE_ENABLED_ITEMS_ONLY, new PropertyModel<>(getModel(), DefinitionScopeDto.F_INCLUDE_ENABLED_ITEMS_ONLY))); add(WebComponentUtil.createHelp(ID_INCLUDE_BY_STATUS_HELP)); + + List relationsList = WebComponentUtil.getAllRelations(getPageBase()); + relationsList.add(0, new QName(PrismConstants.NS_QUERY, "any")); + ListMultipleChoicePanel relationsPanel = new ListMultipleChoicePanel(ID_SCOPE_RELATIONS, new ListModel(getModelObject().getRelationList()), + new ListModel(relationsList), new QNameObjectTypeChoiceRenderer(), null); + relationsPanel.setOutputMarkupId(true); + add(relationsPanel); + + add(WebComponentUtil.createHelp(ID_SCOPE_RELATION_HELP)); } } diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/certification/dto/CertDefinitionDto.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/certification/dto/CertDefinitionDto.java index 3bdab8cf094..313eb3dbc43 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/certification/dto/CertDefinitionDto.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/certification/dto/CertDefinitionDto.java @@ -283,6 +283,7 @@ private DefinitionScopeDto createDefinitionScopeDto(AccessCertificationScopeType dto.setIncludeRoles(true); dto.setIncludeOrgs(true); dto.setIncludeServices(true); + dto.setIncludeUsers(true); dto.setEnabledItemsOnly(true); if (scopeTypeObj != null) { diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/certification/dto/DefinitionScopeDto.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/certification/dto/DefinitionScopeDto.java index e7b4c03805d..42bc900d193 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/certification/dto/DefinitionScopeDto.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/certification/dto/DefinitionScopeDto.java @@ -43,6 +43,8 @@ public class DefinitionScopeDto implements Serializable { public static final String F_INCLUDE_ROLES = "includeRoles"; public static final String F_INCLUDE_ORGS = "includeOrgs"; public static final String F_INCLUDE_SERVICES = "includeServices"; + public static final String F_INCLUDE_USERS = "includeUsers"; + public static final String F_RELATION_LIST = "relationList"; public static final String F_INCLUDE_ENABLED_ITEMS_ONLY = "enabledItemsOnly"; private String name; diff --git a/gui/admin-gui/src/main/resources/localization/Midpoint.properties b/gui/admin-gui/src/main/resources/localization/Midpoint.properties index ab21e53a0b7..5c2af5ad0b3 100755 --- a/gui/admin-gui/src/main/resources/localization/Midpoint.properties +++ b/gui/admin-gui/src/main/resources/localization/Midpoint.properties @@ -1495,6 +1495,8 @@ PageCertDefinition.scopeIncludeOrgs=Orgs PageCertDefinition.scopeIncludeServices=Services PageCertDefinition.scopeIncludeResources=Resources PageCertDefinition.scopeIncludeByStatus=Include by activation status +PageCertDefinition.scopeIncludeUsers=Users +PageCertDefinition.scopeRelation=Relation PageCertDefinition.scopeEnabledItemsOnly=Enabled items only PageCertDefinition.stagesDefinition=Stages definition PageCertDefinitions.message.deleteDefinitionPerformed.success=The definition has been successfully deleted. @@ -3706,6 +3708,7 @@ PageCertDefinition.scopeIncludeTargetTypesHelp=When certifying assignments or in can say that you want to certify only assignments of roles (to, for example, users). PageCertDefinition.scopeIncludeByStatusHelp=Whether to certify only assignments/inducements that have administrative status set to ENABLED (or not set at all). Note \ that what is relevant is the administrative status of the assignment, not the administrative status of the assigned object. +PageCertDefinition.scopeRelationHelp=Relation(s) which are to be considered. Value of q:any means "any relation". If no relation is present, org:default (i.e. null) is assumed. StageDefinitionPanel.stageDurationHelp=Duration of this stage, used to determine stage end time. The end time is computed as the moment of stage opening plus the \ duration, rounded up to 23:59:59 of the last day. Duration is specified in ISO 8601 format, like P14D for 14 days, P3W for 3 weeks, P2M for 2 months, etc. StageDefinitionPanel.notifyBeforeDeadlineHelp=How long before the stage end the reminding notifications (to reviewers and campaign owner) will be sent. \ From 9dc89cd6ea275f8ba4f3eb9d14f172fd9b33f96d Mon Sep 17 00:00:00 2001 From: kate Date: Tue, 26 Feb 2019 00:11:52 +0100 Subject: [PATCH 062/224] little fix for resource assignment popup --- .../midpoint/gui/api/component/AbstractPopupTabPanel.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/gui/api/component/AbstractPopupTabPanel.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/gui/api/component/AbstractPopupTabPanel.java index 057c63a6d15..ccdd3045d59 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/gui/api/component/AbstractPopupTabPanel.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/gui/api/component/AbstractPopupTabPanel.java @@ -93,7 +93,7 @@ protected IModel getCheckBoxEnableModel(IModel> rowMo protected ObjectQuery addFilterToContentQuery(ObjectQuery query) { ObjectQuery queryWithFilters = AbstractPopupTabPanel.this.addFilterToContentQuery(query); if (queryWithFilters == null){ - queryWithFilters = getPrismContext().queryFactory().createQuery(); + queryWithFilters = AbstractPopupTabPanel.this.getPageBase().getPrismContext().queryFactory().createQuery(); } List archetypeRefList = getArchetypeRefList(); if (!CollectionUtils.isEmpty(archetypeRefList)){ From 708f9b7a9529de6325d61e38271d20019a1ac8a2 Mon Sep 17 00:00:00 2001 From: Pavol Mederly Date: Tue, 26 Feb 2019 13:12:00 +0100 Subject: [PATCH 063/224] Add skeleton of UnassignExecutor (MID-4983) This is to be used for unassigning members from an abstract role. --- .../scripting/actions/UnassignExecutor.java | 136 ++++++++++++++++++ .../scripting/helpers/ExpressionHelper.java | 25 ++++ 2 files changed, 161 insertions(+) create mode 100644 model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/scripting/actions/UnassignExecutor.java diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/scripting/actions/UnassignExecutor.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/scripting/actions/UnassignExecutor.java new file mode 100644 index 00000000000..77e2dbf1436 --- /dev/null +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/scripting/actions/UnassignExecutor.java @@ -0,0 +1,136 @@ +/* + * Copyright (c) 2010-2019 Evolveum + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.evolveum.midpoint.model.impl.scripting.actions; + +import com.evolveum.midpoint.model.api.ModelExecuteOptions; +import com.evolveum.midpoint.model.api.PipelineItem; +import com.evolveum.midpoint.model.api.ScriptExecutionException; +import com.evolveum.midpoint.model.impl.scripting.ExecutionContext; +import com.evolveum.midpoint.model.impl.scripting.PipelineData; +import com.evolveum.midpoint.prism.PrismObject; +import com.evolveum.midpoint.prism.PrismObjectValue; +import com.evolveum.midpoint.prism.PrismValue; +import com.evolveum.midpoint.prism.delta.ObjectDelta; +import com.evolveum.midpoint.schema.result.OperationResult; +import com.evolveum.midpoint.util.exception.CommonException; +import com.evolveum.midpoint.util.exception.SchemaException; +import com.evolveum.midpoint.util.logging.Trace; +import com.evolveum.midpoint.util.logging.TraceManager; +import com.evolveum.midpoint.xml.ns._public.common.common_3.*; +import com.evolveum.midpoint.xml.ns._public.model.scripting_3.ActionExpressionType; +import com.evolveum.midpoint.xml.ns._public.model.scripting_3.ActionParameterValueType; +import org.apache.commons.collections4.CollectionUtils; +import org.springframework.stereotype.Component; + +import javax.annotation.PostConstruct; +import java.util.Collection; + +/** + * + */ +@Component +public class UnassignExecutor extends BaseActionExecutor { + + private static final Trace LOGGER = TraceManager.getTrace(UnassignExecutor.class); + + private static final String NAME = "unassign"; + private static final String PARAM_RESOURCE = "resource"; + private static final String PARAM_ROLE = "role"; + private static final String PARAM_RELATION = "relation"; + + @PostConstruct + public void init() { + scriptingExpressionEvaluator.registerActionExecutor(NAME, this); + } + + @Override + public PipelineData execute(ActionExpressionType expression, PipelineData input, ExecutionContext context, OperationResult globalResult) throws ScriptExecutionException { + + ModelExecuteOptions executionOptions = getOptions(expression, input, context, globalResult); + boolean dryRun = getParamDryRun(expression, input, context, globalResult); + + ActionParameterValueType resourceParameterValue = expressionHelper.getArgument(expression.getParameter(), PARAM_RESOURCE, false, false, NAME); + ActionParameterValueType roleParameterValue = expressionHelper.getArgument(expression.getParameter(), PARAM_ROLE, false, false, NAME); + Collection relations = expressionHelper.getArgumentValues(expression.getParameter(), PARAM_RELATION, false, false, NAME, input, context, String.class, globalResult); + + Collection resources; + try { + if (resourceParameterValue != null) { + PipelineData data = expressionHelper + .evaluateParameter(resourceParameterValue, null, input, context, globalResult); + resources = data.getDataAsReferences(ResourceType.COMPLEX_TYPE, ResourceType.class, context, globalResult); + } else { + resources = null; + } + } catch (CommonException e) { + throw new ScriptExecutionException("Couldn't evaluate '" + PARAM_RESOURCE + "' parameter of a scripting expression: " + e.getMessage(), e); + } + + Collection roles; + try { + if (roleParameterValue != null) { + PipelineData data = expressionHelper.evaluateParameter(roleParameterValue, null, input, context, globalResult); + roles = data.getDataAsReferences(RoleType.COMPLEX_TYPE, AbstractRoleType.class, context, globalResult); // if somebody wants to assign Org, he has to use full reference value (including object type) + } else { + roles = null; + } + } catch (CommonException e) { + throw new ScriptExecutionException("Couldn't evaluate '" + PARAM_ROLE + "' parameter of a scripting expression: " + e.getMessage(), e); + } + + if (resources == null && roles == null) { + throw new ScriptExecutionException("Nothing to assign: neither resource nor role specified"); + } + + if (CollectionUtils.isEmpty(resources) && CollectionUtils.isEmpty(roles)) { + LOGGER.warn("No resources and no roles to unassign in a scripting expression"); + context.println("Warning: no resources and no roles to unassign"); // TODO some better handling? + return input; + } + + for (PipelineItem item : input.getData()) { + PrismValue value = item.getValue(); + OperationResult result = operationsHelper.createActionResult(item, this, context, globalResult); + context.checkTaskStop(); + if (value instanceof PrismObjectValue && ((PrismObjectValue) value).asObjectable() instanceof AssignmentHolderType) { + @SuppressWarnings({"unchecked", "raw"}) + PrismObject prismObject = ((PrismObjectValue) value).asPrismObject(); + AssignmentHolderType objectType = (AssignmentHolderType) prismObject.asObjectable(); + long started = operationsHelper.recordStart(context, objectType); + Throwable exception = null; + try { + operationsHelper.applyDelta(createDelta(objectType, resources, roles, relations), executionOptions, dryRun, context, result); + operationsHelper.recordEnd(context, objectType, started, null); + } catch (Throwable ex) { + operationsHelper.recordEnd(context, objectType, started, ex); + exception = processActionException(ex, NAME, value, context); + } + context.println((exception != null ? "Attempted to modify " : "Modified ") + prismObject.toString() + optionsSuffix(executionOptions, dryRun) + exceptionSuffix(exception)); + } else { + //noinspection ThrowableNotThrown + processActionException(new ScriptExecutionException("Item is not a PrismObject of AssignmentHolderType"), NAME, value, context); + } + operationsHelper.trimAndCloneResult(result, globalResult, context); + } + return input; // TODO updated objects? + } + + private ObjectDelta createDelta(ObjectType object, Collection resources, Collection roles, Collection relations) throws ScriptExecutionException { + // TODO implement delta creation + return null; + } +} diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/scripting/helpers/ExpressionHelper.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/scripting/helpers/ExpressionHelper.java index 8d8cc8f4586..1dbc5cf5e0f 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/scripting/helpers/ExpressionHelper.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/scripting/helpers/ExpressionHelper.java @@ -16,6 +16,7 @@ package com.evolveum.midpoint.model.impl.scripting.helpers; +import com.evolveum.midpoint.model.api.PipelineItem; import com.evolveum.midpoint.model.api.ScriptExecutionException; import com.evolveum.midpoint.model.impl.scripting.PipelineData; import com.evolveum.midpoint.model.impl.scripting.ExecutionContext; @@ -27,10 +28,13 @@ import com.evolveum.midpoint.xml.ns._public.model.scripting_3.ActionParameterValueType; import com.evolveum.prism.xml.ns._public.types_3.RawType; import org.apache.commons.lang.Validate; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; +import java.util.ArrayList; +import java.util.Collection; import java.util.List; /** @@ -136,4 +140,25 @@ public T getSingleArgumentValue(List arguments, St throw new ScriptExecutionException("Couldn't retrieve value of parameter '" + parameterName + "': " + t.getMessage(), t); } } + + @NotNull + public Collection getArgumentValues(List arguments, String parameterName, boolean required, + boolean requiredNonNull, String context, PipelineData input, ExecutionContext executionContext, Class clazz, OperationResult result) throws ScriptExecutionException { + List rv = new ArrayList<>(); + ActionParameterValueType paramValue = getArgument(arguments, parameterName, required, requiredNonNull, context); + if (paramValue != null) { + PipelineData paramData = evaluateParameter(paramValue, clazz, input, executionContext, result); + for (PipelineItem item : paramData.getData()) { + PrismValue prismValue = item.getValue(); + if (!(prismValue instanceof PrismPropertyValue)) { + throw new ScriptExecutionException( + "A prism property value was expected in '" + parameterName + "' parameter. Got " + prismValue + .getClass().getName() + " instead."); + } else { + rv.add(JavaTypeConverter.convert(clazz, prismValue.getRealValue())); + } + } + } + return rv; + } } From 479d34573785ea6a0a42441a56292676f93cbc89 Mon Sep 17 00:00:00 2001 From: kate Date: Tue, 26 Feb 2019 14:25:46 +0100 Subject: [PATCH 064/224] mid-3566 export/delete filtered objects in debug pages --- .../web/component/data/column/ColumnUtils.java | 2 +- .../web/page/admin/configuration/PageDebugList.java | 12 +++++------- .../main/resources/localization/Midpoint.properties | 4 ++-- .../resources/localization/Midpoint_en.properties | 4 ++-- 4 files changed, 10 insertions(+), 12 deletions(-) diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/data/column/ColumnUtils.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/data/column/ColumnUtils.java index d8bb8d99789..947bfbc3d92 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/data/column/ColumnUtils.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/data/column/ColumnUtils.java @@ -204,7 +204,7 @@ private static IModel getIconColumnDataModel(IMod createStringResource("ThreeStateBooleanPanel.true") : createStringResource("ThreeStateBooleanPanel.false"); } - return null; + return Model.of(); } private static String getIconColumnTitle(IModel> rowModel){ diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/configuration/PageDebugList.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/configuration/PageDebugList.java index 4fdf61d2f1c..815f9646eed 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/configuration/PageDebugList.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/configuration/PageDebugList.java @@ -31,6 +31,7 @@ import com.evolveum.midpoint.web.page.admin.server.PageTasks; import com.evolveum.midpoint.web.util.OnePageParameterEncoder; import com.evolveum.midpoint.xml.ns._public.common.common_3.*; +import org.apache.commons.collections.IteratorUtils; import org.apache.wicket.AttributeModifier; import org.apache.wicket.Component; import org.apache.wicket.MarkupContainer; @@ -697,7 +698,8 @@ private String deleteAllShadowsConfirmed(OperationResult result, boolean deleteA private void exportSelected(AjaxRequestTarget target, DebugObjectItem item) { List selected = getSelectedData(target, item); if (selected.isEmpty()) { - return; + RepositoryObjectDataProvider provider = getTableDataProvider(); + selected = IteratorUtils.toList(provider.internalIterator(0, provider.size())); } List oids = new ArrayList<>(); @@ -737,18 +739,14 @@ private List getSelectedData(AjaxRequestTarget target, DebugObj } items = WebComponentUtil.getSelectedData(getListTable()); - if (items.isEmpty()) { - warn(getString("pageDebugList.message.nothingSelected")); - target.add(getFeedbackPanel()); - } - return items; } private void deleteSelected(AjaxRequestTarget target, DebugObjectItem item) { List selected = getSelectedData(target, item); if (selected.isEmpty()) { - return; + RepositoryObjectDataProvider provider = getTableDataProvider(); + selected = IteratorUtils.toList(provider.internalIterator(0, provider.size())); } DebugSearchDto searchDto = searchModel.getObject(); diff --git a/gui/admin-gui/src/main/resources/localization/Midpoint.properties b/gui/admin-gui/src/main/resources/localization/Midpoint.properties index 5c2af5ad0b3..687cf215a7d 100755 --- a/gui/admin-gui/src/main/resources/localization/Midpoint.properties +++ b/gui/admin-gui/src/main/resources/localization/Midpoint.properties @@ -1673,12 +1673,12 @@ pageDebugList.dialog.title.confirmDelete=Confirm delete pageDebugList.dialog.title.deleteAll=Delete All Objects pageDebugList.menu.deleteAllIdentities=Delete all identities pageDebugList.menu.deleteAllType=Delete all of selected type -pageDebugList.menu.deleteSelected=Delete selected +pageDebugList.menu.deleteSelected=Delete selected/filtered pageDebugList.menu.deleteShadowsOnResource=Delete all shadows on resource pageDebugList.menu.exportShadowsOnResource=Export all shadows on resource pageDebugList.menu.exportAll=Export all objects pageDebugList.menu.exportAllSelectedType=Export all of selected type -pageDebugList.menu.exportSelected=Export selected +pageDebugList.menu.exportSelected=Export selected/filtered pageDebugList.message.countSearchProblem=Couldn't perform search operation on users/shadows/org. units pageDebugList.message.createFileException=Couldn't create file for download. pageDebugList.message.deleteAllType=Do you really want to delete all objects of type "{0}"? diff --git a/gui/admin-gui/src/main/resources/localization/Midpoint_en.properties b/gui/admin-gui/src/main/resources/localization/Midpoint_en.properties index 77de9d5eb90..2fa8fb9d310 100644 --- a/gui/admin-gui/src/main/resources/localization/Midpoint_en.properties +++ b/gui/admin-gui/src/main/resources/localization/Midpoint_en.properties @@ -1664,12 +1664,12 @@ pageDebugList.dialog.title.confirmDelete=Confirm delete pageDebugList.dialog.title.deleteAll=Delete All Objects pageDebugList.menu.deleteAllIdentities=Delete all identities pageDebugList.menu.deleteAllType=Delete all of selected type -pageDebugList.menu.deleteSelected=Delete selected +pageDebugList.menu.deleteSelected=Delete selected/filtered pageDebugList.menu.deleteShadowsOnResource=Delete all shadows on resource pageDebugList.menu.exportShadowsOnResource=Export all shadows on resource pageDebugList.menu.exportAll=Export all objects pageDebugList.menu.exportAllSelectedType=Export all of selected type -pageDebugList.menu.exportSelected=Export selected +pageDebugList.menu.exportSelected=Export selected/filtered pageDebugList.message.countSearchProblem=Couldn't perform search operation on users/shadows/org. units pageDebugList.message.createFileException=Couldn't create file for download. pageDebugList.message.deleteAllType=Do you really want to delete all objects of type "{0}"? From 3a0849f2af1fe5e3207662cc1fd1f17e2044b771 Mon Sep 17 00:00:00 2001 From: kate Date: Wed, 27 Feb 2019 00:00:18 +0100 Subject: [PATCH 065/224] fix for MID-5025 Role inducement association shadow ref error --- .../component/input/ExpressionValuePanel.html | 1 + .../component/input/ExpressionValuePanel.java | 22 +++++++++++++++++++ .../localization/Midpoint.properties | 1 + 3 files changed, 24 insertions(+) diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/input/ExpressionValuePanel.html b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/input/ExpressionValuePanel.html index 1af0fc664d7..2074908fd8d 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/input/ExpressionValuePanel.html +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/input/ExpressionValuePanel.html @@ -17,6 +17,7 @@ +
diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/input/ExpressionValuePanel.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/input/ExpressionValuePanel.java index c4b14e56682..bd5325afa93 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/input/ExpressionValuePanel.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/input/ExpressionValuePanel.java @@ -22,6 +22,7 @@ import com.evolveum.midpoint.gui.api.model.NonEmptyLoadableModel; import com.evolveum.midpoint.gui.api.page.PageBase; import com.evolveum.midpoint.gui.api.util.WebComponentUtil; +import com.evolveum.midpoint.prism.PrismReferenceValue; import com.evolveum.midpoint.prism.query.ObjectFilter; import com.evolveum.midpoint.prism.xnode.MapXNode; import com.evolveum.midpoint.schema.SchemaConstantsGenerated; @@ -39,8 +40,10 @@ import org.apache.commons.lang.StringUtils; import org.apache.wicket.ajax.AjaxRequestTarget; import org.apache.wicket.ajax.markup.html.AjaxLink; +import org.apache.wicket.feedback.ComponentFeedbackMessageFilter; import org.apache.wicket.feedback.FeedbackMessage; import org.apache.wicket.markup.html.WebMarkupContainer; +import org.apache.wicket.markup.html.panel.FeedbackPanel; import org.apache.wicket.model.IModel; import org.apache.wicket.model.Model; import org.jetbrains.annotations.NotNull; @@ -73,6 +76,7 @@ public class ExpressionValuePanel extends BasePanel{ private final static String ID_ASSOCIATION_TARGET_SEARCH_CONTAINER = "associationTargetSearchContainer"; private final static String ID_TARGET_SEARCH_PATH_INPUT = "targetSearchPathInput"; private final static String ID_TARGET_SEARCH_VALUE_INPUT = "targetSearchValueInput"; + private static final String ID_FEEDBACK = "feedback"; ConstructionType construction; PageBase pageBase; @@ -88,6 +92,10 @@ public ExpressionValuePanel(String id, IModel model, Constructio private void initLayout(){ setOutputMarkupId(true); + FeedbackPanel feedback = new FeedbackPanel(ID_FEEDBACK); + feedback.setOutputMarkupPlaceholderTag(true); + add(feedback); + DropdownButtonDto addValueButtonDto = new DropdownButtonDto("", "", createStringResource("ExpressionValuePanel.specifyExpression").getString(), createAddButtonInlineMenuItems()); @@ -216,6 +224,16 @@ protected List load() { shadowsListModel, Arrays.asList(ShadowType.class), false){ private static final long serialVersionUID = 1L; + @Override + protected void editValuePerformed(List chosenValues, List filterValues, AjaxRequestTarget target, boolean multiselect) { + if (getCustomFilter() == null){ + getFeedbackPanel().warn(createStringResource("ExpressionValuePanel.associationDefenitionsNotDefined").getString()); + target.add(getFeedbackPanel()); + } else { + super.editValuePerformed(chosenValues, filterValues, target, multiselect); + } + } + @Override protected ObjectFilter getCustomFilter(){ return WebComponentUtil.getShadowTypeFilterForAssociation(construction, OPERATION_LOAD_RESOURCE, pageBase); @@ -487,4 +505,8 @@ private List getLiteralValues(){ protected boolean isAssociationExpression(){ return false; } + + private FeedbackPanel getFeedbackPanel(){ + return (FeedbackPanel) get(ID_FEEDBACK); + } } diff --git a/gui/admin-gui/src/main/resources/localization/Midpoint.properties b/gui/admin-gui/src/main/resources/localization/Midpoint.properties index 687cf215a7d..f1d8216d3ee 100755 --- a/gui/admin-gui/src/main/resources/localization/Midpoint.properties +++ b/gui/admin-gui/src/main/resources/localization/Midpoint.properties @@ -4216,6 +4216,7 @@ ExpressionValuePanel.specifyExpression=Specify expression ExpressionValuePanel.addValueButtonDefaultTitle=Add shadow reference value ExpressionValuePanel.addValueButtonTargetSearchTitle=Add association target search ExpressionValuePanel.addLiteralValueButton=Add literal value +ExpressionValuePanel.associationDefenitionsNotDefined=Association definitions are not defined for the current resource with selected kind/intent parameters. ConstructionType.attribute=Attribute ConstructionType.association=Association operation.Recompute.ALL.members=Recompute all members From 2f0338e068263cd453f87443e1a7419702c0ccd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Ga=C5=A1par=C3=ADk?= Date: Wed, 27 Feb 2019 13:37:00 +0100 Subject: [PATCH 066/224] Translation, WIP --- .../localization/Midpoint_cs.properties | 8 +- .../localization/Midpoint_de.properties | 8 +- .../localization/Midpoint_en.properties | 4 + .../localization/Midpoint_es.properties | 8 +- .../localization/Midpoint_et.properties | 8 +- .../localization/Midpoint_fi.properties | 8 +- .../localization/Midpoint_fr.properties | 24 ++-- .../localization/Midpoint_hu.properties | 8 +- .../localization/Midpoint_it.properties | 8 +- .../localization/Midpoint_ja.properties | 108 +++++++++--------- .../localization/Midpoint_lt.properties | 8 +- .../localization/Midpoint_pl.properties | 8 +- .../localization/Midpoint_pt_BR.properties | 8 +- .../localization/Midpoint_ru.properties | 8 +- .../localization/Midpoint_sk.properties | 8 +- .../localization/Midpoint_tr.properties | 8 +- .../localization/Midpoint_zh_CN.properties | 8 +- .../localization/schema_fr.properties | 4 +- .../localization/schema_ja.properties | 4 +- 19 files changed, 162 insertions(+), 94 deletions(-) diff --git a/gui/admin-gui/src/main/resources/localization/Midpoint_cs.properties b/gui/admin-gui/src/main/resources/localization/Midpoint_cs.properties index 369b3b26cf7..989560c5347 100644 --- a/gui/admin-gui/src/main/resources/localization/Midpoint_cs.properties +++ b/gui/admin-gui/src/main/resources/localization/Midpoint_cs.properties @@ -1488,6 +1488,8 @@ PageCertDefinition.scopeIncludeOrgs=Organizace PageCertDefinition.scopeIncludeServices=Služby PageCertDefinition.scopeIncludeResources=Aplikace PageCertDefinition.scopeIncludeByStatus=Včetně stavu aktivace +PageCertDefinition.scopeIncludeUsers=Uživatelé +PageCertDefinition.scopeRelation=Vztah PageCertDefinition.scopeEnabledItemsOnly=Jen povolené položky PageCertDefinition.stagesDefinition=Definice fází PageCertDefinitions.message.deleteDefinitionPerformed.success=Došlo k úspěšnému smazání definice. @@ -1664,12 +1666,12 @@ pageDebugList.dialog.title.confirmDelete=Potvrdit smazání pageDebugList.dialog.title.deleteAll=Smazat všechny objekty pageDebugList.menu.deleteAllIdentities=Smazat všechny identity pageDebugList.menu.deleteAllType=Smazat všechny vybraného typu -pageDebugList.menu.deleteSelected=Smazat vybrané +pageDebugList.menu.deleteSelected=Smazat vybrané/vyhledané pageDebugList.menu.deleteShadowsOnResource=Smazat všechny stínové účty v aplikaci pageDebugList.menu.exportShadowsOnResource=Exportovat všechny stínové účty v aplikaci pageDebugList.menu.exportAll=Exportovat všechny objekty pageDebugList.menu.exportAllSelectedType=Exportovat objekty vybraného typu -pageDebugList.menu.exportSelected=Exportovat vybrané +pageDebugList.menu.exportSelected=Exportovat vybrané/vyhledané pageDebugList.message.countSearchProblem=Nepodařilo se provést vyhledání nad uživateli/stínovými účty/org. pageDebugList.message.createFileException=Nepodařilo se vytvořit soubor pro stažení. pageDebugList.message.deleteAllType=Opravdu chcete smazat všechny objekty typu "{0}"? @@ -3687,6 +3689,7 @@ PageCertDefinition.scopeSearchFilterHelp=Pokud je pro certifikaci zvažována je PageCertDefinition.scopeAssignmentsInducementsHelp=Vybrat, které rysy objektů popsaných výše (přiřazení, indukce nebo oboje) jsou certifikovány. PageCertDefinition.scopeIncludeTargetTypesHelp=Když jsou certifikovány přiřazení nebo indukce, můžete určit jaké cílové typy jsou použity. Například, můžete určit, že chcete certifikovat pouze přiřazení rolí (uživatelům). PageCertDefinition.scopeIncludeByStatusHelp=Zda se mají certifikovat pouze přiřazení či indukce, která mají administrativní status nastaven na Povoleno (či nijak nenastaven). Poznámka: důležitý je zde administrativní status přiřazení, ne administrativní status přiřazeného objektu. +PageCertDefinition.scopeRelationHelp=Vztahy, které jsou zvažovány. Hodnota q:ay znamená "jakýkoliv vztah". Pokud není zvolen žádný vztah, předpokládá se org:default (null). StageDefinitionPanel.stageDurationHelp=Trvání této fáze, použité k určení konce fáze. Čas konce fáze je počítán jako okamžik otevření fáze plus doba trvání, zaokrouhleno na čas 23:59:59 posledního dne.
Trvání se specifikuje v ISO 8601 formátu, například: P14D = 14 dní, P3W = 3 týdny, P2M = 2 měsíce, a podobně. StageDefinitionPanel.notifyBeforeDeadlineHelp=Jak dlouho před koncem fáze se mají posílat upozornění (ověřitelům a vlastníkovi kampaně). Lze zadatr více hodnot, oddělených čárkou.Trvání je zadáváno ve formátu ISO 8601, například PT12H pro 12 hodin, P2D pro 2 dny, P1W pro jeden týden a podobně.
Například, PT48H, PT12H znamená, že první upozornění se pošle 48 hodin před koncem fáze, následovaná druhým upozorněním 12 před koncem fáze. StageDefinitionPanel.notifyWhenNoDecisionHelp=Pokud je zaškrtnuto, je upozornění o blížícím se konci fáze zasláno ověřiteli, a to jen tehdy, pokud nějaké případy čekají na jeho/její rozhodnutí.
Pokud není zaškrtnuto, ověřitelé dostanou upozornění vždy - bez ohledu na to, zda provedli rozhodnutí, nebo ne. (Poznámka: vlastník kampaně dostane upozornění na blížící se konec fáze vždy, bez ohledu na toto nastavení) @@ -4169,6 +4172,7 @@ ExpressionValuePanel.specifyExpression=Určit výraz ExpressionValuePanel.addValueButtonDefaultTitle=Přidat odkaz na stínový účet ExpressionValuePanel.addValueButtonTargetSearchTitle=Přidat vyhledávání cíle asociace ExpressionValuePanel.addLiteralValueButton=Přidat hodnotu +ExpressionValuePanel.associationDefenitionsNotDefined=Pro aktuální aplikaci s vybranými záměry/druhy nejsou popsány žádné definice asociací. ConstructionType.attribute=Atribut ConstructionType.association=Asociace operation.Recompute.ALL.members=Přepočítat všechny členy diff --git a/gui/admin-gui/src/main/resources/localization/Midpoint_de.properties b/gui/admin-gui/src/main/resources/localization/Midpoint_de.properties index c8cc5b86591..3a560b31b90 100644 --- a/gui/admin-gui/src/main/resources/localization/Midpoint_de.properties +++ b/gui/admin-gui/src/main/resources/localization/Midpoint_de.properties @@ -1488,6 +1488,8 @@ PageCertDefinition.scopeIncludeOrgs=Organisationen PageCertDefinition.scopeIncludeServices=Dienste PageCertDefinition.scopeIncludeResources=Ressourcen PageCertDefinition.scopeIncludeByStatus=Einschließen nach Aktivierungsstatus +PageCertDefinition.scopeIncludeUsers=Benutzer +PageCertDefinition.scopeRelation=Beziehung PageCertDefinition.scopeEnabledItemsOnly=Nur aktivierte Elemente PageCertDefinition.stagesDefinition=Definition der Phasen PageCertDefinitions.message.deleteDefinitionPerformed.success=Die Definition wurde erfolgreich gelöscht. @@ -1664,12 +1666,12 @@ pageDebugList.dialog.title.confirmDelete=Löschen bestätigen pageDebugList.dialog.title.deleteAll=Alle Objekte löschen pageDebugList.menu.deleteAllIdentities=Alle Identitäten löschen pageDebugList.menu.deleteAllType=Alle vom ausgewählten Typ löschen -pageDebugList.menu.deleteSelected=Ausgewählte löschen +pageDebugList.menu.deleteSelected=Delete selected/filtered pageDebugList.menu.deleteShadowsOnResource=Alle Shadows in der Ressource löschen pageDebugList.menu.exportShadowsOnResource=Alle Shadows auf der Ressource exportieren pageDebugList.menu.exportAll=Alle Objekte exportieren pageDebugList.menu.exportAllSelectedType=Alle mit dem ausgewählten Typ exportieren -pageDebugList.menu.exportSelected=Ausgewählte exportieren +pageDebugList.menu.exportSelected=Export selected/filtered pageDebugList.message.countSearchProblem=Suche konnte nicht ausgeführt werden auf Benutzer/Shadows/org.units pageDebugList.message.createFileException=Datei zum Herunterladen konnte nicht erzeugt werden. pageDebugList.message.deleteAllType=Wollen Sie wirklich alle Objekte vom Typ "{0}" löschen? @@ -3687,6 +3689,7 @@ PageCertDefinition.scopeSearchFilterHelp=If only a subset of objects of given ty PageCertDefinition.scopeAssignmentsInducementsHelp=Selektieren Sie welche Eigenschaft der beschriebenen Objekte sollen zertifizierten (Zuweisung, Veranlassungen oder beide). PageCertDefinition.scopeIncludeTargetTypesHelp=Wenn Sie Zuweisungen oder Veranlassungen zertifizieren, können Sie definieren welche Zieltypen beachtet werden sollen. Sie können Beispielsweise definieren das Sie nur Rollenzuweisungen zertifizieren möchten. PageCertDefinition.scopeIncludeByStatusHelp=Sofern Zuweisungen den administrativen Status AKTIVIERT (oder nicht gesetzt) haben, beachten Sie bitte das der administrative Status der Zuweisung relevant ist und nicht der administrative Status des zugewiesenen Objektes. +PageCertDefinition.scopeRelationHelp=Relation(s) which are to be considered. Value of q:any means "any relation". If no relation is present, org:default (i.e. null) is assumed. StageDefinitionPanel.stageDurationHelp=Die Dauer dieser Phase wird für die Bestimmung der Endzeit der Phase verwendet. Die Endzeit wird beim Start der Phase berechnet und Errechnet sich aus der Startzeit plus die Dauer gerundet auf 23:59:59 des letzten Tages. Die Dauer ist nach ISO 8601 formatiert, zum Beispiel P14D für 14 Tage, P3W für drei Wochen, P2M für 2 Monate u.s.w. StageDefinitionPanel.notifyBeforeDeadlineHelp=Wie lange vor Ablauf einer Phase sollen die Erinnerungsmeldungen (an Gutachter und Kampagnen Besitzer) versendet werden. Es ist möglich mehrere Werte zu spezifizieren und die Werte durch , (Kommas) zu separieren. Die Zeitintervalle sind noch ISO 8601 zu formatieren, zum Beispiel PT12H für 12 Stunden, P2D für zwei Tage, P1W für eine Woche u.s.w. Das Beispiel: PT48H, PT12H besagt, dass die erste Erinnerungsmeldungen 48 Stunden vor Phasenende und die zweite 12 Stunden vor Ende versendet wird. StageDefinitionPanel.notifyWhenNoDecisionHelp=Wenn aktiviert, wird eine 'Phasenende nähert sich' Meldung an einen Gutachter gesendet sofern sie oder er noch offene Fälle zum beurteilen hat. Ist die Option nicht aktiviert erhalten Gutachter ungeachtet noch offener Fälle eine Meldung. (Beachten Sie das Meldungen betreffend sich nähernden Phasenenden in jedem Fall an den Kampagnen Besitzer gesendet werden, ungeachtet dieser Einstellung). @@ -4169,6 +4172,7 @@ ExpressionValuePanel.specifyExpression=Specify expression ExpressionValuePanel.addValueButtonDefaultTitle=Add shadow reference value ExpressionValuePanel.addValueButtonTargetSearchTitle=Add association target search ExpressionValuePanel.addLiteralValueButton=Add literal value +ExpressionValuePanel.associationDefenitionsNotDefined=Association definitions are not defined for the current resource with selected kind/intent parameters. ConstructionType.attribute=Attribut ConstructionType.association=Assoziation/Beziehung operation.Recompute.ALL.members=Neuberechnung aller Mitglieder diff --git a/gui/admin-gui/src/main/resources/localization/Midpoint_en.properties b/gui/admin-gui/src/main/resources/localization/Midpoint_en.properties index 2fa8fb9d310..d8e169b6a3b 100644 --- a/gui/admin-gui/src/main/resources/localization/Midpoint_en.properties +++ b/gui/admin-gui/src/main/resources/localization/Midpoint_en.properties @@ -1488,6 +1488,8 @@ PageCertDefinition.scopeIncludeOrgs=Orgs PageCertDefinition.scopeIncludeServices=Services PageCertDefinition.scopeIncludeResources=Resources PageCertDefinition.scopeIncludeByStatus=Include by activation status +PageCertDefinition.scopeIncludeUsers=Users +PageCertDefinition.scopeRelation=Relation PageCertDefinition.scopeEnabledItemsOnly=Enabled items only PageCertDefinition.stagesDefinition=Stages definition PageCertDefinitions.message.deleteDefinitionPerformed.success=The definition has been successfully deleted. @@ -3687,6 +3689,7 @@ PageCertDefinition.scopeSearchFilterHelp=If only a subset of objects of given ty PageCertDefinition.scopeAssignmentsInducementsHelp=Select what features (assignments, inducements or both) of the objects described above are to be certified. PageCertDefinition.scopeIncludeTargetTypesHelp=When certifying assignments or inducements, you can specify what target types are taken into account. For example, you can say that you want to certify only assignments of roles (to, for example, users). PageCertDefinition.scopeIncludeByStatusHelp=Whether to certify only assignments/inducements that have administrative status set to ENABLED (or not set at all). Note that what is relevant is the administrative status of the assignment, not the administrative status of the assigned object. +PageCertDefinition.scopeRelationHelp=Relation(s) which are to be considered. Value of q:any means "any relation". If no relation is present, org:default (i.e. null) is assumed. StageDefinitionPanel.stageDurationHelp=Duration of this stage, used to determine stage end time. The end time is computed as the moment of stage opening plus the duration, rounded up to 23:59:59 of the last day. Duration is specified in ISO 8601 format, like P14D for 14 days, P3W for 3 weeks, P2M for 2 months, etc. StageDefinitionPanel.notifyBeforeDeadlineHelp=How long before the stage end the reminding notifications (to reviewers and campaign owner) will be sent. It is possible to specify more values; separate them by commas. Time interval is specified in ISO 8601 format, like PT12H for 12 hours, P2D for 2 days, P1W for 1 week, etc. An example: PT48H, PT12H says that the first notification will be sent 48 hours before stage end, and the second one 12 hours before the end. StageDefinitionPanel.notifyWhenNoDecisionHelp=If checked, a 'stage end approaching' notification is sent to a reviewer only if he/she has some cases waiting for his/her decision. If not checked, reviewers always get their notifications - regardless of whether they have provided a decision or not. (Note that notifications to the campaign owner about approaching stage end are always sent, regardless of this setting.) @@ -4169,6 +4172,7 @@ ExpressionValuePanel.specifyExpression=Specify expression ExpressionValuePanel.addValueButtonDefaultTitle=Add shadow reference value ExpressionValuePanel.addValueButtonTargetSearchTitle=Add association target search ExpressionValuePanel.addLiteralValueButton=Add literal value +ExpressionValuePanel.associationDefenitionsNotDefined=Association definitions are not defined for the current resource with selected kind/intent parameters. ConstructionType.attribute=Attribute ConstructionType.association=Association operation.Recompute.ALL.members=Recompute all members diff --git a/gui/admin-gui/src/main/resources/localization/Midpoint_es.properties b/gui/admin-gui/src/main/resources/localization/Midpoint_es.properties index 1a0188c33c1..2f2d4820475 100644 --- a/gui/admin-gui/src/main/resources/localization/Midpoint_es.properties +++ b/gui/admin-gui/src/main/resources/localization/Midpoint_es.properties @@ -1488,6 +1488,8 @@ PageCertDefinition.scopeIncludeOrgs=Organizaciones PageCertDefinition.scopeIncludeServices=Servicios PageCertDefinition.scopeIncludeResources=Recursos PageCertDefinition.scopeIncludeByStatus=Incluir por estado de activación +PageCertDefinition.scopeIncludeUsers=Usuarios +PageCertDefinition.scopeRelation=Relación PageCertDefinition.scopeEnabledItemsOnly=Solo elementos habilitados PageCertDefinition.stagesDefinition=Definición de la etapas PageCertDefinitions.message.deleteDefinitionPerformed.success=La definición fue correctamente eliminada. @@ -1664,12 +1666,12 @@ pageDebugList.dialog.title.confirmDelete=Confirmar eliminación pageDebugList.dialog.title.deleteAll=Eliminar todos los objetos pageDebugList.menu.deleteAllIdentities=Eliminar todas las entidades pageDebugList.menu.deleteAllType=Eliminar todo del tipo seleccionado -pageDebugList.menu.deleteSelected=Eliminar seleccionados +pageDebugList.menu.deleteSelected=Delete selected/filtered pageDebugList.menu.deleteShadowsOnResource=Eliminar todo lo oscuro es los recursos pageDebugList.menu.exportShadowsOnResource=Exportar todos lo oscuro en los recursos pageDebugList.menu.exportAll=Exportar todos los objetos pageDebugList.menu.exportAllSelectedType=Exportar todo del tipo seleccionado -pageDebugList.menu.exportSelected=Exportar seleccionados +pageDebugList.menu.exportSelected=Export selected/filtered pageDebugList.message.countSearchProblem=No se pudo realizar la operación de búsqueda de los usuarios/shadows/unidades org. pageDebugList.message.createFileException=No se pudo crear el fichero para su descarga. pageDebugList.message.deleteAllType=¿Realmente quiere eliminar todos los objetos de tipo "{0}"? @@ -3687,6 +3689,7 @@ PageCertDefinition.scopeSearchFilterHelp=Si solo un subgrupo de objetos del tipo PageCertDefinition.scopeAssignmentsInducementsHelp=Elige que característica (asignaciones, inducciones o ambas) del objeto descrito arriba van a ser certificadas. PageCertDefinition.scopeIncludeTargetTypesHelp=Cuando se certifican asignaciones o inducciones, puede especificar el tipo del objetivo que será tenido en cuenta. Por ejemplo, puede decir que solo quiere certificar las asignaciones de roles (a usuarios, por ejemplo). PageCertDefinition.scopeIncludeByStatusHelp=Certificar solo asignaciones/inducciones que tengan estado administrativo habilitado (o no seteado). Notar que es relevante solo el estado administrativo de la asignación, no del objeto asignado. +PageCertDefinition.scopeRelationHelp=Relation(s) which are to be considered. Value of q:any means "any relation". If no relation is present, org:default (i.e. null) is assumed. StageDefinitionPanel.stageDurationHelp=Duration of this stage, used to determine stage end time. The end time is computed as the moment of stage opening plus the duration, rounded up to 23:59:59 of the last day. Duration is specified in ISO 8601 format, like P14D for 14 days, P3W for 3 weeks, P2M for 2 months, etc. StageDefinitionPanel.notifyBeforeDeadlineHelp=How long before the stage end the reminding notifications (to reviewers and campaign owner) will be sent. It is possible to specify more values; separate them by commas. Time interval is specified in ISO 8601 format, like PT12H for 12 hours, P2D for 2 days, P1W for 1 week, etc. An example: PT48H, PT12H says that the first notification will be sent 48 hours before stage end, and the second one 12 hours before the end. StageDefinitionPanel.notifyWhenNoDecisionHelp=If checked, a 'stage end approaching' notification is sent to a reviewer only if he/she has some cases waiting for his/her decision. If not checked, reviewers always get their notifications - regardless of whether they have provided a decision or not. (Note that notifications to the campaign owner about approaching stage end are always sent, regardless of this setting.) @@ -4169,6 +4172,7 @@ ExpressionValuePanel.specifyExpression=Specify expression ExpressionValuePanel.addValueButtonDefaultTitle=Add shadow reference value ExpressionValuePanel.addValueButtonTargetSearchTitle=Add association target search ExpressionValuePanel.addLiteralValueButton=Add literal value +ExpressionValuePanel.associationDefenitionsNotDefined=Association definitions are not defined for the current resource with selected kind/intent parameters. ConstructionType.attribute=Ref. ConstructionType.association=Asociación operation.Recompute.ALL.members=Recomputar todos los miembros diff --git a/gui/admin-gui/src/main/resources/localization/Midpoint_et.properties b/gui/admin-gui/src/main/resources/localization/Midpoint_et.properties index 1dde2e17396..84ffff12101 100644 --- a/gui/admin-gui/src/main/resources/localization/Midpoint_et.properties +++ b/gui/admin-gui/src/main/resources/localization/Midpoint_et.properties @@ -1488,6 +1488,8 @@ PageCertDefinition.scopeIncludeOrgs=Organisatsioonid PageCertDefinition.scopeIncludeServices=Teenused PageCertDefinition.scopeIncludeResources=Ressursid PageCertDefinition.scopeIncludeByStatus=Kaasamine aktiveerimise oleku põhjal +PageCertDefinition.scopeIncludeUsers=Kasutajad +PageCertDefinition.scopeRelation=Relatsioon PageCertDefinition.scopeEnabledItemsOnly=Ainult lubatud üksused PageCertDefinition.stagesDefinition=Etappide määratlus PageCertDefinitions.message.deleteDefinitionPerformed.success=The definition has been successfully deleted. @@ -1664,12 +1666,12 @@ pageDebugList.dialog.title.confirmDelete=Kustutuse kinnitamine pageDebugList.dialog.title.deleteAll=Kustuta kõik objektid pageDebugList.menu.deleteAllIdentities=Kustuta kõik identiteedid pageDebugList.menu.deleteAllType=Kustuta kõik valitud tüüpi -pageDebugList.menu.deleteSelected=Kustuta valitud objektid +pageDebugList.menu.deleteSelected=Delete selected/filtered pageDebugList.menu.deleteShadowsOnResource=Kustuta ressursi kõik varjud pageDebugList.menu.exportShadowsOnResource=Ekspordi ressursi kõik varjud pageDebugList.menu.exportAll=Ekspordi kõik objektid pageDebugList.menu.exportAllSelectedType=Ekspordi kõik valitud tüüpi -pageDebugList.menu.exportSelected=Ekspordi valitud objektid +pageDebugList.menu.exportSelected=Export selected/filtered pageDebugList.message.countSearchProblem=Ei õnnestunud sooritada otsingu toimingut kasutajatel/varjudel/org. üksustel. pageDebugList.message.createFileException=Ei saanud luua allalaadimiseks faili. pageDebugList.message.deleteAllType=Kas soovid kindlasti kustutada kõik "{0}" tüüpi objektid? @@ -3687,6 +3689,7 @@ PageCertDefinition.scopeSearchFilterHelp=Kui soovitakse sertida ainult antud tü PageCertDefinition.scopeAssignmentsInducementsHelp=Vali, milliseid ülalkirjeldatud objektide tunnuseid (omistusi, tekitusi või mõlemaid) serditakse. PageCertDefinition.scopeIncludeTargetTypesHelp=Omistuste ja tekituste sertimisel saad määratleda, milliseid tüüpe arvesse võetakse. Näiteks võid öelda, et soovid sertida ainult rollide omistusi (näiteks kasutajatele). PageCertDefinition.scopeIncludeByStatusHelp=Kas sertida ainult omistused/tekitused, mille haldusolekuks on LUBATUD (või millel väärtus puudub). Pane tähele, et see puudutab omistuse haldusolekut, mitte omistatud objekti haldusolekut. +PageCertDefinition.scopeRelationHelp=Relation(s) which are to be considered. Value of q:any means "any relation". If no relation is present, org:default (i.e. null) is assumed. StageDefinitionPanel.stageDurationHelp=Selle etapi kestus. Seda kasutatakse etapi lõpuaja kindlakstegemiseks. Lõpuaeg arvutatakse etapi avamise hetkest, millele lisatakse kestus, ümardatuna viimase päeva ajani 23:59:59. Kestust kirjeldatakse ISO 8601 vormingus, näiteks P14D 14 päeva puhul, P3W 3 nädala puhul, P2M 2 kuu puhul, jne. StageDefinitionPanel.notifyBeforeDeadlineHelp=Kui kaua enne etapi lõppemist saadetakse meeldetuletavad teavitused (läbivaatajatele ja kampaania omanikule). Võimalik on määratleda mitu komaga eraldatud väärtust. Ajavahemik määratletakse ISO 8601 vormingus, näiteks PT12H 12 tunni puhul, P2D 2 päeva puhul, P1W 1 nädala puhul, jne. Näide: PT48H, PT12H ütleb, et esimene teavitus saadetakse 48 tundi enne etapi lõppu ja teine teavitus saadetakse 12 tundi enne lõppu. StageDefinitionPanel.notifyWhenNoDecisionHelp=Kui on linnutatud, saadetakse läbivaatajale teavitus 'etapi lõpp on saabumas' ainult siis kui ta omab mõningaid juhtumeid, mis ootavad tema otsust. Kui see on linnutamata, saavad läbivaatajad alati teavituse, sõltumata sellest, kas nad on otsustamise läbi teinud või mitte. (Pane tähele, et kampaania omanikule saadetakse alati teavitus etapi lõppemisest, sõltumata sellest sättest.) @@ -4169,6 +4172,7 @@ ExpressionValuePanel.specifyExpression=Specify expression ExpressionValuePanel.addValueButtonDefaultTitle=Add shadow reference value ExpressionValuePanel.addValueButtonTargetSearchTitle=Add association target search ExpressionValuePanel.addLiteralValueButton=Add literal value +ExpressionValuePanel.associationDefenitionsNotDefined=Association definitions are not defined for the current resource with selected kind/intent parameters. ConstructionType.attribute=Atribuut ConstructionType.association=Association operation.Recompute.ALL.members=Arvuta uuesti kõik liikmed diff --git a/gui/admin-gui/src/main/resources/localization/Midpoint_fi.properties b/gui/admin-gui/src/main/resources/localization/Midpoint_fi.properties index a79d5f26405..021bfdce666 100644 --- a/gui/admin-gui/src/main/resources/localization/Midpoint_fi.properties +++ b/gui/admin-gui/src/main/resources/localization/Midpoint_fi.properties @@ -1488,6 +1488,8 @@ PageCertDefinition.scopeIncludeOrgs=Organisaatiot PageCertDefinition.scopeIncludeServices=Palvelut PageCertDefinition.scopeIncludeResources=Resurssit PageCertDefinition.scopeIncludeByStatus=Laske mukaan aktivointistatuksen mukaisesti +PageCertDefinition.scopeIncludeUsers=Käyttäjät +PageCertDefinition.scopeRelation=Yhteys PageCertDefinition.scopeEnabledItemsOnly=Vain käyttöön otetut tehtävät PageCertDefinition.stagesDefinition=Vaiheiden määritys PageCertDefinitions.message.deleteDefinitionPerformed.success=The definition has been successfully deleted. @@ -1664,12 +1666,12 @@ pageDebugList.dialog.title.confirmDelete=Vahvista poista pageDebugList.dialog.title.deleteAll=Poista Kaikki Objektit pageDebugList.menu.deleteAllIdentities=Poista kaikki identiteetit pageDebugList.menu.deleteAllType=Poista kaikki valitun tyyppiset -pageDebugList.menu.deleteSelected=Poista valitut +pageDebugList.menu.deleteSelected=Delete selected/filtered pageDebugList.menu.deleteShadowsOnResource=Poista kaikki varjot resurssista pageDebugList.menu.exportShadowsOnResource=Vie kaikki varjot resurssista pageDebugList.menu.exportAll=Vie kaikki objektit pageDebugList.menu.exportAllSelectedType=Vie kaikki valitun tyyppiset -pageDebugList.menu.exportSelected=Vie valitut +pageDebugList.menu.exportSelected=Export selected/filtered pageDebugList.message.countSearchProblem=Ei pystytty suorittaa haku operaatiota tileistä/varjoista/org. yksiköistä pageDebugList.message.createFileException=Ei pystytty luomaan tiedostoa imuroitavaksi. pageDebugList.message.deleteAllType=Haluatko varmasti poistaa kaikki tyyppiä "{0}" olevat objektit? @@ -3687,6 +3689,7 @@ PageCertDefinition.scopeSearchFilterHelp=Jos vain osan valitun tyyppisten objekt PageCertDefinition.scopeAssignmentsInducementsHelp=Valitse mitkä yllä kuvailtujen objektien ominaisuudet (toimeeksiannot, vaikuttimet tai molemmat) sertifioidaan. PageCertDefinition.scopeIncludeTargetTypesHelp=Kun sertifiodaan toimeeksiantoja tai vaikuttimia, voit tarkentaa mitkä kohdetyypit otetaan huomioon. Esimerkiksi voit valita, että haluat sertifioida vain roolien toimeeksiannot (esimerkiksi käyttäjille). PageCertDefinition.scopeIncludeByStatusHelp=Josko sertifioidaan fain toimeeksiannot/vaikuttimet joille on asettu hallinnolinen tila PÄÄLLE (tai ei asetettu ollenkaan). Ota huomioon, että tärkeää on toimeeksiannon hallinnollinen tila, ei osoitetun objektin hallinnollinen tila. +PageCertDefinition.scopeRelationHelp=Relation(s) which are to be considered. Value of q:any means "any relation". If no relation is present, org:default (i.e. null) is assumed. StageDefinitionPanel.stageDurationHelp=Tämän vaiheen kesto, käytetään vaiheen lopetusajan määrittämiseen. Lopetusajaksi lasketaan vaiheen aloitus hetki plus kesto, pyöristettynä maksimissaan viimeisen päivän 23:59:59:ään. Kesto määritetään ISO 8601 formaatissa, kuten P14D 14 päivälle, P3W 3 viikolle, p2M 2 kuukaudelle, jne. StageDefinitionPanel.notifyBeforeDeadlineHelp=Kuinka kauan ennen vaiheen loppua muistutus viestit (tarkastajille ja kampanjan omistajalle) lähetään. On mahdollista asettaa useampi arvo; erota ne pilkuilla. Aikaväli määriteään ISO 8601 formaatissa, eli PT12H 12 tunnille, P2D kahdelle päivälle, P1W 1 viikolle, jne. Esim.: PT48H,PT12H kertoo, että ensimmäinen muistutus lähetetään 48 tuntia ennen vaiheen loppua, ja toinen muistutus 12 tuntia ennen loppua. StageDefinitionPanel.notifyWhenNoDecisionHelp=jos valittuna, 'Vaiheen loppu lähestyy' ilmoitus lähetetään tarkastajalle vain jos hänellä on joitain tapauksia odottamassa hänen päätöstä. Jos ei valittuna, tarkastajat saavat aina ilmoituksen - riippumatta onko hän tehnyt päätöksen tai ei. (ota huomioon, että ilmoitukset kampanjan omistajalle vaiheen lähestyvästä lopusta lähetetään aina, tästä asetuksesta riippumatta.) @@ -4169,6 +4172,7 @@ ExpressionValuePanel.specifyExpression=Specify expression ExpressionValuePanel.addValueButtonDefaultTitle=Add shadow reference value ExpressionValuePanel.addValueButtonTargetSearchTitle=Add association target search ExpressionValuePanel.addLiteralValueButton=Add literal value +ExpressionValuePanel.associationDefenitionsNotDefined=Association definitions are not defined for the current resource with selected kind/intent parameters. ConstructionType.attribute=Attribuutti ConstructionType.association=Association operation.Recompute.ALL.members=Laske uudelleen kaikki jäsenet diff --git a/gui/admin-gui/src/main/resources/localization/Midpoint_fr.properties b/gui/admin-gui/src/main/resources/localization/Midpoint_fr.properties index 6d73ba31d22..706ce51efc0 100644 --- a/gui/admin-gui/src/main/resources/localization/Midpoint_fr.properties +++ b/gui/admin-gui/src/main/resources/localization/Midpoint_fr.properties @@ -634,7 +634,7 @@ NotificationsStatistics.MinTime=Min. NotificationsStatistics.TotalTime=Durée totale NotificationsStatistics.Transport=Transport nullValid=Choisissez... -ObjectDataProvider.message.listObjects.fatalError=Couldn't list objects +ObjectDataProvider.message.listObjects.fatalError=Impossible de lister les objets ObjectDataProvider.message.countObjects.fatalError=Impossible de compter les objets. ObjectDataProvider.message.loadResourceForAccount.fatalError=Couldn't load resource for account. ObjectDeltaOperationPanel.message.fetchOrVisualize.fatalError=Couldn't fetch or visualize the delta: {0} @@ -1010,7 +1010,7 @@ PageAbout.button.testRepositoryCheckOrgClosure=Contrôler et réparer la cohére PageAbout.button.reindexRepositoryObjects=Réindexer les objets du dépôt PageAbout.button.testRepository=Autotest du dépôt PageAbout.button.clearCssJsCache=Vider le cache CSS/JS -PageAbout.button.factoryDefault=Reset to factory default +PageAbout.button.factoryDefault=Rétablir les réglages par défaut PageAbout.message.deleteAllObjects=Voulez-vous vraiment supprimer tous les objets ? Cela peut prendre plusieurs minutes. PageAbout.message.couldntObtainJvmParams=Impossible d'obtenir les paramètres JVM depuis JMX. PageAbout.midPointRevision=${git.describe} @@ -1488,6 +1488,8 @@ PageCertDefinition.scopeIncludeOrgs=Orgs PageCertDefinition.scopeIncludeServices=Services PageCertDefinition.scopeIncludeResources=Ressources PageCertDefinition.scopeIncludeByStatus=Inclure selon l'état d'activation +PageCertDefinition.scopeIncludeUsers=Utilisateurs +PageCertDefinition.scopeRelation=Relation PageCertDefinition.scopeEnabledItemsOnly=Éléments activés uniquement PageCertDefinition.stagesDefinition=Définition des phases PageCertDefinitions.message.deleteDefinitionPerformed.success=La définition a été supprimée avec succès. @@ -1543,7 +1545,7 @@ StageDefinitionPanel.moveStageRightButton = Déplacer vers la droite StageDefinitionPanel.deleteStageButton = Supprimer cette phase PageBase.message.parseObject.fatalError=Couldn't parse object: {0} PageBase.message.loadAdminGuiConfiguration.fatalError=Couldn't load system configuration. -PageBase.message.loadDeploymentInformationType.fatalError=Couldn't load deployment information. +PageBase.message.loadDeploymentInformationType.fatalError=Impossible de charger les informations de déploiement. PageBase.message.getAdministratorPrivileged.fatalError=Impossible d'obtenir l'utilisateur administrateur : {0} PageContacts.title=Navigateur de contacts pageContentAccounts.button.searchButton=Rechercher @@ -1646,9 +1648,9 @@ PageDashboard.infobox.tasks.label=Tâches PageDashboard.infobox.tasks.number=active(s) PageDashboard.infobox.tasks.total=au total PageDashboard.infobox.modifications.label=Changements -PageDashboard.infobox.modifications.number=success +PageDashboard.infobox.modifications.number=réussis PageDashboard.infobox.errors.label=Erreurs -PageDashboard.infobox.errors.number=failed +PageDashboard.infobox.errors.number=ratées PageDashboard.infobox.moreInfo=Plus d'information PageDashboard.search.input=Entrez le nom à rechercher PageDashboard.search.users=Utilisateurs @@ -1664,12 +1666,12 @@ pageDebugList.dialog.title.confirmDelete=Confirmation de suppression pageDebugList.dialog.title.deleteAll=Suppression de tous les objets pageDebugList.menu.deleteAllIdentities=Supprimer toutes les identités pageDebugList.menu.deleteAllType=Supprimer tous les objets du type sélectionné -pageDebugList.menu.deleteSelected=Supprimer les éléments sélectionnés +pageDebugList.menu.deleteSelected=Supprimer les éléments sélectionnés/filtrés pageDebugList.menu.deleteShadowsOnResource=Supprimer tous les reflets de la ressource pageDebugList.menu.exportShadowsOnResource=Exporter tous les reflets de la ressource pageDebugList.menu.exportAll=Exporter tous les objets pageDebugList.menu.exportAllSelectedType=Exporter tous les éléments du type sélectionné -pageDebugList.menu.exportSelected=Exporter les éléments sélectionnés +pageDebugList.menu.exportSelected=Exporter les éléments sélectionnés/filtrés pageDebugList.message.countSearchProblem=Impossible de réaliser l'opération de recherche sur les utilisateurs / reflets / entités organisationnelles pageDebugList.message.createFileException=Impossible de créer le fichier pour le téléchargement. pageDebugList.message.deleteAllType=Voulez-vous vraiment supprimer tous les objets de type « {0} » ? @@ -2295,11 +2297,11 @@ pageTasks.message.scheduleTasksPerformed.success=L'exécution des tâches a ét pageTasks.message.scheduleTasksPerformed.fatalError=Impossible de planifier la/les tâche(s) pageTasks.message.stopSchedulersAndTasksPerformed.success=Les ordonnanceurs des nœuds sélectionnés ont été arrêtés avec succès, de même que leurs tâches en cours d'exécution. pageTasks.message.stopSchedulersAndTasksPerformed.warning=Les ordonnanceurs des nœuds sélectionnés ont été suspendus avec succès ; cependant, certaines tâches qu'ils exécutaient sont encore en cours. Veuillez contrôler leur achèvement au moyen de la liste des tâches. -pageTasks.message.stopSchedulersAndTasksPerformed.fatalError=Couldn't stop schedulers due +pageTasks.message.stopSchedulersAndTasksPerformed.fatalError=Impossible d'arrêter les ordonnanceurs pageTasks.message.startSchedulersPerformed.success=Les ordonnanceurs des nœuds sélectionnés ont été démarrés avec succès. pageTasks.message.startSchedulersPerformed.fatalError=Impossible de démarrer le/les ordonnanceur(s) pageTasks.message.stopSchedulersPerformed.success=Les ordonnanceurs des nœuds sélectionnés ont été arrêtés avec succès. -pageTasks.message.stopSchedulersPerformed.fatalError=Impossible d'arrêter le/les ordonnanceur(s) +pageTasks.message.stopSchedulersPerformed.fatalError=Impossible d'arrêter le(s) ordonnanceur(s) pageTasks.message.deleteNodesPerformed.success=Le(s) nœud(s) sélectionné(s) a/ont été supprimé(s) avec succès. pageTasks.message.deleteNodesPerformed.fatalError=Impossible de supprimer le nœud pageTasks.message.deactivateServiceThreadsPerformed.success=Les exétrons de service sur le nœud local ont été désactivés avec succès. @@ -2506,7 +2508,7 @@ MultipleAssignmentSelector.orgUnit=Entité org. AssignmentPopup.addButtonTitle=Veuillez sélectionner au moins 1 objet pageValuePolicies.table.description=Description pageValuePolicies.button.delete=Supprimer -PageValuePolicies.title=All value policies +PageValuePolicies.title=Toutes les politiques de valeurs PageValuePolicy.title = Politique de valeur PageValuePolicy.button.back=Retour PageValuePolicy.button.save=Enregistrer @@ -3687,6 +3689,7 @@ PageCertDefinition.scopeSearchFilterHelp=Si seul un sous-ensemble des objets d'u PageCertDefinition.scopeAssignmentsInducementsHelp=Sélectionner les caractéristiques des objets ci-dessus devant être certifiées : les attributions, les inductions ou les deux. PageCertDefinition.scopeIncludeTargetTypesHelp=Lors de la certification des attributions ou inductions, vous pouvez spécifier quels types de cibles prendre en compte. Par exemple, vous pouvez indiquer que vous voulez certifier uniquement l'attribution des rôles (par exemple à des utilisateurs). PageCertDefinition.scopeIncludeByStatusHelp=Indique s'il faut certifier uniquement les attributions / incitations dont le statut administratif est défini sur ACTIVÉ (ou non défini du tout). Notez que ce qui est pertinent est le statut administratif de l'attribution, pas le statut administratif de l'objet assigné. +PageCertDefinition.scopeRelationHelp=Relation(s) which are to be considered. Value of q:any means "any relation". If no relation is present, org:default (i.e. null) is assumed. StageDefinitionPanel.stageDurationHelp=Pendant cette phase, utilisé pour déterminer l'heure de fin. L'heure de fin est calculée par addition de la durée à l'heure de l'ouverture de la phase, arrondie à 23h59m59s du dernier jour. La durée est spécifiée en format ISO 8601, par exemple P14D pour 14 jours, P3W pour 3 semaines, P2M pour 2 mois, etc. StageDefinitionPanel.notifyBeforeDeadlineHelp=Combien de temps s'écoule avant l'envoi de notifications de rappel de fin de phase (aux vérificateurs et au propriétaire de la campagne). Il est possible de spécifier plus de valeurs ; séparez-les par des virgules. L'intervalle de temps est spécifié au format ISO 8601, comme PT12H pour 12 heures, P2D pour 2 jours, P1W pour 1 semaine, etc. Exemple : « PT48H, PT12H » indique que la première notification sera envoyée 48 heures avant la fin de la phase et la seconde 12 heures avant la fin. StageDefinitionPanel.notifyWhenNoDecisionHelp=Si cette case est cochée, une notification « fin de phase proche » est envoyée à un vérificateur uniquement si certains cas sont en attente de sa décision. Si cette case n'est pas cochée, les relecteurs reçoivent toujours leurs notifications, qu'ils aient ou non pris une décision. (Notez que les notifications au propriétaire de la campagne concernant l'approche de la fin de la phase sont toujours envoyées, peu importe la configuration de ce paramètre.) @@ -4169,6 +4172,7 @@ ExpressionValuePanel.specifyExpression=Specify expression ExpressionValuePanel.addValueButtonDefaultTitle=Add shadow reference value ExpressionValuePanel.addValueButtonTargetSearchTitle=Ajouter une recherche de cible de l'association ExpressionValuePanel.addLiteralValueButton=Ajouter une valeur littérale +ExpressionValuePanel.associationDefenitionsNotDefined=Association definitions are not defined for the current resource with selected kind/intent parameters. ConstructionType.attribute=Attribut ConstructionType.association=Association operation.Recompute.ALL.members=Recalculer tous les membres diff --git a/gui/admin-gui/src/main/resources/localization/Midpoint_hu.properties b/gui/admin-gui/src/main/resources/localization/Midpoint_hu.properties index 67c1c881e0b..67ca266f8ef 100644 --- a/gui/admin-gui/src/main/resources/localization/Midpoint_hu.properties +++ b/gui/admin-gui/src/main/resources/localization/Midpoint_hu.properties @@ -1488,6 +1488,8 @@ PageCertDefinition.scopeIncludeOrgs=Szervezetek PageCertDefinition.scopeIncludeServices=Szolgáltatások PageCertDefinition.scopeIncludeResources=Erőforrások PageCertDefinition.scopeIncludeByStatus=Include by activation status +PageCertDefinition.scopeIncludeUsers=Felhasználók +PageCertDefinition.scopeRelation=Kapcsolat PageCertDefinition.scopeEnabledItemsOnly=Enabled items only PageCertDefinition.stagesDefinition=Stages definition PageCertDefinitions.message.deleteDefinitionPerformed.success=The definition has been successfully deleted. @@ -1664,12 +1666,12 @@ pageDebugList.dialog.title.confirmDelete=Törlés megerősítése pageDebugList.dialog.title.deleteAll=Delete All Objects pageDebugList.menu.deleteAllIdentities=Delete all identities pageDebugList.menu.deleteAllType=Delete all of selected type -pageDebugList.menu.deleteSelected=Delete selected +pageDebugList.menu.deleteSelected=Delete selected/filtered pageDebugList.menu.deleteShadowsOnResource=Delete all shadows on resource pageDebugList.menu.exportShadowsOnResource=Export all shadows on resource pageDebugList.menu.exportAll=Export all objects pageDebugList.menu.exportAllSelectedType=Export all of selected type -pageDebugList.menu.exportSelected=Export selected +pageDebugList.menu.exportSelected=Export selected/filtered pageDebugList.message.countSearchProblem=Couldn't perform search operation on users/shadows/org. units pageDebugList.message.createFileException=Couldn't create file for download. pageDebugList.message.deleteAllType=Do you really want to delete all objects of type "{0}"? @@ -3687,6 +3689,7 @@ PageCertDefinition.scopeSearchFilterHelp=If only a subset of objects of given ty PageCertDefinition.scopeAssignmentsInducementsHelp=Select what features (assignments, inducements or both) of the objects described above are to be certified. PageCertDefinition.scopeIncludeTargetTypesHelp=When certifying assignments or inducements, you can specify what target types are taken into account. For example, you can say that you want to certify only assignments of roles (to, for example, users). PageCertDefinition.scopeIncludeByStatusHelp=Whether to certify only assignments/inducements that have administrative status set to ENABLED (or not set at all). Note that what is relevant is the administrative status of the assignment, not the administrative status of the assigned object. +PageCertDefinition.scopeRelationHelp=Relation(s) which are to be considered. Value of q:any means "any relation". If no relation is present, org:default (i.e. null) is assumed. StageDefinitionPanel.stageDurationHelp=Duration of this stage, used to determine stage end time. The end time is computed as the moment of stage opening plus the duration, rounded up to 23:59:59 of the last day. Duration is specified in ISO 8601 format, like P14D for 14 days, P3W for 3 weeks, P2M for 2 months, etc. StageDefinitionPanel.notifyBeforeDeadlineHelp=How long before the stage end the reminding notifications (to reviewers and campaign owner) will be sent. It is possible to specify more values; separate them by commas. Time interval is specified in ISO 8601 format, like PT12H for 12 hours, P2D for 2 days, P1W for 1 week, etc. An example: PT48H, PT12H says that the first notification will be sent 48 hours before stage end, and the second one 12 hours before the end. StageDefinitionPanel.notifyWhenNoDecisionHelp=If checked, a 'stage end approaching' notification is sent to a reviewer only if he/she has some cases waiting for his/her decision. If not checked, reviewers always get their notifications - regardless of whether they have provided a decision or not. (Note that notifications to the campaign owner about approaching stage end are always sent, regardless of this setting.) @@ -4169,6 +4172,7 @@ ExpressionValuePanel.specifyExpression=Specify expression ExpressionValuePanel.addValueButtonDefaultTitle=Add shadow reference value ExpressionValuePanel.addValueButtonTargetSearchTitle=Add association target search ExpressionValuePanel.addLiteralValueButton=Add literal value +ExpressionValuePanel.associationDefenitionsNotDefined=Association definitions are not defined for the current resource with selected kind/intent parameters. ConstructionType.attribute=Attríbútum ConstructionType.association=Összerendelés operation.Recompute.ALL.members=Recompute all members diff --git a/gui/admin-gui/src/main/resources/localization/Midpoint_it.properties b/gui/admin-gui/src/main/resources/localization/Midpoint_it.properties index f7d82466e2a..6a949c698d9 100644 --- a/gui/admin-gui/src/main/resources/localization/Midpoint_it.properties +++ b/gui/admin-gui/src/main/resources/localization/Midpoint_it.properties @@ -1488,6 +1488,8 @@ PageCertDefinition.scopeIncludeOrgs=Unità Organizzative PageCertDefinition.scopeIncludeServices=Servizi PageCertDefinition.scopeIncludeResources=Risorse PageCertDefinition.scopeIncludeByStatus=Includi per stato di attivazione +PageCertDefinition.scopeIncludeUsers=Utenti +PageCertDefinition.scopeRelation=Relazione PageCertDefinition.scopeEnabledItemsOnly=Solo elementi abilitati PageCertDefinition.stagesDefinition=Definizione Fasi PageCertDefinitions.message.deleteDefinitionPerformed.success=La definizione è stata cancellata con successo. @@ -1664,12 +1666,12 @@ pageDebugList.dialog.title.confirmDelete=Conferma cancellazione pageDebugList.dialog.title.deleteAll=Elimini Tutti gli Oggetti pageDebugList.menu.deleteAllIdentities=Elimina tutte le identità pageDebugList.menu.deleteAllType=Elimina tutto il tipo selezionato -pageDebugList.menu.deleteSelected=Elimina selezionati +pageDebugList.menu.deleteSelected=Delete selected/filtered pageDebugList.menu.deleteShadowsOnResource=Elimina tutti gli shadow nella risorsa pageDebugList.menu.exportShadowsOnResource=Esporta tutti gli shadows nella risorsa pageDebugList.menu.exportAll=Esporta tutti gli oggetti pageDebugList.menu.exportAllSelectedType=Esporta tutto il tipo selezionato -pageDebugList.menu.exportSelected=Esporta selezionati +pageDebugList.menu.exportSelected=Export selected/filtered pageDebugList.message.countSearchProblem=Impossibile eseguire operazioni di ricerca su utenti /shadow/unita' organizzative pageDebugList.message.createFileException=Impossibile creare il file per il download. pageDebugList.message.deleteAllType=Vuoi davvero cancellare tutti gli oggetti di tipo "{0}"? @@ -3687,6 +3689,7 @@ PageCertDefinition.scopeSearchFilterHelp=Se solo un sottoinsieme di oggetti di u PageCertDefinition.scopeAssignmentsInducementsHelp=Selezionare quali caratteristiche (assegnazioni, incarichi o entrambi) degli oggetti sopra descritti devono essere certificate. PageCertDefinition.scopeIncludeTargetTypesHelp=Quando si certificano assegnazioni o incarichi, è possibile specificare quali tipi di target vengono presi in considerazione. Ad esempio, è possibile indicare che si desidera certificare solo assegnazioni di ruoli (ad esempio per gli utenti). PageCertDefinition.scopeIncludeByStatusHelp=Se certificare solo assegnazioni/incarichicon stato amministrativo impostato su ABILITATO (o non impostato affatto). Si noti che ciò che è rilevante è lo stato amministrativo dell'assegnazione, non lo stato amministrativo dell'oggetto assegnato. +PageCertDefinition.scopeRelationHelp=Relazione(i) che devono essere considerate. Valore di q:any significa "qualsiasi relazione". Se non è presente alcuna relazione, org:default cioè il valore predefinito (null). StageDefinitionPanel.stageDurationHelp=Durata di questa fase, utilizzata per determinare l'ora di fine della fase. L'ora di fine è calcolata dal momento dell'apertura sommando la durata, arrotondata alle 23:59:59 dell'ultimo giorno. La durata è specificata nel formato ISO 8601, come P14D per 14 giorni, P3W per 3 settimane, P2M per 2 mesi, ecc. StageDefinitionPanel.notifyBeforeDeadlineHelp=Quanto tempo prima della fine della fase verranno inviate le notifiche di promemoria (ai revisori e al proprietario della campagna). È possibile specificare più valori; separarli da virgole. L'intervallo di tempo è specificato nel formato ISO 8601, come PT12H per 12 ore, P2D per 2 giorni, P1W per 1 settimana, ecc. Un esempio: PT48H, PT12H dice che la prima notifica verrà inviata 48 ore prima della fine della fase e la seconda una 12 ore prima della fine. StageDefinitionPanel.notifyWhenNoDecisionHelp=Se selezionato, una notifica di "fine fase in avvicinamento" viene inviata a un revisore solo se lui/lei ha dei casi in attesa della sua decisione. Se non selezionato, i revisori ottengono sempre le loro notifiche, indipendentemente dal fatto che abbiano fornito una decisione o meno. (Tieni presente che le notifiche al proprietario della campagna sull'approssimarsi della fase finale vengono sempre inviate, indipendentemente da questa impostazione.) @@ -4169,6 +4172,7 @@ ExpressionValuePanel.specifyExpression=Specifica espressione ExpressionValuePanel.addValueButtonDefaultTitle=Aggiungi il valore del riferimento shadow ExpressionValuePanel.addValueButtonTargetSearchTitle=Aggiungi ricerca target di associazione ExpressionValuePanel.addLiteralValueButton=Aggiungi valore letterale +ExpressionValuePanel.associationDefenitionsNotDefined=Association definitions are not defined for the current resource with selected kind/intent parameters. ConstructionType.attribute=Attributo ConstructionType.association=Associazione operation.Recompute.ALL.members=Ricalcola tutti i membri diff --git a/gui/admin-gui/src/main/resources/localization/Midpoint_ja.properties b/gui/admin-gui/src/main/resources/localization/Midpoint_ja.properties index 13d4f88827f..fb0a07e4c9e 100644 --- a/gui/admin-gui/src/main/resources/localization/Midpoint_ja.properties +++ b/gui/admin-gui/src/main/resources/localization/Midpoint_ja.properties @@ -417,8 +417,8 @@ ItemApprovalPanel.approvalSchema=スキーマを承認 ItemApprovalPanel.currentWorkItems=現在の作業アイテム ItemApprovalPanel.nextStages=次のステージ ItemApprovalPanel.wholeProcess=承認プロセス全体 -ItemApprovalPanel.decisionsDoneWhenFinishedIs_false=これまでに完了されたデジション -ItemApprovalPanel.decisionsDoneWhenFinishedIs_true=デジションの完了 +ItemApprovalPanel.decisionsDoneWhenFinishedIs_false=これまでに行われてきた決定 +ItemApprovalPanel.decisionsDoneWhenFinishedIs_true=行われた決定 ItemApprovalPanel.itemThatWasApproved=考慮済み(で承認済み)のアイテム ItemApprovalPanel.itemThatWasCompleted=完了したアイテム ItemApprovalPanel.itemThatWasRejected=考慮済み(で拒否済み)のアイテム @@ -504,7 +504,7 @@ LoggingConfigPanel.loggers=ロガー LoggingConfigPanel.profiling.dumpInterval=ダンプ・インターバル LoggingConfigPanel.profiling.dumpInterval.placeholder=ダンプ・インターバル LoggingConfigPanel.profiling.dumpInterval.tooltip=分単位で値を指定します(デフォルトは30分です)。 -LoggingConfigPanel.profiling.entryExit=エントリー/エグジットのプロファイリング +LoggingConfigPanel.profiling.entryExit=開始/終了のプロファイリング LoggingConfigPanel.profiling.general=プロファイリング LoggingConfigPanel.profiling.performanceStatistics=パフォーマンス統計 LoggingConfigPanel.profiling.requestFilter=リクエスト・フィルター @@ -1010,7 +1010,7 @@ PageAbout.button.testRepositoryCheckOrgClosure=組織閉鎖の整合性確認と PageAbout.button.reindexRepositoryObjects=リポジトリ・オブジェクトの再インデックス PageAbout.button.testRepository=リポジトリ自己診断 PageAbout.button.clearCssJsCache=CSS/JSキャッシュの削除 -PageAbout.button.factoryDefault=Reset to factory default +PageAbout.button.factoryDefault=工場出荷状態へリセット PageAbout.message.deleteAllObjects=本当にすべてのオブジェクトを削除しますか?この操作は数分かかることがあります。 PageAbout.message.couldntObtainJvmParams=JMXからJVMパラメータを取得できませんでした。 PageAbout.midPointRevision=${git.describe} @@ -1158,8 +1158,8 @@ PageAdmin.menu.top.workItems=作業アイテム PageAdmin.menu.top.workItems.listAttorney=代理人アイテム PageAdmin.menu.top.caseWorkItems.list=私のケースの作業アイテム PageAdmin.menu.top.caseWorkItems.listAll=すべての作業アイテムのケース -PageAdmin.menu.top.caseWorkItems.view=View case work item -PageAdmin.menu.top.case.new=New case +PageAdmin.menu.top.caseWorkItems.view=ケース作業アイテムの表示 +PageAdmin.menu.top.case.new=新規ケース PageAdmin.menu.top.cases.list=私のケース PageAdmin.menu.top.cases.listAll=すべてのケース pageAdmin.reports.description=レポートのエクスポート @@ -1388,7 +1388,7 @@ PageCertCampaign.escalationLevel=エスカレーション・レベル PageCertCampaign.statistics.accept=承諾 PageCertCampaign.statistics.delegate=委任 PageCertCampaign.statistics.items=アイテム -PageCertCampaign.statistics.noDecision=ノー・デシジョン(棄権) +PageCertCampaign.statistics.noDecision=決定を下さない(棄権) PageCertCampaign.statistics.noResponse=応答無し PageCertCampaign.statistics.reduce=削減 PageCertCampaign.statistics.reduceRemedied=削減 - 修復済み @@ -1403,10 +1403,10 @@ PageCertCampaign.table.comments=コメント PageCertCampaign.table.deadline=デッドライン PageCertCampaign.table.decision=決定 PageCertCampaign.table.objectName=オブジェクト -PageCertCampaign.table.remediedAt=Remedied at +PageCertCampaign.table.remediedAt=修復日時 PageCertCampaign.table.requested=リクエスト済 PageCertCampaign.table.reviewers=レビューアー -PageCertCampaign.table.reviewedAt=Reviewed at +PageCertCampaign.table.reviewedAt=レビュー日時 PageCertCampaign.table.reviewedBy=レビュー担当者 PageCertCampaign.table.reviewedInStage=ステージ中 PageCertCampaign.table.targetName=ターゲット @@ -1488,6 +1488,8 @@ PageCertDefinition.scopeIncludeOrgs=組織 PageCertDefinition.scopeIncludeServices=サービス PageCertDefinition.scopeIncludeResources=リソース PageCertDefinition.scopeIncludeByStatus=アクティベーション・ステータスで含める +PageCertDefinition.scopeIncludeUsers=ユーザー +PageCertDefinition.scopeRelation=リレーション PageCertDefinition.scopeEnabledItemsOnly=有効なアイテムのみ PageCertDefinition.stagesDefinition=ステージ定義 PageCertDefinitions.message.deleteDefinitionPerformed.success=定義が正常に削除されました。 @@ -1514,7 +1516,7 @@ StageDefinitionPanel.stageName = 名前 StageDefinitionPanel.stageDescription = 説明 StageDefinitionPanel.stageDuration = 期間 StageDefinitionPanel.notifyBeforeDeadline = 〆切の前に通知 -StageDefinitionPanel.notifyWhenNoDecision = デシジョンがない場合にのみ通知する +StageDefinitionPanel.notifyWhenNoDecision = 決定を下さない場合にのみ通知する StageDefinitionPanel.reviewerSpecification = レビューワーの仕様 StageDefinitionPanel.reviewerSpecificationName = レビューワーの仕様名(オプション) StageDefinitionPanel.reviewerSpecificationDescription = レビューワーの仕様の説明(オプション) @@ -1530,7 +1532,7 @@ StageDefinitionPanel.reviewerUseObjectManagerAllowSelf = マネージャーが StageDefinitionPanel.reviewerUseObjectManagerBox = オブジェクト管理者を使用する StageDefinitionPanel.defaultReviewerRef = デフォルト・レビューワー・リファレンス StageDefinitionPanel.additionalReviewerRef = 追加レビューワー・リファレンス -StageDefinitionPanel.outcomeStrategy = 複数のレビューワーの場合のデシジョン集約ストラテジー +StageDefinitionPanel.outcomeStrategy = 複数のレビューワーの場合の決定集約ストラテジー StageDefinitionPanel.outcomeIfNoReviewers = レビューワーが割当てられていない場合の結果 StageDefinitionPanel.stopReviewOn = レビューを停止する StageDefinitionPanel.remediation = 修復 @@ -1664,12 +1666,12 @@ pageDebugList.dialog.title.confirmDelete=削除の確認 pageDebugList.dialog.title.deleteAll=すべてのオブジェクトの削除 pageDebugList.menu.deleteAllIdentities=すべての識別子の削除 pageDebugList.menu.deleteAllType=選択したすべてのタイプを削除 -pageDebugList.menu.deleteSelected=選択したものを削除 +pageDebugList.menu.deleteSelected=Delete selected/filtered pageDebugList.menu.deleteShadowsOnResource=リソース上のすべてのシャドウを削除 pageDebugList.menu.exportShadowsOnResource=リソース上のすべてのシャドウをエクスポート pageDebugList.menu.exportAll=すべてのオブジェクトのエクスポート pageDebugList.menu.exportAllSelectedType=選択したすべてのタイプをエクスポート -pageDebugList.menu.exportSelected=選択したものをエクスポート +pageDebugList.menu.exportSelected=Export selected/filtered pageDebugList.message.countSearchProblem=ユーザー/シャドウ/組織単位に対する検索操作を実行できませんでした。 pageDebugList.message.createFileException=ダウンロードするファイルを作成できませんでした。 pageDebugList.message.deleteAllType=本当にタイプ"{0}"のすべてのオブジェクトを削除しますか? @@ -1826,7 +1828,7 @@ pageLogging.loggers=ロガー pageLogging.loggersTable=ロガー・テーブル pageLogging.logger.TASKMANAGER=タスク・マネージャー・ロガー pageLogging.logger.WORKFLOWS=ワークフロー・モジュール・ロガー -pageLogging.logSubsystemEntryExit=ログ・サブシステムの登録/終了 +pageLogging.logSubsystemEntryExit=ログ・サブシステムの開始/終了 pageLogging.performanceStatistics=パフォーマンス統計: pageLogging.profiling=プロファイリング pageLogging.requestFilter=リクエスト・フィルター: @@ -2201,7 +2203,7 @@ pageTaskEdit.scheduleHelp=ワンタイムタスクの場合、スケジュール pageTaskEdit.scheduleInterval=スケジュール間隔(秒) pageTaskEdit.scheduleTitle=スケジューリング pageTaskEdit.approvals=承認 -pageTaskEdit.operation=Operation context +pageTaskEdit.operation=操作コンテキスト pageTaskEdit.performance=環境パフォーマンス pageTaskEdit.progress=進捗 pageTaskEdit.subtasksAndThreads=サブタスクとスレッド @@ -2317,8 +2319,8 @@ pageTasks.message.suspendCoordinatorOnly.fatalError=コーディネーターを pageTasks.message.resumeCoordinatorOnly.fatalError=コーディネーターを再開できませんでした pageTasks.message.deleteWorkersAndWorkState.fatalError=コーディネーターのワーカーと稼働状態を削除できませんでした pageTasks.message.getLastCheckInTime={0} 前 -pageTasks.message.startSchedulerAction=start scheduler for -pageTasks.message.stopSchedulerTasksAction=stop scheduler+tasks for +pageTasks.message.startSchedulerAction=スケジューラー開始 +pageTasks.message.stopSchedulerTasksAction=スケジューラーとタスクの停止 pageTasks.message.confirmationMessageForSingleTaskObject=本当にタスク'{1}'を{0}しますか? pageTasks.message.confirmationMessageForMultipleTaskObject=本当に選択された{1}個のタスクを{0}しますか? pageTasks.message.confirmationMessageForSingleNodeObject=本当にノード'{1}'を{0}しますか? @@ -2357,7 +2359,7 @@ pageTasks.node.statusMessage=ステータス・メッセージ pageTasks.nowForNotRunningTasks=(今) pageTasks.now=今 pageTasks.runsContinually=継続的に実行 -pageTasks.stalledSince=STALLED since {0} at {1} +pageTasks.stalledSince={0}以降{1}に停止しました pageTasks.state=状態 pageTasks.subtasks=サブタスクを表示 pageTasks.task.category=カテゴリー @@ -2461,10 +2463,10 @@ pageUser.title.selectResource=リソースの選択 pageUser.userDetails=ユーザーの詳細 PageCase.title=ケースの詳細 -PageCaseWorkItem.title=Case work item details +PageCaseWorkItem.title=ケース作業アイテムの詳細 pageCase.button.save=保存 pageCase.button.back=戻る -PageCaseWorkItemsAllocatedToMe.title=Cases allocated to me +PageCaseWorkItemsAllocatedToMe.title=私に割当てられたケース PageCaseWorkItemsAll.title=すべてのケース PageCaseWorkItems.button.back=戻る PageCaseWorkItems.button.createCase=ケースの作成 @@ -2492,7 +2494,7 @@ pageCases.table.description=説明 pageCases.table.actors=アクター pageCases.table.objectRef=オブジェクト pageCases.table.state=状態 -pageCases.table.openTimestamp=Opened +pageCases.table.openTimestamp=開始日時 pageCases.table.closeTimestamp=終了 pageCases.button.delete=削除 PageCasesAllocatedToMe.title=私のケース @@ -2566,8 +2568,8 @@ workItemPanel.title=Work to do: workItemPanel.changesToBeApproved=承認待ちの変更 workItemPanel.additionalAttributes=追加属性 workItemPanel.approvalHistory=本申請に関する承認履歴 -workItemPanel.approvalHistoryHelp=Decisions that have been done so far in the process of approving the changes displayed here. -workItemPanel.otherWorkItemsHelp=Work items for the changes shown here that are currently active (in addition to the work item displayed on this page). +workItemPanel.approvalHistoryHelp=ここに表示された変更を承認するプロセスで、これまで行われてきた決定。 +workItemPanel.otherWorkItemsHelp=現在アクティブなここに示されている変更のための作業アイテム (このページに表示されている作業アイテムに加えて)。 TaskOperationUtils.message.suspendPerformed.success=タスクが正常にサスペンドされました。 TaskOperationUtils.message.suspendPerformed.warning=タスクのサスペンドが正常に要求されました。 タスクリストを使用して完了をチェックしてください。 TaskOperationUtils.message.suspendPerformed.fatalError=タスクをサスペンドできませんでした @@ -2575,7 +2577,7 @@ TaskOperationUtils.message.resumePerformed.success=タスクが正常に再開 TaskOperationUtils.message.resumePerformed.fatalError=タスクを再開できませんでした TaskOperationUtils.message.runNowPerformed.success=タスクの実行が正常にスケジュールされました。 TaskOperationUtils.message.runNowPerformed.fatalError=タスクをスケジュールできませんでした。 -TaskWfChildPanel.approvalHistoryHelp=Decisions that have been done so far in the process of approving the changes displayed here. +TaskWfChildPanel.approvalHistoryHelp=ここに表示された変更を承認するプロセスで、これまで行われてきた決定。 TaskWfChildPanel.currentWorkItemsHelp=現在アクティブな、ここに表示された変更の作業アイテム。 TaskWfChildPanel.showNextStagesHelp=次の承認ステージのプレビューを表示します。 TaskWfChildPanel.nextStagesHelp=これは次の承認ステージのプレビューです。 @@ -2679,7 +2681,7 @@ processInstancePanel.task=システムタスク: processInstancePanel.tasks=現在アクティブな作業アイテム processInstancePanel.title.edit='{0}'の詳細 ProfilingLevel.ARGUMENTS=引数 -ProfilingLevel.ENTRY_EXIT=Entry/Exit +ProfilingLevel.ENTRY_EXIT=開始/終了 ProfilingLevel.OFF=オフ ProgressPanel.ExecutionTimeWhenFinished=操作は{0}ミリ秒で実行されます。 ProgressPanel.ExecutionTimeWhenRunning=操作は{0}秒間実行されます。 @@ -2732,7 +2734,7 @@ Requestable.NON_REQUESTABLE=要求不能 Requestable.REQUESTABLE=要求可能 ResourceActivationEditor.label.administrativeStatus=管理ステータス ResourceActivationEditor.label=リソース・アクティベーションの編集 -ResourceActivationEditor.label.existence=Existence +ResourceActivationEditor.label.existence=存在 ResourceActivationEditor.label.fetchStrategy=フェッチ・ストラテジー ResourceActivationEditor.label.inbound=インバウンド ResourceActivationEditor.label.outbound=アウトバウンド @@ -2902,12 +2904,12 @@ SchemaHandlingStep.attribute.tooltip.matchingRule=二つの属性値が同じ意 SchemaHandlingStep.attribute.tooltip.outbound=アウトバウンド・マッピングは、リソース(通常はアカウント)へシステム(通常はユーザー)から値をマッピングします。 SchemaHandlingStep.attribute.tooltip.reference=設定する属性の名前。以下のすべての設定とマッピングはこの属性に適用されます。 SchemaHandlingStep.attribute.tooltip.tolerant=許容属性は、システムの外部で設定された値を許容します。拒否属性は、システム内で定義されている値のみを許可します(例えば、リソースまたはロールのマッピングによって)。 -SchemaHandlingStep.attribute.tooltip.tolerantVP=A value that matches this pattern will be tolerated. I.e. it will remain as the attribute value even if it is not a result of system processing (mappings). +SchemaHandlingStep.attribute.tooltip.tolerantVP=このパターンに一致する値は許容されます。すなわち システム処理(マッピング)の結果ではない場合でも、属性値として残ります。 SchemaHandlingStep.button.add=オブジェクトタイプの追加 SchemaHandlingStep.credentials.tooltip.fetchStrategy=必要に応じてクレデンシャルの値を取り出す方法。暗黙的:値はデフォルトで返されます。要求する必要はありません。明示的:値はデフォルトでは返されません。常に明示的に要求してください。 SchemaHandlingStep.credentials.tooltip.inbound=インバウンド・マッピングは、システム(通常はユーザー)へリソース(通常はアカウント)から値をマッピングします。 SchemaHandlingStep.credentials.tooltip.outbound=アウトバウンド・マッピングは、リソース(通常はアカウント)へシステム(通常はユーザー)から値をマッピングします。 -SchemaHandlingStep.credentials.tooltip.passwordPolicyRef=Password policy to apply to this credential. This setting overrides other settings, e.g. default password policy defined in system configuration. If no password policy is defined here then the usual default will be used. +SchemaHandlingStep.credentials.tooltip.passwordPolicyRef=このクレデンシャルに適用するパスワードポリシー。この設定は他の設定を上書きします。例えば、システム設定で定義されているデフォルトのパスワードポリシー。ここでパスワードポリシーが定義されていない場合は、通常のデフォルトが使用されます。 SchemaHandlingStep.dependency.tooltip.intent=私たちが依存するオブジェクトの用途。 SchemaHandlingStep.dependency.tooltip.kind=私たちが依存するオブジェクトの種類。 SchemaHandlingStep.dependency.tooltip.order=通常はゼロです。 循環を形成し、他の方法では解決できない依存関係の順序を決定する整数を指定できます(別名、高位依存関係)。 @@ -2941,7 +2943,7 @@ SchemaHandlingStep.limitations.tooltip.propertyAccess=許可または拒否す SchemaHandlingStep.mapping.tooltip.authoritative=権威のあるマッピングは、指定された値を追加および削除します。 権威のないマッピングでは値が追加されるだけです。 例えば、権威のあるマッピングを持つロールが削除された場合、そのマッピングが暗示していた値も削除されます。 権威のないマッピングを持つロールが削除されても、値は変わりません。 SchemaHandlingStep.mapping.tooltip.channel=Limits application of this mapping only to specific channel. E.g. to changes coming from live sync, reconciliation or GUI. If the channel is listed then the mapping will be applied. If it is not then it will not be applied. If no channel is specified then no limitations apply and the mapping will be applied for all channels. SchemaHandlingStep.mapping.tooltip.conditionLanguage=条件スクリプトが書かれたプログラミング言語。 -SchemaHandlingStep.mapping.tooltip.condition=The XML representation of mapping condition. This is the actual expression code that will be interpreted. Mapping sources are provided as input variables for the condition. If the condition returns true then the mapping will be applied. If it returns false then the mapping is ignored. Note that mappings that were true and that become false may result in removal of a value that was the result of the mapping while it was still true. +SchemaHandlingStep.mapping.tooltip.condition=マッピング条件のXML表現。これは解釈される実際の式コードです。マッピング・ソースは、条件の入力変数として提供されています。条件がtrueを返すと、マッピングが適用されます。falseが返された場合、マッピングは無視されます。trueからfalseになったマッピングは、まだtrueであった間にマッピングの結果であった値を削除する可能性があることに注意してください。 SchemaHandlingStep.mapping.tooltip.conditionType=マッピング条件に使用される式のタイプ。 SchemaHandlingStep.mapping.tooltip.conditionValuePolicyRef=バリュー・ポリシー・オブジェクトへの参照。 指定されたバリュー・ポリシーは、値を生成するためのテンプレートとして使用されます。 バリュー・ポリシーへの参照が指定されていない場合は、デフォルト・ポリシーが自動的に決定されます。 例えば。 マッピング・ターゲットに適用可能な適切なパスワード・ポリシーが使用されます。 SchemaHandlingStep.mapping.tooltip.exceptChannel=Limits application of this mapping to all channels except the specified channel. E.g. all the changes except those coming from live sync, reconciliation or GUI. If the channel is listed then the mapping will be not applied in this channel. If it is not then it will be applied. If no channel is specified then no limitations apply and the mapping will be applied for all channels. @@ -2976,7 +2978,7 @@ SchemaHandlingStep.tooltip.kind=種類は、このオブジェクトが何であ SchemaHandlingStep.tooltip.objectClass=このオブジェクト・タイプのインスタンスを構築するために使用されるスキーマのオブジェクトクラス。 SchemaHandlingStep.tooltip.protected=このオブジェクト型の保護されたインスタンスの指定 システムは保護されたインスタンスを見ることができますが、触れることはできません。 それらを変更しようとしても失敗します。 これは、 "root"や "administrator"などの緊急管理アカウントを保護するために使用されます。 SchemaHandlingStep.duplicateObjectTypeWarning=種類/用途の定義がさらにあります:{0}。 -SchemaHandlingStep.in=in: {0} +SchemaHandlingStep.in={0} 内 SchemaHandlingStep.out=out SchemaHandlingStep.dup=DUP {0} SchemaListPanel.attributes=属性 @@ -3117,20 +3119,20 @@ SynchronizationStep.message.errorLoadingObjectTemplates=リポジトリーから SynchronizationStep.message.unsupportedActionFormat=あなたはリアクションを定義するために廃止予定の属性 'ref'を使っています。 代わりに要素 'handlerUri'を使用してください。 'ref'属性を持つアクションはこのウィザードには表示されません。 SynchronizationStep.reaction.tooltip.action=明確なアクション。この設定は、同期イベントに対するリアクションとしてシステムが何をしなければならないかを定義します。 SynchronizationStep.reaction.tooltip.channel=チャンネル制限。同期イベントが指定されたチャンネルから発生した場合(ライブ同期、リコンシリエーション、インポートなど)、このリアクションは処理されます。 それ以外の場合は無視されます。 -SynchronizationStep.reaction.tooltip.objectTemplateRef=Object template that will be used to process this specific synchronization event. If no object template is specified here then the usual default will be used. +SynchronizationStep.reaction.tooltip.objectTemplateRef=この特定の同期イベントを処理するために使用されるオブジェクト・テンプレート。ここでオブジェクト・テンプレートが指定されていない場合は、通常のデフォルトが使用されます。 SynchronizationStep.reaction.tooltip.reconcile=trueに設定されている場合、リコンシリエーション・ステップはこの同期イベントに対して強制されます。存在しない場合、属性は明示的にフェッチされます。falseに設定した場合、リコンシリエーションは自動的に行われます。そのケースは、リコンシリエーションは同期化イベントに属性がすでに存在する場合にのみ行われます。属性が存在しない場合、それらは明示的にフェッチされず、リコンシリエーションはスキップされます。 SynchronizationStep.reaction.tooltip.situation=同期状況。イベントの状況がここで指定された状況と一致する場合、リアクションが適用されます。それ以外の場合は無視されます。 SynchronizationStep.reaction.tooltip.synchronize=trueに設定すると、通常の同期アルゴリズム(別名clockworkやプロジェクター)が以下に指定された明確なアクションに加えて適用されます。 これは通常のケースです。 falseに設定した場合、同期アルゴリズムはスキップされ、明確なアクションのみが実行されます。 SynchronizationStep.title=同期 SynchronizationStep.tooltip.condition=The synchronization setting will be applied only if this condition returns true. The condition is used mostly to sort the object of the same kind into intents. E.g. the condition may decide whether the username starts with "T". If is does then it can sort out accounts to intent "test" and if it does not then the account will have default intent. -SynchronizationStep.tooltip.confirmation=Confirmation expression. Each result of the correlation expression will be passed to confirmation expression. If the confirmation expression returns true then the objects will be linked. If no confirmation expression is specified then all the objects returned from the correlation query are accepted by default. Confirmation expression may be reasonable resource-intensive because it will be executed only for objects that are returned from the correlation query. -SynchronizationStep.tooltip.correlation=Correlation expression. The correlation expression is used to link focal objects (e.g. User) and shadows (e.g. account) that belong together. The correlation expression results in a search filter that is executed over the focal objects (usually users). The query returns candidate objects for linking. Correlation expression must be very efficient otherwise the synchronization performance will suffer. -SynchronizationStep.tooltip.enabled=Set to true if this synchronization setting is enabled. This is the default. This setting can be used to temporarily disable the synchronization setting. -SynchronizationStep.tooltip.focus=The type of focal object that corresponds to the resource object. For account objects this is usually a user object (UserType). This can be set to RoleType or OrgType for entitlement objects and so on. +SynchronizationStep.tooltip.confirmation=確認式。相関式の各結果は確認式に渡されます。確認式がtrueを返す場合、オブジェクトはリンクされます。確認式が指定されていない場合、相関照会から返されたすべてのオブジェクトがデフォルトで受け入れられます。確認式は、相関照会から返されたオブジェクトに対してのみ実行されるため、妥当なリソース集約型の可能性があります。 +SynchronizationStep.tooltip.correlation=相関式。相関式は、一緒に属するフォーカル・オブジェクト(例えばユーザー)とシャドウ(例えばアカウント)をリンクするために使用される。相関式は、フォーカル・オブジェクト(通常はユーザー)に対して実行される検索フィルターになります。クエリはリンクの候補オブジェクトを返します。相関式は非常に効率的でなければならず、そうでなければ同期性能が悪くなります。 +SynchronizationStep.tooltip.enabled=この同期設定が有効になっている場合はtrueに設定します。これがデフォルトです。この設定は、同期設定を一時的に無効にするために使用できます。 +SynchronizationStep.tooltip.focus=リソース・オブジェクトに対応するフォーカル・オブジェクトのタイプ。アカウント・オブジェクトの場合、これは通常ユーザー・オブジェクト(UserType)です。これは、エンタイトルメント・オブジェクトなどに対してRoleTypeまたはOrgTypeに設定できます。 SynchronizationStep.tooltip.intent=Object intent for which this definition applies. If the object (shadow) already has a kind and intent when it is processed by the synchronization code then this kind/intent definition will be used to select the synchronization settings to apply to this object. If the object does not have kind/intent then object class and conditions will be used to select the settings. In such a case the object (shadow) will be marked by the intent specified in this field. SynchronizationStep.tooltip.kind=Object kind for which this definition applies. If the object (shadow) already has a kind and intent when it is processed by the synchronization code then this kind/intent definition will be used to select the synchronization settings to apply to this object. If the object does not have kind/intent then object class and conditions will be used to select the settings. In such a case the object (shadow) will be marked by the kind specified in this field. SynchronizationStep.tooltip.objectClass=Object class for which this definition applies. This will be used to select the synchronization settings in case the object (shadow) does not have kind/intent definition yet. -SynchronizationStep.tooltip.objectTemplate=Object template that will be used to process this specific synchronization event. If no object template is specified here then the usual default will be used. +SynchronizationStep.tooltip.objectTemplate=この特定の同期イベントを処理するために使用されるオブジェクト・テンプレート。ここでオブジェクト・テンプレートが指定されていない場合は、通常のデフォルトが使用されます。 SynchronizationStep.tooltip.opportunistic=trueに設定すると、このイベントの処理中に日和見的同期(別名ディスカバリー)が有効になります。 SynchronizationStep.tooltip.reaction=システムがこの同期イベントにどのようにリアクションするかを指定します。 いくつかのリアクションを指定できます。 イベントの同期状況に適したリアクションが選択されます。 SynchronizationStep.tooltip.reconcile=trueに設定されている場合、リコンシリエーション・ステップはこの同期イベントに対して強制されます。存在しない場合、属性は明示的にフェッチされます。falseに設定した場合、リコンシリエーションは自動的に行われます。その場合、リコンシリエーションは同期化イベントに属性がすでに存在する場合にのみ行われます。属性が存在しない場合、それらは明示的にフェッチされず、リコンシリエーションはスキップされます。 @@ -3439,7 +3441,7 @@ MyRequestsPanel.skipped=スキップ済 MyRequestsPanel.approved=承認済 MyRequestsPanel.inProgress=処理中 MyRequestsPanel.unknown=不明 -MyRequestsPanel.future=Future +MyRequestsPanel.future=将来像 MyRequestsPanel.cancelled=キャンセル済 MyRequestsPanel.name=名前 PageSelfProfile.title=プロファイルの編集 @@ -3481,7 +3483,7 @@ roleMemberPanel.type=タイプ: roleMemberPanel.tenant=テナント: roleMemberPanel.project=組織/プロジェクト: roleMemberPanel.indirectMembers=間接的メンバーを含める -roleMemberPanel.allRelations=すべての関係を表示 +roleMemberPanel.allRelations=すべてのリレーションを表示 roleMemberPanel.menu.createOwner=オーナーの作成 roleMemberPanel.menu.assignOwners=オーナーのアサイン roleMemberPanel.menu.createApprover=作成承認者 @@ -3681,15 +3683,16 @@ PageCertDefinition.outcomeStrategyHelpLabel=参照してください PageCertDefinition.outcomeStrategyHelpLink=このドキュメント PageCertDefinition.outcomeStrategyHelp=How is the overall outcome for a case determined, based on outcomes in individual stages? Note: 'Stop review on:' field shows outcomes that prevent a case from being advanced to the next stage. Usually you need not change the default value. If necessary, you could do that through the XML configuration. PageCertDefinition.campaignLastStartedHelp=この定義に基づいて作成された最後のキャンペーンはいつ開始されましたか? -PageCertDefinition.campaignLastClosedHelp=When was last campaign created according to this definition closed - either after successfully going through all stages, or closed at any time. However, if a campaign is deleted without being closed first, it is not shown here. -PageCertDefinition.scopeObjectTypeHelp=Determines which objects will be considered to be in the scope of the certification campaigns. Features of these objects (e.g. whether to certify their assignments or their inducements or both, etc) are selected below. +PageCertDefinition.campaignLastClosedHelp=この定義に従って作成された最後のキャンペーンが終了したのはいつか - すべてのステージを通過した後、またはいつでも終了した場合です。 ただし、キャンペーンが終了されずに削除された場合、ここには表示されません。 +PageCertDefinition.scopeObjectTypeHelp=認定キャンペーンのスコープにあると見なされるオブジェクトを決定します。これらのオブジェクトの特徴(例えば、彼らの割当てまたは彼らのインデュースメント、あるいはその両方を証明するかどうかなど)を選択する。 PageCertDefinition.scopeSearchFilterHelp=If only a subset of objects of given type is to be considered for certification, you can specify the corresponding filter here. For example, you can specify that only users from a certain organization should be certified. Or that only employees with a specific employee type should be considered. -PageCertDefinition.scopeAssignmentsInducementsHelp=Select what features (assignments, inducements or both) of the objects described above are to be certified. +PageCertDefinition.scopeAssignmentsInducementsHelp=次のオブジェクトのどの機能(アサイン、インデュースメント、またはその両方)を認定するかを選択します。 PageCertDefinition.scopeIncludeTargetTypesHelp=When certifying assignments or inducements, you can specify what target types are taken into account. For example, you can say that you want to certify only assignments of roles (to, for example, users). PageCertDefinition.scopeIncludeByStatusHelp=Whether to certify only assignments/inducements that have administrative status set to ENABLED (or not set at all). Note that what is relevant is the administrative status of the assignment, not the administrative status of the assigned object. +PageCertDefinition.scopeRelationHelp=考慮されるべきリレーション。q:anyの値は "any relation"を意味します。リレーションが存在しない場合は、org:default(即ちnull)が想定されます。 StageDefinitionPanel.stageDurationHelp=Duration of this stage, used to determine stage end time. The end time is computed as the moment of stage opening plus the duration, rounded up to 23:59:59 of the last day. Duration is specified in ISO 8601 format, like P14D for 14 days, P3W for 3 weeks, P2M for 2 months, etc. -StageDefinitionPanel.notifyBeforeDeadlineHelp=How long before the stage end the reminding notifications (to reviewers and campaign owner) will be sent. It is possible to specify more values; separate them by commas. Time interval is specified in ISO 8601 format, like PT12H for 12 hours, P2D for 2 days, P1W for 1 week, etc. An example: PT48H, PT12H says that the first notification will be sent 48 hours before stage end, and the second one 12 hours before the end. -StageDefinitionPanel.notifyWhenNoDecisionHelp=If checked, a 'stage end approaching' notification is sent to a reviewer only if he/she has some cases waiting for his/her decision. If not checked, reviewers always get their notifications - regardless of whether they have provided a decision or not. (Note that notifications to the campaign owner about approaching stage end are always sent, regardless of this setting.) +StageDefinitionPanel.notifyBeforeDeadlineHelp=ステージが終了するまでに(レビューワーとキャンペーン・オーナーに)リマインド通知が送信されるまでの時間。複数の値をコンマ区切りで指定することが可能です。時間間隔は、ISO 8601形式(12時間のPT12H、2日間のP2D、1週間のP1Wなど)で指定されています。例:PT48H、PT12Hは、最初の通知はステージ終了の48時間前に送信され、2番目の通知は終了の12時間前に送信されることを示しています。 +StageDefinitionPanel.notifyWhenNoDecisionHelp=チェックした場合、レビューワーの決定を待っているケースにのみ「ステージ終了アプローチ」通知がレビューワーに送信されます。チェックされていない場合、レビューワーは決定を下したかどうかに関わらず、常に通知を受け取ります。(この設定に関係なく、ステージの終わりに近づくことに関するキャンペーン・オーナーへの通知は常に送信されることに注意してください。) StageDefinitionPanel.reviewerSpecificationTargetHelp=割当て/インデュースメント・ターゲットの所有者/承認者に基づくレビュー担当者の選択。 例えば ロールの所有者を使用して、(任意のユーザーに対する)「自分の」ロールのすべての割当てを認証するように指定できます。 StageDefinitionPanel.reviewerSpecificationObjectHelp=Selection of reviewers based on object that has something assigned (or induced) to. E.g. you can specify that the role owner is used to certify all inducements made to 'his' role. StageDefinitionPanel.reviewerUseObjectManagerHelp=Selection of reviewers based on managers of object (typically a user) that has something assigned/induced to. E.g. you can specify that a manager is used to certify all assignments made to users in 'his' organization. @@ -3702,7 +3705,7 @@ StageDefinitionPanel.outcomeIfNoReviewersHelp=What should be the outcome if ther StageDefinitionPanel.stopReviewOnHelp=ケースが次のステージに進むのを妨げるのはどのような結果ですか?通常はデフォルト値を変更する必要はありません。必要に応じて、XML設定を通じて変更できます。 StageDefinitionPanel.configurationHelpLabel=認定キャンペーンのステージ構成の詳細については、次の項目も参照してください。 StageDefinitionPanel.configurationHelpLink=このドキュメント -NameStep.configurationWillBeLost=The selected connector configuration schema is different from the current one. Configuration properties will be lost if you will proceed. +NameStep.configurationWillBeLost=選択されたコネクター構成スキーマは現在のものとは異なります。続行すると構成プロパティは失われます。 resultsHandlerConfiguration=結果ハンドラー enableFilteredResultsHandler=結果の追加フィルタリングを有効にする enableFilteredResultsHandlerHelp=このハンドラーは、コネクター・フレームワークのレベルで、コネクターによってリソースから取得された結果をフィルターに掛けます。 それ自体では完全なフィルタリングを提供しないコネクタ実装によって使用されます。 このハンドラーを有効にするといくつかの欠点があります。 ページングの分野で。 そのため、本当に必要な場合にのみ使用してください。 よくわからない場合は、検証モードでフィルタリングを使用することをお勧めします。 ConnIdの現在のバージョンのデフォルト値:有効 @@ -3874,15 +3877,15 @@ PageAssignmentsList.conflictsWarning=認可の問題による割当ての競合 AbstractShoppingCartTabPanel.addAllButton=すべて追加 AbstractShoppingCartTabPanel.goToShoppingCartButton=ショッピングカートへ行く AbstractShoppingCartTabPanel.requestingForLabel=要求の対象 -AbstractShoppingCartTabPanel.availableRelationsLabel=Available relations +AbstractShoppingCartTabPanel.availableRelationsLabel=利用可能なリレーション AssignmentCatalogPanel.selectTargetUser=ターゲット・ユーザーの選択 AssignmentCatalogPanel.selectSourceUser=割当てのソース・ユーザーを選択 AssignmentCatalogPanel.sourceUserSelected={0}の割当て -AssignmentCatalogPanel.selectAssignmentsUserOwner=Select assignments user owner +AssignmentCatalogPanel.selectAssignmentsUserOwner=アサイン・ユーザーのオーナーを選択 AssignmentCatalogPanel.requestForMe=私 AssignmentCatalogPanel.requestFor=ターゲット・ユーザー: {0} AssignmentCatalogPanel.requestForMultiple={0}人のユーザーが選択されています -AssignmentCatalogPanel.assignmentsOwner={0}'s assignments +AssignmentCatalogPanel.assignmentsOwner={0}のアサイン UserSelectionButton.myAssignmentsLabel=ソースユーザー: 私 UserSelectionButton.userAssignmentsLabel=ソースユーザー: {0} MultiButtonPanel.plusIconTitle=ショッピングカートにアイテムを追加 @@ -3903,7 +3906,7 @@ AssignmentViewType.ROLE_CATALOG_VIEW=ロールカタログの表示 AssignmentViewType.ROLE_TYPE=すべてのロールの表示 AssignmentViewType.ORG_TYPE=すべての組織の表示 AssignmentViewType.SERVICE_TYPE=すべてのサービスの表示 -AssignmentViewType.USER_TYPE=User's assignments +AssignmentViewType.USER_TYPE=ユーザーのアサイン PageAssignmentsList.requestButton = リクエスト operation.com.evolveum.midpoint.web.page.self.PageAssignmentsList.requestAssignments=アサイン要求 com.evolveum.midpoint.web.page.self.PageAssignmentsList.requestAssignments=アサイン要求 @@ -4007,7 +4010,7 @@ CaseType.jpegPhoto=エビデンス AbstractWorkItemType.assigneeRef=担当者 AbstractWorkItemType.originalAssigneeRef=元の担当者 AbstractWorkItemType.deadline=デッドライン -AbstractWorkItemType.performerRef=Performer +AbstractWorkItemType.performerRef=実行者 AbstractWorkItemType.closeTimestamp=終了 PageUserHistory.title='{0}'の履歴データ{1} PageXmlDataReview.title=履歴データ @@ -4097,7 +4100,7 @@ AbstractAssignmentDetailsPanel.doneButton=実行 ApprovalProcessesPreviewPanel.processRelatedTo={0}に関連する承認プロセス ApprovalProcessesPreviewPanel.process=承認プロセス ApprovalProcessExecutionInformationPanel.approver=承認者 -ApprovalProcessExecutionInformationPanel.performer=Performer +ApprovalProcessExecutionInformationPanel.performer=実行者 ApprovalProcessExecutionInformationPanel.attorney=代理人 ApprovalProcessExecutionInformationPanel.stage=ステージ PageImportResource.title=リソース定義のインポート @@ -4169,6 +4172,7 @@ ExpressionValuePanel.specifyExpression=式を指定する ExpressionValuePanel.addValueButtonDefaultTitle=シャドウ・リファレンス値を追加 ExpressionValuePanel.addValueButtonTargetSearchTitle=アソシエーション・ターゲット・検索を追加 ExpressionValuePanel.addLiteralValueButton=リテラル値を追加 +ExpressionValuePanel.associationDefenitionsNotDefined=Association definitions are not defined for the current resource with selected kind/intent parameters. ConstructionType.attribute=属性 ConstructionType.association=アソシエーション operation.Recompute.ALL.members=全メンバーの再計算 @@ -4193,7 +4197,7 @@ TreeTablePanel.menu.unassignManagersSelected=選択されたマネージャー Button.cancel=キャンセル AssociationDetailsPanel.expressionPanel=アウトバウンド式 AssociationDetailsPanel.AssociationHeader=アソシエーション -RoleRelationSelectionPanel.select.relation=Select relations to process +RoleRelationSelectionPanel.select.relation=処理するリレーションを選択 operation.com.evolveum.midpoint.web.page.admin.workflow.PageWorkItem.delegateWorkItem=作業アイテムを委任する AbstractRoleAssignmentPanel.relationLabel=リレーション AbstractRoleAssignmentPanel.relationKindIntentColumn=リレーションまたは種類/用途 @@ -4250,7 +4254,7 @@ abstractRoleMemberPanel.unassignSelectedMembersConfirmationLabel=本当にアサ operation.Delete.ALL_DIRECT.members=すべての直接的メンバーの削除 operation.Delete.SELECTED.members=選択されたメンバーの削除 relationDropDownChoicePanel.relation=リレーション -relationDropDownChoicePanel.tooltip.relation=参照の関係。例えばデフォルト、承認者、マネージャー +relationDropDownChoicePanel.tooltip.relation=参照のリレーション。例えば、デフォルト、承認者、マネージャー ItemPathPanel.button.reset=パスのリセット ApprovalPolicyActionType.details.newValue=新しい承認ポリシー・アクション LifecycleStateType.details.newValue=新規ライフサイクル状態 diff --git a/gui/admin-gui/src/main/resources/localization/Midpoint_lt.properties b/gui/admin-gui/src/main/resources/localization/Midpoint_lt.properties index f1d28daec67..c4568151d63 100644 --- a/gui/admin-gui/src/main/resources/localization/Midpoint_lt.properties +++ b/gui/admin-gui/src/main/resources/localization/Midpoint_lt.properties @@ -1488,6 +1488,8 @@ PageCertDefinition.scopeIncludeOrgs=Org. PageCertDefinition.scopeIncludeServices=Paslaugos PageCertDefinition.scopeIncludeResources=Resursai PageCertDefinition.scopeIncludeByStatus=Įtraukti pagal aktyvacijos būseną +PageCertDefinition.scopeIncludeUsers=Naudotojai +PageCertDefinition.scopeRelation=Ryšys PageCertDefinition.scopeEnabledItemsOnly=Tik aktyvūs elementai PageCertDefinition.stagesDefinition=Etapo apibrėžtis PageCertDefinitions.message.deleteDefinitionPerformed.success=Apibrėžtis buvo sėkmingai ištrinta. @@ -1664,12 +1666,12 @@ pageDebugList.dialog.title.confirmDelete=Patvirtinti ištrynimą pageDebugList.dialog.title.deleteAll=Ištrinti visus objektus pageDebugList.menu.deleteAllIdentities=Ištrinti visas tapatybes pageDebugList.menu.deleteAllType=Ištrinti visas pasirinkto tipo. -pageDebugList.menu.deleteSelected=Ištrinti pasirinktą +pageDebugList.menu.deleteSelected=Delete selected/filtered pageDebugList.menu.deleteShadowsOnResource=Ištrinti visus resurso "šešėlius" pageDebugList.menu.exportShadowsOnResource=Išspausdinti visą resurso "šešėlį" pageDebugList.menu.exportAll=Išspausdinti visus objektus pageDebugList.menu.exportAllSelectedType=Ištrinti visus pasirinkto tipo -pageDebugList.menu.exportSelected=Išspausdinti pasirinktą +pageDebugList.menu.exportSelected=Export selected/filtered pageDebugList.message.countSearchProblem=Negalėjome atlikti paieškos operacijos naudotojų/"šešėlių"/org. vienetuose. pageDebugList.message.createFileException=Negalėjome sukurti parsisiuntimo failo. pageDebugList.message.deleteAllType=Ar tikrai norite ištrinti visus "{0}" tipo objektus? @@ -3687,6 +3689,7 @@ PageCertDefinition.scopeSearchFilterHelp=Jei sertifikavimui reikalingas tik tam PageCertDefinition.scopeAssignmentsInducementsHelp=Pasirinkite, kokias anksčiau aprašytų objektų funkcijas (priskyrimus, poveikius ar abu) reikia sertifikuoti. PageCertDefinition.scopeIncludeTargetTypesHelp=Sertifikuojant priskyrimus ar poveikius, galite nurodyti, kuriems adresato tipams taikytina. PageCertDefinition.scopeIncludeByStatusHelp=Galite pasirinkti, ar tvirtinti tik tuos priskyrimus/poveikius, kurių administracinis statusas nustatytas kaip "ĮJUNGTAS". Pastaba "ĮJUNGTAS" turi būti priskyrimo administracinis statusas, o ne priskirtas objektas. +PageCertDefinition.scopeRelationHelp=Relation(s) which are to be considered. Value of q:any means "any relation". If no relation is present, org:default (i.e. null) is assumed. StageDefinitionPanel.stageDurationHelp=Naudojama etapo pabaigos laikui nustatyti. Pabaigos laikas yra suskaičiuojamas prie etapo pradžios laiko pridėjus jo trukmę, suapvalinant iki paskutinės dienos 23:59:59. StageDefinitionPanel.notifyBeforeDeadlineHelp=Nurodo prieš kiek laiko iki etapo pabaigos, siunčiami priminimo pranešimai. Galima nurodyti daugiau nei vieną reikšmę atskiriant jas kableliais. StageDefinitionPanel.notifyWhenNoDecisionHelp=Jei pažymėta, vertintojui yra siunčiami pranešimai apie artėjančią etapo pabaigą, bet tik tuo atveju, jei jis dar nepateikė sprendimo. Jei nepažymėta, vertintojas visada gauna pranešimą, nepriklausomai nuo to ar jau pateikė sprendimą, ar ne. (Pastaba: operacijų savininkams pranešimai apie artėjančią etapo pabaigą yra siunčiami nepriklausomai nuo šių nustatymų.) @@ -4169,6 +4172,7 @@ ExpressionValuePanel.specifyExpression=Nurodykite išraišką ExpressionValuePanel.addValueButtonDefaultTitle=Pridėti "šešėlių" reikšmes ExpressionValuePanel.addValueButtonTargetSearchTitle=Pridėti asiciacijos adresato paiešką ExpressionValuePanel.addLiteralValueButton=Pridėti žodinę reikšmę +ExpressionValuePanel.associationDefenitionsNotDefined=Association definitions are not defined for the current resource with selected kind/intent parameters. ConstructionType.attribute=Atributas ConstructionType.association=Asociacija operation.Recompute.ALL.members=Perskaičiuoti visus narius diff --git a/gui/admin-gui/src/main/resources/localization/Midpoint_pl.properties b/gui/admin-gui/src/main/resources/localization/Midpoint_pl.properties index 849d7e75d6e..c6a0b9f683c 100644 --- a/gui/admin-gui/src/main/resources/localization/Midpoint_pl.properties +++ b/gui/admin-gui/src/main/resources/localization/Midpoint_pl.properties @@ -1488,6 +1488,8 @@ PageCertDefinition.scopeIncludeOrgs=Organizacje PageCertDefinition.scopeIncludeServices=Usługi PageCertDefinition.scopeIncludeResources=Systemy PageCertDefinition.scopeIncludeByStatus=Uwzględnij poprzez status aktywacji +PageCertDefinition.scopeIncludeUsers=Użytkownicy +PageCertDefinition.scopeRelation=Relacja PageCertDefinition.scopeEnabledItemsOnly=Tylko aktywne pozycje PageCertDefinition.stagesDefinition=Definicja etapów PageCertDefinitions.message.deleteDefinitionPerformed.success=Definicja została poprawnie usunięta. @@ -1664,12 +1666,12 @@ pageDebugList.dialog.title.confirmDelete=Potwierdź usunięcie pageDebugList.dialog.title.deleteAll=Usuń wszystkie obiekty pageDebugList.menu.deleteAllIdentities=Usuń wszystkie tożsamości pageDebugList.menu.deleteAllType=Usuń wszystko o wybranym typie -pageDebugList.menu.deleteSelected=Usuń zaznaczone +pageDebugList.menu.deleteSelected=Usuń zaznaczone/odfiltrowane pageDebugList.menu.deleteShadowsOnResource=Usuń wszystkie cienie z systemu pageDebugList.menu.exportShadowsOnResource=Eksportuj wszystkie cienie z systemu pageDebugList.menu.exportAll=Eksportuj wszystkie obiekty pageDebugList.menu.exportAllSelectedType=Eksportuj wszystko o wybranym typie -pageDebugList.menu.exportSelected=Eksportuj wybrane +pageDebugList.menu.exportSelected=Eksportuj zaznaczone/odfiltrowane pageDebugList.message.countSearchProblem=Nie można przeprowadzić wyszukiwania w użytkownikach/cieniach/jedn. org. pageDebugList.message.createFileException=Nie można utworzyć pliku do pobrania. pageDebugList.message.deleteAllType=Naprawdę chcesz usunąć wszystkie obiekty o typie {0}? @@ -3687,6 +3689,7 @@ PageCertDefinition.scopeSearchFilterHelp=Jeśli tylko podzbiór obiektów okreś PageCertDefinition.scopeAssignmentsInducementsHelp=Wybierz które funkcjonalności (przypisania, dziedziczenia lub obie) obiektów opisanych powyżej mają być certyfikowane. PageCertDefinition.scopeIncludeTargetTypesHelp=Gdy certyfikowane są przypisania lub dziedziczenia, możesz wyszczególnić które docelowe typy są brane pod uwagę. Na przykład możesz chcieć certyfikować wyłącznie przypisania ról (do, np. użytkowników). PageCertDefinition.scopeIncludeByStatusHelp=Czy certyfikować tylko przypisania/dziedziczenia które mają status administracyjny "Aktywny" (lub nie ustawiony wcale). Zwróć uwagę, że istotny jest status administracyjny przypisania a nie przypisywanego obiektu. +PageCertDefinition.scopeRelationHelp=Relacje(a) które będą uwzględnione. Wartość q:any oznacza "jakakolwiek relacja". Jeśli nie podano nic, przyjęte zostanie org:default (tzn. null) StageDefinitionPanel.stageDurationHelp=Czas trwania tego etapu użyty do określenia czasu zakończenia etapu. Czas zakończenia jest obliczany jako moment otwarcia etapu plus czas trwania, zaokrąglony do 23:59:59 ostatniego dnia. Czas trwania jest określany w formacie ISO 8601, np. P14D dla 14 dni, P3W dla 3 tygodni, P2M dla 2 miesięcy, itd. StageDefinitionPanel.notifyBeforeDeadlineHelp=Jak długo przed zakończeniem etapu zostaną wysłane wiadomości z przypomnieniem (do recenzentów i właściciela kampanii). Można podać więcej wartości rozdzielonych przecinkiem. Czas podaje się w formacie ISO 8601, np.: PT12H dla 12 godzin, P2D dla 2 dni, P1W dla tygodnia, itd. Przykład: PT48H, PT12H mówi o tym, że powiadomienia zostaną wysłane 48 godzin oraz 12 godzin przed zakończeniem etapu. StageDefinitionPanel.notifyWhenNoDecisionHelp=Jeśli zaznaczone, powiadomienie 'zbliża się termin końca etapu' będzie wysłane do recenzenta tylko jeśli ma jakieś przypadki oczekujące na jego decyzje. Jeśli nie zaznaczone - recenzent zawsze dostanie powiadomienie, niezależnie czy już wprowadził odpowiednie decyzje czy nie. (Zauważ, że powiadomienia do właściciela kampanii wysyłane są zawsze, niezależnie od tego ustawienia.) @@ -4169,6 +4172,7 @@ ExpressionValuePanel.specifyExpression=Określ wyrażenie ExpressionValuePanel.addValueButtonDefaultTitle=Dodaj wartość referencyjną cienia ExpressionValuePanel.addValueButtonTargetSearchTitle=Dodaj wyszukiwanie celu powiązania ExpressionValuePanel.addLiteralValueButton=Dodaj wartość dosłowną +ExpressionValuePanel.associationDefenitionsNotDefined=Association definitions are not defined for the current resource with selected kind/intent parameters. ConstructionType.attribute=Atrybut ConstructionType.association=Powiązanie operation.Recompute.ALL.members=Przelicz wszystkich członków diff --git a/gui/admin-gui/src/main/resources/localization/Midpoint_pt_BR.properties b/gui/admin-gui/src/main/resources/localization/Midpoint_pt_BR.properties index f889c219332..e38254a4355 100644 --- a/gui/admin-gui/src/main/resources/localization/Midpoint_pt_BR.properties +++ b/gui/admin-gui/src/main/resources/localization/Midpoint_pt_BR.properties @@ -1488,6 +1488,8 @@ PageCertDefinition.scopeIncludeOrgs=Orgs PageCertDefinition.scopeIncludeServices=Serviços PageCertDefinition.scopeIncludeResources=Recursos PageCertDefinition.scopeIncludeByStatus=Incluir por status de ativação +PageCertDefinition.scopeIncludeUsers=Usuários +PageCertDefinition.scopeRelation=Relação PageCertDefinition.scopeEnabledItemsOnly=Habilitar apenas itens PageCertDefinition.stagesDefinition=Definição de etapas PageCertDefinitions.message.deleteDefinitionPerformed.success=The definition has been successfully deleted. @@ -1664,12 +1666,12 @@ pageDebugList.dialog.title.confirmDelete=Confirmar deleção pageDebugList.dialog.title.deleteAll=Deletar todos os objetos pageDebugList.menu.deleteAllIdentities=Deletar todas as identidades pageDebugList.menu.deleteAllType=Deletar todos do tipo selecionado -pageDebugList.menu.deleteSelected=Deletar os selecionados +pageDebugList.menu.deleteSelected=Delete selected/filtered pageDebugList.menu.deleteShadowsOnResource=Deletar todas as imagens no recurso pageDebugList.menu.exportShadowsOnResource=Exportar todas as imagens no recurso pageDebugList.menu.exportAll=Exportar todos os objetos pageDebugList.menu.exportAllSelectedType=Exportar todos do tipo selecionado -pageDebugList.menu.exportSelected=Exportar selecionados +pageDebugList.menu.exportSelected=Export selected/filtered pageDebugList.message.countSearchProblem=Não foi possível executar operação de pesquisa em usuários/imagens/unid. org. pageDebugList.message.createFileException=Não foi possível criar arquivo para descarregar. pageDebugList.message.deleteAllType=Deseja realmente deletar todos os objetos do tipo "{0}"? @@ -3687,6 +3689,7 @@ PageCertDefinition.scopeSearchFilterHelp=Se apenas um subconjunto de objetos de PageCertDefinition.scopeAssignmentsInducementsHelp=Selecione quais recursos (atribuições, induções ou ambas) dos objetos descritos acima devem ser certificados. PageCertDefinition.scopeIncludeTargetTypesHelp=Ao certificar atribuições ou induções, você pode especificar quais tipos de alvo são considerados. Por exemplo, você pode dizer que deseja certificar somente atribuições de perfis (para, por exemplo, usuários). PageCertDefinition.scopeIncludeByStatusHelp=Certificar somente atribuições / induções que tenham status administrativo definido como HABILITADO (ou não definido). Observe que o que é relevante é o status administrativo da atribuição, não o status administrativo do objeto atribuído. +PageCertDefinition.scopeRelationHelp=Relation(s) which are to be considered. Value of q:any means "any relation". If no relation is present, org:default (i.e. null) is assumed. StageDefinitionPanel.stageDurationHelp=Duração desta etapa, utilizado para determinar seu fim. O tempo final é computado como o momento da abertura da etapa mais a duração, arredondado até 23:59:59 do último dia. A duração é especificada no formato ISO 8601, como P14D para 14 dias, P3W para 3 semanas, P2M para 2 meses, etc. StageDefinitionPanel.notifyBeforeDeadlineHelp=Quanto tempo antes do final da etapa as notificações de lembrete (para os revisores e o proprietário da campanha) serão enviadas. É possível especificar mais valores; Separe-os por vírgulas. O intervalo de tempo é especificado no formato ISO 8601, como PT12H para 12 horas, P2D para 2 dias, P1W para 1 semana, etc. Um exemplo: PT48H, PT12H diz que a primeira notificação será enviada 48 horas antes do final da etapa, e o segundo 12 horas antes do fim. StageDefinitionPanel.notifyWhenNoDecisionHelp=Se marcada, uma notificação de "aproximação de final de etapa" é enviada a um revisor apenas se ele / ela tiver alguns casos aguardando sua decisão. Se não estiver assinalado, os revisores sempre recebem suas notificações - independentemente de terem ou não fornecido uma decisão. (Observe que as notificações ao proprietário da campanha sobre a aproximação da etapa são sempre enviadas, independentemente desta configuração.) @@ -4169,6 +4172,7 @@ ExpressionValuePanel.specifyExpression=Specify expression ExpressionValuePanel.addValueButtonDefaultTitle=Add shadow reference value ExpressionValuePanel.addValueButtonTargetSearchTitle=Add association target search ExpressionValuePanel.addLiteralValueButton=Add literal value +ExpressionValuePanel.associationDefenitionsNotDefined=Association definitions are not defined for the current resource with selected kind/intent parameters. ConstructionType.attribute=Atributo ConstructionType.association=Association operation.Recompute.ALL.members=Recomputar todos os membros diff --git a/gui/admin-gui/src/main/resources/localization/Midpoint_ru.properties b/gui/admin-gui/src/main/resources/localization/Midpoint_ru.properties index 68f089281c7..7c5fa8bc4d2 100644 --- a/gui/admin-gui/src/main/resources/localization/Midpoint_ru.properties +++ b/gui/admin-gui/src/main/resources/localization/Midpoint_ru.properties @@ -1488,6 +1488,8 @@ PageCertDefinition.scopeIncludeOrgs=Организации PageCertDefinition.scopeIncludeServices=Сервисы: PageCertDefinition.scopeIncludeResources=Ресурсы PageCertDefinition.scopeIncludeByStatus=Включить по статусу активации +PageCertDefinition.scopeIncludeUsers=Пользователи +PageCertDefinition.scopeRelation=Связь PageCertDefinition.scopeEnabledItemsOnly=Только активные задания PageCertDefinition.stagesDefinition=Определение этапов PageCertDefinitions.message.deleteDefinitionPerformed.success=The definition has been successfully deleted. @@ -1664,12 +1666,12 @@ pageDebugList.dialog.title.confirmDelete=Подтверждение удален pageDebugList.dialog.title.deleteAll=Удалить все объекты pageDebugList.menu.deleteAllIdentities=Удалить все идентификационные записи pageDebugList.menu.deleteAllType=Удалить все выбранные типы -pageDebugList.menu.deleteSelected=Удалить выбранные +pageDebugList.menu.deleteSelected=Delete selected/filtered pageDebugList.menu.deleteShadowsOnResource=Удалить все слепки ресурса pageDebugList.menu.exportShadowsOnResource=Экспортировать все слепки ресурса pageDebugList.menu.exportAll=Экспортировать все объекты pageDebugList.menu.exportAllSelectedType=Экспортировать все выбранные типы -pageDebugList.menu.exportSelected=Выбран экспорт +pageDebugList.menu.exportSelected=Export selected/filtered pageDebugList.message.countSearchProblem=Невозможно выполнить поиск по пользователям/связанным УЗ/орг. единицам pageDebugList.message.createFileException=Невозможно создать файл для загрузки. pageDebugList.message.deleteAllType=Вы действительно хотите удалить все типы объектов "{0}"? @@ -3687,6 +3689,7 @@ PageCertDefinition.scopeSearchFilterHelp=Если только подмноже PageCertDefinition.scopeAssignmentsInducementsHelp=Выберите согласуемые характеристики (назначения, наследования или оба варианта) объектов выше PageCertDefinition.scopeIncludeTargetTypesHelp=При сертификации назначений вы можете определить, какие типы целей принимаются для аккаунта. Например, вы можете сказать, что вы хотите сертифицировать только назначение ролей (например, для пользователей). PageCertDefinition.scopeIncludeByStatusHelp=Определить, сертифицировать только ли назначения при АКТИВНОМ административном статусе (или не устанавливать для всех). +PageCertDefinition.scopeRelationHelp=Relation(s) which are to be considered. Value of q:any means "any relation". If no relation is present, org:default (i.e. null) is assumed. StageDefinitionPanel.stageDurationHelp=Продолжительность этого этапа определяется временем конца этапа. Время окончания этапа вычисляется как момент создания этапа плюс длительность этапа и округляется к 23:59:59 последнего дня. Длительность определяется по стандарту ISO 8601, например P14D для 14 дней, P3W для 3 недель, P2M для 2 месяцев и т.д. StageDefinitionPanel.notifyBeforeDeadlineHelp=За сколько времени до окончания этапа должно приходить напоминающее уведомление (согласующем и отправителю запроса). Это возможно для установки сразу нескольких значений; через запятую. Интервал времени определяется по стандарту ISO 8601, например PT12H для 12 часов, P2D для 2 дней, P1W для 1 недели и т.д. Например: PT48H, PT12H говорят, что первое уведомление будет отправлено за 48 часов до окончания этапа, а второе - за 12 часов до времени окончания. StageDefinitionPanel.notifyWhenNoDecisionHelp=Если включено, уведомление об окончании этапа отправляется согласующему только если он/она имеет настройку ожидания сообщения. Если выключено, то согласующие всегда получают уведомления. (Обратите внимание на то, что уведомления об окончании этапа согласования всегда отправляются инициатору запроса вне зависимости от настроек.) @@ -4169,6 +4172,7 @@ ExpressionValuePanel.specifyExpression=Specify expression ExpressionValuePanel.addValueButtonDefaultTitle=Add shadow reference value ExpressionValuePanel.addValueButtonTargetSearchTitle=Add association target search ExpressionValuePanel.addLiteralValueButton=Add literal value +ExpressionValuePanel.associationDefenitionsNotDefined=Association definitions are not defined for the current resource with selected kind/intent parameters. ConstructionType.attribute=Атрибут ConstructionType.association=Association operation.Recompute.ALL.members=Вычислить всех участников diff --git a/gui/admin-gui/src/main/resources/localization/Midpoint_sk.properties b/gui/admin-gui/src/main/resources/localization/Midpoint_sk.properties index 454edbc272d..f192182b758 100644 --- a/gui/admin-gui/src/main/resources/localization/Midpoint_sk.properties +++ b/gui/admin-gui/src/main/resources/localization/Midpoint_sk.properties @@ -1488,6 +1488,8 @@ PageCertDefinition.scopeIncludeOrgs=Organizácie PageCertDefinition.scopeIncludeServices=Služby PageCertDefinition.scopeIncludeResources=Systémy PageCertDefinition.scopeIncludeByStatus=Include by activation status +PageCertDefinition.scopeIncludeUsers=Používatelia +PageCertDefinition.scopeRelation=Vzťah PageCertDefinition.scopeEnabledItemsOnly=Enabled items only PageCertDefinition.stagesDefinition=Stages definition PageCertDefinitions.message.deleteDefinitionPerformed.success=The definition has been successfully deleted. @@ -1664,12 +1666,12 @@ pageDebugList.dialog.title.confirmDelete=Potvrďte zmazanie pageDebugList.dialog.title.deleteAll=Zmazať všetky objekty pageDebugList.menu.deleteAllIdentities=Zmazať všetky označenia pageDebugList.menu.deleteAllType=Zmazať všetky vybrané typy -pageDebugList.menu.deleteSelected=Zmazať vybrané +pageDebugList.menu.deleteSelected=Delete selected/filtered pageDebugList.menu.deleteShadowsOnResource=Zmazať sledovanie systémov pageDebugList.menu.exportShadowsOnResource=Export all shadows on resource pageDebugList.menu.exportAll=Exportovať všetky objekty pageDebugList.menu.exportAllSelectedType=Exportovať všetky vybrané typy -pageDebugList.menu.exportSelected=Exportovať vybrané +pageDebugList.menu.exportSelected=Export selected/filtered pageDebugList.message.countSearchProblem=Vyhľadávanie medzi usermi/obrazmi sa nepodarilo pageDebugList.message.createFileException=Nebolo možné vytvoriť súbor na stiahnutie. pageDebugList.message.deleteAllType=Naozaj chcete vymazať všetky objekty typu "{0}"? @@ -3687,6 +3689,7 @@ PageCertDefinition.scopeSearchFilterHelp=If only a subset of objects of given ty PageCertDefinition.scopeAssignmentsInducementsHelp=Select what features (assignments, inducements or both) of the objects described above are to be certified. PageCertDefinition.scopeIncludeTargetTypesHelp=When certifying assignments or inducements, you can specify what target types are taken into account. For example, you can say that you want to certify only assignments of roles (to, for example, users). PageCertDefinition.scopeIncludeByStatusHelp=Whether to certify only assignments/inducements that have administrative status set to ENABLED (or not set at all). Note that what is relevant is the administrative status of the assignment, not the administrative status of the assigned object. +PageCertDefinition.scopeRelationHelp=Relation(s) which are to be considered. Value of q:any means "any relation". If no relation is present, org:default (i.e. null) is assumed. StageDefinitionPanel.stageDurationHelp=Duration of this stage, used to determine stage end time. The end time is computed as the moment of stage opening plus the duration, rounded up to 23:59:59 of the last day. Duration is specified in ISO 8601 format, like P14D for 14 days, P3W for 3 weeks, P2M for 2 months, etc. StageDefinitionPanel.notifyBeforeDeadlineHelp=How long before the stage end the reminding notifications (to reviewers and campaign owner) will be sent. It is possible to specify more values; separate them by commas. Time interval is specified in ISO 8601 format, like PT12H for 12 hours, P2D for 2 days, P1W for 1 week, etc. An example: PT48H, PT12H says that the first notification will be sent 48 hours before stage end, and the second one 12 hours before the end. StageDefinitionPanel.notifyWhenNoDecisionHelp=If checked, a 'stage end approaching' notification is sent to a reviewer only if he/she has some cases waiting for his/her decision. If not checked, reviewers always get their notifications - regardless of whether they have provided a decision or not. (Note that notifications to the campaign owner about approaching stage end are always sent, regardless of this setting.) @@ -4169,6 +4172,7 @@ ExpressionValuePanel.specifyExpression=Specify expression ExpressionValuePanel.addValueButtonDefaultTitle=Add shadow reference value ExpressionValuePanel.addValueButtonTargetSearchTitle=Add association target search ExpressionValuePanel.addLiteralValueButton=Add literal value +ExpressionValuePanel.associationDefenitionsNotDefined=Association definitions are not defined for the current resource with selected kind/intent parameters. ConstructionType.attribute=Atribút ConstructionType.association=Association operation.Recompute.ALL.members=Prepočítať všetkých členov diff --git a/gui/admin-gui/src/main/resources/localization/Midpoint_tr.properties b/gui/admin-gui/src/main/resources/localization/Midpoint_tr.properties index c14492549c4..e69bff2f338 100644 --- a/gui/admin-gui/src/main/resources/localization/Midpoint_tr.properties +++ b/gui/admin-gui/src/main/resources/localization/Midpoint_tr.properties @@ -1488,6 +1488,8 @@ PageCertDefinition.scopeIncludeOrgs=Organizasyonlar PageCertDefinition.scopeIncludeServices=Servisler PageCertDefinition.scopeIncludeResources=Kaynaklar PageCertDefinition.scopeIncludeByStatus=Aktifleştirme durumu ile dahil et +PageCertDefinition.scopeIncludeUsers=Kullanıcılar +PageCertDefinition.scopeRelation=İlişki PageCertDefinition.scopeEnabledItemsOnly=Sadece aktifleştirilmiş öğeler PageCertDefinition.stagesDefinition=Etapların tanımı PageCertDefinitions.message.deleteDefinitionPerformed.success=Tanım başarıyla silindi. @@ -1664,12 +1666,12 @@ pageDebugList.dialog.title.confirmDelete=Silmeyi onayla pageDebugList.dialog.title.deleteAll=Tüm nesneleri sil pageDebugList.menu.deleteAllIdentities=Tüm kimlikleri sil pageDebugList.menu.deleteAllType=Seçili tiplerin tümünü sil -pageDebugList.menu.deleteSelected=Seçimi sil +pageDebugList.menu.deleteSelected=Delete selected/filtered pageDebugList.menu.deleteShadowsOnResource=Kaynaktaki tüm gölgeleri sil pageDebugList.menu.exportShadowsOnResource=Kaynaktaki tüm gölgeleri dışa aktar pageDebugList.menu.exportAll=Bütün nesneleri dışa aktar pageDebugList.menu.exportAllSelectedType=Seçili tiptekilerin hepsini dışa aktar -pageDebugList.menu.exportSelected=Seçilenleri dışa aktar +pageDebugList.menu.exportSelected=Export selected/filtered pageDebugList.message.countSearchProblem=Gölge/kullanıcılar/org. birimleri üzerinde arama gerçekleştirilemedi pageDebugList.message.createFileException=İndirilecek dosya oluşturulamadı. pageDebugList.message.deleteAllType="{0}" tipindeki tüm nesneleri gerçekten silmek istiyor musunuz? @@ -3687,6 +3689,7 @@ PageCertDefinition.scopeSearchFilterHelp=Gözden geçirme için yalnızca belirl PageCertDefinition.scopeAssignmentsInducementsHelp=Yukarıda nesnelerin hangi özelliklerinin ( atamalar,yönlendirmeler veya ikisi de) onaylanması gerektiğini seçin. PageCertDefinition.scopeIncludeTargetTypesHelp=Atamaları veya teşvikleri onaylarken, hangi hedef türlerinin dikkate alındığını belirtebilirsiniz. Örneğin, yalnızca görev atamalarını (ör. kullanıcılara) onaylamak istediğinizi söyleyebilirsiniz. PageCertDefinition.scopeIncludeByStatusHelp=Yalnızca idari durumu ENABLED olarak belirlenmiş (veya hiç ayarlanmamış) atamaların/teşviklerin onaylanıp onaylanmadığı. Atanmış nesnenin idari durumu değil, atamanın idari durumu olduğuna dikkat edin. +PageCertDefinition.scopeRelationHelp=Relation(s) which are to be considered. Value of q:any means "any relation". If no relation is present, org:default (i.e. null) is assumed. StageDefinitionPanel.stageDurationHelp=Aşamanın bitiş zamanını belirlemek için kullanılan süre. Bitiş zamanı, aşama başlangıç anı artı son günün 23.59: 59'a kadarki süre olarak hesaplanır. Süre ISO 8601 formatında, ör: 14 gün boyunca P14D, 3 hafta boyunca P3W, 2 ay boyunca P2M gibi belirtilir. StageDefinitionPanel.notifyBeforeDeadlineHelp=Etap sonu hatırlatıcı bildirimlerin ne kadar önceden gönderileceği dir. (gözden geçirici ve operasyonu başlatana) Virgülle ayrılarak birnden fazla değer girilebilir. Zaman aralığı ISO 8601 formatındadır. Ör: 12 saat için PT12H, 2 gün için P2D, bir hafa için P1W vb. Bir örnek: PTH48H, PTH12H demek il bildirim 48 saat öncesinde ikinci bildirim etap bitmeden 12 saat önce gönderileceği anlamına gelir. StageDefinitionPanel.notifyWhenNoDecisionHelp=Eğer seçili olursa gözden geçiriciye 'etap sonu yaklaşıyor' bildirimi gönderilir. Bunun için göden geçricinin bekleyen kararları olması gerekir. Seçili olmazsa, gözden geçiriciler karar verip vermediklerine bakılmaksızın her zaman bildirim alır. (Operasyon başlatıcıya bu ayar seçili olsa da olmasa da bildirimin gönderileceğini dikkate alınız) @@ -4169,6 +4172,7 @@ ExpressionValuePanel.specifyExpression=Specify expression ExpressionValuePanel.addValueButtonDefaultTitle=Add shadow reference value ExpressionValuePanel.addValueButtonTargetSearchTitle=Add association target search ExpressionValuePanel.addLiteralValueButton=Add literal value +ExpressionValuePanel.associationDefenitionsNotDefined=Association definitions are not defined for the current resource with selected kind/intent parameters. ConstructionType.attribute=Özellik ConstructionType.association=Association operation.Recompute.ALL.members=Tüm üyeleri tekrar hesapla diff --git a/gui/admin-gui/src/main/resources/localization/Midpoint_zh_CN.properties b/gui/admin-gui/src/main/resources/localization/Midpoint_zh_CN.properties index 81d6a8c53ba..d1f2e5b6409 100644 --- a/gui/admin-gui/src/main/resources/localization/Midpoint_zh_CN.properties +++ b/gui/admin-gui/src/main/resources/localization/Midpoint_zh_CN.properties @@ -1488,6 +1488,8 @@ PageCertDefinition.scopeIncludeOrgs=组织 PageCertDefinition.scopeIncludeServices=服务 PageCertDefinition.scopeIncludeResources=资源 PageCertDefinition.scopeIncludeByStatus=包括激活状态 +PageCertDefinition.scopeIncludeUsers=用户 +PageCertDefinition.scopeRelation=关系 PageCertDefinition.scopeEnabledItemsOnly=仅启用的项 PageCertDefinition.stagesDefinition=阶段定义 PageCertDefinitions.message.deleteDefinitionPerformed.success=The definition has been successfully deleted. @@ -1664,12 +1666,12 @@ pageDebugList.dialog.title.confirmDelete=确定删除 pageDebugList.dialog.title.deleteAll=删除所有对象 pageDebugList.menu.deleteAllIdentities=删除所有身份 pageDebugList.menu.deleteAllType=删除所有选中的类型 -pageDebugList.menu.deleteSelected=删除选中的 +pageDebugList.menu.deleteSelected=Delete selected/filtered pageDebugList.menu.deleteShadowsOnResource=删除该资源的所有影子条目 pageDebugList.menu.exportShadowsOnResource=导出该资源中的所有影子条目 pageDebugList.menu.exportAll=导出所有对象 pageDebugList.menu.exportAllSelectedType=导出所有选中的类型 -pageDebugList.menu.exportSelected=导出选中的 +pageDebugList.menu.exportSelected=Export selected/filtered pageDebugList.message.countSearchProblem=不能对用户/影子链接/组织机构进行搜索 pageDebugList.message.createFileException=不能创建下载的文件。 pageDebugList.message.deleteAllType=确实要删除类型为‘{0}’的所有对象吗? @@ -3687,6 +3689,7 @@ PageCertDefinition.scopeSearchFilterHelp=如果只考虑给定类型的对象子 PageCertDefinition.scopeAssignmentsInducementsHelp=选择上面描述的对象的哪些功能(直接分配、间接分配或两者)将被鉴定。 PageCertDefinition.scopeIncludeTargetTypesHelp=在鉴定直接分配或间接分配时,可以指定要包括哪些目标类型。例如,可以只鉴定角色的分配 (例如,用户)。 PageCertDefinition.scopeIncludeByStatusHelp=是否只验证具有管理状态设置为启用 (或根本不设置) 的直接/间接分配。请注意,相关的是分配的管理状态,而不是分配对象的管理状态。 +PageCertDefinition.scopeRelationHelp=Relation(s) which are to be considered. Value of q:any means "any relation". If no relation is present, org:default (i.e. null) is assumed. StageDefinitionPanel.stageDurationHelp=此阶段的持续时间,用于确定阶段结束时间。结束时间是以阶段开始的时刻加上持续时间计算的,四舍五入到最后一天的23:59:59。持续时间以 iso 8601 格式指定,如 P14D 表示14 天,P3W 表示3 周, P2M表示 2 月等。 StageDefinitionPanel.notifyBeforeDeadlineHelp=在阶段结束前的多长时间将发送提醒通知(对审阅者和活动所有者)。可以指定更多的值;用逗号隔开。时间间隔以 iso 8601 格式指定,如 PT12H 表示12 小时,P2D 表示2 天,P1W 表示1 周等。一个例子:PT48H,PT12H 表示第一个通知将被发送48小时前阶段结束,和第二个12小时前结束。 StageDefinitionPanel.notifyWhenNoDecisionHelp=如果选中了 "阶段结束接近" 通知,则仅当他/她有某些场景等待他/她的决定时才发送给审阅者。如果不选中,审阅者总是会得到他们的通知-不管他们是否提供了决定。(请注意,无论此设置如何,都将始终发送到活动所有者的有关接近阶段结束的通知。 @@ -4169,6 +4172,7 @@ ExpressionValuePanel.specifyExpression=Specify expression ExpressionValuePanel.addValueButtonDefaultTitle=Add shadow reference value ExpressionValuePanel.addValueButtonTargetSearchTitle=Add association target search ExpressionValuePanel.addLiteralValueButton=Add literal value +ExpressionValuePanel.associationDefenitionsNotDefined=Association definitions are not defined for the current resource with selected kind/intent parameters. ConstructionType.attribute=属性 ConstructionType.association=关联 operation.Recompute.ALL.members=重算所有成员 diff --git a/infra/schema/src/main/resources/localization/schema_fr.properties b/infra/schema/src/main/resources/localization/schema_fr.properties index 67ed0c83ad8..b08ad80b20b 100644 --- a/infra/schema/src/main/resources/localization/schema_fr.properties +++ b/infra/schema/src/main/resources/localization/schema_fr.properties @@ -554,7 +554,7 @@ OrgType.displayName=Nom d'affichage OrgType.identifier=Identifiant OrgType.mailDomain=Domaine de courriel OrgType.orgType=Type d'entité org. -OrgType.requestable=Sur demande +OrgType.requestable=Peut être demandé OrgType.tenant=Locataire OriginType.ACTIVATIONS=Activations OriginType.ASSIGNMENTS=Attributions @@ -789,7 +789,7 @@ ActivationType.lockOutExpiration=Expiration du blocage ConnectorType.displayName=Nom d'affichage ShadowType.activation=Activation AbstractRoleType.inducement=Induction -AbstractRoleType.requestable=Sur demande +AbstractRoleType.requestable=Peut être demandé AbstractRoleType.riskLevel=Niveau de risque AbstractRoleType.owner=Propriétaire AbstractRoleType.approver=Validateur diff --git a/infra/schema/src/main/resources/localization/schema_ja.properties b/infra/schema/src/main/resources/localization/schema_ja.properties index ca28f77f159..35565dee78a 100644 --- a/infra/schema/src/main/resources/localization/schema_ja.properties +++ b/infra/schema/src/main/resources/localization/schema_ja.properties @@ -270,7 +270,7 @@ FileAppenderConfigurationType.filePattern=ファイルパターン FileAppenderConfigurationType.maxHistory=最大履歴数 FileAppenderConfigurationType.maxFileSize=最大ファイルサイズ FileAppenderConfigurationType.append=追加する -FileAppenderConfigurationType.prudent=Prudent +FileAppenderConfigurationType.prudent=慎重な FileConfigurationType.details=ファイル設定 FileConfigurationType.name=名前 FileConfigurationType.file=ファイル @@ -959,7 +959,7 @@ DataProtectionType.controllerName=コントローラー名 DataProtectionType.controllerContact=コントローラー連絡先 DataProtectionType.dpoContact=DPO連絡先 DataProtectionType.processingPurposesDescription=処理の目的 -DataProtectionType.legitimateInterestDescription=Legitimate interest +DataProtectionType.legitimateInterestDescription=正当な利益 DataProtectionType.dataRecipientDescription=データ受信者 DataProtectionType.periodOfStorageDescription=保管期間 DataProtectionType.automatedDecisionMakingDescription=自動判断 From 7fbc33127f0ce438799358927d0739e0098756b9 Mon Sep 17 00:00:00 2001 From: Radovan Semancik Date: Wed, 27 Feb 2019 16:43:24 +0100 Subject: [PATCH 067/224] Attempts to reproduce MID-5114 --- .../testing/story/AbstractStoryTest.java | 5 + .../testing/story/TestNullAttribute.java | 10 +- .../testing/story/uuid/AbstractUuidTest.java | 115 +++++++ .../TestUuidClient.java} | 126 +++----- .../testing/story/uuid/TestUuidExtension.java | 218 +++++++++++++ ...-opendj.xml => resource-opendj-client.xml} | 35 +- .../uuid/resource-opendj-extension.xml | 304 ++++++++++++++++++ .../src/test/resources/uuid/role-employee.xml | 35 ++ ...on.xml => system-configuration-client.xml} | 5 +- .../uuid/system-configuration-extension.xml | 48 +++ testing/story/testng-integration.xml | 3 +- 11 files changed, 812 insertions(+), 92 deletions(-) create mode 100644 testing/story/src/test/java/com/evolveum/midpoint/testing/story/uuid/AbstractUuidTest.java rename testing/story/src/test/java/com/evolveum/midpoint/testing/story/{TestUuid.java => uuid/TestUuidClient.java} (77%) create mode 100644 testing/story/src/test/java/com/evolveum/midpoint/testing/story/uuid/TestUuidExtension.java rename testing/story/src/test/resources/uuid/{resource-opendj.xml => resource-opendj-client.xml} (91%) create mode 100644 testing/story/src/test/resources/uuid/resource-opendj-extension.xml create mode 100644 testing/story/src/test/resources/uuid/role-employee.xml rename testing/story/src/test/resources/uuid/{system-configuration.xml => system-configuration-client.xml} (94%) create mode 100644 testing/story/src/test/resources/uuid/system-configuration-extension.xml diff --git a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/AbstractStoryTest.java b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/AbstractStoryTest.java index 25fb53b6800..85caa815445 100644 --- a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/AbstractStoryTest.java +++ b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/AbstractStoryTest.java @@ -19,6 +19,7 @@ import com.evolveum.midpoint.prism.*; import com.evolveum.midpoint.prism.match.MatchingRule; import com.evolveum.midpoint.prism.match.MatchingRuleRegistry; +import com.evolveum.midpoint.prism.path.ItemPath; import com.evolveum.midpoint.prism.util.PrismUtil; import com.evolveum.midpoint.schema.SearchResultList; import com.evolveum.midpoint.schema.constants.ObjectTypes; @@ -72,6 +73,10 @@ public class AbstractStoryTest extends AbstractModelIntegrationTest { protected static final File TASK_VALIDITY_SCANNER_FILE = new File(COMMON_DIR, "task-validity-scanner.xml"); protected static final String TASK_VALIDITY_SCANNER_OID = "00000000-0000-0000-0000-000000000006"; + + protected static final String NS_PIRACY = "http://midpoint.evolveum.com/xml/ns/samples/piracy"; + protected static final QName PIRACY_SHIP_QNAME = new QName(NS_PIRACY, "ship"); + protected static final ItemPath PATH_EXTENSION_SHIP = ItemPath.create(ObjectType.F_EXTENSION, PIRACY_SHIP_QNAME); protected MatchingRule caseIgnoreMatchingRule; diff --git a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestNullAttribute.java b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestNullAttribute.java index 2d88dde045c..664cca76e95 100644 --- a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestNullAttribute.java +++ b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestNullAttribute.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2017 mythoss, Evolveum + * Copyright (c) 2016-2019 mythoss, Evolveum * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -79,8 +79,6 @@ public class TestNullAttribute extends AbstractStoryTest { public static final File USER_SMACK_FILE = new File(TEST_DIR, "user-smack.xml"); public static final String USER_SMACK_OID = "c0c010c0-d34d-b33f-f00d-111111111112"; - protected static final String EXTENSION_NS = "http://midpoint.evolveum.com/xml/ns/samples/piracy"; - @Autowired private ReconciliationTaskHandler reconciliationTaskHandler; protected static DummyResource dummyResource; @@ -145,7 +143,7 @@ public void test000Sanity() throws Exception { PrismContainerDefinition userExtensionDef = userDefinition.getExtensionDefinition(); display("User extension definition", userExtensionDef); PrismAsserts.assertPropertyDefinition(userExtensionDef, - new QName(EXTENSION_NS, "ship"), DOMUtil.XSD_STRING, 0, 1); + new QName(NS_PIRACY, "ship"), DOMUtil.XSD_STRING, 0, 1); } @@ -216,7 +214,7 @@ public void test020UserSmackSetAttribute() throws Exception { @SuppressWarnings("unchecked, raw") Collection> deltas = (Collection) prismContext.deltaFor(UserType.class) - .item(UserType.F_EXTENSION, new QName(EXTENSION_NS, "ship")).add("Black Pearl") + .item(UserType.F_EXTENSION, new QName(NS_PIRACY, "ship")).add("Black Pearl") .asObjectDeltas(USER_SMACK_OID); modelService.executeChanges(deltas, null, task, result); @@ -270,7 +268,7 @@ public void test030UserSmackRemoveAttribute() throws Exception { prismContext.adopt(userNewPrism); if (userNewPrism.getExtension()==null)userNewPrism.createExtension(); PrismContainer ext = userNewPrism.getExtension(); - ext.setPropertyRealValue(new QName(EXTENSION_NS, "ship"), null); + ext.setPropertyRealValue(PIRACY_SHIP_QNAME, null); ObjectDelta delta = userBefore.diff(userNewPrism); display("Modifying user with delta", delta); diff --git a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/uuid/AbstractUuidTest.java b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/uuid/AbstractUuidTest.java new file mode 100644 index 00000000000..15b3ee753d7 --- /dev/null +++ b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/uuid/AbstractUuidTest.java @@ -0,0 +1,115 @@ +package com.evolveum.midpoint.testing.story.uuid; +/* + * Copyright (c) 2014-2019 Evolveum + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import com.evolveum.midpoint.prism.PrismObject; +import com.evolveum.midpoint.prism.PrismReferenceValue; +import com.evolveum.midpoint.prism.util.PrismTestUtil; +import com.evolveum.midpoint.schema.constants.MidPointConstants; +import com.evolveum.midpoint.schema.result.OperationResult; +import com.evolveum.midpoint.task.api.Task; +import com.evolveum.midpoint.test.IntegrationTestTools; +import com.evolveum.midpoint.test.util.MidPointTestConstants; +import com.evolveum.midpoint.test.util.TestUtil; +import com.evolveum.midpoint.testing.story.AbstractStoryTest; +import com.evolveum.midpoint.util.exception.*; +import com.evolveum.midpoint.xml.ns._public.common.common_3.*; +import com.evolveum.prism.xml.ns._public.types_3.PolyStringType; +import org.opends.server.types.DirectoryException; +import org.springframework.test.annotation.DirtiesContext; +import org.springframework.test.annotation.DirtiesContext.ClassMode; +import org.springframework.test.context.ContextConfiguration; +import org.testng.AssertJUnit; +import org.testng.annotations.AfterClass; +import org.testng.annotations.Listeners; +import org.testng.annotations.Test; + +import java.io.File; + +import static org.testng.AssertJUnit.assertEquals; + +/** + * @author Radovan Semancik + * + */ +@ContextConfiguration(locations = {"classpath:ctx-story-test-main.xml"}) +@DirtiesContext(classMode = ClassMode.AFTER_CLASS) +@Listeners({ com.evolveum.midpoint.tools.testng.AlphabeticalMethodInterceptor.class }) +public abstract class AbstractUuidTest extends AbstractStoryTest { + + public static final File TEST_DIR = new File(MidPointTestConstants.TEST_RESOURCES_DIR, "uuid"); + + public static final File OBJECT_TEMPLATE_USER_FILE = new File(TEST_DIR, "object-template-user.xml"); + public static final String OBJECT_TEMPLATE_USER_OID = "10000000-0000-0000-0000-000000000222"; + + protected static final String RESOURCE_OPENDJ_OID = "10000000-0000-0000-0000-000000000003"; + protected static final String RESOURCE_OPENDJ_NAMESPACE = MidPointConstants.NS_RI; + + protected static final String ATTR_ROOM_NUMBER = "roomNumber"; + protected static final String ATTR_MOBILE = "mobile"; + protected static final String ATTR_DEPARTMENT_NUMBER = "departmentNumber"; + + protected ResourceType resourceOpenDjType; + protected PrismObject resourceOpenDj; + + protected String userRappOid; + protected String userMancombOid; + + @Override + protected void startResources() throws Exception { + openDJController.startCleanServer(); + } + + @AfterClass + public static void stopResources() throws Exception { + openDJController.stop(); + } + + @Override + public void initSystem(Task initTask, OperationResult initResult) throws Exception { + super.initSystem(initTask, initResult); + + // Resources + resourceOpenDj = importAndGetObjectFromFile(ResourceType.class, getResourceOpenDjFile(), RESOURCE_OPENDJ_OID, initTask, initResult); + resourceOpenDjType = resourceOpenDj.asObjectable(); + openDJController.setResource(resourceOpenDj); + + // Object Templates + importObjectFromFile(OBJECT_TEMPLATE_USER_FILE, initResult); + + } + + protected abstract File getResourceOpenDjFile(); + + @Override + protected File getSystemConfigurationFile() { + return SYSTEM_CONFIGURATION_FILE; + } + + @Test + public void test000Sanity() throws Exception { + final String TEST_NAME = "test000Sanity"; + displayTestTitle(TEST_NAME); + Task task = createTask(TEST_NAME); + + OperationResult testResultOpenDj = modelService.testResource(RESOURCE_OPENDJ_OID, task); + TestUtil.assertSuccess(testResultOpenDj); + + waitForTaskStart(TASK_TRIGGER_SCANNER_OID, true); + waitForTaskStart(TASK_VALIDITY_SCANNER_OID, true); + } + +} diff --git a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestUuid.java b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/uuid/TestUuidClient.java similarity index 77% rename from testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestUuid.java rename to testing/story/src/test/java/com/evolveum/midpoint/testing/story/uuid/TestUuidClient.java index 75c751967b1..8b1c2504503 100644 --- a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestUuid.java +++ b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/uuid/TestUuidClient.java @@ -1,6 +1,6 @@ -package com.evolveum.midpoint.testing.story; +package com.evolveum.midpoint.testing.story.uuid; /* - * Copyright (c) 2014-2017 Evolveum + * Copyright (c) 2014-2019 Evolveum * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,6 +24,7 @@ import com.evolveum.midpoint.test.IntegrationTestTools; import com.evolveum.midpoint.test.util.MidPointTestConstants; import com.evolveum.midpoint.test.util.TestUtil; +import com.evolveum.midpoint.testing.story.AbstractStoryTest; import com.evolveum.midpoint.util.exception.*; import com.evolveum.midpoint.xml.ns._public.common.common_3.*; import com.evolveum.prism.xml.ns._public.types_3.PolyStringType; @@ -33,6 +34,7 @@ import org.springframework.test.context.ContextConfiguration; import org.testng.AssertJUnit; import org.testng.annotations.AfterClass; +import org.testng.annotations.Listeners; import org.testng.annotations.Test; import java.io.File; @@ -45,18 +47,12 @@ */ @ContextConfiguration(locations = {"classpath:ctx-story-test-main.xml"}) @DirtiesContext(classMode = ClassMode.AFTER_CLASS) -public class TestUuid extends AbstractStoryTest { +@Listeners({ com.evolveum.midpoint.tools.testng.AlphabeticalMethodInterceptor.class }) +public class TestUuidClient extends AbstractUuidTest { - public static final File TEST_DIR = new File(MidPointTestConstants.TEST_RESOURCES_DIR, "uuid"); + public static final File SYSTEM_CONFIGURATION_FILE = new File(TEST_DIR, "system-configuration-client.xml"); - public static final File SYSTEM_CONFIGURATION_FILE = new File(TEST_DIR, "system-configuration.xml"); - - public static final File OBJECT_TEMPLATE_USER_FILE = new File(TEST_DIR, "object-template-user.xml"); - public static final String OBJECT_TEMPLATE_USER_OID = "10000000-0000-0000-0000-000000000222"; - - protected static final File RESOURCE_OPENDJ_FILE = new File(TEST_DIR, "resource-opendj.xml"); - protected static final String RESOURCE_OPENDJ_OID = "10000000-0000-0000-0000-000000000003"; - protected static final String RESOURCE_OPENDJ_NAMESPACE = MidPointConstants.NS_RI; + protected static final File RESOURCE_OPENDJ_FILE = new File(TEST_DIR, "resource-opendj-client.xml"); public static final File ROLE_CLIENT_FILE = new File(TEST_DIR, "role-client.xml"); public static final String ROLE_CLIENT_OID = "10000000-0000-0000-0000-000000000601"; @@ -87,34 +83,13 @@ public class TestUuid extends AbstractStoryTest { private static final String USER_MARTY_GIVEN_NAME = "Mad"; private static final String USER_MARTY_FAMILY_NAME = "Marty"; - protected ResourceType resourceOpenDjType; - protected PrismObject resourceOpenDj; - protected String userRappOid; protected String userMancombOid; - @Override - protected void startResources() throws Exception { - openDJController.startCleanServer(); - } - - @AfterClass - public static void stopResources() throws Exception { - openDJController.stop(); - } - @Override public void initSystem(Task initTask, OperationResult initResult) throws Exception { super.initSystem(initTask, initResult); - // Resources - resourceOpenDj = importAndGetObjectFromFile(ResourceType.class, RESOURCE_OPENDJ_FILE, RESOURCE_OPENDJ_OID, initTask, initResult); - resourceOpenDjType = resourceOpenDj.asObjectable(); - openDJController.setResource(resourceOpenDj); - - // Object Templates - importObjectFromFile(OBJECT_TEMPLATE_USER_FILE, initResult); - // Role importObjectFromFile(ROLE_CLIENT_FILE, initResult); @@ -124,28 +99,20 @@ public void initSystem(Task initTask, OperationResult initResult) throws Excepti } @Override - protected File getSystemConfigurationFile() { - return SYSTEM_CONFIGURATION_FILE; + protected File getResourceOpenDjFile() { + return RESOURCE_OPENDJ_FILE; } - @Test - public void test000Sanity() throws Exception { - final String TEST_NAME = "test000Sanity"; - TestUtil.displayTestTitle(this, TEST_NAME); - Task task = taskManager.createTaskInstance(TestTrafo.class.getName() + "." + TEST_NAME); - - OperationResult testResultOpenDj = modelService.testResource(RESOURCE_OPENDJ_OID, task); - TestUtil.assertSuccess(testResultOpenDj); - - waitForTaskStart(TASK_TRIGGER_SCANNER_OID, true); - waitForTaskStart(TASK_VALIDITY_SCANNER_OID, true); + @Override + protected File getSystemConfigurationFile() { + return SYSTEM_CONFIGURATION_FILE; } @Test public void test100AddUserRapp() throws Exception { final String TEST_NAME = "test100AddUserRapp"; - TestUtil.displayTestTitle(this, TEST_NAME); - Task task = taskManager.createTaskInstance(TestTrafo.class.getName() + "." + TEST_NAME); + displayTestTitle(TEST_NAME); + Task task = createTask(TEST_NAME); OperationResult result = task.getResult(); PrismObject user = createNoNameUser(USER_RAPP_GIVEN_NAME, USER_RAPP_FAMILY_NAME, true); @@ -154,8 +121,7 @@ public void test100AddUserRapp() throws Exception { addObject(user, task, result); // THEN - result.computeStatus(); - TestUtil.assertSuccess(result); + assertSuccess(result); userRappOid = user.getOid(); @@ -166,8 +132,8 @@ public void test100AddUserRapp() throws Exception { @Test public void test101RappAssignRoleClient() throws Exception { final String TEST_NAME = "test101RappAssignRoleClient"; - TestUtil.displayTestTitle(this, TEST_NAME); - Task task = taskManager.createTaskInstance(TestTrafo.class.getName() + "." + TEST_NAME); + displayTestTitle(TEST_NAME); + Task task = createTask(TEST_NAME); OperationResult result = task.getResult(); // WHEN @@ -187,8 +153,8 @@ public void test101RappAssignRoleClient() throws Exception { @Test public void test107RappUnAssignRoleClient() throws Exception { final String TEST_NAME = "test107RappUnAssignRoleClient"; - TestUtil.displayTestTitle(this, TEST_NAME); - Task task = taskManager.createTaskInstance(TestTrafo.class.getName() + "." + TEST_NAME); + displayTestTitle(TEST_NAME); + Task task = createTask(TEST_NAME); // WHEN unassignRole(userRappOid, ROLE_CLIENT_OID); @@ -202,8 +168,8 @@ public void test107RappUnAssignRoleClient() throws Exception { @Test public void test110AddMancombWithRoleClient() throws Exception { final String TEST_NAME = "test110AddMancombWithRoleClient"; - TestUtil.displayTestTitle(this, TEST_NAME); - Task task = taskManager.createTaskInstance(TestTrafo.class.getName() + "." + TEST_NAME); + displayTestTitle(TEST_NAME); + Task task = createTask(TEST_NAME); OperationResult result = task.getResult(); PrismObject user = createClientUser(null, null, USER_MANCOMB_GIVEN_NAME, USER_MANCOMB_FAMILY_NAME, true); @@ -212,8 +178,7 @@ public void test110AddMancombWithRoleClient() throws Exception { addObject(user, task, result); // THEN - result.computeStatus(); - TestUtil.assertSuccess(result); + assertSuccess(result); userMancombOid = user.getOid(); PrismObject userAfter = getUser(userMancombOid); @@ -228,8 +193,8 @@ public void test110AddMancombWithRoleClient() throws Exception { @Test public void test112RenameMancomb() throws Exception { final String TEST_NAME = "test112RenameMancomb"; - TestUtil.displayTestTitle(this, TEST_NAME); - Task task = taskManager.createTaskInstance(TestTrafo.class.getName() + "." + TEST_NAME); + displayTestTitle(TEST_NAME); + Task task = createTask(TEST_NAME); OperationResult result = task.getResult(); try { @@ -251,29 +216,28 @@ public void test112RenameMancomb() throws Exception { @Test public void test119MancombDelete() throws Exception { final String TEST_NAME = "test119MancombDelete"; - TestUtil.displayTestTitle(this, TEST_NAME); - Task task = taskManager.createTaskInstance(TestTrafo.class.getName() + "." + TEST_NAME); + displayTestTitle(TEST_NAME); + Task task = createTask(TEST_NAME); OperationResult result = task.getResult(); // WHEN deleteObject(UserType.class, userMancombOid, task, result); // THEN - result.computeStatus(); - TestUtil.assertSuccess(result); + assertSuccess(result); assertNoObject(UserType.class, userMancombOid, task, result); openDJController.assertNoEntry("uid="+userMancombOid+",ou=clients,dc=example,dc=com"); } /** - * Kate nas a name. But no OID. + * Kate has a name. But no OID. */ @Test public void test120AddKateWithRoleClient() throws Exception { final String TEST_NAME = "test120AddKateWithRoleClient"; - TestUtil.displayTestTitle(this, TEST_NAME); - Task task = taskManager.createTaskInstance(TestTrafo.class.getName() + "." + TEST_NAME); + displayTestTitle(TEST_NAME); + Task task = createTask(TEST_NAME); OperationResult result = task.getResult(); PrismObject user = createClientUser(null, USER_KATE_NAME, USER_KATE_GIVEN_NAME, USER_KATE_FAMILY_NAME, true); @@ -282,8 +246,7 @@ public void test120AddKateWithRoleClient() throws Exception { addObject(user, task, result); // THEN - result.computeStatus(); - TestUtil.assertSuccess(result); + assertSuccess(result); PrismObject userAfter = getUser(USER_KATE_NAME); assertUser(userAfter, USER_WALLY_GIVEN_NAME, USER_WALLY_FAMILY_NAME); @@ -296,8 +259,8 @@ public void test120AddKateWithRoleClient() throws Exception { @Test public void test122AddWallyWithRoleClient() throws Exception { final String TEST_NAME = "test122AddWallyWithRoleClient"; - TestUtil.displayTestTitle(this, TEST_NAME); - Task task = taskManager.createTaskInstance(TestTrafo.class.getName() + "." + TEST_NAME); + displayTestTitle(TEST_NAME); + Task task = createTask(TEST_NAME); OperationResult result = task.getResult(); PrismObject user = createClientUser(USER_WALLY_OID, null, USER_WALLY_GIVEN_NAME, USER_WALLY_FAMILY_NAME, true); @@ -306,8 +269,7 @@ public void test122AddWallyWithRoleClient() throws Exception { addObject(user, task, result); // THEN - result.computeStatus(); - TestUtil.assertSuccess(result); + assertSuccess(result); PrismObject userAfter = getUser(USER_WALLY_OID); assertUser(userAfter, USER_WALLY_GIVEN_NAME, USER_WALLY_FAMILY_NAME); @@ -320,8 +282,8 @@ public void test122AddWallyWithRoleClient() throws Exception { @Test public void test124AddRogersWithRoleClient() throws Exception { final String TEST_NAME = "test124AddMartyWithRoleClient"; - TestUtil.displayTestTitle(this, TEST_NAME); - Task task = taskManager.createTaskInstance(TestTrafo.class.getName() + "." + TEST_NAME); + displayTestTitle(TEST_NAME); + Task task = createTask(TEST_NAME); OperationResult result = task.getResult(); PrismObject user = createClientUser(USER_ROGERS_OID, USER_ROGERS_OID, USER_ROGERS_GIVEN_NAME, USER_ROGERS_FAMILY_NAME, true); @@ -330,8 +292,7 @@ public void test124AddRogersWithRoleClient() throws Exception { addObject(user, task, result); // THEN - result.computeStatus(); - TestUtil.assertSuccess(result); + assertSuccess(result); PrismObject userAfter = getUser(USER_ROGERS_OID); assertUser(userAfter, USER_ROGERS_GIVEN_NAME, USER_ROGERS_FAMILY_NAME); @@ -344,8 +305,8 @@ public void test124AddRogersWithRoleClient() throws Exception { @Test public void test126AddMartyWithRoleClient() throws Exception { final String TEST_NAME = "test124AddMartyWithRoleClient"; - TestUtil.displayTestTitle(this, TEST_NAME); - Task task = taskManager.createTaskInstance(TestTrafo.class.getName() + "." + TEST_NAME); + displayTestTitle(TEST_NAME); + Task task = createTask(TEST_NAME); OperationResult result = task.getResult(); PrismObject user = createClientUser(USER_MARTY_OID, USER_MARTY_NAME, USER_MARTY_GIVEN_NAME, USER_MARTY_FAMILY_NAME, true); @@ -357,8 +318,7 @@ public void test126AddMartyWithRoleClient() throws Exception { AssertJUnit.fail("Unexpected success"); } catch (PolicyViolationException e) { // This is expected - result.computeStatus(); - TestUtil.assertFailure(result); + assertFailure(result); } // THEN @@ -386,6 +346,10 @@ private void assertLdapClient(PrismObject user, String firstName, Stri display("OpenDJ shadow linked to "+user, shadow); IntegrationTestTools.assertSecondaryIdentifier(shadow, "uid="+user.getOid()+",ou=clients,dc=example,dc=com"); // TODO: cn, sn, givenName + + // MID-5114 + assertAttribute(resourceOpenDj, shadow.asObjectable(), ATTR_ROOM_NUMBER, user.getOid()); + assertAttribute(resourceOpenDj, shadow.asObjectable(), ATTR_MOBILE, user.getOid()); } private void assertNoLdapClient(PrismObject user) throws ObjectNotFoundException, SchemaException, SecurityViolationException, CommunicationException, ConfigurationException, DirectoryException { diff --git a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/uuid/TestUuidExtension.java b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/uuid/TestUuidExtension.java new file mode 100644 index 00000000000..00a09f59d5b --- /dev/null +++ b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/uuid/TestUuidExtension.java @@ -0,0 +1,218 @@ +package com.evolveum.midpoint.testing.story.uuid; +/* + * Copyright (c) 2014-2019 Evolveum + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import com.evolveum.midpoint.prism.PrismObject; +import com.evolveum.midpoint.prism.PrismReferenceValue; +import com.evolveum.midpoint.prism.path.ItemPath; +import com.evolveum.midpoint.prism.util.PrismTestUtil; +import com.evolveum.midpoint.schema.constants.MidPointConstants; +import com.evolveum.midpoint.schema.result.OperationResult; +import com.evolveum.midpoint.task.api.Task; +import com.evolveum.midpoint.test.IntegrationTestTools; +import com.evolveum.midpoint.test.util.MidPointTestConstants; +import com.evolveum.midpoint.test.util.TestUtil; +import com.evolveum.midpoint.testing.story.AbstractStoryTest; +import com.evolveum.midpoint.util.exception.*; +import com.evolveum.midpoint.xml.ns._public.common.common_3.*; +import com.evolveum.prism.xml.ns._public.types_3.PolyStringType; +import org.opends.server.types.DirectoryException; +import org.springframework.test.annotation.DirtiesContext; +import org.springframework.test.annotation.DirtiesContext.ClassMode; +import org.springframework.test.context.ContextConfiguration; +import org.testng.AssertJUnit; +import org.testng.annotations.AfterClass; +import org.testng.annotations.Listeners; +import org.testng.annotations.Test; + +import java.io.File; + +import static org.testng.AssertJUnit.assertEquals; + +/** + * @author Radovan Semancik + * + */ +@ContextConfiguration(locations = {"classpath:ctx-story-test-main.xml"}) +@DirtiesContext(classMode = ClassMode.AFTER_CLASS) +@Listeners({ com.evolveum.midpoint.tools.testng.AlphabeticalMethodInterceptor.class }) +public class TestUuidExtension extends AbstractUuidTest { + + public static final File SYSTEM_CONFIGURATION_FILE = new File(TEST_DIR, "system-configuration-extension.xml"); + + protected static final File RESOURCE_OPENDJ_FILE = new File(TEST_DIR, "resource-opendj-extension.xml"); + + public static final File ROLE_EMPLOYEE_FILE = new File(TEST_DIR, "role-employee.xml"); + public static final String ROLE_EMPLOYEE_OID = "b6b6b7a6-3aa0-11e9-b5e3-7fcaee07c7e0"; + public static final String ROLE_EMPLOYEE_NAME = "Employee"; + + private static final String USER_RAPP_NAME = "rapp"; + private static final String USER_RAPP_GIVEN_NAME = "Rapp"; + private static final String USER_RAPP_FAMILY_NAME = "Scallion"; + + private static final String USER_KATE_NAME = "kate"; + private static final String USER_KATE_GIVEN_NAME = "Kate"; + private static final String USER_KATE_FAMILY_NAME = "Capsize"; + + protected String userRappOid; + protected String userKateOid; + + @Override + public void initSystem(Task initTask, OperationResult initResult) throws Exception { + super.initSystem(initTask, initResult); + + // Role + importObjectFromFile(ROLE_EMPLOYEE_FILE, initResult); + } + + @Override + protected File getResourceOpenDjFile() { + return RESOURCE_OPENDJ_FILE; + } + + @Override + protected File getSystemConfigurationFile() { + return SYSTEM_CONFIGURATION_FILE; + } + + @Test + public void test100AddUserRapp() throws Exception { + final String TEST_NAME = "test100AddUserRapp"; + displayTestTitle(TEST_NAME); + Task task = createTask(TEST_NAME); + OperationResult result = task.getResult(); + + PrismObject user = createUser(USER_RAPP_NAME, USER_RAPP_GIVEN_NAME, USER_RAPP_FAMILY_NAME, true); + + // WHEN + addObject(user, task, result); + + // THEN + assertSuccess(result); + + userRappOid = user.getOid(); + + user = getUser(userRappOid); + assertUser(user, USER_RAPP_NAME, USER_RAPP_GIVEN_NAME, USER_RAPP_FAMILY_NAME); + } + + @Test + public void test101RappAssignRoleEmployee() throws Exception { + final String TEST_NAME = "test101RappAssignRoleEmployee"; + displayTestTitle(TEST_NAME); + Task task = createTask(TEST_NAME); + OperationResult result = task.getResult(); + + // WHEN + assignRole(userRappOid, ROLE_EMPLOYEE_OID, task, result); + + // THEN + assertSuccess(result); + + PrismObject userAfter = getUser(userRappOid); + assertUser(userAfter, USER_RAPP_NAME, USER_RAPP_GIVEN_NAME, USER_RAPP_FAMILY_NAME); + assertLdapEmployee(userAfter, USER_RAPP_NAME, USER_RAPP_GIVEN_NAME, USER_RAPP_FAMILY_NAME); + } + + // TODO: modify user, account should be modified + + @Test + public void test107RappUnAssignRoleEmployee() throws Exception { + final String TEST_NAME = "test107RappUnAssignRoleEmployee"; + displayTestTitle(TEST_NAME); + Task task = createTask(TEST_NAME); + + // WHEN + unassignRole(userRappOid, ROLE_EMPLOYEE_OID); + + // THEN + PrismObject userAfter = getUser(userRappOid); + assertUser(userAfter, USER_RAPP_NAME, USER_RAPP_GIVEN_NAME, USER_RAPP_FAMILY_NAME); + assertNoLdapEmployee(userAfter); + } + + /** + * MID-5114 + */ + @Test + public void test110AddKateWithRoleEmployee() throws Exception { + final String TEST_NAME = "test110AddKateWithRoleEmployee"; + displayTestTitle(TEST_NAME); + Task task = createTask(TEST_NAME); + OperationResult result = task.getResult(); + + PrismObject user = createEmployeeUser(USER_KATE_NAME, USER_KATE_GIVEN_NAME, USER_KATE_FAMILY_NAME, true); + display("User before", user); + + // WHEN + addObject(user, task, result); + + // THEN + assertSuccess(result); + userKateOid = user.getOid(); + + PrismObject userAfter = getUser(userKateOid); + assertUser(userAfter, USER_KATE_NAME, USER_KATE_GIVEN_NAME, USER_KATE_FAMILY_NAME); + assertLdapEmployee(userAfter, USER_KATE_NAME, USER_KATE_GIVEN_NAME, USER_KATE_FAMILY_NAME); + } + + private void assertUser(PrismObject user, String expectedName, String firstName, String lastName) { + display("User", user); + String oid = user.getOid(); + PolyStringType name = user.asObjectable().getName(); + assertEquals("User name mismatch", expectedName, name.getOrig()); + + String ship = user.getPropertyRealValue(PATH_EXTENSION_SHIP, String.class); + assertEquals("User ship-OID mismatch", oid, ship); + // TODO + } + + private void assertLdapEmployee(PrismObject user, String name, String firstName, String lastName) throws ObjectNotFoundException, SchemaException, SecurityViolationException, CommunicationException, ConfigurationException, ExpressionEvaluationException { + assertLinks(user, 1); + assertAssignments(user, RoleType.class, 1); + assertAssignedRole(user, ROLE_EMPLOYEE_OID); + + assertAccount(user, RESOURCE_OPENDJ_OID); + PrismReferenceValue linkRef = getLinkRef(user, RESOURCE_OPENDJ_OID); + PrismObject shadow = getShadowModel(linkRef.getOid()); + display("OpenDJ shadow linked to "+user, shadow); + IntegrationTestTools.assertSecondaryIdentifier(shadow, "uid="+user.getOid()+",ou=people,dc=example,dc=com"); + // TODO: cn, sn, givenName + + // MID-5114 + assertAttribute(resourceOpenDj, shadow.asObjectable(), ATTR_DEPARTMENT_NUMBER, user.getOid()); + } + + private void assertNoLdapEmployee(PrismObject user) throws ObjectNotFoundException, SchemaException, SecurityViolationException, CommunicationException, ConfigurationException, DirectoryException { + assertLinks(user, 0); + assertAssignments(user, RoleType.class, 0); + assertNotAssignedRole(user, ROLE_EMPLOYEE_OID); + + openDJController.assertNoEntry("uid="+user.getOid()+",ou=people,dc=example,dc=com"); + } + + private PrismObject createEmployeeUser(String name, String givenName, String familyName, boolean enabled) throws SchemaException { + PrismObject user = createUser(name, givenName, familyName, enabled); + AssignmentType roleAssignment = new AssignmentType(); + ObjectReferenceType targetRef = new ObjectReferenceType(); + targetRef.setOid(ROLE_EMPLOYEE_OID); + targetRef.setType(RoleType.COMPLEX_TYPE); + roleAssignment.setTargetRef(targetRef); + user.asObjectable().getAssignment().add(roleAssignment); + return user; + } + +} diff --git a/testing/story/src/test/resources/uuid/resource-opendj.xml b/testing/story/src/test/resources/uuid/resource-opendj-client.xml similarity index 91% rename from testing/story/src/test/resources/uuid/resource-opendj.xml rename to testing/story/src/test/resources/uuid/resource-opendj-client.xml index d2946bff45d..2a7527b19eb 100644 --- a/testing/story/src/test/resources/uuid/resource-opendj.xml +++ b/testing/story/src/test/resources/uuid/resource-opendj-client.xml @@ -1,6 +1,6 @@ + ri:mobile + + strong + + true + + + + + + + + ri:roomNumber + + strong + + name + + + + + + + ri:uid mr:stringIgnoreCase diff --git a/testing/story/src/test/resources/uuid/resource-opendj-extension.xml b/testing/story/src/test/resources/uuid/resource-opendj-extension.xml new file mode 100644 index 00000000000..15fe9d1ae4d --- /dev/null +++ b/testing/story/src/test/resources/uuid/resource-opendj-extension.xml @@ -0,0 +1,304 @@ + + + + + + + + Embedded Test OpenDJ + + + Dummy description, just for the test + + + connectorType + com.evolveum.polygon.connector.ldap.LdapConnector + + + + + + + + 10389 + localhost + dc=example,dc=com + uid=idm,ou=Administrators,dc=example,dc=com + secret + auto + uid + ds-pwp-account-disabled + isMemberOf + + + + false + false + false + + + + + + + ri:inetOrgPerson + ri:groupOfUniqueNames + ri:organizationalUnit + + + + + + + account + default + Default Account + true + ri:inetOrgPerson + + + ri:dn + Distinguished Name + mr:stringIgnoreCase + + + + extension/piracy:ship + + + + + + + + + ri:uid + mr:stringIgnoreCase + + + weak + + extension/piracy:ship + + + + + + ri:cn + Common Name + + + $user/fullName + + + + + + ri:sn + + + familyName + + + + + + ri:givenName + + + givenName + + + + + + + ri:departmentNumber + + strong + + extension/piracy:ship + + + + + + ri:group + LDAP Group Membership + entitlement + ldapGroup + objectToSubject + ri:uniqueMember + ri:dn + + + + + + stringIgnoreCase + + declare namespace icfs="http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/resource-schema-3"; + attributes/ri:dn + + ou=Administrators,dc=example,dc=com + true + + + + + + + + + + + + + + + + + + + + entitlement + ldapGroup + LDAP Group + ri:groupOfUniqueNames + + ri:dn + mr:stringIgnoreCase + + + + $focus/name + + + + + + + + ri:cn + mr:stringIgnoreCase + + + weak + + $focus/name + + + + + ri:description + + + description + + + + + + + + + + + + ri:ds-pwp-account-disabled + + true + + + + + + + + ri:AccountObjectClass + true + + + name + + $shadow/attributes/ri:uid + + + + + + + + linked + true + + + deleted + true + + http://midpoint.evolveum.com/xml/ns/public/model/action-3#unlink + + + + unlinked + true + + http://midpoint.evolveum.com/xml/ns/public/model/action-3#link + + + + unmatched + true + + http://midpoint.evolveum.com/xml/ns/public/model/action-3#addFocus + + + + + diff --git a/testing/story/src/test/resources/uuid/role-employee.xml b/testing/story/src/test/resources/uuid/role-employee.xml new file mode 100644 index 00000000000..5237ea83c65 --- /dev/null +++ b/testing/story/src/test/resources/uuid/role-employee.xml @@ -0,0 +1,35 @@ + + + + Employee + + + + + + account + + + + diff --git a/testing/story/src/test/resources/uuid/system-configuration.xml b/testing/story/src/test/resources/uuid/system-configuration-client.xml similarity index 94% rename from testing/story/src/test/resources/uuid/system-configuration.xml rename to testing/story/src/test/resources/uuid/system-configuration-client.xml index 1a1f79e3f7f..10d6af3cbd4 100644 --- a/testing/story/src/test/resources/uuid/system-configuration.xml +++ b/testing/story/src/test/resources/uuid/system-configuration-client.xml @@ -1,6 +1,6 @@ + + + SystemConfiguration + + File Appender + INFO + + TRACE + com.evolveum.midpoint.common.LoggingConfigurationManager + + + TRACE + com.evolveum.midpoint.notifications + + + %date [%thread] %-5level \(%logger{46}\): %message%n + target/test.log + true + + + + UserType + + + extension/piracy:ship + true + + + diff --git a/testing/story/testng-integration.xml b/testing/story/testng-integration.xml index aba8c2298ea..c00d92cb185 100644 --- a/testing/story/testng-integration.xml +++ b/testing/story/testng-integration.xml @@ -29,7 +29,8 @@ - + + From 5c41060b0931f5c260e1b8f4fbafcfe467ebdd27 Mon Sep 17 00:00:00 2001 From: Katarina Valalikova Date: Thu, 28 Feb 2019 07:51:34 +0100 Subject: [PATCH 068/224] some thresholds improvements --- .../schema/ResourceShadowDiscriminator.java | 3 +- .../xml/ns/public/common/common-core-3.xsd | 129 ++++++---- ...tificationCampaignCreationTaskHandler.java | 4 +- ...AccessCertificationClosingTaskHandler.java | 2 +- ...ssCertificationRemediationTaskHandler.java | 3 +- .../api/context/EvaluatedPolicyRule.java | 3 + .../midpoint/model/impl/ModelCrudService.java | 3 +- .../midpoint/model/impl/ModelWebService.java | 3 +- .../impl/cleanup/CleanUpTaskHandler.java | 4 +- .../cleanup/ShadowRefreshTaskHandler.java | 3 +- .../controller/ExecuteDeltasTaskHandler.java | 3 +- .../controller/ModelOperationTaskHandler.java | 4 +- ...ImportAccountsFromResourceTaskHandler.java | 13 +- .../ImportObjectsFromFileTaskHandler.java | 3 +- .../ObjectIntegrityCheckTaskHandler.java | 4 +- .../ShadowIntegrityCheckTaskHandler.java | 4 +- .../model/impl/lens/AssignmentEvaluator.java | 7 +- .../impl/lens/EvaluatedPolicyRuleImpl.java | 20 ++ .../policy/PolicyRuleSuspendTaskExecutor.java | 2 +- .../IterativeScriptExecutionTaskHandler.java | 3 +- .../scripting/ScriptExecutionTaskHandler.java | 3 +- .../impl/sync/ExecuteChangesTaskHandler.java | 3 +- .../sync/FocusValidityScannerTaskHandler.java | 3 +- .../model/impl/sync/LiveSyncTaskHandler.java | 62 ++++- .../model/impl/sync/RecomputeTaskHandler.java | 15 +- .../impl/sync/ReconciliationTaskHandler.java | 77 ++---- .../sync/SynchronizeAccountResultHandler.java | 10 +- .../trigger/TriggerScannerTaskHandler.java | 3 +- .../impl/util/AuditReindexTaskHandler.java | 4 +- .../model/impl/util/DeleteTaskHandler.java | 3 +- .../model/impl/util/ModelImplUtils.java | 40 +-- .../model/impl/util/ReindexTaskHandler.java | 4 +- .../model/intest/util/MockTaskHandler.java | 3 +- .../test/AbstractModelIntegrationTest.java | 63 +++++ .../report/impl/ReportCreateTaskHandler.java | 3 +- .../WfPrepareChildOperationTaskHandler.java | 4 +- .../WfPrepareRootOperationTaskHandler.java | 4 +- ...opagateTaskObjectReferenceTaskHandler.java | 3 +- .../WfProcessInstanceShadowTaskHandler.java | 4 +- provisioning/provisioning-api/pom.xml | 5 + .../provisioning/api/ProvisioningService.java | 6 +- .../api/ResourceEventListener.java | 7 +- .../ChangeNotificationDispatcherImpl.java | 4 +- .../impl/ProvisioningServiceImpl.java | 15 +- .../impl/ResourceEventListenerImpl.java | 8 +- .../provisioning/impl/ShadowCache.java | 71 ++++-- .../task/MultiPropagationTaskHandler.java | 3 +- .../impl/task/PropagationResultHandler.java | 2 +- .../impl/task/PropagationTaskHandler.java | 3 +- .../provisioning/impl/dummy/TestDummy.java | 18 +- .../impl/opendj/TestOpenDjNegative.java | 4 +- .../impl/opendj/TestSynchronization.java | 4 +- .../midpoint/repo/api/RepositoryService.java | 31 ++- .../repo/api/VersionPrecondition.java | 7 +- .../midpoint/repo/cache/RepositoryCache.java | 61 +++-- .../midpoint/repo/common/CounterManager.java | 96 ++++---- .../AbstractSearchIterativeResultHandler.java | 23 +- .../AbstractSearchIterativeTaskHandler.java | 10 +- .../repo/common/util/RepoCommonUtils.java | 10 + .../midpoint/repo/sql/ModifyTest.java | 42 +++- .../repo/sql/SqlRepositoryServiceImpl.java | 85 +++++-- .../repo/sql/helpers/ObjectUpdater.java | 59 +++-- .../midpoint/task/api/TaskConstants.java | 2 + .../midpoint/task/api/TaskHandler.java | 13 +- .../midpoint/task/api/TaskManager.java | 28 ++- .../task/api/WorkBucketAwareTaskHandler.java | 10 +- .../quartzimpl/TaskManagerQuartzImpl.java | 90 ++++++- .../task/quartzimpl/TaskQuartzImpl.java | 115 +++++++-- .../execution/ExecutionManager.java | 40 ++- .../quartzimpl/execution/HandlerExecutor.java | 205 ++++++++++++++++ .../quartzimpl/execution/JobExecutor.java | 231 +++++++----------- .../handlers/JdbcPingTaskHandler.java | 4 +- .../LightweigthPartitioningTaskHandler.java | 179 ++++++++++++++ .../quartzimpl/handlers/NoOpTaskHandler.java | 3 +- .../handlers/PartitioningTaskHandler.java | 2 +- .../WaitForSubtasksByPollingTaskHandler.java | 3 +- .../handlers/WaitForTasksTaskHandler.java | 3 +- .../handlers/WorkersCreationTaskHandler.java | 2 +- .../handlers/WorkersRestartTaskHandler.java | 3 +- .../quartzimpl/work/WorkStateManager.java | 43 ++-- .../task/quartzimpl/MockCycleTaskHandler.java | 3 +- .../task/quartzimpl/MockLongTaskHandler.java | 3 +- .../quartzimpl/MockParallelTaskHandler.java | 4 +- .../quartzimpl/MockSingleTaskHandler.java | 3 +- .../MockWorkBucketsTaskHandler.java | 3 +- .../testing/story/TestThresholds.java | 215 ++++++++-------- .../story/TestThresholdsLiveSyncFull.java | 75 ++++++ .../story/TestThresholdsLiveSyncSimulate.java | 72 ++++++ .../story/TestThresholdsReconFull.java | 68 ++++++ .../story/TestThresholdsReconSimulate.java | 69 ++++++ .../story/src/test/resources/logback-test.xml | 5 +- .../resources/thresholds/resource-opendj.xml | 3 +- .../task-opendj-import-base-users.xml | 34 +++ ...cile.xml => task-opendj-livesync-full.xml} | 40 +-- .../task-opendj-livesync-simulate.xml | 64 +++++ .../thresholds/task-opendj-reconcile-full.xml | 66 +++++ .../task-opendj-reconcile-simulate.xml | 69 ++++++ .../test/resources/thresholds/users-base.ldif | 35 +++ .../src/test/resources/thresholds/users.ldif | 36 --- testing/story/testng-integration.xml | 5 +- 100 files changed, 2175 insertions(+), 778 deletions(-) create mode 100644 repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/execution/HandlerExecutor.java create mode 100644 repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/handlers/LightweigthPartitioningTaskHandler.java create mode 100644 testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestThresholdsLiveSyncFull.java create mode 100644 testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestThresholdsLiveSyncSimulate.java create mode 100644 testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestThresholdsReconFull.java create mode 100644 testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestThresholdsReconSimulate.java create mode 100644 testing/story/src/test/resources/thresholds/task-opendj-import-base-users.xml rename testing/story/src/test/resources/thresholds/{task-opendj-reconcile.xml => task-opendj-livesync-full.xml} (69%) create mode 100644 testing/story/src/test/resources/thresholds/task-opendj-livesync-simulate.xml create mode 100644 testing/story/src/test/resources/thresholds/task-opendj-reconcile-full.xml create mode 100644 testing/story/src/test/resources/thresholds/task-opendj-reconcile-simulate.xml create mode 100644 testing/story/src/test/resources/thresholds/users-base.ldif diff --git a/infra/schema/src/main/java/com/evolveum/midpoint/schema/ResourceShadowDiscriminator.java b/infra/schema/src/main/java/com/evolveum/midpoint/schema/ResourceShadowDiscriminator.java index 3890e5225c2..b048401121c 100644 --- a/infra/schema/src/main/java/com/evolveum/midpoint/schema/ResourceShadowDiscriminator.java +++ b/infra/schema/src/main/java/com/evolveum/midpoint/schema/ResourceShadowDiscriminator.java @@ -51,7 +51,7 @@ public class ResourceShadowDiscriminator implements Serializable, DebugDumpable, private QName objectClass; private boolean tombstone; private int order = 0; - + public ResourceShadowDiscriminator(String resourceOid, ShadowKindType kind, String intent, boolean tombstone) { this.resourceOid = resourceOid; this.tombstone = tombstone; @@ -151,7 +151,6 @@ public boolean isWildcard() { return kind == null && objectClass == null; } - public ShadowDiscriminatorType toResourceShadowDiscriminatorType() { ShadowDiscriminatorType rsdt = new ShadowDiscriminatorType(); rsdt.setIntent(intent); diff --git a/infra/schema/src/main/resources/xml/ns/public/common/common-core-3.xsd b/infra/schema/src/main/resources/xml/ns/public/common/common-core-3.xsd index 0ca28178a62..b12431d739a 100755 --- a/infra/schema/src/main/resources/xml/ns/public/common/common-core-3.xsd +++ b/infra/schema/src/main/resources/xml/ns/public/common/common-core-3.xsd @@ -1209,6 +1209,7 @@ + @@ -2744,21 +2745,6 @@ - - - - Stage of the task. Some task can have different processing stages. E.g. reconciliation - task can have: - - situation stage in which only the situation for shadows is computed - - simulation stage in which all changes are computed but nothing is executed - - execution state in which the full reconciliation is run - Supported stages are defined per task type. - - - 4.0 - - - @@ -3303,42 +3289,6 @@ - - - - Stage type of the task. - - - 4.0 - - - - - - - - Name identifying task stage. - - - - - - - Defines which errors are critical and should stop the task in the defined stage. - - - - - - - Define if the specified stage is executed. - - - - - - - @@ -3649,8 +3599,85 @@ + + + + Name identifying task stage. + + + + + + + Defines which errors are critical and should stop the task in the defined stage. + + + + + + + Define if the specified stage is executed. + + + + + + + + An enumeration that indicates the activation status of a particular entity. + The activation status determines whether the entity is active (enabled) + or inactive (disabled, archived, etc.). Please see documentation of individual + enumeration values for more details. + + + + + + + + + +

+ Nothing is executed. Just metadata are handled. E.g. during reconciliation + only situations in shadows are set. +

+
+ + + +
+
+ + + +

+ Changes are computed, but nothing is executed. E.g. preview changes is run for + objects and the computed deltas are stored to be processed later. E.g. simulate + how many changes will be processed during the reconciliation. After reconciliation + finished, proper action is taked to show results during simulation. +

+
+ + + +
+
+ + + +

+ Full execution mode. Cahnges are computed and also executed. +

+
+ + + +
+
+
+
diff --git a/model/certification-impl/src/main/java/com/evolveum/midpoint/certification/impl/AccessCertificationCampaignCreationTaskHandler.java b/model/certification-impl/src/main/java/com/evolveum/midpoint/certification/impl/AccessCertificationCampaignCreationTaskHandler.java index e0357befe23..6a1a3571256 100644 --- a/model/certification-impl/src/main/java/com/evolveum/midpoint/certification/impl/AccessCertificationCampaignCreationTaskHandler.java +++ b/model/certification-impl/src/main/java/com/evolveum/midpoint/certification/impl/AccessCertificationCampaignCreationTaskHandler.java @@ -25,6 +25,8 @@ import com.evolveum.midpoint.util.logging.Trace; import com.evolveum.midpoint.util.logging.TraceManager; import com.evolveum.midpoint.xml.ns._public.common.common_3.AccessCertificationCampaignType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.TaskPartitionDefinitionType; + import org.jetbrains.annotations.NotNull; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @@ -61,7 +63,7 @@ public StatisticsCollectionStrategy getStatisticsCollectionStrategy() { } @Override - public TaskRunResult run(Task task) { + public TaskRunResult run(Task task, TaskPartitionDefinitionType partition) { LOGGER.trace("Task run starting"); OperationResult opResult = new OperationResult(CLASS_DOT+"run"); diff --git a/model/certification-impl/src/main/java/com/evolveum/midpoint/certification/impl/AccessCertificationClosingTaskHandler.java b/model/certification-impl/src/main/java/com/evolveum/midpoint/certification/impl/AccessCertificationClosingTaskHandler.java index c9c662ad02c..2cc5d6285e4 100644 --- a/model/certification-impl/src/main/java/com/evolveum/midpoint/certification/impl/AccessCertificationClosingTaskHandler.java +++ b/model/certification-impl/src/main/java/com/evolveum/midpoint/certification/impl/AccessCertificationClosingTaskHandler.java @@ -90,7 +90,7 @@ public StatisticsCollectionStrategy getStatisticsCollectionStrategy() { } @Override - public TaskRunResult run(Task task) { + public TaskRunResult run(Task task, TaskPartitionDefinitionType partition) { LOGGER.info("Task run starting"); OperationResult opResult = new OperationResult(CLASS_DOT+"run"); diff --git a/model/certification-impl/src/main/java/com/evolveum/midpoint/certification/impl/AccessCertificationRemediationTaskHandler.java b/model/certification-impl/src/main/java/com/evolveum/midpoint/certification/impl/AccessCertificationRemediationTaskHandler.java index e8d5e21969b..17c5f02b198 100644 --- a/model/certification-impl/src/main/java/com/evolveum/midpoint/certification/impl/AccessCertificationRemediationTaskHandler.java +++ b/model/certification-impl/src/main/java/com/evolveum/midpoint/certification/impl/AccessCertificationRemediationTaskHandler.java @@ -35,6 +35,7 @@ import com.evolveum.midpoint.xml.ns._public.common.common_3.AccessCertificationCampaignType; import com.evolveum.midpoint.xml.ns._public.common.common_3.AccessCertificationCaseType; import com.evolveum.midpoint.xml.ns._public.common.common_3.SystemObjectsType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.TaskPartitionDefinitionType; import com.evolveum.midpoint.xml.ns._public.common.common_3.UserType; import com.evolveum.prism.xml.ns._public.types_3.PolyStringType; import org.jetbrains.annotations.NotNull; @@ -83,7 +84,7 @@ public StatisticsCollectionStrategy getStatisticsCollectionStrategy() { } @Override - public TaskRunResult run(Task task) { + public TaskRunResult run(Task task, TaskPartitionDefinitionType partition) { LOGGER.trace("Task run starting"); OperationResult opResult = new OperationResult(CLASS_DOT+"run"); diff --git a/model/model-api/src/main/java/com/evolveum/midpoint/model/api/context/EvaluatedPolicyRule.java b/model/model-api/src/main/java/com/evolveum/midpoint/model/api/context/EvaluatedPolicyRule.java index f2e3250710e..30869a6b08e 100644 --- a/model/model-api/src/main/java/com/evolveum/midpoint/model/api/context/EvaluatedPolicyRule.java +++ b/model/model-api/src/main/java/com/evolveum/midpoint/model/api/context/EvaluatedPolicyRule.java @@ -97,4 +97,7 @@ void addToEvaluatedPolicyRuleTypes(Collection rules, Po // use only if you know what you're doing void addTrigger(@NotNull EvaluatedPolicyRuleTrigger trigger); + + //experimental + String getPolicyRuleIdentifier(); } diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/ModelCrudService.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/ModelCrudService.java index 2bee796f5c9..f9ef107013a 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/ModelCrudService.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/ModelCrudService.java @@ -42,6 +42,7 @@ import com.evolveum.midpoint.provisioning.api.ChangeNotificationDispatcher; import com.evolveum.midpoint.provisioning.api.GenericConnectorException; import com.evolveum.midpoint.provisioning.api.ResourceEventDescription; +import com.evolveum.midpoint.repo.api.PreconditionViolationException; import com.evolveum.midpoint.repo.api.RepositoryService; import com.evolveum.midpoint.repo.cache.RepositoryCache; import com.evolveum.midpoint.schema.DeltaConvertor; @@ -121,7 +122,7 @@ public List> searchObjects(Class type, return modelService.searchObjects(type, query, options, task, parentResult); } - public void notifyChange(ResourceObjectShadowChangeDescriptionType changeDescription, OperationResult parentResult, Task task) throws SchemaException, CommunicationException, ConfigurationException, SecurityViolationException, ObjectNotFoundException, GenericConnectorException, ObjectAlreadyExistsException, ExpressionEvaluationException{ + public void notifyChange(ResourceObjectShadowChangeDescriptionType changeDescription, OperationResult parentResult, Task task) throws SchemaException, CommunicationException, ConfigurationException, SecurityViolationException, ObjectNotFoundException, GenericConnectorException, ObjectAlreadyExistsException, ExpressionEvaluationException, PolicyViolationException, PreconditionViolationException{ String oldShadowOid = changeDescription.getOldShadowOid(); ResourceEventDescription eventDescription = new ResourceEventDescription(); diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/ModelWebService.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/ModelWebService.java index 4cfe76cea01..ca6ef979338 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/ModelWebService.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/ModelWebService.java @@ -23,6 +23,7 @@ import com.evolveum.midpoint.prism.PrismValue; import com.evolveum.midpoint.prism.delta.ObjectDelta; import com.evolveum.midpoint.prism.query.ObjectQuery; +import com.evolveum.midpoint.repo.api.PreconditionViolationException; import com.evolveum.midpoint.schema.DeltaConvertor; import com.evolveum.midpoint.schema.GetOperationOptions; import com.evolveum.midpoint.schema.ObjectDeltaOperation; @@ -426,7 +427,7 @@ public TaskType notifyChange(ResourceObjectShadowChangeDescriptionType changeDes try { model.notifyChange(changeDescription, parentResult, task); - } catch (ObjectNotFoundException | SchemaException | CommunicationException | ConfigurationException | SecurityViolationException | ObjectAlreadyExistsException | ExpressionEvaluationException | RuntimeException | Error ex) { + } catch (ObjectNotFoundException | SchemaException | CommunicationException | ConfigurationException | SecurityViolationException | ObjectAlreadyExistsException | ExpressionEvaluationException | RuntimeException | Error | PolicyViolationException | PreconditionViolationException ex) { LoggingUtils.logException(LOGGER, "# MODEL notifyChange() failed", ex); auditLogout(task); throwFault(ex, parentResult); diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/cleanup/CleanUpTaskHandler.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/cleanup/CleanUpTaskHandler.java index 02dda5f6e61..180dcf2b643 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/cleanup/CleanUpTaskHandler.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/cleanup/CleanUpTaskHandler.java @@ -35,6 +35,8 @@ import com.evolveum.midpoint.xml.ns._public.common.common_3.CleanupPolicyType; import com.evolveum.midpoint.xml.ns._public.common.common_3.SystemConfigurationType; import com.evolveum.midpoint.xml.ns._public.common.common_3.SystemObjectsType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.TaskPartitionDefinitionType; + import org.jetbrains.annotations.NotNull; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @@ -72,7 +74,7 @@ public StatisticsCollectionStrategy getStatisticsCollectionStrategy() { } @Override - public TaskRunResult run(Task task) { + public TaskRunResult run(Task task, TaskPartitionDefinitionType partition) { LOGGER.trace("CleanUpTaskHandler.run starting"); OperationResult opResult = new OperationResult(OperationConstants.CLEANUP); diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/cleanup/ShadowRefreshTaskHandler.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/cleanup/ShadowRefreshTaskHandler.java index 45969bed632..d88c80eb565 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/cleanup/ShadowRefreshTaskHandler.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/cleanup/ShadowRefreshTaskHandler.java @@ -36,6 +36,7 @@ import com.evolveum.midpoint.util.logging.Trace; import com.evolveum.midpoint.util.logging.TraceManager; import com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.TaskPartitionDefinitionType; /** * Scanner that looks for pending operations in the shadows and updates the status. @@ -95,7 +96,7 @@ protected void finish(AbstractScannerResultHandler handler, TaskRunR } @Override - protected AbstractScannerResultHandler createHandler(TaskRunResult runResult, final Task coordinatorTask, + protected AbstractScannerResultHandler createHandler(TaskPartitionDefinitionType partition, TaskRunResult runResult, final Task coordinatorTask, OperationResult opResult) { AbstractScannerResultHandler handler = new AbstractScannerResultHandler( diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/controller/ExecuteDeltasTaskHandler.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/controller/ExecuteDeltasTaskHandler.java index 1b624125fa8..ea526cc0bca 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/controller/ExecuteDeltasTaskHandler.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/controller/ExecuteDeltasTaskHandler.java @@ -31,6 +31,7 @@ import com.evolveum.midpoint.util.logging.Trace; import com.evolveum.midpoint.util.logging.TraceManager; import com.evolveum.midpoint.xml.ns._public.common.common_3.ModelExecuteOptionsType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.TaskPartitionDefinitionType; import com.evolveum.prism.xml.ns._public.types_3.ObjectDeltaType; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @@ -57,7 +58,7 @@ public class ExecuteDeltasTaskHandler implements TaskHandler { @Autowired private ModelService modelService; @Override - public TaskRunResult run(Task task) { + public TaskRunResult run(Task task, TaskPartitionDefinitionType partition) { OperationResult result = task.getResult().createSubresult(DOT_CLASS + "run"); TaskRunResult runResult = new TaskRunResult(); diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/controller/ModelOperationTaskHandler.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/controller/ModelOperationTaskHandler.java index 626ee63e626..856c418f1dd 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/controller/ModelOperationTaskHandler.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/controller/ModelOperationTaskHandler.java @@ -35,6 +35,8 @@ import com.evolveum.midpoint.util.logging.Trace; import com.evolveum.midpoint.util.logging.TraceManager; import com.evolveum.midpoint.xml.ns._public.common.common_3.LensContextType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.TaskPartitionDefinitionType; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @@ -67,7 +69,7 @@ public class ModelOperationTaskHandler implements TaskHandler { @Autowired private Clockwork clockwork; @Override - public TaskRunResult run(Task task) { + public TaskRunResult run(Task task, TaskPartitionDefinitionType partition) { OperationResult result = task.getResult().createSubresult(DOT_CLASS + "run"); TaskRunResult runResult = new TaskRunResult(); diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/importer/ImportAccountsFromResourceTaskHandler.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/importer/ImportAccountsFromResourceTaskHandler.java index 5a82038ee90..9c6d2f4ba3a 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/importer/ImportAccountsFromResourceTaskHandler.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/importer/ImportAccountsFromResourceTaskHandler.java @@ -64,6 +64,7 @@ import com.evolveum.midpoint.xml.ns._public.common.common_3.LayerType; import com.evolveum.midpoint.xml.ns._public.common.common_3.ResourceType; import com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.TaskPartitionDefinitionType; import com.evolveum.prism.xml.ns._public.types_3.PolyStringType; /** @@ -174,7 +175,7 @@ public void launch(ResourceType resource, QName objectclass, Task task, Operatio } @Override - protected SynchronizeAccountResultHandler createHandler(TaskRunResult runResult, Task coordinatorTask, + protected SynchronizeAccountResultHandler createHandler(TaskPartitionDefinitionType partition, TaskRunResult runResult, Task coordinatorTask, OperationResult opResult) { ResourceType resource = resolveObjectRef(ResourceType.class, runResult, coordinatorTask, opResult); @@ -182,11 +183,11 @@ protected SynchronizeAccountResultHandler createHandler(TaskRunResult runResult, return null; } - return createHandler(resource, null, runResult, coordinatorTask, opResult); + return createHandler(partition, resource, null, runResult, coordinatorTask, opResult); } // shadowToImport - it is used to derive objectClass/intent/kind when importing a single shadow - private SynchronizeAccountResultHandler createHandler(ResourceType resource, PrismObject shadowToImport, + private SynchronizeAccountResultHandler createHandler(TaskPartitionDefinitionType partition, ResourceType resource, PrismObject shadowToImport, TaskRunResult runResult, Task coordinatorTask, OperationResult opResult) { ObjectClassComplexTypeDefinition objectClass = determineObjectClassDefinition(resource, shadowToImport, runResult, coordinatorTask, opResult); @@ -197,13 +198,13 @@ private SynchronizeAccountResultHandler createHandler(ResourceType resource, Pri LOGGER.info("Start executing import from resource {}, importing object class {}", resource, objectClass.getTypeName()); SynchronizeAccountResultHandler handler = new SynchronizeAccountResultHandler(resource, objectClass, "import", - coordinatorTask, changeNotificationDispatcher, null, taskManager); + coordinatorTask, changeNotificationDispatcher, partition, taskManager); handler.setSourceChannel(SchemaConstants.CHANGE_CHANNEL_IMPORT); handler.setForceAdd(true); handler.setStopOnError(false); handler.setContextDesc("from "+resource); handler.setLogObjectProgress(true); - + return handler; } @@ -299,7 +300,7 @@ public boolean importSingleShadow(String shadowOid, Task task, OperationResult p // Create a result handler just for one object. Invoke the handle() method manually. TaskRunResult runResult = new TaskRunResult(); - SynchronizeAccountResultHandler resultHandler = createHandler(resource.asObjectable(), shadow, runResult, task, parentResult); + SynchronizeAccountResultHandler resultHandler = createHandler(null, resource.asObjectable(), shadow, runResult, task, parentResult); if (resultHandler == null) { return false; } diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/importer/ImportObjectsFromFileTaskHandler.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/importer/ImportObjectsFromFileTaskHandler.java index 0d2996e0130..5e154026f0d 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/importer/ImportObjectsFromFileTaskHandler.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/importer/ImportObjectsFromFileTaskHandler.java @@ -31,6 +31,7 @@ import com.evolveum.midpoint.util.exception.SchemaException; import com.evolveum.midpoint.util.logging.Trace; import com.evolveum.midpoint.util.logging.TraceManager; +import com.evolveum.midpoint.xml.ns._public.common.common_3.TaskPartitionDefinitionType; import com.evolveum.prism.xml.ns._public.types_3.PolyStringType; import org.apache.commons.lang.NotImplementedException; @@ -150,7 +151,7 @@ public void launch(File input, Task task, OperationResult parentResult) { * The body of the task. This will start the import "loop". */ @Override - public TaskRunResult run(Task task) { + public TaskRunResult run(Task task, TaskPartitionDefinitionType partition) { LOGGER.debug("Import objects from file run (task {})", task); diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/integrity/ObjectIntegrityCheckTaskHandler.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/integrity/ObjectIntegrityCheckTaskHandler.java index 20dfa935749..834f1a1bd4a 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/integrity/ObjectIntegrityCheckTaskHandler.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/integrity/ObjectIntegrityCheckTaskHandler.java @@ -31,6 +31,8 @@ import com.evolveum.midpoint.util.logging.Trace; import com.evolveum.midpoint.util.logging.TraceManager; import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.TaskPartitionDefinitionType; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @@ -72,7 +74,7 @@ private void initialize() { } @Override - protected ObjectIntegrityCheckResultHandler createHandler(TaskRunResult runResult, Task coordinatorTask, OperationResult opResult) { + protected ObjectIntegrityCheckResultHandler createHandler(TaskPartitionDefinitionType partition, TaskRunResult runResult, Task coordinatorTask, OperationResult opResult) { return new ObjectIntegrityCheckResultHandler(coordinatorTask, ObjectIntegrityCheckTaskHandler.class.getName(), "check object integrity", "check object integrity", taskManager, prismContext, repositoryService, systemObjectCache, opResult); diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/integrity/ShadowIntegrityCheckTaskHandler.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/integrity/ShadowIntegrityCheckTaskHandler.java index a5e532c6992..95da89315b4 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/integrity/ShadowIntegrityCheckTaskHandler.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/integrity/ShadowIntegrityCheckTaskHandler.java @@ -31,6 +31,8 @@ import com.evolveum.midpoint.util.logging.TraceManager; import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType; import com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.TaskPartitionDefinitionType; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @@ -89,7 +91,7 @@ private void initialize() { } @Override - protected ShadowIntegrityCheckResultHandler createHandler(TaskRunResult runResult, Task coordinatorTask, OperationResult opResult) { + protected ShadowIntegrityCheckResultHandler createHandler(TaskPartitionDefinitionType partition, TaskRunResult runResult, Task coordinatorTask, OperationResult opResult) { return new ShadowIntegrityCheckResultHandler(coordinatorTask, ShadowIntegrityCheckTaskHandler.class.getName(), "check shadow integrity", "check shadow integrity", taskManager, prismContext, provisioningService, matchingRuleRegistry, repositoryService, synchronizationService, systemObjectCache, opResult); diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/AssignmentEvaluator.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/AssignmentEvaluator.java index 35bd74c46be..ae7c1f7f5ce 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/AssignmentEvaluator.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/AssignmentEvaluator.java @@ -442,18 +442,13 @@ private boolean evaluateSegmentContent(AssignmentPathSegm } if (assignmentType.getPolicyRule() != null && !loginMode) { // We can ignore "reallyValid" for the same reason as for focus mappings. - LOGGER.info("###policy rule"); if (isNonNegative(relativeMode)) { - LOGGER.info("##### is non negative"); if (segment.isMatchingOrder()) { - LOGGER.info("##### collect focus rules"); collectPolicyRule(true, segment, ctx); } if (segment.isMatchingOrderForTarget()) { collectPolicyRule(false, segment, ctx); - } else { - collectPolicyRule(false, segment, ctx); - } + } } } if (assignmentType.getTarget() != null || assignmentType.getTargetRef() != null) { diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/EvaluatedPolicyRuleImpl.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/EvaluatedPolicyRuleImpl.java index d4e5588e435..ada9a1e177e 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/EvaluatedPolicyRuleImpl.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/EvaluatedPolicyRuleImpl.java @@ -87,6 +87,8 @@ public class EvaluatedPolicyRuleImpl implements EvaluatedPolicyRule { @Nullable private final ObjectType directOwner; private final transient PrismContext prismContextForDebugDump; // if null, nothing serious happens + private String policyRuleId; + @NotNull private final List enabledActions = new ArrayList<>(); // computed only when necessary (typically when triggered) public EvaluatedPolicyRuleImpl(@NotNull PolicyRuleType policyRuleType, @Nullable AssignmentPath assignmentPath, @@ -95,6 +97,15 @@ public EvaluatedPolicyRuleImpl(@NotNull PolicyRuleType policyRuleType, @Nullable this.assignmentPath = assignmentPath; this.prismContextForDebugDump = prismContext; this.directOwner = computeDirectOwner(); + this.policyRuleId = computePolicyRuleId(); + } + + private String computePolicyRuleId() { + if (directOwner == null) { + return null; + } + + return directOwner.getOid() + policyRuleType.asPrismContainerValue().getId(); } public EvaluatedPolicyRuleImpl clone() { @@ -446,4 +457,13 @@ public void computeEnabledActions(@Nullable Po enabledActions.add(action); } } + + //experimental + /* (non-Javadoc) + * @see com.evolveum.midpoint.model.api.context.EvaluatedPolicyRule#getPolicyRuleIdentifier() + */ + @Override + public String getPolicyRuleIdentifier() { + return policyRuleId; + } } diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/projector/policy/PolicyRuleSuspendTaskExecutor.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/projector/policy/PolicyRuleSuspendTaskExecutor.java index d429ca1176a..a29e8462733 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/projector/policy/PolicyRuleSuspendTaskExecutor.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/projector/policy/PolicyRuleSuspendTaskExecutor.java @@ -58,7 +58,7 @@ public void execute(@NotNull ModelContext context, Tas } for (EvaluatedPolicyRule policyRule : focusCtx.getPolicyRules()) { - CounterSepcification counterSpec = counterManager.getCounterSpec(task, policyRule.getPolicyRule()); + CounterSepcification counterSpec = counterManager.getCounterSpec(task, policyRule.getPolicyRuleIdentifier(), policyRule.getPolicyRule()); LOGGER.trace("Found counter specification {} for {}", counterSpec, DebugUtil.debugDumpLazily(policyRule)); int counter = 1; diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/scripting/IterativeScriptExecutionTaskHandler.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/scripting/IterativeScriptExecutionTaskHandler.java index d6f3ead757f..e392c3c2931 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/scripting/IterativeScriptExecutionTaskHandler.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/scripting/IterativeScriptExecutionTaskHandler.java @@ -35,6 +35,7 @@ import com.evolveum.midpoint.util.logging.Trace; import com.evolveum.midpoint.util.logging.TraceManager; import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.TaskPartitionDefinitionType; import com.evolveum.midpoint.xml.ns._public.model.scripting_3.ExecuteScriptType; import com.evolveum.midpoint.xml.ns._public.model.scripting_3.ValueListType; import org.jetbrains.annotations.NotNull; @@ -69,7 +70,7 @@ protected Class getType(Task task) { @NotNull @Override - protected AbstractSearchIterativeResultHandler createHandler(TaskRunResult runResult, final Task coordinatorTask, + protected AbstractSearchIterativeResultHandler createHandler(TaskPartitionDefinitionType partition, TaskRunResult runResult, final Task coordinatorTask, OperationResult opResult) { PrismProperty executeScriptProperty = coordinatorTask.getExtensionProperty(SchemaConstants.SE_EXECUTE_SCRIPT); diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/scripting/ScriptExecutionTaskHandler.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/scripting/ScriptExecutionTaskHandler.java index e9965ab98a9..cbcfe2a4f89 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/scripting/ScriptExecutionTaskHandler.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/scripting/ScriptExecutionTaskHandler.java @@ -33,6 +33,7 @@ import com.evolveum.midpoint.util.logging.LoggingUtils; import com.evolveum.midpoint.util.logging.Trace; import com.evolveum.midpoint.util.logging.TraceManager; +import com.evolveum.midpoint.xml.ns._public.common.common_3.TaskPartitionDefinitionType; import com.evolveum.midpoint.xml.ns._public.model.scripting_3.ExecuteScriptType; import org.jetbrains.annotations.NotNull; import org.springframework.beans.factory.annotation.Autowired; @@ -66,7 +67,7 @@ public StatisticsCollectionStrategy getStatisticsCollectionStrategy() { } @Override - public TaskRunResult run(Task task) { + public TaskRunResult run(Task task, TaskPartitionDefinitionType partition) { OperationResult result = task.getResult().createSubresult(DOT_CLASS + "run"); TaskRunResult runResult = new TaskRunResult(); diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/sync/ExecuteChangesTaskHandler.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/sync/ExecuteChangesTaskHandler.java index 2e7b4757a74..e727cbfc979 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/sync/ExecuteChangesTaskHandler.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/sync/ExecuteChangesTaskHandler.java @@ -53,6 +53,7 @@ import com.evolveum.midpoint.util.logging.TraceManager; import com.evolveum.midpoint.xml.ns._public.common.common_3.FocusType; import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.TaskPartitionDefinitionType; import com.evolveum.midpoint.xml.ns._public.common.common_3.UserType; import com.evolveum.prism.xml.ns._public.types_3.ObjectDeltaType; @@ -88,7 +89,7 @@ protected Class getType(Task task) { @NotNull @Override - protected AbstractSearchIterativeResultHandler createHandler(TaskRunResult runResult, final Task coordinatorTask, + protected AbstractSearchIterativeResultHandler createHandler(TaskPartitionDefinitionType partition, TaskRunResult runResult, final Task coordinatorTask, OperationResult opResult) { AbstractSearchIterativeResultHandler handler = new AbstractSearchIterativeResultHandler( diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/sync/FocusValidityScannerTaskHandler.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/sync/FocusValidityScannerTaskHandler.java index 7f013f09e65..a1a05abf895 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/sync/FocusValidityScannerTaskHandler.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/sync/FocusValidityScannerTaskHandler.java @@ -48,6 +48,7 @@ import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType; import com.evolveum.midpoint.xml.ns._public.common.common_3.PolicyConstraintKindType; import com.evolveum.midpoint.xml.ns._public.common.common_3.PolicyRuleType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.TaskPartitionDefinitionType; import com.evolveum.midpoint.xml.ns._public.common.common_3.TimeValidityPolicyConstraintType; import com.evolveum.midpoint.xml.ns._public.common.common_3.UserType; import com.evolveum.prism.xml.ns._public.types_3.ItemPathType; @@ -256,7 +257,7 @@ protected void finish(AbstractScannerResultHandler handler, TaskRunRe @NotNull @Override - protected AbstractScannerResultHandler createHandler(TaskRunResult runResult, final Task coordinatorTask, + protected AbstractScannerResultHandler createHandler(TaskPartitionDefinitionType partition, TaskRunResult runResult, final Task coordinatorTask, OperationResult opResult) { AbstractScannerResultHandler handler = new AbstractScannerResultHandler( diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/sync/LiveSyncTaskHandler.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/sync/LiveSyncTaskHandler.java index 678c431d5b1..cfac437ec83 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/sync/LiveSyncTaskHandler.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/sync/LiveSyncTaskHandler.java @@ -21,25 +21,33 @@ import com.evolveum.midpoint.model.impl.util.ModelImplUtils; import com.evolveum.midpoint.prism.PrismContext; import com.evolveum.midpoint.provisioning.api.ProvisioningService; +import com.evolveum.midpoint.repo.api.PreconditionViolationException; import com.evolveum.midpoint.repo.common.CounterManager; +import com.evolveum.midpoint.repo.common.util.RepoCommonUtils; import com.evolveum.midpoint.schema.ResourceShadowDiscriminator; import com.evolveum.midpoint.schema.constants.SchemaConstants; import com.evolveum.midpoint.schema.processor.ObjectClassComplexTypeDefinition; import com.evolveum.midpoint.schema.result.OperationConstants; import com.evolveum.midpoint.schema.result.OperationResult; import com.evolveum.midpoint.schema.result.OperationResultStatus; +import com.evolveum.midpoint.schema.util.ExceptionUtil; import com.evolveum.midpoint.task.api.*; import com.evolveum.midpoint.task.api.TaskRunResult.TaskRunResultStatus; import com.evolveum.midpoint.util.exception.CommunicationException; import com.evolveum.midpoint.util.exception.ConfigurationException; import com.evolveum.midpoint.util.exception.ExpressionEvaluationException; import com.evolveum.midpoint.util.exception.ObjectNotFoundException; +import com.evolveum.midpoint.util.exception.PolicyViolationException; import com.evolveum.midpoint.util.exception.SchemaException; import com.evolveum.midpoint.util.exception.SecurityViolationException; import com.evolveum.midpoint.util.logging.Trace; import com.evolveum.midpoint.util.logging.TraceManager; +import com.evolveum.midpoint.xml.ns._public.common.common_3.CriticalityType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.ExecutionModeType; import com.evolveum.midpoint.xml.ns._public.common.common_3.LayerType; import com.evolveum.midpoint.xml.ns._public.common.common_3.ResourceType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.TaskPartitionDefinitionType; + import org.jetbrains.annotations.NotNull; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @@ -83,8 +91,9 @@ public StatisticsCollectionStrategy getStatisticsCollectionStrategy() { .maintainActionsExecutedStatistics(); } + @Override - public TaskRunResult run(Task task) { + public TaskRunResult run(Task task, TaskPartitionDefinitionType partition) { LOGGER.trace("LiveSyncTaskHandler.run starting"); // counterManager.registerCounter(task, true); @@ -182,51 +191,66 @@ public TaskRunResult run(Task task) { // It will use extension of task to store synchronization state ModelImplUtils.clearRequestee(task); - changesProcessed = provisioningService.synchronize(coords, task, opResult); + + changesProcessed = provisioningService.synchronize(coords, task, partition, opResult); } catch (ObjectNotFoundException ex) { LOGGER.error("Live Sync: A required object does not exist, OID: {}", ex.getOid()); LOGGER.error("Exception stack trace", ex); // This is bad. The resource or task or something like that does not exist. Permanent problem. opResult.recordFatalError("A required object does not exist, OID: " + ex.getOid(), ex); - runResult.setRunResultStatus(TaskRunResultStatus.PERMANENT_ERROR); + setRunResultStatus(ex, partition, CriticalityType.FATAL, runResult); return runResult; } catch (CommunicationException ex) { LOGGER.error("Live Sync: Communication error:",ex); // Error, but not critical. Just try later. opResult.recordPartialError("Communication error: "+ex.getMessage(),ex); - runResult.setRunResultStatus(TaskRunResultStatus.TEMPORARY_ERROR); + setRunResultStatus(ex, partition, CriticalityType.PARTIAL, runResult); return runResult; } catch (SchemaException ex) { LOGGER.error("Live Sync: Error dealing with schema:",ex); // Not sure about this. But most likely it is a misconfigured resource or connector // It may be worth to retry. Error is fatal, but may not be permanent. opResult.recordFatalError("Error dealing with schema: "+ex.getMessage(),ex); - runResult.setRunResultStatus(TaskRunResultStatus.TEMPORARY_ERROR); + setRunResultStatus(ex, partition, CriticalityType.PARTIAL, runResult); + return runResult; + } catch (PolicyViolationException ex) { + LOGGER.error("Live Sync: Policy violation:",ex); + // Not sure about this. But most likely it is a misconfigured resource or connector + // It may be worth to retry. Error is fatal, but may not be permanent. + opResult.recordFatalError("Live Sync: Policy violation: "+ex.getMessage(),ex); + setRunResultStatus(ex, partition, CriticalityType.PARTIAL, runResult); + return runResult; + } catch (PreconditionViolationException ex) { + LOGGER.error("Live Sync: Error dealing with schema:",ex); + // Not sure about this. But most likely it is a misconfigured resource or connector + // It may be worth to retry. Error is fatal, but may not be permanent. + opResult.recordFatalError("Error dealing with schema: "+ex.getMessage(),ex); + setRunResultStatus(ex, partition, CriticalityType.PARTIAL, runResult); return runResult; } catch (RuntimeException ex) { LOGGER.error("Live Sync: Internal Error:", ex); // Can be anything ... but we can't recover from that. // It is most likely a programming error. Does not make much sense to retry. opResult.recordFatalError("Internal Error: "+ex.getMessage(),ex); - runResult.setRunResultStatus(TaskRunResultStatus.PERMANENT_ERROR); + setRunResultStatus(ex, partition, CriticalityType.FATAL, runResult); return runResult; } catch (ConfigurationException ex) { LOGGER.error("Live Sync: Configuration error:",ex); // Not sure about this. But most likely it is a misconfigured resource or connector // It may be worth to retry. Error is fatal, but may not be permanent. opResult.recordFatalError("Configuration error: "+ex.getMessage(),ex); - runResult.setRunResultStatus(TaskRunResultStatus.TEMPORARY_ERROR); + setRunResultStatus(ex, partition, CriticalityType.PARTIAL, runResult); return runResult; } catch (SecurityViolationException ex) { LOGGER.error("Recompute: Security violation: {}",ex.getMessage(),ex); opResult.recordFatalError("Security violation: "+ex.getMessage(),ex); - runResult.setRunResultStatus(TaskRunResultStatus.PERMANENT_ERROR); + setRunResultStatus(ex, partition, CriticalityType.FATAL, runResult); return runResult; } catch (ExpressionEvaluationException ex) { LOGGER.error("Recompute: Expression error: {}",ex.getMessage(),ex); opResult.recordFatalError("Expression error: "+ex.getMessage(),ex); - runResult.setRunResultStatus(TaskRunResultStatus.PERMANENT_ERROR); + setRunResultStatus(ex, partition, CriticalityType.FATAL, runResult); return runResult; } @@ -238,6 +262,26 @@ public TaskRunResult run(Task task) { LOGGER.trace("LiveSyncTaskHandler.run stopping (resource {})", resourceOid); return runResult; } + + private void setRunResultStatus(Throwable ex, TaskPartitionDefinitionType partition, CriticalityType defaultCriticality, TaskRunResult runResult) { + CriticalityType criticality = null; + if (partition == null) { + criticality = defaultCriticality; + } else { + criticality = ExceptionUtil.getCriticality(partition.getErrorCriticality(), ex, defaultCriticality); + } + + switch (criticality) { + case PARTIAL: + runResult.setRunResultStatus(TaskRunResultStatus.TEMPORARY_ERROR); + break; + case FATAL: + runResult.setRunResultStatus(TaskRunResultStatus.PERMANENT_ERROR); + break; + default: + runResult.setRunResultStatus(TaskRunResultStatus.TEMPORARY_ERROR); + } + } @Override public Long heartbeat(Task task) { diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/sync/RecomputeTaskHandler.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/sync/RecomputeTaskHandler.java index 5761b656eb8..80b40798bac 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/sync/RecomputeTaskHandler.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/sync/RecomputeTaskHandler.java @@ -50,8 +50,10 @@ import com.evolveum.midpoint.util.exception.SecurityViolationException; import com.evolveum.midpoint.util.logging.Trace; import com.evolveum.midpoint.util.logging.TraceManager; +import com.evolveum.midpoint.xml.ns._public.common.common_3.ExecutionModeType; import com.evolveum.midpoint.xml.ns._public.common.common_3.FocusType; import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.TaskPartitionDefinitionType; import com.evolveum.midpoint.xml.ns._public.common.common_3.UserType; /** @@ -92,14 +94,14 @@ protected Class getType(Task task) { } @Override - protected AbstractSearchIterativeResultHandler createHandler(TaskRunResult runResult, final Task coordinatorTask, + protected AbstractSearchIterativeResultHandler createHandler(TaskPartitionDefinitionType partition, TaskRunResult runResult, final Task coordinatorTask, OperationResult opResult) { AbstractSearchIterativeResultHandler handler = new AbstractSearchIterativeResultHandler( coordinatorTask, RecomputeTaskHandler.class.getName(), "recompute", "recompute task", taskManager) { @Override protected boolean handleObject(PrismObject object, Task workerTask, OperationResult result) throws CommonException, PreconditionViolationException { - recompute(object, getOptions(coordinatorTask), workerTask, result); + recompute(object, getOptions(coordinatorTask), workerTask, partition, result); return true; } @@ -119,7 +121,7 @@ private ModelExecuteOptions getOptions(Task coordinatorTask) throws SchemaExcept return modelExecuteOptions; } - private void recompute(PrismObject focalObject, ModelExecuteOptions options, Task task, OperationResult result) throws SchemaException, + private void recompute(PrismObject focalObject, ModelExecuteOptions options, Task task, TaskPartitionDefinitionType partition, OperationResult result) throws SchemaException, ObjectNotFoundException, ExpressionEvaluationException, CommunicationException, ObjectAlreadyExistsException, ConfigurationException, PolicyViolationException, SecurityViolationException, PreconditionViolationException { LOGGER.trace("Recomputing object {}", focalObject); @@ -128,7 +130,12 @@ private void recompute(PrismObject focalObject, ModelExecuteOptions o if (LOGGER.isTraceEnabled()) { LOGGER.trace("Recomputing object {}: context:\n{}", focalObject, syncContext.debugDump()); } - clockwork.run(syncContext, task, result); + + if (partition != null && ExecutionModeType.SIMULATE == partition.getStage()) { + clockwork.previewChanges(syncContext, null, task, result); + } else { + clockwork.run(syncContext, task, result); + } LOGGER.trace("Recomputation of object {}: {}", focalObject, result.getStatus()); } diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/sync/ReconciliationTaskHandler.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/sync/ReconciliationTaskHandler.java index d0ed7116abc..56e0ed0ef61 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/sync/ReconciliationTaskHandler.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/sync/ReconciliationTaskHandler.java @@ -69,7 +69,7 @@ import com.evolveum.midpoint.xml.ns._public.common.common_3.LayerType; import com.evolveum.midpoint.xml.ns._public.common.common_3.ResourceType; import com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowType; -import com.evolveum.midpoint.xml.ns._public.common.common_3.TaskStageType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.TaskPartitionDefinitionType; import com.evolveum.midpoint.xml.ns._public.common.common_3.TaskType; import com.evolveum.midpoint.xml.ns._public.common.common_3.WorkBucketType; import com.evolveum.prism.xml.ns._public.types_3.PolyStringType; @@ -164,14 +164,16 @@ public StatisticsCollectionStrategy getStatisticsCollectionStrategy() { .maintainSynchronizationStatistics() .maintainActionsExecutedStatistics(); } - + + @Override public TaskWorkBucketProcessingResult run(Task localCoordinatorTask, WorkBucketType workBucket, - TaskWorkBucketProcessingResult previousRunResult) { - -// counterManager.registerCounter(localCoordinatorTask, false); - + TaskPartitionDefinitionType partitionDefinition, TaskWorkBucketProcessingResult previousRunResult) { + String handlerUri = localCoordinatorTask.getHandlerUri(); + if (partitionDefinition != null && partitionDefinition.getHandlerUri() != null) { + handlerUri = partitionDefinition.getHandlerUri(); + } Stage stage = getStage(handlerUri); LOGGER.trace("ReconciliationTaskHandler.run starting (stage: {})", stage); ReconciliationTaskResult reconResult = new ReconciliationTaskResult(); @@ -199,28 +201,6 @@ public TaskWorkBucketProcessingResult run(Task localCoordinatorTask, WorkBucketT String resourceOid = localCoordinatorTask.getObjectOid(); opResult.addContext("resourceOid", resourceOid); - try { - - Collection> evaluatedAssignments = assignmentCollector.collect(localCoordinatorTask.getTaskPrismObject(), systemObjectCache.getSystemConfiguration(opResult), false, localCoordinatorTask, opResult); - Set evaluatedPolicyRules = new HashSet<>(); - - LOGGER.info("Evaluated assignments for task: {}", DebugUtil.debugDumpLazily(evaluatedAssignments)); - - for (EvaluatedAssignment evaluatedAssignment : evaluatedAssignments) { - LOGGER.info("Evaluated other policy rules for task: {}", DebugUtil.debugDumpLazily(evaluatedAssignment.getOtherTargetsPolicyRules())); - evaluatedPolicyRules.addAll(evaluatedAssignment.getOtherTargetsPolicyRules()); - - LOGGER.info("Evaluated focus policy rules for task: {}", DebugUtil.debugDumpLazily(evaluatedAssignment.getFocusPolicyRules())); - evaluatedPolicyRules.addAll(evaluatedAssignment.getFocusPolicyRules()); - - LOGGER.info("Evaluated this policy rules for task: {}", DebugUtil.debugDumpLazily(evaluatedAssignment.getThisTargetPolicyRules())); - evaluatedPolicyRules.addAll(evaluatedAssignment.getThisTargetPolicyRules()); - } - evaluatedPolicyRules.forEach(policyRule -> counterManager.registerCounter(localCoordinatorTask, policyRule.getPolicyRule())); - } catch (SchemaException e) { - throw new SystemException("Cannot collect task thresholds."); - } - if (localCoordinatorTask.getChannel() == null) { localCoordinatorTask.setChannel(SchemaConstants.CHANGE_CHANNEL_RECON_URI); } @@ -313,7 +293,7 @@ public TaskWorkBucketProcessingResult run(Task localCoordinatorTask, WorkBucketT long afterShadowReconTimestamp; try { if (isStage(stage, Stage.SECOND) && !performResourceReconciliation(resource, objectclassDef, reconResult, - localCoordinatorTask, workBucket, opResult)) { + localCoordinatorTask, partitionDefinition, workBucket, opResult)) { processInterruption(runResult, resource, localCoordinatorTask, opResult); return runResult; } @@ -518,39 +498,11 @@ private void processErrorPartial(TaskRunResult runResult, String errorDesc, Exce runResult.setRunResultStatus(runResultStatus); } - private boolean performResourceReconciliation(PrismObject resource, - ObjectClassComplexTypeDefinition objectclassDef, - ReconciliationTaskResult reconResult, Task localCoordinatorTask, - WorkBucketType workBucket, OperationResult result) - throws ObjectNotFoundException, SchemaException, CommunicationException, ConfigurationException, - SecurityViolationException, ExpressionEvaluationException { - - List stages = localCoordinatorTask.getTaskType().getStage(); - if (CollectionUtils.isEmpty(stages)) { - TaskStageType defaultStage = new TaskStageType(prismContext); - defaultStage.setStage(EXECUTE_URI); - return performResourceReconciliationInternal(resource, objectclassDef, defaultStage, - reconResult, localCoordinatorTask, workBucket, result); - } - - boolean canContinue = true; - for (TaskStageType stage : stages) { - canContinue = performResourceReconciliationInternal(resource, objectclassDef, stage, - reconResult, localCoordinatorTask, workBucket, result); - if (!canContinue) { - break; - } - } - - return canContinue; - - } - // returns false in case of execution interruption - private boolean performResourceReconciliationInternal(PrismObject resource, - ObjectClassComplexTypeDefinition objectclassDef, TaskStageType stage, + private boolean performResourceReconciliation(PrismObject resource, + ObjectClassComplexTypeDefinition objectclassDef, ReconciliationTaskResult reconResult, Task localCoordinatorTask, - WorkBucketType workBucket, OperationResult result) + TaskPartitionDefinitionType partitionDefinition, WorkBucketType workBucket, OperationResult result) throws ObjectNotFoundException, SchemaException, CommunicationException, ConfigurationException, SecurityViolationException, ExpressionEvaluationException { @@ -561,7 +513,7 @@ private boolean performResourceReconciliationInternal(PrismObject // Instantiate result handler. This will be called with every search // result in the following iterative search SynchronizeAccountResultHandler handler = new SynchronizeAccountResultHandler(resource.asObjectable(), - objectclassDef, "reconciliation", localCoordinatorTask, changeNotificationDispatcher, stage, taskManager); + objectclassDef, "reconciliation", localCoordinatorTask, changeNotificationDispatcher, partitionDefinition, taskManager); handler.setSourceChannel(SchemaConstants.CHANGE_CHANNEL_RECON); handler.setStopOnError(false); handler.setEnableSynchronizationStatistics(true); @@ -573,7 +525,7 @@ private boolean performResourceReconciliationInternal(PrismObject ObjectQuery query = objectclassDef.createShadowSearchQuery(resource.getOid()); query = narrowQueryForBucket(query, localCoordinatorTask, workBucket, objectclassDef, opResult); - + OperationResult searchResult = new OperationResult(OperationConstants.RECONCILIATION+".searchIterative"); handler.createWorkerThreads(localCoordinatorTask, searchResult); @@ -849,4 +801,5 @@ public void refreshStatus(Task task) { public String getCategoryName(Task task) { return TaskCategory.RECONCILIATION; } + } diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/sync/SynchronizeAccountResultHandler.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/sync/SynchronizeAccountResultHandler.java index 2bfc02eb46d..f924e64a5f1 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/sync/SynchronizeAccountResultHandler.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/sync/SynchronizeAccountResultHandler.java @@ -25,6 +25,7 @@ import com.evolveum.midpoint.provisioning.api.ResourceObjectChangeListener; import com.evolveum.midpoint.provisioning.api.ResourceObjectShadowChangeDescription; import com.evolveum.midpoint.repo.common.task.AbstractSearchIterativeResultHandler; +import com.evolveum.midpoint.repo.common.util.RepoCommonUtils; import com.evolveum.midpoint.schema.constants.SchemaConstants; import com.evolveum.midpoint.schema.processor.ObjectClassComplexTypeDefinition; import com.evolveum.midpoint.schema.result.OperationResult; @@ -34,10 +35,11 @@ import com.evolveum.midpoint.util.QNameUtil; import com.evolveum.midpoint.util.logging.Trace; import com.evolveum.midpoint.util.logging.TraceManager; +import com.evolveum.midpoint.xml.ns._public.common.common_3.ExecutionModeType; import com.evolveum.midpoint.xml.ns._public.common.common_3.ResourceType; import com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowKindType; import com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowType; -import com.evolveum.midpoint.xml.ns._public.common.common_3.TaskStageType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.TaskPartitionDefinitionType; /** * Iterative search result handler for account synchronization. Works both for @@ -67,7 +69,7 @@ public class SynchronizeAccountResultHandler extends AbstractSearchIterativeResu public SynchronizeAccountResultHandler(ResourceType resource, ObjectClassComplexTypeDefinition objectClassDef, String processShortName, Task coordinatorTask, ResourceObjectChangeListener objectChangeListener, - TaskStageType stageType, TaskManager taskManager) { + TaskPartitionDefinitionType stageType, TaskManager taskManager) { super(coordinatorTask, SynchronizeAccountResultHandler.class.getName(), processShortName, "from "+resource, stageType, taskManager); this.objectChangeListener = objectChangeListener; this.resourceReadOnly = resource; @@ -125,7 +127,7 @@ protected boolean handleObject(PrismObject accountShadow, Task worke boolean rv = handleObjectInternal(accountShadow, workerTask, result); result.computeStatusIfUnknown(); if (result.isError()) { - workerTask.recordIterativeOperationEnd(accountShadow.asObjectable(), started, getException(result)); + workerTask.recordIterativeOperationEnd(accountShadow.asObjectable(), started, RepoCommonUtils.getResultException(result)); } else { workerTask.recordIterativeOperationEnd(accountShadow.asObjectable(), started, null); } @@ -168,7 +170,7 @@ protected boolean handleObjectInternal(PrismObject accountShadow, Ta ResourceObjectShadowChangeDescription change = new ResourceObjectShadowChangeDescription(); change.setSourceChannel(QNameUtil.qNameToUri(sourceChannel)); change.setResource(getResourceWorkingCopy().asPrismObject()); - if (getStageType() != null && ReconciliationTaskHandler.SIMULATE_URI.equals(getStageType().getStage())) { + if (getStageType() != null && ExecutionModeType.SIMULATE == getStageType().getStage()) { change.setSimulate(true); } diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/trigger/TriggerScannerTaskHandler.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/trigger/TriggerScannerTaskHandler.java index 1d03f6496b5..38986a0a308 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/trigger/TriggerScannerTaskHandler.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/trigger/TriggerScannerTaskHandler.java @@ -36,6 +36,7 @@ import com.evolveum.midpoint.util.logging.Trace; import com.evolveum.midpoint.util.logging.TraceManager; import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.TaskPartitionDefinitionType; import com.evolveum.midpoint.xml.ns._public.common.common_3.TriggerType; import org.apache.commons.lang3.Validate; import org.springframework.beans.factory.annotation.Autowired; @@ -132,7 +133,7 @@ protected void finish(AbstractScannerResultHandler handler, TaskRunR } @Override - protected AbstractScannerResultHandler createHandler(TaskRunResult runResult, final Task coordinatorTask, + protected AbstractScannerResultHandler createHandler(TaskPartitionDefinitionType partition, TaskRunResult runResult, final Task coordinatorTask, OperationResult opResult) { AbstractScannerResultHandler handler = new AbstractScannerResultHandler( diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/util/AuditReindexTaskHandler.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/util/AuditReindexTaskHandler.java index 94843da4ab1..1928fe47cd8 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/util/AuditReindexTaskHandler.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/util/AuditReindexTaskHandler.java @@ -14,6 +14,8 @@ import com.evolveum.midpoint.util.exception.SchemaException; import com.evolveum.midpoint.util.logging.Trace; import com.evolveum.midpoint.util.logging.TraceManager; +import com.evolveum.midpoint.xml.ns._public.common.common_3.TaskPartitionDefinitionType; + import org.apache.commons.collections.CollectionUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @@ -48,7 +50,7 @@ private void initialize() { } @Override - public TaskRunResult run(Task coordinatorTask) { + public TaskRunResult run(Task coordinatorTask, TaskPartitionDefinitionType partition) { OperationResult opResult = new OperationResult(OperationConstants.AUDIT_REINDEX + ".run"); opResult.setStatus(OperationResultStatus.IN_PROGRESS); TaskRunResult runResult = new TaskRunResult(); diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/util/DeleteTaskHandler.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/util/DeleteTaskHandler.java index 7a32ea12e69..58f1960ad6a 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/util/DeleteTaskHandler.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/util/DeleteTaskHandler.java @@ -59,6 +59,7 @@ import com.evolveum.midpoint.util.logging.TraceManager; import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType; import com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.TaskPartitionDefinitionType; import static org.apache.commons.lang3.BooleanUtils.isTrue; @@ -92,7 +93,7 @@ public StatisticsCollectionStrategy getStatisticsCollectionStrategy() { } @Override - public TaskRunResult run(Task task) { + public TaskRunResult run(Task task, TaskPartitionDefinitionType partition) { return runInternal(task); } diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/util/ModelImplUtils.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/util/ModelImplUtils.java index 99c103de200..dbb86fd899e 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/util/ModelImplUtils.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/util/ModelImplUtils.java @@ -600,26 +600,26 @@ public static boolean isDryRun(Task task) throws SchemaException { return dryRun != null ? dryRun : Boolean.FALSE; } - public static boolean canPerformStage(String stageUri, Task task) throws SchemaException { - PrismObject taskType = task.getTaskPrismObject(); - PrismProperty stageType = taskType.findProperty(ItemPath.create(TaskType.F_STAGE, TaskStageType.F_STAGE)); - if (stageType == null) { - return false; - } - - String stageTypeRealValue = stageType.getRealValue(); - return stageUri.equals(stageTypeRealValue); - } - - public static String getStageUri(Task task) { - PrismObject taskType = task.getTaskPrismObject(); - PrismProperty stageType = taskType.findProperty(ItemPath.create(TaskType.F_STAGE, TaskStageType.F_STAGE)); - if (stageType == null) { - return ModelPublicConstants.RECONCILIATION_TASK_HANDLER_URI + "#execute"; - } - - return stageType.getRealValue(); - } +// public static boolean canPerformStage(String stageUri, Task task) throws SchemaException { +// PrismObject taskType = task.getTaskPrismObject(); +// PrismProperty stageType = taskType.findProperty(ItemPath.create(TaskType.F_STAGE, TaskStageType.F_STAGE)); +// if (stageType == null) { +// return false; +// } +// +// String stageTypeRealValue = stageType.getRealValue(); +// return stageUri.equals(stageTypeRealValue); +// } + +// public static String getStageUri(Task task) { +// PrismObject taskType = task.getTaskPrismObject(); +// PrismProperty stageType = taskType.findProperty(ItemPath.create(TaskType.F_STAGE, TaskStageType.F_STAGE)); +// if (stageType == null) { +// return ModelPublicConstants.RECONCILIATION_TASK_HANDLER_URI + "#execute"; +// } +// +// return stageType.getRealValue(); +// } static Boolean findItemValue(Task task, QName path) throws SchemaException{ Validate.notNull(task, "Task must not be null."); diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/util/ReindexTaskHandler.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/util/ReindexTaskHandler.java index 2e6ef943616..1a3a35c5d17 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/util/ReindexTaskHandler.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/util/ReindexTaskHandler.java @@ -33,6 +33,8 @@ import com.evolveum.midpoint.util.logging.Trace; import com.evolveum.midpoint.util.logging.TraceManager; import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.TaskPartitionDefinitionType; + import org.springframework.stereotype.Component; import javax.annotation.PostConstruct; @@ -69,7 +71,7 @@ private void initialize() { } @Override - protected ReindexResultHandler createHandler(TaskRunResult runResult, Task coordinatorTask, OperationResult opResult) + protected ReindexResultHandler createHandler(TaskPartitionDefinitionType partition, TaskRunResult runResult, Task coordinatorTask, OperationResult opResult) throws SchemaException, SecurityViolationException, ObjectNotFoundException, ExpressionEvaluationException, CommunicationException, ConfigurationException { securityEnforcer.authorize(AuthorizationConstants.AUTZ_ALL_URL, null, AuthorizationParameters.EMPTY, null, coordinatorTask, opResult); return new ReindexResultHandler(coordinatorTask, ReindexTaskHandler.class.getName(), diff --git a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/util/MockTaskHandler.java b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/util/MockTaskHandler.java index 92606a25489..890a5831820 100644 --- a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/util/MockTaskHandler.java +++ b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/util/MockTaskHandler.java @@ -34,6 +34,7 @@ import com.evolveum.midpoint.task.api.TaskRunResult.TaskRunResultStatus; import com.evolveum.midpoint.util.logging.Trace; import com.evolveum.midpoint.util.logging.TraceManager; +import com.evolveum.midpoint.xml.ns._public.common.common_3.TaskPartitionDefinitionType; /** * This task handler does nothing. Used in the tests. @@ -56,7 +57,7 @@ private void initialize() { } @Override - public TaskRunResult run(Task task) { + public TaskRunResult run(Task task, TaskPartitionDefinitionType partition) { LOGGER.trace("MockTaskHandler.run starting"); OperationResult opResult = new OperationResult(OperationConstants.RECONCILIATION); diff --git a/model/model-test/src/main/java/com/evolveum/midpoint/model/test/AbstractModelIntegrationTest.java b/model/model-test/src/main/java/com/evolveum/midpoint/model/test/AbstractModelIntegrationTest.java index bcaa6ecbd66..5c1a71907cd 100644 --- a/model/model-test/src/main/java/com/evolveum/midpoint/model/test/AbstractModelIntegrationTest.java +++ b/model/model-test/src/main/java/com/evolveum/midpoint/model/test/AbstractModelIntegrationTest.java @@ -3323,6 +3323,69 @@ private OperationResult getSubresult(OperationResult result, boolean checkSubres } return result; } + + protected OperationResult waitForTaskResume(final String taskOid, final boolean checkSubresult, final int timeout) throws Exception { + final OperationResult waitResult = new OperationResult(AbstractIntegrationTest.class+".waitForTaskResume"); + Task origTask = taskManager.getTaskWithResult(taskOid, waitResult); + + final Long origLastRunStartTimestamp = origTask.getLastRunStartTimestamp(); + final Long origLastRunFinishTimestamp = origTask.getLastRunFinishTimestamp(); + + taskManager.resumeTask(origTask, waitResult); + + final Holder taskResultHolder = new Holder<>(); + Checker checker = new Checker() { + @Override + public boolean check() throws CommonException { + Task freshTask = taskManager.getTaskWithResult(origTask.getOid(), waitResult); + OperationResult taskResult = freshTask.getResult(); +// display("Times", longTimeToString(origLastRunStartTimestamp) + "-" + longTimeToString(origLastRunStartTimestamp) +// + " : " + longTimeToString(freshTask.getLastRunStartTimestamp()) + "-" + longTimeToString(freshTask.getLastRunFinishTimestamp())); + if (verbose) display("Check result", taskResult); + taskResultHolder.setValue(taskResult); + if (isError(taskResult, checkSubresult)) { + return true; + } + if (isUnknown(taskResult, checkSubresult)) { + return false; + } + if (freshTask.getLastRunFinishTimestamp() == null) { + return false; + } + if (freshTask.getLastRunStartTimestamp() == null) { + return false; + } + return !freshTask.getLastRunStartTimestamp().equals(origLastRunStartTimestamp) + && !freshTask.getLastRunFinishTimestamp().equals(origLastRunFinishTimestamp) + && freshTask.getLastRunStartTimestamp() < freshTask.getLastRunFinishTimestamp(); + } + @Override + public void timeout() { + try { + Task freshTask = taskManager.getTaskWithResult(origTask.getOid(), waitResult); + OperationResult result = freshTask.getResult(); + LOGGER.debug("Timed-out task:\n{}", freshTask.debugDump()); + display("Times", "origLastRunStartTimestamp="+longTimeToString(origLastRunStartTimestamp) + + ", origLastRunFinishTimestamp=" + longTimeToString(origLastRunFinishTimestamp) + + ", freshTask.getLastRunStartTimestamp()=" + longTimeToString(freshTask.getLastRunStartTimestamp()) + + ", freshTask.getLastRunFinishTimestamp()=" + longTimeToString(freshTask.getLastRunFinishTimestamp())); + assert false : "Timeout ("+timeout+") while waiting for "+freshTask+" next run. Last result "+result; + } catch (ObjectNotFoundException | SchemaException e) { + LOGGER.error("Exception during task refresh: {}", e, e); + } + } + }; + IntegrationTestTools.waitFor("Waiting for task " + origTask + " resume", checker, timeout, DEFAULT_TASK_SLEEP_TIME); + + Task freshTask = taskManager.getTaskWithResult(origTask.getOid(), waitResult); + LOGGER.debug("Final task:\n{}", freshTask.debugDump()); + display("Times", "origLastRunStartTimestamp="+longTimeToString(origLastRunStartTimestamp) + + ", origLastRunFinishTimestamp=" + longTimeToString(origLastRunFinishTimestamp) + + ", freshTask.getLastRunStartTimestamp()=" + longTimeToString(freshTask.getLastRunStartTimestamp()) + + ", freshTask.getLastRunFinishTimestamp()=" + longTimeToString(freshTask.getLastRunFinishTimestamp())); + + return taskResultHolder.getValue(); + } protected void restartTask(String taskOid) throws CommonException { diff --git a/model/report-impl/src/main/java/com/evolveum/midpoint/report/impl/ReportCreateTaskHandler.java b/model/report-impl/src/main/java/com/evolveum/midpoint/report/impl/ReportCreateTaskHandler.java index 66002b35be6..d87193c078e 100644 --- a/model/report-impl/src/main/java/com/evolveum/midpoint/report/impl/ReportCreateTaskHandler.java +++ b/model/report-impl/src/main/java/com/evolveum/midpoint/report/impl/ReportCreateTaskHandler.java @@ -102,6 +102,7 @@ import com.evolveum.midpoint.xml.ns._public.common.common_3.ReportParameterType; import com.evolveum.midpoint.xml.ns._public.common.common_3.ReportType; import com.evolveum.midpoint.xml.ns._public.common.common_3.SubreportType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.TaskPartitionDefinitionType; import com.evolveum.prism.xml.ns._public.types_3.PolyStringType; import net.sf.jasperreports.engine.JRParameter; import net.sf.jasperreports.engine.fill.JRAbstractLRUVirtualizer; @@ -144,7 +145,7 @@ private void initialize() { } @Override - public TaskRunResult run(Task task) { + public TaskRunResult run(Task task, TaskPartitionDefinitionType partition) { // TODO Auto-generated method stub OperationResult parentResult = task.getResult(); OperationResult result = parentResult.createSubresult(ReportCreateTaskHandler.class.getSimpleName() + ".run"); diff --git a/model/workflow-impl/src/main/java/com/evolveum/midpoint/wf/impl/processors/primary/WfPrepareChildOperationTaskHandler.java b/model/workflow-impl/src/main/java/com/evolveum/midpoint/wf/impl/processors/primary/WfPrepareChildOperationTaskHandler.java index b33f84d9a8c..f8c591ca39d 100644 --- a/model/workflow-impl/src/main/java/com/evolveum/midpoint/wf/impl/processors/primary/WfPrepareChildOperationTaskHandler.java +++ b/model/workflow-impl/src/main/java/com/evolveum/midpoint/wf/impl/processors/primary/WfPrepareChildOperationTaskHandler.java @@ -35,6 +35,8 @@ import com.evolveum.midpoint.wf.impl.tasks.WfTaskUtil; import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType; import com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.TaskPartitionDefinitionType; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @@ -73,7 +75,7 @@ public void init() { //region Body @SuppressWarnings("unchecked") @Override - public TaskRunResult run(Task task) { + public TaskRunResult run(Task task, TaskPartitionDefinitionType partition) { TaskRunResult.TaskRunResultStatus status = TaskRunResult.TaskRunResultStatus.FINISHED; diff --git a/model/workflow-impl/src/main/java/com/evolveum/midpoint/wf/impl/processors/primary/WfPrepareRootOperationTaskHandler.java b/model/workflow-impl/src/main/java/com/evolveum/midpoint/wf/impl/processors/primary/WfPrepareRootOperationTaskHandler.java index d84487dc516..f51b11fc5af 100644 --- a/model/workflow-impl/src/main/java/com/evolveum/midpoint/wf/impl/processors/primary/WfPrepareRootOperationTaskHandler.java +++ b/model/workflow-impl/src/main/java/com/evolveum/midpoint/wf/impl/processors/primary/WfPrepareRootOperationTaskHandler.java @@ -34,6 +34,8 @@ import com.evolveum.midpoint.wf.impl.tasks.WfTaskUtil; import com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.TaskPartitionDefinitionType; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @@ -70,7 +72,7 @@ public void init() { //region run method @Override - public TaskRunResult run(Task task) { + public TaskRunResult run(Task task, TaskPartitionDefinitionType partition) { TaskRunResultStatus status = TaskRunResultStatus.FINISHED; diff --git a/model/workflow-impl/src/main/java/com/evolveum/midpoint/wf/impl/processors/primary/WfPropagateTaskObjectReferenceTaskHandler.java b/model/workflow-impl/src/main/java/com/evolveum/midpoint/wf/impl/processors/primary/WfPropagateTaskObjectReferenceTaskHandler.java index fd5ff64f8aa..fd57e52b769 100644 --- a/model/workflow-impl/src/main/java/com/evolveum/midpoint/wf/impl/processors/primary/WfPropagateTaskObjectReferenceTaskHandler.java +++ b/model/workflow-impl/src/main/java/com/evolveum/midpoint/wf/impl/processors/primary/WfPropagateTaskObjectReferenceTaskHandler.java @@ -33,6 +33,7 @@ import com.evolveum.midpoint.wf.impl.tasks.WfTaskController; import com.evolveum.midpoint.wf.impl.tasks.WfTaskUtil; import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectReferenceType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.TaskPartitionDefinitionType; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @@ -76,7 +77,7 @@ public void init() { //region Body @Override - public TaskRunResult run(Task task) { + public TaskRunResult run(Task task, TaskPartitionDefinitionType partition) { TaskRunResult.TaskRunResultStatus status = TaskRunResult.TaskRunResultStatus.FINISHED; diff --git a/model/workflow-impl/src/main/java/com/evolveum/midpoint/wf/impl/tasks/WfProcessInstanceShadowTaskHandler.java b/model/workflow-impl/src/main/java/com/evolveum/midpoint/wf/impl/tasks/WfProcessInstanceShadowTaskHandler.java index 99669ce7010..d4bd9332e0d 100644 --- a/model/workflow-impl/src/main/java/com/evolveum/midpoint/wf/impl/tasks/WfProcessInstanceShadowTaskHandler.java +++ b/model/workflow-impl/src/main/java/com/evolveum/midpoint/wf/impl/tasks/WfProcessInstanceShadowTaskHandler.java @@ -28,6 +28,8 @@ import com.evolveum.midpoint.wf.impl.WfConfiguration; import com.evolveum.midpoint.wf.impl.activiti.ActivitiInterface; import com.evolveum.midpoint.wf.impl.messages.QueryProcessCommand; +import com.evolveum.midpoint.xml.ns._public.common.common_3.TaskPartitionDefinitionType; + import org.apache.commons.lang.Validate; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.DependsOn; @@ -87,7 +89,7 @@ public void init() { * */ @Override - public TaskRunResult run(Task task) { + public TaskRunResult run(Task task, TaskPartitionDefinitionType partition) { OperationResult taskResult = WfTaskUtil.getResult(task); diff --git a/provisioning/provisioning-api/pom.xml b/provisioning/provisioning-api/pom.xml index c118c9802b1..eb2362afba5 100644 --- a/provisioning/provisioning-api/pom.xml +++ b/provisioning/provisioning-api/pom.xml @@ -43,6 +43,11 @@ prism-api 4.0-SNAPSHOT + + com.evolveum.midpoint.repo + repo-api + 4.0-SNAPSHOT + diff --git a/provisioning/provisioning-api/src/main/java/com/evolveum/midpoint/provisioning/api/ProvisioningService.java b/provisioning/provisioning-api/src/main/java/com/evolveum/midpoint/provisioning/api/ProvisioningService.java index e24129d4c38..c537de0d20b 100644 --- a/provisioning/provisioning-api/src/main/java/com/evolveum/midpoint/provisioning/api/ProvisioningService.java +++ b/provisioning/provisioning-api/src/main/java/com/evolveum/midpoint/provisioning/api/ProvisioningService.java @@ -30,6 +30,7 @@ import com.evolveum.midpoint.prism.path.ItemPath; import com.evolveum.midpoint.prism.query.ObjectPaging; import com.evolveum.midpoint.prism.query.ObjectQuery; +import com.evolveum.midpoint.repo.api.PreconditionViolationException; import com.evolveum.midpoint.schema.GetOperationOptions; import com.evolveum.midpoint.schema.ProvisioningDiag; import com.evolveum.midpoint.schema.ResourceShadowDiscriminator; @@ -56,6 +57,7 @@ import com.evolveum.midpoint.xml.ns._public.common.common_3.ProvisioningScriptType; import com.evolveum.midpoint.xml.ns._public.common.common_3.ResourceType; import com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.TaskPartitionDefinitionType; /** *

Provisioning Service Interface.

@@ -197,8 +199,8 @@ String addObject(PrismObject object, OperationProvisio * @throws GenericConnectorException * unknown connector framework error */ - int synchronize(ResourceShadowDiscriminator shadowCoordinates, Task task, OperationResult parentResult) throws ObjectNotFoundException, - CommunicationException, SchemaException, ConfigurationException, SecurityViolationException, ExpressionEvaluationException; + int synchronize(ResourceShadowDiscriminator shadowCoordinates, Task task, TaskPartitionDefinitionType taskPartition, OperationResult parentResult) throws ObjectNotFoundException, + CommunicationException, SchemaException, ConfigurationException, SecurityViolationException, ExpressionEvaluationException, PolicyViolationException, PreconditionViolationException; /** diff --git a/provisioning/provisioning-api/src/main/java/com/evolveum/midpoint/provisioning/api/ResourceEventListener.java b/provisioning/provisioning-api/src/main/java/com/evolveum/midpoint/provisioning/api/ResourceEventListener.java index 73b19fd2ea2..fc415ace0d9 100644 --- a/provisioning/provisioning-api/src/main/java/com/evolveum/midpoint/provisioning/api/ResourceEventListener.java +++ b/provisioning/provisioning-api/src/main/java/com/evolveum/midpoint/provisioning/api/ResourceEventListener.java @@ -15,6 +15,7 @@ */ package com.evolveum.midpoint.provisioning.api; +import com.evolveum.midpoint.repo.api.PreconditionViolationException; import com.evolveum.midpoint.schema.result.OperationResult; import com.evolveum.midpoint.task.api.Task; import com.evolveum.midpoint.util.exception.CommunicationException; @@ -22,11 +23,13 @@ import com.evolveum.midpoint.util.exception.ExpressionEvaluationException; import com.evolveum.midpoint.util.exception.ObjectAlreadyExistsException; import com.evolveum.midpoint.util.exception.ObjectNotFoundException; +import com.evolveum.midpoint.util.exception.PolicyViolationException; import com.evolveum.midpoint.util.exception.SchemaException; import com.evolveum.midpoint.util.exception.SecurityViolationException; public interface ResourceEventListener extends ProvisioningListener { - public void notifyEvent(ResourceEventDescription eventDescription, Task task, OperationResult parentResult) throws SchemaException, CommunicationException, ConfigurationException, SecurityViolationException, ObjectNotFoundException, GenericConnectorException, ObjectAlreadyExistsException, ExpressionEvaluationException; - + public void notifyEvent(ResourceEventDescription eventDescription, Task task, OperationResult parentResult) throws SchemaException, CommunicationException, ConfigurationException, + SecurityViolationException, ObjectNotFoundException, GenericConnectorException, ObjectAlreadyExistsException, + ExpressionEvaluationException, PolicyViolationException, PreconditionViolationException; } diff --git a/provisioning/provisioning-impl/src/main/java/com/evolveum/midpoint/provisioning/impl/ChangeNotificationDispatcherImpl.java b/provisioning/provisioning-impl/src/main/java/com/evolveum/midpoint/provisioning/impl/ChangeNotificationDispatcherImpl.java index 09286f75933..6055ef698ee 100644 --- a/provisioning/provisioning-impl/src/main/java/com/evolveum/midpoint/provisioning/impl/ChangeNotificationDispatcherImpl.java +++ b/provisioning/provisioning-impl/src/main/java/com/evolveum/midpoint/provisioning/impl/ChangeNotificationDispatcherImpl.java @@ -29,6 +29,7 @@ import com.evolveum.midpoint.provisioning.api.ResourceObjectShadowChangeDescription; import com.evolveum.midpoint.provisioning.api.ResourceOperationDescription; import com.evolveum.midpoint.provisioning.api.ResourceOperationListener; +import com.evolveum.midpoint.repo.api.PreconditionViolationException; import com.evolveum.midpoint.schema.internals.InternalsConfig; import com.evolveum.midpoint.schema.result.OperationResult; import com.evolveum.midpoint.task.api.Task; @@ -37,6 +38,7 @@ import com.evolveum.midpoint.util.exception.ExpressionEvaluationException; import com.evolveum.midpoint.util.exception.ObjectAlreadyExistsException; import com.evolveum.midpoint.util.exception.ObjectNotFoundException; +import com.evolveum.midpoint.util.exception.PolicyViolationException; import com.evolveum.midpoint.util.exception.SchemaException; import com.evolveum.midpoint.util.exception.SecurityViolationException; import com.evolveum.midpoint.util.logging.Trace; @@ -269,7 +271,7 @@ public void notifyEvent(ResourceEventDescription eventDescription, Task task, OperationResult parentResult) throws SchemaException, CommunicationException, ConfigurationException, SecurityViolationException, ObjectNotFoundException, - GenericConnectorException, ObjectAlreadyExistsException, ExpressionEvaluationException { + GenericConnectorException, ObjectAlreadyExistsException, ExpressionEvaluationException, PolicyViolationException, PreconditionViolationException { Validate.notNull(eventDescription, "Event description must not be null."); if (LOGGER.isTraceEnabled()) { diff --git a/provisioning/provisioning-impl/src/main/java/com/evolveum/midpoint/provisioning/impl/ProvisioningServiceImpl.java b/provisioning/provisioning-impl/src/main/java/com/evolveum/midpoint/provisioning/impl/ProvisioningServiceImpl.java index 1a10800952c..b2b4365d027 100644 --- a/provisioning/provisioning-impl/src/main/java/com/evolveum/midpoint/provisioning/impl/ProvisioningServiceImpl.java +++ b/provisioning/provisioning-impl/src/main/java/com/evolveum/midpoint/provisioning/impl/ProvisioningServiceImpl.java @@ -53,6 +53,7 @@ import com.evolveum.midpoint.provisioning.api.ProvisioningService; import com.evolveum.midpoint.provisioning.ucf.api.GenericFrameworkException; import com.evolveum.midpoint.provisioning.util.ProvisioningUtil; +import com.evolveum.midpoint.repo.api.PreconditionViolationException; import com.evolveum.midpoint.repo.api.RepoAddOptions; import com.evolveum.midpoint.repo.api.RepositoryService; import com.evolveum.midpoint.schema.GetOperationOptions; @@ -92,6 +93,7 @@ import com.evolveum.midpoint.xml.ns._public.common.common_3.ProvisioningScriptType; import com.evolveum.midpoint.xml.ns._public.common.common_3.ResourceType; import com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.TaskPartitionDefinitionType; /** * Implementation of provisioning service. @@ -330,8 +332,8 @@ public String addObject(PrismObject object, OperationP @SuppressWarnings("rawtypes") @Override - public int synchronize(ResourceShadowDiscriminator shadowCoordinates, Task task, OperationResult parentResult) throws ObjectNotFoundException, - CommunicationException, SchemaException, ConfigurationException, SecurityViolationException, ExpressionEvaluationException { + public int synchronize(ResourceShadowDiscriminator shadowCoordinates, Task task, TaskPartitionDefinitionType taskPartition, OperationResult parentResult) throws ObjectNotFoundException, + CommunicationException, SchemaException, ConfigurationException, SecurityViolationException, ExpressionEvaluationException, PolicyViolationException, PreconditionViolationException { Validate.notNull(shadowCoordinates, "Coordinates oid must not be null."); String resourceOid = shadowCoordinates.getResourceOid(); @@ -349,7 +351,7 @@ public int synchronize(ResourceShadowDiscriminator shadowCoordinates, Task task, // Resolve resource PrismObject resource = getObject(ResourceType.class, resourceOid, null, task, result); ResourceType resourceType = resource.asObjectable(); - + LOGGER.trace("Start synchronization of resource {} ", resourceType); // getting token form task @@ -359,20 +361,23 @@ public int synchronize(ResourceShadowDiscriminator shadowCoordinates, Task task, SchemaDebugUtil.prettyPrint(tokenProperty)); } - processedChanges = shadowCache.synchronize(shadowCoordinates, tokenProperty, task, result); + processedChanges = shadowCache.synchronize(shadowCoordinates, tokenProperty, task, taskPartition, result); LOGGER.debug("Synchronization of {} done, token {}, {} changes", resource, tokenProperty, processedChanges); } catch (ObjectNotFoundException | CommunicationException | SchemaException | SecurityViolationException | ConfigurationException | ExpressionEvaluationException | RuntimeException | Error e) { ProvisioningUtil.recordFatalError(LOGGER, result, null, e); + result.summarize(true); throw e; } catch (ObjectAlreadyExistsException | EncryptionException e) { ProvisioningUtil.recordFatalError(LOGGER, result, null, e); + result.summarize(true); throw new SystemException(e); } catch (GenericFrameworkException e) { ProvisioningUtil.recordFatalError(LOGGER, result, "Synchronization error: generic connector framework error: " + e.getMessage(), e); + result.summarize(true); throw new GenericConnectorException(e.getMessage(), e); - } + } result.recordSuccess(); result.cleanupResult(); diff --git a/provisioning/provisioning-impl/src/main/java/com/evolveum/midpoint/provisioning/impl/ResourceEventListenerImpl.java b/provisioning/provisioning-impl/src/main/java/com/evolveum/midpoint/provisioning/impl/ResourceEventListenerImpl.java index d957dc6b8fa..f6152560d1a 100644 --- a/provisioning/provisioning-impl/src/main/java/com/evolveum/midpoint/provisioning/impl/ResourceEventListenerImpl.java +++ b/provisioning/provisioning-impl/src/main/java/com/evolveum/midpoint/provisioning/impl/ResourceEventListenerImpl.java @@ -33,6 +33,7 @@ import com.evolveum.midpoint.provisioning.api.ResourceEventDescription; import com.evolveum.midpoint.provisioning.api.ResourceEventListener; import com.evolveum.midpoint.provisioning.ucf.api.Change; +import com.evolveum.midpoint.repo.api.PreconditionViolationException; import com.evolveum.midpoint.schema.processor.ObjectClassComplexTypeDefinition; import com.evolveum.midpoint.schema.processor.ResourceAttribute; import com.evolveum.midpoint.schema.result.OperationResult; @@ -43,6 +44,7 @@ import com.evolveum.midpoint.util.exception.ExpressionEvaluationException; import com.evolveum.midpoint.util.exception.ObjectAlreadyExistsException; import com.evolveum.midpoint.util.exception.ObjectNotFoundException; +import com.evolveum.midpoint.util.exception.PolicyViolationException; import com.evolveum.midpoint.util.exception.SchemaException; import com.evolveum.midpoint.util.exception.SecurityViolationException; import com.evolveum.midpoint.util.exception.SystemException; @@ -77,7 +79,9 @@ public String getName() { } @Override - public void notifyEvent(ResourceEventDescription eventDescription, Task task, OperationResult parentResult) throws SchemaException, CommunicationException, ConfigurationException, SecurityViolationException, ObjectNotFoundException, GenericConnectorException, ObjectAlreadyExistsException, ExpressionEvaluationException { + public void notifyEvent(ResourceEventDescription eventDescription, Task task, OperationResult parentResult) throws SchemaException, CommunicationException, ConfigurationException, + SecurityViolationException, ObjectNotFoundException, GenericConnectorException, ObjectAlreadyExistsException, + ExpressionEvaluationException, PolicyViolationException, PreconditionViolationException { Validate.notNull(eventDescription, "Event description must not be null."); Validate.notNull(task, "Task must not be null."); @@ -113,7 +117,7 @@ public void notifyEvent(ResourceEventDescription eventDescription, Task task, Op } LOGGER.trace("Change after processing {} . Start synchronizing.", change.toString()); - shadowCache.processSynchronization(ctx, change, parentResult); + shadowCache.processSynchronization(ctx, false, change, task, null, parentResult); } diff --git a/provisioning/provisioning-impl/src/main/java/com/evolveum/midpoint/provisioning/impl/ShadowCache.java b/provisioning/provisioning-impl/src/main/java/com/evolveum/midpoint/provisioning/impl/ShadowCache.java index a6f390dee95..8491890b51d 100644 --- a/provisioning/provisioning-impl/src/main/java/com/evolveum/midpoint/provisioning/impl/ShadowCache.java +++ b/provisioning/provisioning-impl/src/main/java/com/evolveum/midpoint/provisioning/impl/ShadowCache.java @@ -36,7 +36,9 @@ import com.evolveum.midpoint.provisioning.ucf.api.ConnectorOperationOptions; import com.evolveum.midpoint.provisioning.ucf.api.GenericFrameworkException; import com.evolveum.midpoint.provisioning.util.ProvisioningUtil; +import com.evolveum.midpoint.repo.api.PreconditionViolationException; import com.evolveum.midpoint.repo.api.RepositoryService; +import com.evolveum.midpoint.repo.common.util.RepoCommonUtils; import com.evolveum.midpoint.schema.*; import com.evolveum.midpoint.schema.constants.SchemaConstants; import com.evolveum.midpoint.schema.internals.InternalCounters; @@ -48,6 +50,7 @@ import com.evolveum.midpoint.schema.result.AsynchronousOperationReturnValue; import com.evolveum.midpoint.schema.result.OperationResult; import com.evolveum.midpoint.schema.result.OperationResultStatus; +import com.evolveum.midpoint.schema.util.ExceptionUtil; import com.evolveum.midpoint.schema.util.ObjectQueryUtil; import com.evolveum.midpoint.schema.util.ObjectTypeUtil; import com.evolveum.midpoint.schema.util.ResourceTypeUtil; @@ -2329,13 +2332,17 @@ public boolean handle(PrismObject shadow, OperationResult objResult) /////////////////////////////////////////////////////////////////////////// public int synchronize(ResourceShadowDiscriminator shadowCoordinates, PrismProperty lastToken, - Task task, OperationResult parentResult) throws ObjectNotFoundException, CommunicationException, + Task task, TaskPartitionDefinitionType partition, OperationResult parentResult) throws ObjectNotFoundException, CommunicationException, GenericFrameworkException, SchemaException, ConfigurationException, - SecurityViolationException, ObjectAlreadyExistsException, ExpressionEvaluationException, EncryptionException { + SecurityViolationException, ObjectAlreadyExistsException, ExpressionEvaluationException, EncryptionException, PolicyViolationException, PreconditionViolationException { InternalMonitor.recordCount(InternalCounters.PROVISIONING_ALL_EXT_OPERATION_COUNT); final ProvisioningContext ctx = ctxFactory.create(shadowCoordinates, task, parentResult); + boolean isSimulate = false; + if (partition != null && ExecutionModeType.SIMULATE == partition.getStage()) { + isSimulate = true; + } List changes; try { @@ -2350,7 +2357,9 @@ public int synchronize(ResourceShadowDiscriminator shadowCoordinates, PrismPrope if (change.isTokenOnly()) { LOGGER.trace("Found token-only change: {}", change); - task.setExtensionProperty(change.getToken()); + if (!isSimulate) { + task.setExtensionProperty(change.getToken()); + } continue; } @@ -2396,20 +2405,23 @@ public int synchronize(ResourceShadowDiscriminator shadowCoordinates, PrismPrope "Skipping processing change. Can't find appropriate shadow (e.g. the object was deleted on the resource meantime)."); continue; } - boolean isSuccess = processSynchronization(shadowCtx, change, parentResult); - - boolean retryUnhandledError = true; - if (task.getExtension() != null) { - PrismProperty tokenRetryUnhandledErrProperty = task.getExtensionProperty(SchemaConstants.SYNC_TOKEN_RETRY_UNHANDLED); - - if (tokenRetryUnhandledErrProperty != null) { - retryUnhandledError = (boolean) tokenRetryUnhandledErrProperty.getRealValue(); - } - } - - if (!retryUnhandledError || isSuccess) { - // get updated token from change, create property modification from new token and replace old token with the new one - task.setExtensionProperty(change.getToken()); + boolean isSuccess = processSynchronization(shadowCtx, isSimulate, change, task, partition, parentResult); + + boolean retryUnhandledError = true; + if (task.getExtension() != null) { + PrismProperty tokenRetryUnhandledErrProperty = task + .getExtensionProperty(SchemaConstants.SYNC_TOKEN_RETRY_UNHANDLED); + + if (tokenRetryUnhandledErrProperty != null) { + retryUnhandledError = (boolean) tokenRetryUnhandledErrProperty.getRealValue(); + } + } + + if (!retryUnhandledError || isSuccess) { + if (!isSimulate) { + // get updated token from change, create property modification from new token and replace old token with the new one + task.setExtensionProperty(change.getToken()); + } processedChanges++; task.incrementProgressAndStoreStatsIfNeeded(); } @@ -2431,9 +2443,9 @@ public int synchronize(ResourceShadowDiscriminator shadowCoordinates, PrismPrope } @SuppressWarnings("rawtypes") - boolean processSynchronization(ProvisioningContext ctx, Change change, OperationResult parentResult) + boolean processSynchronization(ProvisioningContext ctx, boolean isSimulate, Change change, Task task, TaskPartitionDefinitionType partition, OperationResult parentResult) throws SchemaException, ObjectNotFoundException, ObjectAlreadyExistsException, - CommunicationException, ConfigurationException, ExpressionEvaluationException { + CommunicationException, ConfigurationException, ExpressionEvaluationException, SecurityViolationException, PolicyViolationException, PreconditionViolationException { OperationResult result = parentResult.createSubresult(OP_PROCESS_SYNCHRONIZATION); @@ -2441,18 +2453,19 @@ boolean processSynchronization(ProvisioningContext ctx, Change change, Operation try { ResourceObjectShadowChangeDescription shadowChangeDescription = createResourceShadowChangeDescription( change, ctx.getResource(), ctx.getChannel()); + shadowChangeDescription.setSimulate(isSimulate); if (LOGGER.isTraceEnabled()) { LOGGER.trace("Created resource object shadow change description {}", SchemaDebugUtil.prettyPrint(shadowChangeDescription)); } - OperationResult notifyChangeResult = new OperationResult( - ShadowCache.class.getName() + "notifyChange"); + OperationResult notifyChangeResult = result.createMinorSubresult( + ShadowCache.class.getName() + ".notifyChange"); notifyChangeResult.addParam("resourceObjectShadowChangeDescription", shadowChangeDescription.toString()); try { notifyResourceObjectChangeListeners(shadowChangeDescription, ctx.getTask(), notifyChangeResult); - notifyChangeResult.recordSuccess(); + notifyChangeResult.computeStatusIfUnknown(); } catch (RuntimeException ex) { // recordFatalError(LOGGER, notifyChangeResult, "Synchronization // error: " + ex.getMessage(), ex); @@ -2482,15 +2495,29 @@ boolean processSynchronization(ProvisioningContext ctx, Change change, Operation result.computeStatus(); } + validateResult(notifyChangeResult, task, partition); + } catch (SchemaException | ObjectNotFoundException | ObjectAlreadyExistsException | CommunicationException | ConfigurationException | ExpressionEvaluationException | RuntimeException | Error e) { result.recordFatalError(e); throw e; } + return successfull; } + private void validateResult(OperationResult result, Task task, TaskPartitionDefinitionType partition) throws ObjectNotFoundException, CommunicationException, SchemaException, ConfigurationException, SecurityViolationException, PolicyViolationException, ExpressionEvaluationException, ObjectAlreadyExistsException, PreconditionViolationException { + + if (result.isSuccess() || result.isHandledError()) { + return; + } + + Throwable ex = RepoCommonUtils.getResultException(result); + CriticalityType criticality = ExceptionUtil.getCriticality(partition.getErrorCriticality(), ex, CriticalityType.PARTIAL); + RepoCommonUtils.processErrorCriticality(task.getTaskType(), criticality, ex, result); + } + private void notifyResourceObjectChangeListeners(ResourceObjectShadowChangeDescription change, Task task, OperationResult parentResult) { changeNotificationDispatcher.notifyChange(change, task, parentResult); diff --git a/provisioning/provisioning-impl/src/main/java/com/evolveum/midpoint/provisioning/impl/task/MultiPropagationTaskHandler.java b/provisioning/provisioning-impl/src/main/java/com/evolveum/midpoint/provisioning/impl/task/MultiPropagationTaskHandler.java index 745e3d6084e..c5dfd6a3cde 100644 --- a/provisioning/provisioning-impl/src/main/java/com/evolveum/midpoint/provisioning/impl/task/MultiPropagationTaskHandler.java +++ b/provisioning/provisioning-impl/src/main/java/com/evolveum/midpoint/provisioning/impl/task/MultiPropagationTaskHandler.java @@ -33,6 +33,7 @@ import com.evolveum.midpoint.util.logging.TraceManager; import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType; import com.evolveum.midpoint.xml.ns._public.common.common_3.ResourceType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.TaskPartitionDefinitionType; /** * Task handler for provisioning propagation of many resources. @@ -74,7 +75,7 @@ private void initialize() { } @Override - protected MultiPropagationResultHandler createHandler(TaskRunResult runResult, Task coordinatorTask, + protected MultiPropagationResultHandler createHandler(TaskPartitionDefinitionType partition, TaskRunResult runResult, Task coordinatorTask, OperationResult opResult) { MultiPropagationResultHandler handler = new MultiPropagationResultHandler(coordinatorTask, getTaskOperationPrefix(), taskManager, repositoryService, shadowCache); diff --git a/provisioning/provisioning-impl/src/main/java/com/evolveum/midpoint/provisioning/impl/task/PropagationResultHandler.java b/provisioning/provisioning-impl/src/main/java/com/evolveum/midpoint/provisioning/impl/task/PropagationResultHandler.java index 7bf22683dfd..3ee81c9056d 100644 --- a/provisioning/provisioning-impl/src/main/java/com/evolveum/midpoint/provisioning/impl/task/PropagationResultHandler.java +++ b/provisioning/provisioning-impl/src/main/java/com/evolveum/midpoint/provisioning/impl/task/PropagationResultHandler.java @@ -30,7 +30,7 @@ import com.evolveum.midpoint.util.logging.TraceManager; import com.evolveum.midpoint.xml.ns._public.common.common_3.ResourceType; import com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowType; -import com.evolveum.midpoint.xml.ns._public.common.common_3.TaskStageType; + /** * @author semancik diff --git a/provisioning/provisioning-impl/src/main/java/com/evolveum/midpoint/provisioning/impl/task/PropagationTaskHandler.java b/provisioning/provisioning-impl/src/main/java/com/evolveum/midpoint/provisioning/impl/task/PropagationTaskHandler.java index 4428c74dfac..f823db4422f 100644 --- a/provisioning/provisioning-impl/src/main/java/com/evolveum/midpoint/provisioning/impl/task/PropagationTaskHandler.java +++ b/provisioning/provisioning-impl/src/main/java/com/evolveum/midpoint/provisioning/impl/task/PropagationTaskHandler.java @@ -45,6 +45,7 @@ import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType; import com.evolveum.midpoint.xml.ns._public.common.common_3.ResourceType; import com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.TaskPartitionDefinitionType; /** * Task handler for provisioning propagation of one resource. @@ -82,7 +83,7 @@ private void initialize() { } @Override - protected PropagationResultHandler createHandler(TaskRunResult runResult, Task coordinatorTask, + protected PropagationResultHandler createHandler(TaskPartitionDefinitionType partition, TaskRunResult runResult, Task coordinatorTask, OperationResult opResult) { String resourceOid = coordinatorTask.getObjectOid(); diff --git a/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/impl/dummy/TestDummy.java b/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/impl/dummy/TestDummy.java index 73f8c4f0e9d..6359cf6e1cd 100644 --- a/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/impl/dummy/TestDummy.java +++ b/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/impl/dummy/TestDummy.java @@ -3980,7 +3980,7 @@ public void test800LiveSyncInit() throws Exception { // WHEN displayWhen(TEST_NAME); - provisioningService.synchronize(coords, syncTokenTask, result); + provisioningService.synchronize(coords, syncTokenTask, null, result); // THEN result.computeStatus(); @@ -4021,7 +4021,7 @@ public void test801LiveSyncAddBlackbeard() throws Exception { // WHEN displayWhen(TEST_NAME); - provisioningService.synchronize(coords, syncTokenTask, result); + provisioningService.synchronize(coords, syncTokenTask, null, result); // THEN result.computeStatus(); @@ -4084,7 +4084,7 @@ public void test802LiveSyncModifyBlackbeard() throws Exception { // WHEN displayWhen(TEST_NAME); - provisioningService.synchronize(coords, syncTokenTask, result); + provisioningService.synchronize(coords, syncTokenTask, null, result); // THEN result.computeStatus(); @@ -4248,7 +4248,7 @@ public void testLiveSyncAddDrake(final String TEST_NAME, DummySyncStyle syncStyl // WHEN displayWhen(TEST_NAME); - provisioningService.synchronize(coords, syncTokenTask, result); + provisioningService.synchronize(coords, syncTokenTask, null, result); // THEN displayThen(TEST_NAME); @@ -4320,7 +4320,7 @@ public void testLiveSyncModifyDrake(final String TEST_NAME, DummySyncStyle syncS // WHEN displayWhen(TEST_NAME); - provisioningService.synchronize(coords, syncTokenTask, result); + provisioningService.synchronize(coords, syncTokenTask, null, result); // THEN displayThen(TEST_NAME); @@ -4381,7 +4381,7 @@ public void testLiveSyncAddCorsairs(final String TEST_NAME, DummySyncStyle syncS // WHEN displayWhen(TEST_NAME); - provisioningService.synchronize(coords, syncTokenTask, result); + provisioningService.synchronize(coords, syncTokenTask, null, result); // THEN displayThen(TEST_NAME); @@ -4458,7 +4458,7 @@ public void testLiveSyncDeleteCorsairs(final String TEST_NAME, DummySyncStyle sy // WHEN displayWhen(TEST_NAME); - provisioningService.synchronize(coords, syncTokenTask, result); + provisioningService.synchronize(coords, syncTokenTask, null, result); // THEN displayThen(TEST_NAME); @@ -4526,7 +4526,7 @@ public void testLiveSyncDeleteDrake(final String TEST_NAME, DummySyncStyle syncS // WHEN displayWhen(TEST_NAME); - provisioningService.synchronize(coords, syncTokenTask, result); + provisioningService.synchronize(coords, syncTokenTask, null, result); // THEN displayThen(TEST_NAME); @@ -4582,7 +4582,7 @@ public void test890LiveSyncModifyProtectedAccount() throws Exception { // WHEN displayWhen(TEST_NAME); - provisioningService.synchronize(coords, syncTokenTask, result); + provisioningService.synchronize(coords, syncTokenTask, null, result); // THEN displayThen(TEST_NAME); diff --git a/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/impl/opendj/TestOpenDjNegative.java b/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/impl/opendj/TestOpenDjNegative.java index 7f47f1881ea..2c3bb853163 100644 --- a/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/impl/opendj/TestOpenDjNegative.java +++ b/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/impl/opendj/TestOpenDjNegative.java @@ -430,7 +430,7 @@ public void test190Synchronize() throws Exception { try { - provisioningService.synchronize(coords, task, result); + provisioningService.synchronize(coords, task, null, result); AssertJUnit.fail("addObject succeeded unexpectedly"); } catch (CommunicationException e) { @@ -763,7 +763,7 @@ public void test590Synchronize() throws Exception { try { provisioningService.synchronize(coords, - task, result); + task, null, result); AssertJUnit.fail("addObject succeeded unexpectedly"); } catch (CommunicationException e) { diff --git a/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/impl/opendj/TestSynchronization.java b/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/impl/opendj/TestSynchronization.java index 7890037e09a..e0f9eb98fcf 100644 --- a/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/impl/opendj/TestSynchronization.java +++ b/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/impl/opendj/TestSynchronization.java @@ -167,7 +167,7 @@ public void test100SyncAddWill() throws Exception { // WHEN provisioningService.synchronize(coords, - syncTask, result); + syncTask, null, result); // THEN SynchronizationServiceMock mock = (SynchronizationServiceMock) syncServiceMock; @@ -229,7 +229,7 @@ public void test500SyncAddProtected() throws Exception { // WHEN provisioningService.synchronize(coords, - syncTask, result); + syncTask, null, result); // THEN SynchronizationServiceMock mock = (SynchronizationServiceMock) syncServiceMock; diff --git a/repo/repo-api/src/main/java/com/evolveum/midpoint/repo/api/RepositoryService.java b/repo/repo-api/src/main/java/com/evolveum/midpoint/repo/api/RepositoryService.java index dac24882d71..057f778aa6f 100644 --- a/repo/repo-api/src/main/java/com/evolveum/midpoint/repo/api/RepositoryService.java +++ b/repo/repo-api/src/main/java/com/evolveum/midpoint/repo/api/RepositoryService.java @@ -18,19 +18,38 @@ import java.util.Collection; import java.util.List; +import javax.xml.namespace.QName; + +import org.jetbrains.annotations.NotNull; + import com.evolveum.midpoint.prism.Containerable; import com.evolveum.midpoint.prism.PrismObject; import com.evolveum.midpoint.prism.delta.ItemDelta; import com.evolveum.midpoint.prism.query.ObjectQuery; import com.evolveum.midpoint.repo.api.query.ObjectFilterExpressionEvaluator; -import com.evolveum.midpoint.schema.*; +import com.evolveum.midpoint.schema.GetOperationOptions; +import com.evolveum.midpoint.schema.RepositoryDiag; +import com.evolveum.midpoint.schema.RepositoryQueryDiagRequest; +import com.evolveum.midpoint.schema.RepositoryQueryDiagResponse; +import com.evolveum.midpoint.schema.ResultHandler; +import com.evolveum.midpoint.schema.SearchResultList; +import com.evolveum.midpoint.schema.SearchResultMetadata; +import com.evolveum.midpoint.schema.SelectorOptions; import com.evolveum.midpoint.schema.result.OperationResult; -import com.evolveum.midpoint.util.exception.*; +import com.evolveum.midpoint.util.exception.CommunicationException; +import com.evolveum.midpoint.util.exception.ConfigurationException; +import com.evolveum.midpoint.util.exception.ExpressionEvaluationException; +import com.evolveum.midpoint.util.exception.ObjectAlreadyExistsException; +import com.evolveum.midpoint.util.exception.ObjectNotFoundException; +import com.evolveum.midpoint.util.exception.SchemaException; +import com.evolveum.midpoint.util.exception.SecurityViolationException; import com.evolveum.midpoint.util.logging.Trace; -import com.evolveum.midpoint.xml.ns._public.common.common_3.*; -import org.jetbrains.annotations.NotNull; - -import javax.xml.namespace.QName; +import com.evolveum.midpoint.xml.ns._public.common.common_3.FocusType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.FullTextSearchConfigurationType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectSelectorType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.UserType; /** *

Identity Repository Interface.

diff --git a/repo/repo-api/src/main/java/com/evolveum/midpoint/repo/api/VersionPrecondition.java b/repo/repo-api/src/main/java/com/evolveum/midpoint/repo/api/VersionPrecondition.java index 14bd13f8824..713acd2e736 100644 --- a/repo/repo-api/src/main/java/com/evolveum/midpoint/repo/api/VersionPrecondition.java +++ b/repo/repo-api/src/main/java/com/evolveum/midpoint/repo/api/VersionPrecondition.java @@ -16,11 +16,12 @@ package com.evolveum.midpoint.repo.api; -import com.evolveum.midpoint.prism.PrismObject; -import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType; +import java.io.Serializable; + import org.jetbrains.annotations.NotNull; -import java.io.Serializable; +import com.evolveum.midpoint.prism.PrismObject; +import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType; /** * @author mederly diff --git a/repo/repo-cache/src/main/java/com/evolveum/midpoint/repo/cache/RepositoryCache.java b/repo/repo-cache/src/main/java/com/evolveum/midpoint/repo/cache/RepositoryCache.java index 0c1bb3e760a..ceb63052795 100644 --- a/repo/repo-cache/src/main/java/com/evolveum/midpoint/repo/cache/RepositoryCache.java +++ b/repo/repo-cache/src/main/java/com/evolveum/midpoint/repo/cache/RepositoryCache.java @@ -15,15 +15,47 @@ */ package com.evolveum.midpoint.repo.cache; +import java.util.Collection; +import java.util.Collections; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Random; +import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; + +import javax.annotation.PostConstruct; +import javax.xml.namespace.QName; + +import org.apache.commons.lang.Validate; +import org.jetbrains.annotations.NotNull; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + import com.evolveum.midpoint.common.configuration.api.MidpointConfiguration; import com.evolveum.midpoint.prism.Containerable; import com.evolveum.midpoint.prism.PrismContext; import com.evolveum.midpoint.prism.PrismObject; import com.evolveum.midpoint.prism.delta.ItemDelta; import com.evolveum.midpoint.prism.query.ObjectQuery; -import com.evolveum.midpoint.repo.api.*; +import com.evolveum.midpoint.repo.api.CacheDispatcher; +import com.evolveum.midpoint.repo.api.ConflictWatcher; +import com.evolveum.midpoint.repo.api.ModificationPrecondition; +import com.evolveum.midpoint.repo.api.PreconditionViolationException; +import com.evolveum.midpoint.repo.api.RepoAddOptions; +import com.evolveum.midpoint.repo.api.RepoModifyOptions; +import com.evolveum.midpoint.repo.api.RepositoryPerformanceMonitor; +import com.evolveum.midpoint.repo.api.RepositoryService; import com.evolveum.midpoint.repo.api.query.ObjectFilterExpressionEvaluator; -import com.evolveum.midpoint.schema.*; +import com.evolveum.midpoint.schema.GetOperationOptions; +import com.evolveum.midpoint.schema.RepositoryDiag; +import com.evolveum.midpoint.schema.RepositoryQueryDiagRequest; +import com.evolveum.midpoint.schema.RepositoryQueryDiagResponse; +import com.evolveum.midpoint.schema.ResultHandler; +import com.evolveum.midpoint.schema.SearchResultList; +import com.evolveum.midpoint.schema.SearchResultMetadata; +import com.evolveum.midpoint.schema.SelectorOptions; import com.evolveum.midpoint.schema.result.OperationResult; import com.evolveum.midpoint.schema.util.DiagnosticContextHolder; import com.evolveum.midpoint.util.exception.CommunicationException; @@ -35,18 +67,19 @@ import com.evolveum.midpoint.util.exception.SecurityViolationException; import com.evolveum.midpoint.util.logging.Trace; import com.evolveum.midpoint.util.logging.TraceManager; -import com.evolveum.midpoint.xml.ns._public.common.common_3.*; - -import org.apache.commons.lang.Validate; -import org.jetbrains.annotations.NotNull; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -import javax.annotation.PostConstruct; -import javax.xml.namespace.QName; -import java.util.*; -import java.util.Objects; -import java.util.concurrent.ConcurrentHashMap; +import com.evolveum.midpoint.xml.ns._public.common.common_3.ConnectorType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.FocusType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.FullTextSearchConfigurationType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectSelectorType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectTemplateType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.SecurityPolicyType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.SequenceType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.SystemConfigurationType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.TaskType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.UserType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.ValuePolicyType; /** * Read-through write-through per-session repository cache. diff --git a/repo/repo-common/src/main/java/com/evolveum/midpoint/repo/common/CounterManager.java b/repo/repo-common/src/main/java/com/evolveum/midpoint/repo/common/CounterManager.java index 3ee05095c6b..39728747aa4 100644 --- a/repo/repo-common/src/main/java/com/evolveum/midpoint/repo/common/CounterManager.java +++ b/repo/repo-common/src/main/java/com/evolveum/midpoint/repo/common/CounterManager.java @@ -15,7 +15,9 @@ */ package com.evolveum.midpoint.repo.common; +import java.util.HashSet; import java.util.Map; +import java.util.Set; import java.util.concurrent.ConcurrentHashMap; import javax.xml.datatype.Duration; @@ -43,53 +45,27 @@ public class CounterManager { private static final Trace LOGGER = TraceManager.getTrace(CounterManager.class); -// private Map countersMapOld = new ConcurrentHashMap<>(); -// private Map countersMap = new ConcurrentHashMap<>(); -// -// public synchronized void registerCounter(Task task, boolean timeCounter) { -// CounterSepcification counterSpec = countersMapOld.get(task.getOid()); -// if (counterSpec == null) { -// counterSpec = new CounterSepcification(); -// counterSpec.setCounterStart(clock.currentTimeMillis()); -// countersMapOld.put(task.getOid(), counterSpec); -// return; -// } -// -// if (timeCounter) { -// long currentInMillis = clock.currentTimeMillis(); -// long start = counterSpec.getCounterStart(); -// if (start + 3600 * 1000 < currentInMillis) { -// counterSpec = new CounterSepcification(); -// counterSpec.setCounterStart(clock.currentTimeMillis()); -// countersMapOld.replace(task.getOid(), counterSpec); -// } -// return; -// } -// -// counterSpec = new CounterSepcification(); -// counterSpec.setCounterStart(clock.currentTimeMillis()); -// countersMapOld.replace(task.getOid(), counterSpec); -// } - public synchronized void registerCounter(Task task, PolicyRuleType policyRule) { + public synchronized CounterSepcification registerCounter(Task task, String policyRuleId, PolicyRuleType policyRule) { if (task.getOid() == null) { LOGGER.trace("Not persistent task, skipping registering counter."); - return; + return null; } - CounterKey key = new CounterKey(task.getOid(), policyRule); + CounterKey key = new CounterKey(task.getOid(), policyRuleId); CounterSepcification counterSpec = countersMap.get(key); if (counterSpec == null) { - initCleanCounter(policyRule, task); - return; + return initCleanCounter(key, policyRule); } if (isResetCounter(counterSpec)) { - refreshCounter(key, counterSpec); + return refreshCounter(key, counterSpec); } + throw new IllegalStateException("Cannot register counter."); + } private boolean isResetCounter(CounterSepcification counterSpec) { @@ -102,10 +78,10 @@ private boolean isResetCounter(CounterSepcification counterSpec) { TimeIntervalType timeInterval = threshold.getTimeInterval(); if (timeInterval == null) { - return true; + return false; } if (timeInterval.getInterval() == null) { - return true; + return false; } Duration interval = timeInterval.getInterval(); @@ -113,37 +89,65 @@ private boolean isResetCounter(CounterSepcification counterSpec) { } - private CounterSepcification initCleanCounter(PolicyRuleType policyRule, Task task) { + public void cleanupCounters(String taskOid) { + Set keys = countersMap.keySet(); + + Set counersToRemove = new HashSet<>(); + for (CounterKey key : keys) { + if (taskOid.equals(key.oid)) { + counersToRemove.add(key); + } + } + + for (CounterKey counterToRemove : counersToRemove) { + countersMap.remove(counterToRemove); + } + } + + private CounterSepcification initCleanCounter(CounterKey key, PolicyRuleType policyRule) { CounterSepcification counterSpec = new CounterSepcification(); counterSpec.setCounterStart(clock.currentTimeMillis()); counterSpec.setPolicyThreshold(policyRule.getPolicyThreshold()); - countersMap.put(new CounterKey(task.getOid(), policyRule), counterSpec); + countersMap.put(key, counterSpec); return counterSpec; } - private void refreshCounter(CounterKey key, CounterSepcification counterSpec) { + private CounterSepcification refreshCounter(CounterKey key, CounterSepcification counterSpec) { counterSpec.reset(clock.currentTimeMillis()); countersMap.replace(key, counterSpec); + return counterSpec; } - public CounterSepcification getCounterSpec(Task task, PolicyRuleType policyRule) { + public CounterSepcification getCounterSpec(Task task, String policyRuleId, PolicyRuleType policyRule) { if (task.getOid() == null) { LOGGER.trace("Cannot get counter spec for task without oid"); return null; } LOGGER.trace("Getting counter spec for {} and {}", task, policyRule); - return countersMap.get(new CounterKey(task.getOid(), policyRule)); + CounterKey key = new CounterKey(task.getOid(), policyRuleId); + CounterSepcification counterSpec = countersMap.get(key); + + if (counterSpec == null) { + return registerCounter(task, policyRuleId, policyRule); + } + + if (isResetCounter(counterSpec)) { + counterSpec = refreshCounter(key, counterSpec); + } + + + return counterSpec; } class CounterKey { private String oid; - private PolicyRuleType policyRule; + private String policyRuleId; - public CounterKey(String oid, PolicyRuleType policyRule) { + public CounterKey(String oid, String policyRuleId) { this.oid = oid; - this.policyRule = policyRule; + this.policyRuleId = policyRuleId; } @Override @@ -155,16 +159,16 @@ public boolean equals(Object o) { CounterKey cacheKey = (CounterKey) o; - if (policyRule != null ? !policyRule.equals(cacheKey.policyRule) : cacheKey.policyRule != null) + if (policyRuleId != null ? !policyRuleId.equals(cacheKey.policyRuleId) : cacheKey.policyRuleId != null) return false; return oid != null ? oid.equals(cacheKey.oid) : cacheKey.oid == null; } @Override public int hashCode() { - int result = policyRule != null ? policyRule.hashCode() : 0; + int result = policyRuleId != null ? policyRuleId.hashCode() : 0; result = 31 * result + (oid != null ? oid.hashCode() : 0); - LOGGER.trace("hashCode {} for {}{}", result, oid, policyRule); + LOGGER.trace("hashCode {} for {}{}", result, oid, policyRuleId); return result; } } diff --git a/repo/repo-common/src/main/java/com/evolveum/midpoint/repo/common/task/AbstractSearchIterativeResultHandler.java b/repo/repo-common/src/main/java/com/evolveum/midpoint/repo/common/task/AbstractSearchIterativeResultHandler.java index 181c63e66c9..347dfbbd845 100644 --- a/repo/repo-common/src/main/java/com/evolveum/midpoint/repo/common/task/AbstractSearchIterativeResultHandler.java +++ b/repo/repo-common/src/main/java/com/evolveum/midpoint/repo/common/task/AbstractSearchIterativeResultHandler.java @@ -47,7 +47,7 @@ import com.evolveum.midpoint.util.logging.TraceManager; import com.evolveum.midpoint.xml.ns._public.common.common_3.CriticalityType; import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType; -import com.evolveum.midpoint.xml.ns._public.common.common_3.TaskStageType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.TaskPartitionDefinitionType; import java.util.ArrayList; import java.util.List; @@ -91,7 +91,7 @@ public abstract class AbstractSearchIterativeResultHandler private List workerSpecificResults; - private TaskStageType stageType; + private TaskPartitionDefinitionType stageType; public AbstractSearchIterativeResultHandler(Task coordinatorTask, String taskOperationPrefix, String processShortName, String contextDesc, TaskManager taskManager) { @@ -99,7 +99,7 @@ public AbstractSearchIterativeResultHandler(Task coordinatorTask, String taskOpe } public AbstractSearchIterativeResultHandler(Task coordinatorTask, String taskOperationPrefix, String processShortName, - String contextDesc, TaskStageType taskStageType, TaskManager taskManager) { + String contextDesc, TaskPartitionDefinitionType taskStageType, TaskManager taskManager) { super(); this.coordinatorTask = coordinatorTask; this.taskOperationPrefix = taskOperationPrefix; @@ -360,10 +360,10 @@ private void processRequest(ProcessingRequest request, Task workerTask, Operatio // Alternative way how to indicate an error. if (isRecordIterationStatistics()) { workerTask.recordIterativeOperationEnd(objectName, objectDisplayName, - null /* TODO */, object.getOid(), startTime, getException(result)); + null /* TODO */, object.getOid(), startTime, RepoCommonUtils.getResultException(result)); } - cont = processError(object, workerTask, getException(result), result); + cont = processError(object, workerTask, RepoCommonUtils.getResultException(result), result); } else { if (isRecordIterationStatistics()) { workerTask.recordIterativeOperationEnd(objectName, objectDisplayName, @@ -439,16 +439,7 @@ protected String getDisplayName(PrismObject object) { } // TODO implement better - protected Throwable getException(OperationResult result) { - if (result.getCause() != null) { - return result.getCause(); - } else if (result.getLastSubresult().getCause() != null) { - return result.getLastSubresult().getCause(); - } else { - return new SystemException(result.getMessage()); - } - } - + // @pre: result is "error" or ex is not null private boolean processError(PrismObject object, Task task, Throwable ex, OperationResult result) throws ObjectNotFoundException, CommunicationException, SchemaException, ConfigurationException, SecurityViolationException, PolicyViolationException, ExpressionEvaluationException, ObjectAlreadyExistsException, PreconditionViolationException { int errorsCount = errors.incrementAndGet(); @@ -488,7 +479,7 @@ private boolean isStopOnError(Task task, Throwable ex, OperationResult result) t /** * @return the stageType */ - public TaskStageType getStageType() { + public TaskPartitionDefinitionType getStageType() { return stageType; } diff --git a/repo/repo-common/src/main/java/com/evolveum/midpoint/repo/common/task/AbstractSearchIterativeTaskHandler.java b/repo/repo-common/src/main/java/com/evolveum/midpoint/repo/common/task/AbstractSearchIterativeTaskHandler.java index 54832ca0904..ac22ac9eb7e 100644 --- a/repo/repo-common/src/main/java/com/evolveum/midpoint/repo/common/task/AbstractSearchIterativeTaskHandler.java +++ b/repo/repo-common/src/main/java/com/evolveum/midpoint/repo/common/task/AbstractSearchIterativeTaskHandler.java @@ -171,7 +171,7 @@ public StatisticsCollectionStrategy getStatisticsCollectionStrategy() { @Override public TaskWorkBucketProcessingResult run(Task localCoordinatorTask, WorkBucketType workBucket, - TaskWorkBucketProcessingResult previousRunResult) { + TaskPartitionDefinitionType partition, TaskWorkBucketProcessingResult previousRunResult) { LOGGER.trace("{} run starting: local coordinator task {}, bucket {}, previous run result {}", taskName, localCoordinatorTask, workBucket, previousRunResult); @@ -207,7 +207,7 @@ public TaskWorkBucketProcessingResult run(Task localCoordinatorTask, WorkBucketT } try { - H resultHandler = setupHandler(runResult, localCoordinatorTask, opResult); + H resultHandler = setupHandler(partition, runResult, localCoordinatorTask, opResult); boolean cont = initializeRun(resultHandler, runResult, localCoordinatorTask, opResult); if (!cont) { @@ -433,10 +433,10 @@ private ObjectQuery prepareQuery(H resultHandler, return query; } - private H setupHandler(TaskWorkBucketProcessingResult runResult, Task localCoordinatorTask, OperationResult opResult) + private H setupHandler(TaskPartitionDefinitionType partition, TaskWorkBucketProcessingResult runResult, Task localCoordinatorTask, OperationResult opResult) throws ExitWorkBucketHandlerException { try { - H resultHandler = createHandler(runResult, localCoordinatorTask, opResult); + H resultHandler = createHandler(partition, runResult, localCoordinatorTask, opResult); if (resultHandler == null) { throw new ExitWorkBucketHandlerException(runResult); // the error should already be in the runResult } @@ -535,7 +535,7 @@ protected boolean requiresDirectRepositoryAccess(H resultHandler, TaskRunResult protected abstract Class getType(Task task); - protected abstract H createHandler(TaskRunResult runResult, Task coordinatorTask, + protected abstract H createHandler(TaskPartitionDefinitionType partition, TaskRunResult runResult, Task coordinatorTask, OperationResult opResult) throws SchemaException, SecurityViolationException, ObjectNotFoundException, ExpressionEvaluationException, CommunicationException, ConfigurationException; /** diff --git a/repo/repo-common/src/main/java/com/evolveum/midpoint/repo/common/util/RepoCommonUtils.java b/repo/repo-common/src/main/java/com/evolveum/midpoint/repo/common/util/RepoCommonUtils.java index 385b0bc3f35..39854387b29 100644 --- a/repo/repo-common/src/main/java/com/evolveum/midpoint/repo/common/util/RepoCommonUtils.java +++ b/repo/repo-common/src/main/java/com/evolveum/midpoint/repo/common/util/RepoCommonUtils.java @@ -89,5 +89,15 @@ public static void throwException(Throwable e, OperationResult result) throw new SystemException(e.getMessage(), e); } } + //TODO implement better + public static Throwable getResultException(OperationResult result) { + if (result.getCause() != null) { + return result.getCause(); + } else if (result.getLastSubresult().getCause() != null) { + return result.getLastSubresult().getCause(); + } else { + return new SystemException(result.getMessage()); + } + } } diff --git a/repo/repo-sql-impl-test/src/test/java/com/evolveum/midpoint/repo/sql/ModifyTest.java b/repo/repo-sql-impl-test/src/test/java/com/evolveum/midpoint/repo/sql/ModifyTest.java index 60f6f7f9bbb..ce6a73fe739 100644 --- a/repo/repo-sql-impl-test/src/test/java/com/evolveum/midpoint/repo/sql/ModifyTest.java +++ b/repo/repo-sql-impl-test/src/test/java/com/evolveum/midpoint/repo/sql/ModifyTest.java @@ -35,12 +35,6 @@ import javax.xml.datatype.XMLGregorianCalendar; import javax.xml.namespace.QName; -import com.evolveum.midpoint.prism.*; -import com.evolveum.midpoint.prism.delta.*; -import com.evolveum.midpoint.prism.equivalence.EquivalenceStrategy; -import com.evolveum.midpoint.prism.path.ItemPath; -import com.evolveum.midpoint.xml.ns._public.common.common_3.*; -import com.evolveum.midpoint.schema.SearchResultList; import org.hibernate.Session; import org.springframework.test.annotation.DirtiesContext; import org.springframework.test.context.ContextConfiguration; @@ -51,6 +45,25 @@ import org.xml.sax.SAXException; import com.evolveum.midpoint.common.SynchronizationUtils; +import com.evolveum.midpoint.prism.Containerable; +import com.evolveum.midpoint.prism.Item; +import com.evolveum.midpoint.prism.ItemDefinition; +import com.evolveum.midpoint.prism.MutablePrismPropertyDefinition; +import com.evolveum.midpoint.prism.Objectable; +import com.evolveum.midpoint.prism.PrismContainer; +import com.evolveum.midpoint.prism.PrismObject; +import com.evolveum.midpoint.prism.PrismObjectDefinition; +import com.evolveum.midpoint.prism.PrismProperty; +import com.evolveum.midpoint.prism.PrismPropertyDefinition; +import com.evolveum.midpoint.prism.PrismReferenceDefinition; +import com.evolveum.midpoint.prism.PrismValue; +import com.evolveum.midpoint.prism.delta.ItemDelta; +import com.evolveum.midpoint.prism.delta.ItemDeltaCollectionsUtil; +import com.evolveum.midpoint.prism.delta.ObjectDelta; +import com.evolveum.midpoint.prism.delta.PropertyDelta; +import com.evolveum.midpoint.prism.delta.ReferenceDelta; +import com.evolveum.midpoint.prism.equivalence.EquivalenceStrategy; +import com.evolveum.midpoint.prism.path.ItemPath; import com.evolveum.midpoint.prism.polystring.PolyString; import com.evolveum.midpoint.prism.query.ObjectFilter; import com.evolveum.midpoint.prism.query.ObjectQuery; @@ -65,6 +78,7 @@ import com.evolveum.midpoint.repo.sql.testing.SqlRepoTestUtil; import com.evolveum.midpoint.schema.DeltaConvertor; import com.evolveum.midpoint.schema.MidPointPrismContextFactory; +import com.evolveum.midpoint.schema.SearchResultList; import com.evolveum.midpoint.schema.constants.MidPointConstants; import com.evolveum.midpoint.schema.constants.SchemaConstants; import com.evolveum.midpoint.schema.internals.InternalsConfig; @@ -79,6 +93,22 @@ import com.evolveum.midpoint.util.logging.Trace; import com.evolveum.midpoint.util.logging.TraceManager; import com.evolveum.midpoint.xml.ns._public.common.api_types_3.ObjectModificationType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.AssignmentType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.CaseType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.CaseWorkItemType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.MetadataType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectCollectionType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectReferenceType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.PendingOperationType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.ResourceType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.RoleType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowAttributesType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.SynchronizationSituationDescriptionType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.SynchronizationSituationType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.TaskType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.UserType; import com.evolveum.prism.xml.ns._public.query_3.SearchFilterType; import com.evolveum.prism.xml.ns._public.types_3.PolyStringType; diff --git a/repo/repo-sql-impl/src/main/java/com/evolveum/midpoint/repo/sql/SqlRepositoryServiceImpl.java b/repo/repo-sql-impl/src/main/java/com/evolveum/midpoint/repo/sql/SqlRepositoryServiceImpl.java index 98ba827c5e5..06a8ff72f96 100644 --- a/repo/repo-sql-impl/src/main/java/com/evolveum/midpoint/repo/sql/SqlRepositoryServiceImpl.java +++ b/repo/repo-sql-impl/src/main/java/com/evolveum/midpoint/repo/sql/SqlRepositoryServiceImpl.java @@ -16,6 +16,36 @@ package com.evolveum.midpoint.repo.sql; +import static org.apache.commons.collections4.CollectionUtils.emptyIfNull; + +import java.sql.Connection; +import java.sql.Driver; +import java.sql.DriverManager; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.Comparator; +import java.util.Enumeration; +import java.util.HashSet; +import java.util.List; +import java.util.Properties; +import java.util.Set; +import java.util.function.Consumer; +import java.util.function.Supplier; + +import javax.xml.namespace.QName; + +import org.apache.commons.lang.Validate; +import org.hibernate.Session; +import org.hibernate.SessionFactory; +import org.hibernate.internal.SessionFactoryImpl; +import org.hibernate.jdbc.Work; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Repository; + import com.evolveum.midpoint.common.configuration.api.MidpointConfiguration; import com.evolveum.midpoint.common.crypto.CryptoUtil; import com.evolveum.midpoint.prism.ConsistencyCheckScope; @@ -35,13 +65,32 @@ import com.evolveum.midpoint.prism.query.ObjectFilter; import com.evolveum.midpoint.prism.query.ObjectPaging; import com.evolveum.midpoint.prism.query.ObjectQuery; -import com.evolveum.midpoint.repo.api.*; +import com.evolveum.midpoint.repo.api.ConflictWatcher; +import com.evolveum.midpoint.repo.api.ModificationPrecondition; +import com.evolveum.midpoint.repo.api.PreconditionViolationException; +import com.evolveum.midpoint.repo.api.RepoAddOptions; +import com.evolveum.midpoint.repo.api.RepoModifyOptions; +import com.evolveum.midpoint.repo.api.RepositoryService; +import com.evolveum.midpoint.repo.api.SystemConfigurationChangeDispatcher; import com.evolveum.midpoint.repo.api.query.ObjectFilterExpressionEvaluator; -import com.evolveum.midpoint.repo.sql.helpers.*; +import com.evolveum.midpoint.repo.sql.helpers.BaseHelper; +import com.evolveum.midpoint.repo.sql.helpers.ObjectRetriever; +import com.evolveum.midpoint.repo.sql.helpers.ObjectUpdater; +import com.evolveum.midpoint.repo.sql.helpers.OrgClosureManager; +import com.evolveum.midpoint.repo.sql.helpers.SequenceHelper; import com.evolveum.midpoint.repo.sql.query2.matcher.DefaultMatcher; import com.evolveum.midpoint.repo.sql.query2.matcher.PolyStringMatcher; import com.evolveum.midpoint.repo.sql.query2.matcher.StringMatcher; -import com.evolveum.midpoint.schema.*; +import com.evolveum.midpoint.schema.GetOperationOptions; +import com.evolveum.midpoint.schema.LabeledString; +import com.evolveum.midpoint.schema.RelationRegistry; +import com.evolveum.midpoint.schema.RepositoryDiag; +import com.evolveum.midpoint.schema.RepositoryQueryDiagRequest; +import com.evolveum.midpoint.schema.RepositoryQueryDiagResponse; +import com.evolveum.midpoint.schema.ResultHandler; +import com.evolveum.midpoint.schema.SearchResultList; +import com.evolveum.midpoint.schema.SearchResultMetadata; +import com.evolveum.midpoint.schema.SelectorOptions; import com.evolveum.midpoint.schema.internals.InternalMonitor; import com.evolveum.midpoint.schema.internals.InternalsConfig; import com.evolveum.midpoint.schema.result.OperationResult; @@ -61,30 +110,16 @@ import com.evolveum.midpoint.util.logging.LoggingUtils; import com.evolveum.midpoint.util.logging.Trace; import com.evolveum.midpoint.util.logging.TraceManager; -import com.evolveum.midpoint.xml.ns._public.common.common_3.*; +import com.evolveum.midpoint.xml.ns._public.common.common_3.FocusType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.FullTextSearchConfigurationType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.IterationMethodType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectReferenceType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectSelectorType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.UserType; import com.evolveum.prism.xml.ns._public.query_3.SearchFilterType; import com.evolveum.prism.xml.ns._public.types_3.PolyStringType; -import org.apache.commons.lang.Validate; -import org.hibernate.Session; -import org.hibernate.SessionFactory; -import org.hibernate.internal.SessionFactoryImpl; -import org.hibernate.jdbc.Work; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Repository; - -import java.sql.Connection; -import java.sql.Driver; -import java.sql.DriverManager; -import java.sql.SQLException; -import java.util.*; -import java.util.function.Consumer; -import java.util.function.Supplier; - -import javax.xml.namespace.QName; - -import static org.apache.commons.collections4.CollectionUtils.emptyIfNull; /** * @author lazyman diff --git a/repo/repo-sql-impl/src/main/java/com/evolveum/midpoint/repo/sql/helpers/ObjectUpdater.java b/repo/repo-sql-impl/src/main/java/com/evolveum/midpoint/repo/sql/helpers/ObjectUpdater.java index d7f97225e0d..5a83d8b2601 100644 --- a/repo/repo-sql-impl/src/main/java/com/evolveum/midpoint/repo/sql/helpers/ObjectUpdater.java +++ b/repo/repo-sql-impl/src/main/java/com/evolveum/midpoint/repo/sql/helpers/ObjectUpdater.java @@ -16,12 +16,41 @@ package com.evolveum.midpoint.repo.sql.helpers; -import com.evolveum.midpoint.prism.*; -import com.evolveum.midpoint.prism.delta.*; +import java.lang.reflect.Method; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.List; + +import javax.persistence.PersistenceException; +import javax.persistence.criteria.CriteriaBuilder; +import javax.persistence.criteria.CriteriaQuery; + +import org.apache.commons.lang.StringUtils; +import org.hibernate.Session; +import org.hibernate.exception.ConstraintViolationException; +import org.hibernate.query.NativeQuery; +import org.hibernate.query.Query; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Component; + +import com.evolveum.midpoint.prism.PrismContext; +import com.evolveum.midpoint.prism.PrismObject; +import com.evolveum.midpoint.prism.PrismObjectDefinition; +import com.evolveum.midpoint.prism.PrismReference; +import com.evolveum.midpoint.prism.delta.ItemDelta; +import com.evolveum.midpoint.prism.delta.ItemDeltaCollectionsUtil; +import com.evolveum.midpoint.prism.delta.ObjectDelta; +import com.evolveum.midpoint.prism.delta.ReferenceDelta; import com.evolveum.midpoint.prism.equivalence.EquivalenceStrategy; import com.evolveum.midpoint.prism.path.ItemPath; import com.evolveum.midpoint.prism.util.CloneUtil; -import com.evolveum.midpoint.repo.api.*; +import com.evolveum.midpoint.repo.api.ModificationPrecondition; +import com.evolveum.midpoint.repo.api.PreconditionViolationException; +import com.evolveum.midpoint.repo.api.RepoAddOptions; +import com.evolveum.midpoint.repo.api.RepoModifyOptions; +import com.evolveum.midpoint.repo.api.RepositoryService; import com.evolveum.midpoint.repo.sql.SerializationRelatedException; import com.evolveum.midpoint.repo.sql.SqlRepositoryConfiguration; import com.evolveum.midpoint.repo.sql.SqlRepositoryServiceImpl; @@ -33,7 +62,9 @@ import com.evolveum.midpoint.repo.sql.util.IdGeneratorResult; import com.evolveum.midpoint.repo.sql.util.PrismIdentifierGenerator; import com.evolveum.midpoint.repo.sql.util.RUtil; -import com.evolveum.midpoint.schema.*; +import com.evolveum.midpoint.schema.GetOperationOptionsBuilder; +import com.evolveum.midpoint.schema.RelationRegistry; +import com.evolveum.midpoint.schema.SchemaHelper; import com.evolveum.midpoint.schema.result.OperationResult; import com.evolveum.midpoint.schema.util.ExceptionUtil; import com.evolveum.midpoint.schema.util.ObjectTypeUtil; @@ -43,21 +74,11 @@ import com.evolveum.midpoint.util.exception.SchemaException; import com.evolveum.midpoint.util.logging.Trace; import com.evolveum.midpoint.util.logging.TraceManager; -import com.evolveum.midpoint.xml.ns._public.common.common_3.*; -import org.apache.commons.lang.StringUtils; -import org.hibernate.query.Query; -import org.hibernate.Session; -import org.hibernate.exception.ConstraintViolationException; -import org.hibernate.query.NativeQuery; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.stereotype.Component; - -import javax.persistence.PersistenceException; -import javax.persistence.criteria.CriteriaBuilder; -import javax.persistence.criteria.CriteriaQuery; -import java.lang.reflect.Method; -import java.util.*; +import com.evolveum.midpoint.xml.ns._public.common.common_3.AccessCertificationCampaignType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.FocusType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.LookupTableType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.TaskType; /** * @author lazyman, mederly diff --git a/repo/task-api/src/main/java/com/evolveum/midpoint/task/api/TaskConstants.java b/repo/task-api/src/main/java/com/evolveum/midpoint/task/api/TaskConstants.java index e0b3a56e9f7..7b8f304360f 100644 --- a/repo/task-api/src/main/java/com/evolveum/midpoint/task/api/TaskConstants.java +++ b/repo/task-api/src/main/java/com/evolveum/midpoint/task/api/TaskConstants.java @@ -25,6 +25,8 @@ public class TaskConstants { public static final String WORKERS_RESTART_TASK_HANDLER_URI = "http://midpoint.evolveum.com/xml/ns/public/task/workers-restart/handler-3"; public static final String WORKERS_CREATION_TASK_HANDLER_URI = "http://midpoint.evolveum.com/xml/ns/public/task/workers-creation/handler-3"; public static final String GENERIC_PARTITIONING_TASK_HANDLER_URI = "http://midpoint.evolveum.com/xml/ns/public/task/generic-partitioning/handler-3"; + public static final String LIGHTWEIGTH_PARTITIONING_TASK_HANDLER_URI = "http://midpoint.evolveum.com/xml/ns/public/task/lightweigth-partitioning/handler-3"; + public static final String NOOP_TASK_HANDLER_URI = "http://midpoint.evolveum.com/xml/ns/public/task/noop/handler-3"; public static final String NOOP_TASK_HANDLER_URI_1 = NOOP_TASK_HANDLER_URI + "#1"; diff --git a/repo/task-api/src/main/java/com/evolveum/midpoint/task/api/TaskHandler.java b/repo/task-api/src/main/java/com/evolveum/midpoint/task/api/TaskHandler.java index 5dc1ce84323..fa72c128447 100644 --- a/repo/task-api/src/main/java/com/evolveum/midpoint/task/api/TaskHandler.java +++ b/repo/task-api/src/main/java/com/evolveum/midpoint/task/api/TaskHandler.java @@ -17,6 +17,11 @@ import org.jetbrains.annotations.NotNull; +import com.evolveum.midpoint.prism.PrismObjectDefinition; +import com.evolveum.midpoint.util.annotation.Experimental; +import com.evolveum.midpoint.xml.ns._public.common.common_3.TaskPartitionDefinitionType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.TaskType; + import java.util.List; /** @@ -25,7 +30,12 @@ */ public interface TaskHandler { - TaskRunResult run(Task task); + default TaskRunResult run(Task task) { + return run(task); + } + + @Experimental + TaskRunResult run(Task task, TaskPartitionDefinitionType partitionDefinition); default Long heartbeat(Task task) { return null; @@ -56,4 +66,5 @@ default List getCategoryNames() { default StatisticsCollectionStrategy getStatisticsCollectionStrategy() { return new StatisticsCollectionStrategy(); } + } diff --git a/repo/task-api/src/main/java/com/evolveum/midpoint/task/api/TaskManager.java b/repo/task-api/src/main/java/com/evolveum/midpoint/task/api/TaskManager.java index b00193dcf6f..b687e5d937b 100644 --- a/repo/task-api/src/main/java/com/evolveum/midpoint/task/api/TaskManager.java +++ b/repo/task-api/src/main/java/com/evolveum/midpoint/task/api/TaskManager.java @@ -15,6 +15,14 @@ */ package com.evolveum.midpoint.task.api; +import java.text.ParseException; +import java.util.Collection; +import java.util.List; +import java.util.Set; +import java.util.function.Function; + +import org.jetbrains.annotations.NotNull; + import com.evolveum.midpoint.prism.ItemDefinition; import com.evolveum.midpoint.prism.PrismObject; import com.evolveum.midpoint.prism.delta.ItemDelta; @@ -22,19 +30,21 @@ import com.evolveum.midpoint.prism.query.ObjectQuery; import com.evolveum.midpoint.repo.api.PreconditionViolationException; import com.evolveum.midpoint.repo.api.RepoAddOptions; -import com.evolveum.midpoint.schema.*; +import com.evolveum.midpoint.schema.GetOperationOptions; +import com.evolveum.midpoint.schema.ResultHandler; +import com.evolveum.midpoint.schema.SearchResultList; +import com.evolveum.midpoint.schema.SearchResultMetadata; +import com.evolveum.midpoint.schema.SelectorOptions; import com.evolveum.midpoint.schema.result.OperationResult; import com.evolveum.midpoint.util.exception.ObjectAlreadyExistsException; import com.evolveum.midpoint.util.exception.ObjectNotFoundException; import com.evolveum.midpoint.util.exception.SchemaException; -import com.evolveum.midpoint.xml.ns._public.common.common_3.*; -import org.jetbrains.annotations.NotNull; - -import java.text.ParseException; -import java.util.Collection; -import java.util.List; -import java.util.Set; -import java.util.function.Function; +import com.evolveum.midpoint.xml.ns._public.common.common_3.CleanupPolicyType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.NodeType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.SchedulerInformationType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.TaskType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.WorkBucketType; /** *

Task Manager Interface.

diff --git a/repo/task-api/src/main/java/com/evolveum/midpoint/task/api/WorkBucketAwareTaskHandler.java b/repo/task-api/src/main/java/com/evolveum/midpoint/task/api/WorkBucketAwareTaskHandler.java index 17240a6628f..d668d623848 100644 --- a/repo/task-api/src/main/java/com/evolveum/midpoint/task/api/WorkBucketAwareTaskHandler.java +++ b/repo/task-api/src/main/java/com/evolveum/midpoint/task/api/WorkBucketAwareTaskHandler.java @@ -16,6 +16,7 @@ package com.evolveum.midpoint.task.api; +import com.evolveum.midpoint.xml.ns._public.common.common_3.TaskPartitionDefinitionType; import com.evolveum.midpoint.xml.ns._public.common.common_3.WorkBucketType; /** @@ -27,8 +28,15 @@ public interface WorkBucketAwareTaskHandler extends TaskHandler { default TaskRunResult run(Task task) { throw new UnsupportedOperationException("run with no work bucket is not supported here"); } + + @Override + default TaskRunResult run(Task task, TaskPartitionDefinitionType partitionDefinition) { + throw new UnsupportedOperationException("run with no work bucket is not supported here"); + } - TaskWorkBucketProcessingResult run(Task task, WorkBucketType workBucket, TaskWorkBucketProcessingResult previousRunResult); + TaskWorkBucketProcessingResult run(Task task, WorkBucketType workBucket, TaskPartitionDefinitionType partitionDefinition, TaskWorkBucketProcessingResult previousRunResult); + +// TaskWorkBucketProcessingResult run(Task task, WorkBucketType workBucket, TaskWorkBucketProcessingResult previousRunResult); default TaskWorkBucketProcessingResult onNoMoreBuckets(Task task, TaskWorkBucketProcessingResult previousRunResult) { return previousRunResult; diff --git a/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/TaskManagerQuartzImpl.java b/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/TaskManagerQuartzImpl.java index 187b0a1a121..5f7609ad6f7 100644 --- a/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/TaskManagerQuartzImpl.java +++ b/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/TaskManagerQuartzImpl.java @@ -21,7 +21,16 @@ import static java.util.Collections.singleton; import java.text.ParseException; -import java.util.*; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.ConcurrentModificationException; +import java.util.Date; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; import java.util.concurrent.CancellationException; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; @@ -33,17 +42,6 @@ import javax.xml.datatype.Duration; import javax.xml.datatype.XMLGregorianCalendar; -import com.evolveum.midpoint.common.LocalizationService; -import com.evolveum.midpoint.prism.ItemDefinition; -import com.evolveum.midpoint.prism.crypto.Protector; -import com.evolveum.midpoint.prism.path.ItemPath; -import com.evolveum.midpoint.repo.api.*; -import com.evolveum.midpoint.schema.*; -import com.evolveum.midpoint.task.api.*; -import com.evolveum.midpoint.task.quartzimpl.handlers.PartitioningTaskHandler; -import com.evolveum.midpoint.task.quartzimpl.work.WorkStateManager; -import com.evolveum.midpoint.task.quartzimpl.work.workers.WorkersManager; -import com.evolveum.midpoint.xml.ns._public.common.common_3.*; import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.Validate; import org.jetbrains.annotations.NotNull; @@ -60,22 +58,60 @@ import org.springframework.context.annotation.DependsOn; import org.springframework.stereotype.Service; +import com.evolveum.midpoint.common.LocalizationService; import com.evolveum.midpoint.common.configuration.api.MidpointConfiguration; +import com.evolveum.midpoint.prism.ItemDefinition; import com.evolveum.midpoint.prism.PrismContext; import com.evolveum.midpoint.prism.PrismObject; import com.evolveum.midpoint.prism.PrismObjectDefinition; +import com.evolveum.midpoint.prism.crypto.Protector; import com.evolveum.midpoint.prism.delta.ItemDelta; +import com.evolveum.midpoint.prism.path.ItemPath; import com.evolveum.midpoint.prism.polystring.PolyString; import com.evolveum.midpoint.prism.query.ObjectQuery; import com.evolveum.midpoint.prism.query.builder.S_AtomicFilterEntry; import com.evolveum.midpoint.prism.xml.XmlTypeConverter; +import com.evolveum.midpoint.repo.api.PreconditionViolationException; +import com.evolveum.midpoint.repo.api.RepoAddOptions; +import com.evolveum.midpoint.repo.api.RepositoryService; +import com.evolveum.midpoint.repo.api.SystemConfigurationChangeDispatcher; +import com.evolveum.midpoint.repo.api.SystemConfigurationChangeListener; +import com.evolveum.midpoint.schema.GetOperationOptions; +import com.evolveum.midpoint.schema.RelationRegistry; +import com.evolveum.midpoint.schema.ResultHandler; +import com.evolveum.midpoint.schema.SchemaHelper; +import com.evolveum.midpoint.schema.SearchResultList; +import com.evolveum.midpoint.schema.SearchResultMetadata; +import com.evolveum.midpoint.schema.SelectorOptions; import com.evolveum.midpoint.schema.result.OperationResult; import com.evolveum.midpoint.schema.result.OperationResultStatus; import com.evolveum.midpoint.security.api.SecurityContextManager; +import com.evolveum.midpoint.task.api.ClusterExecutionHelper; +import com.evolveum.midpoint.task.api.LightweightIdentifier; +import com.evolveum.midpoint.task.api.LightweightIdentifierGenerator; +import com.evolveum.midpoint.task.api.LightweightTaskHandler; +import com.evolveum.midpoint.task.api.Task; +import com.evolveum.midpoint.task.api.TaskCategory; +import com.evolveum.midpoint.task.api.TaskDeletionListener; +import com.evolveum.midpoint.task.api.TaskExecutionStatus; +import com.evolveum.midpoint.task.api.TaskHandler; +import com.evolveum.midpoint.task.api.TaskListener; +import com.evolveum.midpoint.task.api.TaskManager; +import com.evolveum.midpoint.task.api.TaskManagerException; +import com.evolveum.midpoint.task.api.TaskManagerInitializationException; +import com.evolveum.midpoint.task.api.TaskPartitionsDefinition; +import com.evolveum.midpoint.task.api.TaskPersistenceStatus; +import com.evolveum.midpoint.task.api.TaskRunResult; +import com.evolveum.midpoint.task.api.TaskWaitingReason; +import com.evolveum.midpoint.task.api.WorkersReconciliationOptions; import com.evolveum.midpoint.task.quartzimpl.cluster.ClusterManager; import com.evolveum.midpoint.task.quartzimpl.cluster.ClusterStatusInformation; import com.evolveum.midpoint.task.quartzimpl.execution.ExecutionManager; +import com.evolveum.midpoint.task.quartzimpl.execution.HandlerExecutor; import com.evolveum.midpoint.task.quartzimpl.execution.StalledTasksWatcher; +import com.evolveum.midpoint.task.quartzimpl.handlers.PartitioningTaskHandler; +import com.evolveum.midpoint.task.quartzimpl.work.WorkStateManager; +import com.evolveum.midpoint.task.quartzimpl.work.workers.WorkersManager; import com.evolveum.midpoint.util.exception.CommunicationException; import com.evolveum.midpoint.util.exception.ConfigurationException; import com.evolveum.midpoint.util.exception.ExpressionEvaluationException; @@ -87,6 +123,20 @@ import com.evolveum.midpoint.util.logging.LoggingUtils; import com.evolveum.midpoint.util.logging.Trace; import com.evolveum.midpoint.util.logging.TraceManager; +import com.evolveum.midpoint.xml.ns._public.common.common_3.CleanupPolicyType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.InfrastructureConfigurationType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.NodeErrorStatusType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.NodeExecutionStatusType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.NodeType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.OperationResultStatusType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.OperationStatsType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.SchedulerInformationType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.SystemConfigurationType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.TaskExecutionStatusType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.TaskType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.TaskUnpauseActionType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.WorkBucketType; import com.evolveum.prism.xml.ns._public.types_3.PolyStringType; /** @@ -181,6 +231,9 @@ public class TaskManagerQuartzImpl implements TaskManager, BeanFactoryAware, Sys @Autowired @Qualifier("securityContextManager") private SecurityContextManager securityContextManager; + + // fixme " how to properly initialize handler executer for jobexecutor? + @Autowired private HandlerExecutor handlerExecutor; private static final transient Trace LOGGER = TraceManager.getTrace(TaskManagerQuartzImpl.class); @@ -239,6 +292,12 @@ public void init() { postInit(result); } } + + @PreDestroy + public void destroy() { + systemConfigurationChangeDispatcher.unregisterListener(this); + } + @Override public void postInit(OperationResult parentResult) { @@ -2343,6 +2402,13 @@ public SecurityContextManager getSecurityContextManager() { public WorkStateManager getWorkStateManager() { return workStateManager; } + + /** + * @return the handlerExecutor + */ + public HandlerExecutor getHandlerExecutor() { + return handlerExecutor; + } @Override public ObjectQuery narrowQueryForWorkBucket(ObjectQuery query, Class type, diff --git a/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/TaskQuartzImpl.java b/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/TaskQuartzImpl.java index 9432c6b7f0b..fba84ac0cd1 100644 --- a/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/TaskQuartzImpl.java +++ b/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/TaskQuartzImpl.java @@ -15,10 +15,58 @@ */ package com.evolveum.midpoint.task.quartzimpl; -import com.evolveum.midpoint.prism.*; -import com.evolveum.midpoint.prism.delta.*; -import com.evolveum.midpoint.prism.path.ItemPath; +import static com.evolveum.midpoint.prism.xml.XmlTypeConverter.createXMLGregorianCalendar; +import static com.evolveum.midpoint.xml.ns._public.common.common_3.TaskType.F_MODEL_OPERATION_CONTEXT; +import static com.evolveum.midpoint.xml.ns._public.common.common_3.TaskType.F_WORKFLOW_CONTEXT; +import static java.util.Collections.emptyMap; +import static java.util.Collections.singleton; +import static java.util.Collections.singletonList; +import static org.apache.commons.collections4.CollectionUtils.addIgnoreNull; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.Date; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.Future; + +import javax.xml.datatype.Duration; +import javax.xml.datatype.XMLGregorianCalendar; +import javax.xml.namespace.QName; + +import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang.Validate; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import com.evolveum.midpoint.prism.Containerable; +import com.evolveum.midpoint.prism.Item; +import com.evolveum.midpoint.prism.PrismContainer; +import com.evolveum.midpoint.prism.PrismContainerDefinition; +import com.evolveum.midpoint.prism.PrismContainerValue; +import com.evolveum.midpoint.prism.PrismContext; +import com.evolveum.midpoint.prism.PrismObject; +import com.evolveum.midpoint.prism.PrismObjectDefinition; +import com.evolveum.midpoint.prism.PrismProperty; +import com.evolveum.midpoint.prism.PrismPropertyDefinition; +import com.evolveum.midpoint.prism.PrismPropertyValue; +import com.evolveum.midpoint.prism.PrismReference; +import com.evolveum.midpoint.prism.PrismReferenceDefinition; +import com.evolveum.midpoint.prism.PrismReferenceValue; +import com.evolveum.midpoint.prism.PrismValue; +import com.evolveum.midpoint.prism.PrismValueCollectionsUtil; +import com.evolveum.midpoint.prism.delta.ChangeType; +import com.evolveum.midpoint.prism.delta.DeltaFactory; +import com.evolveum.midpoint.prism.delta.ItemDelta; +import com.evolveum.midpoint.prism.delta.ItemDeltaCollectionsUtil; +import com.evolveum.midpoint.prism.delta.PropertyDelta; +import com.evolveum.midpoint.prism.delta.ReferenceDelta; import com.evolveum.midpoint.prism.path.ItemName; +import com.evolveum.midpoint.prism.path.ItemPath; import com.evolveum.midpoint.prism.polystring.PolyString; import com.evolveum.midpoint.prism.query.ObjectQuery; import com.evolveum.midpoint.prism.util.CloneUtil; @@ -32,13 +80,23 @@ import com.evolveum.midpoint.schema.SelectorOptions; import com.evolveum.midpoint.schema.constants.SchemaConstants; import com.evolveum.midpoint.schema.result.OperationResult; +import com.evolveum.midpoint.schema.statistics.ActionsExecutedInformation; import com.evolveum.midpoint.schema.statistics.EnvironmentalPerformanceInformation; import com.evolveum.midpoint.schema.statistics.IterativeTaskInformation; import com.evolveum.midpoint.schema.statistics.ProvisioningOperation; -import com.evolveum.midpoint.schema.statistics.ActionsExecutedInformation; import com.evolveum.midpoint.schema.statistics.StatisticsUtil; import com.evolveum.midpoint.schema.statistics.SynchronizationInformation; -import com.evolveum.midpoint.task.api.*; +import com.evolveum.midpoint.task.api.LightweightIdentifier; +import com.evolveum.midpoint.task.api.LightweightTaskHandler; +import com.evolveum.midpoint.task.api.StatisticsCollectionStrategy; +import com.evolveum.midpoint.task.api.Task; +import com.evolveum.midpoint.task.api.TaskBinding; +import com.evolveum.midpoint.task.api.TaskExecutionStatus; +import com.evolveum.midpoint.task.api.TaskHandler; +import com.evolveum.midpoint.task.api.TaskPersistenceStatus; +import com.evolveum.midpoint.task.api.TaskRecurrence; +import com.evolveum.midpoint.task.api.TaskRunResult; +import com.evolveum.midpoint.task.api.TaskWaitingReason; import com.evolveum.midpoint.task.quartzimpl.handlers.WaitForSubtasksByPollingTaskHandler; import com.evolveum.midpoint.task.quartzimpl.handlers.WaitForTasksTaskHandler; import com.evolveum.midpoint.util.DebugUtil; @@ -49,25 +107,38 @@ import com.evolveum.midpoint.util.logging.LoggingUtils; import com.evolveum.midpoint.util.logging.Trace; import com.evolveum.midpoint.util.logging.TraceManager; -import com.evolveum.midpoint.xml.ns._public.common.common_3.*; +import com.evolveum.midpoint.xml.ns._public.common.common_3.ActionsExecutedInformationType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.EnvironmentalPerformanceInformationType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.IterativeTaskInformationType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.LensContextType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectReferenceType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.OperationResultStatusType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.OperationResultType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.OperationStatsType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.PolicyRuleType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.ScheduleType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.SynchronizationInformationType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.TaskBindingType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.TaskExecutionConstraintsType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.TaskExecutionGroupConstraintType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.TaskExecutionStatusType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.TaskKindType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.TaskRecurrenceType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.TaskType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.TaskUnpauseActionType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.TaskWaitingReasonType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.TaskWorkManagementType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.TaskWorkStateType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.ThreadStopActionType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.TriggerType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.UriStack; +import com.evolveum.midpoint.xml.ns._public.common.common_3.UriStackEntry; +import com.evolveum.midpoint.xml.ns._public.common.common_3.UserType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.WfContextType; import com.evolveum.prism.xml.ns._public.types_3.ItemDeltaType; import com.evolveum.prism.xml.ns._public.types_3.PolyStringType; -import org.apache.commons.lang.StringUtils; -import org.apache.commons.lang.Validate; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -import javax.xml.datatype.Duration; -import javax.xml.datatype.XMLGregorianCalendar; -import javax.xml.namespace.QName; -import java.util.*; -import java.util.concurrent.Future; - -import static com.evolveum.midpoint.prism.xml.XmlTypeConverter.createXMLGregorianCalendar; -import static com.evolveum.midpoint.xml.ns._public.common.common_3.TaskType.F_MODEL_OPERATION_CONTEXT; -import static com.evolveum.midpoint.xml.ns._public.common.common_3.TaskType.F_WORKFLOW_CONTEXT; -import static java.util.Collections.*; -import static org.apache.commons.collections4.CollectionUtils.addIgnoreNull; /** * Implementation of a Task. diff --git a/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/execution/ExecutionManager.java b/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/execution/ExecutionManager.java index 0aaa661c4b9..e8c80a6ac73 100644 --- a/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/execution/ExecutionManager.java +++ b/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/execution/ExecutionManager.java @@ -16,12 +16,35 @@ package com.evolveum.midpoint.task.quartzimpl.execution; +import java.util.Collection; +import java.util.Date; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import org.quartz.JobKey; +import org.quartz.Scheduler; +import org.quartz.SchedulerException; +import org.quartz.Trigger; +import org.quartz.TriggerKey; + import com.evolveum.midpoint.prism.PrismObject; import com.evolveum.midpoint.repo.api.PreconditionViolationException; import com.evolveum.midpoint.schema.result.OperationResult; import com.evolveum.midpoint.schema.result.OperationResultStatus; -import com.evolveum.midpoint.task.api.*; -import com.evolveum.midpoint.task.quartzimpl.*; +import com.evolveum.midpoint.task.api.Task; +import com.evolveum.midpoint.task.api.TaskExecutionStatus; +import com.evolveum.midpoint.task.api.TaskManagerException; +import com.evolveum.midpoint.task.api.TaskManagerInitializationException; +import com.evolveum.midpoint.task.api.UseThreadInterrupt; +import com.evolveum.midpoint.task.quartzimpl.TaskManagerConfiguration; +import com.evolveum.midpoint.task.quartzimpl.TaskManagerQuartzImpl; +import com.evolveum.midpoint.task.quartzimpl.TaskQuartzImpl; +import com.evolveum.midpoint.task.quartzimpl.TaskQuartzImplUtil; import com.evolveum.midpoint.task.quartzimpl.cluster.ClusterStatusInformation; import com.evolveum.midpoint.util.MiscUtil; import com.evolveum.midpoint.util.exception.ObjectNotFoundException; @@ -30,13 +53,12 @@ import com.evolveum.midpoint.util.logging.LoggingUtils; import com.evolveum.midpoint.util.logging.Trace; import com.evolveum.midpoint.util.logging.TraceManager; -import com.evolveum.midpoint.xml.ns._public.common.common_3.*; - -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import org.quartz.*; - -import java.util.*; +import com.evolveum.midpoint.xml.ns._public.common.common_3.NodeType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.SchedulerInformationType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.TaskExecutionLimitationsType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.TaskExecutionStatusType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.TaskGroupExecutionLimitationType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.TaskType; /** * Manages task threads (clusterwide). Concerned mainly with stopping threads and querying their state. diff --git a/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/execution/HandlerExecutor.java b/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/execution/HandlerExecutor.java new file mode 100644 index 00000000000..4ee1c4c4ed1 --- /dev/null +++ b/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/execution/HandlerExecutor.java @@ -0,0 +1,205 @@ +/* + * Copyright (c) 2010-2018 Evolveum + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.evolveum.midpoint.task.quartzimpl.execution; + +import java.util.List; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import com.evolveum.midpoint.prism.PrismContext; +import com.evolveum.midpoint.prism.delta.ItemDelta; +import com.evolveum.midpoint.schema.result.OperationResult; +import com.evolveum.midpoint.task.api.Task; +import com.evolveum.midpoint.task.api.TaskHandler; +import com.evolveum.midpoint.task.api.TaskRunResult; +import com.evolveum.midpoint.task.api.TaskWorkBucketProcessingResult; +import com.evolveum.midpoint.task.api.WorkBucketAwareTaskHandler; +import com.evolveum.midpoint.task.api.TaskRunResult.TaskRunResultStatus; +import com.evolveum.midpoint.task.quartzimpl.TaskManagerQuartzImpl; +import com.evolveum.midpoint.task.quartzimpl.TaskQuartzImpl; +import com.evolveum.midpoint.task.quartzimpl.work.WorkStateManager; +import com.evolveum.midpoint.util.exception.ObjectAlreadyExistsException; +import com.evolveum.midpoint.util.exception.ObjectNotFoundException; +import com.evolveum.midpoint.util.exception.SchemaException; +import com.evolveum.midpoint.util.logging.LoggingUtils; +import com.evolveum.midpoint.util.logging.Trace; +import com.evolveum.midpoint.util.logging.TraceManager; +import com.evolveum.midpoint.xml.ns._public.common.common_3.TaskPartitionDefinitionType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.TaskType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.WorkBucketType; + +/** + * @author katka + * + */ +@Component +public class HandlerExecutor { + + private static final transient Trace LOGGER = TraceManager.getTrace(HandlerExecutor.class); + private static final String DOT_CLASS = HandlerExecutor.class.getName() + "."; + + private static final long FREE_BUCKET_WAIT_TIME = -1; // indefinitely + + @Autowired private PrismContext prismCtx; + @Autowired private TaskManagerQuartzImpl taskManagerImpl; + + + public TaskRunResult executeHandler(TaskQuartzImpl task, TaskPartitionDefinitionType partition, TaskHandler handler, OperationResult executionResult) { + + if (handler instanceof WorkBucketAwareTaskHandler) { + return executeWorkBucketAwareTaskHandler(task, partition, (WorkBucketAwareTaskHandler) handler, executionResult); + } + + return executePlainTaskHandler(task, partition, handler); + } + + private TaskRunResult executePlainTaskHandler(TaskQuartzImpl task, TaskPartitionDefinitionType partition, TaskHandler handler) { + TaskRunResult runResult; + try { + LOGGER.trace("Executing handler {}", handler.getClass().getName()); + runResult = handler.run(task, partition); + if (runResult == null) { // Obviously an error in task handler + LOGGER.error("Unable to record run finish: task returned null result"); + runResult = createFailureTaskRunResult(task, "Unable to record run finish: task returned null result", null); + } + } catch (Throwable t) { + LOGGER.error("Task handler threw unexpected exception: {}: {}; task = {}", t.getClass().getName(), t.getMessage(), task, t); + runResult = createFailureTaskRunResult(task, "Task handler threw unexpected exception: " + t.getMessage(), t); + } + return runResult; + } + + private TaskRunResult executeWorkBucketAwareTaskHandler(TaskQuartzImpl task, TaskPartitionDefinitionType taskPartition, WorkBucketAwareTaskHandler handler, OperationResult executionResult) { + WorkStateManager workStateManager = taskManagerImpl.getWorkStateManager(); + + if (task.getWorkState() != null && Boolean.TRUE.equals(task.getWorkState().isAllWorkComplete())) { + LOGGER.debug("Work is marked as complete; restarting it in task {}", task); + try { + List> itemDeltas = prismCtx.deltaFor(TaskType.class) + .item(TaskType.F_WORK_STATE).replace() + .asItemDeltas(); + task.applyDeltasImmediate(itemDeltas, executionResult); + } catch (SchemaException | ObjectAlreadyExistsException | ObjectNotFoundException | RuntimeException e) { + LoggingUtils.logUnexpectedException(LOGGER, "Couldn't remove work state from (completed) task {} -- continuing", e, task); + } + } + + boolean initialBucket = true; + TaskWorkBucketProcessingResult runResult = null; + for (;;) { + WorkBucketType bucket; + try { + try { + bucket = workStateManager.getWorkBucket(task.getOid(), FREE_BUCKET_WAIT_TIME, () -> task.canRun(), initialBucket, executionResult); + } catch (InterruptedException e) { + LOGGER.trace("InterruptedExecution in getWorkBucket for {}", task); + if (task.canRun()) { + throw new IllegalStateException("Unexpected InterruptedException: " + e.getMessage(), e); + } else { + return createInterruptedTaskRunResult(task); + } + } + } catch (Throwable t) { + LoggingUtils.logUnexpectedException(LOGGER, "Couldn't allocate a work bucket for task {} (coordinator {})", t, task, null); + return createFailureTaskRunResult(task, "Couldn't allocate a work bucket for task: " + t.getMessage(), t); + } + initialBucket = false; + if (bucket == null) { + LOGGER.trace("No (next) work bucket within {}, exiting", task); + runResult = handler.onNoMoreBuckets(task, runResult); + return runResult != null ? runResult : createSuccessTaskRunResult(task); + } + try { + LOGGER.trace("Executing handler {} with work bucket of {} for {}", handler.getClass().getName(), bucket, task); + runResult = handler.run(task, bucket, taskPartition, runResult); + LOGGER.trace("runResult is {} for {}", runResult, task); + if (runResult == null) { // Obviously an error in task handler + LOGGER.error("Unable to record run finish: task returned null result"); + //releaseWorkBucketChecked(bucket, executionResult); + return createFailureTaskRunResult(task, "Unable to record run finish: task returned null result", null); + } + } catch (Throwable t) { + LOGGER.error("Task handler threw unexpected exception: {}: {}; task = {}", t.getClass().getName(), t.getMessage(), task, t); + //releaseWorkBucketChecked(bucket, executionResult); + return createFailureTaskRunResult(task, "Task handler threw unexpected exception: " + t.getMessage(), t); + } + if (!runResult.isBucketComplete()) { + return runResult; + } + try { + taskManagerImpl.getWorkStateManager().completeWorkBucket(task.getOid(), bucket.getSequentialNumber(), executionResult); + } catch (ObjectAlreadyExistsException | ObjectNotFoundException | SchemaException | RuntimeException e) { + LoggingUtils.logUnexpectedException(LOGGER, "Couldn't complete work bucket for task {}", e, task); + return createFailureTaskRunResult(task, "Couldn't complete work bucket: " + e.getMessage(), e); + } + if (!task.canRun() || !runResult.isShouldContinue()) { + return runResult; + } + } + } + + private TaskRunResult createFailureTaskRunResult(TaskQuartzImpl task, String message, Throwable t) { + TaskRunResult runResult = new TaskRunResult(); + OperationResult opResult; + if (task.getResult() != null) { + opResult = task.getResult(); + } else { + opResult = createOperationResult(DOT_CLASS + "executeHandler"); + } + if (t != null) { + opResult.recordFatalError(message, t); + } else { + opResult.recordFatalError(message); + } + runResult.setOperationResult(opResult); + runResult.setRunResultStatus(TaskRunResultStatus.PERMANENT_ERROR); + return runResult; + } + + private TaskRunResult createSuccessTaskRunResult(TaskQuartzImpl task) { + TaskRunResult runResult = new TaskRunResult(); + OperationResult opResult; + if (task.getResult() != null) { + opResult = task.getResult(); + } else { + opResult = createOperationResult(DOT_CLASS + "executeHandler"); + } + opResult.recordSuccess(); + runResult.setOperationResult(opResult); + runResult.setRunResultStatus(TaskRunResultStatus.FINISHED); + return runResult; + } + + private TaskRunResult createInterruptedTaskRunResult(TaskQuartzImpl task) { + TaskRunResult runResult = new TaskRunResult(); + OperationResult opResult; + if (task.getResult() != null) { + opResult = task.getResult(); + } else { + opResult = createOperationResult(DOT_CLASS + "executeHandler"); + } + opResult.recordSuccess(); + runResult.setOperationResult(opResult); + runResult.setRunResultStatus(TaskRunResultStatus.INTERRUPTED); + return runResult; + } + + private OperationResult createOperationResult(String methodName) { + return new OperationResult(DOT_CLASS + methodName); + } + +} diff --git a/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/execution/JobExecutor.java b/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/execution/JobExecutor.java index 56b07df9f21..f1d681ee04d 100644 --- a/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/execution/JobExecutor.java +++ b/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/execution/JobExecutor.java @@ -74,7 +74,7 @@ public static void setTaskManagerQuartzImpl(TaskManagerQuartzImpl managerImpl) { private static final int DEFAULT_RESCHEDULE_TIME_FOR_GROUP_LIMIT = 60; private static final int RESCHEDULE_TIME_RANDOMIZATION_INTERVAL = 3; - private static final long FREE_BUCKET_WAIT_TIME = -1; // indefinitely + /* * JobExecutor is instantiated at each execution of the task, so we can store @@ -535,9 +535,8 @@ private void executeRecurrentTask(TaskHandler handler) { LOGGER.trace("CycleRunner loop: start"); - TaskRunResult runResult; recordCycleRunStart(executionResult, handler); - runResult = executeHandler(handler, executionResult); + TaskRunResult runResult = executeHandler(handler, executionResult); boolean canContinue = recordCycleRunFinish(runResult, handler, executionResult); if (!canContinue) { // in case of task disappeared break; @@ -658,101 +657,96 @@ private TaskRunResult executeHandler(TaskHandler handler, OperationResult execut task.setResultTransient(task.createUnnamedTaskResult()); } - TaskRunResult runResult; - if (handler instanceof WorkBucketAwareTaskHandler) { - runResult = executeWorkBucketAwareTaskHandler((WorkBucketAwareTaskHandler) handler, executionResult); - } else { - runResult = executePlainTaskHandler(handler); - } + TaskRunResult runResult = taskManagerImpl.getHandlerExecutor().executeHandler(task, null, handler, executionResult); - waitForTransientChildrenAndCloseThem(executionResult); + waitForTransientChildrenAndCloseThem(executionResult); return runResult; } - - private TaskRunResult executePlainTaskHandler(TaskHandler handler) { - TaskRunResult runResult; - try { - LOGGER.trace("Executing handler {}", handler.getClass().getName()); - runResult = handler.run(task); - if (runResult == null) { // Obviously an error in task handler - LOGGER.error("Unable to record run finish: task returned null result"); - runResult = createFailureTaskRunResult("Unable to record run finish: task returned null result", null); - } - } catch (Throwable t) { - LOGGER.error("Task handler threw unexpected exception: {}: {}; task = {}", t.getClass().getName(), t.getMessage(), task, t); - runResult = createFailureTaskRunResult("Task handler threw unexpected exception: " + t.getMessage(), t); - } - return runResult; - } - - private TaskRunResult executeWorkBucketAwareTaskHandler(WorkBucketAwareTaskHandler handler, OperationResult executionResult) { - WorkStateManager workStateManager = taskManagerImpl.getWorkStateManager(); - - if (task.getWorkState() != null && Boolean.TRUE.equals(task.getWorkState().isAllWorkComplete())) { - LOGGER.debug("Work is marked as complete; restarting it in task {}", task); - try { - List> itemDeltas = taskManagerImpl.getPrismContext().deltaFor(TaskType.class) - .item(TaskType.F_WORK_STATE).replace() - .asItemDeltas(); - task.applyDeltasImmediate(itemDeltas, executionResult); - } catch (SchemaException | ObjectAlreadyExistsException | ObjectNotFoundException | RuntimeException e) { - LoggingUtils.logUnexpectedException(LOGGER, "Couldn't remove work state from (completed) task {} -- continuing", e, task); - } - } - - boolean initialBucket = true; - TaskWorkBucketProcessingResult runResult = null; - for (;;) { - WorkBucketType bucket; - try { - try { - bucket = workStateManager.getWorkBucket(task.getOid(), FREE_BUCKET_WAIT_TIME, () -> task.canRun(), initialBucket, executionResult); - } catch (InterruptedException e) { - LOGGER.trace("InterruptedExecution in getWorkBucket for {}", task); - if (task.canRun()) { - throw new IllegalStateException("Unexpected InterruptedException: " + e.getMessage(), e); - } else { - return createInterruptedTaskRunResult(); - } - } - } catch (Throwable t) { - LoggingUtils.logUnexpectedException(LOGGER, "Couldn't allocate a work bucket for task {} (coordinator {})", t, task, null); - return createFailureTaskRunResult("Couldn't allocate a work bucket for task: " + t.getMessage(), t); - } - initialBucket = false; - if (bucket == null) { - LOGGER.trace("No (next) work bucket within {}, exiting", task); - runResult = handler.onNoMoreBuckets(task, runResult); - return runResult != null ? runResult : createSuccessTaskRunResult(); - } - try { - LOGGER.trace("Executing handler {} with work bucket of {} for {}", handler.getClass().getName(), bucket, task); - runResult = handler.run(task, bucket, runResult); - LOGGER.trace("runResult is {} for {}", runResult, task); - if (runResult == null) { // Obviously an error in task handler - LOGGER.error("Unable to record run finish: task returned null result"); - //releaseWorkBucketChecked(bucket, executionResult); - return createFailureTaskRunResult("Unable to record run finish: task returned null result", null); - } - } catch (Throwable t) { - LOGGER.error("Task handler threw unexpected exception: {}: {}; task = {}", t.getClass().getName(), t.getMessage(), task, t); - //releaseWorkBucketChecked(bucket, executionResult); - return createFailureTaskRunResult("Task handler threw unexpected exception: " + t.getMessage(), t); - } - if (!runResult.isBucketComplete()) { - return runResult; - } - try { - taskManagerImpl.getWorkStateManager().completeWorkBucket(task.getOid(), bucket.getSequentialNumber(), executionResult); - } catch (ObjectAlreadyExistsException | ObjectNotFoundException | SchemaException | RuntimeException e) { - LoggingUtils.logUnexpectedException(LOGGER, "Couldn't complete work bucket for task {}", e, task); - return createFailureTaskRunResult("Couldn't complete work bucket: " + e.getMessage(), e); - } - if (!task.canRun() || !runResult.isShouldContinue()) { - return runResult; - } - } - } +// +// private TaskRunResult executePlainTaskHandler(TaskHandler handler) { +// TaskRunResult runResult; +// try { +// LOGGER.trace("Executing handler {}", handler.getClass().getName()); +// runResult = handler.run(task); +// if (runResult == null) { // Obviously an error in task handler +// LOGGER.error("Unable to record run finish: task returned null result"); +// runResult = createFailureTaskRunResult("Unable to record run finish: task returned null result", null); +// } +// } catch (Throwable t) { +// LOGGER.error("Task handler threw unexpected exception: {}: {}; task = {}", t.getClass().getName(), t.getMessage(), task, t); +// runResult = createFailureTaskRunResult("Task handler threw unexpected exception: " + t.getMessage(), t); +// } +// return runResult; +// } +// +// private TaskRunResult executeWorkBucketAwareTaskHandler(WorkBucketAwareTaskHandler handler, OperationResult executionResult) { +// WorkStateManager workStateManager = taskManagerImpl.getWorkStateManager(); +// +// if (task.getWorkState() != null && Boolean.TRUE.equals(task.getWorkState().isAllWorkComplete())) { +// LOGGER.debug("Work is marked as complete; restarting it in task {}", task); +// try { +// List> itemDeltas = taskManagerImpl.getPrismContext().deltaFor(TaskType.class) +// .item(TaskType.F_WORK_STATE).replace() +// .asItemDeltas(); +// task.applyDeltasImmediate(itemDeltas, executionResult); +// } catch (SchemaException | ObjectAlreadyExistsException | ObjectNotFoundException | RuntimeException e) { +// LoggingUtils.logUnexpectedException(LOGGER, "Couldn't remove work state from (completed) task {} -- continuing", e, task); +// } +// } +// +// boolean initialBucket = true; +// TaskWorkBucketProcessingResult runResult = null; +// for (;;) { +// WorkBucketType bucket; +// try { +// try { +// bucket = workStateManager.getWorkBucket(task.getOid(), FREE_BUCKET_WAIT_TIME, () -> task.canRun(), initialBucket, executionResult); +// } catch (InterruptedException e) { +// LOGGER.trace("InterruptedExecution in getWorkBucket for {}", task); +// if (task.canRun()) { +// throw new IllegalStateException("Unexpected InterruptedException: " + e.getMessage(), e); +// } else { +// return createInterruptedTaskRunResult(); +// } +// } +// } catch (Throwable t) { +// LoggingUtils.logUnexpectedException(LOGGER, "Couldn't allocate a work bucket for task {} (coordinator {})", t, task, null); +// return createFailureTaskRunResult("Couldn't allocate a work bucket for task: " + t.getMessage(), t); +// } +// initialBucket = false; +// if (bucket == null) { +// LOGGER.trace("No (next) work bucket within {}, exiting", task); +// runResult = handler.onNoMoreBuckets(task, runResult); +// return runResult != null ? runResult : createSuccessTaskRunResult(); +// } +// try { +// LOGGER.trace("Executing handler {} with work bucket of {} for {}", handler.getClass().getName(), bucket, task); +// runResult = handler.run(task, bucket, runResult); +// LOGGER.trace("runResult is {} for {}", runResult, task); +// if (runResult == null) { // Obviously an error in task handler +// LOGGER.error("Unable to record run finish: task returned null result"); +// //releaseWorkBucketChecked(bucket, executionResult); +// return createFailureTaskRunResult("Unable to record run finish: task returned null result", null); +// } +// } catch (Throwable t) { +// LOGGER.error("Task handler threw unexpected exception: {}: {}; task = {}", t.getClass().getName(), t.getMessage(), task, t); +// //releaseWorkBucketChecked(bucket, executionResult); +// return createFailureTaskRunResult("Task handler threw unexpected exception: " + t.getMessage(), t); +// } +// if (!runResult.isBucketComplete()) { +// return runResult; +// } +// try { +// taskManagerImpl.getWorkStateManager().completeWorkBucket(task.getOid(), bucket.getSequentialNumber(), executionResult); +// } catch (ObjectAlreadyExistsException | ObjectNotFoundException | SchemaException | RuntimeException e) { +// LoggingUtils.logUnexpectedException(LOGGER, "Couldn't complete work bucket for task {}", e, task); +// return createFailureTaskRunResult("Couldn't complete work bucket: " + e.getMessage(), e); +// } +// if (!task.canRun() || !runResult.isShouldContinue()) { +// return runResult; +// } +// } +// } // private void releaseWorkBucketChecked(AbstractWorkBucketType bucket, OperationResult executionResult) { // try { @@ -762,53 +756,6 @@ private TaskRunResult executeWorkBucketAwareTaskHandler(WorkBucketAwareTaskHandl // } // } - private TaskRunResult createFailureTaskRunResult(String message, Throwable t) { - TaskRunResult runResult = new TaskRunResult(); - OperationResult opResult; - if (task.getResult() != null) { - opResult = task.getResult(); - } else { - opResult = createOperationResult(DOT_CLASS + "executeHandler"); - } - if (t != null) { - opResult.recordFatalError(message, t); - } else { - opResult.recordFatalError(message); - } - runResult.setOperationResult(opResult); - runResult.setRunResultStatus(TaskRunResultStatus.PERMANENT_ERROR); - return runResult; - } - - private TaskRunResult createSuccessTaskRunResult() { - TaskRunResult runResult = new TaskRunResult(); - OperationResult opResult; - if (task.getResult() != null) { - opResult = task.getResult(); - } else { - opResult = createOperationResult(DOT_CLASS + "executeHandler"); - } - opResult.recordSuccess(); - runResult.setOperationResult(opResult); - runResult.setRunResultStatus(TaskRunResultStatus.FINISHED); - return runResult; - } - - private TaskRunResult createInterruptedTaskRunResult() { - TaskRunResult runResult = new TaskRunResult(); - OperationResult opResult; - if (task.getResult() != null) { - opResult = task.getResult(); - } else { - opResult = createOperationResult(DOT_CLASS + "executeHandler"); - } - opResult.recordSuccess(); - runResult.setOperationResult(opResult); - runResult.setRunResultStatus(TaskRunResultStatus.INTERRUPTED); - return runResult; - } - - private OperationResult createOperationResult(String methodName) { return new OperationResult(DOT_CLASS + methodName); } diff --git a/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/handlers/JdbcPingTaskHandler.java b/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/handlers/JdbcPingTaskHandler.java index 88ef16de576..eb1fe96d059 100644 --- a/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/handlers/JdbcPingTaskHandler.java +++ b/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/handlers/JdbcPingTaskHandler.java @@ -26,6 +26,8 @@ import com.evolveum.midpoint.util.logging.LoggingUtils; import com.evolveum.midpoint.util.logging.Trace; import com.evolveum.midpoint.util.logging.TraceManager; +import com.evolveum.midpoint.xml.ns._public.common.common_3.TaskPartitionDefinitionType; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @@ -84,7 +86,7 @@ public String toString() { } @Override - public TaskRunResult run(Task task) { + public TaskRunResult run(Task task, TaskPartitionDefinitionType partition) { OperationResult opResult = new OperationResult(JdbcPingTaskHandler.class.getName()+".run"); diff --git a/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/handlers/LightweigthPartitioningTaskHandler.java b/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/handlers/LightweigthPartitioningTaskHandler.java new file mode 100644 index 00000000000..93a45f961be --- /dev/null +++ b/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/handlers/LightweigthPartitioningTaskHandler.java @@ -0,0 +1,179 @@ +/* + * Copyright (c) 2010-2018 Evolveum + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.evolveum.midpoint.task.quartzimpl.handlers; + +import java.util.Comparator; +import java.util.List; + +import javax.annotation.PostConstruct; + +import org.apache.commons.lang.Validate; +import org.jetbrains.annotations.NotNull; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import com.evolveum.midpoint.prism.PrismContext; +import com.evolveum.midpoint.schema.result.OperationResult; +import com.evolveum.midpoint.task.api.StatisticsCollectionStrategy; +import com.evolveum.midpoint.task.api.Task; +import com.evolveum.midpoint.task.api.TaskConstants; +import com.evolveum.midpoint.task.api.TaskHandler; +import com.evolveum.midpoint.task.api.TaskManager; +import com.evolveum.midpoint.task.api.TaskRunResult; +import com.evolveum.midpoint.task.api.TaskRunResult.TaskRunResultStatus; +import com.evolveum.midpoint.task.quartzimpl.TaskManagerQuartzImpl; +import com.evolveum.midpoint.task.quartzimpl.TaskQuartzImpl; +import com.evolveum.midpoint.task.quartzimpl.execution.HandlerExecutor; +import com.evolveum.midpoint.util.logging.Trace; +import com.evolveum.midpoint.util.logging.TraceManager; +import com.evolveum.midpoint.xml.ns._public.common.common_3.TaskPartitionDefinitionType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.TaskPartitionsDefinitionType; + +/** + * @author katka + * + */ +@Component +public class LightweigthPartitioningTaskHandler implements TaskHandler { + + private static final transient Trace LOGGER = TraceManager.getTrace(LightweigthPartitioningTaskHandler.class); + + private static final String HANDLER_URI = TaskConstants.LIGHTWEIGTH_PARTITIONING_TASK_HANDLER_URI; + + @Autowired private PrismContext prismContext; + @Autowired private TaskManagerQuartzImpl taskManager; + @Autowired private HandlerExecutor handlerExecutor; +// @Autowired private TaskManager taskManager; + + + @PostConstruct + private void initialize() { + taskManager.registerHandler(HANDLER_URI, this); + } + + public TaskRunResult run(Task task, TaskPartitionDefinitionType taskPartition) { + OperationResult opResult = new OperationResult(LightweigthPartitioningTaskHandler.class.getName()+".run"); + TaskRunResult runResult = new TaskRunResult(); + + runResult.setProgress(task.getProgress()); + runResult.setOperationResult(opResult); + + + TaskPartitionsDefinitionType partitionsDefinition = task.getWorkManagement().getPartitions(); + List partitions = partitionsDefinition.getPartition(); + Comparator comparator = + (partition1, partition2) -> { + + Validate.notNull(partition1); + Validate.notNull(partition2); + + Integer index1 = partition1.getIndex(); + Integer index2 = partition2.getIndex(); + + if (index1 == null) { + if (index2 == null) { + return 0; + } + return -1; + } + + if (index2 == null) { + return -1; + } + + return index1.compareTo(index2); + }; + + partitions.sort(comparator); + for (TaskPartitionDefinitionType partition : partitions) { + TaskHandler handler = taskManager.getHandler(partition.getHandlerUri()); + TaskRunResult subHandlerResult = handlerExecutor.executeHandler((TaskQuartzImpl) task, partition, handler, opResult); +// TaskRunResult subHandlerResult = handler.run(task, partition); + OperationResult subHandlerOpResult = subHandlerResult.getOperationResult(); + opResult.addSubresult(subHandlerOpResult); + if (subHandlerResult != null) { + runResult = subHandlerResult; + runResult.setProgress(task.getProgress()); + } + + if (!canContinue(task, subHandlerResult)) { + break; + } + + if (subHandlerOpResult.isError()) { + break; + } + } + + runResult.setProgress(runResult.getProgress() + 1); + opResult.computeStatusIfUnknown(); + + return runResult; + } + + private boolean canContinue(Task task, TaskRunResult runResult) { + if (!task.canRun() || runResult.getRunResultStatus() == TaskRunResultStatus.INTERRUPTED) { + // first, if a task was interrupted, we do not want to change its status + LOGGER.trace("Task was interrupted, exiting the execution cycle. Task = {}", task); + return true; + } else if (runResult.getRunResultStatus() == TaskRunResultStatus.TEMPORARY_ERROR) { + LOGGER.trace("Task encountered temporary error, continuing with the execution cycle. Task = {}", task); + return false; + } else if (runResult.getRunResultStatus() == TaskRunResultStatus.RESTART_REQUESTED) { + // in case of RESTART_REQUESTED we have to get (new) current handler and restart it + // this is implemented by pushHandler and by Quartz + LOGGER.trace("Task returned RESTART_REQUESTED state, exiting the execution cycle. Task = {}", task); + return true; + } else if (runResult.getRunResultStatus() == TaskRunResultStatus.PERMANENT_ERROR) { + LOGGER.info("Task encountered permanent error, suspending the task. Task = {}", task); + return false; + } else if (runResult.getRunResultStatus() == TaskRunResultStatus.FINISHED) { + LOGGER.trace("Task handler finished, continuing with the execution cycle. Task = {}", task); + return true; + } else if (runResult.getRunResultStatus() == TaskRunResultStatus.IS_WAITING) { + LOGGER.trace("Task switched to waiting state, exiting the execution cycle. Task = {}", task); + return true; + } else if (runResult.getRunResultStatus() == TaskRunResultStatus.FINISHED_HANDLER) { + LOGGER.trace("Task handler finished with FINISHED_HANDLER, calling task.finishHandler() and exiting the execution cycle. Task = {}", task); + return true; + } else { + throw new IllegalStateException("Invalid value for Task's runResultStatus: " + runResult.getRunResultStatus() + " for task " + task); + } + } + + @NotNull + @Override + public StatisticsCollectionStrategy getStatisticsCollectionStrategy() { + return new StatisticsCollectionStrategy() + .fromZero() + .maintainIterationStatistics() + .maintainSynchronizationStatistics() + .maintainActionsExecutedStatistics(); + } + + @Override + public String getCategoryName(Task task) { + // TODO Auto-generated method stub + return null; + }; + + +// private void processErrorCriticality(Task task, TaskPartitionDefinitionType partitionDefinition, Throwable ex, OperationResult result) throws ObjectNotFoundException, CommunicationException, SchemaException, ConfigurationException, SecurityViolationException, PolicyViolationException, ExpressionEvaluationException, ObjectAlreadyExistsException, PreconditionViolationException { +// CriticalityType criticality = ExceptionUtil.getCriticality(partitionDefinition.getErrorCriticality(), ex, CriticalityType.PARTIAL); +// RepoCommonUtils.processErrorCriticality(task.getTaskType(), criticality, ex, result); +// +// } +} diff --git a/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/handlers/NoOpTaskHandler.java b/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/handlers/NoOpTaskHandler.java index d15eb44f9cf..b2c1a7df007 100644 --- a/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/handlers/NoOpTaskHandler.java +++ b/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/handlers/NoOpTaskHandler.java @@ -29,6 +29,7 @@ import com.evolveum.midpoint.util.logging.Trace; import com.evolveum.midpoint.util.logging.TraceManager; import com.evolveum.midpoint.xml.ns._public.common.common_3.NumericIntervalWorkBucketContentType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.TaskPartitionDefinitionType; import com.evolveum.midpoint.xml.ns._public.common.common_3.WorkBucketType; /** @@ -58,7 +59,7 @@ public static void instantiateAndRegister(TaskManagerQuartzImpl taskManager) { @Override public TaskWorkBucketProcessingResult run(Task task, WorkBucketType workBucket, - TaskWorkBucketProcessingResult previousRunResult) { + TaskPartitionDefinitionType taskPartition, TaskWorkBucketProcessingResult previousRunResult) { String partition = task.getHandlerUri().substring(TaskConstants.NOOP_TASK_HANDLER_URI.length()); // empty or #1..#4 diff --git a/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/handlers/PartitioningTaskHandler.java b/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/handlers/PartitioningTaskHandler.java index cde2eba1a2b..e8006d8c316 100644 --- a/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/handlers/PartitioningTaskHandler.java +++ b/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/handlers/PartitioningTaskHandler.java @@ -62,7 +62,7 @@ public PartitioningTaskHandler(TaskManagerQuartzImpl taskManager, Function resourceOpenDj; + protected int getDefaultUsers() { + return 6; + } - private static int defaultLdapUsers = 3; @Override protected void startResources() throws Exception { @@ -97,6 +85,20 @@ public static void stopResources() throws Exception { openDJController.stop(); } + protected abstract File getTaskFile(); + protected abstract String getTaskOid(); + protected abstract int getProcessedUsers(); + protected abstract void assertSynchronizationStatisticsAfterImport(Task syncInfo) throws Exception; + + + protected void assertSynchronizationStatisticsActivation(Task taskAfter) { + assertEquals(taskAfter.getStoredOperationStats().getSynchronizationInformation().getCountUnmatched(), 5); + assertEquals(taskAfter.getStoredOperationStats().getSynchronizationInformation().getCountDeleted(), 0); + assertEquals(taskAfter.getStoredOperationStats().getSynchronizationInformation().getCountLinked(), getDefaultUsers()); + assertEquals(taskAfter.getStoredOperationStats().getSynchronizationInformation().getCountUnlinked(), 0); + } + + @Override public void initSystem(Task initTask, OperationResult initResult) throws Exception { super.initSystem(initTask, initResult); @@ -107,9 +109,50 @@ public void initSystem(Task initTask, OperationResult initResult) throws Excepti repoAddObjectFromFile(ROLE_POLICY_RULE_CREATE_FILE, initResult); repoAddObjectFromFile(ROLE_POLICY_RULE_CHANGE_ACTIVATION_FILE, initResult); + + repoAddObjectFromFile(getTaskFile(), initResult); + } + + + @Test + public void test001testImportBaseUsers() throws Exception { + final String TEST_NAME = "test001testImportBaseUsers"; + displayTestTitle(TEST_NAME); + OperationResult result = new OperationResult(TEST_NAME); - repoAddObjectFromFile(TASK_RECONCILE_OPENDJ_FILE, initResult); - + importObjectFromFile(TASK_IMPORT_BASE_USERS_FILE); + + openDJController.addEntriesFromLdifFile(LDIF_CREATE_BASE_USERS_FILE); + + waitForTaskFinish(TASK_IMPORT_BASE_USERS_OID, true, 30000); + +// waitForTaskNextRun(TASK_IMPORT_BASE_USERS_OID, true, 20000, true); + + Task taskAfter = taskManager.getTaskWithResult(TASK_IMPORT_BASE_USERS_OID, result); + display("Task after test001testImportBaseUsers:", taskAfter); + + OperationStatsType stats = taskAfter.getStoredOperationStats(); + assertNotNull(stats, "No statistics in task"); + + SynchronizationInformationType syncInfo = stats.getSynchronizationInformation(); + assertNotNull(syncInfo, "No sync info in task"); + + assertEquals(syncInfo.getCountUnmatched(), getDefaultUsers()); + assertEquals(syncInfo.getCountDeleted(), 0); + assertEquals(syncInfo.getCountLinked(), 0); + assertEquals(syncInfo.getCountUnlinked(), 0); + + assertEquals(syncInfo.getCountUnmatchedAfter(), 0); + assertEquals(syncInfo.getCountDeletedAfter(), 0); + assertEquals(syncInfo.getCountLinkedAfter(), getDefaultUsers()); + assertEquals(syncInfo.getCountUnlinkedAfter(), 0); + + assertUsers(getNumberOfUsers()); + } + + @Override + protected int getNumberOfUsers() { + return super.getNumberOfUsers() + getDefaultUsers(); } @Test @@ -120,112 +163,66 @@ public void test100assignPolicyRuleCreateToTask() throws Exception { // WHEN Task task = taskManager.createTaskInstance(TEST_NAME); OperationResult result = task.getResult(); - assignRole(TaskType.class, TASK_RECONCILE_OPENDJ_OID, ROLE_POLICY_RULE_CREATE_OID, task, result); + assignRole(TaskType.class, getTaskOid(), ROLE_POLICY_RULE_CREATE_OID, task, result); //THEN - PrismObject taskAfter = getObject(TaskType.class, TASK_RECONCILE_OPENDJ_OID); + PrismObject taskAfter = getObject(TaskType.class, getTaskOid()); display("Task after:", taskAfter); assertAssignments(taskAfter, 1); assertAssigned(taskAfter, ROLE_POLICY_RULE_CREATE_OID, RoleType.COMPLEX_TYPE); - assertTaskExecutionStatus(TASK_RECONCILE_OPENDJ_OID, TaskExecutionStatus.SUSPENDED); + assertTaskExecutionStatus(getTaskOid(), TaskExecutionStatus.SUSPENDED); } @Test - public void test110importAccountsSimulate() throws Exception { + public void test110importAccounts() throws Exception { final String TEST_NAME = "test110importAccountsSimulate"; displayTestTitle(TEST_NAME); + + Task task = taskManager.createTaskInstance(TEST_NAME); + OperationResult result = task.getResult(); +// executeChanges(DeltaBuilder.deltaFor(TaskType.class, prismContext) +// .item(TaskType.F_EXECUTION_STATUS) +// .replace(TaskExecutionStatusType.RUNNABLE) +// .asObjectDelta(getTaskOid()), null, task, result); openDJController.addEntriesFromLdifFile(LDIF_CREATE_USERS_FILE); - Task task = taskManager.createTaskInstance(TEST_NAME); - OperationResult result = task.getResult(); - executeChanges(DeltaBuilder.deltaFor(TaskType.class, prismContext) - .item(TaskType.F_EXECUTION_STATUS) - .replace(TaskExecutionStatusType.RUNNABLE) - .asObjectDelta(TASK_RECONCILE_OPENDJ_OID), null, task, result); + assertUsers(getNumberOfUsers()); //WHEN displayWhen(TEST_NAME); - OperationResult reconResult = waitForTaskNextRun(TASK_RECONCILE_OPENDJ_OID, false, 20000, true); + OperationResult reconResult = waitForTaskResume(getTaskOid(), false, 20000); assertFailure(reconResult); //THEN - assertUsers(getNumberOfUsers()); - assertTaskExecutionStatus(TASK_RECONCILE_OPENDJ_OID, TaskExecutionStatus.SUSPENDED); + assertUsers(getProcessedUsers() + getNumberOfUsers()); + assertTaskExecutionStatus(getTaskOid(), TaskExecutionStatus.SUSPENDED); - Task taskAfter = taskManager.getTaskWithResult(TASK_RECONCILE_OPENDJ_OID, result); - IterativeTaskInformationType infoType = taskAfter.getStoredOperationStats().getIterativeTaskInformation(); - assertEquals(infoType.getTotalFailureCount(), 1); + Task taskAfter = taskManager.getTaskWithResult(getTaskOid(), result); + assertSynchronizationStatisticsAfterImport(taskAfter); - assertEquals(taskAfter.getStoredOperationStats().getSynchronizationInformation().getCountUnmatched(), 5); - assertEquals(taskAfter.getStoredOperationStats().getSynchronizationInformation().getCountDeleted(), 0); - assertEquals(taskAfter.getStoredOperationStats().getSynchronizationInformation().getCountLinked(), 0); - assertEquals(taskAfter.getStoredOperationStats().getSynchronizationInformation().getCountUnlinked(), 0); } - @Test - public void test120changeReconTaskFull() throws Exception { - final String TEST_NAME = "test120changeReconTaskFull"; + public void test500chageTaskPolicyRule() throws Exception { + final String TEST_NAME = "test500chageTaskPolicyRule"; displayTestTitle(TEST_NAME); - assertUsers(getNumberOfUsers()); - - // WHEN - displayWhen(TEST_NAME); - - Task task = taskManager.createTaskInstance(TEST_NAME); - OperationResult result = task.getResult(); - PrismObject taskBefore = getObject(TaskType.class, TASK_RECONCILE_OPENDJ_OID); - TaskType taskTypeBefore = taskBefore.asObjectable(); - List stages = taskTypeBefore.getStage(); - TaskStageType simulateStage = null; - for (TaskStageType stage : stages) { - if (ReconciliationTaskHandler.SIMULATE_URI.equals(stage.getStage())) { - simulateStage = stage; - break; - } - } - modifyObjectDeleteContainer(TaskType.class, TASK_RECONCILE_OPENDJ_OID, new ItemName(TaskType.F_STAGE), task, result, simulateStage.clone()); - - // THEN - displayThen(TEST_NAME); - - PrismObject taskAfter = getObject(TaskType.class, TASK_RECONCILE_OPENDJ_OID); - assertNotNull(taskAfter, "Task not found"); - - TaskType taskTypeAfter = taskAfter.asObjectable(); - List stagesAfter = taskTypeAfter.getStage(); - assertEquals(stagesAfter.size(), 1, "Unexpected number of stages"); - - TaskStageType stageAfter = stagesAfter.iterator().next(); - assertEquals(ReconciliationTaskHandler.EXECUTE_URI, stageAfter.getStage(), "Unexpected stage."); - assertTaskExecutionStatus(TASK_RECONCILE_OPENDJ_OID, TaskExecutionStatus.SUSPENDED); - - - } - - @Test - public void test510importFourAccounts() throws Exception { - final String TEST_NAME = "test510importFourAccounts"; - displayTestTitle(TEST_NAME); - - //GIVEN - Task task = taskManager.createTaskInstance(TEST_NAME); - OperationResult result = task.getResult(); - modifyObjectReplaceProperty(TaskType.class, TASK_RECONCILE_OPENDJ_OID, TaskType.F_EXECUTION_STATUS, task, result, TaskExecutionStatusType.RUNNABLE); - //WHEN - displayWhen(TEST_NAME); - OperationResult reconResult = waitForTaskNextRun(TASK_RECONCILE_OPENDJ_OID, false, 20000, true); - assertFailure(reconResult); + Task task = taskManager.createTaskInstance(TEST_NAME); + OperationResult result = task.getResult(); + unassignRole(TaskType.class, getTaskOid(), ROLE_POLICY_RULE_CREATE_OID, task, result); + assignRole(TaskType.class, getTaskOid(), ROLE_POLICY_RULE_CHANGE_ACTIVATION_OID, task, result); //THEN - assertUsers(getNumberOfUsers() + 4); - assertTaskExecutionStatus(TASK_RECONCILE_OPENDJ_OID, TaskExecutionStatus.SUSPENDED); + PrismObject taskAfter = getObject(TaskType.class, getTaskOid()); + display("Task after:", taskAfter); + assertAssignments(taskAfter, 1); + assertAssigned(taskAfter, ROLE_POLICY_RULE_CHANGE_ACTIVATION_OID, RoleType.COMPLEX_TYPE); + assertTaskExecutionStatus(getTaskOid(), TaskExecutionStatus.SUSPENDED); } @@ -233,32 +230,24 @@ public void test510importFourAccounts() throws Exception { public void test520changeActivationThreeAccounts() throws Exception { final String TEST_NAME = "test520changeActivationThreeAccounts"; displayTestTitle(TEST_NAME); + OperationResult result = new OperationResult(TEST_NAME); //GIVEN - Task task = taskManager.createTaskInstance(TEST_NAME); - OperationResult result = task.getResult(); - unassignRole(TaskType.class, TASK_RECONCILE_OPENDJ_OID, ROLE_POLICY_RULE_CREATE_OID, task, result); - assignRole(TaskType.class, TASK_RECONCILE_OPENDJ_OID, ROLE_POLICY_RULE_CHANGE_ACTIVATION_OID, task, result); - openDJController.executeLdifChange(LDIF_CHANGE_ACTIVATION_FILE); //WHEN displayWhen(TEST_NAME); - OperationResult reconResult = waitForTaskNextRun(TASK_RECONCILE_OPENDJ_OID, false, 20000, true); + OperationResult reconResult = waitForTaskNextRun(getTaskOid(), false, 20000, true); assertFailure(reconResult); //THEN - Task taskAfter = taskManager.getTaskWithResult(TASK_RECONCILE_OPENDJ_OID, result); -// recotaskAfternTask.getStoredOperationStats().getSynchronizationInformation().getCountLinked(); + Task taskAfter = taskManager.getTaskWithResult(getTaskOid(), result); - assertTaskExecutionStatus(TASK_RECONCILE_OPENDJ_OID, TaskExecutionStatus.SUSPENDED); - assertUsers(getNumberOfUsers() + 4); + assertTaskExecutionStatus(getTaskOid(), TaskExecutionStatus.SUSPENDED); + assertUsers(getNumberOfUsers() + getProcessedUsers()); -// assertEquals(taskAfter.getStoredOperationStats().getSynchronizationInformation().getCountUnmatched(), 4); -// assertEquals(taskAfter.getStoredOperationStats().getSynchronizationInformation().getCountDeleted(), 0); -// assertEquals(taskAfter.getStoredOperationStats().getSynchronizationInformation().getCountLinked(), 0); -// assertEquals(taskAfter.getStoredOperationStats().getSynchronizationInformation().getCountUnlinked(), 0); + assertSynchronizationStatisticsActivation(taskAfter); } diff --git a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestThresholdsLiveSyncFull.java b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestThresholdsLiveSyncFull.java new file mode 100644 index 00000000000..e95fbd113b4 --- /dev/null +++ b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestThresholdsLiveSyncFull.java @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2010-2018 Evolveum + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.evolveum.midpoint.testing.story; + +import static org.testng.Assert.assertEquals; + +import java.io.File; + +import com.evolveum.midpoint.task.api.Task; +import com.evolveum.midpoint.xml.ns._public.common.common_3.IterativeTaskInformationType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.SynchronizationInformationType; + +/** + * @author katka + * + */ +public class TestThresholdsLiveSyncFull extends TestThresholds { + + private static final File TASK_LIVESYNC_OPENDJ_FULL_FILE = new File(TEST_DIR, "task-opendj-livesync-full.xml"); + private static final String TASK_LIVESYNC_OPENDJ_FULL_OID = "10335c7c-838f-11e8-93a6-4b1dd0ab58e4"; + + + @Override + protected File getTaskFile() { + return TASK_LIVESYNC_OPENDJ_FULL_FILE; + } + + @Override + protected String getTaskOid() { + return TASK_LIVESYNC_OPENDJ_FULL_OID; + } + + @Override + protected int getProcessedUsers() { + return 4; + } + + @Override + protected void assertSynchronizationStatisticsAfterImport(Task taskAfter) throws Exception { + SynchronizationInformationType syncInfo = taskAfter.getStoredOperationStats().getSynchronizationInformation(); + + assertSyncToken(taskAfter, 8, taskAfter.getResult()); + + assertEquals(syncInfo.getCountUnmatched(), 5); + assertEquals(syncInfo.getCountDeleted(), 0); + assertEquals(syncInfo.getCountLinked(), 0); + assertEquals(syncInfo.getCountUnlinked(), 0); + + assertEquals(syncInfo.getCountUnmatchedAfter(), 0); + assertEquals(syncInfo.getCountDeletedAfter(), 0); + assertEquals(syncInfo.getCountLinkedAfter(), getProcessedUsers()); + assertEquals(syncInfo.getCountUnlinkedAfter(), 0); + + } + + protected void assertSynchronizationStatisticsActivation(Task taskAfter) { + assertEquals(taskAfter.getStoredOperationStats().getSynchronizationInformation().getCountUnmatched(), 5); + assertEquals(taskAfter.getStoredOperationStats().getSynchronizationInformation().getCountDeleted(), 0); + assertEquals(taskAfter.getStoredOperationStats().getSynchronizationInformation().getCountLinked(), 0); + assertEquals(taskAfter.getStoredOperationStats().getSynchronizationInformation().getCountUnlinked(), 0); + } +} diff --git a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestThresholdsLiveSyncSimulate.java b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestThresholdsLiveSyncSimulate.java new file mode 100644 index 00000000000..b062d15baf8 --- /dev/null +++ b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestThresholdsLiveSyncSimulate.java @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2010-2018 Evolveum + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.evolveum.midpoint.testing.story; + +import static org.testng.Assert.assertEquals; + +import java.io.File; + +import com.evolveum.midpoint.task.api.Task; +import com.evolveum.midpoint.xml.ns._public.common.common_3.IterativeTaskInformationType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.SynchronizationInformationType; + +/** + * @author katka + * + */ +public class TestThresholdsLiveSyncSimulate extends TestThresholds { + + private static final File TASK_LIVESYNC_OPENDJ_SIMULATE_FILE = new File(TEST_DIR, "task-opendj-livesync-simulate.xml"); + private static final String TASK_LIVESYNC_OPENDJ_SIMULATE_OID = "10335c7c-838f-11e8-93a6-4b1dd0ab58e4"; + + + @Override + protected File getTaskFile() { + return TASK_LIVESYNC_OPENDJ_SIMULATE_FILE; + } + + @Override + protected String getTaskOid() { + return TASK_LIVESYNC_OPENDJ_SIMULATE_OID; + } + + @Override + protected int getProcessedUsers() { + return 0; + } + + @Override + protected void assertSynchronizationStatisticsAfterImport(Task taskAfter) throws Exception { + SynchronizationInformationType syncInfo = taskAfter.getStoredOperationStats().getSynchronizationInformation(); + + assertSyncToken(taskAfter, 4, taskAfter.getResult()); + + assertEquals(syncInfo.getCountUnmatchedAfter(), 0); + assertEquals(syncInfo.getCountDeletedAfter(), 0); + assertEquals(syncInfo.getCountLinkedAfter(), 0); + assertEquals(syncInfo.getCountUnlinkedAfter(), 0); + + } + + protected void assertSynchronizationStatisticsActivation(Task taskAfter) { + assertEquals(taskAfter.getStoredOperationStats().getSynchronizationInformation().getCountUnmatched(), 5); + assertEquals(taskAfter.getStoredOperationStats().getSynchronizationInformation().getCountDeleted(), 0); + assertEquals(taskAfter.getStoredOperationStats().getSynchronizationInformation().getCountLinked(), 0); + assertEquals(taskAfter.getStoredOperationStats().getSynchronizationInformation().getCountUnlinked(), 0); + } + + +} diff --git a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestThresholdsReconFull.java b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestThresholdsReconFull.java new file mode 100644 index 00000000000..9c10a12867c --- /dev/null +++ b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestThresholdsReconFull.java @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2010-2018 Evolveum + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.evolveum.midpoint.testing.story; + +import static org.testng.Assert.assertEquals; + +import java.io.File; + +import com.evolveum.midpoint.task.api.Task; +import com.evolveum.midpoint.xml.ns._public.common.common_3.IterativeTaskInformationType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.SynchronizationInformationType; + +/** + * @author katka + * + */ +public class TestThresholdsReconFull extends TestThresholds { + + private static final File TASK_RECONCILE_OPENDJ_FULL_FILE = new File(TEST_DIR, "task-opendj-reconcile-full.xml"); + private static final String TASK_RECONCILE_OPENDJ_FULL_OID = "20335c7c-838f-11e8-93a6-4b1dd0ab58e4"; + + + @Override + protected File getTaskFile() { + return TASK_RECONCILE_OPENDJ_FULL_FILE; + } + + @Override + protected String getTaskOid() { + return TASK_RECONCILE_OPENDJ_FULL_OID; + } + + @Override + protected int getProcessedUsers() { + return 4; + } + + @Override + protected void assertSynchronizationStatisticsAfterImport(Task taskAfter) throws Exception { + IterativeTaskInformationType infoType = taskAfter.getStoredOperationStats().getIterativeTaskInformation(); + assertEquals(infoType.getTotalFailureCount(), 1); + + SynchronizationInformationType syncInfo = taskAfter.getStoredOperationStats().getSynchronizationInformation(); + + assertEquals(syncInfo.getCountUnmatched(), 5); + assertEquals(syncInfo.getCountDeleted(), 0); + assertEquals(syncInfo.getCountLinked(), getDefaultUsers()); + assertEquals(syncInfo.getCountUnlinked(), 0); + + assertEquals(syncInfo.getCountUnmatchedAfter(), 0); + assertEquals(syncInfo.getCountDeleted(), 0); + assertEquals(syncInfo.getCountLinkedAfter(), getDefaultUsers() + getProcessedUsers()); + assertEquals(syncInfo.getCountUnlinked(), 0); + } +} diff --git a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestThresholdsReconSimulate.java b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestThresholdsReconSimulate.java new file mode 100644 index 00000000000..7719f1b31f4 --- /dev/null +++ b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestThresholdsReconSimulate.java @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2010-2018 Evolveum + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.evolveum.midpoint.testing.story; + +import static org.testng.Assert.assertEquals; + +import java.io.File; + +import com.evolveum.midpoint.task.api.Task; +import com.evolveum.midpoint.xml.ns._public.common.common_3.IterativeTaskInformationType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.SynchronizationInformationType; + +/** + * @author katka + * + */ +public class TestThresholdsReconSimulate extends TestThresholds { + + + private static final File TASK_RECONCILE_OPENDJ_SIMULATE_FILE = new File(TEST_DIR, "task-opendj-reconcile-simulate.xml"); + private static final String TASK_RECONCILE_OPENDJ_SIMULATE_OID = "10335c7c-838f-11e8-93a6-4b1dd0ab58e4"; + + @Override + protected File getTaskFile() { + return TASK_RECONCILE_OPENDJ_SIMULATE_FILE; + } + + @Override + protected String getTaskOid() { + return TASK_RECONCILE_OPENDJ_SIMULATE_OID; + } + + @Override + protected int getProcessedUsers() { + return 0; + } + + @Override + protected void assertSynchronizationStatisticsAfterImport(Task taskAfter) throws Exception { + IterativeTaskInformationType infoType = taskAfter.getStoredOperationStats().getIterativeTaskInformation(); + assertEquals(infoType.getTotalFailureCount(), 1); + + SynchronizationInformationType syncInfo = taskAfter.getStoredOperationStats().getSynchronizationInformation(); + + assertEquals(syncInfo.getCountUnmatched(), 5); + assertEquals(syncInfo.getCountDeleted(), 0); + assertEquals(syncInfo.getCountLinked(), getDefaultUsers()); + assertEquals(syncInfo.getCountUnlinked(), 0); + + assertEquals(syncInfo.getCountUnmatchedAfter(), 0); + assertEquals(syncInfo.getCountDeletedAfter(), 0); + assertEquals(syncInfo.getCountLinkedAfter(), 0); + assertEquals(syncInfo.getCountUnlinkedAfter(), 0); + } + +} diff --git a/testing/story/src/test/resources/logback-test.xml b/testing/story/src/test/resources/logback-test.xml index 26bda76405e..8573bb290b0 100644 --- a/testing/story/src/test/resources/logback-test.xml +++ b/testing/story/src/test/resources/logback-test.xml @@ -39,6 +39,9 @@ + + + @@ -68,7 +71,7 @@ - + diff --git a/testing/story/src/test/resources/thresholds/resource-opendj.xml b/testing/story/src/test/resources/thresholds/resource-opendj.xml index 065abcff96c..f4703dcf28a 100644 --- a/testing/story/src/test/resources/thresholds/resource-opendj.xml +++ b/testing/story/src/test/resources/thresholds/resource-opendj.xml @@ -75,7 +75,7 @@ ri:dn Distinguished Name - mr:stringIgnoreCase + mr:distinguishedName @@ -180,6 +180,7 @@ c:name + polyStringNorm declare namespace ri="http://midpoint.evolveum.com/xml/ns/public/resource/instance-3"; diff --git a/testing/story/src/test/resources/thresholds/task-opendj-import-base-users.xml b/testing/story/src/test/resources/thresholds/task-opendj-import-base-users.xml new file mode 100644 index 00000000000..8a47d7bccbe --- /dev/null +++ b/testing/story/src/test/resources/thresholds/task-opendj-import-base-users.xml @@ -0,0 +1,34 @@ + + + + + HR Import + + account + + fa25e6dc-a858-11e7-8ebc-eb2b71ecce1d + + runnable + http://midpoint.evolveum.com/xml/ns/public/model/synchronization/task/import/handler-3 + + single + diff --git a/testing/story/src/test/resources/thresholds/task-opendj-reconcile.xml b/testing/story/src/test/resources/thresholds/task-opendj-livesync-full.xml similarity index 69% rename from testing/story/src/test/resources/thresholds/task-opendj-reconcile.xml rename to testing/story/src/test/resources/thresholds/task-opendj-livesync-full.xml index 9a9523134a5..a76a5096582 100644 --- a/testing/story/src/test/resources/thresholds/task-opendj-reconcile.xml +++ b/testing/story/src/test/resources/thresholds/task-opendj-livesync-full.xml @@ -20,45 +20,45 @@ - Reconciliation: Dummy + LiveSync Simulate: Dummy ri:inetOrgPerson account default + 4 - - http://midpoint.evolveum.com/xml/ns/public/model/synchronization/task/reconciliation/handler-3#simulate - - fatal - - - - http://midpoint.evolveum.com/xml/ns/public/model/synchronization/task/reconciliation/handler-3#execute - - fatal - - - 10335c7c-838f-11e8-93a6-4b1dd0ab58e4 suspended - http://midpoint.evolveum.com/xml/ns/public/model/synchronization/task/reconciliation/handler-3 + http://midpoint.evolveum.com/xml/ns/public/task/lightweigth-partitioning/handler-3 + + + + + 2 + http://midpoint.evolveum.com/xml/ns/public/model/synchronization/task/live-sync/handler-3 + execute + + fatal + + + + + recurring + tight - 3 + 1 - - - - diff --git a/testing/story/src/test/resources/thresholds/task-opendj-livesync-simulate.xml b/testing/story/src/test/resources/thresholds/task-opendj-livesync-simulate.xml new file mode 100644 index 00000000000..99a94ca5c38 --- /dev/null +++ b/testing/story/src/test/resources/thresholds/task-opendj-livesync-simulate.xml @@ -0,0 +1,64 @@ + + + + + + + + + LiveSync Simulate: Dummy + + + ri:inetOrgPerson + account + default + 4 + + + 10335c7c-838f-11e8-93a6-4b1dd0ab58e4 + + suspended + + http://midpoint.evolveum.com/xml/ns/public/task/lightweigth-partitioning/handler-3 + + + + + 1 + http://midpoint.evolveum.com/xml/ns/public/model/synchronization/task/live-sync/handler-3 + simulate + + fatal + + + + + + + recurring + tight + + 1 + + + diff --git a/testing/story/src/test/resources/thresholds/task-opendj-reconcile-full.xml b/testing/story/src/test/resources/thresholds/task-opendj-reconcile-full.xml new file mode 100644 index 00000000000..1b1f45fdf18 --- /dev/null +++ b/testing/story/src/test/resources/thresholds/task-opendj-reconcile-full.xml @@ -0,0 +1,66 @@ + + + + + + + + + Reconciliation Full: Dummy + + + ri:inetOrgPerson + account + default + + + 20335c7c-838f-11e8-93a6-4b1dd0ab58e4 + + suspended + + http://midpoint.evolveum.com/xml/ns/public/task/lightweigth-partitioning/handler-3 + + + + + 2 + http://midpoint.evolveum.com/xml/ns/public/model/synchronization/task/reconciliation/handler-3 + execute + + fatal + + + + + + + recurring + + 3 + + + + + + + + diff --git a/testing/story/src/test/resources/thresholds/task-opendj-reconcile-simulate.xml b/testing/story/src/test/resources/thresholds/task-opendj-reconcile-simulate.xml new file mode 100644 index 00000000000..9c20005b574 --- /dev/null +++ b/testing/story/src/test/resources/thresholds/task-opendj-reconcile-simulate.xml @@ -0,0 +1,69 @@ + + + + + + + + + Reconciliation Simulate: Dummy + + + ri:inetOrgPerson + account + default + + + 10335c7c-838f-11e8-93a6-4b1dd0ab58e4 + + suspended + + http://midpoint.evolveum.com/xml/ns/public/task/lightweigth-partitioning/handler-3 + + + + + 2 + http://midpoint.evolveum.com/xml/ns/public/model/synchronization/task/reconciliation/handler-3 + execute + + fatal + + + + 1 + http://midpoint.evolveum.com/xml/ns/public/model/synchronization/task/reconciliation/handler-3 + simulate + + fatal + + + + + + + recurring + + 3 + + + diff --git a/testing/story/src/test/resources/thresholds/users-base.ldif b/testing/story/src/test/resources/thresholds/users-base.ldif new file mode 100644 index 00000000000..07f6ae65ad6 --- /dev/null +++ b/testing/story/src/test/resources/thresholds/users-base.ldif @@ -0,0 +1,35 @@ +dn: uid=user1,ou=People,dc=example,dc=com +uid: user1 +cn: User First +sn: First +givenname: User +objectclass: top +objectclass: person +objectclass: organizationalPerson +objectclass: inetOrgPerson +l: Caribbean +mail: user.first@example.com + +dn: uid=user2,ou=People,dc=example,dc=com +uid: user2 +cn: User Second +sn: Second +givenname: User +objectclass: top +objectclass: person +objectclass: organizationalPerson +objectclass: inetOrgPerson +l: Caribbean +mail: user.second@example.com + +dn: uid=user3,ou=People,dc=example,dc=com +uid: user3 +cn: User Third +sn: Third +givenname: User +objectclass: top +objectclass: person +objectclass: organizationalPerson +objectclass: inetOrgPerson +l: Caribbean +mail: user.third@example.com diff --git a/testing/story/src/test/resources/thresholds/users.ldif b/testing/story/src/test/resources/thresholds/users.ldif index e09817ca573..8e5ead31bd2 100644 --- a/testing/story/src/test/resources/thresholds/users.ldif +++ b/testing/story/src/test/resources/thresholds/users.ldif @@ -1,39 +1,3 @@ -dn: uid=user1,ou=People,dc=example,dc=com -uid: user1 -cn: User First -sn: First -givenname: User -objectclass: top -objectclass: person -objectclass: organizationalPerson -objectclass: inetOrgPerson -l: Caribbean -mail: user.first@example.com - -dn: uid=user2,ou=People,dc=example,dc=com -uid: user2 -cn: User Second -sn: Second -givenname: User -objectclass: top -objectclass: person -objectclass: organizationalPerson -objectclass: inetOrgPerson -l: Caribbean -mail: user.second@example.com - -dn: uid=user3,ou=People,dc=example,dc=com -uid: user3 -cn: User Third -sn: Third -givenname: User -objectclass: top -objectclass: person -objectclass: organizationalPerson -objectclass: inetOrgPerson -l: Caribbean -mail: user.third@example.com - dn: uid=user4,ou=People,dc=example,dc=com uid: user4 cn: User Fourth diff --git a/testing/story/testng-integration.xml b/testing/story/testng-integration.xml index 57ca7dcee62..177989ec849 100644 --- a/testing/story/testng-integration.xml +++ b/testing/story/testng-integration.xml @@ -57,7 +57,10 @@ - + + + + From 0671f000ac25afdca936d98c38039b30392502b9 Mon Sep 17 00:00:00 2001 From: Pavol Mederly Date: Thu, 28 Feb 2019 11:47:19 +0100 Subject: [PATCH 069/224] Fix validity scanner handler URI Replaced deprecated variant of URI with the current one. Changed also initial objects (070-task-validity.xml). --- config/initial-objects/070-task-validity.xml | 2 +- .../src/main/resources/initial-objects/070-task-validity.xml | 2 +- .../src/test/resources/common/task-validity-scanner.xml | 2 +- .../story/src/test/resources/common/task-validity-scanner.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/config/initial-objects/070-task-validity.xml b/config/initial-objects/070-task-validity.xml index 37df265d55f..e2f250645ed 100644 --- a/config/initial-objects/070-task-validity.xml +++ b/config/initial-objects/070-task-validity.xml @@ -23,7 +23,7 @@ runnable System - http://midpoint.evolveum.com/xml/ns/public/model/synchronization/task/focus-validation-scanner/handler-3 + http://midpoint.evolveum.com/xml/ns/public/model/focus-validity-scanner/handler-3 recurring loose diff --git a/gui/admin-gui/src/main/resources/initial-objects/070-task-validity.xml b/gui/admin-gui/src/main/resources/initial-objects/070-task-validity.xml index 37df265d55f..e2f250645ed 100644 --- a/gui/admin-gui/src/main/resources/initial-objects/070-task-validity.xml +++ b/gui/admin-gui/src/main/resources/initial-objects/070-task-validity.xml @@ -23,7 +23,7 @@ runnable System - http://midpoint.evolveum.com/xml/ns/public/model/synchronization/task/focus-validation-scanner/handler-3 + http://midpoint.evolveum.com/xml/ns/public/model/focus-validity-scanner/handler-3 recurring loose diff --git a/model/model-intest/src/test/resources/common/task-validity-scanner.xml b/model/model-intest/src/test/resources/common/task-validity-scanner.xml index ed9c0adc336..7cb804f0d2e 100644 --- a/model/model-intest/src/test/resources/common/task-validity-scanner.xml +++ b/model/model-intest/src/test/resources/common/task-validity-scanner.xml @@ -28,7 +28,7 @@ runnable - http://midpoint.evolveum.com/xml/ns/public/model/synchronization/task/focus-validation-scanner/handler-3 + http://midpoint.evolveum.com/xml/ns/public/model/focus-validity-scanner/handler-3 recurring tight diff --git a/testing/story/src/test/resources/common/task-validity-scanner.xml b/testing/story/src/test/resources/common/task-validity-scanner.xml index be24c5de977..2e62ef8f945 100644 --- a/testing/story/src/test/resources/common/task-validity-scanner.xml +++ b/testing/story/src/test/resources/common/task-validity-scanner.xml @@ -28,7 +28,7 @@ runnable - http://midpoint.evolveum.com/xml/ns/public/model/synchronization/task/focus-validation-scanner/handler-3 + http://midpoint.evolveum.com/xml/ns/public/model/focus-validity-scanner/handler-3 recurring tight From c3b66d901cec26baee2cec7bb5c17c54e7187c4e Mon Sep 17 00:00:00 2001 From: Pavol Mederly Date: Thu, 28 Feb 2019 11:48:49 +0100 Subject: [PATCH 070/224] Fix displaying task extension items (MID-5161) In particular, the containers and references are now shown along with properties. This resolves first part of MID-5161. --- .../prism/ContainerWrapperFactory.java | 2 +- .../web/page/admin/server/dto/TaskDto.java | 12 +++- .../server/handlers/HandlerDtoFactory.java | 32 +++++----- .../handlers/dto/GenericHandlerDto.java | 62 +++++++++---------- 4 files changed, 56 insertions(+), 52 deletions(-) diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/prism/ContainerWrapperFactory.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/prism/ContainerWrapperFactory.java index d579e80acd4..208e042ad95 100755 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/prism/ContainerWrapperFactory.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/prism/ContainerWrapperFactory.java @@ -88,7 +88,7 @@ public ContainerWrapper createContainerWrapper( Object result = new OperationResult(CREATE_PROPERTIES); - ContainerWrapper cWrapper = new ContainerWrapper(objectWrapper, container, objectWrapper.getStatus(), status, path); + ContainerWrapper cWrapper = new ContainerWrapper(objectWrapper, container, objectWrapper != null ? objectWrapper.getStatus() : status, status, path); List> containerValues = createContainerValues(cWrapper, path, task); cWrapper.setProperties(containerValues); diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/server/dto/TaskDto.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/server/dto/TaskDto.java index 66bb5ebc794..105d0e8e559 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/server/dto/TaskDto.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/server/dto/TaskDto.java @@ -26,6 +26,7 @@ import com.evolveum.midpoint.model.api.context.ModelContext; import com.evolveum.midpoint.model.api.util.ModelContextUtil; import com.evolveum.midpoint.model.api.visualizer.Scene; +import com.evolveum.midpoint.prism.Item; import com.evolveum.midpoint.prism.PrismContext; import com.evolveum.midpoint.prism.PrismProperty; import com.evolveum.midpoint.prism.path.ItemPath; @@ -945,8 +946,12 @@ public OperationResult getTaskOperationResult() { return taskOperationResult; } - public PrismProperty getExtensionProperty(QName propertyName) { - return taskType.asPrismObject().findProperty(ItemPath.create(TaskType.F_EXTENSION, propertyName)); + public Item getExtensionItem(QName itemName) { + return taskType.asPrismObject().findItem(ItemPath.create(TaskType.F_EXTENSION, itemName)); + } + + public PrismProperty getExtensionProperty(QName itemName) { + return taskType.asPrismObject().findProperty(ItemPath.create(TaskType.F_EXTENSION, itemName)); } public T getExtensionPropertyRealValue(QName propertyName, Class clazz) { @@ -1205,7 +1210,8 @@ public boolean isShadowIntegrityCheck() { } public boolean isFocusValidityScanner() { - return getHandlerUriList().contains(ModelPublicConstants.FOCUS_VALIDITY_SCANNER_TASK_HANDLER_URI); + return getHandlerUriList().contains(ModelPublicConstants.FOCUS_VALIDITY_SCANNER_TASK_HANDLER_URI) + || getHandlerUriList().contains(ModelPublicConstants.DEPRECATED_FOCUS_VALIDITY_SCANNER_TASK_HANDLER_URI); } public boolean isJdbcPing() { diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/server/handlers/HandlerDtoFactory.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/server/handlers/HandlerDtoFactory.java index b95fe1fd742..8bba08c0ecc 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/server/handlers/HandlerDtoFactory.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/server/handlers/HandlerDtoFactory.java @@ -29,7 +29,7 @@ import java.util.Collections; import static com.evolveum.midpoint.schema.constants.SchemaConstants.*; -import static com.evolveum.midpoint.web.page.admin.server.handlers.dto.GenericHandlerDto.item; +import static com.evolveum.midpoint.web.page.admin.server.handlers.dto.GenericHandlerDto.extensionItem; /** * @author mederly @@ -58,30 +58,30 @@ public HandlerDto createDtoForTask(TaskDto taskDto, PageBase pageBase, Task opTa return new ExecuteChangesHandlerDto(taskDto); } else if (taskDto.isShadowIntegrityCheck()) { return new GenericHandlerDto(taskDto, Arrays.asList( - item(MODEL_EXTENSION_OBJECT_QUERY, QueryType.class), - item(MODEL_EXTENSION_DIAGNOSE, String.class), - item(MODEL_EXTENSION_FIX, String.class), - item(MODEL_EXTENSION_DRY_RUN, Boolean.class), - item(MODEL_EXTENSION_DUPLICATE_SHADOWS_RESOLVER, String.class), - item(MODEL_EXTENSION_CHECK_DUPLICATES_ON_PRIMARY_IDENTIFIERS_ONLY, Boolean.class)), pageBase); + extensionItem(MODEL_EXTENSION_OBJECT_QUERY, QueryType.class), + extensionItem(MODEL_EXTENSION_DIAGNOSE, String.class), + extensionItem(MODEL_EXTENSION_FIX, String.class), + extensionItem(MODEL_EXTENSION_DRY_RUN, Boolean.class), + extensionItem(MODEL_EXTENSION_DUPLICATE_SHADOWS_RESOLVER, String.class), + extensionItem(MODEL_EXTENSION_CHECK_DUPLICATES_ON_PRIMARY_IDENTIFIERS_ONLY, Boolean.class)), pageBase); } else if (taskDto.isCleanup()) { return new GenericHandlerDto(taskDto, Collections.singletonList( - item(MODEL_EXTENSION_CLEANUP_POLICIES, CleanupPoliciesType.class)), pageBase); + extensionItem(MODEL_EXTENSION_CLEANUP_POLICIES, CleanupPoliciesType.class)), pageBase); } else if (taskDto.isNoOp()) { return new GenericHandlerDto(taskDto, Arrays.asList( - item(SchemaConstants.NOOP_STEPS_QNAME, Integer.class), - item(SchemaConstants.NOOP_DELAY_QNAME, Integer.class)), pageBase); + extensionItem(SchemaConstants.NOOP_STEPS_QNAME, Integer.class), + extensionItem(SchemaConstants.NOOP_DELAY_QNAME, Integer.class)), pageBase); } else if (taskDto.isReportCreate()) { return new ReportCreateHandlerDto(taskDto); } else if (taskDto.isJdbcPing()) { return new GenericHandlerDto(taskDto, Arrays.asList( - item(SchemaConstants.JDBC_PING_TESTS_QNAME, Integer.class), - item(SchemaConstants.JDBC_PING_INTERVAL_QNAME, Integer.class), - item(SchemaConstants.JDBC_PING_TEST_QUERY_QNAME, String.class), - item(SchemaConstants.JDBC_PING_JDBC_URL_QNAME, String.class), - item(SchemaConstants.JDBC_PING_JDBC_USERNAME_QNAME, String.class), + extensionItem(SchemaConstants.JDBC_PING_TESTS_QNAME, Integer.class), + extensionItem(SchemaConstants.JDBC_PING_INTERVAL_QNAME, Integer.class), + extensionItem(SchemaConstants.JDBC_PING_TEST_QUERY_QNAME, String.class), + extensionItem(SchemaConstants.JDBC_PING_JDBC_URL_QNAME, String.class), + extensionItem(SchemaConstants.JDBC_PING_JDBC_USERNAME_QNAME, String.class), //item(SchemaConstants.JDBC_PING_JDBC_PASSWORD_QNAME, String.class), - item(SchemaConstants.JDBC_PING_LOG_ON_INFO_LEVEL_QNAME, Boolean.class) + extensionItem(SchemaConstants.JDBC_PING_LOG_ON_INFO_LEVEL_QNAME, Boolean.class) ), pageBase); } else { return new HandlerDto(taskDto); diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/server/handlers/dto/GenericHandlerDto.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/server/handlers/dto/GenericHandlerDto.java index 1ee6fc9c426..42cb22b0be0 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/server/handlers/dto/GenericHandlerDto.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/server/handlers/dto/GenericHandlerDto.java @@ -23,13 +23,14 @@ import com.evolveum.midpoint.task.api.Task; import com.evolveum.midpoint.util.exception.SchemaException; import com.evolveum.midpoint.util.exception.SystemException; +import com.evolveum.midpoint.util.logging.Trace; +import com.evolveum.midpoint.util.logging.TraceManager; import com.evolveum.midpoint.web.component.prism.*; import com.evolveum.midpoint.web.page.admin.server.dto.TaskDto; import org.jetbrains.annotations.NotNull; import javax.xml.namespace.QName; import java.io.Serializable; -import java.util.ArrayList; import java.util.List; /** @@ -37,64 +38,59 @@ */ public class GenericHandlerDto extends HandlerDto { + private static final Trace LOGGER = TraceManager.getTrace(GenericHandlerDto.class); + public static final String F_CONTAINER = "container"; - public static class Item implements Serializable { - @NotNull private QName name; - @NotNull private Class type; + public static class ExtensionItem implements Serializable { + @NotNull private final QName name; + @NotNull private final Class type; - public Item(@NotNull QName name, @NotNull Class type) { + public ExtensionItem(@NotNull QName name, @NotNull Class type) { this.name = name; this.type = type; } } - public static Item item(QName name, Class type) { - return new Item(name, type); + public static ExtensionItem extensionItem(QName name, Class type) { + return new ExtensionItem(name, type); } - @NotNull private List items; - private final List propertyWrappers = new ArrayList<>(); private final ContainerWrapper containerWrapper; - public GenericHandlerDto(TaskDto taskDto, @NotNull List items, PageBase pageBase) { + public GenericHandlerDto(TaskDto taskDto, @NotNull List extensionItems, PageBase pageBase) { super(taskDto); - this.items = items; - for (Item item : items) { - PrismProperty property = taskDto.getExtensionProperty(item.name); - if (property != null) { - PropertyWrapper propertyWrapper = new PropertyWrapper<>(null, property, true, ValueStatus.NOT_CHANGED, pageBase.getPrismContext()); - propertyWrappers.add(propertyWrapper); - } else { - // TODO create empty property? - } - } + PrismContext prismContext = pageBase.getPrismContext(); ContainerWrapperFactory cwf = new ContainerWrapperFactory(pageBase); - final PrismContext prismContext = pageBase.getPrismContext(); PrismContainer container = prismContext.itemFactory().createContainer(new QName("test")); ComplexTypeDefinition ctd = prismContext.definitionFactory().createComplexTypeDefinition(new QName("Test")); int displayOrder = 1; - for (Item item : items) { - PrismProperty property = taskDto.getExtensionProperty(item.name); - MutablePrismPropertyDefinition clonedDefinition = null; - if (property != null) { + for (ExtensionItem extensionItem : extensionItems) { + Item item = taskDto.getExtensionItem(extensionItem.name); + MutableItemDefinition clonedDefinition = null; + if (item != null) { try { - PrismProperty clonedProperty = property.clone(); - container.add(clonedProperty); - if (clonedProperty.getDefinition() != null) { - clonedDefinition = clonedProperty.getDefinition().clone().toMutable(); - clonedProperty.setDefinition((PrismPropertyDefinition) clonedDefinition); + Item clonedItem = item.clone(); + //noinspection unchecked + container.add(clonedItem); + if (clonedItem.getDefinition() != null) { + clonedDefinition = clonedItem.getDefinition().clone().toMutable(); + //noinspection unchecked + ((Item) clonedItem).setDefinition(clonedDefinition); } } catch (SchemaException e) { throw new SystemException(e); } } if (clonedDefinition == null) { - clonedDefinition = CloneUtil.clone(prismContext.getSchemaRegistry().findPropertyDefinitionByElementName(item.name)).toMutable(); + ItemDefinition definition = prismContext.getSchemaRegistry().findItemDefinitionByElementName(extensionItem.name); + if (definition != null) { + clonedDefinition = CloneUtil.clone(definition).toMutable(); + } } if (clonedDefinition == null) { - System.out.println("Definition-less property " + item.name); // TODO + LOGGER.warn("Extension item without definition: {} of {}", extensionItem.name, extensionItem.type); } else { clonedDefinition.setCanAdd(false); clonedDefinition.setCanModify(false); @@ -104,8 +100,10 @@ public GenericHandlerDto(TaskDto taskDto, @NotNull List items, PageBase pa displayOrder++; } MutablePrismContainerDefinition containerDefinition = prismContext.definitionFactory().createContainerDefinition(new QName("Handler data"), ctd); + //noinspection unchecked container.setDefinition(containerDefinition); Task task = pageBase.createSimpleTask("Adding new container wrapper"); + //noinspection unchecked containerWrapper = cwf.createContainerWrapper(null, container, ContainerStatus.MODIFYING, ItemPath.EMPTY_PATH, true, task); } From 80467a8e74c6dfad836ed7a106e989bd650b7879 Mon Sep 17 00:00:00 2001 From: Pavol Mederly Date: Thu, 28 Feb 2019 12:00:30 +0100 Subject: [PATCH 071/224] Fix displaying of subtasks (MID-5161) --- .../midpoint/task/quartzimpl/TaskManagerQuartzImpl.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/TaskManagerQuartzImpl.java b/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/TaskManagerQuartzImpl.java index 2b68c25f2ae..2c136180fd5 100644 --- a/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/TaskManagerQuartzImpl.java +++ b/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/TaskManagerQuartzImpl.java @@ -1342,8 +1342,11 @@ private List getSubtasks(Object task, OperationResult result) throws SchemaEx return ((Task) task).listSubtasks(result); } else if (task instanceof TaskType) { return listPersistentSubtasksForTask(((TaskType) task).getTaskIdentifier(), result); + } else if (task instanceof PrismObject) { + //noinspection unchecked + return listPersistentSubtasksForTask(((PrismObject) task).asObjectable().getTaskIdentifier(), result); } else { - throw new IllegalArgumentException("task: " + task); + throw new IllegalArgumentException("task: " + task + " (of class " + (task != null ? task.getClass() : "null") + ")"); } } From 4351b2332943b1dc222b9c14f44a10f0c48dd60c Mon Sep 17 00:00:00 2001 From: kate Date: Thu, 28 Feb 2019 14:23:39 +0100 Subject: [PATCH 072/224] MID-5165 fix (npe) --- .../midpoint/web/component/data/BaseSortableDataProvider.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/data/BaseSortableDataProvider.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/data/BaseSortableDataProvider.java index 5411f42dd70..356f225af6b 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/data/BaseSortableDataProvider.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/data/BaseSortableDataProvider.java @@ -244,7 +244,7 @@ public boolean isOrderingDisabled() { } // TODO: Default list view setting should never be needed. Always check setting for specific object type (and archetype). CompiledObjectCollectionView def = WebComponentUtil.getDefaultGuiObjectListType((PageBase) component.getPage()); - return def != null && def.isDisableSorting(); + return def != null && def.isDisableSorting() != null && def.isDisableSorting(); } protected ObjectPaging createPaging(long offset, long pageSize) { From f61aef8933f639c6c718184926556f9f474dcd1c Mon Sep 17 00:00:00 2001 From: skublik Date: Thu, 28 Feb 2019 14:36:41 +0100 Subject: [PATCH 073/224] adding unassign action for bulk action MID-4983 --- .../midpoint/test/util/MidPointAsserts.java | 15 ++++ .../scripting/actions/UnassignExecutor.java | 61 +++++++++++++- ...bstractConfiguredModelIntegrationTest.java | 3 + ...stractInitializedModelIntegrationTest.java | 2 + .../intest/scripting/TestScriptingBasic.java | 82 ++++++++++++++++++- .../src/test/resources/common/user-will.xml | 53 ++++++++++++ .../scripting/unassign-from-will-2.xml | 40 +++++++++ .../scripting/unassign-from-will-3.xml | 36 ++++++++ .../scripting/unassign-from-will.xml | 40 +++++++++ 9 files changed, 328 insertions(+), 4 deletions(-) create mode 100644 model/model-intest/src/test/resources/common/user-will.xml create mode 100644 model/model-intest/src/test/resources/scripting/unassign-from-will-2.xml create mode 100644 model/model-intest/src/test/resources/scripting/unassign-from-will-3.xml create mode 100644 model/model-intest/src/test/resources/scripting/unassign-from-will.xml diff --git a/infra/test-util/src/main/java/com/evolveum/midpoint/test/util/MidPointAsserts.java b/infra/test-util/src/main/java/com/evolveum/midpoint/test/util/MidPointAsserts.java index 7fd050c226f..939693bfc48 100644 --- a/infra/test-util/src/main/java/com/evolveum/midpoint/test/util/MidPointAsserts.java +++ b/infra/test-util/src/main/java/com/evolveum/midpoint/test/util/MidPointAsserts.java @@ -113,6 +113,21 @@ public static void assertNotAssigned(PrismObject user, } } } + + public static void assertNotAssigned(PrismObject user, String targetOid, QName refType, QName relation) { + F userType = user.asObjectable(); + for (AssignmentType assignmentType: userType.getAssignment()) { + ObjectReferenceType targetRef = assignmentType.getTargetRef(); + if (targetRef != null) { + if (QNameUtil.match(refType, targetRef.getType())) { + if (targetOid.equals(targetRef.getOid()) && + getPrismContext().relationMatches(targetRef.getRelation(), relation)) { + AssertJUnit.fail(user + " does have assigned "+refType.getLocalPart()+" "+targetOid+", relation "+relation+"while not expecting it"); + } + } + } + } + } public static void assertAssignments(PrismObject user, int expectedNumber) { F userType = user.asObjectable(); diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/scripting/actions/UnassignExecutor.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/scripting/actions/UnassignExecutor.java index 77e2dbf1436..731e5d36792 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/scripting/actions/UnassignExecutor.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/scripting/actions/UnassignExecutor.java @@ -25,7 +25,11 @@ import com.evolveum.midpoint.prism.PrismObjectValue; import com.evolveum.midpoint.prism.PrismValue; import com.evolveum.midpoint.prism.delta.ObjectDelta; +import com.evolveum.midpoint.prism.path.ItemPath; +import com.evolveum.midpoint.prism.query.QueryFactory; +import com.evolveum.midpoint.schema.constants.RelationTypes; import com.evolveum.midpoint.schema.result.OperationResult; +import com.evolveum.midpoint.util.QNameUtil; import com.evolveum.midpoint.util.exception.CommonException; import com.evolveum.midpoint.util.exception.SchemaException; import com.evolveum.midpoint.util.logging.Trace; @@ -37,7 +41,11 @@ import org.springframework.stereotype.Component; import javax.annotation.PostConstruct; +import javax.xml.namespace.QName; + +import java.util.ArrayList; import java.util.Collection; +import java.util.List; /** * @@ -129,8 +137,55 @@ public PipelineData execute(ActionExpressionType expression, PipelineData input, return input; // TODO updated objects? } - private ObjectDelta createDelta(ObjectType object, Collection resources, Collection roles, Collection relations) throws ScriptExecutionException { - // TODO implement delta creation - return null; + private ObjectDelta createDelta(AssignmentHolderType object, Collection resources, Collection roles, Collection relations) throws ScriptExecutionException { + List assignmentsForDelete = new ArrayList<>(); + + List oldAssignments = object.getAssignment(); + if(oldAssignments != null) { + for (AssignmentType oldAssignment : oldAssignments) { + if(oldAssignment.getTargetRef() != null) { + if (roles != null) { + outerloop: + for (ObjectReferenceType roleRef : roles) { + if(oldAssignment.getTargetRef().getOid().equals(roleRef.getOid())) { + if(relations != null && !relations.isEmpty()) { + for (String relationQuery : relations) { + if(prismContext.relationMatches(QNameUtil.uriToQName(relationQuery, true), oldAssignment.getTargetRef().getRelation())) { + assignmentsForDelete.add(oldAssignment.clone()); + break outerloop; + } + } + } else { + if(prismContext.relationMatches(RelationTypes.MEMBER.getRelation(), oldAssignment.getTargetRef().getRelation())) { + assignmentsForDelete.add(oldAssignment.clone()); + break outerloop; + } + } + } + } + } + } else if(oldAssignment.getConstruction() != null) { + if (resources != null) { + for (ObjectReferenceType resourceRef : resources) { + if(oldAssignment.getConstruction().getResourceRef() != null + && oldAssignment.getConstruction().getResourceRef().getOid().equals(resourceRef.getOid())) { + assignmentsForDelete.add(oldAssignment.clone()); + break; + } + } + } + } + } + } + + ObjectDelta delta = null; + + try { + delta = prismContext.deltaFor(object.getClass()).item(ItemPath.create(AssignmentHolderType.F_ASSIGNMENT)) + .delete(assignmentsForDelete.toArray(new AssignmentType[0])).asObjectDelta(object.getOid()); + } catch (SchemaException e) { + throw new ScriptExecutionException("Couldn't prepare modification to delete resource/role assignments", e); + } + return delta; } } diff --git a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/AbstractConfiguredModelIntegrationTest.java b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/AbstractConfiguredModelIntegrationTest.java index f8d8b7d8df8..cb8fa45af7a 100644 --- a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/AbstractConfiguredModelIntegrationTest.java +++ b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/AbstractConfiguredModelIntegrationTest.java @@ -322,6 +322,9 @@ public class AbstractConfiguredModelIntegrationTest extends AbstractModelIntegra protected static final String USER_GUYBRUSH_GIVEN_NAME = "Guybrush"; protected static final String USER_GUYBRUSH_FAMILY_NAME = "Threepwood"; protected static final String USER_GUYBRUSH_LOCALITY = "Melee Island"; + + public static final File USER_WILL_FILE = new File(COMMON_DIR, "user-will.xml"); + public static final String USER_WILL_OID = "c0c010c0-d34d-b33f-f00d-111111145118"; // Largo does not have a full name set, employeeType=PIRATE protected static final File USER_LARGO_FILE = new File(COMMON_DIR, "user-largo.xml"); diff --git a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/AbstractInitializedModelIntegrationTest.java b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/AbstractInitializedModelIntegrationTest.java index 5fe5a26656e..c0662faa1b0 100644 --- a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/AbstractInitializedModelIntegrationTest.java +++ b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/AbstractInitializedModelIntegrationTest.java @@ -82,6 +82,7 @@ public class AbstractInitializedModelIntegrationTest extends AbstractConfiguredM protected UserType userTypeBarbossa; protected UserType userTypeGuybrush; protected UserType userTypeElaine; + protected UserType userTypeWill; protected DummyResourceContoller dummyResourceCtl; @@ -230,6 +231,7 @@ public void initSystem(Task initTask, OperationResult initResult) throws Excepti userTypeBarbossa = repoAddObjectFromFile(USER_BARBOSSA_FILE, UserType.class, initResult).asObjectable(); userTypeGuybrush = repoAddObjectFromFile(USER_GUYBRUSH_FILE, UserType.class, initResult).asObjectable(); userTypeElaine = repoAddObjectFromFile(USER_ELAINE_FILE, UserType.class, initResult).asObjectable(); + userTypeWill = repoAddObjectFromFile(USER_WILL_FILE, UserType.class, true, initResult).asObjectable(); // Roles repoAddObjectFromFile(ROLE_PIRATE_FILE, initResult); diff --git a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/scripting/TestScriptingBasic.java b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/scripting/TestScriptingBasic.java index 5c0eab242a5..784d9b367da 100644 --- a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/scripting/TestScriptingBasic.java +++ b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/scripting/TestScriptingBasic.java @@ -29,6 +29,7 @@ import com.evolveum.midpoint.prism.delta.ItemDelta; import com.evolveum.midpoint.prism.path.ItemName; import com.evolveum.midpoint.prism.util.PrismAsserts; +import com.evolveum.midpoint.schema.constants.RelationTypes; import com.evolveum.midpoint.schema.constants.SchemaConstants; import com.evolveum.midpoint.schema.internals.InternalMonitor; import com.evolveum.midpoint.schema.result.OperationResult; @@ -36,6 +37,7 @@ import com.evolveum.midpoint.schema.util.ObjectQueryUtil; import com.evolveum.midpoint.task.api.Task; import com.evolveum.midpoint.test.util.LogfileTestTailer; +import com.evolveum.midpoint.test.util.MidPointAsserts; import com.evolveum.midpoint.test.util.TestUtil; import com.evolveum.midpoint.util.exception.*; import com.evolveum.midpoint.xml.ns._public.common.common_3.*; @@ -91,6 +93,9 @@ public class TestScriptingBasic extends AbstractInitializedModelIntegrationTest private static final File RECOMPUTE_JACK_FILE = new File(TEST_DIR, "recompute-jack.xml"); private static final File ASSIGN_TO_JACK_FILE = new File(TEST_DIR, "assign-to-jack.xml"); private static final File ASSIGN_TO_JACK_2_FILE = new File(TEST_DIR, "assign-to-jack-2.xml"); + private static final File UNASSIGN_FROM_WILL_FILE = new File(TEST_DIR, "unassign-from-will.xml"); + private static final File UNASSIGN_FROM_WILL_2_FILE = new File(TEST_DIR, "unassign-from-will-2.xml"); + private static final File UNASSIGN_FROM_WILL_3_FILE = new File(TEST_DIR, "unassign-from-will-3.xml"); private static final File PURGE_DUMMY_BLACK_SCHEMA_FILE = new File(TEST_DIR, "purge-dummy-black-schema.xml"); private static final File TEST_DUMMY_RESOURCE_FILE = new File(TEST_DIR, "test-dummy-resource.xml"); private static final File NOTIFICATION_ABOUT_JACK_FILE = new File(TEST_DIR, "notification-about-jack.xml"); @@ -550,7 +555,7 @@ public void test360AssignToJack() throws Exception { assertAssignedAccount(jack, "10000000-0000-0000-0000-000000000104"); assertAssignedRole(jack, "12345678-d34d-b33f-f00d-55555555cccc"); } - + @Test public void test370AssignToJackInBackground() throws Exception { final String TEST_NAME = "test370AssignToJackInBackground"; @@ -601,6 +606,81 @@ public void test380DisableJackInBackgroundSimple() throws Exception { display("jack after disable script", jack); assertAdministrativeStatusDisabled(jack); } + + @Test + public void test390UnassignFromWill() throws Exception { + final String TEST_NAME = "test390UnassignFromJack"; + TestUtil.displayTestTitle(this, TEST_NAME); + + // GIVEN + Task task = createTask(DOT_CLASS + TEST_NAME); + OperationResult result = task.getResult(); + PrismProperty expression = parseAnyData(UNASSIGN_FROM_WILL_FILE); + + // WHEN + ExecutionContext output = scriptingExpressionEvaluator.evaluateExpression(expression.getAnyValue().getValue(), task, result); + + // THEN + dumpOutput(output, result); + assertOutputData(output, 1, OperationResultStatus.SUCCESS); + result.computeStatus(); + TestUtil.assertSuccess(result); + PrismObject will = getUser(USER_WILL_OID); + display("will after unassign assignment", will); + MidPointAsserts.assertNotAssigned(will, "12345678-d34d-b33f-f00d-555555556666", RoleType.COMPLEX_TYPE, RelationTypes.MEMBER.getRelation()); + MidPointAsserts.assertAssigned(will, "12345678-d34d-b33f-f00d-555555556666", RoleType.COMPLEX_TYPE, RelationTypes.MANAGER.getRelation()); + MidPointAsserts.assertAssignedResource(will, "10000000-0000-0000-0000-000000000004"); + } + + @Test + public void test391UnassignFromWill() throws Exception { + final String TEST_NAME = "test391UnassignFromJack"; + TestUtil.displayTestTitle(this, TEST_NAME); + + // GIVEN + Task task = createTask(DOT_CLASS + TEST_NAME); + OperationResult result = task.getResult(); + PrismProperty expression = parseAnyData(UNASSIGN_FROM_WILL_2_FILE); + + // WHEN + ExecutionContext output = scriptingExpressionEvaluator.evaluateExpression(expression.getAnyValue().getValue(), task, result); + + // THEN + dumpOutput(output, result); + assertOutputData(output, 1, OperationResultStatus.SUCCESS); + result.computeStatus(); + TestUtil.assertSuccess(result); + PrismObject will = getUser(USER_WILL_OID); + display("will after unassign assignment", will); + MidPointAsserts.assertNotAssigned(will, "12345678-d34d-b33f-f00d-555555556666", RoleType.COMPLEX_TYPE, RelationTypes.MEMBER.getRelation()); + MidPointAsserts.assertNotAssigned(will, "12345678-d34d-b33f-f00d-555555556666", RoleType.COMPLEX_TYPE, RelationTypes.MANAGER.getRelation()); + MidPointAsserts.assertAssignedResource(will, "10000000-0000-0000-0000-000000000004"); + } + + @Test + public void test392UnassignFromWill() throws Exception { + final String TEST_NAME = "test392UnassignFromJack"; + TestUtil.displayTestTitle(this, TEST_NAME); + + // GIVEN + Task task = createTask(DOT_CLASS + TEST_NAME); + OperationResult result = task.getResult(); + PrismProperty expression = parseAnyData(UNASSIGN_FROM_WILL_3_FILE); + + // WHEN + ExecutionContext output = scriptingExpressionEvaluator.evaluateExpression(expression.getAnyValue().getValue(), task, result); + + // THEN + dumpOutput(output, result); + assertOutputData(output, 1, OperationResultStatus.SUCCESS); + result.computeStatus(); + TestUtil.assertSuccess(result); + PrismObject will = getUser(USER_WILL_OID); + display("will after unassign assignment", will); + MidPointAsserts.assertNotAssigned(will, "12345678-d34d-b33f-f00d-555555556666", RoleType.COMPLEX_TYPE, RelationTypes.MEMBER.getRelation()); + MidPointAsserts.assertNotAssigned(will, "12345678-d34d-b33f-f00d-555555556666", RoleType.COMPLEX_TYPE, RelationTypes.MANAGER.getRelation()); + MidPointAsserts.assertNotAssignedResource(will, "10000000-0000-0000-0000-000000000004"); + } @Test public void test400PurgeSchema() throws Exception { diff --git a/model/model-intest/src/test/resources/common/user-will.xml b/model/model-intest/src/test/resources/common/user-will.xml new file mode 100644 index 00000000000..d2c309a1a6a --- /dev/null +++ b/model/model-intest/src/test/resources/common/user-will.xml @@ -0,0 +1,53 @@ + + + + will + + PIRATE + Will + Turner + + + + + + + + + + + + + 1777-05-30T14:15:00Z + 2222-02-22T08:30:42Z + + + + + orlando123 + + + + + diff --git a/model/model-intest/src/test/resources/scripting/unassign-from-will-2.xml b/model/model-intest/src/test/resources/scripting/unassign-from-will-2.xml new file mode 100644 index 00000000000..ca4d368940d --- /dev/null +++ b/model/model-intest/src/test/resources/scripting/unassign-from-will-2.xml @@ -0,0 +1,40 @@ + + + + + c:UserType + + + c:name + will + + + + unassign + + role + 12345678-d34d-b33f-f00d-555555556666 + + + relation + any + + + diff --git a/model/model-intest/src/test/resources/scripting/unassign-from-will-3.xml b/model/model-intest/src/test/resources/scripting/unassign-from-will-3.xml new file mode 100644 index 00000000000..e9683c2bf0f --- /dev/null +++ b/model/model-intest/src/test/resources/scripting/unassign-from-will-3.xml @@ -0,0 +1,36 @@ + + + + + c:UserType + + + c:name + will + + + + unassign + + resource + 10000000-0000-0000-0000-000000000004 + + + diff --git a/model/model-intest/src/test/resources/scripting/unassign-from-will.xml b/model/model-intest/src/test/resources/scripting/unassign-from-will.xml new file mode 100644 index 00000000000..2e2e8ca47d6 --- /dev/null +++ b/model/model-intest/src/test/resources/scripting/unassign-from-will.xml @@ -0,0 +1,40 @@ + + + + + c:UserType + + + c:name + will + + + + unassign + + role + 12345678-d34d-b33f-f00d-555555556666 + + + relation + default + + + From c9f95b7fa519d11093cb5c7de175f29f4b540bf5 Mon Sep 17 00:00:00 2001 From: Pavol Mederly Date: Thu, 28 Feb 2019 14:38:33 +0100 Subject: [PATCH 074/224] Fix starting midPoint with profiling enabled It is not possible to autowire TaskManagerQuartzImpl, because when profiling is enabled, a dynamic proxy is generated for this class. @Autowire TaskManager should be used instead. --- .../quartzimpl/execution/HandlerExecutor.java | 27 ++++++++--------- ...> LightweightPartitioningTaskHandler.java} | 29 +++++++------------ 2 files changed, 24 insertions(+), 32 deletions(-) rename repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/handlers/{LightweigthPartitioningTaskHandler.java => LightweightPartitioningTaskHandler.java} (88%) diff --git a/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/execution/HandlerExecutor.java b/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/execution/HandlerExecutor.java index c459e88806c..a1912fb1d32 100644 --- a/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/execution/HandlerExecutor.java +++ b/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/execution/HandlerExecutor.java @@ -17,21 +17,17 @@ import java.util.List; +import com.evolveum.midpoint.task.api.*; +import com.evolveum.midpoint.task.quartzimpl.TaskManagerQuartzImpl; +import org.jetbrains.annotations.NotNull; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import com.evolveum.midpoint.prism.PrismContext; import com.evolveum.midpoint.prism.delta.ItemDelta; import com.evolveum.midpoint.schema.result.OperationResult; -import com.evolveum.midpoint.task.api.RunningTask; -import com.evolveum.midpoint.task.api.TaskHandler; -import com.evolveum.midpoint.task.api.TaskRunResult; import com.evolveum.midpoint.task.api.TaskRunResult.TaskRunResultStatus; -import com.evolveum.midpoint.task.api.TaskWorkBucketProcessingResult; -import com.evolveum.midpoint.task.api.WorkBucketAwareTaskHandler; import com.evolveum.midpoint.task.quartzimpl.RunningTaskQuartzImpl; -import com.evolveum.midpoint.task.quartzimpl.TaskManagerQuartzImpl; -import com.evolveum.midpoint.task.quartzimpl.TaskQuartzImpl; import com.evolveum.midpoint.task.quartzimpl.work.WorkStateManager; import com.evolveum.midpoint.util.exception.ObjectAlreadyExistsException; import com.evolveum.midpoint.util.exception.ObjectNotFoundException; @@ -56,9 +52,9 @@ public class HandlerExecutor { private static final long FREE_BUCKET_WAIT_TIME = -1; // indefinitely @Autowired private PrismContext prismCtx; - @Autowired private TaskManagerQuartzImpl taskManagerImpl; - - + @Autowired private TaskManager taskManager; + + @NotNull public TaskRunResult executeHandler(RunningTaskQuartzImpl task, TaskPartitionDefinitionType partition, TaskHandler handler, OperationResult executionResult) { if (handler instanceof WorkBucketAwareTaskHandler) { @@ -68,6 +64,7 @@ public TaskRunResult executeHandler(RunningTaskQuartzImpl task, TaskPartitionDef return executePlainTaskHandler(task, partition, handler); } + @NotNull private TaskRunResult executePlainTaskHandler(RunningTask task, TaskPartitionDefinitionType partition, TaskHandler handler) { TaskRunResult runResult; try { @@ -84,8 +81,9 @@ private TaskRunResult executePlainTaskHandler(RunningTask task, TaskPartitionDef return runResult; } + @NotNull private TaskRunResult executeWorkBucketAwareTaskHandler(RunningTaskQuartzImpl task, TaskPartitionDefinitionType taskPartition, WorkBucketAwareTaskHandler handler, OperationResult executionResult) { - WorkStateManager workStateManager = taskManagerImpl.getWorkStateManager(); + WorkStateManager workStateManager = ((TaskManagerQuartzImpl) taskManager).getWorkStateManager(); if (task.getWorkState() != null && Boolean.TRUE.equals(task.getWorkState().isAllWorkComplete())) { LOGGER.debug("Work is marked as complete; restarting it in task {}", task); @@ -142,7 +140,7 @@ private TaskRunResult executeWorkBucketAwareTaskHandler(RunningTaskQuartzImpl ta return runResult; } try { - taskManagerImpl.getWorkStateManager().completeWorkBucket(task.getOid(), bucket.getSequentialNumber(), executionResult); + ((TaskManagerQuartzImpl) taskManager).getWorkStateManager().completeWorkBucket(task.getOid(), bucket.getSequentialNumber(), executionResult); } catch (ObjectAlreadyExistsException | ObjectNotFoundException | SchemaException | RuntimeException e) { LoggingUtils.logUnexpectedException(LOGGER, "Couldn't complete work bucket for task {}", e, task); return createFailureTaskRunResult(task, "Couldn't complete work bucket: " + e.getMessage(), e); @@ -152,7 +150,8 @@ private TaskRunResult executeWorkBucketAwareTaskHandler(RunningTaskQuartzImpl ta } } } - + + @NotNull private TaskRunResult createFailureTaskRunResult(RunningTask task, String message, Throwable t) { TaskRunResult runResult = new TaskRunResult(); OperationResult opResult; @@ -171,6 +170,7 @@ private TaskRunResult createFailureTaskRunResult(RunningTask task, String messag return runResult; } + @NotNull private TaskRunResult createSuccessTaskRunResult(RunningTask task) { TaskRunResult runResult = new TaskRunResult(); OperationResult opResult; @@ -185,6 +185,7 @@ private TaskRunResult createSuccessTaskRunResult(RunningTask task) { return runResult; } + @NotNull private TaskRunResult createInterruptedTaskRunResult(RunningTask task) { TaskRunResult runResult = new TaskRunResult(); OperationResult opResult; diff --git a/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/handlers/LightweigthPartitioningTaskHandler.java b/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/handlers/LightweightPartitioningTaskHandler.java similarity index 88% rename from repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/handlers/LightweigthPartitioningTaskHandler.java rename to repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/handlers/LightweightPartitioningTaskHandler.java index 61f27e691fb..59cef8dc30b 100644 --- a/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/handlers/LightweigthPartitioningTaskHandler.java +++ b/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/handlers/LightweightPartitioningTaskHandler.java @@ -20,6 +20,7 @@ import javax.annotation.PostConstruct; +import com.evolveum.midpoint.task.api.*; import org.apache.commons.lang.Validate; import org.jetbrains.annotations.NotNull; import org.springframework.beans.factory.annotation.Autowired; @@ -27,17 +28,9 @@ import com.evolveum.midpoint.prism.PrismContext; import com.evolveum.midpoint.schema.result.OperationResult; -import com.evolveum.midpoint.task.api.RunningTask; -import com.evolveum.midpoint.task.api.StatisticsCollectionStrategy; -import com.evolveum.midpoint.task.api.Task; -import com.evolveum.midpoint.task.api.TaskConstants; -import com.evolveum.midpoint.task.api.TaskHandler; -import com.evolveum.midpoint.task.api.TaskManager; -import com.evolveum.midpoint.task.api.TaskRunResult; import com.evolveum.midpoint.task.api.TaskRunResult.TaskRunResultStatus; import com.evolveum.midpoint.task.quartzimpl.RunningTaskQuartzImpl; import com.evolveum.midpoint.task.quartzimpl.TaskManagerQuartzImpl; -import com.evolveum.midpoint.task.quartzimpl.TaskQuartzImpl; import com.evolveum.midpoint.task.quartzimpl.execution.HandlerExecutor; import com.evolveum.midpoint.util.logging.Trace; import com.evolveum.midpoint.util.logging.TraceManager; @@ -49,14 +42,14 @@ * */ @Component -public class LightweigthPartitioningTaskHandler implements TaskHandler { +public class LightweightPartitioningTaskHandler implements TaskHandler { - private static final transient Trace LOGGER = TraceManager.getTrace(LightweigthPartitioningTaskHandler.class); + private static final transient Trace LOGGER = TraceManager.getTrace(LightweightPartitioningTaskHandler.class); private static final String HANDLER_URI = TaskConstants.LIGHTWEIGTH_PARTITIONING_TASK_HANDLER_URI; @Autowired private PrismContext prismContext; - @Autowired private TaskManagerQuartzImpl taskManager; + @Autowired private TaskManager taskManager; @Autowired private HandlerExecutor handlerExecutor; // @Autowired private TaskManager taskManager; @@ -67,7 +60,7 @@ private void initialize() { } public TaskRunResult run(RunningTask task, TaskPartitionDefinitionType taskPartition) { - OperationResult opResult = new OperationResult(LightweigthPartitioningTaskHandler.class.getName()+".run"); + OperationResult opResult = new OperationResult(LightweightPartitioningTaskHandler.class.getName()+".run"); TaskRunResult runResult = new TaskRunResult(); runResult.setProgress(task.getProgress()); @@ -101,16 +94,14 @@ public TaskRunResult run(RunningTask task, TaskPartitionDefinitionType taskParti partitions.sort(comparator); for (TaskPartitionDefinitionType partition : partitions) { - TaskHandler handler = taskManager.getHandler(partition.getHandlerUri()); + TaskHandler handler = ((TaskManagerQuartzImpl) taskManager).getHandler(partition.getHandlerUri()); TaskRunResult subHandlerResult = handlerExecutor.executeHandler((RunningTaskQuartzImpl) task, partition, handler, opResult); // TaskRunResult subHandlerResult = handler.run(task, partition); OperationResult subHandlerOpResult = subHandlerResult.getOperationResult(); opResult.addSubresult(subHandlerOpResult); - if (subHandlerResult != null) { - runResult = subHandlerResult; - runResult.setProgress(task.getProgress()); - } - + runResult = subHandlerResult; + runResult.setProgress(task.getProgress()); + if (!canContinue(task, subHandlerResult)) { break; } @@ -170,7 +161,7 @@ public StatisticsCollectionStrategy getStatisticsCollectionStrategy() { public String getCategoryName(Task task) { // TODO Auto-generated method stub return null; - }; + } // private void processErrorCriticality(Task task, TaskPartitionDefinitionType partitionDefinition, Throwable ex, OperationResult result) throws ObjectNotFoundException, CommunicationException, SchemaException, ConfigurationException, SecurityViolationException, PolicyViolationException, ExpressionEvaluationException, ObjectAlreadyExistsException, PreconditionViolationException { From 7d373cb7d6c53c5c1b3a7b2d198356dacae821d4 Mon Sep 17 00:00:00 2001 From: Viliam Repan Date: Thu, 28 Feb 2019 14:40:14 +0100 Subject: [PATCH 075/224] minor extension schema rest service fix --- .../midpoint/model/impl/ExtensionSchemaRestService.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/ExtensionSchemaRestService.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/ExtensionSchemaRestService.java index e74048e65d6..5e061a84af0 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/ExtensionSchemaRestService.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/ExtensionSchemaRestService.java @@ -102,9 +102,9 @@ public Response getSchema(@PathParam("name") String name) { .entity("Name not defined").build(); } - if (!name.toLowerCase().endsWith("\\.xsd")) { + if (!name.toLowerCase().endsWith(".xsd") && name.length() > 4) { return Response.status(Response.Status.BAD_REQUEST).type(MediaType.TEXT_PLAIN_TYPE) - .entity("Name must be and xsd schema (.xsd extension expected)").build(); + .entity("Name must be an xsd schema (.xsd extension expected)").build(); } SchemaRegistry registry = prismContext.getSchemaRegistry(); From a2e0ccc0ff669d2b0372c70b2a3008475bdfa8e3 Mon Sep 17 00:00:00 2001 From: Viliam Repan Date: Thu, 28 Feb 2019 14:41:17 +0100 Subject: [PATCH 076/224] sync script sample udpated, not finished yet --- .../resources/scriptedsql/SyncScript.groovy | 120 ++++++++++++++++++ 1 file changed, 120 insertions(+) create mode 100644 samples/resources/scriptedsql/SyncScript.groovy diff --git a/samples/resources/scriptedsql/SyncScript.groovy b/samples/resources/scriptedsql/SyncScript.groovy new file mode 100644 index 00000000000..99a26c5d29b --- /dev/null +++ b/samples/resources/scriptedsql/SyncScript.groovy @@ -0,0 +1,120 @@ +import groovy.sql.Sql +import org.forgerock.openicf.connectors.scriptedsql.ScriptedSQLConfiguration +import org.forgerock.openicf.misc.scriptedcommon.ICFObjectBuilder +import org.forgerock.openicf.misc.scriptedcommon.OperationType +import org.identityconnectors.common.logging.Log +import org.identityconnectors.framework.common.exceptions.ConnectorException + +def configuration = configuration as ScriptedSQLConfiguration +def operation = operation as OperationType +def objectClass = objectClass as ObjectClass +def log = log as Log + +log.info("Entering " + operation + " Script"); + +def sql = new Sql(connection) + +switch (operation) { + case OperationType.SYNC: + def token = token as Object + def handler = handler as SyncResultsHandler + + handleSync(sql, token, handler) + break + case OperationType.GET_LATEST_SYNC_TOKEN: + return handleGetLatestSyncToken(sql) +} + +void handleSync(Sql sql, Object tokenObject, SyncResultsHandler handler) { + String token = (String) tokenObject + + switch (objectClass) { + case ObjectClass.ACCOUNT: + handleSyncAccount(sql, token, handler) + break + default: + throw new ConnectorException("Sync not supported for object class " + objectClass) + } +} + +Object handleGetLatestSyncToken(Sql sql) { + switch (objectClass) { + case ObjectClass.ACCOUNT: + return handleSyncTokenAccount(sql) + default: + throw new ConnectorException("Sync not supported for object class " + objectClass) + } +} + +Object handleSyncAccount(Sql sql, Object token, SyncResultsHandler handler) { + def result = [] + def tstamp = null + + if (token != null) { + tstamp = new java.sql.Timestamp(token) + } else { + def today = new Date() + tstamp = new java.sql.Timestamp(today.time) + } + + Closure closure = { row -> + SyncDelta delta = buildSyncDelta(row) + + if (!handler.handle(delta)) { + throw new IllegalStateException() + } + } + + // XXX the following line is probably fine for MySQL + // sql.eachRow("select * from Users where timestamp > ${tstamp}", + // {result.add([operation:"CREATE_OR_UPDATE", uid:Integer.toString(it.id), token:it.timestamp.getTime(), attributes:[__NAME__:it.login, firstname:it.firstname, lastname:it.lastname, fullname:it.fullname, organization:it.organization, email:it.email, __ENABLE__:!(it.disabled as Boolean)]])} + + // the following line (the select statement) is for PostgreSQL with + // timestamp in microseconds - we truncate the timestamp to milliseconds + try { + sql.eachRow("select id,login,firstname,lastname,fullname,email,organization,disabled," + + "date_trunc('milliseconds', timestamp) as timestamp from Users where date_trunc('milliseconds',timestamp) > ${tstamp}", closure) + } catch (IllegalStateException ex) { + + } + + log.ok("Sync script: found " + result.size() + " events to sync") + return result; +} + +Object handleSyncTokenAccount(Sql sql) { + row = sql.firstRow("select date_trunc('milliseconds', timestamp) as timestamp from users order by timestamp desc") + + return row["timestamp"].getTime(); +} + +private SyncDelta buildSyncDelta(SyncDeltaType type, GroovyRowResult row) { + SyncDeltaBuilder builder = new SyncDeltaBuilder() + builder.setDeltaType(SyncDeltaType.CREATE_OR_UPDATE) + builder.setObjectClass(ObjectClass.ACCOUNT) + + def newToken = null // todo + if (newToken != null) { + builder.setToken(new SyncToken(newToken)) + } + + ConnectorObject obj = ICFObjectBuilder.co { + uid row.id as String + id row.name + attribute 'description', row.description + } + builder.setObject(obj) + +//result.add([operation: "CREATE_OR_UPDATE", +// uid: Integer.toString(it.id), +// token: it.timestamp.getTime(), +// attributes: [__NAME__: it.login, +// firstname: it.firstname, +// lastname: it.lastname, +// fullname: it.fullname, +// organization: it.organization, +// email: it.email, +// __ENABLE__: !(it.disabled as Boolean)]]) + + return builder.build() +} \ No newline at end of file From c834eef27a73a02465e51168e3cfa11e140957fe Mon Sep 17 00:00:00 2001 From: Pavol Mederly Date: Thu, 28 Feb 2019 14:56:37 +0100 Subject: [PATCH 077/224] Improve/fix UnassignExecutor a bit --- .../scripting/actions/UnassignExecutor.java | 82 +++++++++---------- 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/scripting/actions/UnassignExecutor.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/scripting/actions/UnassignExecutor.java index 731e5d36792..4f24532909c 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/scripting/actions/UnassignExecutor.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/scripting/actions/UnassignExecutor.java @@ -26,7 +26,6 @@ import com.evolveum.midpoint.prism.PrismValue; import com.evolveum.midpoint.prism.delta.ObjectDelta; import com.evolveum.midpoint.prism.path.ItemPath; -import com.evolveum.midpoint.prism.query.QueryFactory; import com.evolveum.midpoint.schema.constants.RelationTypes; import com.evolveum.midpoint.schema.result.OperationResult; import com.evolveum.midpoint.util.QNameUtil; @@ -45,6 +44,7 @@ import java.util.ArrayList; import java.util.Collection; +import java.util.Collections; import java.util.List; /** @@ -138,51 +138,51 @@ public PipelineData execute(ActionExpressionType expression, PipelineData input, } private ObjectDelta createDelta(AssignmentHolderType object, Collection resources, Collection roles, Collection relations) throws ScriptExecutionException { + if (relations == null || relations.isEmpty()) { + QName defaultRelation = prismContext.getDefaultRelation() != null ? + prismContext.getDefaultRelation() : RelationTypes.MEMBER.getRelation(); + relations = Collections.singletonList(QNameUtil.qNameToUri(defaultRelation)); + } List assignmentsForDelete = new ArrayList<>(); List oldAssignments = object.getAssignment(); - if(oldAssignments != null) { - for (AssignmentType oldAssignment : oldAssignments) { - if(oldAssignment.getTargetRef() != null) { - if (roles != null) { - outerloop: - for (ObjectReferenceType roleRef : roles) { - if(oldAssignment.getTargetRef().getOid().equals(roleRef.getOid())) { - if(relations != null && !relations.isEmpty()) { - for (String relationQuery : relations) { - if(prismContext.relationMatches(QNameUtil.uriToQName(relationQuery, true), oldAssignment.getTargetRef().getRelation())) { - assignmentsForDelete.add(oldAssignment.clone()); - break outerloop; - } - } - } else { - if(prismContext.relationMatches(RelationTypes.MEMBER.getRelation(), oldAssignment.getTargetRef().getRelation())) { - assignmentsForDelete.add(oldAssignment.clone()); - break outerloop; - } - } - } - } - } - } else if(oldAssignment.getConstruction() != null) { - if (resources != null) { - for (ObjectReferenceType resourceRef : resources) { - if(oldAssignment.getConstruction().getResourceRef() != null - && oldAssignment.getConstruction().getResourceRef().getOid().equals(resourceRef.getOid())) { - assignmentsForDelete.add(oldAssignment.clone()); - break; - } - } - } - } - } - } - - ObjectDelta delta = null; + for (AssignmentType oldAssignment : oldAssignments) { + ObjectReferenceType targetRef = oldAssignment.getTargetRef(); + if (targetRef != null) { + if (roles != null) { + outerloop: + for (ObjectReferenceType roleRef : roles) { + if (targetRef.getOid() != null && targetRef.getOid().equals(roleRef.getOid())) { + for (String relationQuery : relations) { + if (prismContext.relationMatches(QNameUtil.uriToQName(relationQuery, true), targetRef.getRelation())) { + assignmentsForDelete.add(oldAssignment.clone()); + break outerloop; + } + } + } + } + } + } else if (oldAssignment.getConstruction() != null) { + if (resources != null) { + for (ObjectReferenceType resourceRef : resources) { + if (oldAssignment.getConstruction().getResourceRef() != null && + oldAssignment.getConstruction().getResourceRef().getOid() != null && + oldAssignment.getConstruction().getResourceRef().getOid().equals(resourceRef.getOid())) { + assignmentsForDelete.add(oldAssignment.clone()); + break; + } + } + } + } + } + + ObjectDelta delta; try { - delta = prismContext.deltaFor(object.getClass()).item(ItemPath.create(AssignmentHolderType.F_ASSIGNMENT)) - .delete(assignmentsForDelete.toArray(new AssignmentType[0])).asObjectDelta(object.getOid()); + delta = prismContext.deltaFor(object.getClass()) + .item(ItemPath.create(AssignmentHolderType.F_ASSIGNMENT)) + .deleteRealValues(assignmentsForDelete) + .asObjectDelta(object.getOid()); } catch (SchemaException e) { throw new ScriptExecutionException("Couldn't prepare modification to delete resource/role assignments", e); } From 48c515ce65990d97e81d1ed7285ac420f039f7d1 Mon Sep 17 00:00:00 2001 From: Pavol Mederly Date: Thu, 28 Feb 2019 15:43:21 +0100 Subject: [PATCH 078/224] Fix NPE for resource with pwd-as-config (MID-5046) --- .../java/com/evolveum/midpoint/common/crypto/CryptoUtil.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/infra/common/src/main/java/com/evolveum/midpoint/common/crypto/CryptoUtil.java b/infra/common/src/main/java/com/evolveum/midpoint/common/crypto/CryptoUtil.java index 5ee9ab83c5a..7dde814276c 100644 --- a/infra/common/src/main/java/com/evolveum/midpoint/common/crypto/CryptoUtil.java +++ b/infra/common/src/main/java/com/evolveum/midpoint/common/crypto/CryptoUtil.java @@ -200,7 +200,7 @@ private static void checkEncrypted(PrismPropertyValue pval) { @SuppressWarnings("unchecked") PrismPropertyValue psPval = (PrismPropertyValue)pval; ProtectedStringType ps = psPval.getValue(); - if (ps.getClearValue() != null) { + if (ps != null && ps.getClearValue() != null) { throw new IllegalStateException("Unencrypted value in field " + propName); } } else if (itemDef.getTypeName().equals(MailConfigurationType.COMPLEX_TYPE)) { From a330353a19c1e79aaec81a4291c8e879dce4450f Mon Sep 17 00:00:00 2001 From: skublik Date: Thu, 28 Feb 2019 15:59:20 +0100 Subject: [PATCH 079/224] fix model-intest TestScriptingBasic --- .../model/intest/scripting/TestScriptingBasic.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/scripting/TestScriptingBasic.java b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/scripting/TestScriptingBasic.java index 784d9b367da..8fd0d778eb6 100644 --- a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/scripting/TestScriptingBasic.java +++ b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/scripting/TestScriptingBasic.java @@ -819,7 +819,7 @@ public void test500ScriptingUsers() throws Exception { result.computeStatus(); TestUtil.assertSuccess(result); PipelineData data = output.getFinalOutput(); - assertEquals("Unexpected # of items in output", 5, data.getData().size()); + assertEquals("Unexpected # of items in output", 6, data.getData().size()); Set realOids = new HashSet<>(); for (PipelineItem item : data.getData()) { PrismValue value = item.getValue(); @@ -829,7 +829,7 @@ public void test500ScriptingUsers() throws Exception { assertSuccess(item.getResult()); } assertEquals("Unexpected OIDs in output", - Sets.newHashSet(Arrays.asList(USER_ADMINISTRATOR_OID, USER_JACK_OID, USER_BARBOSSA_OID, USER_GUYBRUSH_OID, USER_ELAINE_OID)), + Sets.newHashSet(Arrays.asList(USER_ADMINISTRATOR_OID, USER_JACK_OID, USER_BARBOSSA_OID, USER_GUYBRUSH_OID, USER_ELAINE_OID, USER_WILL_OID)), realOids); } @@ -947,7 +947,7 @@ public void test510GeneratePasswords() throws Exception { result.computeStatus(); TestUtil.assertSuccess(result); PipelineData data = output.getFinalOutput(); - assertEquals("Unexpected # of items in output", 5, data.getData().size()); + assertEquals("Unexpected # of items in output", 6, data.getData().size()); Set realOids = new HashSet<>(); for (PipelineItem item : data.getData()) { PrismValue value = item.getValue(); @@ -957,7 +957,7 @@ public void test510GeneratePasswords() throws Exception { realOids.add(user.getOid()); } assertEquals("Unexpected OIDs in output", - Sets.newHashSet(Arrays.asList(USER_ADMINISTRATOR_OID, USER_JACK_OID, USER_BARBOSSA_OID, USER_GUYBRUSH_OID, USER_ELAINE_OID)), + Sets.newHashSet(Arrays.asList(USER_ADMINISTRATOR_OID, USER_JACK_OID, USER_BARBOSSA_OID, USER_GUYBRUSH_OID, USER_ELAINE_OID, USER_WILL_OID)), realOids); } From a44164ae64e58f9da9d4a02abca5ac0e50b62fb9 Mon Sep 17 00:00:00 2001 From: Katarina Valalikova Date: Thu, 28 Feb 2019 18:22:55 +0100 Subject: [PATCH 080/224] imrpovements for validate security question/answers (MID-5030) --- .../ModelInteractionServiceImpl.java | 74 ++++++++++-- testing/rest/pom.xml | 4 + .../testing/rest/RestServiceInitializer.java | 2 + .../testing/rest/TestAbstractRestService.java | 106 +++++++++++++++--- .../rest/src/test/resources/logback-test.xml | 10 +- .../policy-generate-password-execute.json | 5 - ...security-answer-check-expression-fail.json | 13 +++ ...date-security-answer-check-expression.json | 13 +++ .../test/resources/repo/security-policy.xml | 2 + .../resources/repo/system-configuration.xml | 6 +- .../repo/value-policy-security-answer.xml | 92 +++++++++++++++ .../xml/policy-generate-password-execute.xml | 1 - ...-security-answer-check-expression-fail.xml | 15 +++ ...idate-security-answer-check-expression.xml | 15 +++ .../repo/xml/script-generate-passwords.xml | 1 + .../yaml/policy-generate-password-execute.yml | 3 - ...-security-answer-check-expression-fail.yml | 6 + ...idate-security-answer-check-expression.yml | 6 + 18 files changed, 334 insertions(+), 40 deletions(-) create mode 100644 testing/rest/src/test/resources/repo/json/policy-validate-security-answer-check-expression-fail.json create mode 100644 testing/rest/src/test/resources/repo/json/policy-validate-security-answer-check-expression.json create mode 100644 testing/rest/src/test/resources/repo/value-policy-security-answer.xml create mode 100644 testing/rest/src/test/resources/repo/xml/policy-validate-security-answer-check-expression-fail.xml create mode 100644 testing/rest/src/test/resources/repo/xml/policy-validate-security-answer-check-expression.xml create mode 100644 testing/rest/src/test/resources/repo/yaml/policy-validate-security-answer-check-expression-fail.yml create mode 100644 testing/rest/src/test/resources/repo/yaml/policy-validate-security-answer-check-expression.yml diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/controller/ModelInteractionServiceImpl.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/controller/ModelInteractionServiceImpl.java index 4b051ae8be9..2ea9820efa0 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/controller/ModelInteractionServiceImpl.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/controller/ModelInteractionServiceImpl.java @@ -1132,15 +1132,20 @@ private ValuePolicyType getValuePolicy(PrismObject obj CredentialsPolicyType policy = null; PrismObject user = null; if (object != null && object.getCompileTimeClass().isAssignableFrom(UserType.class)) { + LOGGER.trace("Start to resolve policy for user"); user = (PrismObject) object; policy = getCredentialsPolicy(user, task, parentResult); + LOGGER.trace("Resolved user policy: {}", policy); } + + SystemConfigurationType systemConfigurationType = getSystemConfiguration(parentResult); if (!containsValuePolicyDefinition(policy)) { SecurityPolicyType securityPolicy = securityHelper.locateGlobalSecurityPolicy(user, systemConfigurationType.asPrismObject(), task, parentResult); if (securityPolicy != null) { policy = securityPolicy.getCredentials(); + LOGGER.trace("Resolved policy from global security policy: {}", policy); } } @@ -1148,6 +1153,7 @@ private ValuePolicyType getValuePolicy(PrismObject obj SecurityPolicyType securityPolicy = securityHelper.locateGlobalPasswordPolicy(systemConfigurationType, task, parentResult); if (securityPolicy != null) { policy = securityPolicy.getCredentials(); + LOGGER.trace("Resolved global password policy: {}", policy); } } @@ -1278,15 +1284,34 @@ private boolean validateValue(PrismObject object, V evaluator.setOriginResolver(getOriginResolver(object)); evaluator.setTask(task); evaluator.setShortDesc(" rest validate "); - if (object != null && path != null && path.isSuperPathOrEquivalent(SchemaConstants.PATH_PASSWORD)) { - evaluator.setSecurityPolicy(getSecurityPolicy((PrismObject) object, task, parentResult)); - PrismContainer password = object.findContainer(SchemaConstants.PATH_PASSWORD); - PasswordType passwordType = null; - if (password != null) { - PrismContainerValue passwordPcv = password.getValue(); - passwordType = passwordPcv != null ? passwordPcv.asContainerable() : null; + if (object != null && path != null) { + if (path.isSuperPathOrEquivalent(SchemaConstants.PATH_PASSWORD)) { + + evaluator.setSecurityPolicy(getSecurityPolicy((PrismObject) object, task, parentResult)); + PrismContainer password = object.findContainer(SchemaConstants.PATH_PASSWORD); + PasswordType passwordType = null; + if (password != null) { + PrismContainerValue passwordPcv = password.getValue(); + passwordType = passwordPcv != null ? passwordPcv.asContainerable() : null; + } + evaluator.setOldCredentialType(passwordType); + } else if (path.isSuperPathOrEquivalent(SchemaConstants.PATH_SECURITY_QUESTIONS)) { + LOGGER.trace("Setting security questions related policy."); + SecurityPolicyType securityPolicy = getSecurityPolicy((PrismObject) object, task, parentResult); + evaluator.setSecurityPolicy(securityPolicy); + PrismContainer securityQuestionsContainer = object.findContainer(SchemaConstants.PATH_SECURITY_QUESTIONS); + SecurityQuestionsCredentialsType securityQuestions = null; + if (securityQuestionsContainer != null) { + PrismContainerValue secQestionPcv = securityQuestionsContainer.getValue(); + securityQuestions = secQestionPcv != null ? secQestionPcv.asContainerable() : null; + } + //evaluator.setOldCredentialType(securityQuestions); + + ValuePolicyType valuePolicy = resolveSecurityQuestionsPolicy(securityPolicy, task, parentResult); + if (valuePolicy != null) { + evaluator.setValuePolicy(valuePolicy); + } } - evaluator.setOldCredentialType(passwordType); } evaluator.setNow(clock.currentTimeXMLGregorianCalendar()); LOGGER.trace("Validating value started"); @@ -1310,6 +1335,39 @@ private boolean validateValue(PrismObject object, V } + /** + * @param securityPolicy + * @return + * @throws ExpressionEvaluationException + * @throws SecurityViolationException + * @throws ConfigurationException + * @throws CommunicationException + * @throws SchemaException + * @throws ObjectNotFoundException + */ + private ValuePolicyType resolveSecurityQuestionsPolicy(SecurityPolicyType securityPolicy, Task task, OperationResult result) throws ObjectNotFoundException, SchemaException, CommunicationException, ConfigurationException, SecurityViolationException, ExpressionEvaluationException { + if (securityPolicy == null) { + return null; + } + + CredentialsPolicyType credentialsPolicy = securityPolicy.getCredentials(); + if (credentialsPolicy == null) { + return null; + } + + SecurityQuestionsCredentialsPolicyType securityQuestionsPolicy = credentialsPolicy.getSecurityQuestions(); + if (securityQuestionsPolicy == null) { + return null; + } + + ObjectReferenceType policyRef = securityQuestionsPolicy.getValuePolicyRef(); + if (policyRef == null) { + return null; + } + + return objectResolver.resolve(policyRef, ValuePolicyType.class, null, " resolve value policy for security questions", task, result); + } + private AbstractValuePolicyOriginResolver getOriginResolver(PrismObject object) { if (object != null && UserType.class.equals(object.getCompileTimeClass())) { return (AbstractValuePolicyOriginResolver) new UserValuePolicyOriginResolver((PrismObject) object, objectResolver); diff --git a/testing/rest/pom.xml b/testing/rest/pom.xml index 8a6da5398aa..6e9c10929ca 100644 --- a/testing/rest/pom.xml +++ b/testing/rest/pom.xml @@ -110,6 +110,10 @@ repo-test-util 4.0-SNAPSHOT + + javax.xml.bind + jaxb-api + commons-lang diff --git a/testing/rest/src/test/java/com/evolveum/midpoint/testing/rest/RestServiceInitializer.java b/testing/rest/src/test/java/com/evolveum/midpoint/testing/rest/RestServiceInitializer.java index 0c1387598ee..356b21c71e3 100644 --- a/testing/rest/src/test/java/com/evolveum/midpoint/testing/rest/RestServiceInitializer.java +++ b/testing/rest/src/test/java/com/evolveum/midpoint/testing/rest/RestServiceInitializer.java @@ -105,6 +105,7 @@ public abstract class RestServiceInitializer { public static final File VALUE_POLICY_GENERAL = new File(BASE_REPO_DIR, "value-policy-general.xml"); public static final File VALUE_POLICY_NUMERIC = new File(BASE_REPO_DIR, "value-policy-numeric.xml"); public static final File VALUE_POLICY_SIMPLE = new File(BASE_REPO_DIR, "value-policy-simple.xml"); + public static final File VALUE_POLICY_SECURITY_ANSWER = new File(BASE_REPO_DIR, "value-policy-security-answer.xml"); public static final File SECURITY_POLICY = new File(BASE_REPO_DIR, "security-policy.xml"); public static final File SECURITY_POLICY_NO_HISTORY = new File(BASE_REPO_DIR, "security-policy-no-history.xml"); @@ -177,6 +178,7 @@ public void startServer() throws Exception { addObject(VALUE_POLICY_GENERAL, result); addObject(VALUE_POLICY_NUMERIC, result); addObject(VALUE_POLICY_SIMPLE, result); + addObject(VALUE_POLICY_SECURITY_ANSWER, result); addObject(SECURITY_POLICY, result); addObject(SYSTEM_CONFIGURATION_FILE, result); diff --git a/testing/rest/src/test/java/com/evolveum/midpoint/testing/rest/TestAbstractRestService.java b/testing/rest/src/test/java/com/evolveum/midpoint/testing/rest/TestAbstractRestService.java index fc7972d51d7..b3c3394accb 100644 --- a/testing/rest/src/test/java/com/evolveum/midpoint/testing/rest/TestAbstractRestService.java +++ b/testing/rest/src/test/java/com/evolveum/midpoint/testing/rest/TestAbstractRestService.java @@ -17,8 +17,8 @@ import static com.evolveum.midpoint.test.IntegrationTestTools.display; import static com.evolveum.midpoint.test.util.TestUtil.displayTestTitle; -import static com.evolveum.midpoint.test.util.TestUtil.displayWhen; import static com.evolveum.midpoint.test.util.TestUtil.displayThen; +import static com.evolveum.midpoint.test.util.TestUtil.displayWhen; import static org.testng.AssertJUnit.assertEquals; import static org.testng.AssertJUnit.assertNotNull; import static org.testng.AssertJUnit.assertTrue; @@ -34,17 +34,6 @@ import javax.xml.datatype.XMLGregorianCalendar; import javax.xml.namespace.QName; -import com.evolveum.midpoint.prism.Referencable; -import com.evolveum.midpoint.prism.crypto.EncryptionException; -import com.evolveum.midpoint.prism.polystring.PolyString; -import com.evolveum.midpoint.prism.xml.XmlTypeConverter; -import com.evolveum.midpoint.repo.api.RepoAddOptions; -import com.evolveum.midpoint.util.exception.*; - -import com.evolveum.midpoint.xml.ns._public.common.api_types_3.ExecuteScriptResponseType; -import com.evolveum.midpoint.xml.ns._public.common.common_3.*; -import com.evolveum.midpoint.xml.ns._public.model.scripting_3.PipelineItemType; -import com.evolveum.prism.xml.ns._public.types_3.RawType; import org.apache.commons.lang.BooleanUtils; import org.apache.commons.lang.StringUtils; import org.apache.cxf.jaxrs.client.WebClient; @@ -52,7 +41,12 @@ import org.testng.annotations.Test; import com.evolveum.midpoint.prism.PrismObject; +import com.evolveum.midpoint.prism.Referencable; +import com.evolveum.midpoint.prism.crypto.EncryptionException; import com.evolveum.midpoint.prism.delta.ChangeType; +import com.evolveum.midpoint.prism.polystring.PolyString; +import com.evolveum.midpoint.prism.xml.XmlTypeConverter; +import com.evolveum.midpoint.repo.api.RepoAddOptions; import com.evolveum.midpoint.schema.GetOperationOptions; import com.evolveum.midpoint.schema.SelectorOptions; import com.evolveum.midpoint.schema.constants.SchemaConstants; @@ -60,10 +54,33 @@ import com.evolveum.midpoint.schema.result.OperationResultStatus; import com.evolveum.midpoint.util.MiscUtil; import com.evolveum.midpoint.util.QNameUtil; +import com.evolveum.midpoint.util.exception.ObjectNotFoundException; +import com.evolveum.midpoint.util.exception.SchemaException; import com.evolveum.midpoint.util.logging.Trace; import com.evolveum.midpoint.util.logging.TraceManager; +import com.evolveum.midpoint.xml.ns._public.common.api_types_3.ExecuteScriptResponseType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.ActivationStatusType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.CredentialsType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.FunctionLibraryType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.LocalizableMessageListType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.LocalizableMessageType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectTemplateType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.OperationResultStatusType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.OperationResultType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.PasswordType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.RoleType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.ScriptExpressionEvaluatorType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.SecurityQuestionAnswerType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.SecurityQuestionsCredentialsType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.SingleLocalizableMessageType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.SystemObjectsType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.UserType; +import com.evolveum.midpoint.xml.ns._public.model.scripting_3.PipelineItemType; import com.evolveum.prism.xml.ns._public.query_3.QueryType; import com.evolveum.prism.xml.ns._public.types_3.ProtectedStringType; +import com.evolveum.prism.xml.ns._public.types_3.RawType; public abstract class TestAbstractRestService extends RestServiceInitializer { @@ -101,6 +118,8 @@ public abstract class TestAbstractRestService extends RestServiceInitializer { public static final String POLICY_ITEM_DEFINITION_VALIDATE_PASSWORD_PASSWORD_HISTORY_CONFLICT = "policy-validate-password-history-conflict"; public static final String POLICY_ITEM_DEFINITION_VALIDATE_IMPLICIT_MULTI = "policy-validate-implicit-multi"; public static final String POLICY_ITEM_DEFINITION_VALIDATE_IMPLICIT_MULTI_CONFLICT = "policy-validate-implicit-multi-conflict"; + public static final String POLICY_ITEM_DEFINITION_VALIDATE_SECURITY_ANSWER_CHECK_EXPRESSION_FAIL = "policy-validate-security-answer-check-expression-fail"; + public static final String POLICY_ITEM_DEFINITION_VALIDATE_SECURITY_ANSWER_CHECK_EXPRESSION = "policy-validate-security-answer-check-expression"; public static final String SCRIPT_GENERATE_PASSWORDS = "script-generate-passwords"; public static final String SCRIPT_MODIFY_VALID_TO = "script-modify-validTo"; @@ -1303,7 +1322,7 @@ public void test518validateValueImplicitPassword() throws Exception { assertEquals("Expected 200 but got " + response.getStatus(), 200, response.getStatus()); - + addObject(SECURITY_POLICY, RepoAddOptions.createOverwrite(), result); display("Audit", getDummyAuditService()); getDummyAuditService().assertRecords(2); @@ -1330,12 +1349,9 @@ public void test520GeneratePasswordsUsingScripting() throws Exception { assertEquals("Expected 200 but got " + response.getStatus(), 200, response.getStatus()); - display("Audit", getDummyAuditService()); - getDummyAuditService().assertRecords(4); - getDummyAuditService().assertLoginLogout(SchemaConstants.CHANNEL_REST_URI); - ExecuteScriptResponseType responseData = response.readEntity(ExecuteScriptResponseType.class); display("Response", getPrismContext().xmlSerializer().serializeRealValue(responseData)); + LOGGER.info("Response: {}", getPrismContext().xmlSerializer().serializeRealValue(responseData)); List items = responseData.getOutput().getDataOutput().getItem(); assertEquals("Wrong # of processed items", 2, items.size()); @@ -1352,13 +1368,20 @@ public void test520GeneratePasswordsUsingScripting() throws Exception { ItemProcessingResult second = extractedResults.get(1); assertEquals("Wrong OID in second result", USER_JACK_OID, second.oid); assertEquals("Wrong name in second result", "jack", second.name); + LOGGER.info("pwd in second result {}", second.data.password); assertNotNull("Missing password in second result", second.data.password); + assertEquals("Wrong status in second result", OperationResultStatusType.SUCCESS, second.status); UserType jackAfter = getRepositoryService() .getObject(UserType.class, USER_JACK_OID, null, new OperationResult("getObject")).asObjectable(); display("jack after", jackAfter); assertNotNull("password not set", jackAfter.getCredentials().getPassword().getValue()); + + display("Audit", getDummyAuditService()); + getDummyAuditService().assertRecords(4); + getDummyAuditService().assertLoginLogout(SchemaConstants.CHANNEL_REST_URI); + } @Test @@ -1646,6 +1669,55 @@ public void test606ModifySecurityQuestionReplaceAnswer() throws Exception { display("User after", userRepoAfter); assertSecurityQuestionAnswer(userRepoAfter.asObjectable(), "you would not believe what happens next"); } + + @Test + public void test607validateSecurityAnswerCheckExpressionFail() throws Exception { + final String TEST_NAME = "test607validateSecurityAnswerCheckExpressionFail"; + displayTestTitle(this, TEST_NAME); + + WebClient client = prepareClient(); + client.path("/users/" + USER_DARTHADDER_OID + "/validate"); + + getDummyAuditService().clear(); + + displayWhen(TEST_NAME); + Response response = client.post(getRepoFile(POLICY_ITEM_DEFINITION_VALIDATE_SECURITY_ANSWER_CHECK_EXPRESSION_FAIL)); + + displayThen(TEST_NAME); + displayResponse(response); + traceResponse(response); + + assertEquals("Expected 409 but got " + response.getStatus(), 409, response.getStatus()); + + + display("Audit", getDummyAuditService()); + getDummyAuditService().assertRecords(2); + getDummyAuditService().assertLoginLogout(SchemaConstants.CHANNEL_REST_URI); + } + + @Test + public void test608validateSecurityAnswerCheckExpression() throws Exception { + final String TEST_NAME = "test607validateSecurityAnswerCheckExpression"; + displayTestTitle(this, TEST_NAME); + + WebClient client = prepareClient(); + client.path("/users/" + USER_DARTHADDER_OID + "/validate"); + + getDummyAuditService().clear(); + + displayWhen(TEST_NAME); + Response response = client.post(getRepoFile(POLICY_ITEM_DEFINITION_VALIDATE_SECURITY_ANSWER_CHECK_EXPRESSION)); + + displayThen(TEST_NAME); + displayResponse(response); + + assertEquals("Expected 200 but got " + response.getStatus(), 200, response.getStatus()); + + + display("Audit", getDummyAuditService()); + getDummyAuditService().assertRecords(2); + getDummyAuditService().assertLoginLogout(SchemaConstants.CHANNEL_REST_URI); + } private void assertSecurityQuestionAnswer(UserType userType, String expectedAnswer) throws EncryptionException { CredentialsType credentials = userType.getCredentials(); diff --git a/testing/rest/src/test/resources/logback-test.xml b/testing/rest/src/test/resources/logback-test.xml index fd6724b5793..e3bd917c13d 100644 --- a/testing/rest/src/test/resources/logback-test.xml +++ b/testing/rest/src/test/resources/logback-test.xml @@ -16,13 +16,10 @@ --> - - ./target/test.log - - %date [%thread] %-5level [%X{subsystem}]\(%logger{46}\): %message%n + %date [%thread] %-5level \(%logger{46}\): %message%n @@ -32,6 +29,9 @@ + + + @@ -50,7 +50,7 @@ - + diff --git a/testing/rest/src/test/resources/repo/json/policy-generate-password-execute.json b/testing/rest/src/test/resources/repo/json/policy-generate-password-execute.json index 36904f66889..f7e1eda5677 100644 --- a/testing/rest/src/test/resources/repo/json/policy-generate-password-execute.json +++ b/testing/rest/src/test/resources/repo/json/policy-generate-password-execute.json @@ -5,11 +5,6 @@ "target": { "path": "credentials/password/value" }, - "valuePolicyRef": { - "@ns": "http://midpoint.evolveum.com/xml/ns/public/common/common-3", - "type": "http://midpoint.evolveum.com/xml/ns/public/common/common-3#ValuePolicyType", - "oid": "81818181-76e0-0000-8888-3d4f02d3fffb" - }, "execute" : "true" }] } diff --git a/testing/rest/src/test/resources/repo/json/policy-validate-security-answer-check-expression-fail.json b/testing/rest/src/test/resources/repo/json/policy-validate-security-answer-check-expression-fail.json new file mode 100644 index 00000000000..1e8b4a82ef7 --- /dev/null +++ b/testing/rest/src/test/resources/repo/json/policy-validate-security-answer-check-expression-fail.json @@ -0,0 +1,13 @@ +{ + "@ns": "http://midpoint.evolveum.com/xml/ns/public/common/api-types-3", + "policyItemsDefinition": { + "policyItemDefinition": [ + { + "target": { + "path": "credentials/securityQuestions/questionAnswer[1]/questionAnswer" + }, + "value": "darthadder" + } + ] + } +} \ No newline at end of file diff --git a/testing/rest/src/test/resources/repo/json/policy-validate-security-answer-check-expression.json b/testing/rest/src/test/resources/repo/json/policy-validate-security-answer-check-expression.json new file mode 100644 index 00000000000..c440f58d783 --- /dev/null +++ b/testing/rest/src/test/resources/repo/json/policy-validate-security-answer-check-expression.json @@ -0,0 +1,13 @@ +{ + "@ns": "http://midpoint.evolveum.com/xml/ns/public/common/api-types-3", + "policyItemsDefinition": { + "policyItemDefinition": [ + { + "target": { + "path": "credentials/securityQuestions/questionAnswer[1]/questionAnswer" + }, + "value": "another" + } + ] + } +} \ No newline at end of file diff --git a/testing/rest/src/test/resources/repo/security-policy.xml b/testing/rest/src/test/resources/repo/security-policy.xml index 2cb82ee5595..9a7305867b2 100644 --- a/testing/rest/src/test/resources/repo/security-policy.xml +++ b/testing/rest/src/test/resources/repo/security-policy.xml @@ -25,6 +25,7 @@ PT3M PT15M 3 + P30D @@ -38,6 +39,7 @@ PT3M PT15M 1 + http://midpoint.evolveum.com/xml/ns/public/security/question-2#q001 true diff --git a/testing/rest/src/test/resources/repo/system-configuration.xml b/testing/rest/src/test/resources/repo/system-configuration.xml index 4b3fb4c1ee7..df7a42b8e7f 100644 --- a/testing/rest/src/test/resources/repo/system-configuration.xml +++ b/testing/rest/src/test/resources/repo/system-configuration.xml @@ -36,6 +36,10 @@ com.evolveum.midpoint.model DEBUG + + com.evolveum.midpoint.model.impl.controller + TRACE + com.evolveum.midpoint.model.impl.security.MidpointRestAuthenticationHandler TRACE @@ -52,6 +56,6 @@ IDM_LOG INFO - + diff --git a/testing/rest/src/test/resources/repo/value-policy-security-answer.xml b/testing/rest/src/test/resources/repo/value-policy-security-answer.xml new file mode 100644 index 00000000000..26e9dffcbda --- /dev/null +++ b/testing/rest/src/test/resources/repo/value-policy-security-answer.xml @@ -0,0 +1,92 @@ + + + + Security Policy General + Complex Password policy requires at least one lowercase letter, at least one uppercase letter, at least one digit +and at least on special character in the password. The password must start +with a lowercase letter and must be at least 6 characters long. + + 999 + 9 + 0 + 0 + + + String validation policy + + 4 + 32 + 3 + + + + Lowercase alphanumeric characters + 1 + false + + abcdefghijklmnopqrstuvwxyz + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Password must not contain User ID + + + + diff --git a/testing/rest/src/test/resources/repo/xml/policy-generate-password-execute.xml b/testing/rest/src/test/resources/repo/xml/policy-generate-password-execute.xml index 5a1281703e3..df68a707f11 100644 --- a/testing/rest/src/test/resources/repo/xml/policy-generate-password-execute.xml +++ b/testing/rest/src/test/resources/repo/xml/policy-generate-password-execute.xml @@ -9,7 +9,6 @@ credentials/password/value - true \ No newline at end of file diff --git a/testing/rest/src/test/resources/repo/xml/policy-validate-security-answer-check-expression-fail.xml b/testing/rest/src/test/resources/repo/xml/policy-validate-security-answer-check-expression-fail.xml new file mode 100644 index 00000000000..5be6f1414ba --- /dev/null +++ b/testing/rest/src/test/resources/repo/xml/policy-validate-security-answer-check-expression-fail.xml @@ -0,0 +1,15 @@ + + + + + credentials/securityQuestions/questionAnswer[1]/questionAnswer + + darthadder + + + \ No newline at end of file diff --git a/testing/rest/src/test/resources/repo/xml/policy-validate-security-answer-check-expression.xml b/testing/rest/src/test/resources/repo/xml/policy-validate-security-answer-check-expression.xml new file mode 100644 index 00000000000..798795c1ce2 --- /dev/null +++ b/testing/rest/src/test/resources/repo/xml/policy-validate-security-answer-check-expression.xml @@ -0,0 +1,15 @@ + + + + + credentials/securityQuestions/questionAnswer[1]/questionAnswer + + another + + + \ No newline at end of file diff --git a/testing/rest/src/test/resources/repo/xml/script-generate-passwords.xml b/testing/rest/src/test/resources/repo/xml/script-generate-passwords.xml index fc506226ee2..11b8640a086 100644 --- a/testing/rest/src/test/resources/repo/xml/script-generate-passwords.xml +++ b/testing/rest/src/test/resources/repo/xml/script-generate-passwords.xml @@ -18,6 +18,7 @@ diff --git a/testing/rest/src/test/resources/repo/yaml/policy-generate-password-execute.yml b/testing/rest/src/test/resources/repo/yaml/policy-generate-password-execute.yml index 2d12c206e26..10225ddfa17 100644 --- a/testing/rest/src/test/resources/repo/yaml/policy-generate-password-execute.yml +++ b/testing/rest/src/test/resources/repo/yaml/policy-generate-password-execute.yml @@ -3,7 +3,4 @@ policyItemsDefinition: policyItemDefinition: - target: path: "credentials/password/value" - valuePolicyRef: - type: "http://midpoint.evolveum.com/xml/ns/public/common/common-3#ValuePolicyType" - oid: "81818181-76e0-0000-8888-3d4f02d3fffb" execute: true \ No newline at end of file diff --git a/testing/rest/src/test/resources/repo/yaml/policy-validate-security-answer-check-expression-fail.yml b/testing/rest/src/test/resources/repo/yaml/policy-validate-security-answer-check-expression-fail.yml new file mode 100644 index 00000000000..dbc3d2e9f2b --- /dev/null +++ b/testing/rest/src/test/resources/repo/yaml/policy-validate-security-answer-check-expression-fail.yml @@ -0,0 +1,6 @@ +'@ns': "http://midpoint.evolveum.com/xml/ns/public/common/api-types-3" +policyItemsDefinition: + policyItemDefinition: + - target: + path: "credentials/securityQuestions/questionAnswer[1]/questionAnswer" + value: "darthadder" \ No newline at end of file diff --git a/testing/rest/src/test/resources/repo/yaml/policy-validate-security-answer-check-expression.yml b/testing/rest/src/test/resources/repo/yaml/policy-validate-security-answer-check-expression.yml new file mode 100644 index 00000000000..60a6c1f43ed --- /dev/null +++ b/testing/rest/src/test/resources/repo/yaml/policy-validate-security-answer-check-expression.yml @@ -0,0 +1,6 @@ +'@ns': "http://midpoint.evolveum.com/xml/ns/public/common/api-types-3" +policyItemsDefinition: + policyItemDefinition: + - target: + path: "credentials/securityQuestions/questionAnswer[1]/questionAnswer" + value: "another" \ No newline at end of file From 7729666b2cf76521e53f89f7253bb763ee207927 Mon Sep 17 00:00:00 2001 From: kate Date: Thu, 28 Feb 2019 18:41:18 +0100 Subject: [PATCH 081/224] fix for MID-5088 (accounts column in the popup) --- .../api/component/AbstractPopupTabPanel.java | 15 +++++++ .../component/data/column/ColumnUtils.java | 44 ++++++++++--------- 2 files changed, 38 insertions(+), 21 deletions(-) diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/gui/api/component/AbstractPopupTabPanel.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/gui/api/component/AbstractPopupTabPanel.java index ccdd3045d59..bb6e833cb79 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/gui/api/component/AbstractPopupTabPanel.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/gui/api/component/AbstractPopupTabPanel.java @@ -21,8 +21,10 @@ import com.evolveum.midpoint.prism.query.OrFilter; import com.evolveum.midpoint.prism.query.RefFilter; import com.evolveum.midpoint.schema.constants.ObjectTypes; +import com.evolveum.midpoint.web.component.data.column.ColumnUtils; import com.evolveum.midpoint.web.component.util.SelectableBean; import com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour; +import com.evolveum.midpoint.xml.ns._public.common.common_3.AbstractRoleType; import com.evolveum.midpoint.xml.ns._public.common.common_3.AssignmentHolderType; import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectReferenceType; import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType; @@ -30,6 +32,7 @@ import org.apache.commons.lang.ArrayUtils; import org.apache.wicket.Component; import org.apache.wicket.ajax.AjaxRequestTarget; +import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn; import org.apache.wicket.markup.html.WebMarkupContainer; import org.apache.wicket.markup.html.panel.Fragment; import org.apache.wicket.model.IModel; @@ -37,6 +40,7 @@ import java.util.ArrayList; import java.util.Arrays; +import java.util.Collection; import java.util.List; /** @@ -74,6 +78,17 @@ true, getPageBase()) { private static final long serialVersionUID = 1L; + @Override + protected List, String>> createColumns() { + if (AbstractRoleType.class.isAssignableFrom(getType())){ + List, String>> columns = new ArrayList<>(); + columns.addAll((Collection)ColumnUtils.getDefaultAbstractRoleColumns(false)); + return columns; + } else { + return super.createColumns(); + } + } + @Override protected void onUpdateCheckbox(AjaxRequestTarget target, IModel> rowModel) { onSelectionPerformed(target, rowModel); diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/data/column/ColumnUtils.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/data/column/ColumnUtils.java index 947bfbc3d92..61eb4f3d90e 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/data/column/ColumnUtils.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/data/column/ColumnUtils.java @@ -342,7 +342,7 @@ public static List, String>> ge List, String>> columns = new ArrayList<>(); - columns.addAll((Collection)getDefaultAbstractRoleColumns(RoleType.COMPLEX_TYPE)); + columns.addAll((Collection)getDefaultAbstractRoleColumns(true)); return columns; } @@ -350,7 +350,7 @@ public static List, String>> ge public static List, String>> getDefaultServiceColumns() { List, String>> columns = new ArrayList<>(); - columns.addAll((Collection)getDefaultAbstractRoleColumns(ServiceType.COMPLEX_TYPE)); + columns.addAll((Collection)getDefaultAbstractRoleColumns(true)); return columns; } @@ -358,12 +358,12 @@ public static List, String>> ge public static List, String>> getDefaultOrgColumns() { List, String>> columns = new ArrayList<>(); - columns.addAll((Collection)getDefaultAbstractRoleColumns(OrgType.COMPLEX_TYPE)); + columns.addAll((Collection)getDefaultAbstractRoleColumns(true)); return columns; } - private static List, String>> getDefaultAbstractRoleColumns(QName type) { + public static List, String>> getDefaultAbstractRoleColumns(boolean showAccounts) { String sortByDisplayName = null; String sortByIdentifer = null; @@ -381,28 +381,30 @@ private static List, Stri ); List, String>> columns = createColumns(columnsDefs); - - IColumn, String> column = new AbstractExportableColumn, String>( - createStringResource("pageUsers.accounts")) { - @Override - public void populateItem(Item>> cellItem, - String componentId, IModel> model) { - cellItem.add(new Label(componentId, - model.getObject().getValue() != null ? - model.getObject().getValue().getLinkRef().size() : null)); - } + if (showAccounts) { + IColumn, String> column = new AbstractExportableColumn, String>( + createStringResource("pageUsers.accounts")) { - @Override - public IModel getDataModel(IModel> rowModel) { - return Model.of(rowModel.getObject().getValue() != null ? - Integer.toString(rowModel.getObject().getValue().getLinkRef().size()) : ""); - } + @Override + public void populateItem(Item>> cellItem, + String componentId, IModel> model) { + cellItem.add(new Label(componentId, + model.getObject().getValue() != null ? + model.getObject().getValue().getLinkRef().size() : null)); + } + @Override + public IModel getDataModel(IModel> rowModel) { + return Model.of(rowModel.getObject().getValue() != null ? + Integer.toString(rowModel.getObject().getValue().getLinkRef().size()) : ""); + } - }; - columns.add(column); + }; + + columns.add(column); + } return columns; } From 6b27f218a545d1d3731ee35b080191dca50ead52 Mon Sep 17 00:00:00 2001 From: kate Date: Fri, 1 Mar 2019 09:02:08 +0100 Subject: [PATCH 082/224] assignment holder types list for org members panel --- .../MultiTypesMemberPopupTabPanel.java | 2 +- .../gui/api/util/WebComponentUtil.java | 36 +++++++++++++++++++ .../admin/users/component/OrgMemberPanel.java | 3 +- 3 files changed, 39 insertions(+), 2 deletions(-) diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/gui/api/component/MultiTypesMemberPopupTabPanel.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/gui/api/component/MultiTypesMemberPopupTabPanel.java index 68a7ea5dc0f..7157adc55f1 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/gui/api/component/MultiTypesMemberPopupTabPanel.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/gui/api/component/MultiTypesMemberPopupTabPanel.java @@ -92,7 +92,7 @@ protected ObjectDelta prepareDelta(){ } protected List getSupportedTypesList(){ - List supportedTypes = new ArrayList<>(Arrays.asList(ObjectTypes.values())); + List supportedTypes = WebComponentUtil.createAssignmentHolderTypesList(); supportedTypes.remove(ObjectTypes.USER); supportedTypes.remove(ObjectTypes.ROLE); supportedTypes.remove(ObjectTypes.SERVICE); diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/gui/api/util/WebComponentUtil.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/gui/api/util/WebComponentUtil.java index 86f00f42920..1d120e00970 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/gui/api/util/WebComponentUtil.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/gui/api/util/WebComponentUtil.java @@ -687,6 +687,42 @@ public static List createObjectTypeList() { } + public static List createAssignmentHolderTypeQnamesList() { + + List objectTypes = createAssignmentHolderTypesList(); + List types = new ArrayList<>(); + objectTypes.forEach(objectType -> { + types.add(objectType.getTypeQName()); + }); + + return types.stream().sorted((type1, type2) -> { + Validate.notNull(type1); + Validate.notNull(type2); + + return String.CASE_INSENSITIVE_ORDER.compare(QNameUtil.qNameToUri(type1), QNameUtil.qNameToUri(type2)); + + + }).collect(Collectors.toList()); + + } + + public static List createAssignmentHolderTypesList(){ + List objectTypes = new ArrayList<>(); + for (ObjectTypes t : ObjectTypes.values()) { + if (AssignmentHolderType.class.isAssignableFrom(t.getClassDefinition())) { + objectTypes.add(t); + } + } + return objectTypes.stream().sorted((type1, type2) -> { + Validate.notNull(type1); + Validate.notNull(type2); + + return String.CASE_INSENSITIVE_ORDER.compare(QNameUtil.qNameToUri(type1.getTypeQName()), QNameUtil.qNameToUri(type2.getTypeQName())); + + + }).collect(Collectors.toList()); + } + // TODO: move to schema component public static List createFocusTypeList() { return createFocusTypeList(false); diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/users/component/OrgMemberPanel.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/users/component/OrgMemberPanel.java index 0491550d63a..df0ccabb986 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/users/component/OrgMemberPanel.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/users/component/OrgMemberPanel.java @@ -112,9 +112,10 @@ protected void unassignMembersPerformed(QName objectType, QueryScope scope, Coll @Override protected List getSupportedObjectTypes(boolean includeAbstractTypes) { - List objectTypes = WebComponentUtil.createObjectTypeList(); + List objectTypes = WebComponentUtil.createAssignmentHolderTypeQnamesList(); objectTypes.remove(ShadowType.COMPLEX_TYPE); objectTypes.remove(ObjectType.COMPLEX_TYPE); + objectTypes.remove(AssignmentHolderType.COMPLEX_TYPE); return objectTypes; } From 0ddbf58c873830400ec89b8afa945758a44252fa Mon Sep 17 00:00:00 2001 From: skublik Date: Fri, 1 Mar 2019 12:31:05 +0100 Subject: [PATCH 083/224] increase number of users --- ...stractInitializedModelIntegrationTest.java | 2 +- .../intest/security/AbstractSecurityTest.java | 3 +- .../intest/sync/AbstractInboundSyncTest.java | 38 +++++++++---------- .../AbstractSynchronizationStoryTest.java | 6 +-- .../intest/sync/TestInboundLiveSyncTask.java | 4 +- .../src/test/resources/common/user-will.xml | 1 - 6 files changed, 27 insertions(+), 27 deletions(-) diff --git a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/AbstractInitializedModelIntegrationTest.java b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/AbstractInitializedModelIntegrationTest.java index c0662faa1b0..ca3d0ce0500 100644 --- a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/AbstractInitializedModelIntegrationTest.java +++ b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/AbstractInitializedModelIntegrationTest.java @@ -68,7 +68,7 @@ public class AbstractInitializedModelIntegrationTest extends AbstractConfiguredM protected static final Trace LOGGER = TraceManager.getTrace(AbstractInitializedModelIntegrationTest.class); - private static final int NUMBER_OF_IMPORTED_USERS = 4; + private static final int NUMBER_OF_IMPORTED_USERS = 5; private static final int NUMBER_OF_IMPORTED_ROLES = 16; @Autowired protected MappingFactory mappingFactory; diff --git a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/security/AbstractSecurityTest.java b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/security/AbstractSecurityTest.java index 6561647db3f..4203790587e 100644 --- a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/security/AbstractSecurityTest.java +++ b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/security/AbstractSecurityTest.java @@ -369,7 +369,7 @@ public abstract class AbstractSecurityTest extends AbstractInitializedModelInteg protected static final XMLGregorianCalendar JACK_VALID_FROM_LONG_AGO = XmlTypeConverter.createXMLGregorianCalendar(10000L); protected static final XMLGregorianCalendar JACK_VALID_TO_LONG_AGEAD = XmlTypeConverter.createXMLGregorianCalendar(10000000000000L); - protected static final int NUMBER_OF_ALL_USERS = 11; + protected static final int NUMBER_OF_ALL_USERS = 12; protected static final int NUMBER_OF_IMPORTED_ROLES = 69; protected static final int NUMBER_OF_ALL_ORGS = 11; @@ -604,6 +604,7 @@ protected void cleanupAutzTest(String userOid, int expectedAssignments) throws O cleanupDelete(UserType.class, USER_RAPP_OID, task, result); cleanupDelete(UserType.class, USER_MANCOMB_OID, task, result); cleanupDelete(UserType.class, USER_CAPSIZE_OID, task, result); + cleanupDelete(UserType.class, USER_WILL_OID, task, result); cleanupAdd(USER_LARGO_FILE, task, result); cleanupAdd(USER_LECHUCK_FILE, task, result); cleanupAdd(USER_ESTEVAN_FILE, task, result); diff --git a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/sync/AbstractInboundSyncTest.java b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/sync/AbstractInboundSyncTest.java index ebafe4bba35..5ff8757ef35 100644 --- a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/sync/AbstractInboundSyncTest.java +++ b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/sync/AbstractInboundSyncTest.java @@ -69,7 +69,7 @@ public abstract class AbstractInboundSyncTest extends AbstractInitializedModelIn protected static final Date ACCOUNT_MANCOMB_VALID_TO_DATE = MiscUtil.asDate(2066, 5, 4, 3, 2, 1); protected static final String ACCOUNT_POSIXUSER_DUMMY_USERNAME = "posixuser"; - + protected static String userWallyOid; protected boolean allwaysCheckTimestamp = false; @@ -131,7 +131,7 @@ public void test110AddDummyEmeraldAccountMancomb() throws Exception { prepareNotifications(); // Preconditions - assertUsers(5); + assertUsers(6); DummyAccount account = new DummyAccount(ACCOUNT_MANCOMB_DUMMY_USERNAME); account.setEnabled(true); @@ -171,7 +171,7 @@ public void test110AddDummyEmeraldAccountMancomb() throws Exception { assertLinked(userMancomb, accountMancomb); - assertUsers(6); + assertUsers(7); // notifications notificationManager.setDisabled(true); @@ -189,7 +189,7 @@ public void test120ModifyDummyEmeraldAccountMancombSeepbad() throws Exception { prepareNotifications(); // Preconditions - assertUsers(6); + assertUsers(7); DummyAccount account = dummyResourceEmerald.getAccountByUsername(ACCOUNT_MANCOMB_DUMMY_USERNAME); @@ -226,7 +226,7 @@ public void test120ModifyDummyEmeraldAccountMancombSeepbad() throws Exception { PrismAsserts.assertPropertyValue(userAfter, UserType.F_FULL_NAME, PrismTestUtil.createPolyString("Mancomb Seepbad")); - assertUsers(6); + assertUsers(7); // notifications notificationManager.setDisabled(true); @@ -244,7 +244,7 @@ public void test122ModifyDummyEmeraldAccountMancombSeepNULL() throws Exception { prepareNotifications(); // Preconditions - assertUsers(6); + assertUsers(7); DummyAccount account = dummyResourceEmerald.getAccountByUsername(ACCOUNT_MANCOMB_DUMMY_USERNAME); @@ -281,7 +281,7 @@ public void test122ModifyDummyEmeraldAccountMancombSeepNULL() throws Exception { PrismAsserts.assertNoItem(userAfter, UserType.F_FULL_NAME); - assertUsers(6); + assertUsers(7); // notifications notificationManager.setDisabled(true); @@ -299,7 +299,7 @@ public void test124ModifyDummyEmeraldAccountMancombSeepevil() throws Exception { prepareNotifications(); // Preconditions - assertUsers(6); + assertUsers(7); DummyAccount account = dummyResourceEmerald.getAccountByUsername(ACCOUNT_MANCOMB_DUMMY_USERNAME); @@ -336,7 +336,7 @@ public void test124ModifyDummyEmeraldAccountMancombSeepevil() throws Exception { PrismAsserts.assertPropertyValue(userAfter, UserType.F_FULL_NAME, PrismTestUtil.createPolyString("Mancomb Seepevil")); - assertUsers(6); + assertUsers(7); // notifications notificationManager.setDisabled(true); @@ -354,7 +354,7 @@ public void test126ModifyDummyEmeraldAccountMancombTitlePirate() throws Exceptio prepareNotifications(); // Preconditions - assertUsers(6); + assertUsers(7); DummyAccount account = dummyResourceEmerald.getAccountByUsername(ACCOUNT_MANCOMB_DUMMY_USERNAME); @@ -392,7 +392,7 @@ public void test126ModifyDummyEmeraldAccountMancombTitlePirate() throws Exceptio PrismAsserts.assertPropertyValue(userAfter, UserType.F_FULL_NAME, PrismTestUtil.createPolyString("Mancomb Seepevil")); PrismAsserts.assertPropertyValue(userAfter, UserType.F_TITLE, PrismTestUtil.createPolyString("Pirate")); - assertUsers(6); + assertUsers(7); // notifications notificationManager.setDisabled(true); @@ -410,7 +410,7 @@ public void test127ModifyDummyEmeraldAccountMancombTitlePirateNull() throws Exce prepareNotifications(); // Preconditions - assertUsers(6); + assertUsers(7); DummyAccount account = dummyResourceEmerald.getAccountByUsername(ACCOUNT_MANCOMB_DUMMY_USERNAME); @@ -448,7 +448,7 @@ public void test127ModifyDummyEmeraldAccountMancombTitlePirateNull() throws Exce PrismAsserts.assertPropertyValue(userAfter, UserType.F_FULL_NAME, PrismTestUtil.createPolyString("Mancomb Seepevil")); PrismAsserts.assertNoItem(userAfter, UserType.F_TITLE); - assertUsers(6); + assertUsers(7); // notifications notificationManager.setDisabled(true); @@ -466,7 +466,7 @@ public void test129ModifyDummyEmeraldAccountMancombSeepgood() throws Exception { prepareNotifications(); // Preconditions - assertUsers(6); + assertUsers(7); DummyAccount account = dummyResourceEmerald.getAccountByUsername(ACCOUNT_MANCOMB_DUMMY_USERNAME); @@ -503,7 +503,7 @@ public void test129ModifyDummyEmeraldAccountMancombSeepgood() throws Exception { PrismAsserts.assertPropertyValue(userAfter, UserType.F_FULL_NAME, PrismTestUtil.createPolyString("Mancomb Seepgood")); - assertUsers(6); + assertUsers(7); // notifications notificationManager.setDisabled(true); @@ -531,7 +531,7 @@ public void test300AddDummyEmeraldAccountPosixUser() throws Exception { prepareNotifications(); // Preconditions - assertUsers(6); + assertUsers(7); DummyAccount account = new DummyAccount(ACCOUNT_POSIXUSER_DUMMY_USERNAME); account.setEnabled(true); @@ -567,7 +567,7 @@ public void test300AddDummyEmeraldAccountPosixUser() throws Exception { assertAdministrativeStatusEnabled(userPosixUser); assertLinked(userPosixUser, accountPosixUser); - assertUsers(7); + assertUsers(8); // notifications notificationManager.setDisabled(true); @@ -589,7 +589,7 @@ public void test310ModifyDummyEmeraldAccountPosixUserUidNumber() throws Exceptio prepareNotifications(); // Preconditions - assertUsers(7); + assertUsers(8); DummyAccount account = dummyResourceEmerald.getAccountByUsername(ACCOUNT_POSIXUSER_DUMMY_USERNAME); @@ -620,7 +620,7 @@ public void test310ModifyDummyEmeraldAccountPosixUserUidNumber() throws Exceptio assertLinked(userAfter, accountAfter); - assertUsers(7); + assertUsers(8); // notifications notificationManager.setDisabled(true); diff --git a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/sync/AbstractSynchronizationStoryTest.java b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/sync/AbstractSynchronizationStoryTest.java index 6408971c8ee..0f1c041a9ff 100644 --- a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/sync/AbstractSynchronizationStoryTest.java +++ b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/sync/AbstractSynchronizationStoryTest.java @@ -143,7 +143,7 @@ public void test110AddDummyGreenAccountMancomb() throws Exception { prepareNotifications(); // Preconditions - assertUsers(5); + assertUsers(6); DummyAccount account = new DummyAccount(ACCOUNT_MANCOMB_DUMMY_USERNAME); account.setEnabled(true); @@ -181,7 +181,7 @@ public void test110AddDummyGreenAccountMancomb() throws Exception { assertLinked(userMancomb, accountMancomb); - assertUsers(6); + assertUsers(7); // notifications displayAllNotifications(); @@ -251,7 +251,7 @@ public void test210AddDummyGreenAccountWally() throws Exception { assertUser(userWally, userWallyOid, ACCOUNT_WALLY_DUMMY_USERNAME, "Wally Feed", null, null); assertLinks(userWally, 1); - assertUsers(7); + assertUsers(8); assertLinked(userWally, accountWallyGreen); diff --git a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/sync/TestInboundLiveSyncTask.java b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/sync/TestInboundLiveSyncTask.java index 1fcb198d0e5..88424156f38 100644 --- a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/sync/TestInboundLiveSyncTask.java +++ b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/sync/TestInboundLiveSyncTask.java @@ -80,7 +80,7 @@ public void test199DeleteDummyEmeraldAccountMancomb() throws Exception { prepareNotifications(); // Preconditions - assertUsers(6); + assertUsers(7); /// WHEN displayWhen(TEST_NAME); @@ -112,7 +112,7 @@ public void test199DeleteDummyEmeraldAccountMancomb() throws Exception { assertNoDummyAccount(ACCOUNT_MANCOMB_DUMMY_USERNAME); - assertUsers(6); + assertUsers(7); // notifications notificationManager.setDisabled(true); diff --git a/model/model-intest/src/test/resources/common/user-will.xml b/model/model-intest/src/test/resources/common/user-will.xml index d2c309a1a6a..c552243300a 100644 --- a/model/model-intest/src/test/resources/common/user-will.xml +++ b/model/model-intest/src/test/resources/common/user-will.xml @@ -24,7 +24,6 @@ xmlns:org="http://midpoint.evolveum.com/xml/ns/public/common/org-3"> will - PIRATE Will Turner From 7a09c56d2723ea525fdc3e7a1c978b96afa41922 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Ga=C5=A1par=C3=ADk?= Date: Fri, 1 Mar 2019 12:40:25 +0100 Subject: [PATCH 084/224] Translation, WIP --- .../localization/Midpoint_cs.properties | 6 +- .../localization/Midpoint_fr.properties | 64 +++++++++---------- .../localization/Midpoint_it.properties | 6 +- .../localization/Midpoint_ja.properties | 26 ++++---- .../localization/Midpoint_pl.properties | 2 +- .../localization/schema_fr.properties | 18 +++--- 6 files changed, 61 insertions(+), 61 deletions(-) diff --git a/gui/admin-gui/src/main/resources/localization/Midpoint_cs.properties b/gui/admin-gui/src/main/resources/localization/Midpoint_cs.properties index 989560c5347..0b97954ddab 100644 --- a/gui/admin-gui/src/main/resources/localization/Midpoint_cs.properties +++ b/gui/admin-gui/src/main/resources/localization/Midpoint_cs.properties @@ -3456,15 +3456,15 @@ PageAdmin.menu.top.roles.edit=Upravit roli PageAdmin.menu.top.users.org.edit=Upravit organizaci PageSelfCredentials.tabs.password=Heslo PageSelfCredentials.title=Změna hesla -PageSelfCredentials.oldPasswordLabel=Staré heslo +PageSelfCredentials.oldPasswordLabel=Stávající heslo PageSelfCredentials.passwordLabel1=Nové heslo PageSelfCredentials.passwordLabel2=Potvrdit heslo PageSelfCredentials.accountMidpoint=Správce identit PageSelfCredentials.resourceMidpoint=Repozitář identit PageSelfCredentials.noAccountSelected=Heslo nebylo změněno. Nebyl vybrán žádný účet. PageSelfCredentials.emptyPasswordFiled=Je třeba vyplnit položky pro nové heslo. -PageSelfCredentials.incorrectOldPassword=Heslo nebylo změněno. Staré heslo není správně. -PageSelfCredentials.specifyOldPasswordMessage=Zadejte staré heslo +PageSelfCredentials.incorrectOldPassword=Heslo nebylo změněno. Stávající heslo není správně zadáno. +PageSelfCredentials.specifyOldPasswordMessage=Zadejte stávající heslo ChangePasswordPanel.accountsTable.header=Propagace hesla ChangePasswordPanel.name=Název ChangePasswordPanel.resourceName=Aplikace diff --git a/gui/admin-gui/src/main/resources/localization/Midpoint_fr.properties b/gui/admin-gui/src/main/resources/localization/Midpoint_fr.properties index 706ce51efc0..91916fbecbb 100644 --- a/gui/admin-gui/src/main/resources/localization/Midpoint_fr.properties +++ b/gui/admin-gui/src/main/resources/localization/Midpoint_fr.properties @@ -652,7 +652,7 @@ ObjectPolicyDialog.property.placeholder=Insérer un chemin de propriété ObjectPolicyDialog.subtype=Sous-type d'objet ObjectPolicyDialog.template=Gabarit d'objet ObjectPolicyDialog.type=Type d'objet -ObjectPolicyDialogDto.message.preparePolicyConfig.warning=Skipping setting property constraint, no path was defined. +ObjectPolicyDialogDto.message.preparePolicyConfig.warning=Aucune contrainte sur la propriété n'est établie car aucun chemin n'a été défini. ObjectPolicyConfigurationTabPanel.type=Type ObjectPolicyConfigurationTabPanel.subtype=Sous-type ObjectPolicyConfigurationTabPanel.objectTemplate=Gabarit d'objet @@ -1104,8 +1104,8 @@ PageAdmin.menu.top.configuration.expressionEvaluator=Évaluateur d'expression PageAdmin.menu.top.configuration.importObject=Importer un objet PageAdmin.menu.top.configuration.internals=Configuration interne PageAdmin.menu.top.configuration.objectPolicy=Politique des objets -PageAdmin.menu.top.configuration.globalPolicyRule=Règle globale de politique -PageAdmin.menu.top.configuration.globalAccountSynchronization=Synchronisation globale des comptes +PageAdmin.menu.top.configuration.globalPolicyRule=Règles de politique globale +PageAdmin.menu.top.configuration.globalAccountSynchronization=Synchronisation des comptes PageAdmin.menu.top.configuration.cleanupPolicy=Politique de nettoyage PageAdmin.menu.top.configuration.workflow=Configuration de flux de travaux PageAdmin.menu.top.configuration.roleManagement=Gestion des rôles @@ -1116,7 +1116,7 @@ PageAdmin.menu.top.configuration.logging=Journalisation PageAdmin.menu.top.configuration.deploymentInformation=Information de déploiement PageAdmin.menu.top.configuration.notifications=Notifications PageAdmin.menu.top.configuration.profiling=Profilage -PageAdmin.menu.top.configuration.adminGui=Interface graphique d'administration +PageAdmin.menu.top.configuration.adminGui=Interface graphique d'admin. PageAdmin.menu.top.configuration.repositoryObjects=Objets du dépôt PageAdmin.menu.top.configuration.repositoryObjectsList=Tous les objets PageAdmin.menu.top.configuration.security=Sécurité @@ -2081,7 +2081,7 @@ PageRoles.title=Tous les rôles pageSecurityQuestions.message.WrongAnswer=Questions non répondues correctement pageSecurityQuestions.message.noPolicySet=Aucune politique des mots de passe n'est définie PageSecurityQuestions.title=Questions de sécurité -PageShowPassword.message=Votre nouveau mot de passe est : +PageShowPassword.message=Votre nouveau mot de passe est : PageShowPassword.success=Le nouveau mot de passe a été créé avec succès PageShowPassword.title=Nouveau Mot de Passe PageSizePopover.title=Lignes par page @@ -2093,10 +2093,10 @@ pageSystemConfiguration.assignmentPolicyEnforcement.value.positive=Positive pageSystemConfiguration.logging.title=Journalisation pageSystemConfiguration.notifications.title=Notifications pageSystemConfiguration.profiling.title=Profilage -pageSystemConfiguration.adminGui.title=Admin GUI +pageSystemConfiguration.adminGui.title=Interface graphique d'admin. pageSystemConfiguration.system.title=Système pageSystemConfiguration.objectPolicy.title=Politique des objets -pageSystemConfiguration.globalPolicyRule.title=Règle globale de politique +pageSystemConfiguration.globalPolicyRule.title=Règles de politique globale pageSystemConfiguration.globalAccountSynchronization.title=Synchronisation globale des comptes pageSystemConfiguration.cleanupPolicy.title=Politique de nettoyage pageSystemConfiguration.roleManagement.title=Gestion des rôles @@ -2792,7 +2792,7 @@ ResourceCredentialsEditor.label=Modifier les informations d'identification de la ResourceCredentialsEditor.label.fetchStrategy=Stratégie d'obtention ResourceCredentialsEditor.label.inbound=Entrant ResourceCredentialsEditor.label.outbound=Sortant -ResourceCredentialsEditor.label.passwordPolicyRef=Stratégie de mot de passe +ResourceCredentialsEditor.label.passwordPolicyRef=Politique de mot de passe ResourceDependencyEditor.label.button.add=Ajouter une dépendance de ressource ResourceDependencyEditor.label=Modifier les dépendances ResourceDependencyEditor.label.intent=Finalité de la dépendance @@ -3425,7 +3425,7 @@ PageAdmin.menu.profile=Profil PageAdmin.menu.assignments=Attributions PageAdmin.menu.credentials=Informations d'identification PageAdmin.menu.request=Demander un rôle -PageTemplate.version=Version: +PageTemplate.version=Version : PageTemplate.copy=Copyright © 2010-2018 Evolveum® et ses partenaires.  PageTemplate.toggleNavigation=Toggle navigation PageTemplate.user=utilisateur @@ -3437,7 +3437,7 @@ TableConfigurationPanel.pageSize=Lignes par page TableConfigurationPanel.tableColumns=Table columnsCountToolbar.label.unknownCount=Displaying {0,number,integer} to {1,number,integer}, nombre inconnu de résultats correspondants. MyRequestsPanel.started=Démarré MyRequestsPanel.rejected=Rejeté -MyRequestsPanel.skipped=Passé +MyRequestsPanel.skipped=Ignoré MyRequestsPanel.approved=Validé MyRequestsPanel.inProgress=En cours MyRequestsPanel.unknown=Inconnu @@ -3873,9 +3873,9 @@ AssignmentConflictPanel.undoAction=Annuler PageAssignmentConflicts.title=Conflits entre attributions PageAssignmentConflicts.back=Retour PageAssignmentConflicts.submit=Soumettre -PageAssignmentsList.conflictsWarning=Unable to calculate assignment conflicts due to authorization problem. Reason: +PageAssignmentsList.conflictsWarning=Impossible de calculer les conflits d'attribution dus à des problèmes d'autorisation. Cause : AbstractShoppingCartTabPanel.addAllButton=Les ajouter tou(te)s -AbstractShoppingCartTabPanel.goToShoppingCartButton=Go to shopping cart +AbstractShoppingCartTabPanel.goToShoppingCartButton=Voir le panier AbstractShoppingCartTabPanel.requestingForLabel=Demande pour AbstractShoppingCartTabPanel.availableRelationsLabel=Relations disponibles AssignmentCatalogPanel.selectTargetUser=Sélectionner l'utilisateur cible @@ -4155,8 +4155,8 @@ PolicyConstraintsType.objectMinAssigneesViolation=Violation du nombre minimal d' PolicyConstraintsType.objectMaxAssigneesViolation=Violation du nombre maximal d'attributaires de l'objet PolicyConstraintsType.modification=Modification PolicyConstraintsType.assignment=Attribution -PolicyConstraintsType.objectTimeValidity=Object time validity -PolicyConstraintsType.assignmentTimeValidity=Validité du temps d'attribution +PolicyConstraintsType.objectTimeValidity=Durée de validité de l'objet +PolicyConstraintsType.assignmentTimeValidity=Durée de validité des attributions PolicyConstraintsType.situation=Situation PolicyConstraintsType.transition=Transition PolicyConstraintsType.ref=Réf @@ -4168,11 +4168,11 @@ ExpressionValuePanel.literalValueTitle=Valeur littérale ExpressionValuePanel.associationTargetSearchTitle=Filtre pour la recherche de la cible de l'association ExpressionValuePanel.path=Chemin ExpressionValuePanel.value=Valeur -ExpressionValuePanel.specifyExpression=Specify expression -ExpressionValuePanel.addValueButtonDefaultTitle=Add shadow reference value +ExpressionValuePanel.specifyExpression=Spécifier l'expression +ExpressionValuePanel.addValueButtonDefaultTitle=Ajouter une valeur de référence du reflet ExpressionValuePanel.addValueButtonTargetSearchTitle=Ajouter une recherche de cible de l'association ExpressionValuePanel.addLiteralValueButton=Ajouter une valeur littérale -ExpressionValuePanel.associationDefenitionsNotDefined=Association definitions are not defined for the current resource with selected kind/intent parameters. +ExpressionValuePanel.associationDefenitionsNotDefined=Aucune définition d'association n'est définie pour la ressource actuelle avec les paramètres sorte et finalité sélectionnés. ConstructionType.attribute=Attribut ConstructionType.association=Association operation.Recompute.ALL.members=Recalculer tous les membres @@ -4259,32 +4259,32 @@ ItemPathPanel.button.reset=Réinitialiser le chemin ApprovalPolicyActionType.details.newValue=Nouvelle action de politique de validation LifecycleStateType.details.newValue=État du nouveau cycle de vie NotificationPolicyActionType.details.newValue=Nouvelle action de politique de notification -PropertyConstraintType.details.newValue=Nouvelle contrainte de propriété -objectState.details.newValue=New object state -assignmentState.details.newValue=Nouvel état d'attribution -hasAssignment.details.newValue=New has assignment -hasNoAssignment.details.newValue=New has no assignment +PropertyConstraintType.details.newValue=Nouvelle contrainte sur une propriété +objectState.details.newValue=Nouvelle contrainte relative à l'état de l'objet +assignmentState.details.newValue=Nouvelle contrainte relative à l'état de l'attribution +hasAssignment.details.newValue=Nouvelle contrainte relative à la présence d'attributions +hasNoAssignment.details.newValue=Nouvelle contrainte relative à l'absence d'attributions exclusion.details.newValue=Nouvelle exclusion minAssignees.details.newValue=Nouveau nombre minimal d'attributaires maxAssignees.details.newValue=Nouveau nombre maximal d'attributaires -modification.details.newValue=Nouvelle modification -assignment.details.newValue=Nouvelle attribution -objectTimeValidity.details.newValue=New object time validity -assignmentTimeValidity.details.newValue=New assignment time validity -situation.details.newValue=Nouvelle situation de politique +modification.details.newValue=Nouvelle contrainte sur la modification de l'objet +assignment.details.newValue=Nouvelle contrainte sur la modification d'une attribution +objectTimeValidity.details.newValue=Nouvelle contrainte sur la durée de validité de l'objet +assignmentTimeValidity.details.newValue=Nouvelle contrainte sur la durée de validité des attributions +situation.details.newValue=Nouvelle contrainte relative à une situation de politique transition.details.newValue=Nouvelle transition ref.details.newValue=Nouvelle référence objectMaxAssigneesViolation.details.newValue=Violation du nombre maximal d'attributaires du nouvel objet objectMinAssigneesViolation.details.newValue=Violation du nombre minimal d'attributaires du nouvel objet -PolicyConstraintReferenceType.details.newValue=New policy constraint reference +PolicyConstraintReferenceType.details.newValue=Nouvelle référence à une contrainte de politique RichHyperlinkType.details.newValue=New rich hyperlink UserInterfaceFeatureType.details.newValue=New user interface feature GuiObjectDetailsPageType.details.newValue=Page de détails du nouvel objet gui -ObjectFormType.details.newValue=Formulaire pour un nouvel objet +ObjectFormType.details.newValue=Nouveau formulaire d'objet GuiObjectColumnType.details.newValue=Colonne du nouvel objet gui GuiObjectListViewType.details.newValue=Vue de la liste d'objets du nouvel objet gui DashboardWidgetType.details.newValue=Nouvelle vignette de tableau de bord -RelationDefinitionType.details.newValue=Définition d'une nouvelle relation +RelationDefinitionType.details.newValue=Nouvelle définition de relation GuiActionType.details.newValue=Nouvelle action GUI ApprovalStageDefinitionType.details.newValue=Nouvelle définition de phase de validation WorkItemTimedActionsType.details.newValue=Actions programmées pour un nouveau travail @@ -4302,8 +4302,8 @@ minAssignees.details=Nombre minimal d'attributaires maxAssignees.details=Nombre maximal d'attributaires modification.details=Modification assignment.details=Attribution -objectTimeValidity.details=Object time validity -assignmentTimeValidity.details=Validité du temps d'attribution +objectTimeValidity.details=Durée de validité de l'objet +assignmentTimeValidity.details=Durée de validité des attributions situation.details=Situation de politique transition.details=Transition ref.details=Référence diff --git a/gui/admin-gui/src/main/resources/localization/Midpoint_it.properties b/gui/admin-gui/src/main/resources/localization/Midpoint_it.properties index 6a949c698d9..754b18512da 100644 --- a/gui/admin-gui/src/main/resources/localization/Midpoint_it.properties +++ b/gui/admin-gui/src/main/resources/localization/Midpoint_it.properties @@ -1666,12 +1666,12 @@ pageDebugList.dialog.title.confirmDelete=Conferma cancellazione pageDebugList.dialog.title.deleteAll=Elimini Tutti gli Oggetti pageDebugList.menu.deleteAllIdentities=Elimina tutte le identità pageDebugList.menu.deleteAllType=Elimina tutto il tipo selezionato -pageDebugList.menu.deleteSelected=Delete selected/filtered +pageDebugList.menu.deleteSelected=Elimina selezionato/filtrato pageDebugList.menu.deleteShadowsOnResource=Elimina tutti gli shadow nella risorsa pageDebugList.menu.exportShadowsOnResource=Esporta tutti gli shadows nella risorsa pageDebugList.menu.exportAll=Esporta tutti gli oggetti pageDebugList.menu.exportAllSelectedType=Esporta tutto il tipo selezionato -pageDebugList.menu.exportSelected=Export selected/filtered +pageDebugList.menu.exportSelected=Esporta selezionato/filtrato pageDebugList.message.countSearchProblem=Impossibile eseguire operazioni di ricerca su utenti /shadow/unita' organizzative pageDebugList.message.createFileException=Impossibile creare il file per il download. pageDebugList.message.deleteAllType=Vuoi davvero cancellare tutti gli oggetti di tipo "{0}"? @@ -4172,7 +4172,7 @@ ExpressionValuePanel.specifyExpression=Specifica espressione ExpressionValuePanel.addValueButtonDefaultTitle=Aggiungi il valore del riferimento shadow ExpressionValuePanel.addValueButtonTargetSearchTitle=Aggiungi ricerca target di associazione ExpressionValuePanel.addLiteralValueButton=Aggiungi valore letterale -ExpressionValuePanel.associationDefenitionsNotDefined=Association definitions are not defined for the current resource with selected kind/intent parameters. +ExpressionValuePanel.associationDefenitionsNotDefined=Le definizioni di associazione non sono definite per la risorsa corrente con i parametri di tipo/Intent selezionati. ConstructionType.attribute=Attributo ConstructionType.association=Associazione operation.Recompute.ALL.members=Ricalcola tutti i membri diff --git a/gui/admin-gui/src/main/resources/localization/Midpoint_ja.properties b/gui/admin-gui/src/main/resources/localization/Midpoint_ja.properties index fb0a07e4c9e..1f0357a8cbb 100644 --- a/gui/admin-gui/src/main/resources/localization/Midpoint_ja.properties +++ b/gui/admin-gui/src/main/resources/localization/Midpoint_ja.properties @@ -1148,7 +1148,7 @@ PageAdmin.menu.top.users=ユーザー PageAdmin.menu.top.valuePolicies.list= バリュー・ポリシー一覧 PageAdmin.menu.top.valuePolicies.new = 新しいバリュー・ポリシー PageAdmin.menu.top.valuePolicies= バリュー・ポリシー -PageAdmin.menu.top.workItems.listClaimable=私の主張するアイテム +PageAdmin.menu.top.workItems.listClaimable=私が要求できるアイテム PageAdmin.menu.top.workItems.list=私のアイテム PageAdmin.menu.top.workItems.listAll=すべてのアイテム PageAdmin.menu.top.workItems.listProcessInstancesAll=全リクエスト @@ -1666,12 +1666,12 @@ pageDebugList.dialog.title.confirmDelete=削除の確認 pageDebugList.dialog.title.deleteAll=すべてのオブジェクトの削除 pageDebugList.menu.deleteAllIdentities=すべての識別子の削除 pageDebugList.menu.deleteAllType=選択したすべてのタイプを削除 -pageDebugList.menu.deleteSelected=Delete selected/filtered +pageDebugList.menu.deleteSelected=選択/フィルターされたものを削除 pageDebugList.menu.deleteShadowsOnResource=リソース上のすべてのシャドウを削除 pageDebugList.menu.exportShadowsOnResource=リソース上のすべてのシャドウをエクスポート pageDebugList.menu.exportAll=すべてのオブジェクトのエクスポート pageDebugList.menu.exportAllSelectedType=選択したすべてのタイプをエクスポート -pageDebugList.menu.exportSelected=Export selected/filtered +pageDebugList.menu.exportSelected=選択/フィルターされたものをエクスポート pageDebugList.message.countSearchProblem=ユーザー/シャドウ/組織単位に対する検索操作を実行できませんでした。 pageDebugList.message.createFileException=ダウンロードするファイルを作成できませんでした。 pageDebugList.message.deleteAllType=本当にタイプ"{0}"のすべてのオブジェクトを削除しますか? @@ -2601,7 +2601,7 @@ pageWorkItems.button.approve=承認 pageWorkItems.button.claim=クレーム pageWorkItems.button.reject=却下 pageWorkItems.button.release=リリース -PageWorkItemsClaimable.title=私がクレーム可能な作業アイテム +PageWorkItemsClaimable.title=私が要求できる作業アイテム pageWorkItems.item.created=Created on pageWorkItems.item.name=名前 pageWorkItems.item.owner=オーナー @@ -2612,7 +2612,7 @@ pageWorkItems.message.success.approved=業務アイテムが正常に承認さ pageWorkItems.message.partialError.approved=予期しない例外のために作業アイテムを承認/却下できませんでした。 pageWorkItems.message.success.rejected=業務アイテムが正常に拒否されました。 pageWorkItems.message.success.claimed=業務アイテムが正常に要求されました。 -pageWorkItems.message.partialError.claimed=予期しない例外のために作業アイテムを請求できませんでした。 +pageWorkItems.message.partialError.claimed=予期しない例外のために作業アイテムを要求できませんでした。 pageWorkItems.message.success.released={0}個の業務アイテムが正常にリリースされました。 pageWorkItems.message.partialError.released=予期しない例外のために作業アイテムを解放できませんでした。 PageWorkItemsAll.title=すべての作業アイテム @@ -2842,8 +2842,8 @@ ResourceWizard.expression.tooltip.type=式のタイプ。 これは式がスク ResourceWizard.help.capabilityStep=

リソース機能はリソースができることです。すべてのリソースが機能的に同じというわけではありません。例えば、 1つのリソースはアカウントの有効化(アカウントの有効化と無効化)をサポートしますが、その他はサポートしません。 1つのリソースが読み書きアクセスを提供し、他のリソースが読み取り専用アクセスをサポートできます。一方のリソースはリアルタイム同期をサポートしますが、他方はサポートしません。機能は、リソースがサポートする機能を定義し、システムがそれに応じて動作できるようにします。

すべての機能を無効にする(つまりオフにする)ことができます。この機能を無効にすると、システムはコネクターとリソースのその部分を使用しません。これらの機能に問題があると、機能は通常無効になります。例えば、コネクターまたはリソースにバグがある場合、適切な機能が無効になっているとバグが回避される可能性があります。しかし、管理上の理由からも機能が無効になっている可能性があります。例えば、作成更新削除機能を無効にすると、リソースは効率的に読み取り専用になります。

一部の機能はシミュレートできます。つまり、システムにはリソースがなくてもリソースに特定の機能があると見せかけることができます。例えば、特定のアカウント属性を特定の値に設定してアカウントを無効にすることで、アクティブ化機能をシミュレートできます。そのようなシミュレートされた機能は通常何らかの設定を必要とします。これはこのページでも設定できます。

詳細はResource Capabilities wikiページを参照してください。

ResourceWizard.help.configurationStep=

ウィザードのこのステージで、コネクター設定プロパティを設定します。 それらは通常、ホスト名やポート番号などのリソースへのアクセスに使用されるネットワーク・パラメーターを定義します。 操作ネットワークのタイムアウトや接続プーリングの設定など、追加の接続パラメータをここで指定できます。

コネクター設定プロパティは各コネクターに固有です。 特定の構成プロパティーのセットは、コネクター構成スキーマによって決まります。 したがって、このページの内容は前のページで選択されたコネクターの種類によって異なります。

ResourceWizard.help.nameStep=

ウィザードのこのステージでは、リソースの基本的なプロパティを設定します。 リソース名と説明を設定するために使用できます。 コネクター名は必須であり、一意である必要があります。 リソースへのアクセスに使用されるコネクターも設定する必要があります。 コネクターはコネクター・ホストにデプロイされます。 コネクター・ホストを空のままにすると、システム・インスタンスに直接デプロイされたコネクターが使用されます。

リソース設定の詳細な説明については、リソース設定のWikiページを参照してください。

-ResourceWizard.help.schemaHandlingStep=

This step is used to provide configuration for handling of resource schema. The configuration displayed on this page tells system what to do with resource object classes and attributes. It contains the configuration of mappings between user properties and account attributes, configuration of account types, groups, provisioning dependencies, password mapping and so on.

The configuration is grouped into object types. Each object type defines the behavior for specific account type, entitlement type, OU, etc. The object type is uniquely identified by the combination of kind and intent. The kind defines what kind of the object it is:

  • kind=account means that the object is an account, i.e. that it represents a user.
  • kind=entitlement is applied to groups, roles, privileges, ACIs and similar objects that can be associated with accounts and which give privileges or access rights to the account.
  • kind=generic applies to other objects such as organizational units (OUs), domains, etc.
Intent is a plain string that can be used to distinguish several object types. E.g. it can be used to define several account types, e.g. "default user account", "administration account", "testing account" and so on. See Kind, Intent and ObjectClass wiki page for more details.

More details about schema handling configuration are provided on Resource Schema Handling wiki page. -ResourceWizard.help.schemaStep=

This page shows resource schema. The resource schema defines object classes that the connector can manage, e.g. accounts, groups, organizational units and so on. The schema defines a set of attributes for each object class. The schema is presented here in read-only form so you can inspect it and familiarize yourself with the data model that the resource provides.

The resource schema presented at this page is usually retrieved from the resource and automatically generated by system. Resource schema defines what the resource can do, i.e. what object classes it defines and what attributes are used in the object classes. Therefore the schema is read-only. It is not a configuration. It does not defines how system uses the object classes and attributes. That is configured in next steps of the wizard.

See Resource Schema wiki page for detailed explanation of resource schema concepts

+ResourceWizard.help.schemaHandlingStep=

このステップは、リソース・スキーマを処理するための設定を提供するために使用されます。このページに表示される設定は、リソース・オブジェクトのクラスと属性をどう処理するかをシステムに指示します。ユーザー・プロパティとアカウント属性間のマッピングの設定、アカウント・タイプの設定、グループ、プロビジョニングの依存関係、パスワード・マッピングなどが含まれます。

設定はオブジェクト・タイプに分類されます。各オブジェクト・タイプは、特定のアカウント・タイプ、エンタイトルメント・タイプ、OUなどの動作を定義します。オブジェクト・タイプは、種類用途の組み合わせによって一意に識別されます。 種類はどの種類のオブジェクトであるかを定義します。

  • kind = accountはオブジェクトがアカウントであることを意味します。つまり、ユーザーを表します。
  • kind= entitlementはグループ、ロール、特権、ACI、および関連することができる同様のオブジェクトに適用されます。 accountおよびaccountに特権またはアクセス権を付与する。
  • kind= genericは、組織単位(OU)、ドメインなどの他のオブジェクトに適用されます。
用途は、いくつかのオブジェクト・タイプを区別するために使用できるプレーンな文字列です。例えば、それはいくつかのアカウント・タイプを定義するために使用することができます。 「デフォルトのユーザー・アカウント」、「管理者アカウント」、「テスト用アカウント」など。詳細については、種類、用途、オブジェクト・クラスのWikiページを参照してください。

スキーマ処理設定の詳細については、リソース・スキーマ・ハンドリングのWikiページを参照してください。 +ResourceWizard.help.schemaStep=

このページはリソース・スキーマを表示します。リソース・スキーマは、コネクターが管理できるオブジェクト・クラスを定義します。 アカウント、グループ、組織単位など。 スキーマは、各オブジェクト・クラスの一連の属性を定義します。スキーマは読み取り専用形式でここに表示されるので、それを調べてリソースが提供するデータ・モデルに慣れることができます。

このページに表示されるリソース・スキーマは通常リソースから取得され、システムによって自動的に生成されます。リソース・スキーマは、そのリソースができること、即ちそれが定義するオブジェクト・クラス、および、そのオブジェクト・クラスで使用される属性を定義します。従って、スキーマは読み取り専用です。構成ではありません。システムがオブジェクト・クラスと属性をどのように使用するかは定義していません。これは、ウィザードの次のステップで構成されます。

リソース・スキーマの概念の詳細な説明については、

リソース・スキーマのWikiページを参照してください。

ResourceWizard.help.synchronizationStep=

同期設定は、リソース・オブジェクトが変更されたことを検出したときにIdentity Managerがどのように反応するかを定義します。例えば、新しいアカウントを検出したとき、存在すべきグループが存在しないことを検出したときなどに、システムがどのように反応するかを定義します。システムがどのように変化を検出しても反応は同じであるかどうかは、通常は問題ではありません(ただし、例外はチャネル指定を使用することで可能です)。したがって、ここで設定されているポリシーは通常、ライブ同期リコンシリエーションインポートディスカバリー(一貫性メカニズム)、および将来発生する可能性のあるその他のメカニズムにも適用されます。

詳細については、同期設定のWikiページを参照してください。 ResourceWizard.saveAndVisualize=保存と可視化 ResourceWizard.visualize=可視化 @@ -2889,7 +2889,7 @@ SchemaHandlingStep.association.tooltip.direction=アソシエーションの方 SchemaHandlingStep.association.tooltip.explicitRefIntegrity=明示的な参照整合性。falseに設定すると、システムはリソースが参照整合性を実装していると見なします。例えば、 システムは、アカウントの名前が変更され、システムが何もする必要がない場合に、リソースが自動的にアソシエーションIDを更新すると想定します。trueに設定すると、システムは明示的に参照整合性を取ります。この場合、システムは、アカウントの名前が変更されると、アソシエーション属性を明示的に更新します。 SchemaHandlingStep.association.tooltip.intent=アソシエーションの対象オブジェクト・タイプの用途。 ターゲットの種類と用途は、アソシエーションの対象となるオブジェクト・タイプを識別します。 グループ、特権、ロールなど SchemaHandlingStep.association.tooltip.kind=アソシエーションの対象オブジェクト・タイプの種類。 これは通常”エンタイトルメント”です。 ターゲットの種類と用途は、アソシエーションの対象となるオブジェクトタイプを識別します。例えば、 グループ、特権、ロールなど。 -SchemaHandlingStep.association.tooltip.valueAttribute=Name of the attribute that is the source of a value for the association. The value of this attribute will be taken and stored into the association attribute to form an association. This is usually an attribute that contains an identifier or name such as "uid", "id", "name", etc. In subject-to-object associations this is an attribute of an object (e.g. group). In object-to-subject associations this is an attribute of a subject (e.g. account). +SchemaHandlingStep.association.tooltip.valueAttribute=アソシエーションの値のソースとなる属性の名前。この属性の値が取得され、アソシエーションを形成するためにアソシエーション属性に格納されます。これは通常、 "uid"、 "id"、 "name"などの識別子または名前を含む属性です。サブジェクトとオブジェクトのアソシエーションでは、これはオブジェクトの属性です(グループなど)。オブジェクトとサブジェクトのアソシエーションでは、これはサブジェクトの属性です(例:アカウント)。 SchemaHandlingStep.attribute.label.attributeName=属性名 SchemaHandlingStep.attribute.label.attributeNamespace=属性名前空間 SchemaHandlingStep.attribute.tooltip.allow=オンにすると、元のリソーススキーマにない属性を指定できます。これは、完全なリソーススキーマを提供せず、いくつかの属性を隠すような不完全なコネクターを修正するために使用できます。 @@ -2973,7 +2973,7 @@ SchemaHandlingStep.tooltip.default=trueに設定した場合、この定義は SchemaHandlingStep.tooltip.dependency=Dependencies are object types that has to be processed before this object types is processed. I.e. this object type depends on them. The object types on which this object type depends will be provisioned before this object type. Dependencies are used to impose ordering into provisioning operations. SchemaHandlingStep.tooltip.filterClause=TODO: SchemaHandlingStep.tooltip.filterClause SchemaHandlingStep.tooltip.intent=用途は、システムがオブジェクトに対して何をすべきかを指定します。用途は、同じ種類のオブジェクトをいくつかのカテゴリに分類します。 用途が異なるオブジェクトは、システムによって異なる方法で処理される可能性があります。 -SchemaHandlingStep.tooltip.iteration=Iteratively find values for unique attributes such as identifiers. Identity Manager will try several times to find a unique value for such attributes. +SchemaHandlingStep.tooltip.iteration=識別子などの固有の属性の値を繰り返し見つけます。アイデンティティ・マネージャーは、そのような属性に固有の値を見つけるために何度か試行します。 SchemaHandlingStep.tooltip.kind=種類は、このオブジェクトが何であるか、それがアカウント、エンタイトルメント、または何か他のものであるかどうかを指定しました。 SchemaHandlingStep.tooltip.objectClass=このオブジェクト・タイプのインスタンスを構築するために使用されるスキーマのオブジェクトクラス。 SchemaHandlingStep.tooltip.protected=このオブジェクト型の保護されたインスタンスの指定 システムは保護されたインスタンスを見ることができますが、触れることはできません。 それらを変更しようとしても失敗します。 これは、 "root"や "administrator"などの緊急管理アカウントを保護するために使用されます。 @@ -3131,7 +3131,7 @@ SynchronizationStep.tooltip.enabled=この同期設定が有効になってい SynchronizationStep.tooltip.focus=リソース・オブジェクトに対応するフォーカル・オブジェクトのタイプ。アカウント・オブジェクトの場合、これは通常ユーザー・オブジェクト(UserType)です。これは、エンタイトルメント・オブジェクトなどに対してRoleTypeまたはOrgTypeに設定できます。 SynchronizationStep.tooltip.intent=Object intent for which this definition applies. If the object (shadow) already has a kind and intent when it is processed by the synchronization code then this kind/intent definition will be used to select the synchronization settings to apply to this object. If the object does not have kind/intent then object class and conditions will be used to select the settings. In such a case the object (shadow) will be marked by the intent specified in this field. SynchronizationStep.tooltip.kind=Object kind for which this definition applies. If the object (shadow) already has a kind and intent when it is processed by the synchronization code then this kind/intent definition will be used to select the synchronization settings to apply to this object. If the object does not have kind/intent then object class and conditions will be used to select the settings. In such a case the object (shadow) will be marked by the kind specified in this field. -SynchronizationStep.tooltip.objectClass=Object class for which this definition applies. This will be used to select the synchronization settings in case the object (shadow) does not have kind/intent definition yet. +SynchronizationStep.tooltip.objectClass=この定義が適用されるオブジェクトクラス。これはオブジェクト(シャドウ)が種類/用途の定義をまだ持っていない場合に同期設定を選択するために使用されます。 SynchronizationStep.tooltip.objectTemplate=この特定の同期イベントを処理するために使用されるオブジェクト・テンプレート。ここでオブジェクト・テンプレートが指定されていない場合は、通常のデフォルトが使用されます。 SynchronizationStep.tooltip.opportunistic=trueに設定すると、このイベントの処理中に日和見的同期(別名ディスカバリー)が有効になります。 SynchronizationStep.tooltip.reaction=システムがこの同期イベントにどのようにリアクションするかを指定します。 いくつかのリアクションを指定できます。 イベントの同期状況に適したリアクションが選択されます。 @@ -3696,7 +3696,7 @@ StageDefinitionPanel.notifyWhenNoDecisionHelp=チェックした場合、レビ StageDefinitionPanel.reviewerSpecificationTargetHelp=割当て/インデュースメント・ターゲットの所有者/承認者に基づくレビュー担当者の選択。 例えば ロールの所有者を使用して、(任意のユーザーに対する)「自分の」ロールのすべての割当てを認証するように指定できます。 StageDefinitionPanel.reviewerSpecificationObjectHelp=Selection of reviewers based on object that has something assigned (or induced) to. E.g. you can specify that the role owner is used to certify all inducements made to 'his' role. StageDefinitionPanel.reviewerUseObjectManagerHelp=Selection of reviewers based on managers of object (typically a user) that has something assigned/induced to. E.g. you can specify that a manager is used to certify all assignments made to users in 'his' organization. -StageDefinitionPanel.reviewerUseObjectManagerOrgTypeHelp=Influences determination of a manager of a user: First, we take all managers of all organizations the user belongs to. We exclude the user himself, if he is a manager of such organization (and if 'allow managers to approve their own assignments' below is unchecked). If the value in this field is filled-in, we use it to select only organizations with given organization type value - for example, 'functional' (if you have e.g. both functional-type and project-type organizations). If this field is empty, we take into account all organizations. If we find no suitable manager, we continue with all parent organizations (again, of the given type, if specified). +StageDefinitionPanel.reviewerUseObjectManagerOrgTypeHelp=ユーザーのマネージャーの決定に影響を与えます。まず、ユーザーが属するすべての組織のすべてのマネージャーを取得します。ユーザーがそのような組織のマネージャーである場合(および下記の「マネージャーに自分の割当てを承認することを許可する」のチェックが外されている場合)、ユーザー自身を除外します。 このフィールドの値が入力されている場合は、指定された組織タイプの値を持つ組織のみを選択するために使用します。例えば、「ファンクショナル」(例えば、ファンクショナル・タイプとプロジェクト・タイプの組織の両方がある場合)。 このフィールドが空白の場合は、すべての組織が考慮されます。 適切なマネージャーが見つからない場合は、すべての親組織(ここでも指定されている場合は指定されたタイプのもの)を続行します。 StageDefinitionPanel.reviewerUseObjectManagerAllowSelfHelp=If a user is a manager in his organization, could he be selected as a reviewer for his own assignments? If unchecked (the default), a higher-level manager is searched for - see description for the above field. StageDefinitionPanel.defaultReviewerRefHelp=上記の条件でレビューワーを導けない場合は、このレビューワー(複数可)が使用されます。 StageDefinitionPanel.additionalReviewerRefHelp=このレビューワー(複数可)は、上記の条件で選択されたレビューワーに加えて使用されます。 @@ -3747,7 +3747,7 @@ PageResourceVisualization.dotMessage=DOTグラフのレンダリングは実行 PageResourceVisualization.dot1=DOTレンダリング・ソフトウェアがサーバーにインストールされています。 推奨されるのはGraphvizです PageResourceVisualization.dot2=DOTレンダリング実行ファイルへのパスは、config.xmlファイルで正しく設定されています。 PageResourceVisualization.moreInformation=詳細は、こちらをご覧ください: -PageResourceVisualization.moreInformationLink=this article +PageResourceVisualization.moreInformationLink=この記事 PageResourceVisualization.errorMessage=エラーメッセージ PageResourceVisualization.seeOnline=オンラインのDOTレンダラーを使用することもできます PageResourceVisualization.seeOnlineLink=webgraphviz.com @@ -4172,7 +4172,7 @@ ExpressionValuePanel.specifyExpression=式を指定する ExpressionValuePanel.addValueButtonDefaultTitle=シャドウ・リファレンス値を追加 ExpressionValuePanel.addValueButtonTargetSearchTitle=アソシエーション・ターゲット・検索を追加 ExpressionValuePanel.addLiteralValueButton=リテラル値を追加 -ExpressionValuePanel.associationDefenitionsNotDefined=Association definitions are not defined for the current resource with selected kind/intent parameters. +ExpressionValuePanel.associationDefenitionsNotDefined=アソシエーション定義は、選択された種類/用途パラメーターを持つ現在のリソースに対して定義されていません。 ConstructionType.attribute=属性 ConstructionType.association=アソシエーション operation.Recompute.ALL.members=全メンバーの再計算 diff --git a/gui/admin-gui/src/main/resources/localization/Midpoint_pl.properties b/gui/admin-gui/src/main/resources/localization/Midpoint_pl.properties index c6a0b9f683c..4bb0c3f8248 100644 --- a/gui/admin-gui/src/main/resources/localization/Midpoint_pl.properties +++ b/gui/admin-gui/src/main/resources/localization/Midpoint_pl.properties @@ -4172,7 +4172,7 @@ ExpressionValuePanel.specifyExpression=Określ wyrażenie ExpressionValuePanel.addValueButtonDefaultTitle=Dodaj wartość referencyjną cienia ExpressionValuePanel.addValueButtonTargetSearchTitle=Dodaj wyszukiwanie celu powiązania ExpressionValuePanel.addLiteralValueButton=Dodaj wartość dosłowną -ExpressionValuePanel.associationDefenitionsNotDefined=Association definitions are not defined for the current resource with selected kind/intent parameters. +ExpressionValuePanel.associationDefenitionsNotDefined=Brak jest definicji powiązań dla bieżącego systemu z wybranymi parametrami rodzaj/intencja ConstructionType.attribute=Atrybut ConstructionType.association=Powiązanie operation.Recompute.ALL.members=Przelicz wszystkich członków diff --git a/infra/schema/src/main/resources/localization/schema_fr.properties b/infra/schema/src/main/resources/localization/schema_fr.properties index b08ad80b20b..fce73424438 100644 --- a/infra/schema/src/main/resources/localization/schema_fr.properties +++ b/infra/schema/src/main/resources/localization/schema_fr.properties @@ -299,7 +299,7 @@ FormSpecificationType.formRef=Reference to form FormSpecificationType.panelClass=Classe de panneau FormSpecificationType.panelUri=Uri du panneau GenericPcpAspectConfigurationType.name=Nom -GlobalPolicyRuleType.details=Règle globale de politique +GlobalPolicyRuleType.details=Règle de politique globale GlobalPolicyRuleType.focusSelector=Sélecteur de foyer GlobalPolicyRuleType.targetSelector=Sélecteur de cible GlobalPolicyRuleType.condition=Conditions @@ -633,9 +633,9 @@ RoleManagementConfigurationType.defaultAssignmentConstraints=Contraintes d'attri RoleManagementConfigurationType.defaultExecuteAfterAllApprovals=Default execute after all approvals RoleManagementConfigurationType.autoassignEnabled=Autoassign enabled RoleManagementConfigurationType.relations=Relations -SearchBoxConfigurationType.defaultMode=Default mode -SearchBoxConfigurationType.defaultObjectType=Default object type -SearchBoxConfigurationType.defaultScope=Default scope +SearchBoxConfigurationType.defaultMode=Mode par défaut +SearchBoxConfigurationType.defaultObjectType=Type d'objet par défaut +SearchBoxConfigurationType.defaultScope=Champ d'application par défaut ShadowType.dead=Mort ShadowType.kind=Sorte ShadowType.failedOperationType=Failed operation type @@ -931,7 +931,7 @@ DefaultPolicyConstraint.not=Les contraintes incluses n'ont pas été enclenchée DefaultPolicyConstraint.transition=Contrainte de politique de transition appariée DefaultPolicyConstraint.situation=Contrainte de politique de situation appariée PolicyViolationException.message.aggregate=Des infractions à la politique {0} ont eu lieu. -PolicyViolationException.message.projectionPassword=Le mot de passe fourni ne satisfait pas aux stratégies de mot de passe dans {0 }: {1} +PolicyViolationException.message.projectionPassword=Le mot de passe fourni ne satisfait pas aux politiques de mots de passe dans {0} : {1} PolicyViolationException.message.credentials.nonce=Provided nonce does not satisfy the policies: {0} PolicyViolationException.message.credentials.password=Le mot de passe fourni ne satisfait pas les règles: {0} PolicyViolationException.message.credentials.securityQuestions=Les questions de sécurité fournies ne satisfont pas aux règles : {0} @@ -1003,9 +1003,9 @@ PolicyConstraintsType.modification=Modification PolicyConstraintsType.modification.help=Contrainte déclenchée lorsque l'objet est modifié. PolicyConstraintsType.assignment=Attribution PolicyConstraintsType.assignment.help=Contrainte déclenchée lorsqu'un objet est attribué ou que l'attribution est retirée ou modifiée. -PolicyConstraintsType.objectTimeValidity=Object time validity +PolicyConstraintsType.objectTimeValidity=Durée de validité de l'objet PolicyConstraintsType.objectTimeValidity.help=Une contrainte qui se déclenche lorsque la validité d'un objet ou n'importe lequel de ses éléments asservis au temps (p.e. un mot de passe) est sur le point d'expirer. -PolicyConstraintsType.assignmentTimeValidity=Validité du temps d'attribution +PolicyConstraintsType.assignmentTimeValidity=Durée de validité des attributions PolicyConstraintsType.assignmentTimeValidity.help=Une contrainte qui se déclenche lorsque la validité d'une attribution ou n'importe lequel de ses éléments asservis au temps (p.e. un mot de passe) est sur le point d'expirer. PolicyConstraintsType.situation=Situation de politique PolicyConstraintsType.situation.help=Occurrence de la situation de politique au sein d'un objet ou d'une attribution. @@ -1088,8 +1088,8 @@ DefaultPolicyConstraint.Short.objectModification.toBeDeleted=Suppression de {0} DefaultPolicyConstraint.Short.objectModification.wasDeleted={0} supprimé(e) DefaultPolicyConstraint.Short.objectModification.toBeModified=Modification de {0} DefaultPolicyConstraint.Short.objectModification.wasModified={0} modifié(e) -DefaultPolicyConstraint.Short.objectState.unnamed=État d'appariement : {0} -DefaultPolicyConstraint.Short.objectState.named=État d'appariement : {0} (« {1} ») +DefaultPolicyConstraint.Short.objectState.unnamed=État d'appariement : {0} +DefaultPolicyConstraint.Short.objectState.named=État d'appariement : {0} (« {1} ») # {0} = before/after, {1} target/path, {2} rule name DefaultPolicyConstraint.Short.assignmentState.unnamed=État correspondant : attribution de {1} ({0}) DefaultPolicyConstraint.Short.assignmentState.named=État correspondant : attribution de {1} ({0}) (« {2} ») From eb6903a93551361b7e97229b80e4cf9f645e02ea Mon Sep 17 00:00:00 2001 From: Pavol Mederly Date: Fri, 1 Mar 2019 14:55:03 +0100 Subject: [PATCH 085/224] Fix intra-cluster authentication (MID-5162) Also fixed the fix for TaskManagerQuartzImpl autowiring when profiling is enabled. --- .../NodeAuthenticationEvaluatorImpl.java | 105 +++++++++--------- .../midpoint/task/api/TaskManager.java | 7 ++ .../quartzimpl/TaskManagerQuartzImpl.java | 7 +- .../cluster/ClusterExecutionHelperImpl.java | 9 +- .../quartzimpl/execution/HandlerExecutor.java | 4 +- .../LightweightPartitioningTaskHandler.java | 2 +- 6 files changed, 76 insertions(+), 58 deletions(-) diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/security/NodeAuthenticationEvaluatorImpl.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/security/NodeAuthenticationEvaluatorImpl.java index 680c24e495d..29776336582 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/security/NodeAuthenticationEvaluatorImpl.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/security/NodeAuthenticationEvaluatorImpl.java @@ -23,6 +23,7 @@ import com.evolveum.midpoint.prism.crypto.Protector; import com.evolveum.midpoint.task.api.TaskManager; import com.evolveum.prism.xml.ns._public.types_3.ProtectedStringType; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; @@ -55,7 +56,7 @@ public class NodeAuthenticationEvaluatorImpl implements NodeAuthenticationEvalua private static final String OPERATION_SEARCH_NODE = NodeAuthenticationEvaluatorImpl.class.getName() + ".searchNode"; - public boolean authenticate(@Nullable String remoteName, String remoteAddress, @Nullable String credentials, String operation) { + public boolean authenticate(@Nullable String remoteName, String remoteAddress, @NotNull String credentials, String operation) { LOGGER.debug("Checking if {} ({}) is a known node", remoteName, remoteAddress); OperationResult result = new OperationResult(OPERATION_SEARCH_NODE); @@ -63,45 +64,52 @@ public boolean authenticate(@Nullable String remoteName, String remoteAddress, @ try { List> allNodes = repositoryService.searchObjects(NodeType.class, null, null, result); - List> matchingNodes = getMatchingNodes(allNodes, remoteName, remoteAddress, operation); - - if (matchingNodes.size() == 1 || matchingNodes.size() >= 1 && taskManager.isLocalNodeClusteringEnabled()) { + List> matchingNodes = getMatchingNodes(allNodes, remoteName, remoteAddress); + + if (matchingNodes.isEmpty()) { + LOGGER.debug("Authenticity cannot be established: No matching nodes for remote name '{}' and remote address '{}'", + remoteName, remoteAddress); + } else if (matchingNodes.size() > 1 && !taskManager.isLocalNodeClusteringEnabled()) { + LOGGER.debug("Authenticity cannot be established: More than one matching node for remote name '{}' and " + + "remote address '{}' with local-node clustering disabled: {}", remoteName, remoteAddress, matchingNodes); + } else { + assert matchingNodes.size() == 1 || matchingNodes.size() > 1 && taskManager.isLocalNodeClusteringEnabled(); LOGGER.trace( - "Matching result: Node(s) {} recognized as known (remote host name {} or IP address {} matched). Attempting to execute the requested operation: {}", - allNodes, remoteName, remoteAddress, operation); + "Matching result: Node(s) {} recognized as known (remote host name {} or IP address {} matched).", + matchingNodes, remoteName, remoteAddress); PrismObject actualNode = null; - if (credentials != null) { - for (PrismObject matchingNode : matchingNodes) { - ProtectedStringType encryptedSecret = matchingNode.asObjectable().getSecret(); - if (encryptedSecret != null) { - String plainSecret; - try { - plainSecret = protector.decryptString(encryptedSecret); - } catch (EncryptionException e) { - LoggingUtils.logUnexpectedException(LOGGER, "Couldn't decrypt node secret for {}", e, matchingNode); - continue; - } - if (credentials.equals(plainSecret)) { - LOGGER.debug("Node secret matches for {}", matchingNode); - actualNode = matchingNode; - break; - } else { - LOGGER.debug("Node secret does not match for {}", matchingNode); - } + for (PrismObject matchingNode : matchingNodes) { + ProtectedStringType encryptedSecret = matchingNode.asObjectable().getSecret(); + if (encryptedSecret != null) { + String plainSecret; + try { + plainSecret = protector.decryptString(encryptedSecret); + } catch (EncryptionException e) { + LoggingUtils.logUnexpectedException(LOGGER, "Couldn't decrypt node secret for {}", e, matchingNode); + continue; + } + if (credentials.equals(plainSecret)) { + LOGGER.debug("Node secret matches for {}", matchingNode); + actualNode = matchingNode; + break; + } else { + LOGGER.debug("Node secret does not match for {}", matchingNode); } + } else { + LOGGER.debug("No secret known for node {}", matchingNode); } - } else { - actualNode = matchingNodes.get(0); } if (actualNode != null) { + LOGGER.trace("Established authenticity for remote {}", actualNode); NodeAuthenticationToken authNtoken = new NodeAuthenticationToken(actualNode, remoteAddress, Collections.emptyList()); SecurityContextHolder.getContext().setAuthentication(authNtoken); securityHelper.auditLoginSuccess(actualNode.asObjectable(), connEnv); return true; + } else { + LOGGER.debug("Authenticity for {} couldn't be established: none of the secrets match", matchingNodes); } } - } catch (RuntimeException | SchemaException e) { LOGGER.error("Unhandled exception when listing nodes"); LoggingUtils.logUnexpectedException(LOGGER, "Unhandled exception when listing nodes", e); @@ -110,27 +118,24 @@ public boolean authenticate(@Nullable String remoteName, String remoteAddress, @ return false; } -private List> getMatchingNodes(List> knownNodes, String remoteName, String remoteAddress, String operation) { - List> matchingNodes = new ArrayList<>(); - for (PrismObject node : knownNodes) { - NodeType actualNode = node.asObjectable(); - if (remoteName != null && remoteName.equalsIgnoreCase(actualNode.getHostname())) { - LOGGER.trace("The node {} was recognized as a known node (remote host name {} matched). Attempting to execute the requested operation: {} ", - actualNode.getName(), actualNode.getHostname(), operation); - matchingNodes.add(node); - continue; - } - if (actualNode.getIpAddress().contains(remoteAddress)) { - LOGGER.trace("The node {} was recognized as a known node (remote host address {} matched). Attempting to execute the requested operation: {} ", - actualNode.getName(), remoteAddress, operation); - matchingNodes.add(node); - continue; - } - } - - return matchingNodes; -} - - - + private List> getMatchingNodes(List> knownNodes, String remoteName, + String remoteAddress) { + List> matchingNodes = new ArrayList<>(); + for (PrismObject node : knownNodes) { + NodeType actualNode = node.asObjectable(); + if (remoteName != null && remoteName.equalsIgnoreCase(actualNode.getHostname())) { + LOGGER.trace("The node {} was recognized as a known node (remote host name {} matched).", + actualNode.getName(), actualNode.getHostname()); + matchingNodes.add(node); + continue; + } + if (actualNode.getIpAddress().contains(remoteAddress)) { + LOGGER.trace("The node {} was recognized as a known node (remote host address {} matched).", + actualNode.getName(), remoteAddress); + matchingNodes.add(node); + continue; + } + } + return matchingNodes; + } } diff --git a/repo/task-api/src/main/java/com/evolveum/midpoint/task/api/TaskManager.java b/repo/task-api/src/main/java/com/evolveum/midpoint/task/api/TaskManager.java index 35ef928292e..c18f3704ccf 100644 --- a/repo/task-api/src/main/java/com/evolveum/midpoint/task/api/TaskManager.java +++ b/repo/task-api/src/main/java/com/evolveum/midpoint/task/api/TaskManager.java @@ -740,4 +740,11 @@ String recordTaskThreadsDump(String taskOid, String cause, OperationResult paren * Use only for tests. Otherwise considered to be an ugly hack. */ RunningTask createFakeRunningTask(Task task); + + TaskHandler getHandler(String handlerUri); + + NodeType getLocalNode(); + + // TEMPORARY HACK -- DO NOT USE OUTSIDE task-quartz-impl module + Object getWorkStateManager(); } diff --git a/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/TaskManagerQuartzImpl.java b/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/TaskManagerQuartzImpl.java index c26f85620b7..f5786467073 100644 --- a/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/TaskManagerQuartzImpl.java +++ b/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/TaskManagerQuartzImpl.java @@ -42,6 +42,7 @@ import javax.xml.datatype.Duration; import javax.xml.datatype.XMLGregorianCalendar; +import com.evolveum.midpoint.schema.util.ObjectTypeUtil; import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.Validate; import org.jetbrains.annotations.NotNull; @@ -91,7 +92,6 @@ import com.evolveum.midpoint.task.api.LightweightIdentifierGenerator; import com.evolveum.midpoint.task.api.LightweightTaskHandler; import com.evolveum.midpoint.task.api.RunningTask; -import com.evolveum.midpoint.task.api.RunningTask; import com.evolveum.midpoint.task.api.Task; import com.evolveum.midpoint.task.api.TaskCategory; import com.evolveum.midpoint.task.api.TaskDeletionListener; @@ -2548,5 +2548,8 @@ public RunningTaskQuartzImpl createFakeRunningTask(Task task) { return createRunningTask(task); } - + @Override + public NodeType getLocalNode() { + return ObjectTypeUtil.asObjectable(clusterManager.getLocalNodeObject()); + } } diff --git a/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/cluster/ClusterExecutionHelperImpl.java b/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/cluster/ClusterExecutionHelperImpl.java index fcbe48703d4..80c223c505a 100644 --- a/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/cluster/ClusterExecutionHelperImpl.java +++ b/repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/cluster/ClusterExecutionHelperImpl.java @@ -34,6 +34,7 @@ import com.evolveum.midpoint.util.logging.Trace; import com.evolveum.midpoint.util.logging.TraceManager; import com.evolveum.midpoint.xml.ns._public.common.common_3.NodeType; +import com.evolveum.prism.xml.ns._public.types_3.ProtectedStringType; import org.apache.cxf.common.util.Base64Utility; import org.apache.cxf.jaxrs.client.WebClient; import org.jetbrains.annotations.NotNull; @@ -110,14 +111,16 @@ public void execute(@NotNull NodeType node, @NotNull BiConsumer Date: Fri, 1 Mar 2019 15:43:25 +0100 Subject: [PATCH 086/224] MID-5107 sorting for dropdown choices --- .../AssignmentActivationPopupablePanel.html | 77 -------- .../AssignmentActivationPopupablePanel.java | 181 ------------------ .../component/input/DropDownChoicePanel.java | 19 +- .../web/page/admin/server/PageTaskAdd.html | 2 +- .../web/page/admin/server/PageTaskAdd.java | 13 +- 5 files changed, 23 insertions(+), 269 deletions(-) delete mode 100644 gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/assignment/AssignmentActivationPopupablePanel.html delete mode 100644 gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/assignment/AssignmentActivationPopupablePanel.java diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/assignment/AssignmentActivationPopupablePanel.html b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/assignment/AssignmentActivationPopupablePanel.html deleted file mode 100644 index 5048d061eff..00000000000 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/assignment/AssignmentActivationPopupablePanel.html +++ /dev/null @@ -1,77 +0,0 @@ -/* -* Copyright (c) 2010-2017 Evolveum -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - - -
-
-
- -
- -
- -
-
-
- -
-
-
-
-
-
-
-
-
-
- -
-
- -
-
-
-
-
-
-
-
-
- -
-
-
- -
-
-
-
-
-
-
-
-
-
- -
-
-
- - - diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/assignment/AssignmentActivationPopupablePanel.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/assignment/AssignmentActivationPopupablePanel.java deleted file mode 100644 index 50caabfb269..00000000000 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/assignment/AssignmentActivationPopupablePanel.java +++ /dev/null @@ -1,181 +0,0 @@ -/* - * Copyright (c) 2010-2017 Evolveum - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.evolveum.midpoint.web.component.assignment; - -import com.evolveum.midpoint.gui.api.component.BasePanel; -import com.evolveum.midpoint.gui.api.util.WebComponentUtil; -import com.evolveum.midpoint.web.component.AjaxButton; -import com.evolveum.midpoint.web.component.DateInput; -import com.evolveum.midpoint.web.component.dialog.Popupable; -import com.evolveum.midpoint.web.component.input.DropDownChoicePanel; -import com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour; -import com.evolveum.midpoint.xml.ns._public.common.common_3.ActivationStatusType; -import com.evolveum.midpoint.xml.ns._public.common.common_3.ActivationType; -import org.apache.wicket.Component; -import org.apache.wicket.ajax.AjaxRequestTarget; -import org.apache.wicket.markup.html.WebMarkupContainer; -import org.apache.wicket.model.IModel; -import org.apache.wicket.model.PropertyModel; -import org.apache.wicket.model.StringResourceModel; - -/** - * Created by honchar. - * the panel could be used as a content panel for popup - * window as well as a standard page activation panel - */ -public class AssignmentActivationPopupablePanel extends BasePanel implements Popupable{ - private static final long serialVersionUID = 1L; - - private static final String ID_ACTIVATION = "activation"; - private static final String ID_ACTIVATION_BLOCK = "activationBlock"; - private static final String ID_ADMINISTRATIVE_STATUS = "administrativeStatus"; - private static final String ID_VALID_FROM = "validFrom"; - private static final String ID_VALID_TO = "validTo"; - private static final String ID_ADMIN_STATUS_CONTAINER = "administrativeStatusContainer"; - private static final String ID_VALID_FROM_CONTAINER = "validFromContainer"; - private static final String ID_VALID_TO_CONTAINER = "validToContainer"; - private static final String ID_OK_BUTTON = "okButton"; - private static final String ID_CANCEL_BUTTON = "cancelButton"; - private static final String ID_BUTTONS_PANEL = "buttonsPanel"; - - - public AssignmentActivationPopupablePanel(String id, IModel assignmentModel){ - super(id, assignmentModel); - initModelObject(); - initLayout(); - } - - private void initModelObject(){ - if (getModelObject() == null){ - getModel().setObject(new ActivationType()); - } - } - - private void initLayout(){ - WebMarkupContainer activationBlock = new WebMarkupContainer(ID_ACTIVATION_BLOCK); - activationBlock.setOutputMarkupId(true); - add(activationBlock); - - WebMarkupContainer adminStatusContainer = new WebMarkupContainer(ID_ADMIN_STATUS_CONTAINER); - adminStatusContainer.setOutputMarkupId(true); - activationBlock.add(adminStatusContainer); - - DropDownChoicePanel administrativeStatus = WebComponentUtil.createEnumPanel( - ActivationStatusType.class, ID_ADMINISTRATIVE_STATUS, - new PropertyModel(getModel(), ActivationType.F_ADMINISTRATIVE_STATUS.getLocalPart()), - this); - adminStatusContainer.add(administrativeStatus); - - WebMarkupContainer validFromContainer = new WebMarkupContainer(ID_VALID_FROM_CONTAINER); - validFromContainer.setOutputMarkupId(true); - activationBlock.add(validFromContainer); - - DateInput validFrom = new DateInput(ID_VALID_FROM, - AssignmentsUtil.createDateModel(new PropertyModel<>(getModel(), - ActivationType.F_VALID_FROM.getLocalPart()))); - validFromContainer.add(validFrom); - - WebMarkupContainer validToContainer = new WebMarkupContainer(ID_VALID_TO_CONTAINER); - validToContainer.setOutputMarkupId(true); - activationBlock.add(validToContainer); - - DateInput validTo = new DateInput(ID_VALID_TO, - AssignmentsUtil.createDateModel(new PropertyModel<>(getModel(), - ActivationType.F_VALID_TO.getLocalPart()))); - validToContainer.add(validTo); - - activationBlock.add(new VisibleEnableBehaviour() { - - @Override - public boolean isVisible() { - // enabled activation in assignments for now. - return true; - } - }); - - WebMarkupContainer buttonsPanel = new WebMarkupContainer(ID_BUTTONS_PANEL); - buttonsPanel.setOutputMarkupId(true); - buttonsPanel.add(new VisibleEnableBehaviour(){ - private static final long serialVersionUID = 1L; - - @Override - public boolean isVisible(){ - return getButtonsPanelVisibility(); - } - }); - add(buttonsPanel); - - AjaxButton okButton = new AjaxButton(ID_OK_BUTTON, createStringResource("AssignmentActivationPopupPanel.okButton")) { - private static final long serialVersionUID = 1L; - - @Override - public void onClick(AjaxRequestTarget ajaxRequestTarget) { - getPageBase().hideMainPopup(ajaxRequestTarget); - reloadDateComponent(ajaxRequestTarget); - } - }; - buttonsPanel.add(okButton); - - AjaxButton cancelButton = new AjaxButton(ID_CANCEL_BUTTON, createStringResource("AssignmentActivationPopupPanel.cancelButton")) { - private static final long serialVersionUID = 1L; - @Override - public void onClick(AjaxRequestTarget ajaxRequestTarget) { - getPageBase().hideMainPopup(ajaxRequestTarget); - } - }; - buttonsPanel.add(cancelButton); - - WebComponentUtil.addAjaxOnUpdateBehavior((WebMarkupContainer)get(ID_ACTIVATION_BLOCK)); - - } - - protected void reloadDateComponent(AjaxRequestTarget target){ - } - - protected boolean getButtonsPanelVisibility(){ - return true; - } - - @Override - public int getWidth(){ - return 600; - } - - @Override - public int getHeight(){ - return 300; - } - - @Override - public String getWidthUnit(){ - return "px"; - } - - @Override - public String getHeightUnit(){ - return "px"; - } - - @Override - public StringResourceModel getTitle(){ - return createStringResource("AssignmentActivationPopupPanel.title"); - } - - @Override - public Component getComponent(){ - return this; - } -} diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/input/DropDownChoicePanel.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/input/DropDownChoicePanel.java index 21e8152cc33..cbb2ebdf569 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/input/DropDownChoicePanel.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/input/DropDownChoicePanel.java @@ -17,13 +17,17 @@ package com.evolveum.midpoint.web.component.input; import java.util.List; +import java.util.stream.Collectors; +import com.evolveum.midpoint.util.QNameUtil; import com.evolveum.midpoint.web.component.prism.InputPanel; +import org.apache.commons.lang.Validate; import org.apache.wicket.markup.html.form.ChoiceRenderer; import org.apache.wicket.markup.html.form.DropDownChoice; import org.apache.wicket.markup.html.form.IChoiceRenderer; import org.apache.wicket.model.IModel; +import org.apache.wicket.model.Model; /** * @author lazyman @@ -49,7 +53,8 @@ public DropDownChoicePanel(String id, IModel model, IModel input = new DropDownChoice(ID_INPUT, model, choices, renderer) { + DropDownChoice input = new DropDownChoice(ID_INPUT, model, + Model.ofList(sortChoices(choices, renderer)), renderer) { private static final long serialVersionUID = 1L; @@ -71,6 +76,18 @@ protected String getNullValidDisplayValue() { add(input); } + private List sortChoices(IModel> choicesModel, IChoiceRenderer renderer){ + List sortedList = choicesModel.getObject().stream().sorted((choice1, choice2) -> { + Validate.notNull(choice1); + Validate.notNull(choice2); + + return String.CASE_INSENSITIVE_ORDER.compare(renderer.getDisplayValue(choice1).toString(), renderer.getDisplayValue(choice2).toString()); + + + }).collect(Collectors.toList()); + return sortedList; + } + @Override public DropDownChoice getBaseFormComponent() { return (DropDownChoice) get("input"); diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/server/PageTaskAdd.html b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/server/PageTaskAdd.html index 3f7e1dfdece..4d2da928c86 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/server/PageTaskAdd.html +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/server/PageTaskAdd.html @@ -37,7 +37,7 @@

- -
-
-
-
-
-
- -
-
- +
diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/gui/api/component/MultiTypesMemberPopupTabPanel.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/gui/api/component/MultiTypesMemberPopupTabPanel.java index 7157adc55f1..44c918d1276 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/gui/api/component/MultiTypesMemberPopupTabPanel.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/gui/api/component/MultiTypesMemberPopupTabPanel.java @@ -22,6 +22,7 @@ import com.evolveum.midpoint.schema.util.ObjectTypeUtil; import com.evolveum.midpoint.util.logging.Trace; import com.evolveum.midpoint.util.logging.TraceManager; +import com.evolveum.midpoint.web.component.input.DropDownChoicePanel; import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectReferenceType; import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType; import org.apache.wicket.ajax.AjaxRequestTarget; @@ -29,6 +30,7 @@ import org.apache.wicket.markup.html.WebMarkupContainer; import org.apache.wicket.markup.html.form.DropDownChoice; import org.apache.wicket.markup.html.form.EnumChoiceRenderer; +import org.apache.wicket.model.Model; import javax.xml.namespace.QName; import java.util.ArrayList; @@ -59,20 +61,19 @@ protected void onInitialize(){ typePanel.setOutputMarkupId(true); add(typePanel); - DropDownChoice typeSelect = new DropDownChoice<>(ID_TYPE, new LoadableModel() { + DropDownChoicePanel typeSelect = new DropDownChoicePanel(ID_TYPE, new LoadableModel() { @Override protected ObjectTypes load() { return defaultObjectType; } - }, - getSupportedTypesList(), new EnumChoiceRenderer<>(this)); - typeSelect.add(new OnChangeAjaxBehavior() { + }, Model.ofList(getSupportedTypesList()), new EnumChoiceRenderer<>(this)); + typeSelect.getBaseFormComponent().add(new OnChangeAjaxBehavior() { private static final long serialVersionUID = 1L; @Override protected void onUpdate(AjaxRequestTarget target) { - defaultObjectType = typeSelect.getModelObject(); + defaultObjectType = typeSelect.getModel().getObject(); MultiTypesMemberPopupTabPanel.this.addOrReplace(initObjectListPanel()); target.add(MultiTypesMemberPopupTabPanel.this); } diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/certification/PageCertCampaigns.html b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/certification/PageCertCampaigns.html index 518a6d2128b..b8101fc5ddd 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/certification/PageCertCampaigns.html +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/certification/PageCertCampaigns.html @@ -28,7 +28,7 @@
- +

- +
- +
-