syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fmarte...@apache.org
Subject syncope git commit: [SYNCOPE-1133] fixes the issue + provides refactoring
Date Wed, 28 Jun 2017 14:24:31 GMT
Repository: syncope
Updated Branches:
  refs/heads/master aa5d3ba95 -> 653afac68


[SYNCOPE-1133] fixes the issue + provides refactoring


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

Branch: refs/heads/master
Commit: 653afac686cc10a13bdd191b807b8f90e0b84e25
Parents: aa5d3ba
Author: fmartelli <fabio.martelli@gmail.com>
Authored: Wed Jun 28 16:23:48 2017 +0200
Committer: fmartelli <fabio.martelli@gmail.com>
Committed: Wed Jun 28 16:24:19 2017 +0200

----------------------------------------------------------------------
 .../console/approvals/ApprovalDetails.java      |  2 +-
 .../client/console/commons/Constants.java       | 18 +-----
 .../console/panels/AnyDirectoryPanel.java       | 55 ++++++++++++++++
 .../console/panels/AnyObjectDirectoryPanel.java | 57 ++--------------
 .../AnyObjectDisplayAttributesModalPanel.java   | 22 -------
 .../syncope/client/console/panels/AnyPanel.java |  1 -
 .../panels/DisplayAttributesModalPanel.java     | 52 +++++++++------
 .../console/panels/GroupDirectoryPanel.java     | 53 ++-------------
 .../GroupDisplayAttributesModalPanel.java       | 25 +------
 .../console/panels/UserDirectoryPanel.java      | 51 ++-------------
 .../panels/UserDisplayAttributesModalPanel.java | 26 +-------
 .../AnyObjectSelectionDirectoryPanel.java       | 19 ++----
 .../search/AnySelectionDirectoryPanel.java      | 62 ------------------
 .../search/GroupSelectionDirectoryPanel.java    | 19 ++----
 .../search/UserSelectionDirectoryPanel.java     | 19 ++----
 .../console/wizards/any/Relationships.java      |  4 +-
 .../apache/syncope/fit/console/UsersITCase.java | 68 ++++++++++++++++++++
 17 files changed, 192 insertions(+), 361 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/653afac6/client/console/src/main/java/org/apache/syncope/client/console/approvals/ApprovalDetails.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/approvals/ApprovalDetails.java b/client/console/src/main/java/org/apache/syncope/client/console/approvals/ApprovalDetails.java
