You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by il...@apache.org on 2018/06/15 15:34:29 UTC
[4/4] syncope git commit: [SYNCOPE-470] Implementation and
documentation provided
[SYNCOPE-470] Implementation and documentation provided
Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/595a8d15
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/595a8d15
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/595a8d15
Branch: refs/heads/master
Commit: 595a8d154a98758bd4d8852f49923200189ff99a
Parents: ebc1e05
Author: Francesco Chicchiriccò <il...@apache.org>
Authored: Fri Jun 15 16:10:45 2018 +0200
Committer: Francesco Chicchiriccò <il...@apache.org>
Committed: Fri Jun 15 17:34:16 2018 +0200
----------------------------------------------------------------------
.../init/ClassPathScanImplementationLookup.java | 12 +
.../syncope/client/console/pages/Policies.java | 11 +
.../panels/ImplementationModalPanel.java | 14 +
.../console/policies/PolicyDirectoryPanel.java | 6 +-
.../policies/PolicyModalPanelBuilder.java | 12 +-
.../policies/ProvisioningPolicyModalPanel.java | 410 +++++++++++++++++++
.../policies/PullPolicyDirectoryPanel.java | 2 +-
.../console/policies/PullPolicyModalPanel.java | 338 ---------------
.../policies/PushPolicyDirectoryPanel.java | 82 ++++
.../console/rest/ImplementationRestClient.java | 8 +-
.../console/rest/RemediationRestClient.java | 2 -
.../MyPushCorrelationRule.groovy | 32 ++
.../client/console/pages/Policies.properties | 1 +
.../client/console/pages/Policies_it.properties | 1 +
.../client/console/pages/Policies_ja.properties | 1 +
.../console/pages/Policies_pt_BR.properties | 1 +
.../client/console/pages/Policies_ru.properties | 1 +
...ngPolicyModalPanel$CorrelationRulePanel.html | 34 ++
.../policies/ProvisioningPolicyModalPanel.html | 25 ++
.../ProvisioningPolicyModalPanel.properties | 20 +
.../ProvisioningPolicyModalPanel_it.properties | 21 +
.../ProvisioningPolicyModalPanel_ja.properties | 20 +
...rovisioningPolicyModalPanel_pt_BR.properties | 21 +
.../ProvisioningPolicyModalPanel_ru.properties | 21 +
...llPolicyModalPanel$CorrelationRulePanel.html | 31 --
.../console/policies/PullPolicyModalPanel.html | 25 --
.../policies/PullPolicyModalPanel.properties | 19 -
.../policies/PullPolicyModalPanel_it.properties | 20 -
.../policies/PullPolicyModalPanel_ja.properties | 19 -
.../PullPolicyModalPanel_pt_BR.properties | 20 -
.../policies/PullPolicyModalPanel_ru.properties | 20 -
.../syncope/common/lib/LogOutputStream.java | 2 +-
.../lib/policy/AbstractCorrelationRuleConf.java | 52 +++
.../policy/AbstractPullCorrelationRuleConf.java | 52 ---
.../policy/DefaultPullCorrelationRuleConf.java | 13 +-
.../policy/DefaultPushCorrelationRuleConf.java | 53 +++
.../syncope/common/lib/policy/PolicyTO.java | 2 +-
.../common/lib/policy/ProvisioningPolicyTO.java | 57 +++
.../syncope/common/lib/policy/PullPolicyTO.java | 29 +-
.../lib/policy/PushCorrelationRuleConf.java | 23 ++
.../common/lib/policy/PushPolicySpec.java | 29 --
.../syncope/common/lib/policy/PushPolicyTO.java | 41 ++
.../syncope/common/lib/to/ResourceTO.java | 10 +
.../common/lib/types/ImplementationType.java | 1 +
.../syncope/core/logic/ImplementationLogic.java | 6 +-
.../init/ClassPathScanImplementationLookup.java | 35 +-
.../persistence/api/ImplementationLookup.java | 5 +
.../core/persistence/api/dao/PolicyDAO.java | 5 +-
.../api/dao/PushCorrelationRule.java | 42 ++
.../api/dao/PushCorrelationRuleConfClass.java | 33 ++
.../core/persistence/api/entity/AnyUtils.java | 3 +
.../api/entity/policy/CorrelationRule.java | 38 --
.../entity/policy/CorrelationRuleEntity.java | 34 ++
.../api/entity/policy/ProvisioningPolicy.java | 28 ++
.../policy/PullCorrelationRuleEntity.java | 26 ++
.../api/entity/policy/PullPolicy.java | 13 +-
.../policy/PushCorrelationRuleEntity.java | 26 ++
.../api/entity/policy/PushPolicy.java | 12 +-
.../api/entity/resource/ExternalResource.java | 5 +
.../jpa/dao/DefaultPullCorrelationRule.java | 51 +--
.../jpa/dao/DefaultPushCorrelationRule.java | 74 ++++
.../jpa/dao/HaveIBeenPwnedPasswordRule.java | 2 +-
.../jpa/dao/JPAExternalResourceDAO.java | 3 +
.../core/persistence/jpa/dao/JPAPolicyDAO.java | 38 +-
.../core/persistence/jpa/dao/JPARealmDAO.java | 5 +-
.../core/persistence/jpa/dao/JPAUserDAO.java | 3 +-
.../persistence/jpa/entity/JPAAnyUtils.java | 31 ++
.../jpa/entity/JPAEntityFactory.java | 12 +-
.../policy/AbstractCorrelationRuleEntity.java | 66 +++
.../policy/AbstractProvisioningPolicy.java | 46 +++
.../jpa/entity/policy/JPACorrelationRule.java | 86 ----
.../entity/policy/JPAPolicyUtilsFactory.java | 4 +-
.../policy/JPAPullCorrelationRuleEntity.java | 56 +++
.../jpa/entity/policy/JPAPullPolicy.java | 34 +-
.../policy/JPAPushCorrelationRuleEntity.java | 56 +++
.../jpa/entity/policy/JPAPushPolicy.java | 31 +-
.../entity/resource/JPAExternalResource.java | 16 +
.../jpa/DummyImplementationLookup.java | 10 +
.../jpa/inner/ImplementationTest.java | 5 +-
.../core/persistence/jpa/inner/PolicyTest.java | 42 +-
.../test/resources/domains/MasterContent.xml | 11 +-
.../core/provisioning/api/MappingManager.java | 11 +
.../api/pushpull/ProvisioningProfile.java | 10 +-
.../provisioning/java/MappingManagerImpl.java | 39 +-
.../java/data/AbstractAnyDataBinder.java | 5 +-
.../java/data/AnyObjectDataBinderImpl.java | 6 +-
.../java/data/ImplementationDataBinderImpl.java | 13 +-
.../java/data/PolicyDataBinderImpl.java | 53 ++-
.../java/data/ResourceDataBinderImpl.java | 7 +
.../java/data/UserDataBinderImpl.java | 6 +-
.../java/jexl/SyncopeJexlFunctions.java | 6 +-
.../pushpull/AbstractPullResultHandler.java | 14 +-
.../pushpull/AbstractPushResultHandler.java | 159 +++----
.../pushpull/AbstractSyncopeResultHandler.java | 17 -
.../DefaultAnyObjectPullResultHandler.java | 18 -
.../DefaultAnyObjectPushResultHandler.java | 22 +-
.../pushpull/DefaultGroupPullResultHandler.java | 18 -
.../pushpull/DefaultGroupPushResultHandler.java | 18 -
.../pushpull/DefaultRealmPullResultHandler.java | 2 +-
.../pushpull/DefaultUserPullResultHandler.java | 18 -
.../pushpull/DefaultUserPushResultHandler.java | 18 -
.../java/pushpull/PullJobDelegate.java | 2 +-
.../provisioning/java/pushpull/PullUtils.java | 22 +-
.../java/pushpull/PushJobDelegate.java | 5 +-
.../provisioning/java/pushpull/PushUtils.java | 132 ++++++
.../java/pushpull/SinglePullJobDelegate.java | 2 +-
.../java/pushpull/SinglePushJobDelegate.java | 3 +-
.../java/utils/ConnObjectUtils.java | 9 +-
.../java/DummyImplementationLookup.java | 11 +-
.../core/spring/ImplementationManager.java | 37 ++
.../core/spring/security/JWTSSOProvider.java | 2 +-
.../security/DummyImplementationLookup.java | 10 +-
.../entity/OIDCProviderValidator.java | 2 -
.../reference/DummyPullCorrelationRule.java | 1 -
.../reference/DummyPullCorrelationRuleConf.java | 4 +-
.../reference/DummyPushCorrelationRule.java | 36 ++
.../reference/DummyPushCorrelationRuleConf.java | 29 ++
.../core/reference/ITImplementationLookup.java | 31 +-
.../org/apache/syncope/fit/AbstractITCase.java | 24 +-
.../apache/syncope/fit/core/PolicyITCase.java | 47 ++-
.../apache/syncope/fit/core/PullTaskITCase.java | 3 +-
.../apache/syncope/fit/core/PushTaskITCase.java | 51 +++
.../src/test/resources/TestPullRule.groovy | 2 +-
.../src/test/resources/TestPushRule.groovy | 39 ++
.../reference-guide/concepts/policies.adoc | 39 +-
125 files changed, 2420 insertions(+), 1190 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/syncope/blob/595a8d15/client/console/src/main/java/org/apache/syncope/client/console/init/ClassPathScanImplementationLookup.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/init/ClassPathScanImplementationLookup.java b/client/console/src/main/java/org/apache/syncope/client/console/init/ClassPathScanImplementationLookup.java
index 22ac2f4..876d299 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/init/ClassPathScanImplementationLookup.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/init/ClassPathScanImplementationLookup.java
@@ -41,6 +41,7 @@ import org.apache.syncope.client.console.widgets.BaseExtWidget;
import org.apache.syncope.common.lib.policy.AccountRuleConf;
import org.apache.syncope.common.lib.policy.PasswordRuleConf;
import org.apache.syncope.common.lib.policy.PullCorrelationRuleConf;
+import org.apache.syncope.common.lib.policy.PushCorrelationRuleConf;
import org.apache.syncope.common.lib.report.ReportletConf;
import org.apache.syncope.common.lib.to.AnyObjectTO;
import org.apache.syncope.common.lib.to.GroupTO;
@@ -102,6 +103,8 @@ public class ClassPathScanImplementationLookup {
private Map<String, Class<? extends PullCorrelationRuleConf>> pullCorrelationRuleConfs;
+ private Map<String, Class<? extends PushCorrelationRuleConf>> pushCorrelationRuleConfs;
+
/**
* This method can be overridden by subclasses to customize classpath scan.
*
@@ -122,6 +125,7 @@ public class ClassPathScanImplementationLookup {
accountRuleConfs = new HashMap<>();
passwordRuleConfs = new HashMap<>();
pullCorrelationRuleConfs = new HashMap<>();
+ pushCorrelationRuleConfs = new HashMap<>();
ClassPathScanningCandidateComponentProvider scanner = new ClassPathScanningCandidateComponentProvider(false);
scanner.addIncludeFilter(new AssignableTypeFilter(BasePage.class));
@@ -133,6 +137,7 @@ public class ClassPathScanImplementationLookup {
scanner.addIncludeFilter(new AssignableTypeFilter(AccountRuleConf.class));
scanner.addIncludeFilter(new AssignableTypeFilter(PasswordRuleConf.class));
scanner.addIncludeFilter(new AssignableTypeFilter(PullCorrelationRuleConf.class));
+ scanner.addIncludeFilter(new AssignableTypeFilter(PushCorrelationRuleConf.class));
scanner.findCandidateComponents(getBasePackage()).forEach(bd -> {
try {
@@ -169,6 +174,8 @@ public class ClassPathScanImplementationLookup {
passwordRuleConfs.put(clazz.getName(), (Class<? extends PasswordRuleConf>) clazz);
} else if (PullCorrelationRuleConf.class.isAssignableFrom(clazz)) {
pullCorrelationRuleConfs.put(clazz.getName(), (Class<? extends PullCorrelationRuleConf>) clazz);
+ } else if (PushCorrelationRuleConf.class.isAssignableFrom(clazz)) {
+ pushCorrelationRuleConfs.put(clazz.getName(), (Class<? extends PushCorrelationRuleConf>) clazz);
}
}
} catch (Throwable t) {
@@ -196,6 +203,7 @@ public class ClassPathScanImplementationLookup {
accountRuleConfs = Collections.unmodifiableMap(accountRuleConfs);
passwordRuleConfs = Collections.unmodifiableMap(passwordRuleConfs);
pullCorrelationRuleConfs = Collections.unmodifiableMap(pullCorrelationRuleConfs);
+ pushCorrelationRuleConfs = Collections.unmodifiableMap(pushCorrelationRuleConfs);
LOG.debug("Binary previewers found: {}", previewers);
LOG.debug("Extension pages found: {}", extPages);
@@ -205,6 +213,7 @@ public class ClassPathScanImplementationLookup {
LOG.debug("Account Rule configurations found: {}", accountRuleConfs);
LOG.debug("Password Rule configurations found: {}", passwordRuleConfs);
LOG.debug("Pull Correlation Rule configurations found: {}", pullCorrelationRuleConfs);
+ LOG.debug("Push Correlation Rule configurations found: {}", pushCorrelationRuleConfs);
}
public Class<? extends AbstractBinaryPreviewer> getPreviewerClass(final String mimeType) {
@@ -253,4 +262,7 @@ public class ClassPathScanImplementationLookup {
return pullCorrelationRuleConfs;
}
+ public Map<String, Class<? extends PushCorrelationRuleConf>> getPushCorrelationRuleConfs() {
+ return pushCorrelationRuleConfs;
+ }
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/595a8d15/client/console/src/main/java/org/apache/syncope/client/console/pages/Policies.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/pages/Policies.java b/client/console/src/main/java/org/apache/syncope/client/console/pages/Policies.java
index 508c6c8..294b238 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/pages/Policies.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/pages/Policies.java
@@ -25,6 +25,7 @@ import org.apache.syncope.client.console.BookmarkablePageLinkBuilder;
import org.apache.syncope.client.console.policies.AccountPolicyDirectoryPanel;
import org.apache.syncope.client.console.policies.PasswordPolicyDirectoryPanel;
import org.apache.syncope.client.console.policies.PullPolicyDirectoryPanel;
+import org.apache.syncope.client.console.policies.PushPolicyDirectoryPanel;
import org.apache.wicket.extensions.markup.html.tabs.AbstractTab;
import org.apache.wicket.extensions.markup.html.tabs.ITab;
import org.apache.wicket.markup.html.WebMarkupContainer;
@@ -81,6 +82,16 @@ public class Policies extends BasePage {
}
});
+ tabs.add(new AbstractTab(new ResourceModel("policy.push")) {
+
+ private static final long serialVersionUID = -6815067322125799251L;
+
+ @Override
+ public Panel getPanel(final String panelId) {
+ return new PushPolicyDirectoryPanel(panelId, getPageReference());
+ }
+ });
+
return tabs;
}
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/595a8d15/client/console/src/main/java/org/apache/syncope/client/console/panels/ImplementationModalPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/ImplementationModalPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/ImplementationModalPanel.java
index f1b3f5b..5f3fdae 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/ImplementationModalPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/ImplementationModalPanel.java
@@ -86,6 +86,7 @@ public class ImplementationModalPanel extends AbstractModalPanel<ImplementationT
|| implementation.getType() == ImplementationType.ACCOUNT_RULE
|| implementation.getType() == ImplementationType.PASSWORD_RULE
|| implementation.getType() == ImplementationType.PULL_CORRELATION_RULE
+ || implementation.getType() == ImplementationType.PUSH_CORRELATION_RULE
? ViewMode.JSON_BODY
: ViewMode.JAVA_CLASS;
this.create = implementation.getKey() == null;
@@ -127,6 +128,11 @@ public class ImplementationModalPanel extends AbstractModalPanel<ImplementationT
collect(Collectors.toList());
break;
+ case PUSH_CORRELATION_RULE:
+ classes = implementationLookup.getPushCorrelationRuleConfs().keySet().stream().
+ collect(Collectors.toList());
+ break;
+
default:
}
}
@@ -216,6 +222,10 @@ public class ImplementationModalPanel extends AbstractModalPanel<ImplementationT
templateClassName = "MyPullCorrelationRule";
break;
+ case PUSH_CORRELATION_RULE:
+ templateClassName = "MyPushCorrelationRule";
+ break;
+
case VALIDATOR:
templateClassName = "MyValidator";
break;
@@ -275,6 +285,10 @@ public class ImplementationModalPanel extends AbstractModalPanel<ImplementationT
clazz = implementationLookup.getPullCorrelationRuleConfs().get(jsonClass.getModelObject());
break;
+ case PUSH_CORRELATION_RULE:
+ clazz = implementationLookup.getPushCorrelationRuleConfs().get(jsonClass.getModelObject());
+ break;
+
default:
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/595a8d15/client/console/src/main/java/org/apache/syncope/client/console/policies/PolicyDirectoryPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/policies/PolicyDirectoryPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/policies/PolicyDirectoryPanel.java
index ab029ef..aae9114 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/policies/PolicyDirectoryPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/policies/PolicyDirectoryPanel.java
@@ -123,8 +123,10 @@ public abstract class PolicyDirectoryPanel<T extends PolicyTO>
new StringResourceModel("description", this), "description", "description"));
columns.add(new CollectionPropertyColumn<>(
new StringResourceModel("usedByResources", this), "usedByResources"));
- columns.add(new CollectionPropertyColumn<>(
- new StringResourceModel("usedByRealms", this), "usedByRealms"));
+ if (type != PolicyType.PULL && type != PolicyType.PUSH) {
+ columns.add(new CollectionPropertyColumn<>(
+ new StringResourceModel("usedByRealms", this), "usedByRealms"));
+ }
addCustomColumnFields(columns);
http://git-wip-us.apache.org/repos/asf/syncope/blob/595a8d15/client/console/src/main/java/org/apache/syncope/client/console/policies/PolicyModalPanelBuilder.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/policies/PolicyModalPanelBuilder.java b/client/console/src/main/java/org/apache/syncope/client/console/policies/PolicyModalPanelBuilder.java
index 1be9976..6bad2d4 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/policies/PolicyModalPanelBuilder.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/policies/PolicyModalPanelBuilder.java
@@ -43,7 +43,7 @@ import org.apache.syncope.client.console.wizards.AjaxWizard;
import org.apache.syncope.common.lib.policy.PolicyTO;
import org.apache.syncope.common.lib.policy.AccountPolicyTO;
import org.apache.syncope.common.lib.policy.PasswordPolicyTO;
-import org.apache.syncope.common.lib.policy.PullPolicyTO;
+import org.apache.syncope.common.lib.policy.ProvisioningPolicyTO;
import org.apache.syncope.common.lib.to.EntityTO;
import org.apache.syncope.common.lib.types.ConflictResolutionAction;
import org.apache.syncope.common.lib.types.PolicyType;
@@ -113,7 +113,7 @@ public class PolicyModalPanelBuilder<T extends PolicyTO> extends AbstractModalPa
"field",
"maxAuthenticationAttempts",
Integer.class,
- new PropertyModel<Integer>(policyTO, "maxAuthenticationAttempts")));
+ new PropertyModel<>(policyTO, "maxAuthenticationAttempts")));
fields.add(new AjaxCheckBoxPanel(
"field",
@@ -123,21 +123,21 @@ public class PolicyModalPanelBuilder<T extends PolicyTO> extends AbstractModalPa
fields.add(new AjaxPalettePanel.Builder<String>().setName("passthroughResources").build(
"field",
- new PropertyModel<List<String>>(policyTO, "passthroughResources"),
- new ListModel<String>(resources.getObject())));
+ new PropertyModel<>(policyTO, "passthroughResources"),
+ new ListModel<>(resources.getObject())));
} else if (policyTO instanceof PasswordPolicyTO) {
fields.add(new AjaxSpinnerFieldPanel.Builder<Integer>().build(
"field",
"historyLength",
Integer.class,
- new PropertyModel<Integer>(policyTO, "historyLength")));
+ new PropertyModel<>(policyTO, "historyLength")));
fields.add(new AjaxCheckBoxPanel(
"field",
"allowNullPassword",
new PropertyModel<>(policyTO, "allowNullPassword"),
false));
- } else if (policyTO instanceof PullPolicyTO) {
+ } else if (policyTO instanceof ProvisioningPolicyTO) {
fields.add(new AjaxDropDownChoicePanel<>(
"field",
"conflictResolutionAction",
http://git-wip-us.apache.org/repos/asf/syncope/blob/595a8d15/client/console/src/main/java/org/apache/syncope/client/console/policies/ProvisioningPolicyModalPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/policies/ProvisioningPolicyModalPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/policies/ProvisioningPolicyModalPanel.java
new file mode 100644
index 0000000..96176b6
--- /dev/null
+++ b/client/console/src/main/java/org/apache/syncope/client/console/policies/ProvisioningPolicyModalPanel.java
@@ -0,0 +1,410 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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 org.apache.syncope.client.console.policies;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.function.Function;
+import java.util.stream.Collectors;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.syncope.client.console.SyncopeConsoleSession;
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.pages.BasePage;
+import org.apache.syncope.client.console.panels.AbstractModalPanel;
+import org.apache.syncope.client.console.rest.AnyTypeRestClient;
+import org.apache.syncope.client.console.rest.ImplementationRestClient;
+import org.apache.syncope.client.console.rest.PolicyRestClient;
+import org.apache.syncope.client.console.rest.SchemaRestClient;
+import org.apache.syncope.client.console.wicket.ajax.form.IndicatorAjaxFormComponentUpdatingBehavior;
+import org.apache.syncope.client.console.wicket.markup.html.bootstrap.dialog.BaseModal;
+import org.apache.syncope.client.console.wicket.markup.html.form.AjaxCheckBoxPanel;
+import org.apache.syncope.client.console.wicket.markup.html.form.AjaxDropDownChoicePanel;
+import org.apache.syncope.client.console.wicket.markup.html.form.AjaxPalettePanel;
+import org.apache.syncope.client.console.wicket.markup.html.form.MultiPanel;
+import org.apache.syncope.common.lib.policy.AbstractCorrelationRuleConf;
+import org.apache.syncope.common.lib.policy.DefaultPullCorrelationRuleConf;
+import org.apache.syncope.common.lib.policy.DefaultPushCorrelationRuleConf;
+import org.apache.syncope.common.lib.policy.ProvisioningPolicyTO;
+import org.apache.syncope.common.lib.policy.PullPolicyTO;
+import org.apache.syncope.common.lib.to.EntityTO;
+import org.apache.syncope.common.lib.to.ImplementationTO;
+import org.apache.syncope.common.lib.types.AnyTypeKind;
+import org.apache.syncope.common.lib.types.ImplementationEngine;
+import org.apache.syncope.common.lib.types.ImplementationType;
+import org.apache.syncope.common.lib.types.PolicyType;
+import org.apache.syncope.common.lib.types.SchemaType;
+import org.apache.wicket.PageReference;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.markup.html.list.ListItem;
+import org.apache.wicket.markup.html.panel.Panel;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.LoadableDetachableModel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.model.PropertyModel;
+
+public class ProvisioningPolicyModalPanel extends AbstractModalPanel<ProvisioningPolicyTO> {
+
+ private static final long serialVersionUID = 2988891313881271124L;
+
+ private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper();
+
+ private final PolicyRestClient restClient = new PolicyRestClient();
+
+ private final ImplementationRestClient implRestClient = new ImplementationRestClient();
+
+ private final SchemaRestClient schemaRestClient = new SchemaRestClient();
+
+ private final LoadableDetachableModel<Map<String, ImplementationTO>> implementations;
+
+ private final IModel<List<CorrelationRule>> model;
+
+ @SuppressWarnings("unchecked")
+ public ProvisioningPolicyModalPanel(
+ final ProvisioningPolicyTO policyTO,
+ final BaseModal<? extends ProvisioningPolicyTO> modal,
+ final PageReference pageRef) {
+
+ super((BaseModal<ProvisioningPolicyTO>) modal, pageRef);
+ ((BaseModal<ProvisioningPolicyTO>) modal).setFormModel(policyTO);
+
+ implementations = new LoadableDetachableModel<Map<String, ImplementationTO>>() {
+
+ private static final long serialVersionUID = 5275935387613157437L;
+
+ @Override
+ protected Map<String, ImplementationTO> load() {
+ return implRestClient.list(policyTO instanceof PullPolicyTO
+ ? ImplementationType.PULL_CORRELATION_RULE
+ : ImplementationType.PUSH_CORRELATION_RULE).stream().
+ collect(Collectors.toMap(EntityTO::getKey, Function.identity()));
+ }
+ };
+
+ model = new PropertyModel<List<CorrelationRule>>(policyTO, "correlationRules") {
+
+ private static final long serialVersionUID = -8168676563540297301L;
+
+ private final List<CorrelationRule> rules = policyTO.getCorrelationRules().keySet().stream().
+ map(anyType -> new CorrelationRule(
+ policyTO instanceof PullPolicyTO
+ ? DefaultPullCorrelationRuleConf.class
+ : DefaultPushCorrelationRuleConf.class,
+ anyType,
+ implementations.getObject().get(policyTO.getCorrelationRules().get(anyType)))).
+ collect(Collectors.toList());
+
+ @Override
+ public List<CorrelationRule> getObject() {
+ return rules;
+ }
+
+ @Override
+ public void setObject(final List<CorrelationRule> object) {
+ policyTO.getCorrelationRules().clear();
+ rules.forEach(rule -> {
+ policyTO.getCorrelationRules().put(rule.getAnyType(), rule.getImpl().getKey());
+ });
+ }
+ };
+
+ add(new MultiPanel<CorrelationRule>("correlationRules", "correlationRules", model) {
+
+ private static final long serialVersionUID = -2481579077338205547L;
+
+ @Override
+ protected CorrelationRule newModelObject() {
+ return new CorrelationRule(policyTO instanceof PullPolicyTO
+ ? DefaultPullCorrelationRuleConf.class
+ : DefaultPushCorrelationRuleConf.class);
+ }
+
+ @Override
+ protected CorrelationRulePanel getItemPanel(final ListItem<CorrelationRule> item) {
+ return new CorrelationRulePanel("panel", Model.of(item.getModelObject()));
+ }
+ });
+ }
+
+ @Override
+ public void onSubmit(final AjaxRequestTarget target) {
+ try {
+ getItem().getCorrelationRules().clear();
+ model.getObject().forEach(rule -> {
+ getItem().getCorrelationRules().put(rule.getAnyType(), rule.getImplKey());
+
+ if (rule.getImpl().getEngine() == ImplementationEngine.JAVA && rule.getDefaultRuleConf() != null) {
+ try {
+ implRestClient.update(rule.getImpl());
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+ });
+ restClient.updatePolicy(getItem() instanceof PullPolicyTO ? PolicyType.PULL : PolicyType.PUSH, getItem());
+
+ SyncopeConsoleSession.get().info(getString(Constants.OPERATION_SUCCEEDED));
+ this.modal.close(target);
+ } catch (Exception e) {
+ LOG.error("While creating/updating policy", e);
+ SyncopeConsoleSession.get().error(
+ StringUtils.isBlank(e.getMessage()) ? e.getClass().getName() : e.getMessage());
+ }
+ ((BasePage) pageRef.getPage()).getNotificationPanel().refresh(target);
+ }
+
+ protected class CorrelationRulePanel extends Panel {
+
+ private static final long serialVersionUID = -5380414818290018189L;
+
+ CorrelationRulePanel(final String id, final IModel<CorrelationRule> correlationRule) {
+ super(id);
+
+ AjaxDropDownChoicePanel<String> anyType = new AjaxDropDownChoicePanel<>(
+ "anyType", "anyType", new PropertyModel<String>(correlationRule.getObject(), "anyType")).
+ setNullValid(true).
+ setChoices(new AnyTypeRestClient().list());
+ anyType.setNullValid(false);
+ anyType.setRequired(true);
+ anyType.setOutputMarkupId(true);
+ add(anyType);
+
+ AjaxDropDownChoicePanel<String> rule = new AjaxDropDownChoicePanel<>(
+ "rule", "rule", new PropertyModel<String>(correlationRule.getObject(), "implKey")).
+ setChoices(implementations.getObject().keySet().stream().sorted().collect(Collectors.toList()));
+ rule.setNullValid(false);
+ rule.setRequired(true);
+ rule.setOutputMarkupId(true);
+ add(rule);
+
+ PropertyModel<Boolean> orSchemasModel =
+ new PropertyModel<Boolean>(correlationRule.getObject().getDefaultRuleConf(), "orSchemas") {
+
+ private static final long serialVersionUID = 807008909842554829L;
+
+ private boolean orSchemas() {
+ AbstractCorrelationRuleConf conf = correlationRule.getObject().getDefaultRuleConf();
+ return conf instanceof DefaultPullCorrelationRuleConf
+ ? DefaultPullCorrelationRuleConf.class.cast(conf).isOrSchemas()
+ : conf instanceof DefaultPushCorrelationRuleConf
+ ? DefaultPushCorrelationRuleConf.class.cast(conf).isOrSchemas()
+ : false;
+ }
+
+ @Override
+ public Boolean getObject() {
+ AbstractCorrelationRuleConf conf = correlationRule.getObject().getDefaultRuleConf();
+ return conf instanceof DefaultPullCorrelationRuleConf
+ ? DefaultPullCorrelationRuleConf.class.cast(conf).isOrSchemas()
+ : conf instanceof DefaultPushCorrelationRuleConf
+ ? DefaultPushCorrelationRuleConf.class.cast(conf).isOrSchemas()
+ : false;
+ }
+
+ @Override
+ public void setObject(final Boolean object) {
+ AbstractCorrelationRuleConf conf = correlationRule.getObject().getDefaultRuleConf();
+ if (conf instanceof DefaultPullCorrelationRuleConf) {
+ DefaultPullCorrelationRuleConf.class.cast(conf).setOrSchemas(object);
+ } else if (conf instanceof DefaultPushCorrelationRuleConf) {
+ DefaultPushCorrelationRuleConf.class.cast(conf).setOrSchemas(object);
+ }
+ }
+ };
+ AjaxCheckBoxPanel orSchemas = new AjaxCheckBoxPanel("orSchemas", "orSchemas", orSchemasModel, false);
+ orSchemas.setOutputMarkupPlaceholderTag(true);
+ add(orSchemas.setVisible(correlationRule.getObject().getDefaultRuleConf() != null));
+
+ PropertyModel<List<String>> defaultRuleConfModel =
+ new PropertyModel<List<String>>(correlationRule.getObject().getDefaultRuleConf(), "schemas") {
+
+ private static final long serialVersionUID = 3799387950428254072L;
+
+ private List<String> schemas() {
+ AbstractCorrelationRuleConf conf = correlationRule.getObject().getDefaultRuleConf();
+ return conf instanceof DefaultPullCorrelationRuleConf
+ ? DefaultPullCorrelationRuleConf.class.cast(conf).getSchemas()
+ : conf instanceof DefaultPushCorrelationRuleConf
+ ? DefaultPushCorrelationRuleConf.class.cast(conf).getSchemas()
+ : Collections.emptyList();
+ }
+
+ @Override
+ public List<String> getObject() {
+ List<String> schemas = new ArrayList<>();
+ if (correlationRule.getObject().getDefaultRuleConf() != null) {
+ schemas.addAll(schemas());
+ }
+ return schemas;
+ }
+
+ @Override
+ public void setObject(final List<String> object) {
+ if (correlationRule.getObject().getDefaultRuleConf() != null) {
+ schemas().clear();
+ schemas().addAll(object);
+ }
+ }
+ };
+ AjaxPalettePanel<String> defaultRuleConf = new AjaxPalettePanel.Builder<String>().
+ setName("defaultRuleConf").build("defaultRuleConf",
+ defaultRuleConfModel, new AjaxPalettePanel.Builder.Query<String>() {
+
+ private static final long serialVersionUID = -7223078772249308813L;
+
+ @Override
+ public List<String> execute(final String filter) {
+ return getSchemas(correlationRule.getObject());
+ }
+ });
+ defaultRuleConf.hideLabel().setOutputMarkupPlaceholderTag(true);
+ add(defaultRuleConf.setVisible(correlationRule.getObject().getDefaultRuleConf() != null));
+
+ anyType.getField().add(new IndicatorAjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) {
+
+ private static final long serialVersionUID = -1107858522700306810L;
+
+ @Override
+ protected void onUpdate(final AjaxRequestTarget target) {
+ if (orSchemas.isVisibleInHierarchy()) {
+ target.add(orSchemas);
+ }
+ if (defaultRuleConf.isVisibleInHierarchy()) {
+ correlationRule.getObject().setImpl(null);
+ defaultRuleConf.reload(target);
+ target.add(defaultRuleConf);
+ }
+ }
+ });
+
+ rule.getField().add(new IndicatorAjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) {
+
+ private static final long serialVersionUID = -1107858522700306810L;
+
+ @Override
+ protected void onUpdate(final AjaxRequestTarget target) {
+ if (correlationRule.getObject().getDefaultRuleConf() == null) {
+ orSchemas.setVisible(false);
+ defaultRuleConf.setVisible(false);
+ } else {
+ orSchemas.setVisible(true);
+ defaultRuleConf.setVisible(true);
+ }
+ target.add(orSchemas);
+ target.add(defaultRuleConf);
+ }
+ });
+ }
+
+ private List<String> getSchemas(final CorrelationRule rule) {
+ List<String> choices = StringUtils.isEmpty(rule.getAnyType())
+ ? new ArrayList<>()
+ : schemaRestClient.getSchemas(SchemaType.PLAIN,
+ rule.getAnyType().equals(AnyTypeKind.USER.name())
+ ? AnyTypeKind.USER
+ : rule.getAnyType().equals(AnyTypeKind.GROUP.name())
+ ? AnyTypeKind.GROUP
+ : AnyTypeKind.ANY_OBJECT).stream().map(EntityTO::getKey).
+ collect(Collectors.toList());
+ choices.add("key");
+ choices.add(rule.getAnyType().equals(AnyTypeKind.USER.name()) ? "username" : "name");
+ Collections.sort(choices);
+ return choices;
+ }
+ }
+
+ private class CorrelationRule implements Serializable {
+
+ private static final long serialVersionUID = 4221521483948294336L;
+
+ private final Class<? extends AbstractCorrelationRuleConf> ruleConfClass;
+
+ private String anyType;
+
+ private ImplementationTO impl;
+
+ private AbstractCorrelationRuleConf defaultRuleConf;
+
+ CorrelationRule(final Class<? extends AbstractCorrelationRuleConf> ruleConfClass) {
+ this.ruleConfClass = ruleConfClass;
+ this.anyType = AnyTypeKind.USER.name();
+ }
+
+ CorrelationRule(
+ final Class<? extends AbstractCorrelationRuleConf> ruleConfClass,
+ final String anyType,
+ final ImplementationTO impl) {
+
+ this.ruleConfClass = ruleConfClass;
+ this.anyType = anyType;
+ setImpl(impl);
+ }
+
+ public String getAnyType() {
+ return anyType;
+ }
+
+ public void setAnyType(final String anyType) {
+ this.anyType = anyType;
+ }
+
+ public String getImplKey() {
+ return impl == null ? null : impl.getKey();
+ }
+
+ public void setImplKey(final String key) {
+ setImpl(implementations.getObject().get(key));
+ }
+
+ public final void setImpl(final ImplementationTO impl) {
+ this.impl = impl;
+ if (impl != null) {
+ this.defaultRuleConf = null;
+ try {
+ this.defaultRuleConf = OBJECT_MAPPER.readValue(impl.getBody(), ruleConfClass);
+ } catch (Exception e) {
+ LOG.debug("Could not deserialize {} as {}",
+ impl.getBody(), ruleConfClass.getName());
+ }
+ }
+ }
+
+ public ImplementationTO getImpl() {
+ if (defaultRuleConf != null) {
+ try {
+ this.impl.setBody(OBJECT_MAPPER.writeValueAsString(defaultRuleConf));
+ } catch (Exception e) {
+ LOG.error("Could not serialize {}", defaultRuleConf);
+ }
+ }
+ return impl;
+ }
+
+ public void setDefaultRuleConf(final DefaultPushCorrelationRuleConf defaultRuleConf) {
+ this.defaultRuleConf = defaultRuleConf;
+ }
+
+ public AbstractCorrelationRuleConf getDefaultRuleConf() {
+ return defaultRuleConf;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/595a8d15/client/console/src/main/java/org/apache/syncope/client/console/policies/PullPolicyDirectoryPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/policies/PullPolicyDirectoryPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/policies/PullPolicyDirectoryPanel.java
index e0c49a4..7861891 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/policies/PullPolicyDirectoryPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/policies/PullPolicyDirectoryPanel.java
@@ -67,7 +67,7 @@ public class PullPolicyDirectoryPanel extends PolicyDirectoryPanel<PullPolicyTO>
@Override
public void onClick(final AjaxRequestTarget target, final PullPolicyTO ignore) {
target.add(policySpecModal.setContent(
- new PullPolicyModalPanel(model.getObject(), policySpecModal, pageRef)));
+ new ProvisioningPolicyModalPanel(model.getObject(), policySpecModal, pageRef)));
policySpecModal.header(new StringResourceModel(
"policy.rules", PullPolicyDirectoryPanel.this, Model.of(model.getObject())));
http://git-wip-us.apache.org/repos/asf/syncope/blob/595a8d15/client/console/src/main/java/org/apache/syncope/client/console/policies/PullPolicyModalPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/policies/PullPolicyModalPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/policies/PullPolicyModalPanel.java
deleted file mode 100644
index da0efd9..0000000
--- a/client/console/src/main/java/org/apache/syncope/client/console/policies/PullPolicyModalPanel.java
+++ /dev/null
@@ -1,338 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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 org.apache.syncope.client.console.policies;
-
-import com.fasterxml.jackson.databind.ObjectMapper;
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-import java.util.function.Function;
-import java.util.stream.Collectors;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.syncope.client.console.SyncopeConsoleSession;
-import org.apache.syncope.client.console.commons.Constants;
-import org.apache.syncope.client.console.pages.BasePage;
-import org.apache.syncope.client.console.panels.AbstractModalPanel;
-import org.apache.syncope.client.console.rest.AnyTypeRestClient;
-import org.apache.syncope.client.console.rest.ImplementationRestClient;
-import org.apache.syncope.client.console.rest.PolicyRestClient;
-import org.apache.syncope.client.console.rest.SchemaRestClient;
-import org.apache.syncope.client.console.wicket.ajax.form.IndicatorAjaxFormComponentUpdatingBehavior;
-import org.apache.syncope.client.console.wicket.markup.html.bootstrap.dialog.BaseModal;
-import org.apache.syncope.client.console.wicket.markup.html.form.AjaxDropDownChoicePanel;
-import org.apache.syncope.client.console.wicket.markup.html.form.AjaxPalettePanel;
-import org.apache.syncope.client.console.wicket.markup.html.form.MultiPanel;
-import org.apache.syncope.common.lib.policy.DefaultPullCorrelationRuleConf;
-import org.apache.syncope.common.lib.policy.PullPolicyTO;
-import org.apache.syncope.common.lib.to.EntityTO;
-import org.apache.syncope.common.lib.to.ImplementationTO;
-import org.apache.syncope.common.lib.types.AnyTypeKind;
-import org.apache.syncope.common.lib.types.ImplementationEngine;
-import org.apache.syncope.common.lib.types.ImplementationType;
-import org.apache.syncope.common.lib.types.PolicyType;
-import org.apache.syncope.common.lib.types.SchemaType;
-import org.apache.wicket.PageReference;
-import org.apache.wicket.ajax.AjaxRequestTarget;
-import org.apache.wicket.markup.html.list.ListItem;
-import org.apache.wicket.markup.html.panel.Panel;
-import org.apache.wicket.model.IModel;
-import org.apache.wicket.model.LoadableDetachableModel;
-import org.apache.wicket.model.Model;
-import org.apache.wicket.model.PropertyModel;
-
-public class PullPolicyModalPanel extends AbstractModalPanel<PullPolicyTO> {
-
- private static final long serialVersionUID = 2988891313881271124L;
-
- private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper();
-
- private final PolicyRestClient restClient = new PolicyRestClient();
-
- private final ImplementationRestClient implRestClient = new ImplementationRestClient();
-
- private final SchemaRestClient schemaRestClient = new SchemaRestClient();
-
- private final LoadableDetachableModel<Map<String, ImplementationTO>> implementations =
- new LoadableDetachableModel<Map<String, ImplementationTO>>() {
-
- private static final long serialVersionUID = 5275935387613157437L;
-
- @Override
- protected Map<String, ImplementationTO> load() {
- return implRestClient.list(ImplementationType.PULL_CORRELATION_RULE).stream().
- collect(Collectors.toMap(EntityTO::getKey, Function.identity()));
- }
- };
-
- private final IModel<List<CorrelationRule>> model;
-
- public PullPolicyModalPanel(
- final PullPolicyTO policyTO,
- final BaseModal<PullPolicyTO> modal,
- final PageReference pageRef) {
-
- super(modal, pageRef);
- modal.setFormModel(policyTO);
-
- model = new PropertyModel<List<CorrelationRule>>(policyTO, "correlationRules") {
-
- private static final long serialVersionUID = -8168676563540297301L;
-
- private final List<CorrelationRule> rules = policyTO.getCorrelationRules().keySet().stream().
- map(anyType -> new CorrelationRule(anyType,
- implementations.getObject().get(policyTO.getCorrelationRules().get(anyType)))).
- collect(Collectors.toList());
-
- @Override
- public List<CorrelationRule> getObject() {
- return rules;
- }
-
- @Override
- public void setObject(final List<CorrelationRule> object) {
- policyTO.getCorrelationRules().clear();
- rules.forEach(rule -> {
- policyTO.getCorrelationRules().put(rule.getAnyType(), rule.getImpl().getKey());
- });
- }
- };
-
- add(new MultiPanel<CorrelationRule>("correlationRules", "correlationRules", model) {
-
- private static final long serialVersionUID = -2481579077338205547L;
-
- @Override
- protected CorrelationRule newModelObject() {
- return new CorrelationRule();
- }
-
- @Override
- protected CorrelationRulePanel getItemPanel(final ListItem<CorrelationRule> item) {
- return new CorrelationRulePanel("panel", Model.of(item.getModelObject()));
- }
- });
- }
-
- @Override
- public void onSubmit(final AjaxRequestTarget target) {
- try {
- getItem().getCorrelationRules().clear();
- model.getObject().forEach(rule -> {
- getItem().getCorrelationRules().put(rule.getAnyType(), rule.getImplKey());
-
- if (rule.getImpl().getEngine() == ImplementationEngine.JAVA && rule.getDefaultRuleConf() != null) {
- try {
- implRestClient.update(rule.getImpl());
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
- });
- restClient.updatePolicy(PolicyType.PULL, getItem());
-
- SyncopeConsoleSession.get().info(getString(Constants.OPERATION_SUCCEEDED));
- this.modal.close(target);
- } catch (Exception e) {
- LOG.error("While creating/updating policy", e);
- SyncopeConsoleSession.get().error(
- StringUtils.isBlank(e.getMessage()) ? e.getClass().getName() : e.getMessage());
- }
- ((BasePage) pageRef.getPage()).getNotificationPanel().refresh(target);
- }
-
- protected class CorrelationRulePanel extends Panel {
-
- private static final long serialVersionUID = -5380414818290018189L;
-
- CorrelationRulePanel(final String id, final IModel<CorrelationRule> correlationRule) {
- super(id);
-
- AjaxDropDownChoicePanel<String> anyType = new AjaxDropDownChoicePanel<>(
- "anyType", "anyType", new PropertyModel<String>(correlationRule.getObject(), "anyType")).
- setNullValid(true).
- setChoices(new AnyTypeRestClient().list());
- anyType.setNullValid(false);
- anyType.setRequired(true);
- anyType.setOutputMarkupId(true);
- add(anyType);
-
- AjaxDropDownChoicePanel<String> rule = new AjaxDropDownChoicePanel<>(
- "rule", "rule", new PropertyModel<String>(correlationRule.getObject(), "implKey")).
- setChoices(implementations.getObject().keySet().stream().sorted().collect(Collectors.toList()));
- rule.setNullValid(false);
- rule.setRequired(true);
- rule.setOutputMarkupId(true);
- add(rule);
-
- PropertyModel<List<String>> defaultRuleConfModel =
- new PropertyModel<List<String>>(correlationRule.getObject().getDefaultRuleConf(), "schemas") {
-
- private static final long serialVersionUID = 3799387950428254072L;
-
- @Override
- public List<String> getObject() {
- List<String> schemas = new ArrayList<>();
- if (correlationRule.getObject().getDefaultRuleConf() != null) {
- schemas.addAll(correlationRule.getObject().getDefaultRuleConf().getSchemas());
- }
- return schemas;
- }
-
- @Override
- public void setObject(final List<String> object) {
- if (correlationRule.getObject().getDefaultRuleConf() != null) {
- correlationRule.getObject().getDefaultRuleConf().getSchemas().clear();
- correlationRule.getObject().getDefaultRuleConf().getSchemas().addAll(object);
- }
- }
- };
-
- AjaxPalettePanel<String> defaultRuleConf = new AjaxPalettePanel.Builder<String>().
- setName("defaultRuleConf").build("defaultRuleConf",
- defaultRuleConfModel, new AjaxPalettePanel.Builder.Query<String>() {
-
- private static final long serialVersionUID = -7223078772249308813L;
-
- @Override
- public List<String> execute(final String filter) {
- return getSchemas(correlationRule.getObject());
- }
- });
- defaultRuleConf.hideLabel().setOutputMarkupPlaceholderTag(true);
- add(defaultRuleConf.setVisible(correlationRule.getObject().getDefaultRuleConf() != null));
-
- anyType.getField().add(new IndicatorAjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) {
-
- private static final long serialVersionUID = -1107858522700306810L;
-
- @Override
- protected void onUpdate(final AjaxRequestTarget target) {
- if (defaultRuleConf.isVisibleInHierarchy()) {
- correlationRule.getObject().setImpl(null);
- defaultRuleConf.reload(target);
- target.add(defaultRuleConf);
- }
- }
- });
-
- rule.getField().add(new IndicatorAjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) {
-
- private static final long serialVersionUID = -1107858522700306810L;
-
- @Override
- protected void onUpdate(final AjaxRequestTarget target) {
- if (correlationRule.getObject().getDefaultRuleConf() == null) {
- defaultRuleConf.setVisible(false);
- } else {
- defaultRuleConf.setVisible(true);
- }
- target.add(defaultRuleConf);
- }
- });
- }
-
- private List<String> getSchemas(final CorrelationRule rule) {
- List<String> choices = StringUtils.isEmpty(rule.getAnyType())
- ? new ArrayList<>()
- : schemaRestClient.getSchemas(SchemaType.PLAIN,
- rule.getAnyType().equals(AnyTypeKind.USER.name())
- ? AnyTypeKind.USER
- : rule.getAnyType().equals(AnyTypeKind.GROUP.name())
- ? AnyTypeKind.GROUP
- : AnyTypeKind.ANY_OBJECT).stream().map(EntityTO::getKey).
- collect(Collectors.toList());
- choices.add("key");
- choices.add(rule.getAnyType().equals(AnyTypeKind.USER.name()) ? "username" : "name");
- Collections.sort(choices);
- return choices;
- }
- }
-
- private class CorrelationRule implements Serializable {
-
- private static final long serialVersionUID = 4221521483948294336L;
-
- private String anyType;
-
- private ImplementationTO impl;
-
- private DefaultPullCorrelationRuleConf defaultRuleConf;
-
- CorrelationRule() {
- this.anyType = AnyTypeKind.USER.name();
- }
-
- CorrelationRule(final String anyType, final ImplementationTO impl) {
- this.anyType = anyType;
- setImpl(impl);
- }
-
- public String getAnyType() {
- return anyType;
- }
-
- public void setAnyType(final String anyType) {
- this.anyType = anyType;
- }
-
- public String getImplKey() {
- return impl == null ? null : impl.getKey();
- }
-
- public void setImplKey(final String key) {
- setImpl(implementations.getObject().get(key));
- }
-
- public final void setImpl(final ImplementationTO impl) {
- this.impl = impl;
- if (impl != null) {
- this.defaultRuleConf = null;
- try {
- this.defaultRuleConf = OBJECT_MAPPER.readValue(
- impl.getBody(), DefaultPullCorrelationRuleConf.class);
- } catch (Exception e) {
- LOG.debug("Could not deserialize {} as {}",
- impl.getBody(), DefaultPullCorrelationRuleConf.class.getName());
- }
- }
- }
-
- public ImplementationTO getImpl() {
- if (defaultRuleConf != null) {
- try {
- this.impl.setBody(OBJECT_MAPPER.writeValueAsString(defaultRuleConf));
- } catch (Exception e) {
- LOG.error("Could not serialize {}", defaultRuleConf);
- }
- }
- return impl;
- }
-
- public void setDefaultRuleConf(final DefaultPullCorrelationRuleConf defaultRuleConf) {
- this.defaultRuleConf = defaultRuleConf;
- }
-
- public DefaultPullCorrelationRuleConf getDefaultRuleConf() {
- return defaultRuleConf;
- }
-
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/595a8d15/client/console/src/main/java/org/apache/syncope/client/console/policies/PushPolicyDirectoryPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/policies/PushPolicyDirectoryPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/policies/PushPolicyDirectoryPanel.java
new file mode 100644
index 0000000..fa50014
--- /dev/null
+++ b/client/console/src/main/java/org/apache/syncope/client/console/policies/PushPolicyDirectoryPanel.java
@@ -0,0 +1,82 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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 org.apache.syncope.client.console.policies;
+
+import java.util.List;
+import org.apache.syncope.client.console.wicket.markup.html.form.ActionLink;
+import org.apache.syncope.client.console.wicket.markup.html.form.ActionsPanel;
+import org.apache.syncope.common.lib.policy.PushPolicyTO;
+import org.apache.syncope.common.lib.types.PolicyType;
+import org.apache.syncope.common.lib.types.StandardEntitlement;
+import org.apache.wicket.PageReference;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.model.StringResourceModel;
+
+/**
+ * Push policies page.
+ */
+public class PushPolicyDirectoryPanel extends PolicyDirectoryPanel<PushPolicyTO> {
+
+ private static final long serialVersionUID = 4984337552918213290L;
+
+ public PushPolicyDirectoryPanel(final String id, final PageReference pageRef) {
+ super(id, PolicyType.PUSH, pageRef);
+
+ final PushPolicyTO defaultItem = new PushPolicyTO();
+
+ this.addNewItemPanelBuilder(
+ new PolicyModalPanelBuilder<>(PolicyType.PUSH, defaultItem, modal, pageRef), true);
+ MetaDataRoleAuthorizationStrategy.authorize(addAjaxLink, RENDER, StandardEntitlement.POLICY_CREATE);
+
+ initResultTable();
+ }
+
+ @Override
+ protected void addCustomColumnFields(final List<IColumn<PushPolicyTO, String>> columns) {
+ columns.add(new PropertyColumn<>(new StringResourceModel(
+ "conflictResolutionAction", this), "conflictResolutionAction", "conflictResolutionAction"));
+ }
+
+ @Override
+ protected void addCustomActions(final ActionsPanel<PushPolicyTO> panel, final IModel<PushPolicyTO> model) {
+ panel.add(new ActionLink<PushPolicyTO>() {
+
+ private static final long serialVersionUID = -3722207913631435501L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target, final PushPolicyTO ignore) {
+ target.add(policySpecModal.setContent(
+ new ProvisioningPolicyModalPanel(model.getObject(), policySpecModal, pageRef)));
+
+ policySpecModal.header(new StringResourceModel(
+ "policy.rules", PushPolicyDirectoryPanel.this, Model.of(model.getObject())));
+
+ MetaDataRoleAuthorizationStrategy.authorize(
+ policySpecModal.getForm(), ENABLE, StandardEntitlement.POLICY_UPDATE);
+
+ policySpecModal.show(true);
+ }
+ }, ActionLink.ActionType.COMPOSE, StandardEntitlement.POLICY_UPDATE);
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/595a8d15/client/console/src/main/java/org/apache/syncope/client/console/rest/ImplementationRestClient.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/rest/ImplementationRestClient.java b/client/console/src/main/java/org/apache/syncope/client/console/rest/ImplementationRestClient.java
index 7d99c7c..746ea70 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/rest/ImplementationRestClient.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/rest/ImplementationRestClient.java
@@ -19,7 +19,6 @@
package org.apache.syncope.client.console.rest;
import java.util.List;
-import javax.ws.rs.core.Response;
import org.apache.syncope.common.lib.to.ImplementationTO;
import org.apache.syncope.common.lib.types.ImplementationType;
import org.apache.syncope.common.rest.api.service.ImplementationService;
@@ -36,10 +35,8 @@ public class ImplementationRestClient extends BaseRestClient {
return getService(ImplementationService.class).read(type, key);
}
- public ImplementationTO create(final ImplementationTO implementation) {
- ImplementationService service = getService(ImplementationService.class);
- Response response = service.create(implementation);
- return getObject(service, response.getLocation(), ImplementationTO.class);
+ public void create(final ImplementationTO implementation) {
+ getService(ImplementationService.class).create(implementation);
}
public void update(final ImplementationTO implementation) {
@@ -49,5 +46,4 @@ public class ImplementationRestClient extends BaseRestClient {
public void delete(final ImplementationType type, final String key) {
getService(ImplementationService.class).delete(type, key);
}
-
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/595a8d15/client/console/src/main/java/org/apache/syncope/client/console/rest/RemediationRestClient.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/rest/RemediationRestClient.java b/client/console/src/main/java/org/apache/syncope/client/console/rest/RemediationRestClient.java
index 4dd9ca6..a5023e5 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/rest/RemediationRestClient.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/rest/RemediationRestClient.java
@@ -18,8 +18,6 @@
*/
package org.apache.syncope.client.console.rest;
-import static org.apache.syncope.client.console.rest.BaseRestClient.getService;
-
import java.util.List;
import javax.ws.rs.core.GenericType;
import javax.ws.rs.core.Response;
http://git-wip-us.apache.org/repos/asf/syncope/blob/595a8d15/client/console/src/main/resources/org/apache/syncope/client/console/implementations/MyPushCorrelationRule.groovy
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/implementations/MyPushCorrelationRule.groovy b/client/console/src/main/resources/org/apache/syncope/client/console/implementations/MyPushCorrelationRule.groovy
new file mode 100644
index 0000000..ad3951d
--- /dev/null
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/implementations/MyPushCorrelationRule.groovy
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.transform.CompileStatic
+import org.apache.syncope.core.persistence.api.dao.PushCorrelationRule
+import org.apache.syncope.core.persistence.api.entity.Any;
+import org.apache.syncope.core.persistence.api.entity.resource.Provision;
+import org.identityconnectors.framework.common.objects.filter.Filter;
+
+@CompileStatic
+class MyPushCorrelationRule implements PushCorrelationRule {
+
+ @Override
+ Filter getFilter(Any<?> any, Provision provision) {
+
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/595a8d15/client/console/src/main/resources/org/apache/syncope/client/console/pages/Policies.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Policies.properties b/client/console/src/main/resources/org/apache/syncope/client/console/pages/Policies.properties
index be89226..b8dd372 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Policies.properties
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/pages/Policies.properties
@@ -17,3 +17,4 @@
policy.account=Account
policy.password=Password
policy.pull=Pull
+policy.push=Push
http://git-wip-us.apache.org/repos/asf/syncope/blob/595a8d15/client/console/src/main/resources/org/apache/syncope/client/console/pages/Policies_it.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Policies_it.properties b/client/console/src/main/resources/org/apache/syncope/client/console/pages/Policies_it.properties
index be89226..b8dd372 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Policies_it.properties
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/pages/Policies_it.properties
@@ -17,3 +17,4 @@
policy.account=Account
policy.password=Password
policy.pull=Pull
+policy.push=Push
http://git-wip-us.apache.org/repos/asf/syncope/blob/595a8d15/client/console/src/main/resources/org/apache/syncope/client/console/pages/Policies_ja.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Policies_ja.properties b/client/console/src/main/resources/org/apache/syncope/client/console/pages/Policies_ja.properties
index 4e28d96..5dc1831 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Policies_ja.properties
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/pages/Policies_ja.properties
@@ -17,3 +17,4 @@
policy.account=\u30a2\u30ab\u30a6\u30f3\u30c8
policy.password=\u30d1\u30b9\u30ef\u30fc\u30c9
policy.pull=\u30d7\u30eb
+policy.push=Push
http://git-wip-us.apache.org/repos/asf/syncope/blob/595a8d15/client/console/src/main/resources/org/apache/syncope/client/console/pages/Policies_pt_BR.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Policies_pt_BR.properties b/client/console/src/main/resources/org/apache/syncope/client/console/pages/Policies_pt_BR.properties
index be89226..b8dd372 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Policies_pt_BR.properties
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/pages/Policies_pt_BR.properties
@@ -17,3 +17,4 @@
policy.account=Account
policy.password=Password
policy.pull=Pull
+policy.push=Push
http://git-wip-us.apache.org/repos/asf/syncope/blob/595a8d15/client/console/src/main/resources/org/apache/syncope/client/console/pages/Policies_ru.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Policies_ru.properties b/client/console/src/main/resources/org/apache/syncope/client/console/pages/Policies_ru.properties
index 20b411c..5c1a92a 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Policies_ru.properties
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/pages/Policies_ru.properties
@@ -18,3 +18,4 @@
policy.account=\u041f\u043e\u043b\u0438\u0442\u0438\u043a\u0430 \u0443\u0447\u0435\u0442\u043d\u044b\u0445 \u0437\u0430\u043f\u0438\u0441\u0435\u0439
policy.password=\u041f\u043e\u043b\u0438\u0442\u0438\u043a\u0430 \u043f\u0430\u0440\u043e\u043b\u0435\u0439
policy.pull=\u041f\u043e\u043b\u0438\u0442\u0438\u043a\u0430 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445
+policy.push=Push
http://git-wip-us.apache.org/repos/asf/syncope/blob/595a8d15/client/console/src/main/resources/org/apache/syncope/client/console/policies/ProvisioningPolicyModalPanel$CorrelationRulePanel.html
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/policies/ProvisioningPolicyModalPanel$CorrelationRulePanel.html b/client/console/src/main/resources/org/apache/syncope/client/console/policies/ProvisioningPolicyModalPanel$CorrelationRulePanel.html
new file mode 100644
index 0000000..987016d
--- /dev/null
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/policies/ProvisioningPolicyModalPanel$CorrelationRulePanel.html
@@ -0,0 +1,34 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you 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.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
+ <wicket:panel>
+ <div class="form-group">
+ <span wicket:id="anyType"/>
+ </div>
+ <div class="form-group">
+ <span wicket:id="rule"/>
+ </div>
+ <div class="form-group">
+ <span wicket:id="orSchemas"/>
+ </div>
+ <div class="form-group">
+ <span wicket:id="defaultRuleConf"/>
+ </div>
+ </wicket:panel>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/595a8d15/client/console/src/main/resources/org/apache/syncope/client/console/policies/ProvisioningPolicyModalPanel.html
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/policies/ProvisioningPolicyModalPanel.html b/client/console/src/main/resources/org/apache/syncope/client/console/policies/ProvisioningPolicyModalPanel.html
new file mode 100644
index 0000000..5ade68c
--- /dev/null
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/policies/ProvisioningPolicyModalPanel.html
@@ -0,0 +1,25 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you 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.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
+ <wicket:panel>
+ <div class="form-group">
+ <span wicket:id="correlationRules"/>
+ </div>
+ </wicket:panel>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/595a8d15/client/console/src/main/resources/org/apache/syncope/client/console/policies/ProvisioningPolicyModalPanel.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/policies/ProvisioningPolicyModalPanel.properties b/client/console/src/main/resources/org/apache/syncope/client/console/policies/ProvisioningPolicyModalPanel.properties
new file mode 100644
index 0000000..dcd9917
--- /dev/null
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/policies/ProvisioningPolicyModalPanel.properties
@@ -0,0 +1,20 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you 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.
+rule=Rule
+anyType=Applies to
+correlationRules=Correlation Rules
+orSchemas=Schema conditions in OR (AND is default)
http://git-wip-us.apache.org/repos/asf/syncope/blob/595a8d15/client/console/src/main/resources/org/apache/syncope/client/console/policies/ProvisioningPolicyModalPanel_it.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/policies/ProvisioningPolicyModalPanel_it.properties b/client/console/src/main/resources/org/apache/syncope/client/console/policies/ProvisioningPolicyModalPanel_it.properties
new file mode 100644
index 0000000..fe183bf
--- /dev/null
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/policies/ProvisioningPolicyModalPanel_it.properties
@@ -0,0 +1,21 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you 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.
+#
+rule=Regola
+anyType=Applicata a
+correlationRules=Regole di Correlazione
+orSchemas=Condizioni schema in OR (AND \u00e8 il default)
http://git-wip-us.apache.org/repos/asf/syncope/blob/595a8d15/client/console/src/main/resources/org/apache/syncope/client/console/policies/ProvisioningPolicyModalPanel_ja.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/policies/ProvisioningPolicyModalPanel_ja.properties b/client/console/src/main/resources/org/apache/syncope/client/console/policies/ProvisioningPolicyModalPanel_ja.properties
new file mode 100644
index 0000000..a52a010
--- /dev/null
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/policies/ProvisioningPolicyModalPanel_ja.properties
@@ -0,0 +1,20 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you 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.
+rule=\u30eb\u30fc\u30eb
+anyType=\u9069\u7528...
+correlationRules=\u76f8\u95a2\u30eb\u30fc\u30eb
+orSchemas=Schema conditions in OR (AND is default)
http://git-wip-us.apache.org/repos/asf/syncope/blob/595a8d15/client/console/src/main/resources/org/apache/syncope/client/console/policies/ProvisioningPolicyModalPanel_pt_BR.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/policies/ProvisioningPolicyModalPanel_pt_BR.properties b/client/console/src/main/resources/org/apache/syncope/client/console/policies/ProvisioningPolicyModalPanel_pt_BR.properties
new file mode 100644
index 0000000..f39a868
--- /dev/null
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/policies/ProvisioningPolicyModalPanel_pt_BR.properties
@@ -0,0 +1,21 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you 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.
+#
+rule=Rule
+anyType=Applies to
+correlationRules=Correlation Rules
+orSchemas=Schema conditions in OR (AND is default)
http://git-wip-us.apache.org/repos/asf/syncope/blob/595a8d15/client/console/src/main/resources/org/apache/syncope/client/console/policies/ProvisioningPolicyModalPanel_ru.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/policies/ProvisioningPolicyModalPanel_ru.properties b/client/console/src/main/resources/org/apache/syncope/client/console/policies/ProvisioningPolicyModalPanel_ru.properties
new file mode 100644
index 0000000..966749e
--- /dev/null
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/policies/ProvisioningPolicyModalPanel_ru.properties
@@ -0,0 +1,21 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you 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.
+#
+rule=Rule
+anyType=\u041e\u0431\u044a\u0435\u043a\u0442 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0438
+correlationRules=\u041f\u0440\u0430\u0432\u0438\u043b\u0430 \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u0438
+orSchemas=Schema conditions in OR (AND is default)
http://git-wip-us.apache.org/repos/asf/syncope/blob/595a8d15/client/console/src/main/resources/org/apache/syncope/client/console/policies/PullPolicyModalPanel$CorrelationRulePanel.html
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/policies/PullPolicyModalPanel$CorrelationRulePanel.html b/client/console/src/main/resources/org/apache/syncope/client/console/policies/PullPolicyModalPanel$CorrelationRulePanel.html
deleted file mode 100644
index 0092417..0000000
--- a/client/console/src/main/resources/org/apache/syncope/client/console/policies/PullPolicyModalPanel$CorrelationRulePanel.html
+++ /dev/null
@@ -1,31 +0,0 @@
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements. See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership. The ASF licenses this file
-to you 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.
--->
-<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
- <wicket:panel>
- <div class="form-group">
- <span wicket:id="anyType"/>
- </div>
- <div class="form-group">
- <span wicket:id="rule"/>
- </div>
- <div class="form-group">
- <span wicket:id="defaultRuleConf"/>
- </div>
- </wicket:panel>
-</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/595a8d15/client/console/src/main/resources/org/apache/syncope/client/console/policies/PullPolicyModalPanel.html
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/policies/PullPolicyModalPanel.html b/client/console/src/main/resources/org/apache/syncope/client/console/policies/PullPolicyModalPanel.html
deleted file mode 100644
index 5ade68c..0000000
--- a/client/console/src/main/resources/org/apache/syncope/client/console/policies/PullPolicyModalPanel.html
+++ /dev/null
@@ -1,25 +0,0 @@
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements. See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership. The ASF licenses this file
-to you 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.
--->
-<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
- <wicket:panel>
- <div class="form-group">
- <span wicket:id="correlationRules"/>
- </div>
- </wicket:panel>
-</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/595a8d15/client/console/src/main/resources/org/apache/syncope/client/console/policies/PullPolicyModalPanel.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/policies/PullPolicyModalPanel.properties b/client/console/src/main/resources/org/apache/syncope/client/console/policies/PullPolicyModalPanel.properties
deleted file mode 100644
index a661523..0000000
--- a/client/console/src/main/resources/org/apache/syncope/client/console/policies/PullPolicyModalPanel.properties
+++ /dev/null
@@ -1,19 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you 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.
-rule=Rule
-anyType=Applies to
-correlationRules=Correlation Rules
http://git-wip-us.apache.org/repos/asf/syncope/blob/595a8d15/client/console/src/main/resources/org/apache/syncope/client/console/policies/PullPolicyModalPanel_it.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/policies/PullPolicyModalPanel_it.properties b/client/console/src/main/resources/org/apache/syncope/client/console/policies/PullPolicyModalPanel_it.properties
deleted file mode 100644
index 18420ca..0000000
--- a/client/console/src/main/resources/org/apache/syncope/client/console/policies/PullPolicyModalPanel_it.properties
+++ /dev/null
@@ -1,20 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you 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.
-#
-rule=Regola
-anyType=Applicata a
-correlationRules=Regole di Correlazione