syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ilgro...@apache.org
Subject [12/12] syncope git commit: [SYNCOPE-1164] Realm provisioning now features complete mapping, as Anys
Date Tue, 18 Jul 2017 10:22:55 GMT
[SYNCOPE-1164] Realm provisioning now features complete mapping, as Anys


Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/eebca673
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/eebca673
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/eebca673

Branch: refs/heads/master
Commit: eebca673ec43f26c711c5e16495427800180570a
Parents: 3faef35
Author: Francesco Chicchiriccò <ilgrosso@apache.org>
Authored: Tue Jul 18 12:20:31 2017 +0200
Committer: Francesco Chicchiriccò <ilgrosso@apache.org>
Committed: Tue Jul 18 12:22:30 2017 +0200

----------------------------------------------------------------------
 .../syncope/client/cli/commands/info/Info.java  |   2 +-
 .../resource/ResourceResultManager.java         |   8 +-
 .../client/console/bulk/BulkContent.java        |   6 +-
 .../console/commons/status/StatusBean.java      |  31 +-
 .../console/commons/status/StatusUtils.java     |  38 +-
 .../client/console/panels/ConnObjects.java      |   9 +-
 .../client/console/panels/ListViewPanel.java    |   4 +-
 .../panels/ProvisionAuxClassesPanel.java        |  29 +-
 .../console/rest/AbstractAnyRestClient.java     |   5 -
 .../client/console/rest/AnyTypeRestClient.java  |   7 +
 .../console/status/AnyStatusDirectoryPanel.java |   8 +-
 .../console/status/ChangePasswordModal.java     |   4 +-
 .../status/ResourceStatusDirectoryPanel.java    |   3 +-
 .../console/status/ResourceStatusModal.java     |  28 +-
 .../html/form/ActionLinksTogglePanel.java       |   2 +-
 .../console/widgets/ItemTransformerWidget.java  |  83 +++
 .../console/widgets/JEXLTransformerWidget.java  |  20 +-
 .../widgets/MappingItemTransformerWidget.java   |  83 ---
 .../console/wizards/AbstractMappingPanel.java   |  64 +-
 .../client/console/wizards/any/StatusPanel.java |   8 +-
 .../console/wizards/any/UserWizardBuilder.java  |   2 +-
 .../resources/ItemTransformersTogglePanel.java  | 118 ++++
 .../resources/JEXLTransformersTogglePanel.java  |   8 +-
 .../MappingItemTransformersTogglePanel.java     | 121 ----
 .../resources/ProvisionWizardBuilder.java       | 102 +--
 .../wizards/resources/ResourceMappingPanel.java |  75 ++-
 .../wizards/resources/ResourceProvision.java    | 151 +++++
 .../resources/ResourceProvisionPanel.java       | 247 ++-----
 .../META-INF/resources/css/syncopeConsole.css   |   6 +-
 .../widgets/ItemTransformerWidget.properties    |  18 +
 .../widgets/ItemTransformerWidget_it.properties |  18 +
 .../ItemTransformerWidget_pt_BR.properties      |  18 +
 .../widgets/ItemTransformerWidget_ru.properties |  19 +
 .../MappingItemTransformerWidget.properties     |  18 -
 .../MappingItemTransformerWidget_it.properties  |  18 -
 ...appingItemTransformerWidget_pt_BR.properties |  18 -
 .../MappingItemTransformerWidget_ru.properties  |  19 -
 .../console/wizards/AbstractMappingPanel.html   |   2 +-
 .../resources/ItemTransformersTogglePanel.html  |  32 +
 .../ItemTransformersTogglePanel.properties      |  19 +
 .../ItemTransformersTogglePanel_it.properties   |  19 +
 ...ItemTransformersTogglePanel_pt_BR.properties |  19 +
 .../ItemTransformersTogglePanel_ru.properties   |  20 +
 .../MappingItemTransformersTogglePanel.html     |  32 -
 ...appingItemTransformersTogglePanel.properties |  19 -
 ...ingItemTransformersTogglePanel_it.properties |  19 -
 ...ItemTransformersTogglePanel_pt_BR.properties |  19 -
 ...ingItemTransformersTogglePanel_ru.properties |  20 -
 .../resources/ResourceProvisionPanel.html       |   8 -
 .../resources/ResourceProvisionPanel.properties |   5 -
 .../ResourceProvisionPanel_it.properties        |   5 -
 .../ResourceProvisionPanel_pt_BR.properties     |   5 -
 .../ResourceProvisionPanel_ru.properties        |   5 -
 .../syncope/common/lib/info/PlatformInfo.java   |  12 +-
 .../syncope/common/lib/to/ItemContainerTO.java  |  32 +
 .../apache/syncope/common/lib/to/ItemTO.java    | 163 +++++
 .../syncope/common/lib/to/MappingItemTO.java    | 163 -----
 .../apache/syncope/common/lib/to/MappingTO.java |  28 +-
 .../apache/syncope/common/lib/to/OrgUnitTO.java |  62 +-
 .../syncope/core/logic/ResourceLogic.java       |  66 +-
 .../apache/syncope/core/logic/SyncopeLogic.java |   4 +-
 .../init/ClassPathScanImplementationLookup.java |  12 +-
 .../persistence/api/ImplementationLookup.java   |   2 +-
 .../core/persistence/api/dao/RealmDAO.java      |   2 +
 .../api/entity/LinkingMappingItem.java          |   2 +-
 .../persistence/api/entity/resource/Item.java   |  60 ++
 .../api/entity/resource/Mapping.java            |   8 +-
 .../api/entity/resource/MappingItem.java        |  40 +-
 .../api/entity/resource/OrgUnit.java            |  12 +-
 .../api/entity/resource/OrgUnitItem.java        |  26 +
 .../core/persistence/jpa/dao/JPARealmDAO.java   |  11 +
 .../jpa/entity/JPAEntityFactory.java            |   4 +
 .../jpa/entity/resource/AbstractItem.java       | 176 +++++
 .../jpa/entity/resource/JPAMapping.java         |   4 +-
 .../jpa/entity/resource/JPAMappingItem.java     | 157 +----
 .../jpa/entity/resource/JPAOrgUnit.java         |  47 +-
 .../jpa/entity/resource/JPAOrgUnitItem.java     |  72 +++
 .../entity/ExternalResourceValidator.java       |  74 ++-
 .../test/resources/domains/MasterContent.xml    |  12 +-
 .../core/provisioning/api/MappingManager.java   |  32 +
 .../provisioning/api/data/ItemTransformer.java  |  60 ++
 .../api/data/JEXLItemTransformer.java           |  30 +
 .../api/data/JEXLMappingItemTransformer.java    |  30 -
 .../api/data/MappingItemTransformer.java        |  60 --
 .../provisioning/api/pushpull/PullActions.java  |   8 +-
 .../provisioning/java/MappingManagerImpl.java   | 173 ++++-
 .../java/data/AbstractAnyDataBinder.java        |   4 +-
 .../java/data/DefaultItemTransformer.java       |  47 ++
 .../data/DefaultMappingItemTransformer.java     |  54 --
 .../java/data/JEXLItemTransformerImpl.java      | 102 +++
 .../data/JEXLMappingItemTransformerImpl.java    |  99 ---
 .../java/data/ResourceDataBinderImpl.java       |  95 ++-
 .../AbstractPropagationTaskExecutor.java        |  47 +-
 .../propagation/PropagationManagerImpl.java     |  36 +-
 .../pushpull/AbstractPullResultHandler.java     |  38 +-
 .../java/pushpull/DBPasswordPullActions.java    |   5 +-
 .../java/pushpull/DefaultPullActions.java       |   5 +-
 .../java/pushpull/LDAPPasswordPullActions.java  |   5 +-
 .../pushpull/PlainAttrsPullCorrelationRule.java |   6 +-
 .../java/pushpull/PullJobDelegate.java          |  15 +-
 .../provisioning/java/pushpull/PullUtils.java   |  65 +-
 .../pushpull/RealmPullResultHandlerImpl.java    | 638 +++++++++++--------
 .../pushpull/RealmPushResultHandlerImpl.java    |  62 +-
 .../java/utils/ConnObjectUtils.java             |  15 +-
 .../provisioning/java/utils/MappingUtils.java   | 211 +++---
 .../java/ResourceDataBinderTest.java            |   4 +-
 .../console/wizards/SAML2IdPMappingPanel.java   |   8 +-
 .../console/wizards/SAML2IdPWizardBuilder.java  |  12 +-
 .../syncope/common/lib/to/SAML2IdPTO.java       |  18 +-
 .../syncope/core/logic/SAML2IdPLogic.java       |   4 +-
 .../apache/syncope/core/logic/SAML2SPLogic.java |   8 +-
 .../syncope/core/logic/saml2/SAML2IdPCache.java |   4 +-
 .../core/logic/saml2/SAML2IdPEntity.java        |  10 +-
 .../validation/entity/SAML2IdPValidator.java    |   6 +-
 .../java/data/SAML2IdPDataBinderImpl.java       |  10 +-
 .../core/reference/ITImplementationLookup.java  |   8 +-
 .../core/reference/PrefixItemTransformer.java   |  66 ++
 .../reference/PrefixMappingItemTransformer.java |  66 --
 .../fit/core/reference/TestPullActions.java     |   4 +-
 .../syncope/fit/console/BulkActionITCase.java   |   6 +-
 .../syncope/fit/console/RealmsITCase.java       |  28 +-
 .../syncope/fit/console/TopologyITCase.java     |  40 +-
 .../syncope/fit/core/ConnectorITCase.java       |   4 +-
 .../apache/syncope/fit/core/GroupITCase.java    |   6 +-
 .../syncope/fit/core/MembershipITCase.java      |  12 +-
 .../syncope/fit/core/MigrationITCase.java       |  34 +-
 .../syncope/fit/core/MultitenancyITCase.java    |  10 +-
 .../syncope/fit/core/PropagationTaskITCase.java |  10 +-
 .../apache/syncope/fit/core/PullTaskITCase.java |  19 +-
 .../apache/syncope/fit/core/PushTaskITCase.java |   4 +-
 .../apache/syncope/fit/core/RealmITCase.java    |  52 +-
 .../apache/syncope/fit/core/ResourceITCase.java |  60 +-
 .../apache/syncope/fit/core/SAML2ITCase.java    |   4 +-
 .../syncope/fit/core/UserIssuesITCase.java      |  12 +-
 .../apache/syncope/fit/core/VirAttrITCase.java  |  16 +-
 135 files changed, 3047 insertions(+), 2357 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/eebca673/client/cli/src/main/java/org/apache/syncope/client/cli/commands/info/Info.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/info/Info.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/info/Info.java
