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-156] fix for dynamic memberships
Date Thu, 10 Dec 2015 17:04:18 GMT
Repository: syncope
Updated Branches:
  refs/heads/master b578a788a -> 0d5ba39a3


[SYNCOPE-156] fix for dynamic memberships


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

Branch: refs/heads/master
Commit: 0d5ba39a3d935b733a4e79732d2a79cc7d6afda6
Parents: b578a78
Author: fmartelli <fabio.martelli@gmail.com>
Authored: Thu Dec 10 18:04:01 2015 +0100
Committer: fmartelli <fabio.martelli@gmail.com>
Committed: Thu Dec 10 18:04:01 2015 +0100

----------------------------------------------------------------------
 .../pages/AnyDisplayAttributesModalPage.java    |   2 +-
 .../pages/GroupDisplayAttributesModalPage.java  |   2 +-
 .../client/console/pages/StatusModal.java       | 158 +++++++++----------
 .../pages/UserDisplayAttributesModalPage.java   |   2 +-
 .../panels/AbstractSearchResultPanel.java       |   7 +-
 .../panels/AnyObjectSearchResultPanel.java      |  12 +-
 .../console/panels/GroupSearchResultPanel.java  |   9 +-
 .../client/console/panels/ListViewPanel.java    |   7 +-
 .../console/panels/UserSearchResultPanel.java   |  40 +++--
 .../client/console/wizards/WizardMgtPanel.java  |   5 +-
 .../client/console/wizards/any/AnyHandler.java  |  38 +++++
 .../console/wizards/any/AnyWizardBuilder.java   |  66 +++++---
 .../client/console/wizards/any/AuxClasses.java  |  72 ++++-----
 .../client/console/wizards/any/Details.java     |   4 +-
 .../console/wizards/any/GroupDetails.java       |  15 +-
 .../console/wizards/any/GroupHandler.java       |  99 ++++++++++++
 .../console/wizards/any/GroupWizardBuilder.java | 109 ++-----------
 .../client/console/wizards/any/UserDetails.java |  22 +--
 .../console/wizards/any/UserWizardBuilder.java  |  27 ++--
 .../panels/AbstractSearchResultPanel.properties |   4 +-
 20 files changed, 403 insertions(+), 297 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/0d5ba39a/client/console/src/main/java/org/apache/syncope/client/console/pages/AnyDisplayAttributesModalPage.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/pages/AnyDisplayAttributesModalPage.java b/client/console/src/main/java/org/apache/syncope/client/console/pages/AnyDisplayAttributesModalPage.java