index 2d169f6..ec9dbab 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/approvals/ApprovalDetails.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/approvals/ApprovalDetails.java
@@ -42,7 +42,7 @@ public class ApprovalDetails extends MultilevelPanel.SecondLevel {
             newUserTO = formTO.getUserTO();
             previousUserTO = null;
         } else if (formTO.getUserTO() == null) {
-            // make it stronger by handling NPE in case of test users or missing approval info
+            // make it stronger by handling possible NPE
             previousUserTO = new UserTO();
             previousUserTO.setKey(formTO.getUserPatch().getKey());
             newUserTO = AnyOperations.patch(previousUserTO, formTO.getUserPatch());

http://git-wip-us.apache.org/repos/asf/syncope/blob/653afac6/client/console/src/main/java/org/apache/syncope/client/console/commons/Constants.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/commons/Constants.java b/client/console/src/main/java/org/apache/syncope/client/console/commons/Constants.java
index 588790d..24109d2 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/commons/Constants.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/commons/Constants.java
@@ -73,12 +73,6 @@ public final class Constants {
 
     public static final String PARAM_PASSWORD_RESET_TOKEN = "pwdResetToken";
 
-    public static final String PREF_USERS_DETAILS_VIEW = "users.details.view";
-
-    public static final String PREF_USERS_PLAIN_ATTRS_VIEW = "users.plain.attrs.view";
-
-    public static final String PREF_USERS_DER_ATTRS_VIEW = "users.der.attrs.view";
-
     public static final String PREF_CONF_SCHEMA_PAGINATOR_ROWS = "conf.schema.paginator.rows";
 
     public static final String PREF_USER_PLAIN_SCHEMA_PAGINATOR_ROWS = "user.schema.paginator.rows";
@@ -95,12 +89,6 @@ public final class Constants {
 
     public static final String PREF_RELATIONSHIPTYPE_PAGINATOR_ROWS = "relationshiptype.painator.rows";
 
-    public static final String PREF_GROUP_DETAILS_VIEW = "group.details.view";
-
-    public static final String PREF_GROUP_PLAIN_ATTRS_VIEW = "group.plain.attrs.view";
-
-    public static final String PREF_GROUP_DER_ATTRS_VIEW = "group.der.attrs.view";
-
     public static final String PREF_GROUP_PLAIN_SCHEMA_PAGINATOR_ROWS = "group.schema.paginator.rows";
 
     public static final String PREF_GROUP_DER_SCHEMA_PAGINATOR_ROWS = "group.derived.schema.paginator.rows";
@@ -169,11 +157,11 @@ public final class Constants {
 
     public static final String PAGEPARAM_CURRENT_PAGE = "_current_page";
 
-    public static final String PREF_ANY_OBJECT_DETAILS_VIEW = "anyobject.%s.details.view";
+    public static final String PREF_ANY_DETAILS_VIEW = "any.%s.details.view";
 
-    public static final String PREF_ANY_OBJECT_PLAIN_ATTRS_VIEW = "anyobject.%s.plain.attrs.view";
+    public static final String PREF_ANY_PLAIN_ATTRS_VIEW = "any.%s.plain.attrs.view";
 
-    public static final String PREF_ANY_OBJECT_DER_ATTRS_VIEW = "anyobject.%s.der.attrs.view";
+    public static final String PREF_ANY_DER_ATTRS_VIEW = "any.%s.der.attrs.view";
 
     public static final String CREATED_ICON = "glyphicon glyphicon-ok-circle";
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/653afac6/client/console/src/main/java/org/apache/syncope/client/console/panels/AnyDirectoryPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/AnyDirectoryPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/AnyDirectoryPanel.java
index 4bc4b7b..b6c6778 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/AnyDirectoryPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/AnyDirectoryPanel.java
@@ -22,6 +22,7 @@ import de.agilecoders.wicket.core.markup.html.bootstrap.dialog.Modal;
 import java.io.Serializable;
 import java.lang.reflect.Field;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Collection;
 import java.util.Date;
 import java.util.List;
@@ -35,6 +36,7 @@ import org.apache.syncope.client.console.commons.status.ConnObjectWrapper;
 import org.apache.syncope.client.console.commons.status.StatusBean;
 import org.apache.syncope.client.console.rest.AbstractAnyRestClient;
 import org.apache.syncope.client.console.rest.SchemaRestClient;
+import org.apache.syncope.client.console.wicket.extensions.markup.html.repeater.data.table.AttrColumn;
 import org.apache.syncope.client.console.wicket.extensions.markup.html.repeater.data.table.BooleanPropertyColumn;
 import org.apache.syncope.client.console.wicket.extensions.markup.html.repeater.data.table.DatePropertyColumn;
 import org.apache.syncope.client.console.wicket.extensions.markup.html.repeater.data.table.KeyPropertyColumn;
@@ -49,6 +51,7 @@ import org.apache.syncope.common.lib.to.AnyTypeClassTO;
 import org.apache.syncope.common.lib.to.ConnObjectTO;
 import org.apache.syncope.common.lib.to.PropagationStatus;
 import org.apache.syncope.common.lib.to.ProvisioningResult;
+import org.apache.syncope.common.lib.types.SchemaType;
 import org.apache.wicket.PageReference;
 import org.apache.wicket.ajax.AjaxRequestTarget;
 import org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy;
@@ -57,6 +60,7 @@ import org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColu
 import org.apache.wicket.markup.html.panel.Panel;
 import org.apache.wicket.model.ResourceModel;
 import org.apache.wicket.model.util.ListModel;
+import org.springframework.util.ReflectionUtils;
 
 public abstract class AnyDirectoryPanel<A extends AnyTO, E extends AbstractAnyRestClient<A, ?>>
         extends DirectoryPanel<A, AnyWrapper<A>, AnyDataProvider<A>, E> {
@@ -123,6 +127,57 @@ public abstract class AnyDirectoryPanel<A extends AnyTO, E extends AbstractAnyRe
         initResultTable();
     }
 
+    @Override
+    protected final List<IColumn<A, String>> getColumns() {
+        final List<IColumn<A, String>> columns = new ArrayList<>();
+        final List<IColumn<A, String>> prefcolumns = new ArrayList<>();
+
+        columns.add(new KeyPropertyColumn<A>(
+                new ResourceModel(Constants.KEY_FIELD_NAME, Constants.KEY_FIELD_NAME), Constants.KEY_FIELD_NAME));
+
+        for (String name : prefMan.getList(
+                getRequest(), DisplayAttributesModalPanel.getPrefDetailView(type))) {
+            if (!Constants.KEY_FIELD_NAME.equalsIgnoreCase(name)) {
+                addPropertyColumn(
+                        name,
+                        ReflectionUtils.findField(DisplayAttributesModalPanel.getTOClass(type), name),
+                        prefcolumns);
+            }
+        }
+
+        for (String name : prefMan.getList(
+                getRequest(), DisplayAttributesModalPanel.getPrefPlainAttributeView(type))) {
+            if (pSchemaNames.contains(name)) {
+                prefcolumns.add(new AttrColumn<A>(name, SchemaType.PLAIN));
+            }
+        }
+
+        for (String name : prefMan.getList(
+                getRequest(), DisplayAttributesModalPanel.getPrefDerivedAttributeView(type))) {
+            if (dSchemaNames.contains(name)) {
+                prefcolumns.add(new AttrColumn<A>(name, SchemaType.DERIVED));
+            }
+        }
+
+        // Add defaults in case of no selection
+        if (prefcolumns.isEmpty()) {
+            for (String name : getDefaultAttributeSelection()) {
+                addPropertyColumn(
+                        name,
+                        ReflectionUtils.findField(DisplayAttributesModalPanel.getTOClass(type), name),
+                        prefcolumns);
+            }
+
+            prefMan.setList(getRequest(), getResponse(), Constants.PREF_ANY_DETAILS_VIEW,
+                    Arrays.asList(getDefaultAttributeSelection()));
+        }
+
+        columns.addAll(prefcolumns);
+        return columns;
+    }
+
+    protected abstract String[] getDefaultAttributeSelection();
+
     protected void addPropertyColumn(
             final String name,
             final Field field,

http://git-wip-us.apache.org/repos/asf/syncope/blob/653afac6/client/console/src/main/java/org/apache/syncope/client/console/panels/AnyObjectDirectoryPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/AnyObjectDirectoryPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/AnyObjectDirectoryPanel.java
index 75803d9..2b7d154 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/AnyObjectDirectoryPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/AnyObjectDirectoryPanel.java
@@ -19,8 +19,6 @@
 package org.apache.syncope.client.console.panels;
 
 import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.List;
 import org.apache.commons.lang3.SerializationUtils;
 import org.apache.commons.lang3.StringUtils;
@@ -31,8 +29,6 @@ import org.apache.syncope.client.console.pages.BasePage;
 import org.apache.syncope.client.console.rest.AnyObjectRestClient;
 import org.apache.syncope.client.console.status.AnyStatusModal;
 import org.apache.syncope.client.console.tasks.AnyPropagationTasks;
-import org.apache.syncope.client.console.wicket.extensions.markup.html.repeater.data.table.AttrColumn;
-import org.apache.syncope.client.console.wicket.extensions.markup.html.repeater.data.table.KeyPropertyColumn;
 import org.apache.syncope.client.console.wicket.markup.html.form.ActionLink;
 import org.apache.syncope.client.console.wicket.markup.html.form.ActionLink.ActionType;
 import org.apache.syncope.client.console.wicket.markup.html.form.ActionsPanel;
@@ -45,18 +41,15 @@ import org.apache.syncope.common.lib.to.AnyObjectTO;
 import org.apache.syncope.common.lib.to.AnyTypeClassTO;
 import org.apache.syncope.common.lib.types.AnyEntitlement;
 import org.apache.syncope.common.lib.types.AnyTypeKind;
-import org.apache.syncope.common.lib.types.SchemaType;
 import org.apache.syncope.common.lib.types.StandardEntitlement;
 import org.apache.wicket.PageReference;
 import org.apache.wicket.ajax.AjaxRequestTarget;
 import org.apache.wicket.event.Broadcast;
-import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
 import org.apache.wicket.model.CompoundPropertyModel;
 import org.apache.wicket.model.IModel;
 import org.apache.wicket.model.Model;
 import org.apache.wicket.model.ResourceModel;
 import org.apache.wicket.model.StringResourceModel;
-import org.springframework.util.ReflectionUtils;
 
 public class AnyObjectDirectoryPanel extends AnyDirectoryPanel<AnyObjectTO, AnyObjectRestClient> {
 
@@ -72,6 +65,11 @@ public class AnyObjectDirectoryPanel extends AnyDirectoryPanel<AnyObjectTO, AnyO
     }
 
     @Override
+    protected String[] getDefaultAttributeSelection() {
+        return AnyObjectDisplayAttributesModalPanel.DEFAULT_SELECTION;
+    }
+
+    @Override
     public ActionsPanel<Serializable> getHeader(final String componentId) {
         final ActionsPanel<Serializable> panel = super.getHeader(componentId);
 
@@ -97,51 +95,6 @@ public class AnyObjectDirectoryPanel extends AnyDirectoryPanel<AnyObjectTO, AnyO
     }
 
     @Override
-    protected List<IColumn<AnyObjectTO, String>> getColumns() {
-        final List<IColumn<AnyObjectTO, String>> columns = new ArrayList<>();
-        final List<IColumn<AnyObjectTO, String>> prefcolumns = new ArrayList<>();
-
-        columns.add(new KeyPropertyColumn<AnyObjectTO>(
-                new ResourceModel(Constants.KEY_FIELD_NAME, Constants.KEY_FIELD_NAME), Constants.KEY_FIELD_NAME));
-
-        for (String name : prefMan.getList(
-                getRequest(), String.format(Constants.PREF_ANY_OBJECT_DETAILS_VIEW, type))) {
-            if (!Constants.KEY_FIELD_NAME.equalsIgnoreCase(name)) {
-                addPropertyColumn(name, ReflectionUtils.findField(AnyObjectTO.class, name), prefcolumns);
-            }
-        }
-
-        for (String name : prefMan.getList(
-                getRequest(), String.format(Constants.PREF_ANY_OBJECT_PLAIN_ATTRS_VIEW, type))) {
-
-            if (pSchemaNames.contains(name)) {
-                prefcolumns.add(new AttrColumn<AnyObjectTO>(name, SchemaType.PLAIN));
-            }
-        }
-
-        for (String name : prefMan.getList(
-                getRequest(), String.format(Constants.PREF_ANY_OBJECT_DER_ATTRS_VIEW, type))) {
-
-            if (dSchemaNames.contains(name)) {
-                prefcolumns.add(new AttrColumn<AnyObjectTO>(name, SchemaType.DERIVED));
-            }
-        }
-
-        // Add defaults in case of no selection
-        if (prefcolumns.isEmpty()) {
-            for (String name : AnyObjectDisplayAttributesModalPanel.DEFAULT_SELECTION) {
-                addPropertyColumn(name, ReflectionUtils.findField(AnyObjectTO.class, name), prefcolumns);
-            }
-
-            prefMan.setList(getRequest(), getResponse(), Constants.PREF_ANY_OBJECT_DETAILS_VIEW,
-                    Arrays.asList(AnyObjectDisplayAttributesModalPanel.DEFAULT_SELECTION));
-        }
-
-        columns.addAll(prefcolumns);
-        return columns;
-    }
-
-    @Override
     public ActionsPanel<AnyObjectTO> getActions(final IModel<AnyObjectTO> model) {
         final ActionsPanel<AnyObjectTO> panel = super.getActions(model);
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/653afac6/client/console/src/main/java/org/apache/syncope/client/console/panels/AnyObjectDisplayAttributesModalPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/AnyObjectDisplayAttributesModalPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/AnyObjectDisplayAttributesModalPanel.java
index 6462d11..3d798cd 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/AnyObjectDisplayAttributesModalPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/AnyObjectDisplayAttributesModalPanel.java
@@ -20,9 +20,7 @@ package org.apache.syncope.client.console.panels;
 
 import java.io.Serializable;
 import java.util.List;
-import org.apache.syncope.client.console.commons.Constants;
 import org.apache.syncope.client.console.wicket.markup.html.bootstrap.dialog.BaseModal;
-import org.apache.syncope.common.lib.to.AnyObjectTO;
 import org.apache.wicket.PageReference;
 
 /**
@@ -46,24 +44,4 @@ public class AnyObjectDisplayAttributesModalPanel<T extends Serializable> extend
 
         super(modal, pageRef, schemaNames, dSchemaNames, type);
     }
-
-    @Override
-    protected String getPrefDetailView() {
-        return String.format(Constants.PREF_ANY_OBJECT_DETAILS_VIEW, type);
-    }
-
-    @Override
-    protected String getPrefPlainAttributeView() {
-        return String.format(Constants.PREF_ANY_OBJECT_PLAIN_ATTRS_VIEW, type);
-    }
-
-    @Override
-    protected String getPrefDerivedAttributeView() {
-        return String.format(Constants.PREF_ANY_OBJECT_DER_ATTRS_VIEW, type);
-    }
-
-    @Override
-    protected Class<AnyObjectTO> getTOClass() {
-        return AnyObjectTO.class;
-    }
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/653afac6/client/console/src/main/java/org/apache/syncope/client/console/panels/AnyPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/AnyPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/AnyPanel.java
index dd95128..7e2ed3d 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/AnyPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/AnyPanel.java
@@ -182,7 +182,6 @@ public class AnyPanel extends Panel implements ModalPanel {
                     break;
                 default:
             }
-            target.add(directoryPanel);
         } else {
             super.onEvent(event);
         }

http://git-wip-us.apache.org/repos/asf/syncope/blob/653afac6/client/console/src/main/java/org/apache/syncope/client/console/panels/DisplayAttributesModalPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/DisplayAttributesModalPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/DisplayAttributesModalPanel.java
index 106ba0c..344356d 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/DisplayAttributesModalPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/DisplayAttributesModalPanel.java
@@ -30,7 +30,11 @@ import org.apache.syncope.client.console.pages.BasePage;
 import org.apache.syncope.client.console.wicket.markup.html.bootstrap.dialog.BaseModal;
 import org.apache.syncope.client.console.wicket.markup.html.form.AjaxPalettePanel;
 import org.apache.syncope.common.lib.search.SearchableFields;
+import org.apache.syncope.common.lib.to.AnyObjectTO;
 import org.apache.syncope.common.lib.to.AnyTO;
+import org.apache.syncope.common.lib.to.GroupTO;
+import org.apache.syncope.common.lib.to.UserTO;
+import org.apache.syncope.common.lib.types.AnyTypeKind;
 import org.apache.wicket.PageReference;
 import org.apache.wicket.ajax.AjaxRequestTarget;
 import org.apache.wicket.markup.html.WebMarkupContainer;
@@ -67,14 +71,6 @@ public abstract class DisplayAttributesModalPanel<T extends Serializable> extend
     public DisplayAttributesModalPanel(
             final BaseModal<T> modal,
             final PageReference pageRef,
-            final List<String> schemaNames,
-            final List<String> dSchemaNames) {
-        this(modal, pageRef, schemaNames, dSchemaNames, null);
-    }
-
-    public DisplayAttributesModalPanel(
-            final BaseModal<T> modal,
-            final PageReference pageRef,
             final List<String> pSchemaNames,
             final List<String> dSchemaNames,
             final String type) {
@@ -82,7 +78,7 @@ public abstract class DisplayAttributesModalPanel<T extends Serializable> extend
         super(modal, pageRef);
         this.type = type;
 
-        final List<String> detailslList = SearchableFields.get(getTOClass());
+        final List<String> detailslList = SearchableFields.get(DisplayAttributesModalPanel.getTOClass(type));
         Collections.sort(detailslList);
         Collections.sort(pSchemaNames);
         Collections.sort(dSchemaNames);
@@ -117,9 +113,12 @@ public abstract class DisplayAttributesModalPanel<T extends Serializable> extend
             }
         };
 
-        selectedDetails = prefMan.getList(getRequest(), getPrefDetailView());
-        selectedPlainSchemas = prefMan.getList(getRequest(), getPrefPlainAttributeView());
-        selectedDerSchemas = prefMan.getList(getRequest(), getPrefDerivedAttributeView());
+        selectedDetails
+                = prefMan.getList(getRequest(), DisplayAttributesModalPanel.getPrefDetailView(type));
+        selectedPlainSchemas
+                = prefMan.getList(getRequest(), DisplayAttributesModalPanel.getPrefPlainAttributeView(type));
+        selectedDerSchemas
+                = prefMan.getList(getRequest(), DisplayAttributesModalPanel.getPrefDerivedAttributeView(type));
 
         final WebMarkupContainer container = new WebMarkupContainer("container");
         container.setOutputMarkupId(true);
@@ -164,9 +163,9 @@ public abstract class DisplayAttributesModalPanel<T extends Serializable> extend
         } else {
             final Map<String, List<String>> prefs = new HashMap<>();
 
-            prefs.put(getPrefDetailView(), selectedDetails);
-            prefs.put(getPrefPlainAttributeView(), selectedPlainSchemas);
-            prefs.put(getPrefDerivedAttributeView(), selectedDerSchemas);
+            prefs.put(DisplayAttributesModalPanel.getPrefDetailView(type), selectedDetails);
+            prefs.put(DisplayAttributesModalPanel.getPrefPlainAttributeView(type), selectedPlainSchemas);
+            prefs.put(DisplayAttributesModalPanel.getPrefDerivedAttributeView(type), selectedDerSchemas);
             prefMan.setList(getRequest(), getResponse(), prefs);
 
             SyncopeConsoleSession.get().info(getString(Constants.OPERATION_SUCCEEDED));
@@ -175,12 +174,25 @@ public abstract class DisplayAttributesModalPanel<T extends Serializable> extend
         }
     }
 
-    protected abstract String getPrefDetailView();
-
-    protected abstract String getPrefPlainAttributeView();
+    protected static final String getPrefDetailView(final String type) {
+        return String.format(Constants.PREF_ANY_DETAILS_VIEW, type);
+    }
 
-    protected abstract String getPrefDerivedAttributeView();
+    protected static final String getPrefPlainAttributeView(final String type) {
+        return String.format(Constants.PREF_ANY_PLAIN_ATTRS_VIEW, type);
+    }
 
-    protected abstract Class<? extends AnyTO> getTOClass();
+    protected static final String getPrefDerivedAttributeView(final String type) {
+        return String.format(Constants.PREF_ANY_DER_ATTRS_VIEW, type);
+    }
 
+    protected static final Class<? extends AnyTO> getTOClass(final String type) {
+        if (type.equalsIgnoreCase(AnyTypeKind.USER.name())) {
+            return UserTO.class;
+        } else if (type.equalsIgnoreCase(AnyTypeKind.USER.name())) {
+            return GroupTO.class;
+        } else {
+            return AnyObjectTO.class;
+        }
+    }
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/653afac6/client/console/src/main/java/org/apache/syncope/client/console/panels/GroupDirectoryPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/GroupDirectoryPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/GroupDirectoryPanel.java
index 0191c3e..b560f82 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/GroupDirectoryPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/GroupDirectoryPanel.java
@@ -20,8 +20,6 @@ package org.apache.syncope.client.console.panels;
 
 import de.agilecoders.wicket.core.markup.html.bootstrap.dialog.Modal;
 import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.List;
 import org.apache.commons.lang3.SerializationUtils;
 import org.apache.commons.lang3.StringUtils;
@@ -36,8 +34,6 @@ import org.apache.syncope.client.console.rest.AnyTypeRestClient;
 import org.apache.syncope.client.console.rest.GroupRestClient;
 import org.apache.syncope.client.console.status.AnyStatusModal;
 import org.apache.syncope.client.console.tasks.AnyPropagationTasks;
-import org.apache.syncope.client.console.wicket.extensions.markup.html.repeater.data.table.AttrColumn;
-import org.apache.syncope.client.console.wicket.extensions.markup.html.repeater.data.table.KeyPropertyColumn;
 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.client.console.wicket.markup.html.form.ActionLink.ActionType;
@@ -57,13 +53,11 @@ import org.apache.syncope.common.lib.to.UserTO;
 import org.apache.syncope.common.lib.types.AnyEntitlement;
 import org.apache.syncope.common.lib.types.AnyTypeKind;
 import org.apache.syncope.common.lib.types.BulkMembersActionType;
-import org.apache.syncope.common.lib.types.SchemaType;
 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.event.Broadcast;
-import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
 import org.apache.wicket.markup.html.WebPage;
 import org.apache.wicket.markup.html.panel.Panel;
 import org.apache.wicket.model.CompoundPropertyModel;
@@ -71,7 +65,6 @@ import org.apache.wicket.model.IModel;
 import org.apache.wicket.model.Model;
 import org.apache.wicket.model.ResourceModel;
 import org.apache.wicket.model.StringResourceModel;
-import org.springframework.util.ReflectionUtils;
 
 public class GroupDirectoryPanel extends AnyDirectoryPanel<GroupTO, GroupRestClient> {
 
@@ -184,6 +177,11 @@ public class GroupDirectoryPanel extends AnyDirectoryPanel<GroupTO, GroupRestCli
     }
 
     @Override
+    protected String[] getDefaultAttributeSelection() {
+        return GroupDisplayAttributesModalPanel.DEFAULT_SELECTION;
+    }
+
+    @Override
     public ActionsPanel<Serializable> getHeader(final String componentId) {
         final ActionsPanel<Serializable> panel = super.getHeader(componentId);
 
@@ -203,47 +201,6 @@ public class GroupDirectoryPanel extends AnyDirectoryPanel<GroupTO, GroupRestCli
     }
 
     @Override
-    protected List<IColumn<GroupTO, String>> getColumns() {
-
-        final List<IColumn<GroupTO, String>> columns = new ArrayList<>();
-        final List<IColumn<GroupTO, String>> prefcolumns = new ArrayList<>();
-
-        columns.add(new KeyPropertyColumn<GroupTO>(
-                new ResourceModel(Constants.KEY_FIELD_NAME, Constants.KEY_FIELD_NAME), Constants.KEY_FIELD_NAME));
-
-        for (String name : prefMan.getList(getRequest(), Constants.PREF_GROUP_DETAILS_VIEW)) {
-            if (!Constants.KEY_FIELD_NAME.equalsIgnoreCase(name)) {
-                addPropertyColumn(name, ReflectionUtils.findField(GroupTO.class, name), prefcolumns);
-            }
-        }
-
-        for (String name : prefMan.getList(getRequest(), Constants.PREF_GROUP_PLAIN_ATTRS_VIEW)) {
-            if (pSchemaNames.contains(name)) {
-                prefcolumns.add(new AttrColumn<GroupTO>(name, SchemaType.PLAIN));
-            }
-        }
-
-        for (String name : prefMan.getList(getRequest(), Constants.PREF_GROUP_DER_ATTRS_VIEW)) {
-            if (dSchemaNames.contains(name)) {
-                prefcolumns.add(new AttrColumn<GroupTO>(name, SchemaType.DERIVED));
-            }
-        }
-
-        // Add defaults in case of no selection
-        if (prefcolumns.isEmpty()) {
-            for (String name : GroupDisplayAttributesModalPanel.DEFAULT_SELECTION) {
-                addPropertyColumn(name, ReflectionUtils.findField(GroupTO.class, name), prefcolumns);
-            }
-
-            prefMan.setList(getRequest(), getResponse(), Constants.PREF_GROUP_DETAILS_VIEW,
-                    Arrays.asList(GroupDisplayAttributesModalPanel.DEFAULT_SELECTION));
-        }
-
-        columns.addAll(prefcolumns);
-        return columns;
-    }
-
-    @Override
     public ActionsPanel<GroupTO> getActions(final IModel<GroupTO> model) {
         final ActionsPanel<GroupTO> panel = super.getActions(model);
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/653afac6/client/console/src/main/java/org/apache/syncope/client/console/panels/GroupDisplayAttributesModalPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/GroupDisplayAttributesModalPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/GroupDisplayAttributesModalPanel.java
index 89d8dc9..e35a8ad 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/GroupDisplayAttributesModalPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/GroupDisplayAttributesModalPanel.java
@@ -20,9 +20,8 @@ package org.apache.syncope.client.console.panels;
 
 import java.io.Serializable;
 import java.util.List;
-import org.apache.syncope.client.console.commons.Constants;
 import org.apache.syncope.client.console.wicket.markup.html.bootstrap.dialog.BaseModal;
-import org.apache.syncope.common.lib.to.GroupTO;
+import org.apache.syncope.common.lib.types.AnyTypeKind;
 import org.apache.wicket.PageReference;
 
 /**
@@ -42,26 +41,6 @@ public class GroupDisplayAttributesModalPanel<T extends Serializable> extends Di
             final PageReference pageRef,
             final List<String> schemaNames,
             final List<String> dSchemaNames) {
-        super(modal, pageRef, schemaNames, dSchemaNames);
-    }
-
-    @Override
-    protected String getPrefDetailView() {
-        return Constants.PREF_GROUP_DETAILS_VIEW;
-    }
-
-    @Override
-    protected String getPrefPlainAttributeView() {
-        return Constants.PREF_GROUP_PLAIN_ATTRS_VIEW;
-    }
-
-    @Override
-    protected String getPrefDerivedAttributeView() {
-        return Constants.PREF_GROUP_DER_ATTRS_VIEW;
-    }
-
-    @Override
-    protected Class<GroupTO> getTOClass() {
-        return GroupTO.class;
+        super(modal, pageRef, schemaNames, dSchemaNames, AnyTypeKind.GROUP.name());
     }
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/653afac6/client/console/src/main/java/org/apache/syncope/client/console/panels/UserDirectoryPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/UserDirectoryPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/UserDirectoryPanel.java
index 717a955..2845ad9 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/UserDirectoryPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/UserDirectoryPanel.java
@@ -20,7 +20,6 @@ package org.apache.syncope.client.console.panels;
 
 import java.io.Serializable;
 import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.Collection;
 import java.util.List;
 import org.apache.commons.lang3.SerializationUtils;
@@ -33,8 +32,6 @@ import org.apache.syncope.client.console.rest.UserRestClient;
 import org.apache.syncope.client.console.status.AnyStatusModal;
 import org.apache.syncope.client.console.status.ChangePasswordModal;
 import org.apache.syncope.client.console.tasks.AnyPropagationTasks;
-import org.apache.syncope.client.console.wicket.extensions.markup.html.repeater.data.table.AttrColumn;
-import org.apache.syncope.client.console.wicket.extensions.markup.html.repeater.data.table.KeyPropertyColumn;
 import org.apache.syncope.client.console.wicket.markup.html.form.ActionLink;
 import org.apache.syncope.client.console.wicket.markup.html.form.ActionLink.ActionType;
 import org.apache.syncope.client.console.wicket.markup.html.form.ActionsPanel;
@@ -46,19 +43,16 @@ import org.apache.syncope.common.lib.SyncopeConstants;
 import org.apache.syncope.common.lib.to.AnyTypeClassTO;
 import org.apache.syncope.common.lib.to.UserTO;
 import org.apache.syncope.common.lib.types.AnyTypeKind;
-import org.apache.syncope.common.lib.types.SchemaType;
 import org.apache.syncope.common.lib.types.StandardEntitlement;
 import org.apache.wicket.PageReference;
 import org.apache.wicket.ajax.AjaxRequestTarget;
 import org.apache.wicket.event.Broadcast;
 import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
-import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
 import org.apache.wicket.model.CompoundPropertyModel;
 import org.apache.wicket.model.IModel;
 import org.apache.wicket.model.Model;
 import org.apache.wicket.model.ResourceModel;
 import org.apache.wicket.model.StringResourceModel;
-import org.springframework.util.ReflectionUtils;
 
 public class UserDirectoryPanel extends AnyDirectoryPanel<UserTO, UserRestClient> {
 
@@ -89,6 +83,11 @@ public class UserDirectoryPanel extends AnyDirectoryPanel<UserTO, UserRestClient
     }
 
     @Override
+    protected String[] getDefaultAttributeSelection() {
+        return UserDisplayAttributesModalPanel.DEFAULT_SELECTION;
+    }
+
+    @Override
     protected Collection<ActionType> getBulkActions() {
         List<ActionType> bulkActions = new ArrayList<>();
 
@@ -127,46 +126,6 @@ public class UserDirectoryPanel extends AnyDirectoryPanel<UserTO, UserRestClient
     }
 
     @Override
-    protected List<IColumn<UserTO, String>> getColumns() {
-        final List<IColumn<UserTO, String>> columns = new ArrayList<>();
-        final List<IColumn<UserTO, String>> prefcolumns = new ArrayList<>();
-
-        columns.add(new KeyPropertyColumn<UserTO>(
-                new ResourceModel(Constants.KEY_FIELD_NAME, Constants.KEY_FIELD_NAME), Constants.KEY_FIELD_NAME));
-
-        for (String name : prefMan.getList(getRequest(), Constants.PREF_USERS_DETAILS_VIEW)) {
-            if (!Constants.KEY_FIELD_NAME.equalsIgnoreCase(name)) {
-                addPropertyColumn(name, ReflectionUtils.findField(UserTO.class, name), prefcolumns);
-            }
-        }
-
-        for (String name : prefMan.getList(getRequest(), Constants.PREF_USERS_PLAIN_ATTRS_VIEW)) {
-            if (pSchemaNames.contains(name)) {
-                prefcolumns.add(new AttrColumn<UserTO>(name, SchemaType.PLAIN));
-            }
-        }
-
-        for (String name : prefMan.getList(getRequest(), Constants.PREF_USERS_DER_ATTRS_VIEW)) {
-            if (dSchemaNames.contains(name)) {
-                prefcolumns.add(new AttrColumn<UserTO>(name, SchemaType.DERIVED));
-            }
-        }
-
-        // Add defaults in case of no selection
-        if (prefcolumns.isEmpty()) {
-            for (String name : UserDisplayAttributesModalPanel.DEFAULT_SELECTION) {
-                addPropertyColumn(name, ReflectionUtils.findField(UserTO.class, name), prefcolumns);
-            }
-
-            prefMan.setList(getRequest(), getResponse(), Constants.PREF_USERS_DETAILS_VIEW,
-                    Arrays.asList(UserDisplayAttributesModalPanel.DEFAULT_SELECTION));
-        }
-
-        columns.addAll(prefcolumns);
-        return columns;
-    }
-
-    @Override
     public ActionsPanel<UserTO> getActions(final IModel<UserTO> model) {
         final ActionsPanel<UserTO> panel = super.getActions(model);
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/653afac6/client/console/src/main/java/org/apache/syncope/client/console/panels/UserDisplayAttributesModalPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/UserDisplayAttributesModalPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/UserDisplayAttributesModalPanel.java
index 513ec9d..24e701e 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/UserDisplayAttributesModalPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/UserDisplayAttributesModalPanel.java
@@ -20,9 +20,8 @@ package org.apache.syncope.client.console.panels;
 
 import java.io.Serializable;
 import java.util.List;
-import org.apache.syncope.client.console.commons.Constants;
 import org.apache.syncope.client.console.wicket.markup.html.bootstrap.dialog.BaseModal;
-import org.apache.syncope.common.lib.to.UserTO;
+import org.apache.syncope.common.lib.types.AnyTypeKind;
 import org.apache.wicket.PageReference;
 
 /**
@@ -42,27 +41,6 @@ public class UserDisplayAttributesModalPanel<T extends Serializable> extends Dis
             final PageReference pageRef,
             final List<String> schemaNames,
             final List<String> dSchemaNames) {
-        super(modal, pageRef, schemaNames, dSchemaNames);
+        super(modal, pageRef, schemaNames, dSchemaNames, AnyTypeKind.USER.name());
     }
-
-    @Override
-    protected String getPrefDetailView() {
-        return Constants.PREF_USERS_DETAILS_VIEW;
-    }
-
-    @Override
-    protected String getPrefPlainAttributeView() {
-        return Constants.PREF_USERS_PLAIN_ATTRS_VIEW;
-    }
-
-    @Override
-    protected String getPrefDerivedAttributeView() {
-        return Constants.PREF_USERS_DER_ATTRS_VIEW;
-    }
-
-    @Override
-    protected Class<UserTO> getTOClass() {
-        return UserTO.class;
-    }
-
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/653afac6/client/console/src/main/java/org/apache/syncope/client/console/panels/search/AnyObjectSelectionDirectoryPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/search/AnyObjectSelectionDirectoryPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/search/AnyObjectSelectionDirectoryPanel.java
index 8276be9..6654091 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/search/AnyObjectSelectionDirectoryPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/search/AnyObjectSelectionDirectoryPanel.java
@@ -20,6 +20,7 @@ package org.apache.syncope.client.console.panels.search;
 
 import java.util.List;
 import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.panels.AnyObjectDisplayAttributesModalPanel;
 import org.apache.syncope.client.console.rest.AnyObjectRestClient;
 import org.apache.syncope.client.console.wizards.WizardMgtPanel;
 import org.apache.syncope.client.console.wizards.any.AnyWrapper;
@@ -33,7 +34,7 @@ public final class AnyObjectSelectionDirectoryPanel
     private static final long serialVersionUID = -1100228004207271272L;
 
     private AnyObjectSelectionDirectoryPanel(final String id, final Builder builder, final boolean wizardInModal) {
-        super(id, builder, AnyObjectTO.class, wizardInModal);
+        super(id, builder, wizardInModal);
     }
 
     @Override
@@ -42,18 +43,8 @@ public final class AnyObjectSelectionDirectoryPanel
     }
 
     @Override
-    public String getPrefDetailsView() {
-        return String.format(Constants.PREF_ANY_OBJECT_DETAILS_VIEW, type);
-    }
-
-    @Override
-    public String getPrefPlainAttributesView() {
-        return String.format(Constants.PREF_ANY_OBJECT_PLAIN_ATTRS_VIEW, type);
-    }
-
-    @Override
-    public String getPrefDerivedAttributesView() {
-        return String.format(Constants.PREF_ANY_OBJECT_DER_ATTRS_VIEW, type);
+    protected String[] getDefaultAttributeSelection() {
+        return AnyObjectDisplayAttributesModalPanel.DEFAULT_SELECTION;
     }
 
     public static final class Builder extends AnySelectionDirectoryPanel.Builder<AnyObjectTO, AnyObjectRestClient> {
@@ -62,8 +53,6 @@ public final class AnyObjectSelectionDirectoryPanel
 
         public Builder(final List<AnyTypeClassTO> anyTypeClassTOs, final String type, final PageReference pageRef) {
             super(anyTypeClassTOs, new AnyObjectRestClient(), type, pageRef);
-            this.filtered = true;
-            this.checkBoxEnabled = false;
         }
 
         @Override

http://git-wip-us.apache.org/repos/asf/syncope/blob/653afac6/client/console/src/main/java/org/apache/syncope/client/console/panels/search/AnySelectionDirectoryPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/search/AnySelectionDirectoryPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/search/AnySelectionDirectoryPanel.java
index 27712ce..7eeb59c 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/search/AnySelectionDirectoryPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/search/AnySelectionDirectoryPanel.java
@@ -19,89 +19,33 @@
 package org.apache.syncope.client.console.panels.search;
 
 import java.io.Serializable;
-import java.lang.reflect.Field;
-import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
-import java.util.Date;
 import java.util.List;
 import org.apache.syncope.client.console.panels.AnyDirectoryPanel;
 import org.apache.syncope.client.console.rest.AbstractAnyRestClient;
-import org.apache.syncope.client.console.wicket.extensions.markup.html.repeater.data.table.AttrColumn;
-import org.apache.syncope.client.console.wicket.extensions.markup.html.repeater.data.table.BooleanPropertyColumn;
-import org.apache.syncope.client.console.wicket.extensions.markup.html.repeater.data.table.DatePropertyColumn;
-import org.apache.syncope.client.console.wicket.extensions.markup.html.repeater.data.table.KeyPropertyColumn;
-import org.apache.syncope.client.console.wicket.extensions.markup.html.repeater.data.table.TokenColumn;
 import org.apache.syncope.client.console.wicket.markup.html.form.ActionLink;
 import org.apache.syncope.client.console.wicket.markup.html.form.ActionLink.ActionType;
 import org.apache.syncope.client.console.wicket.markup.html.form.ActionsPanel;
 import org.apache.syncope.common.lib.to.AnyTypeClassTO;
-import org.apache.syncope.common.lib.to.AnyObjectTO;
 import org.apache.syncope.common.lib.to.AnyTO;
-import org.apache.syncope.common.lib.to.UserTO;
 import org.apache.syncope.common.lib.types.AnyEntitlement;
-import org.apache.syncope.common.lib.types.SchemaType;
 import org.apache.wicket.PageReference;
 import org.apache.wicket.ajax.AjaxRequestTarget;
 import org.apache.wicket.event.Broadcast;
-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.ResourceModel;
-import org.springframework.util.ReflectionUtils;
 
 public abstract class AnySelectionDirectoryPanel<A extends AnyTO, E extends AbstractAnyRestClient<A, ?>>
         extends AnyDirectoryPanel<A, E> {
 
     private static final long serialVersionUID = -1100228004207271272L;
 
-    private final Class<A> reference;
-
     protected AnySelectionDirectoryPanel(
             final String id,
             final AnyDirectoryPanel.Builder<A, E> builder,
-            final Class<A> reference,
             final boolean wizardInModal) {
 
         super(id, builder, wizardInModal);
-        this.reference = reference;
-    }
-
-    @Override
-    protected List<IColumn<A, String>> getColumns() {
-        final List<IColumn<A, String>> columns = new ArrayList<>();
-
-        for (String name : prefMan.getList(getRequest(), getPrefDetailsView())) {
-            final Field field = ReflectionUtils.findField(AnyObjectTO.class, name);
-
-            if ("key".equalsIgnoreCase(name)) {
-                columns.add(new KeyPropertyColumn<A>(new ResourceModel(name, name), name, name));
-            } else if (reference == UserTO.class && "token".equalsIgnoreCase(name)) {
-                columns.add(new TokenColumn<A>(new ResourceModel(name, name), name));
-            } else if (field != null
-                    && (field.getType().equals(Boolean.class) || field.getType().equals(boolean.class))) {
-
-                columns.add(new BooleanPropertyColumn<A>(new ResourceModel(name, name), name, name));
-            } else if (field != null && field.getType().equals(Date.class)) {
-                columns.add(new DatePropertyColumn<A>(new ResourceModel(name, name), name, name));
-            } else {
-                columns.add(new PropertyColumn<A, String>(new ResourceModel(name, name), name, name));
-            }
-        }
-
-        for (String name : prefMan.getList(getRequest(), getPrefPlainAttributesView())) {
-            if (pSchemaNames.contains(name)) {
-                columns.add(new AttrColumn<A>(name, SchemaType.PLAIN));
-            }
-        }
-
-        for (String name : prefMan.getList(getRequest(), getPrefDerivedAttributesView())) {
-            if (dSchemaNames.contains(name)) {
-                columns.add(new AttrColumn<A>(name, SchemaType.DERIVED));
-            }
-        }
-
-        return columns;
     }
 
     @Override
@@ -127,12 +71,6 @@ public abstract class AnySelectionDirectoryPanel<A extends AnyTO, E extends Abst
         return Collections.<ActionType>emptyList();
     }
 
-    protected abstract String getPrefDetailsView();
-
-    protected abstract String getPrefPlainAttributesView();
-
-    protected abstract String getPrefDerivedAttributesView();
-
     public abstract static class Builder<A extends AnyTO, E extends AbstractAnyRestClient<A, ?>>
             extends AnyDirectoryPanel.Builder<A, E> {
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/653afac6/client/console/src/main/java/org/apache/syncope/client/console/panels/search/GroupSelectionDirectoryPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/search/GroupSelectionDirectoryPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/search/GroupSelectionDirectoryPanel.java
index 4642414..a31fb41 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/search/GroupSelectionDirectoryPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/search/GroupSelectionDirectoryPanel.java
@@ -20,6 +20,7 @@ package org.apache.syncope.client.console.panels.search;
 
 import java.util.List;
 import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.panels.GroupDisplayAttributesModalPanel;
 import org.apache.syncope.client.console.rest.GroupRestClient;
 import org.apache.syncope.client.console.wizards.WizardMgtPanel;
 import org.apache.syncope.client.console.wizards.any.AnyWrapper;
@@ -32,7 +33,7 @@ public final class GroupSelectionDirectoryPanel extends AnySelectionDirectoryPan
     private static final long serialVersionUID = -1100228004207271271L;
 
     private GroupSelectionDirectoryPanel(final String id, final Builder builder, final boolean wizardInModal) {
-        super(id, builder, GroupTO.class, wizardInModal);
+        super(id, builder, wizardInModal);
     }
 
     @Override
@@ -41,18 +42,8 @@ public final class GroupSelectionDirectoryPanel extends AnySelectionDirectoryPan
     }
 
     @Override
-    public String getPrefDetailsView() {
-        return Constants.PREF_GROUP_DETAILS_VIEW;
-    }
-
-    @Override
-    public String getPrefPlainAttributesView() {
-        return Constants.PREF_GROUP_PLAIN_ATTRS_VIEW;
-    }
-
-    @Override
-    public String getPrefDerivedAttributesView() {
-        return Constants.PREF_GROUP_DER_ATTRS_VIEW;
+    protected String[] getDefaultAttributeSelection() {
+        return GroupDisplayAttributesModalPanel.DEFAULT_SELECTION;
     }
 
     public static final class Builder extends AnySelectionDirectoryPanel.Builder<GroupTO, GroupRestClient> {
@@ -61,8 +52,6 @@ public final class GroupSelectionDirectoryPanel extends AnySelectionDirectoryPan
 
         public Builder(final List<AnyTypeClassTO> anyTypeClassTOs, final String type, final PageReference pageRef) {
             super(anyTypeClassTOs, new GroupRestClient(), type, pageRef);
-            this.filtered = true;
-            this.checkBoxEnabled = false;
         }
 
         @Override

http://git-wip-us.apache.org/repos/asf/syncope/blob/653afac6/client/console/src/main/java/org/apache/syncope/client/console/panels/search/UserSelectionDirectoryPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/search/UserSelectionDirectoryPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/search/UserSelectionDirectoryPanel.java
index a27c2f6..542536c 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/search/UserSelectionDirectoryPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/search/UserSelectionDirectoryPanel.java
@@ -20,6 +20,7 @@ package org.apache.syncope.client.console.panels.search;
 
 import java.util.List;
 import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.panels.UserDisplayAttributesModalPanel;
 import org.apache.syncope.client.console.rest.UserRestClient;
 import org.apache.syncope.client.console.wizards.WizardMgtPanel;
 import org.apache.syncope.client.console.wizards.any.AnyWrapper;
@@ -32,7 +33,7 @@ public final class UserSelectionDirectoryPanel extends AnySelectionDirectoryPane
     private static final long serialVersionUID = -1100228004207271272L;
 
     private UserSelectionDirectoryPanel(final String id, final Builder builder, final boolean wizardInModal) {
-        super(id, builder, UserTO.class, wizardInModal);
+        super(id, builder, wizardInModal);
     }
 
     @Override
@@ -41,18 +42,8 @@ public final class UserSelectionDirectoryPanel extends AnySelectionDirectoryPane
     }
 
     @Override
-    protected String getPrefDetailsView() {
-        return Constants.PREF_USERS_DETAILS_VIEW;
-    }
-
-    @Override
-    protected String getPrefPlainAttributesView() {
-        return Constants.PREF_USERS_PLAIN_ATTRS_VIEW;
-    }
-
-    @Override
-    protected String getPrefDerivedAttributesView() {
-        return Constants.PREF_USERS_DER_ATTRS_VIEW;
+    protected String[] getDefaultAttributeSelection() {
+        return UserDisplayAttributesModalPanel.DEFAULT_SELECTION;
     }
 
     public static final class Builder extends AnySelectionDirectoryPanel.Builder<UserTO, UserRestClient> {
@@ -61,8 +52,6 @@ public final class UserSelectionDirectoryPanel extends AnySelectionDirectoryPane
 
         public Builder(final List<AnyTypeClassTO> anyTypeClassTOs, final String type, final PageReference pageRef) {
             super(anyTypeClassTOs, new UserRestClient(), type, pageRef);
-            this.filtered = true;
-            this.checkBoxEnabled = false;
         }
 
         @Override

http://git-wip-us.apache.org/repos/asf/syncope/blob/653afac6/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/Relationships.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/Relationships.java b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/Relationships.java
index c476251..da08b7f 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/Relationships.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/Relationships.java
@@ -360,7 +360,7 @@ public class Relationships extends WizardStep {
                         anyObjectDirectoryPanel = new AnyObjectSelectionDirectoryPanel.Builder(
                                 anyTypeClassRestClient.list(anyType.getClasses()),
                                 anyType.getKey(),
-                                pageRef).setFiltered(true).
+                                pageRef).
                                 setFiql(SyncopeClient.getAnyObjectSearchConditionBuilder(anyType.getKey()).
                                         is("key").notNullValue().query()).
                                 setWizardInModal(true).build("searchResultPanel");
@@ -378,7 +378,7 @@ public class Relationships extends WizardStep {
                         getTarget();
                 final String fiql = SearchUtils.buildFIQL(anyObjectSearchPanel.getModel().getObject(),
                         SyncopeClient.getAnyObjectSearchConditionBuilder(anyObjectSearchPanel.getBackObjectType()));
-                AnyDirectoryPanel.class.cast(anyObjectDirectoryPanel).search(fiql, target);
+                AnyDirectoryPanel.class.cast(Specification.this.anyObjectDirectoryPanel).search(fiql, target);
             } else if (event.getPayload() instanceof AnySelectionDirectoryPanel.ItemSelection) {
                 final AjaxRequestTarget target = AnySelectionDirectoryPanel.ItemSelection.class.cast(event.
                         getPayload()).getTarget();

http://git-wip-us.apache.org/repos/asf/syncope/blob/653afac6/fit/core-reference/src/test/java/org/apache/syncope/fit/console/UsersITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/console/UsersITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/console/UsersITCase.java
index 77d479e..a78d9f3 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/console/UsersITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/console/UsersITCase.java
@@ -99,6 +99,74 @@ public class UsersITCase extends AbstractConsoleITCase {
     }
 
     @Test
+    public void editRelationships() {
+        TESTER.clickLink("body:realmsLI:realms");
+        TESTER.clickLink("body:content:body:container:content:tabbedPanel:tabs-container:tabs:1:link");
+
+        Component component = findComponentByProp("username", CONTAINER
+                + ":searchContainer:resultTable:tablePanel:groupForm:checkgroup:dataTable", "puccini");
+        assertNotNull(component);
+
+        TESTER.executeAjaxEvent(component.getPageRelativePath(), Constants.ON_CLICK);
+        TESTER.clickLink(TAB_PANEL + "outerObjectsRepeater:1:outer:container:content:togglePanelContainer:container:"
+                + "actions:actions:actionRepeater:0:action:action");
+
+        TESTER.assertComponent(TAB_PANEL + "outerObjectsRepeater:0:outer:form:content:form:view:username:textField",
+                TextField.class);
+
+        FormTester formTester = TESTER.newFormTester(TAB_PANEL + "outerObjectsRepeater:0:outer:form:content:form");
+        assertNotNull(formTester);
+
+        formTester.submit("buttons:next");
+
+        formTester = TESTER.newFormTester(TAB_PANEL + "outerObjectsRepeater:0:outer:form:content:form");
+        assertNotNull(formTester);
+        formTester.submit("buttons:next");
+
+        formTester = TESTER.newFormTester(TAB_PANEL + "outerObjectsRepeater:0:outer:form:content:form");
+        assertNotNull(formTester);
+        formTester.submit("buttons:next");
+
+        formTester = TESTER.newFormTester(TAB_PANEL + "outerObjectsRepeater:0:outer:form:content:form");
+        assertNotNull(formTester);
+        formTester.submit("buttons:next");
+
+        formTester = TESTER.newFormTester(TAB_PANEL + "outerObjectsRepeater:0:outer:form:content:form");
+        assertNotNull(formTester);
+        formTester.submit("buttons:next");
+
+        formTester = TESTER.newFormTester(TAB_PANEL + "outerObjectsRepeater:0:outer:form:content:form");
+        assertNotNull(formTester);
+        formTester.submit("buttons:next");
+
+        formTester = TESTER.newFormTester(TAB_PANEL + "outerObjectsRepeater:0:outer:form:content:form");
+        assertNotNull(formTester);
+        formTester.submit("buttons:next");
+
+        TESTER.executeAjaxEvent(TAB_PANEL + "outerObjectsRepeater:0:outer:form:content:form:view:relationships:actions:"
+                + "actionRepeater:0:action:action", Constants.ON_CLICK);
+
+        formTester = TESTER.newFormTester(TAB_PANEL + "outerObjectsRepeater:0:outer:form:content:form");
+        assertNotNull(formTester);
+
+        formTester.setValue("view:relationships:specification:type:dropDownChoiceField", "1");
+        TESTER.executeAjaxEvent(TAB_PANEL + "outerObjectsRepeater:0:outer:form:content:form:view:relationships:"
+                + "specification:type:dropDownChoiceField", Constants.ON_CHANGE);
+
+        formTester.setValue("view:relationships:specification:rightType:dropDownChoiceField", "PRINTER");
+        TESTER.executeAjaxEvent(TAB_PANEL + "outerObjectsRepeater:0:outer:form:content:form:view:relationships:"
+                + "specification:rightType:dropDownChoiceField", Constants.ON_CHANGE);
+
+        component = findComponentByProp("name", TAB_PANEL + "outerObjectsRepeater:"
+                + "0:outer:form:content:form:view:relationships:specification:searchPanelContainer:searchPanel:"
+                + "searchResultPanel:container:content:searchContainer:resultTable:tablePanel:groupForm:checkgroup:"
+                + "dataTable:body:rows:1:cells:2:cell", "Canon MF 8030cn");
+        assertNotNull(component);
+
+        formTester.submit("buttons:cancel");
+    }
+
+    @Test
     public void editUser() {
         TESTER.clickLink("body:realmsLI:realms");
         TESTER.clickLink("body:content:body:container:content:tabbedPanel:tabs-container:tabs:1:link");


Mime
View raw message