index 369ee8e..7df6fb7 100644
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/info/Info.java
+++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/info/Info.java
@@ -131,7 +131,7 @@ public class Info {
 
     public void mappingItemTransformers() {
         try {
-            infoResultManager.printMappingItemTransformers(platformInfo.getMappingItemTransformers());
+            infoResultManager.printMappingItemTransformers(platformInfo.getItemTransformers());
         } catch (final Exception ex) {
             LOG.error("Information error", ex);
             infoResultManager.genericError(ex.getMessage());

http://git-wip-us.apache.org/repos/asf/syncope/blob/eebca673/client/cli/src/main/java/org/apache/syncope/client/cli/commands/resource/ResourceResultManager.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/resource/ResourceResultManager.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/resource/ResourceResultManager.java
index aefb7c1..7e57e01 100644
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/resource/ResourceResultManager.java
+++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/resource/ResourceResultManager.java
@@ -21,7 +21,7 @@ package org.apache.syncope.client.cli.commands.resource;
 import java.util.List;
 import java.util.Map;
 import org.apache.syncope.client.cli.commands.CommonsResultManager;
-import org.apache.syncope.common.lib.to.MappingItemTO;
+import org.apache.syncope.common.lib.to.ItemTO;
 import org.apache.syncope.common.lib.to.MappingTO;
 import org.apache.syncope.common.lib.to.ProvisionTO;
 import org.apache.syncope.common.lib.to.ResourceTO;
@@ -74,8 +74,8 @@ public class ResourceResultManager extends CommonsResultManager {
         printMappingItem(mappingTO.getItems());
     }
 
-    private void printMappingItem(final List<MappingItemTO> mappingItemTOs) {
-        for (final MappingItemTO mappingItemTO : mappingItemTOs) {
+    private void printMappingItem(final List<ItemTO> mappingItemTOs) {
+        for (final ItemTO mappingItemTO : mappingItemTOs) {
             System.out.println("             mapping key: " + mappingItemTO.getKey());
             System.out.println("             internal attribute name: " + mappingItemTO.getIntAttrName());
             System.out.println("             external attribute name: " + mappingItemTO.getExtAttrName());
@@ -85,7 +85,7 @@ public class ResourceResultManager extends CommonsResultManager {
             System.out.println("             JEXL pull transformer: "
                     + mappingItemTO.getPullJEXLTransformer());
             System.out.println("             transformers classes: "
-                    + mappingItemTO.getMappingItemTransformerClassNames());
+                    + mappingItemTO.getTransformerClassNames());
             System.out.println("             purpose: " + mappingItemTO.getPurpose());
             System.out.println("             connector object key: " + mappingItemTO.isConnObjectKey());
             System.out.println("             password: " + mappingItemTO.isPassword());

http://git-wip-us.apache.org/repos/asf/syncope/blob/eebca673/client/console/src/main/java/org/apache/syncope/client/console/bulk/BulkContent.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/bulk/BulkContent.java b/client/console/src/main/java/org/apache/syncope/client/console/bulk/BulkContent.java
index 2a46141..de3ceb7 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/bulk/BulkContent.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/bulk/BulkContent.java
@@ -171,11 +171,11 @@ public class BulkContent<T extends Serializable, S> extends MultilevelPanel.Seco
                             for (T bean : items) {
                                 final StatusBean sb = StatusBean.class.cast(bean);
                                 final List<StatusBean> sblist;
-                                if (beans.containsKey(sb.getAnyKey())) {
-                                    sblist = beans.get(sb.getAnyKey());
+                                if (beans.containsKey(sb.getKey())) {
+                                    sblist = beans.get(sb.getKey());
                                 } else {
                                     sblist = new ArrayList<>();
-                                    beans.put(sb.getAnyKey(), sblist);
+                                    beans.put(sb.getKey(), sblist);
                                 }
                                 sblist.add(sb);
                             }

http://git-wip-us.apache.org/repos/asf/syncope/blob/eebca673/client/console/src/main/java/org/apache/syncope/client/console/commons/status/StatusBean.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/commons/status/StatusBean.java b/client/console/src/main/java/org/apache/syncope/client/console/commons/status/StatusBean.java
index a34425a..c8bba79 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/commons/status/StatusBean.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/commons/status/StatusBean.java
@@ -25,17 +25,18 @@ import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
 import org.apache.syncope.common.lib.to.AnyTO;
 import org.apache.syncope.common.lib.to.GroupTO;
+import org.apache.syncope.common.lib.to.RealmTO;
 import org.apache.syncope.common.lib.to.UserTO;
 
 public class StatusBean implements Serializable {
 
     private static final long serialVersionUID = -5207260204921071129L;
 
-    private final String anyKey;
+    private final String key;
 
-    private final String anyName;
+    private final String name;
 
-    private final String resourceName;
+    private final String resource;
 
     private String connObjectLink;
 
@@ -44,11 +45,17 @@ public class StatusBean implements Serializable {
     private boolean linked = true;
 
     public StatusBean(final AnyTO any, final String resourceName) {
-        this.anyKey = any.getKey();
-        this.anyName = any instanceof UserTO
+        this.key = any.getKey();
+        this.name = any instanceof UserTO
                 ? ((UserTO) any).getUsername()
                 : any instanceof GroupTO ? ((GroupTO) any).getName() : String.valueOf(any.getKey());
-        this.resourceName = resourceName;
+        this.resource = resourceName;
+    }
+
+    public StatusBean(final RealmTO realm, final String resourceName) {
+        this.key = realm.getKey();
+        this.name = realm.getFullPath();
+        this.resource = resourceName;
     }
 
     public String getConnObjectLink() {
@@ -59,8 +66,8 @@ public class StatusBean implements Serializable {
         this.connObjectLink = connObjectLink;
     }
 
-    public String getResourceName() {
-        return resourceName;
+    public String getResource() {
+        return resource;
     }
 
     public Status getStatus() {
@@ -71,12 +78,12 @@ public class StatusBean implements Serializable {
         this.status = status;
     }
 
-    public String getAnyKey() {
-        return anyKey;
+    public String getKey() {
+        return key;
     }
 
-    public String getAnyName() {
-        return anyName;
+    public String getName() {
+        return name;
     }
 
     public boolean isLinked() {

http://git-wip-us.apache.org/repos/asf/syncope/blob/eebca673/client/console/src/main/java/org/apache/syncope/client/console/commons/status/StatusUtils.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/commons/status/StatusUtils.java b/client/console/src/main/java/org/apache/syncope/client/console/commons/status/StatusUtils.java
index 6da9246..8a9aa09 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/commons/status/StatusUtils.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/commons/status/StatusUtils.java
@@ -32,6 +32,7 @@ import org.apache.syncope.common.lib.patch.StatusPatch;
 import org.apache.syncope.common.lib.to.AnyTO;
 import org.apache.syncope.common.lib.to.AttrTO;
 import org.apache.syncope.common.lib.to.ConnObjectTO;
+import org.apache.syncope.common.lib.to.RealmTO;
 import org.apache.syncope.common.lib.types.PropagationTaskExecStatus;
 import org.apache.wicket.markup.ComponentTag;
 import org.apache.wicket.markup.html.basic.Label;
@@ -88,7 +89,7 @@ public class StatusUtils implements Serializable {
             final AnyTO anyTO,
             final String resourceName,
             final ConnObjectTO objectTO,
-            final boolean isGroup) {
+            final boolean notUser) {
 
         final StatusBean statusBean = new StatusBean(anyTO, resourceName);
 
@@ -96,7 +97,32 @@ public class StatusUtils implements Serializable {
             final Boolean enabled = isEnabled(objectTO);
 
             final Status status = enabled == null
-                    ? (isGroup ? Status.ACTIVE : Status.UNDEFINED)
+                    ? (notUser ? Status.ACTIVE : Status.UNDEFINED)
+                    : enabled
+                            ? Status.ACTIVE
+                            : Status.SUSPENDED;
+
+            String connObjectLink = getConnObjectLink(objectTO);
+
+            statusBean.setStatus(status);
+            statusBean.setConnObjectLink(connObjectLink);
+        }
+
+        return statusBean;
+    }
+
+    public StatusBean getStatusBean(
+            final RealmTO anyTO,
+            final String resourceName,
+            final ConnObjectTO objectTO) {
+
+        final StatusBean statusBean = new StatusBean(anyTO, resourceName);
+
+        if (objectTO != null) {
+            final Boolean enabled = isEnabled(objectTO);
+
+            final Status status = enabled == null
+                    ? Status.ACTIVE
                     : enabled
                             ? Status.ACTIVE
                             : Status.SUSPENDED;
@@ -129,10 +155,10 @@ public class StatusUtils implements Serializable {
         builder.value(password);
 
         for (StatusBean status : statuses) {
-            if (Constants.SYNCOPE.equalsIgnoreCase(status.getResourceName())) {
+            if (Constants.SYNCOPE.equalsIgnoreCase(status.getResource())) {
                 builder.onSyncope(true);
             } else {
-                builder.resource(status.getResourceName());
+                builder.resource(status.getResource());
             }
         }
         return builder.build();
@@ -150,10 +176,10 @@ public class StatusUtils implements Serializable {
             if (enable == null
                     || (enable && !status.getStatus().isActive()) || (!enable && status.getStatus().isActive())) {
 
-                if ("syncope".equalsIgnoreCase(status.getResourceName())) {
+                if ("syncope".equalsIgnoreCase(status.getResource())) {
                     statusPatch.setOnSyncope(true);
                 } else {
-                    statusPatch.getResources().add(status.getResourceName());
+                    statusPatch.getResources().add(status.getResource());
                 }
 
             }

http://git-wip-us.apache.org/repos/asf/syncope/blob/eebca673/client/console/src/main/java/org/apache/syncope/client/console/panels/ConnObjects.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/ConnObjects.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/ConnObjects.java
index 595ff5a..d29ce1a 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/ConnObjects.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/ConnObjects.java
@@ -19,10 +19,12 @@
 package org.apache.syncope.client.console.panels;
 
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.List;
 import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.collections4.Transformer;
 import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.rest.AnyTypeRestClient;
 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.common.lib.SyncopeConstants;
@@ -48,16 +50,17 @@ public class ConnObjects extends Panel implements ModalPanel {
     public ConnObjects(final ResourceTO resource, final PageReference pageRef) {
         super(BaseModal.CONTENT_ID);
 
-        List<String> availableAnyTypes = CollectionUtils.collect(resource.getProvisions(),
-                new Transformer<ProvisionTO, String>() {
+        List<String> availableAnyTypes = CollectionUtils.collect(
+                resource.getProvisions(), new Transformer<ProvisionTO, String>() {
 
             @Override
             public String transform(final ProvisionTO provision) {
                 return provision.getAnyType();
             }
         }, new ArrayList<String>());
+        Collections.sort(availableAnyTypes, new AnyTypeRestClient.AnyTypeKeyComparator());
         if (resource.getOrgUnit() != null) {
-            availableAnyTypes.add(SyncopeConstants.REALM_ANYTYPE);
+            availableAnyTypes.add(0, SyncopeConstants.REALM_ANYTYPE);
         }
 
         anyTypes = new AjaxDropDownChoicePanel<>("anyTypes", "anyTypes", new Model<String>());

http://git-wip-us.apache.org/repos/asf/syncope/blob/eebca673/client/console/src/main/java/org/apache/syncope/client/console/panels/ListViewPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/ListViewPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/ListViewPanel.java
index 16c4b77..e028cc3 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/ListViewPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/ListViewPanel.java
@@ -241,7 +241,7 @@ public abstract class ListViewPanel<T extends Serializable> extends WizardMgtPan
             super(pageRef);
             this.reference = reference;
             this.items = null;
-            this.actions = new ActionsPanel<T>("actions", null);
+            this.actions = new ActionsPanel<>("actions", null);
         }
 
         public Builder<T> setModel(final IModel<? extends Collection<T>> model) {
@@ -376,7 +376,7 @@ public abstract class ListViewPanel<T extends Serializable> extends WizardMgtPan
             return new ListViewPanel<T>(
                     id, items, reference, includes, actions, check, reuseItem, wizardInModal, model) {
 
-                private static final long serialVersionUID = 1L;
+                private static final long serialVersionUID = -1715389337530657988L;
 
                 @Override
                 protected Component getValueComponent(final String key, final T bean) {

http://git-wip-us.apache.org/repos/asf/syncope/blob/eebca673/client/console/src/main/java/org/apache/syncope/client/console/panels/ProvisionAuxClassesPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/ProvisionAuxClassesPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/ProvisionAuxClassesPanel.java
index 3e7116c..574939a 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/ProvisionAuxClassesPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/ProvisionAuxClassesPanel.java
@@ -19,6 +19,7 @@
 package org.apache.syncope.client.console.panels;
 
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.List;
 import org.apache.syncope.client.console.rest.AnyTypeClassRestClient;
 import org.apache.syncope.client.console.rest.AnyTypeRestClient;
@@ -27,6 +28,7 @@ import org.apache.syncope.common.lib.to.AnyTypeClassTO;
 import org.apache.syncope.common.lib.to.AnyTypeTO;
 import org.apache.syncope.common.lib.to.ProvisionTO;
 import org.apache.wicket.markup.html.panel.Panel;
+import org.apache.wicket.model.IModel;
 import org.apache.wicket.model.PropertyModel;
 import org.apache.wicket.model.util.ListModel;
 
@@ -47,16 +49,27 @@ public class ProvisionAuxClassesPanel extends Panel {
     protected void onBeforeRender() {
         super.onBeforeRender();
 
-        AnyTypeTO anyType = new AnyTypeRestClient().read(provisionTO.getAnyType());
-        List<String> choices = new ArrayList<>();
-        for (AnyTypeClassTO aux : new AnyTypeClassRestClient().list()) {
-            if (!anyType.getClasses().contains(aux.getKey())) {
-                choices.add(aux.getKey());
+        IModel<List<String>> model;
+        List<String> choices;
+        if (provisionTO == null) {
+            model = new ListModel<>(Collections.<String>emptyList());
+            choices = Collections.emptyList();
+        } else {
+            model = new PropertyModel<>(provisionTO, "auxClasses");
+
+            AnyTypeTO anyType = new AnyTypeRestClient().read(provisionTO.getAnyType());
+            choices = new ArrayList<>();
+            for (AnyTypeClassTO aux : new AnyTypeClassRestClient().list()) {
+                if (!anyType.getClasses().contains(aux.getKey())) {
+                    choices.add(aux.getKey());
+                }
             }
         }
-        addOrReplace(new AjaxPalettePanel.Builder<String>().build("auxClasses",
-                new PropertyModel<List<String>>(provisionTO, "auxClasses"),
-                new ListModel<>(choices)).hideLabel().setOutputMarkupId(true));
+        addOrReplace(
+                new AjaxPalettePanel.Builder<String>().build("auxClasses", model, new ListModel<>(choices)).
+                        hideLabel().
+                        setOutputMarkupId(true).
+                        setEnabled(provisionTO != null));
     }
 
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/eebca673/client/console/src/main/java/org/apache/syncope/client/console/rest/AbstractAnyRestClient.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/rest/AbstractAnyRestClient.java b/client/console/src/main/java/org/apache/syncope/client/console/rest/AbstractAnyRestClient.java
index 9d7d1d7..1386e62 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/rest/AbstractAnyRestClient.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/rest/AbstractAnyRestClient.java
@@ -28,7 +28,6 @@ import org.apache.syncope.common.lib.patch.AssociationPatch;
 import org.apache.syncope.common.lib.patch.DeassociationPatch;
 import org.apache.syncope.common.lib.patch.StatusPatch;
 import org.apache.syncope.common.lib.to.AnyTO;
-import org.apache.syncope.common.lib.to.BulkAction;
 import org.apache.syncope.common.lib.to.BulkActionResult;
 import org.apache.syncope.common.lib.to.ProvisioningResult;
 import org.apache.syncope.common.lib.types.ResourceAssociationAction;
@@ -188,8 +187,4 @@ public abstract class AbstractAnyRestClient<TO extends AnyTO, P extends AnyPatch
         }
         return result;
     }
-
-    public BulkActionResult bulkAction(final BulkAction action) {
-        return getService(getAnyServiceClass()).bulk(action).readEntity(BulkActionResult.class);
-    }
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/eebca673/client/console/src/main/java/org/apache/syncope/client/console/rest/AnyTypeRestClient.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/rest/AnyTypeRestClient.java b/client/console/src/main/java/org/apache/syncope/client/console/rest/AnyTypeRestClient.java
index 86d27c1..fc1e004 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/rest/AnyTypeRestClient.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/rest/AnyTypeRestClient.java
@@ -24,6 +24,7 @@ import java.util.Comparator;
 import java.util.List;
 import org.apache.commons.collections4.ComparatorUtils;
 import org.apache.syncope.common.lib.SyncopeClientException;
+import org.apache.syncope.common.lib.SyncopeConstants;
 import org.apache.syncope.common.lib.to.AnyTypeTO;
 import org.apache.syncope.common.lib.types.AnyTypeKind;
 import org.apache.syncope.common.rest.api.service.AnyTypeService;
@@ -103,6 +104,12 @@ public class AnyTypeRestClient extends BaseRestClient {
 
         @Override
         public int compare(final String o1, final String o2) {
+            if (SyncopeConstants.REALM_ANYTYPE.equals(o1)) {
+                return -1;
+            }
+            if (SyncopeConstants.REALM_ANYTYPE.equals(o2)) {
+                return 1;
+            }
             if (AnyTypeKind.USER.name().equals(o1)) {
                 return -1;
             }

http://git-wip-us.apache.org/repos/asf/syncope/blob/eebca673/client/console/src/main/java/org/apache/syncope/client/console/status/AnyStatusDirectoryPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/status/AnyStatusDirectoryPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/status/AnyStatusDirectoryPanel.java
index 992f3fb..6fcc84b 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/status/AnyStatusDirectoryPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/status/AnyStatusDirectoryPanel.java
@@ -121,7 +121,7 @@ public class AnyStatusDirectoryPanel
                     final String componentId,
                     final IModel<StatusBean> model) {
 
-                cellItem.add(new Label(componentId, model.getObject().getResourceName()) {
+                cellItem.add(new Label(componentId, model.getObject().getResource()) {
 
                     private static final long serialVersionUID = 8432079838783825801L;
 
@@ -171,14 +171,14 @@ public class AnyStatusDirectoryPanel
             @Override
             protected boolean statusCondition(final StatusBean bean) {
                 return bean != null && bean.getConnObjectLink() != null
-                        && !bean.getResourceName().equalsIgnoreCase(Constants.SYNCOPE);
+                        && !bean.getResource().equalsIgnoreCase(Constants.SYNCOPE);
             }
 
             @Override
             public void onClick(final AjaxRequestTarget target, final StatusBean bean) {
-                multiLevelPanelRef.next(bean.getResourceName(),
+                multiLevelPanelRef.next(bean.getResource(),
                         new ConnObjectDetails(resourceRestClient.readConnObject(
-                                bean.getResourceName(), anyTO.getType(), anyTO.getKey())), target);
+                                bean.getResource(), anyTO.getType(), anyTO.getKey())), target);
                 target.add(multiLevelPanelRef);
                 AnyStatusDirectoryPanel.this.getTogglePanel().close(target);
             }

http://git-wip-us.apache.org/repos/asf/syncope/blob/eebca673/client/console/src/main/java/org/apache/syncope/client/console/status/ChangePasswordModal.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/status/ChangePasswordModal.java b/client/console/src/main/java/org/apache/syncope/client/console/status/ChangePasswordModal.java
index dff996f..336f4d1 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/status/ChangePasswordModal.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/status/ChangePasswordModal.java
@@ -80,10 +80,10 @@ public class ChangePasswordModal extends AbstractModalPanel<AnyWrapper<UserTO>>
                 final List<String> resources = new ArrayList<String>();
                 boolean isOnSyncope = false;
                 for (StatusBean sb : statusModel.getObject()) {
-                    if (sb.getResourceName().equals(Constants.SYNCOPE)) {
+                    if (sb.getResource().equals(Constants.SYNCOPE)) {
                         isOnSyncope = true;
                     } else {
-                        resources.add(sb.getResourceName());
+                        resources.add(sb.getResource());
                     }
                 }
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/eebca673/client/console/src/main/java/org/apache/syncope/client/console/status/ResourceStatusDirectoryPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/status/ResourceStatusDirectoryPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/status/ResourceStatusDirectoryPanel.java
index 93a0ffa..2844a74 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/status/ResourceStatusDirectoryPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/status/ResourceStatusDirectoryPanel.java
@@ -36,6 +36,7 @@ import org.apache.syncope.client.console.rest.GroupRestClient;
 import org.apache.syncope.client.console.rest.UserRestClient;
 import org.apache.syncope.client.console.wicket.markup.html.bootstrap.dialog.BaseModal;
 import org.apache.syncope.client.console.wicket.markup.html.form.ActionLink;
+import org.apache.syncope.common.lib.SyncopeConstants;
 import org.apache.syncope.common.lib.to.ResourceTO;
 import org.apache.wicket.PageReference;
 import org.apache.wicket.ajax.AjaxRequestTarget;
@@ -145,7 +146,7 @@ public class ResourceStatusDirectoryPanel
 
     @Override
     protected ResourceStatusDataProvider dataProvider() {
-        return new ResourceStatusDataProvider(type, resourceTO.getKey(), rows, "/");
+        return new ResourceStatusDataProvider(type, resourceTO.getKey(), rows, SyncopeConstants.ROOT_REALM);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/syncope/blob/eebca673/client/console/src/main/java/org/apache/syncope/client/console/status/ResourceStatusModal.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/status/ResourceStatusModal.java b/client/console/src/main/java/org/apache/syncope/client/console/status/ResourceStatusModal.java
index 1a379a9..960bd12 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/status/ResourceStatusModal.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/status/ResourceStatusModal.java
@@ -18,7 +18,11 @@
  */
 package org.apache.syncope.client.console.status;
 
+import java.util.ArrayList;
+import java.util.Collections;
 import java.util.List;
+import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.collections4.Transformer;
 import org.apache.syncope.client.console.commons.Constants;
 import org.apache.syncope.client.console.commons.DirectoryDataProvider;
 import org.apache.syncope.client.console.commons.status.StatusBean;
@@ -28,11 +32,12 @@ import org.apache.syncope.client.console.rest.AbstractAnyRestClient;
 import org.apache.syncope.client.console.rest.AnyTypeRestClient;
 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.common.lib.SyncopeConstants;
+import org.apache.syncope.common.lib.to.ProvisionTO;
 import org.apache.syncope.common.lib.to.ResourceTO;
 import org.apache.wicket.PageReference;
 import org.apache.wicket.ajax.AjaxRequestTarget;
 import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
-import org.apache.wicket.model.LoadableDetachableModel;
 import org.apache.wicket.model.Model;
 
 public class ResourceStatusModal extends StatusModal<ResourceTO> {
@@ -44,23 +49,26 @@ public class ResourceStatusModal extends StatusModal<ResourceTO> {
     public ResourceStatusModal(
             final BaseModal<?> baseModal,
             final PageReference pageReference,
-            final ResourceTO resourceTO) {
+            final ResourceTO resource) {
 
-        super(baseModal, pageReference, resourceTO, null, false);
+        super(baseModal, pageReference, resource, null, false);
 
-        final LoadableDetachableModel<List<String>> types = new LoadableDetachableModel<List<String>>() {
-
-            private static final long serialVersionUID = 5275935387613157437L;
+        List<String> availableAnyTypes = CollectionUtils.collect(
+                resource.getProvisions(), new Transformer<ProvisionTO, String>() {
 
             @Override
-            protected List<String> load() {
-                return new AnyTypeRestClient().list();
+            public String transform(final ProvisionTO provision) {
+                return provision.getAnyType();
             }
-        };
+        }, new ArrayList<String>());
+        Collections.sort(availableAnyTypes, new AnyTypeRestClient.AnyTypeKeyComparator());
+        if (resource.getOrgUnit() != null) {
+            availableAnyTypes.add(0, SyncopeConstants.REALM_ANYTYPE);
+        }
 
         AjaxDropDownChoicePanel<String> anyTypes =
                 new AjaxDropDownChoicePanel<>("anyTypes", "anyTypes", typeModel, false);
-        anyTypes.setChoices(types);
+        anyTypes.setChoices(availableAnyTypes);
         anyTypes.hideLabel();
         add(anyTypes);
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/eebca673/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/ActionLinksTogglePanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/ActionLinksTogglePanel.java b/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/ActionLinksTogglePanel.java
index 78c175a..fb8ab83 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/ActionLinksTogglePanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/ActionLinksTogglePanel.java
@@ -99,7 +99,7 @@ public class ActionLinksTogglePanel<T extends Serializable> extends TogglePanel<
         } else if (modelObject instanceof EntityTO) {
             header = ((EntityTO) modelObject).getKey();
         } else if (modelObject instanceof StatusBean) {
-            header = ((StatusBean) modelObject).getResourceName();
+            header = ((StatusBean) modelObject).getResource();
         } else if (modelObject instanceof PolicyRuleWrapper) {
             header = ((PolicyRuleWrapper) modelObject).getName();
         } else if (modelObject instanceof PolicyRuleWrapper) {

http://git-wip-us.apache.org/repos/asf/syncope/blob/eebca673/client/console/src/main/java/org/apache/syncope/client/console/widgets/ItemTransformerWidget.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/widgets/ItemTransformerWidget.java b/client/console/src/main/java/org/apache/syncope/client/console/widgets/ItemTransformerWidget.java
new file mode 100644
index 0000000..9aa4142
--- /dev/null
+++ b/client/console/src/main/java/org/apache/syncope/client/console/widgets/ItemTransformerWidget.java
@@ -0,0 +1,83 @@
+/*
+ * 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.widgets;
+
+import de.agilecoders.wicket.core.markup.html.bootstrap.image.Icon;
+import de.agilecoders.wicket.extensions.markup.html.bootstrap.icon.FontAwesomeIconTypeBuilder;
+import java.util.List;
+import org.apache.syncope.client.console.wizards.resources.ItemTransformersTogglePanel;
+import org.apache.syncope.common.lib.to.ItemTO;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.markup.html.AjaxLink;
+import org.apache.wicket.markup.html.link.AbstractLink;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.util.ListModel;
+
+public class ItemTransformerWidget extends AlertWidget<String> {
+
+    private static final long serialVersionUID = 7667120094526529934L;
+
+    private final ItemTO item;
+
+    private final ItemTransformersTogglePanel transformers;
+
+    public ItemTransformerWidget(
+            final String id,
+            final ItemTO item,
+            final ItemTransformersTogglePanel transformers) {
+
+        super(id);
+        this.item = item;
+        this.transformers = transformers;
+        setOutputMarkupId(true);
+    }
+
+    @Override
+    protected IModel<List<String>> getLatestAlerts() {
+        return new ListModel<String>() {
+
+            private static final long serialVersionUID = 1232998477036705088L;
+
+            @Override
+            public List<String> getObject() {
+                return item.getTransformerClassNames();
+            }
+        };
+    }
+
+    @Override
+    protected AbstractLink getEventsLink(final String linkid) {
+        return new AjaxLink<String>(linkid) {
+
+            private static final long serialVersionUID = -7978723352517770644L;
+
+            @Override
+            public void onClick(final AjaxRequestTarget target) {
+                transformers.setItem(target, ItemTransformerWidget.this.item);
+                transformers.toggle(target, true);
+            }
+        };
+    }
+
+    @Override
+    protected Icon getIcon(final String iconid) {
+        return new Icon(
+                iconid, FontAwesomeIconTypeBuilder.on(FontAwesomeIconTypeBuilder.FontAwesomeGraphic.magic).build());
+    }
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/eebca673/client/console/src/main/java/org/apache/syncope/client/console/widgets/JEXLTransformerWidget.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/widgets/JEXLTransformerWidget.java b/client/console/src/main/java/org/apache/syncope/client/console/widgets/JEXLTransformerWidget.java
index a4dec3d..6c4dd7b 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/widgets/JEXLTransformerWidget.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/widgets/JEXLTransformerWidget.java
@@ -24,7 +24,7 @@ import java.util.ArrayList;
 import java.util.List;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.syncope.client.console.wizards.resources.JEXLTransformersTogglePanel;
-import org.apache.syncope.common.lib.to.MappingItemTO;
+import org.apache.syncope.common.lib.to.ItemTO;
 import org.apache.wicket.ajax.AjaxRequestTarget;
 import org.apache.wicket.ajax.markup.html.AjaxLink;
 import org.apache.wicket.markup.html.link.AbstractLink;
@@ -35,21 +35,21 @@ public class JEXLTransformerWidget extends AlertWidget<String> {
 
     private static final long serialVersionUID = 7667120094526529934L;
 
-    private final MappingItemTO mapItem;
+    private final ItemTO item;
 
     private final JEXLTransformersTogglePanel transformers;
 
     public JEXLTransformerWidget(
             final String id,
-            final MappingItemTO mapItem,
+            final ItemTO item,
             final JEXLTransformersTogglePanel transformers) {
 
         super(id);
         setOutputMarkupId(true);
 
-        this.mapItem = mapItem;
+        this.item = item;
         this.transformers = transformers;
-        
+
         this.latestAlertsList.setVisible(false);
     }
 
@@ -62,11 +62,11 @@ public class JEXLTransformerWidget extends AlertWidget<String> {
             @Override
             public List<String> getObject() {
                 List<String> result = new ArrayList<>();
-                if (StringUtils.isNotBlank(mapItem.getPropagationJEXLTransformer())) {
-                    result.add(mapItem.getPropagationJEXLTransformer());
+                if (StringUtils.isNotBlank(item.getPropagationJEXLTransformer())) {
+                    result.add(item.getPropagationJEXLTransformer());
                 }
-                if (StringUtils.isNotBlank(mapItem.getPullJEXLTransformer())) {
-                    result.add(mapItem.getPullJEXLTransformer());
+                if (StringUtils.isNotBlank(item.getPullJEXLTransformer())) {
+                    result.add(item.getPullJEXLTransformer());
                 }
                 return result;
             }
@@ -81,7 +81,7 @@ public class JEXLTransformerWidget extends AlertWidget<String> {
 
             @Override
             public void onClick(final AjaxRequestTarget target) {
-                transformers.setMappingItem(target, JEXLTransformerWidget.this.mapItem);
+                transformers.setItem(target, JEXLTransformerWidget.this.item);
                 transformers.toggle(target, true);
             }
         };

http://git-wip-us.apache.org/repos/asf/syncope/blob/eebca673/client/console/src/main/java/org/apache/syncope/client/console/widgets/MappingItemTransformerWidget.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/widgets/MappingItemTransformerWidget.java b/client/console/src/main/java/org/apache/syncope/client/console/widgets/MappingItemTransformerWidget.java
deleted file mode 100644
index 6e363dd..0000000
--- a/client/console/src/main/java/org/apache/syncope/client/console/widgets/MappingItemTransformerWidget.java
+++ /dev/null
@@ -1,83 +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.widgets;
-
-import de.agilecoders.wicket.core.markup.html.bootstrap.image.Icon;
-import de.agilecoders.wicket.extensions.markup.html.bootstrap.icon.FontAwesomeIconTypeBuilder;
-import java.util.List;
-import org.apache.syncope.client.console.wizards.resources.MappingItemTransformersTogglePanel;
-import org.apache.syncope.common.lib.to.MappingItemTO;
-import org.apache.wicket.ajax.AjaxRequestTarget;
-import org.apache.wicket.ajax.markup.html.AjaxLink;
-import org.apache.wicket.markup.html.link.AbstractLink;
-import org.apache.wicket.model.IModel;
-import org.apache.wicket.model.util.ListModel;
-
-public class MappingItemTransformerWidget extends AlertWidget<String> {
-
-    private static final long serialVersionUID = 7667120094526529934L;
-
-    private final MappingItemTO mapItem;
-
-    private final MappingItemTransformersTogglePanel transformers;
-
-    public MappingItemTransformerWidget(
-            final String id,
-            final MappingItemTO mapItem,
-            final MappingItemTransformersTogglePanel transformers) {
-
-        super(id);
-        this.mapItem = mapItem;
-        this.transformers = transformers;
-        setOutputMarkupId(true);
-    }
-
-    @Override
-    protected IModel<List<String>> getLatestAlerts() {
-        return new ListModel<String>() {
-
-            private static final long serialVersionUID = 1232998477036705088L;
-
-            @Override
-            public List<String> getObject() {
-                return mapItem.getMappingItemTransformerClassNames();
-            }
-        };
-    }
-
-    @Override
-    protected AbstractLink getEventsLink(final String linkid) {
-        return new AjaxLink<String>(linkid) {
-
-            private static final long serialVersionUID = -7978723352517770644L;
-
-            @Override
-            public void onClick(final AjaxRequestTarget target) {
-                transformers.setMappingItem(target, MappingItemTransformerWidget.this.mapItem);
-                transformers.toggle(target, true);
-            }
-        };
-    }
-
-    @Override
-    protected Icon getIcon(final String iconid) {
-        return new Icon(
-                iconid, FontAwesomeIconTypeBuilder.on(FontAwesomeIconTypeBuilder.FontAwesomeGraphic.magic).build());
-    }
-}

http://git-wip-us.apache.org/repos/asf/syncope/blob/eebca673/client/console/src/main/java/org/apache/syncope/client/console/wizards/AbstractMappingPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wizards/AbstractMappingPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/wizards/AbstractMappingPanel.java
index 6872cde..5532f86 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/wizards/AbstractMappingPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/wizards/AbstractMappingPanel.java
@@ -44,12 +44,12 @@ import org.apache.syncope.client.console.wicket.markup.html.form.AjaxCheckBoxPan
 import org.apache.syncope.client.console.wicket.markup.html.form.AjaxTextFieldPanel;
 import org.apache.syncope.client.console.wicket.markup.html.form.MappingPurposePanel;
 import org.apache.syncope.client.console.widgets.JEXLTransformerWidget;
-import org.apache.syncope.client.console.widgets.MappingItemTransformerWidget;
+import org.apache.syncope.client.console.widgets.ItemTransformerWidget;
 import org.apache.syncope.client.console.wizards.resources.JEXLTransformersTogglePanel;
-import org.apache.syncope.client.console.wizards.resources.MappingItemTransformersTogglePanel;
+import org.apache.syncope.client.console.wizards.resources.ItemTransformersTogglePanel;
 import org.apache.syncope.common.lib.to.AnyObjectTO;
 import org.apache.syncope.common.lib.to.GroupTO;
-import org.apache.syncope.common.lib.to.MappingItemTO;
+import org.apache.syncope.common.lib.to.ItemTO;
 import org.apache.syncope.common.lib.to.UserTO;
 import org.apache.syncope.common.lib.types.MappingPurpose;
 import org.apache.syncope.common.lib.types.StandardEntitlement;
@@ -120,20 +120,18 @@ public abstract class AbstractMappingPanel extends Panel {
     /**
      * All mappings.
      */
-    protected final ListView<MappingItemTO> mappings;
+    protected final ListView<ItemTO> mappings;
 
     /**
      * Mapping container.
      */
     protected final WebMarkupContainer mappingContainer;
 
-    protected final IModel<List<MappingItemTO>> model;
-
     public AbstractMappingPanel(
             final String id,
-            final MappingItemTransformersTogglePanel mapItemTransformers,
+            final ItemTransformersTogglePanel itemTransformers,
             final JEXLTransformersTogglePanel jexlTransformers,
-            final IModel<List<MappingItemTO>> model,
+            final IModel<List<ItemTO>> model,
             final boolean addMappingBtnVisible,
             final boolean hidePurpose,
             final MappingPurpose defaultPurpose) {
@@ -141,8 +139,6 @@ public abstract class AbstractMappingPanel extends Panel {
         super(id);
         setOutputMarkupId(true);
 
-        this.model = model;
-
         mappingContainer = new WebMarkupContainer("mappingContainer");
         mappingContainer.setOutputMarkupId(true);
         add(mappingContainer);
@@ -173,10 +169,10 @@ public abstract class AbstractMappingPanel extends Panel {
 
         mappingContainer.add(Constants.getJEXLPopover(this, TooltipConfig.Placement.bottom));
 
-        Collections.sort(model.getObject(), new Comparator<MappingItemTO>() {
+        Collections.sort(model.getObject(), new Comparator<ItemTO>() {
 
             @Override
-            public int compare(final MappingItemTO left, final MappingItemTO right) {
+            public int compare(final ItemTO left, final ItemTO right) {
                 int compared;
                 if (left == null && right == null) {
                     compared = 0;
@@ -216,15 +212,15 @@ public abstract class AbstractMappingPanel extends Panel {
             }
         });
 
-        mappings = new ListView<MappingItemTO>("mappings", model.getObject()) {
+        mappings = new ListView<ItemTO>("mappings", model) {
 
             private static final long serialVersionUID = 4949588177564901031L;
 
             @Override
-            protected void populateItem(final ListItem<MappingItemTO> item) {
-                final MappingItemTO mapItem = item.getModelObject();
-                if (mapItem.getPurpose() == null) {
-                    mapItem.setPurpose(defaultPurpose);
+            protected void populateItem(final ListItem<ItemTO> item) {
+                final ItemTO itemTO = item.getModelObject();
+                if (itemTO.getPurpose() == null) {
+                    itemTO.setPurpose(defaultPurpose);
                 }
 
                 //--------------------------------
@@ -233,7 +229,7 @@ public abstract class AbstractMappingPanel extends Panel {
                 AjaxTextFieldPanel intAttrName = new AjaxTextFieldPanel(
                         "intAttrName",
                         getString("intAttrName"),
-                        new PropertyModel<String>(mapItem, "intAttrName"),
+                        new PropertyModel<String>(itemTO, "intAttrName"),
                         false);
                 intAttrName.setChoices(Collections.<String>emptyList());
                 intAttrName.setRequired(true).hideLabel();
@@ -246,10 +242,10 @@ public abstract class AbstractMappingPanel extends Panel {
                 final AjaxTextFieldPanel extAttrName = new AjaxTextFieldPanel(
                         "extAttrName",
                         getString("extAttrName"),
-                        new PropertyModel<String>(mapItem, "extAttrName"));
+                        new PropertyModel<String>(itemTO, "extAttrName"));
                 extAttrName.setChoices(getExtAttrNames().getObject());
 
-                boolean required = !mapItem.isPassword();
+                boolean required = !itemTO.isPassword();
                 extAttrName.setRequired(required).hideLabel();
                 extAttrName.setEnabled(required);
                 item.add(extAttrName);
@@ -259,14 +255,14 @@ public abstract class AbstractMappingPanel extends Panel {
                 // JEXL transformers
                 // -------------------------------
                 item.add(new JEXLTransformerWidget(
-                        "jexlTransformers", mapItem, jexlTransformers).setRenderBodyOnly(true));
+                        "jexlTransformers", itemTO, jexlTransformers).setRenderBodyOnly(true));
                 // -------------------------------
 
                 //--------------------------------
                 // Mapping item transformers
                 // -------------------------------
-                item.add(new MappingItemTransformerWidget(
-                        "mappingItemTransformers", mapItem, mapItemTransformers).setRenderBodyOnly(true));
+                item.add(new ItemTransformerWidget(
+                        "itemTransformers", itemTO, itemTransformers).setRenderBodyOnly(true));
                 // -------------------------------
 
                 //--------------------------------
@@ -275,10 +271,10 @@ public abstract class AbstractMappingPanel extends Panel {
                 final AjaxTextFieldPanel mandatory = new AjaxTextFieldPanel(
                         "mandatoryCondition",
                         new ResourceModel("mandatoryCondition", "mandatoryCondition").getObject(),
-                        new PropertyModel<String>(mapItem, "mandatoryCondition"));
+                        new PropertyModel<String>(itemTO, "mandatoryCondition"));
                 mandatory.hideLabel();
                 mandatory.setChoices(Arrays.asList(new String[] { "true", "false" }));
-                mandatory.setEnabled(!mapItem.isConnObjectKey());
+                mandatory.setEnabled(!itemTO.isConnObjectKey());
                 item.add(mandatory);
                 // -------------------------------
 
@@ -288,7 +284,7 @@ public abstract class AbstractMappingPanel extends Panel {
                 final AjaxCheckBoxPanel connObjectKey = new AjaxCheckBoxPanel(
                         "connObjectKey",
                         new ResourceModel("connObjectKey", "connObjectKey").getObject(),
-                        new PropertyModel<Boolean>(mapItem, "connObjectKey"), false);
+                        new PropertyModel<Boolean>(itemTO, "connObjectKey"), false);
                 connObjectKey.hideLabel();
                 item.add(connObjectKey);
                 // -------------------------------
@@ -299,7 +295,7 @@ public abstract class AbstractMappingPanel extends Panel {
                 final AjaxCheckBoxPanel password = new AjaxCheckBoxPanel(
                         "password",
                         new ResourceModel("password", "password").getObject(),
-                        new PropertyModel<Boolean>(mapItem, "password"), false);
+                        new PropertyModel<Boolean>(itemTO, "password"), false);
                 item.add(password.hideLabel());
                 // -------------------------------
 
@@ -310,7 +306,7 @@ public abstract class AbstractMappingPanel extends Panel {
                 purpose.setOutputMarkupId(true);
 
                 final MappingPurposePanel purposeActions = new MappingPurposePanel(
-                        "purposeActions", new PropertyModel<MappingPurpose>(mapItem, "purpose"), purpose);
+                        "purposeActions", new PropertyModel<MappingPurpose>(itemTO, "purpose"), purpose);
                 purpose.add(purposeActions.setRenderBodyOnly(true));
                 item.add(purpose);
                 // -------------------------------
@@ -327,7 +323,7 @@ public abstract class AbstractMappingPanel extends Panel {
                     public void onClick(final AjaxRequestTarget target, final Serializable ignore) {
                         int index = -1;
                         for (int i = 0; i < model.getObject().size() && index == -1; i++) {
-                            if (mapItem.equals(model.getObject().get(i))) {
+                            if (itemTO.equals(model.getObject().get(i))) {
                                 index = i;
                             }
                         }
@@ -358,11 +354,11 @@ public abstract class AbstractMappingPanel extends Panel {
                     @Override
                     protected void onUpdate(final AjaxRequestTarget target) {
                         if (connObjectKey.getModelObject()) {
-                            mapItem.setMandatoryCondition("true");
+                            itemTO.setMandatoryCondition("true");
                             mandatory.setModelObject("true");
                             mandatory.setEnabled(false);
                         } else {
-                            mapItem.setMandatoryCondition("false");
+                            itemTO.setMandatoryCondition("false");
                             mandatory.setModelObject("false");
                             mandatory.setEnabled(true);
                         }
@@ -395,11 +391,11 @@ public abstract class AbstractMappingPanel extends Panel {
 
                     // Changes required by clone ....
                     extAttrName.setEnabled(true);
-                    if (mapItem.isPassword()) {
+                    if (itemTO.isPassword()) {
                         // re-enable if and only if cloned object mapping item was a password
                         intAttrName.setEnabled(true);
                     }
-                    mapItem.setPassword(false);
+                    itemTO.setPassword(false);
                 }
 
                 if (hidePurpose) {
@@ -417,7 +413,7 @@ public abstract class AbstractMappingPanel extends Panel {
 
             @Override
             protected void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
-                model.getObject().add(new MappingItemTO());
+                model.getObject().add(new ItemTO());
                 target.add(AbstractMappingPanel.this);
             }
         };

http://git-wip-us.apache.org/repos/asf/syncope/blob/eebca673/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/StatusPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/StatusPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/StatusPanel.java
index 4ce8868..565c985 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/StatusPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/StatusPanel.java
@@ -121,7 +121,7 @@ public class StatusPanel extends Panel {
         }
 
         statusBeans.add(syncope);
-        initialStatusBeanMap.put(syncope.getResourceName(), syncope);
+        initialStatusBeanMap.put(syncope.getResource(), syncope);
 
         for (Pair<ConnObjectTO, ConnObjectWrapper> pair : connObjects) {
             ConnObjectWrapper entry = pair.getRight();
@@ -164,14 +164,14 @@ public class StatusPanel extends Panel {
             @Override
             protected boolean statusCondition(final StatusBean bean) {
                 final Pair<ConnObjectTO, ConnObjectTO> pair
-                        = getConnObjectTO(bean.getAnyKey(), bean.getResourceName(), connObjects);
+                        = getConnObjectTO(bean.getKey(), bean.getResource(), connObjects);
 
                 return pair != null && pair.getRight() != null;
             }
 
             @Override
             public void onClick(final AjaxRequestTarget target, final StatusBean bean) {
-                mlp.next(bean.getResourceName(), new RemoteAnyPanel(bean, connObjects), target);
+                mlp.next(bean.getResource(), new RemoteAnyPanel(bean, connObjects), target);
             }
         };
 
@@ -225,7 +225,7 @@ public class StatusPanel extends Panel {
 
         @Override
         protected final Pair<ConnObjectTO, ConnObjectTO> getConnObjectTO() {
-            return StatusPanel.this.getConnObjectTO(bean.getAnyKey(), bean.getResourceName(), connObjects);
+            return StatusPanel.this.getConnObjectTO(bean.getKey(), bean.getResource(), connObjects);
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/eebca673/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/UserWizardBuilder.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/UserWizardBuilder.java b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/UserWizardBuilder.java
index 6cf6023..44be252 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/UserWizardBuilder.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/UserWizardBuilder.java
@@ -39,7 +39,7 @@ public class UserWizardBuilder extends AnyWizardBuilder<UserTO> implements UserF
     private final UserRestClient userRestClient = new UserRestClient();
 
     /**
-     * Costructor to be used for templating only.
+     * Constructor to be used for templating only.
      *
      * @param anyTypeClasses any type classes.
      * @param formLayoutInfo form layout.

http://git-wip-us.apache.org/repos/asf/syncope/blob/eebca673/client/console/src/main/java/org/apache/syncope/client/console/wizards/resources/ItemTransformersTogglePanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wizards/resources/ItemTransformersTogglePanel.java b/client/console/src/main/java/org/apache/syncope/client/console/wizards/resources/ItemTransformersTogglePanel.java
new file mode 100644
index 0000000..6e37955
--- /dev/null
+++ b/client/console/src/main/java/org/apache/syncope/client/console/wizards/resources/ItemTransformersTogglePanel.java
@@ -0,0 +1,118 @@
+/*
+ * 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.wizards.resources;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.syncope.client.console.SyncopeConsoleSession;
+import org.apache.syncope.client.console.panels.TogglePanel;
+import org.apache.syncope.client.console.wicket.markup.html.form.AjaxPalettePanel;
+import org.apache.syncope.common.lib.to.ItemTO;
+import org.apache.wicket.PageReference;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.markup.html.form.AjaxSubmitLink;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.form.IChoiceRenderer;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.LoadableDetachableModel;
+import org.apache.wicket.model.util.ListModel;
+
+public class ItemTransformersTogglePanel extends TogglePanel<Serializable> {
+
+    private static final long serialVersionUID = -3195479265440591519L;
+
+    private ItemTO item;
+
+    public ItemTransformersTogglePanel(final WebMarkupContainer container, final PageReference pageRef) {
+        super("outer", "itemTransformersTogglePanel", pageRef);
+
+        final LoadableDetachableModel<List<String>> model = new LoadableDetachableModel<List<String>>() {
+
+            private static final long serialVersionUID = 5275935387613157437L;
+
+            @Override
+            protected List<String> load() {
+                // [!] this is required to disable changed with close button
+                return item == null
+                        ? Collections.<String>emptyList()
+                        : new ArrayList<>(item.getTransformerClassNames());
+            }
+        };
+
+        Form<?> form = new Form<>("form");
+        addInnerObject(form);
+
+        form.add(new AjaxPalettePanel.Builder<String>().setAllowOrder(true).setRenderer(new IChoiceRenderer<String>() {
+
+            private static final long serialVersionUID = 3464376099975468136L;
+
+            private static final int MAX_LENGTH = 50;
+
+            @Override
+            public Object getDisplayValue(final String object) {
+                if (object.length() > MAX_LENGTH) {
+                    return "..." + object.substring(object.length() - MAX_LENGTH);
+                } else {
+                    return object;
+                }
+            }
+
+            @Override
+            public String getIdValue(final String object, final int index) {
+                return object;
+            }
+
+            @Override
+            public String getObject(final String id, final IModel<? extends List<? extends String>> choices) {
+                return id;
+            }
+        }).build(
+                "classes",
+                model,
+                new ListModel<>(new ArrayList<>(SyncopeConsoleSession.get().getPlatformInfo().getItemTransformers()))).
+                hideLabel().setEnabled(true).setOutputMarkupId(true));
+
+        form.add(new AjaxSubmitLink("submit", form) {
+
+            private static final long serialVersionUID = 5538299138211283825L;
+
+            @Override
+            public void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
+                toggle(target, false);
+
+                // [!] this is required to disable changed with close button
+                item.getTransformerClassNames().clear();
+                item.getTransformerClassNames().addAll(model.getObject());
+
+                target.add(container);
+            }
+
+        });
+    }
+
+    public ItemTransformersTogglePanel setItem(final AjaxRequestTarget target, final ItemTO item) {
+        this.item = item;
+        setHeader(target, StringUtils.EMPTY);
+        return this;
+    }
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/eebca673/client/console/src/main/java/org/apache/syncope/client/console/wizards/resources/JEXLTransformersTogglePanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wizards/resources/JEXLTransformersTogglePanel.java b/client/console/src/main/java/org/apache/syncope/client/console/wizards/resources/JEXLTransformersTogglePanel.java
index 759b708..da3847b 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/wizards/resources/JEXLTransformersTogglePanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/wizards/resources/JEXLTransformersTogglePanel.java
@@ -22,7 +22,7 @@ import java.io.Serializable;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.syncope.client.console.panels.TogglePanel;
 import org.apache.syncope.client.console.wicket.markup.html.form.AjaxTextFieldPanel;
-import org.apache.syncope.common.lib.to.MappingItemTO;
+import org.apache.syncope.common.lib.to.ItemTO;
 import org.apache.wicket.PageReference;
 import org.apache.wicket.ajax.AjaxRequestTarget;
 import org.apache.wicket.ajax.markup.html.form.AjaxSubmitLink;
@@ -69,9 +69,9 @@ public class JEXLTransformersTogglePanel extends TogglePanel<Serializable> {
         });
     }
 
-    public JEXLTransformersTogglePanel setMappingItem(final AjaxRequestTarget target, final MappingItemTO mapItem) {
-        this.propagationJEXLTransformer.setNewModel(new PropertyModel<String>(mapItem, "propagationJEXLTransformer"));
-        this.pullJEXLTransformer.setNewModel(new PropertyModel<String>(mapItem, "pullJEXLTransformer"));
+    public JEXLTransformersTogglePanel setItem(final AjaxRequestTarget target, final ItemTO item) {
+        this.propagationJEXLTransformer.setNewModel(new PropertyModel<String>(item, "propagationJEXLTransformer"));
+        this.pullJEXLTransformer.setNewModel(new PropertyModel<String>(item, "pullJEXLTransformer"));
         setHeader(target, StringUtils.EMPTY);
         return this;
     }

http://git-wip-us.apache.org/repos/asf/syncope/blob/eebca673/client/console/src/main/java/org/apache/syncope/client/console/wizards/resources/MappingItemTransformersTogglePanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wizards/resources/MappingItemTransformersTogglePanel.java b/client/console/src/main/java/org/apache/syncope/client/console/wizards/resources/MappingItemTransformersTogglePanel.java
deleted file mode 100644
index 3298d20..0000000
--- a/client/console/src/main/java/org/apache/syncope/client/console/wizards/resources/MappingItemTransformersTogglePanel.java
+++ /dev/null
@@ -1,121 +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.wizards.resources;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.syncope.client.console.SyncopeConsoleSession;
-import org.apache.syncope.client.console.panels.TogglePanel;
-import org.apache.syncope.client.console.wicket.markup.html.form.AjaxPalettePanel;
-import org.apache.syncope.common.lib.to.MappingItemTO;
-import org.apache.wicket.PageReference;
-import org.apache.wicket.ajax.AjaxRequestTarget;
-import org.apache.wicket.ajax.markup.html.form.AjaxSubmitLink;
-import org.apache.wicket.markup.html.WebMarkupContainer;
-import org.apache.wicket.markup.html.form.Form;
-import org.apache.wicket.markup.html.form.IChoiceRenderer;
-import org.apache.wicket.model.IModel;
-import org.apache.wicket.model.LoadableDetachableModel;
-import org.apache.wicket.model.util.ListModel;
-
-public class MappingItemTransformersTogglePanel extends TogglePanel<Serializable> {
-
-    private static final long serialVersionUID = -3195479265440591519L;
-
-    private MappingItemTO mapItem;
-
-    public MappingItemTransformersTogglePanel(final WebMarkupContainer container, final PageReference pageRef) {
-        super("outer", "mappingItemTransformersTogglePanel", pageRef);
-
-        final LoadableDetachableModel<List<String>> model = new LoadableDetachableModel<List<String>>() {
-
-            private static final long serialVersionUID = 5275935387613157437L;
-
-            @Override
-            protected List<String> load() {
-                // [!] this is required to disable changed with close button
-                return mapItem == null
-                        ? Collections.<String>emptyList()
-                        : new ArrayList<>(mapItem.getMappingItemTransformerClassNames());
-            }
-        };
-
-        Form<?> form = new Form<>("form");
-        addInnerObject(form);
-
-        form.add(new AjaxPalettePanel.Builder<String>().setAllowOrder(true).setRenderer(new IChoiceRenderer<String>() {
-
-            private static final long serialVersionUID = 3464376099975468136L;
-
-            private static final int MAX_LENGTH = 50;
-
-            @Override
-            public Object getDisplayValue(final String object) {
-                if (object.length() > MAX_LENGTH) {
-                    return "..." + object.substring(object.length() - MAX_LENGTH);
-                } else {
-                    return object;
-                }
-            }
-
-            @Override
-            public String getIdValue(final String object, final int index) {
-                return object;
-            }
-
-            @Override
-            public String getObject(final String id, final IModel<? extends List<? extends String>> choices) {
-                return id;
-            }
-        }).build(
-                "classes",
-                model,
-                new ListModel<>(
-                        new ArrayList<>(SyncopeConsoleSession.get().getPlatformInfo().getMappingItemTransformers()))).
-                hideLabel().setEnabled(true).setOutputMarkupId(true));
-
-        form.add(new AjaxSubmitLink("submit", form) {
-
-            private static final long serialVersionUID = 5538299138211283825L;
-
-            @Override
-            public void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
-                toggle(target, false);
-
-                // [!] this is required to disable changed with close button
-                mapItem.getMappingItemTransformerClassNames().clear();
-                mapItem.getMappingItemTransformerClassNames().addAll(model.getObject());
-
-                target.add(container);
-            }
-
-        });
-    }
-
-    public MappingItemTransformersTogglePanel setMappingItem(
-            final AjaxRequestTarget target, final MappingItemTO mapItem) {
-
-        this.mapItem = mapItem;
-        setHeader(target, StringUtils.EMPTY);
-        return this;
-    }
-}


Mime
View raw message