index 9c2eaef..d5731ff 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/pages/AnyDisplayAttributesModalPage.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/pages/AnyDisplayAttributesModalPage.java
@@ -38,7 +38,7 @@ public class AnyDisplayAttributesModalPage<T extends AnyTO> extends DisplayAttri
     public static final String[] ANY_DEFAULT_SELECTION = { "key" };
 
     public AnyDisplayAttributesModalPage(
-            final BaseModal<T> modal,
+            final BaseModal<?> modal,
             final PageReference pageRef,
             final List<String> schemaNames,
             final List<String> dSchemaNames) {

http://git-wip-us.apache.org/repos/asf/syncope/blob/0d5ba39a/client/console/src/main/java/org/apache/syncope/client/console/pages/GroupDisplayAttributesModalPage.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/pages/GroupDisplayAttributesModalPage.java b/client/console/src/main/java/org/apache/syncope/client/console/pages/GroupDisplayAttributesModalPage.java
index 9b33379..09dbb06 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/pages/GroupDisplayAttributesModalPage.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/pages/GroupDisplayAttributesModalPage.java
@@ -35,7 +35,7 @@ public class GroupDisplayAttributesModalPage extends DisplayAttributesModalPage
     public static final String[] GROUP_DEFAULT_SELECTION = { "key", "name" };
 
     public GroupDisplayAttributesModalPage(
-            final BaseModal<GroupTO> modal,
+            final BaseModal<?> modal,
             final PageReference pageRef,
             final List<String> schemaNames,
             final List<String> dSchemaNames) {

http://git-wip-us.apache.org/repos/asf/syncope/blob/0d5ba39a/client/console/src/main/java/org/apache/syncope/client/console/pages/StatusModal.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/pages/StatusModal.java b/client/console/src/main/java/org/apache/syncope/client/console/pages/StatusModal.java
index e6c7a27..8ee6357 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/pages/StatusModal.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/pages/StatusModal.java
@@ -103,7 +103,7 @@ public class StatusModal<T extends AnyTO> extends AbstractStatusModalPage {
     private final List<IColumn<StatusBean, String>> columns;
 
     public StatusModal(
-            final BaseModal<T> modal,
+            final BaseModal<?> modal,
             final PageReference pageRef,
             final AnyTO attributableTO) {
 
@@ -111,7 +111,7 @@ public class StatusModal<T extends AnyTO> extends AbstractStatusModalPage {
     }
 
     public StatusModal(
-            final BaseModal<T> modal,
+            final BaseModal<?> modal,
             final PageReference pageRef,
             final AnyTO anyTO,
             final boolean statusOnly) {
@@ -130,29 +130,29 @@ public class StatusModal<T extends AnyTO> extends AbstractStatusModalPage {
         columns.add(new AbstractColumn<StatusBean, String>(
                 new StringResourceModel("resourceName", this, null), "resourceName") {
 
-                    private static final long serialVersionUID = 2054811145491901166L;
+            private static final long serialVersionUID = 2054811145491901166L;
+
+            @Override
+            public void populateItem(
+                    final Item<ICellPopulator<StatusBean>> cellItem,
+                    final String componentId,
+                    final IModel<StatusBean> model) {
+
+                cellItem.add(new Label(componentId, model.getObject().getResourceName()) {
+
+                    private static final long serialVersionUID = 8432079838783825801L;
 
                     @Override
-                    public void populateItem(
-                            final Item<ICellPopulator<StatusBean>> cellItem,
-                            final String componentId,
-                            final IModel<StatusBean> model) {
-
-                                cellItem.add(new Label(componentId, model.getObject().getResourceName()) {
-
-                                    private static final long serialVersionUID = 8432079838783825801L;
-
-                                    @Override
-                                    protected void onComponentTag(final ComponentTag tag) {
-                                        if (model.getObject().isLinked()) {
-                                            super.onComponentTag(tag);
-                                        } else {
-                                            tag.put("style", "color: #DDDDDD");
-                                        }
-                                    }
-                                });
-                            }
+                    protected void onComponentTag(final ComponentTag tag) {
+                        if (model.getObject().isLinked()) {
+                            super.onComponentTag(tag);
+                        } else {
+                            tag.put("style", "color: #DDDDDD");
+                        }
+                    }
                 });
+            }
+        });
 
         columns.add(new PropertyColumn<StatusBean, String>(
                 new StringResourceModel("connObjectLink", this, null), "connObjectLink", "connObjectLink"));
@@ -160,27 +160,27 @@ public class StatusModal<T extends AnyTO> extends AbstractStatusModalPage {
         columns.add(new AbstractColumn<StatusBean, String>(
                 new StringResourceModel("status", this, null)) {
 
-                    private static final long serialVersionUID = -3503023501954863131L;
+            private static final long serialVersionUID = -3503023501954863131L;
 
-                    @Override
-                    public String getCssClass() {
-                        return "action";
-                    }
+            @Override
+            public String getCssClass() {
+                return "action";
+            }
 
-                    @Override
-                    public void populateItem(
-                            final Item<ICellPopulator<StatusBean>> cellItem,
-                            final String componentId,
-                            final IModel<StatusBean> model) {
-
-                                if (model.getObject().isLinked()) {
-                                    cellItem.add(statusUtils.getStatusImagePanel(componentId, model.getObject().
-                                                    getStatus()));
-                                } else {
-                                    cellItem.add(new Label(componentId, ""));
-                                }
-                            }
-                });
+            @Override
+            public void populateItem(
+                    final Item<ICellPopulator<StatusBean>> cellItem,
+                    final String componentId,
+                    final IModel<StatusBean> model) {
+
+                if (model.getObject().isLinked()) {
+                    cellItem.add(statusUtils.getStatusImagePanel(componentId, model.getObject().
+                            getStatus()));
+                } else {
+                    cellItem.add(new Label(componentId, ""));
+                }
+            }
+        });
 
         table = new ActionDataTablePanel<StatusBean, String>(
                 "resourceDatatable",
@@ -189,13 +189,13 @@ public class StatusModal<T extends AnyTO> extends AbstractStatusModalPage {
                 rowsPerPage,
                 pageRef) {
 
-                    private static final long serialVersionUID = 6510391461033818316L;
+            private static final long serialVersionUID = 6510391461033818316L;
 
-                    @Override
-                    public boolean isElementEnabled(final StatusBean element) {
-                        return !statusOnly || element.getStatus() != Status.OBJECT_NOT_FOUND;
-                    }
-                };
+            @Override
+            public boolean isElementEnabled(final StatusBean element) {
+                return !statusOnly || element.getStatus() != Status.OBJECT_NOT_FOUND;
+            }
+        };
         table.setOutputMarkupId(true);
 
         final String pageId = anyTO instanceof GroupTO ? "Groups" : "Users";
@@ -248,13 +248,13 @@ public class StatusModal<T extends AnyTO> extends AbstractStatusModalPage {
         final ClearIndicatingAjaxButton goon = new ClearIndicatingAjaxButton("continue", new ResourceModel("continue"),
                 pageRef) {
 
-                    private static final long serialVersionUID = -2341391430136818027L;
+            private static final long serialVersionUID = -2341391430136818027L;
 
-                    @Override
-                    protected void onSubmitInternal(final AjaxRequestTarget target, final Form<?> form) {
-                        // none
-                    }
-                };
+            @Override
+            protected void onSubmitInternal(final AjaxRequestTarget target, final Form<?> form) {
+                // none
+            }
+        };
 
         pwdMgtForm.add(goon);
 
@@ -555,18 +555,18 @@ public class StatusModal<T extends AnyTO> extends AbstractStatusModalPage {
         final ClearIndicatingAjaxButton goon = new ClearIndicatingAjaxButton("continue", new ResourceModel("continue",
                 "Continue"), pageRef) {
 
-                    private static final long serialVersionUID = -2341391430136818027L;
+            private static final long serialVersionUID = -2341391430136818027L;
 
-                    @Override
-                    protected void onSubmitInternal(final AjaxRequestTarget target, final Form<?> form) {
-                        try {
-                            if (StringUtils.isNotBlank(password.getModelObject())
+            @Override
+            protected void onSubmitInternal(final AjaxRequestTarget target, final Form<?> form) {
+                try {
+                    if (StringUtils.isNotBlank(password.getModelObject())
                             && !password.getModelObject().equals(confirm.getModelObject())) {
-                                throw new Exception(getString("passwordMismatch"));
-                            }
+                        throw new Exception(getString("passwordMismatch"));
+                    }
 
-                            final BulkActionResult bulkActionResult;
-                            switch (type) {
+                    final BulkActionResult bulkActionResult;
+                    switch (type) {
 //                                case ASSIGN:
 //                                    bulkActionResult = userRestClient.assign(
 //                                            anyTO.getETagValue(),
@@ -583,27 +583,27 @@ public class StatusModal<T extends AnyTO> extends AbstractStatusModalPage {
 //                                            changepwd.getModelObject(),
 //                                            password.getModelObject());
 //                                    break;
-                                default:
-                                    bulkActionResult = null;
-                                // ignore
-                            }
+                        default:
+                            bulkActionResult = null;
+                        // ignore
+                    }
 
-                            ((BasePage) pageRef.getPage()).setModalResult(true);
+                    ((BasePage) pageRef.getPage()).setModalResult(true);
 
-                            if (bulkActionResult != null) {
-                                loadBulkActionResultPage(target, selection, bulkActionResult);
-                            } else {
+                    if (bulkActionResult != null) {
+                        loadBulkActionResultPage(target, selection, bulkActionResult);
+                    } else {
 
-                                target.add(((BasePage) pageRef.getPage()).getFeedbackPanel());
-                                modal.close(target);
-                            }
-                        } catch (Exception e) {
-                            LOG.error("Error provisioning resources", e);
-                            error(getString(Constants.ERROR) + ": " + e.getMessage());
-                            modal.getFeedbackPanel().refresh(target);
-                        }
+                        target.add(((BasePage) pageRef.getPage()).getFeedbackPanel());
+                        modal.close(target);
                     }
-                }.feedbackPanelAutomaticReload(false);
+                } catch (Exception e) {
+                    LOG.error("Error provisioning resources", e);
+                    error(getString(Constants.ERROR) + ": " + e.getMessage());
+                    modal.getFeedbackPanel().refresh(target);
+                }
+            }
+        }.feedbackPanelAutomaticReload(false);
 
         pwdMgtForm.addOrReplace(goon);
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/0d5ba39a/client/console/src/main/java/org/apache/syncope/client/console/pages/UserDisplayAttributesModalPage.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/pages/UserDisplayAttributesModalPage.java b/client/console/src/main/java/org/apache/syncope/client/console/pages/UserDisplayAttributesModalPage.java
index 2ce0a30..0529f9f 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/pages/UserDisplayAttributesModalPage.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/pages/UserDisplayAttributesModalPage.java
@@ -35,7 +35,7 @@ public class UserDisplayAttributesModalPage extends DisplayAttributesModalPage {
     public static final String[] USER_DEFAULT_SELECTION = { "key", "username", "status" };
 
     public UserDisplayAttributesModalPage(
-            final BaseModal<UserTO> modal,
+            final BaseModal<?> modal,
             final PageReference pageRef,
             final List<String> schemaNames,
             final List<String> dSchemaNames) {

http://git-wip-us.apache.org/repos/asf/syncope/blob/0d5ba39a/client/console/src/main/java/org/apache/syncope/client/console/panels/AbstractSearchResultPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/AbstractSearchResultPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/AbstractSearchResultPanel.java
index 9c534d0..d3bdd34 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/AbstractSearchResultPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/AbstractSearchResultPanel.java
@@ -28,6 +28,7 @@ import org.apache.syncope.client.console.rest.AbstractAnyRestClient;
 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.wizards.WizardMgtPanel;
+import org.apache.syncope.client.console.wizards.any.AnyHandler;
 import org.apache.syncope.common.lib.to.AnyTO;
 import org.apache.wicket.PageReference;
 import org.apache.wicket.ajax.AjaxRequestTarget;
@@ -43,7 +44,7 @@ import org.apache.wicket.model.PropertyModel;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-public abstract class AbstractSearchResultPanel<T extends AnyTO> extends WizardMgtPanel<T> {
+public abstract class AbstractSearchResultPanel<T extends AnyTO> extends WizardMgtPanel<AnyHandler<T>> {
 
     private static final long serialVersionUID = -9170191461250434024L;
 
@@ -294,7 +295,7 @@ public abstract class AbstractSearchResultPanel<T extends AnyTO> extends WizardM
 
     protected abstract String getPageId();
 
-    public abstract static class Builder<T extends AnyTO> extends WizardMgtPanel.Builder<T> {
+    public abstract static class Builder<T extends AnyTO> extends WizardMgtPanel.Builder<AnyHandler<T>> {
 
         private static final long serialVersionUID = 5088962796986706805L;
 
@@ -330,7 +331,7 @@ public abstract class AbstractSearchResultPanel<T extends AnyTO> extends WizardM
                 final String realm,
                 final String type) {
 
-            super(reference, pageRef);
+            super(pageRef);
             this.filtered = filtered;
             this.fiql = fiql;
             this.restClient = restClient;

http://git-wip-us.apache.org/repos/asf/syncope/blob/0d5ba39a/client/console/src/main/java/org/apache/syncope/client/console/panels/AnyObjectSearchResultPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/AnyObjectSearchResultPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/AnyObjectSearchResultPanel.java
index 0d9c7ed..2bb56d7 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/AnyObjectSearchResultPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/AnyObjectSearchResultPanel.java
@@ -36,6 +36,7 @@ import org.apache.syncope.client.console.wicket.markup.html.form.ActionLink;
 import org.apache.syncope.client.console.wicket.markup.html.form.ActionLinksPanel;
 import org.apache.syncope.client.console.wizards.AjaxWizard;
 import org.apache.syncope.client.console.wizards.WizardMgtPanel;
+import org.apache.syncope.client.console.wizards.any.AnyHandler;
 import org.apache.syncope.common.lib.SyncopeClientException;
 import org.apache.syncope.common.lib.to.AnyTO;
 import org.apache.syncope.common.lib.to.AnyTypeClassTO;
@@ -144,23 +145,24 @@ public class AnyObjectSearchResultPanel<T extends AnyTO> extends AbstractSearchR
                     private static final long serialVersionUID = -7978723352517770644L;
 
                     @Override
-                    public void onClick(final AjaxRequestTarget target, final AnyTO anyTO) {
+                    public void onClick(final AjaxRequestTarget target, final T ignore) {
                         send(AnyObjectSearchResultPanel.this, Broadcast.EXACT,
-                                new AjaxWizard.EditItemActionEvent<>(model.getObject(), target));
+                                new AjaxWizard.EditItemActionEvent<AnyHandler<T>>(
+                                        new AnyHandler<T>(model.getObject()), target));
                     }
                 }, ActionLink.ActionType.EDIT, entitlement).add(new ActionLink<T>() {
 
                     private static final long serialVersionUID = -7978723352517770644L;
 
                     @Override
-                    public void onClick(final AjaxRequestTarget target, final T anyTO) {
+                    public void onClick(final AjaxRequestTarget target, final T ignore) {
                         try {
                             restClient.delete(model.getObject().getETagValue(), model.getObject().getKey());
                             info(getString(Constants.OPERATION_SUCCEEDED));
                             target.add(container);
                         } catch (SyncopeClientException e) {
                             error(getString(Constants.ERROR) + ": " + e.getMessage());
-                            LOG.error("While deleting object {}", anyTO.getKey(), e);
+                            LOG.error("While deleting object {}", model.getObject().getKey(), e);
                         }
                         ((BasePage) getPage()).getFeedbackPanel().refresh(target);
                     }
@@ -241,7 +243,7 @@ public class AnyObjectSearchResultPanel<T extends AnyTO> extends AbstractSearchR
         }
 
         @Override
-        protected WizardMgtPanel<AnyObjectTO> newInstance(final String parentId) {
+        protected WizardMgtPanel<AnyHandler<AnyObjectTO>> newInstance(final String parentId) {
             return new AnyObjectSearchResultPanel<>(
                     type, parentId, filtered, fiql, pageRef, restClient, anyTypeClassTOs, realm, type + "_LIST");
         }

http://git-wip-us.apache.org/repos/asf/syncope/blob/0d5ba39a/client/console/src/main/java/org/apache/syncope/client/console/panels/GroupSearchResultPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/GroupSearchResultPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/GroupSearchResultPanel.java
index 86ccb13..eb692f8 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/GroupSearchResultPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/GroupSearchResultPanel.java
@@ -36,6 +36,8 @@ import org.apache.syncope.client.console.wicket.markup.html.form.ActionLink.Acti
 import org.apache.syncope.client.console.wicket.markup.html.form.ActionLinksPanel;
 import org.apache.syncope.client.console.wizards.AjaxWizard;
 import org.apache.syncope.client.console.wizards.WizardMgtPanel;
+import org.apache.syncope.client.console.wizards.any.AnyHandler;
+import org.apache.syncope.client.console.wizards.any.GroupHandler;
 import org.apache.syncope.common.lib.SyncopeClientException;
 import org.apache.syncope.common.lib.to.AnyTO;
 import org.apache.syncope.common.lib.to.AnyTypeClassTO;
@@ -122,7 +124,8 @@ public final class GroupSearchResultPanel extends AnyObjectSearchResultPanel<Gro
                     @Override
                     public void onClick(final AjaxRequestTarget target, final GroupTO anyTO) {
                         send(GroupSearchResultPanel.this, Broadcast.EXACT,
-                                new AjaxWizard.EditItemActionEvent<AnyTO>(model.getObject(), target));
+                                new AjaxWizard.EditItemActionEvent<GroupHandler>(
+                                        new GroupHandler(model.getObject()), target));
                     }
                 }, ActionLink.ActionType.EDIT, entitlement).add(new ActionLink<GroupTO>() {
 
@@ -136,7 +139,7 @@ public final class GroupSearchResultPanel extends AnyObjectSearchResultPanel<Gro
                             target.add(container);
                         } catch (SyncopeClientException e) {
                             error(getString(Constants.ERROR) + ": " + e.getMessage());
-                            LOG.error("While deleting object {}", anyTO.getKey(), e);
+                            LOG.error("While deleting object {}", model.getObject().getKey(), e);
                         }
                         ((BasePage) getPage()).getFeedbackPanel().refresh(target);
 
@@ -243,7 +246,7 @@ public final class GroupSearchResultPanel extends AnyObjectSearchResultPanel<Gro
         }
 
         @Override
-        protected WizardMgtPanel<GroupTO> newInstance(final String parentId) {
+        protected WizardMgtPanel<AnyHandler<GroupTO>> newInstance(final String parentId) {
             return new GroupSearchResultPanel(
                     type, parentId, filtered, fiql, pageRef, restClient, anyTypeClassTOs, realm,
                     StandardEntitlement.GROUP_SEARCH);

http://git-wip-us.apache.org/repos/asf/syncope/blob/0d5ba39a/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 be47039..69e69d7 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
@@ -232,8 +232,11 @@ public abstract class ListViewPanel<T extends Serializable> extends WizardMgtPan
 
         private boolean reuseItem = true;
 
+        private final Class<T> reference;
+
         public Builder(final Class<T> reference, final PageReference pageRef) {
-            super(reference, pageRef);
+            super(pageRef);
+            this.reference = reference;
             this.items = null;
             this.actions = ActionLinksPanel.<T>builder(pageRef);
         }
@@ -358,7 +361,7 @@ public abstract class ListViewPanel<T extends Serializable> extends WizardMgtPan
 
             final T item = ((AjaxWizard.NewItemEvent<T>) event.getPayload()).getItem();
             final AjaxRequestTarget target = ((AjaxWizard.NewItemEvent<T>) event.getPayload()).getTarget();
-            
+
             if (event.getPayload() instanceof AjaxWizard.NewItemFinishEvent) {
                 if (item != null && !this.listOfItems.contains(item)) {
                     this.listOfItems.add(item);

http://git-wip-us.apache.org/repos/asf/syncope/blob/0d5ba39a/client/console/src/main/java/org/apache/syncope/client/console/panels/UserSearchResultPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/UserSearchResultPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/UserSearchResultPanel.java
index 3e7ce11..7bc12b3 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/UserSearchResultPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/UserSearchResultPanel.java
@@ -38,6 +38,7 @@ import org.apache.syncope.client.console.wicket.markup.html.form.ActionLink.Acti
 import org.apache.syncope.client.console.wicket.markup.html.form.ActionLinksPanel;
 import org.apache.syncope.client.console.wizards.AjaxWizard;
 import org.apache.syncope.client.console.wizards.WizardMgtPanel;
+import org.apache.syncope.client.console.wizards.any.AnyHandler;
 import org.apache.syncope.common.lib.SyncopeClientException;
 import org.apache.syncope.common.lib.to.AnyTO;
 import org.apache.syncope.common.lib.to.AnyTypeClassTO;
@@ -126,14 +127,16 @@ public final class UserSearchResultPanel extends AnyObjectSearchResultPanel<User
                     private static final long serialVersionUID = -7978723352517770644L;
 
                     @Override
-                    public void onClick(final AjaxRequestTarget target, final UserTO anyTO) {
-                        final IModel<UserTO> model = new CompoundPropertyModel<>(anyTO);
-                        modal.setFormModel(model);
+                    public void onClick(final AjaxRequestTarget target, final UserTO ignore) {
+                        final IModel<AnyHandler<UserTO>> formModel
+                                = new CompoundPropertyModel<>(new AnyHandler<UserTO>(model.getObject()));
+                        modal.setFormModel(formModel);
 
-                        target.add(modal.
-                                setContent(new StatusModal<>(modal, page.getPageReference(), model.getObject())));
+                        target.add(modal.setContent(new StatusModal<>(
+                                modal, page.getPageReference(), formModel.getObject().getInnerObject())));
 
-                        modal.header(new Model<>(MessageFormat.format(getString("any.edit"), anyTO.getKey())));
+                        modal.header(new Model<>(MessageFormat.format(
+                                getString("any.edit"), model.getObject().getKey())));
                         modal.show(true);
                     }
                 }, ActionLink.ActionType.MANAGE_RESOURCES, StandardEntitlement.USER_LIST).add(new ActionLink<UserTO>() {
@@ -141,14 +144,16 @@ public final class UserSearchResultPanel extends AnyObjectSearchResultPanel<User
                     private static final long serialVersionUID = -7978723352517770644L;
 
                     @Override
-                    public void onClick(final AjaxRequestTarget target, final UserTO anyTO) {
-                        final IModel<UserTO> model = new CompoundPropertyModel<>(anyTO);
-                        modal.setFormModel(model);
+                    public void onClick(final AjaxRequestTarget target, final UserTO ignore) {
+                        final IModel<AnyHandler<UserTO>> formModel
+                                = new CompoundPropertyModel<>(new AnyHandler<UserTO>(model.getObject()));
+                        modal.setFormModel(formModel);
 
-                        target.add(modal.setContent(new StatusModal<>(modal, page.getPageReference(), model.getObject(),
-                                true)));
+                        target.add(modal.setContent(new StatusModal<>(
+                                modal, page.getPageReference(), formModel.getObject().getInnerObject(), true)));
 
-                        modal.header(new Model<>(MessageFormat.format(getString("any.edit"), anyTO.getKey())));
+                        modal.header(new Model<>(MessageFormat.format(
+                                getString("any.edit"), model.getObject().getKey())));
                         modal.show(true);
                     }
                 }, ActionLink.ActionType.ENABLE, entitlement).add(new ActionLink<UserTO>() {
@@ -156,23 +161,24 @@ public final class UserSearchResultPanel extends AnyObjectSearchResultPanel<User
                     private static final long serialVersionUID = -7978723352517770644L;
 
                     @Override
-                    public void onClick(final AjaxRequestTarget target, final UserTO modelObject) {
+                    public void onClick(final AjaxRequestTarget target, final UserTO ignore) {
                         send(UserSearchResultPanel.this, Broadcast.EXACT,
-                                new AjaxWizard.EditItemActionEvent<AnyTO>(model.getObject(), target));
+                                new AjaxWizard.EditItemActionEvent<AnyHandler<UserTO>>(
+                                        new AnyHandler<UserTO>(model.getObject()), target));
                     }
                 }, ActionLink.ActionType.EDIT, entitlement).add(new ActionLink<UserTO>() {
 
                     private static final long serialVersionUID = -7978723352517770644L;
 
                     @Override
-                    public void onClick(final AjaxRequestTarget target, final UserTO anyTO) {
+                    public void onClick(final AjaxRequestTarget target, final UserTO ignore) {
                         try {
                             restClient.delete(model.getObject().getETagValue(), model.getObject().getKey());
                             info(getString(Constants.OPERATION_SUCCEEDED));
                             target.add(container);
                         } catch (SyncopeClientException e) {
                             error(getString(Constants.ERROR) + ": " + e.getMessage());
-                            LOG.error("While deleting object {}", anyTO.getKey(), e);
+                            LOG.error("While deleting object {}", model.getObject().getKey(), e);
                         }
                         ((BasePage) getPage()).getFeedbackPanel().refresh(target);
                     }
@@ -252,7 +258,7 @@ public final class UserSearchResultPanel extends AnyObjectSearchResultPanel<User
         }
 
         @Override
-        protected WizardMgtPanel<UserTO> newInstance(final String parentId) {
+        protected WizardMgtPanel<AnyHandler<UserTO>> newInstance(final String parentId) {
             return new UserSearchResultPanel(
                     type, parentId, filtered, fiql, pageRef, restClient, anyTypeClassTOs, realm,
                     StandardEntitlement.USER_LIST);

http://git-wip-us.apache.org/repos/asf/syncope/blob/0d5ba39a/client/console/src/main/java/org/apache/syncope/client/console/wizards/WizardMgtPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wizards/WizardMgtPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/wizards/WizardMgtPanel.java
index 5cf7513..dcf83bf 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/wizards/WizardMgtPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/wizards/WizardMgtPanel.java
@@ -183,15 +183,12 @@ public abstract class WizardMgtPanel<T extends Serializable> extends Panel imple
 
         protected final PageReference pageRef;
 
-        protected final Class<T> reference;
-
         private AjaxWizardBuilder<T> newItemPanelBuilder;
 
         private NotificationPanel notificationPanel;
 
-        protected Builder(final Class<T> reference, final PageReference pageRef) {
+        protected Builder(final PageReference pageRef) {
             this.pageRef = pageRef;
-            this.reference = reference;
         }
 
         protected abstract WizardMgtPanel<T> newInstance(final String id);

http://git-wip-us.apache.org/repos/asf/syncope/blob/0d5ba39a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/AnyHandler.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/AnyHandler.java b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/AnyHandler.java
new file mode 100644
index 0000000..4e1b13c
--- /dev/null
+++ b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/AnyHandler.java
@@ -0,0 +1,38 @@
+/*
+ * 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.any;
+
+import java.io.Serializable;
+import org.apache.syncope.common.lib.to.AnyTO;
+
+public class AnyHandler<T extends AnyTO> implements Serializable {
+
+    private static final long serialVersionUID = 8058288034211558375L;
+
+    protected final T anyTO;
+
+    public AnyHandler(final T anyTO) {
+        this.anyTO = anyTO;
+    }
+
+    public T getInnerObject() {
+        return anyTO;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/0d5ba39a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/AnyWizardBuilder.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/AnyWizardBuilder.java b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/AnyWizardBuilder.java
index 6ccf566..3c321dd 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/AnyWizardBuilder.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/AnyWizardBuilder.java
@@ -34,7 +34,8 @@ import org.apache.wicket.PageReference;
 import org.apache.wicket.extensions.wizard.WizardModel;
 import org.apache.wicket.model.util.ListModel;
 
-public class AnyWizardBuilder<T extends AnyTO> extends AjaxWizardBuilder<T> implements Serializable {
+public class AnyWizardBuilder<T extends AnyTO> extends AjaxWizardBuilder<AnyHandler<T>>
+        implements Serializable {
 
     private static final long serialVersionUID = -2480279868319546243L;
 
@@ -52,62 +53,85 @@ public class AnyWizardBuilder<T extends AnyTO> extends AjaxWizardBuilder<T> impl
      */
     public AnyWizardBuilder(
             final String id, final T anyTO, final List<String> anyTypeClasses, final PageReference pageRef) {
-        super(id, anyTO, pageRef);
+        super(id, new AnyHandler<T>(anyTO), pageRef);
+        this.anyTypeClasses = anyTypeClasses;
+    }
+
+    /**
+     * Construct.
+     *
+     * @param id The component id
+     * @param handler any handler
+     * @param anyTypeClasses any type classes
+     * @param pageRef Caller page reference.
+     */
+    public AnyWizardBuilder(
+            final String id,
+            final AnyHandler<T> handler,
+            final List<String> anyTypeClasses,
+            final PageReference pageRef) {
+        super(id, handler, pageRef);
         this.anyTypeClasses = anyTypeClasses;
     }
 
     @Override
-    protected WizardModel buildModelSteps(final T modelObject, final WizardModel wizardModel) {
+    protected WizardModel buildModelSteps(final AnyHandler<T> modelObject, final WizardModel wizardModel) {
         final String[] clazzes = anyTypeClasses.toArray(new String[] {});
         // optional details panel step
         addOptionalDetailsPanel(modelObject, wizardModel);
 
-        wizardModel.add(new AuxClasses(modelObject, clazzes));
+        wizardModel.add(new AuxClasses(modelObject.getInnerObject(), clazzes));
 
         // attributes panel steps
-        wizardModel.add(new PlainAttrs(modelObject, null, Mode.ADMIN, clazzes));
-        wizardModel.add(new DerAttrs(modelObject, clazzes));
-        wizardModel.add(new VirAttrs(modelObject, clazzes));
+        wizardModel.add(new PlainAttrs(modelObject.getInnerObject(), null, Mode.ADMIN, clazzes));
+        wizardModel.add(new DerAttrs(modelObject.getInnerObject(), clazzes));
+        wizardModel.add(new VirAttrs(modelObject.getInnerObject(), clazzes));
 
         // role panel step (jst available for users)
-        if ((this instanceof UserWizardBuilder) && (modelObject instanceof UserTO)) {
-            wizardModel.add(new Roles(UserTO.class.cast(modelObject)));
+        if ((this instanceof UserWizardBuilder) && (modelObject.getInnerObject() instanceof UserTO)) {
+            wizardModel.add(new Roles(UserTO.class.cast(modelObject.getInnerObject())));
         }
 
         // resource panel step
-        wizardModel.add(new Resources(modelObject));
+        wizardModel.add(new Resources(modelObject.getInnerObject()));
         return wizardModel;
     }
 
     @Override
-    protected void onCancelInternal(final T modelObject) {
+    protected void onCancelInternal(final AnyHandler<T> modelObject) {
         // do nothing
     }
 
     @Override
-    protected void onApplyInternal(final T modelObject) {
-        if (!(modelObject instanceof AnyObjectTO)) {
+    protected void onApplyInternal(final AnyHandler<T> modelObject) {
+        final T obj = modelObject.getInnerObject();
+
+        if (!(obj instanceof AnyObjectTO)) {
             throw new IllegalArgumentException();
         }
 
         final ProvisioningResult<AnyObjectTO> actual;
 
-        if (modelObject.getKey() == 0) {
-            actual = anyTypeRestClient.create(AnyObjectTO.class.cast(modelObject));
+        if (obj.getKey() == 0) {
+            actual = anyTypeRestClient.create(AnyObjectTO.class.cast(obj));
         } else {
-            final AnyObjectPatch patch = AnyOperations.diff(modelObject, getOriginalItem(), true);
+            final AnyObjectPatch patch = AnyOperations.diff(obj, getOriginalItem().getInnerObject(), true);
 
             // update user just if it is changed
             if (!patch.isEmpty()) {
-                actual = anyTypeRestClient.update(getOriginalItem().getETagValue(), patch);
+                actual = anyTypeRestClient.update(getOriginalItem().getInnerObject().getETagValue(), patch);
             }
         }
     }
 
-    protected AnyWizardBuilder<T> addOptionalDetailsPanel(final T modelObject, final WizardModel wizardModel) {
-        if (modelObject.getKey() > 0) {
-            wizardModel.add(
-                    new Details<T>(modelObject, new ListModel<>(Collections.<StatusBean>emptyList()), pageRef, true));
+    protected AnyWizardBuilder<T> addOptionalDetailsPanel(
+            final AnyHandler<T> modelObject, final WizardModel wizardModel) {
+        if (modelObject.getInnerObject().getKey() > 0) {
+            wizardModel.add(new Details<T>(
+                    modelObject,
+                    new ListModel<>(Collections.<StatusBean>emptyList()),
+                    pageRef,
+                    true));
         }
         return this;
     }

http://git-wip-us.apache.org/repos/asf/syncope/blob/0d5ba39a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/AuxClasses.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/AuxClasses.java b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/AuxClasses.java
index e90be42..4f2beb0 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/AuxClasses.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/AuxClasses.java
@@ -89,56 +89,56 @@ public class AuxClasses extends WizardStep {
                         @Override
                         public MembershipTO getObject(
                                 final String id, final IModel<? extends List<? extends MembershipTO>> choices) {
-                                    for (MembershipTO membershipTO : choices.getObject()) {
-                                        if (id.equalsIgnoreCase(membershipTO.getGroupName())) {
-                                            return membershipTO;
-                                        }
-                                    }
-                                    return null;
+                            for (MembershipTO membershipTO : choices.getObject()) {
+                                if (id.equalsIgnoreCase(membershipTO.getGroupName())) {
+                                    return membershipTO;
                                 }
+                            }
+                            return null;
+                        }
                     });
 
             fragment.add(builder.setAllowOrder(true).withFilter().build(
                     "groups", new ListModel<MembershipTO>(memberships),
                     new AjaxPalettePanel.Builder.Query<MembershipTO>() {
 
-                        private static final long serialVersionUID = 1L;
+                private static final long serialVersionUID = 1L;
+
+                @Override
+                public List<MembershipTO> execute(final String filter) {
+                    return CollectionUtils.collect(
+                            groupRestClient.search(
+                                    entityTO.getRealm(),
+                                    SyncopeClient.getGroupSearchConditionBuilder().
+                                    isAssignable().and().is("name").equalTo(filter).query(),
+                                    -1, -1,
+                                    new SortParam<>("name", true),
+                                    null),
+                            new Transformer<GroupTO, MembershipTO>() {
 
                         @Override
-                        public List<MembershipTO> execute(final String filter) {
-                            return CollectionUtils.collect(
-                                    groupRestClient.search(
-                                            entityTO.getRealm(),
-                                            SyncopeClient.getGroupSearchConditionBuilder().
-                                            isAssignable().and().is("name").equalTo(filter).query(),
-                                            -1, -1,
-                                            new SortParam<>("name", true),
-                                            null),
-                                    new Transformer<GroupTO, MembershipTO>() {
-
-                                        @Override
-                                        public MembershipTO transform(final GroupTO input) {
-                                            final MembershipTO membershipTO = new MembershipTO();
-                                            membershipTO.setGroupName(input.getName());
-                                            membershipTO.setRightKey(input.getKey());
-                                            membershipTO.setRightType(input.getType());
-                                            membershipTO.setLeftKey(entityTO.getKey());
-                                            membershipTO.setLeftType(entityTO.getType());
-                                            return membershipTO;
-                                        }
-                                    }, new ArrayList<MembershipTO>());
+                        public MembershipTO transform(final GroupTO input) {
+                            final MembershipTO membershipTO = new MembershipTO();
+                            membershipTO.setGroupName(input.getName());
+                            membershipTO.setRightKey(input.getKey());
+                            membershipTO.setRightType(input.getType());
+                            membershipTO.setLeftKey(entityTO.getKey());
+                            membershipTO.setLeftType(entityTO.getType());
+                            return membershipTO;
                         }
-                    }).setOutputMarkupId(true));
+                    }, new ArrayList<MembershipTO>());
+                }
+            }).setOutputMarkupId(true));
 
             final ArrayList<String> dynamics = CollectionUtils.collect(dyngroups,
                     new Transformer<Long, String>() {
 
-                        @Override
-                        public String transform(final Long input) {
-                            final GroupTO groupTO = groupRestClient.read(input);
-                            return String.format("[%d] %s", groupTO.getKey(), groupTO.getName());
-                        }
-                    }, new ArrayList<String>());
+                @Override
+                public String transform(final Long input) {
+                    final GroupTO groupTO = groupRestClient.read(input);
+                    return String.format("[%d] %s", groupTO.getKey(), groupTO.getName());
+                }
+            }, new ArrayList<String>());
 
             fragment.add(new AjaxPalettePanel.Builder<String>().setAllowOrder(true).build(
                     "dyngroups",

http://git-wip-us.apache.org/repos/asf/syncope/blob/0d5ba39a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/Details.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/Details.java b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/Details.java
index 974d3dd..bb588e5 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/Details.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/Details.java
@@ -34,12 +34,14 @@ public class Details<T extends AnyTO> extends WizardStep {
     protected final StatusPanel statusPanel;
 
     public Details(
-            final T anyTO,
+            final AnyHandler<T> handler,
             final IModel<List<StatusBean>> statusModel,
             final PageReference pageRef,
             final boolean includeStatusPanel) {
         this.pageRef = pageRef;
 
+        T anyTO = handler.getInnerObject();
+
         statusPanel = new StatusPanel("status", anyTO, statusModel, pageRef);
 
         add(statusPanel.setEnabled(includeStatusPanel).

http://git-wip-us.apache.org/repos/asf/syncope/blob/0d5ba39a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/GroupDetails.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/GroupDetails.java b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/GroupDetails.java
index 9705fc4..6b3d7f1 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/GroupDetails.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/GroupDetails.java
@@ -80,12 +80,14 @@ public class GroupDetails extends Details<GroupTO> {
     private final OwnerModel gOwnerModel;
 
     public GroupDetails(
-            final GroupTO groupTO,
+            final GroupHandler groupHandler,
             final IModel<List<StatusBean>> statusModel,
             final boolean templateMode,
             final PageReference pageRef,
             final boolean includeStatusPanel) {
-        super(groupTO, statusModel, pageRef, includeStatusPanel);
+        super(groupHandler, statusModel, pageRef, includeStatusPanel);
+
+        final GroupTO groupTO = GroupHandler.class.cast(groupHandler).getInnerObject();
 
         final LoadableDetachableModel<List<AnyTypeTO>> types = new LoadableDetachableModel<List<AnyTypeTO>>() {
 
@@ -220,10 +222,10 @@ public class GroupDetails extends Details<GroupTO> {
 
             @Override
             public Panel getPanel(final String panelId) {
-                return new UserSearchPanel.Builder(new PropertyModel<List<SearchClause>>(groupTO, "uDynClauses")).
+                return new UserSearchPanel.Builder(new PropertyModel<List<SearchClause>>(groupHandler, "uDynClauses")).
                         required(false).build(panelId);
             }
-        }), Model.of(StringUtils.isBlank(groupTO.getUDynMembershipCond()) ? -1 : 0)).setOutputMarkupId(true));
+        }), Model.of(StringUtils.isBlank(groupHandler.getUDynMembershipCond()) ? -1 : 0)).setOutputMarkupId(true));
         // ------------------------ 
 
         // ------------------------
@@ -245,11 +247,10 @@ public class GroupDetails extends Details<GroupTO> {
                     @Override
                     public Panel getPanel(final String panelId) {
                         return new AnyObjectSearchPanel.Builder(
-                                new MapOfListModel<SearchClause>(groupTO, "aDynClauses",
-                                        item.getModelObject().getKey())).
+                                new MapOfListModel<SearchClause>(groupHandler, "aDynClauses", key)).
                                 required(false).build(panelId);
                     }
-                }), Model.of(StringUtils.isBlank(groupTO.getADynMembershipConds().get(key)) ? -1 : 0))
+                }), Model.of(StringUtils.isBlank(groupHandler.getADynMembershipConds().get(key)) ? -1 : 0))
                         .setOutputMarkupId(true));
             }
         });

http://git-wip-us.apache.org/repos/asf/syncope/blob/0d5ba39a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/GroupHandler.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/GroupHandler.java b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/GroupHandler.java
new file mode 100644
index 0000000..0afba05
--- /dev/null
+++ b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/GroupHandler.java
@@ -0,0 +1,99 @@
+/*
+ * 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.any;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import org.apache.commons.collections4.CollectionUtils;
+import org.apache.syncope.client.console.panels.search.SearchClause;
+import org.apache.syncope.client.console.panels.search.SearchUtils;
+import org.apache.syncope.client.lib.SyncopeClient;
+import org.apache.syncope.common.lib.search.AbstractFiqlSearchConditionBuilder;
+import org.apache.syncope.common.lib.to.GroupTO;
+
+public class GroupHandler extends AnyHandler<GroupTO> {
+
+    private static final long serialVersionUID = 8058288034211558376L;
+
+    private List<SearchClause> uDynClauses;
+
+    private Map<String, List<SearchClause>> aDynClauses;
+
+    public GroupHandler(final GroupTO anyTO) {
+        super(anyTO);
+    }
+
+    public List<SearchClause> getUDynClauses() {
+        if (this.uDynClauses == null) {
+            this.uDynClauses = SearchUtils.getSearchClauses(this.anyTO.getUDynMembershipCond());
+        }
+        return this.uDynClauses;
+    }
+
+    public void setUDynClauses(final List<SearchClause> uDynClauses) {
+        this.uDynClauses = uDynClauses;
+    }
+
+    public Map<String, List<SearchClause>> getADynClauses() {
+        if (this.aDynClauses == null) {
+            this.aDynClauses = SearchUtils.getSearchClauses(this.anyTO.getADynMembershipConds());
+        }
+        return this.aDynClauses;
+    }
+
+    public void setADynClauses(final Map<String, List<SearchClause>> aDynClauses) {
+        this.aDynClauses = aDynClauses;
+    }
+
+    public String getUDynMembershipCond() {
+        if (CollectionUtils.isEmpty(this.uDynClauses)) {
+            return this.anyTO.getUDynMembershipCond();
+        } else {
+            return getFIQLString(this.uDynClauses, SyncopeClient.getUserSearchConditionBuilder());
+        }
+    }
+
+    public Map<String, String> getADynMembershipConds() {
+        if (this.aDynClauses == null || this.aDynClauses.isEmpty()) {
+            return this.anyTO.getADynMembershipConds();
+        } else {
+            final Map<String, String> res = new HashMap<>();
+
+            for (Map.Entry<String, List<SearchClause>> entry : this.aDynClauses.entrySet()) {
+                if (CollectionUtils.isNotEmpty(entry.getValue())) {
+                    res.put(entry.getKey(), getFIQLString(entry.getValue(),
+                            SyncopeClient.getAnyObjectSearchConditionBuilder(entry.getKey())));
+                }
+            }
+
+            return res;
+        }
+    }
+
+    private String getFIQLString(final List<SearchClause> clauses, final AbstractFiqlSearchConditionBuilder bld) {
+        return SearchUtils.buildFIQL(clauses, bld);
+    }
+
+    public GroupTO fillDynamicConditions() {
+        this.anyTO.setUDynMembershipCond(this.getUDynMembershipCond());
+        this.anyTO.getADynMembershipConds().putAll(this.getADynMembershipConds());
+        return this.anyTO;
+    }
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/0d5ba39a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/GroupWizardBuilder.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/GroupWizardBuilder.java b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/GroupWizardBuilder.java
index f0f0760..43b5f73 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/GroupWizardBuilder.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/GroupWizardBuilder.java
@@ -16,25 +16,17 @@
 package org.apache.syncope.client.console.wizards.any;
 
 import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
-import org.apache.commons.collections4.CollectionUtils;
 import org.apache.syncope.client.console.commons.status.StatusBean;
-import org.apache.syncope.client.console.panels.search.SearchClause;
-import org.apache.syncope.client.console.panels.search.SearchUtils;
 import org.apache.syncope.client.console.rest.GroupRestClient;
 import org.apache.syncope.client.console.wizards.AjaxWizardBuilder;
-import org.apache.syncope.client.lib.SyncopeClient;
 import org.apache.syncope.common.lib.AnyOperations;
 import org.apache.syncope.common.lib.patch.GroupPatch;
-import org.apache.syncope.common.lib.search.AbstractFiqlSearchConditionBuilder;
 import org.apache.syncope.common.lib.to.GroupTO;
 import org.apache.syncope.common.lib.to.ProvisioningResult;
 import org.apache.wicket.PageReference;
 import org.apache.wicket.extensions.wizard.WizardModel;
 import org.apache.wicket.model.util.ListModel;
-import org.springframework.beans.BeanUtils;
 
 public class GroupWizardBuilder extends AnyWizardBuilder<GroupTO> {
 
@@ -52,7 +44,7 @@ public class GroupWizardBuilder extends AnyWizardBuilder<GroupTO> {
      */
     public GroupWizardBuilder(
             final String id, final GroupTO groupTO, final List<String> anyTypeClasses, final PageReference pageRef) {
-        super(id, groupTO, anyTypeClasses, pageRef);
+        super(id, new GroupHandler(groupTO), anyTypeClasses, pageRef);
     }
 
     /**
@@ -63,107 +55,36 @@ public class GroupWizardBuilder extends AnyWizardBuilder<GroupTO> {
      * @return the current builder.
      */
     @Override
-    public AjaxWizardBuilder<GroupTO> setItem(final GroupTO item) {
-        final GroupTO actual = new GroupHandler();
-        BeanUtils.copyProperties(item == null ? getDefaultItem() : item, actual);
-        return super.setItem(actual);
+    public AjaxWizardBuilder<AnyHandler<GroupTO>> setItem(final AnyHandler<GroupTO> item) {
+        return item == null ? super.setItem(item) : super.setItem(new GroupHandler(item.getInnerObject()));
     }
 
     @Override
-    protected void onApplyInternal(final GroupTO modelObject) {
+    protected void onApplyInternal(final AnyHandler<GroupTO> modelObject) {
         final ProvisioningResult<GroupTO> actual;
 
         GroupTO toBeProcessed = modelObject instanceof GroupHandler
-                ? GroupHandler.class.cast(modelObject).toGroupTO()
-                : modelObject;
+                ? GroupHandler.class.cast(modelObject).fillDynamicConditions()
+                : modelObject.getInnerObject();
 
-        if (modelObject.getKey() == 0) {
+        if (toBeProcessed.getKey() == 0) {
             actual = groupRestClient.create(toBeProcessed);
         } else {
-            final GroupPatch patch = AnyOperations.diff(toBeProcessed, getOriginalItem(), true);
-
+            final GroupPatch patch = AnyOperations.diff(toBeProcessed, getOriginalItem().getInnerObject(), true);
             // update user just if it is changed
             if (!patch.isEmpty()) {
-                actual = groupRestClient.update(getOriginalItem().getETagValue(), patch);
+                actual = groupRestClient.update(getOriginalItem().getInnerObject().getETagValue(), patch);
             }
         }
     }
 
     @Override
-    protected GroupWizardBuilder addOptionalDetailsPanel(final GroupTO modelObject, final WizardModel wizardModel) {
-        wizardModel.add(new GroupDetails(modelObject,
-                new ListModel<>(Collections.<StatusBean>emptyList()), false, pageRef, modelObject.getKey() > 0));
+    protected GroupWizardBuilder addOptionalDetailsPanel(
+            final AnyHandler<GroupTO> modelObject, final WizardModel wizardModel) {
+        wizardModel.add(new GroupDetails(
+                GroupHandler.class.cast(modelObject),
+                new ListModel<>(Collections.<StatusBean>emptyList()),
+                false, pageRef, modelObject.getInnerObject().getKey() > 0));
         return this;
     }
-
-    /**
-     * Class tprovided to handle asychronous FIQL string translations.
-     */
-    public static class GroupHandler extends GroupTO {
-
-        private static final long serialVersionUID = 8058288034211558375L;
-
-        private List<SearchClause> uDynClauses;
-
-        private Map<String, List<SearchClause>> aDynClauses;
-
-        public List<SearchClause> getUDynClauses() {
-            if (this.uDynClauses == null) {
-                this.uDynClauses = SearchUtils.getSearchClauses(super.getUDynMembershipCond());
-            }
-            return this.uDynClauses;
-        }
-
-        public void setUDynClauses(final List<SearchClause> uDynClauses) {
-            this.uDynClauses = uDynClauses;
-        }
-
-        public Map<String, List<SearchClause>> getADynClauses() {
-            if (this.aDynClauses == null) {
-                this.aDynClauses = SearchUtils.getSearchClauses(super.getADynMembershipConds());
-            }
-            return this.aDynClauses;
-        }
-
-        public void setADynClauses(final Map<String, List<SearchClause>> aDynClauses) {
-            this.aDynClauses = aDynClauses;
-        }
-
-        @Override
-        public String getUDynMembershipCond() {
-            if (CollectionUtils.isEmpty(this.uDynClauses)) {
-                return super.getUDynMembershipCond();
-            } else {
-                return getFIQLString(this.uDynClauses, SyncopeClient.getUserSearchConditionBuilder());
-            }
-        }
-
-        @Override
-        public Map<String, String> getADynMembershipConds() {
-            if (this.aDynClauses == null || this.aDynClauses.isEmpty()) {
-                return super.getADynMembershipConds();
-            } else {
-                final Map<String, String> res = new HashMap<>();
-
-                for (Map.Entry<String, List<SearchClause>> entry : this.aDynClauses.entrySet()) {
-                    res.put(entry.getKey(), getFIQLString(entry.getValue(),
-                            SyncopeClient.getAnyObjectSearchConditionBuilder(entry.getKey())));
-                }
-
-                return res;
-            }
-        }
-
-        private String getFIQLString(final List<SearchClause> clauses, final AbstractFiqlSearchConditionBuilder bld) {
-            return SearchUtils.buildFIQL(clauses, bld);
-        }
-
-        public GroupTO toGroupTO() {
-            final GroupTO res = new GroupTO();
-            BeanUtils.copyProperties(this, res, "uDynClauses", "aDynClauses");
-            res.setUDynMembershipCond(this.getUDynMembershipCond());
-            res.getADynMembershipConds().putAll(this.getADynMembershipConds());
-            return res;
-        }
-    }
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/0d5ba39a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/UserDetails.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/UserDetails.java b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/UserDetails.java
index 9a6239a..ef1ea05 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/UserDetails.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/UserDetails.java
@@ -48,13 +48,15 @@ public class UserDetails extends Details<UserTO> {
     private static final String PASSWORD_CONTENT_PATH = "body:content";
 
     public UserDetails(
-            final UserTO userTO,
+            final AnyHandler<UserTO> handler,
             final IModel<List<StatusBean>> statusModel,
             final boolean resetPassword,
             final boolean templateMode,
             final PageReference pageRef,
             final boolean includeStatusPanel) {
-        super(userTO, statusModel, pageRef, includeStatusPanel);
+        super(handler, statusModel, pageRef, includeStatusPanel);
+
+        final UserTO userTO = handler.getInnerObject();
         // ------------------------
         // Username
         // ------------------------
@@ -82,15 +84,15 @@ public class UserDetails extends Details<UserTO> {
         final Collapsible collapsible = new Collapsible("collapsePanel", Collections.<ITab>singletonList(
                 new AbstractTab(new ResourceModel("password.change", "Change password")) {
 
-                    private static final long serialVersionUID = 1037272333056449378L;
+            private static final long serialVersionUID = 1037272333056449378L;
 
-                    @Override
-                    public Panel getPanel(final String panelId) {
-                        final PasswordPanel panel = new PasswordPanel(panelId, userTO, resetPassword, templateMode);
-                        panel.setEnabled(model.getObject() >= 0);
-                        return panel;
-                    }
-                }
+            @Override
+            public Panel getPanel(final String panelId) {
+                final PasswordPanel panel = new PasswordPanel(panelId, userTO, resetPassword, templateMode);
+                panel.setEnabled(model.getObject() >= 0);
+                return panel;
+            }
+        }
         ), model) {
 
             private static final long serialVersionUID = 1L;

http://git-wip-us.apache.org/repos/asf/syncope/blob/0d5ba39a/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 6f9097e..28245b9 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
@@ -47,33 +47,40 @@ public class UserWizardBuilder extends AnyWizardBuilder<UserTO> {
      * @param pageRef Caller page reference.
      */
     public UserWizardBuilder(
-            final String id, final UserTO userTO, final List<String> anyTypeClasses, final PageReference pageRef) {
+            final String id,
+            final UserTO userTO,
+            final List<String> anyTypeClasses,
+            final PageReference pageRef) {
         super(id, userTO, anyTypeClasses, pageRef);
         statusModel = new ListModel<>(new ArrayList<StatusBean>());
     }
 
     @Override
-    protected void onApplyInternal(final UserTO modelObject) {
+    protected void onApplyInternal(final AnyHandler<UserTO> modelObject) {
         final ProvisioningResult<UserTO> actual;
 
-        if (modelObject.getKey() == 0) {
-            actual = userRestClient.create(modelObject, StringUtils.isNotBlank(modelObject.getPassword()));
+        final UserTO inner = modelObject.getInnerObject();
+
+        if (inner.getKey() == 0) {
+            actual = userRestClient.create(inner, StringUtils.isNotBlank(inner.getPassword()));
         } else {
-            final UserPatch patch = AnyOperations.diff(modelObject, getOriginalItem(), false);
+            final UserPatch patch = AnyOperations.diff(inner, getOriginalItem().getInnerObject(), false);
             if (!statusModel.getObject().isEmpty()) {
-                patch.setPassword(StatusUtils.buildPasswordPatch(modelObject.getPassword(), statusModel.getObject()));
+                patch.setPassword(StatusUtils.buildPasswordPatch(inner.getPassword(), statusModel.getObject()));
             }
 
             // update user just if it is changed
             if (!patch.isEmpty()) {
-                actual = userRestClient.update(getOriginalItem().getETagValue(), patch);
+                actual = userRestClient.update(getOriginalItem().getInnerObject().getETagValue(), patch);
             }
         }
     }
 
     @Override
-    protected UserWizardBuilder addOptionalDetailsPanel(final UserTO modelObject, final WizardModel wizardModel) {
-        wizardModel.add(new UserDetails(modelObject, statusModel, false, false, pageRef, modelObject.getKey() > 0));
+    protected UserWizardBuilder addOptionalDetailsPanel(
+            final AnyHandler<UserTO> modelObject, final WizardModel wizardModel) {
+        wizardModel.add(new UserDetails(
+                modelObject, statusModel, false, false, pageRef, modelObject.getInnerObject().getKey() > 0));
         return this;
     }
 
@@ -84,7 +91,7 @@ public class UserWizardBuilder extends AnyWizardBuilder<UserTO> {
      * @return the current wizard.
      */
     @Override
-    public UserWizardBuilder setItem(final UserTO item) {
+    public UserWizardBuilder setItem(final AnyHandler<UserTO> item) {
         super.setItem(item);
         statusModel.getObject().clear();
         return this;

http://git-wip-us.apache.org/repos/asf/syncope/blob/0d5ba39a/client/console/src/main/resources/org/apache/syncope/client/console/panels/AbstractSearchResultPanel.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/panels/AbstractSearchResultPanel.properties b/client/console/src/main/resources/org/apache/syncope/client/console/panels/AbstractSearchResultPanel.properties
index 05b5945..db9e17e 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/panels/AbstractSearchResultPanel.properties
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/panels/AbstractSearchResultPanel.properties
@@ -29,6 +29,6 @@ creationDate=Creation Date
 tokenValued=Valued
 tokenNotValued=Not valued
 
-any.edit=Edit ${type} ${key}
-any.new=New ${type}
+any.edit=Edit ${anyTO.type} ${anyTO.key}
+any.new=New ${anyTO.type}
 any.attr.display=Attributes to be displayed


Mime
View raw message