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] providing wizard step to add resources to ANY
Date Thu, 19 Nov 2015 11:18:29 GMT
Repository: syncope
Updated Branches:
  refs/heads/master 1ffc62e57 -> 6ea34cd36


[SYNCOPE-156] providing wizard step to add resources to ANY


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

Branch: refs/heads/master
Commit: 6ea34cd36a4943537abf65eee1a94ef3982679b5
Parents: 1ffc62e
Author: fmartelli <fabio.martelli@gmail.com>
Authored: Thu Nov 19 12:17:52 2015 +0100
Committer: fmartelli <fabio.martelli@gmail.com>
Committed: Thu Nov 19 12:17:52 2015 +0100

----------------------------------------------------------------------
 .../client/console/commons/AnyDataProvider.java |   4 +-
 .../panels/AbstractSearchResultPanel.java       |   8 +-
 .../panels/AnyObjectSearchResultPanel.java      | 250 +++++++++++++++++++
 .../console/panels/AnySearchResultPanel.java    | 250 -------------------
 .../console/panels/GroupSearchResultPanel.java  |   2 +-
 .../syncope/client/console/panels/Realm.java    |   2 +-
 .../console/panels/UserSearchResultPanel.java   |   2 +-
 .../client/console/rest/UserRestClient.java     |   6 +-
 .../markup/html/form/AjaxPalettePanel.java      |   2 +-
 .../console/wizards/any/AnyWizardBuilder.java   |  12 +-
 .../client/console/wizards/any/AuxClasses.java  |   5 +-
 .../client/console/wizards/any/Resources.java   |  67 +++++
 .../console/wizards/any/UserWizardBuilder.java  |   1 -
 .../client/console/wizards/any/Resources.html   |  26 ++
 14 files changed, 361 insertions(+), 276 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/6ea34cd3/client/console/src/main/java/org/apache/syncope/client/console/commons/AnyDataProvider.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/commons/AnyDataProvider.java
b/client/console/src/main/java/org/apache/syncope/client/console/commons/AnyDataProvider.java
index 6a2d226..f36d3c5 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/commons/AnyDataProvider.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/commons/AnyDataProvider.java
@@ -95,9 +95,7 @@ public class AnyDataProvider<T extends AnyTO> extends SortableDataProvider<T,
St
         long result;
 
         if (filtered) {
-            result = fiql == null
-                    ? 0
-                    : restClient.searchCount(realm, fiql, type);
+            result = fiql == null ? 0 : restClient.searchCount(realm, fiql, type);
         } else {
             result = restClient.count(type, realm);
         }

http://git-wip-us.apache.org/repos/asf/syncope/blob/6ea34cd3/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 4907f77..9c534d0 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
@@ -191,10 +191,7 @@ public abstract class AbstractSearchResultPanel<T extends AnyTO>
extends WizardM
         dataProvider.setFIQL(fiql);
 
         final int currentPage = resultTable != null
-                ? (create
-                        ? (int) resultTable.getPageCount() - 1
-                        : (int) resultTable.getCurrentPage())
-                : 0;
+                ? (create ? (int) resultTable.getPageCount() - 1 : (int) resultTable.getCurrentPage())
: 0;
 
         resultTable = new AjaxDataTablePanel<>(
                 "resultTable",
@@ -303,8 +300,7 @@ public abstract class AbstractSearchResultPanel<T extends AnyTO>
extends WizardM
 
         /**
          * Specify if results are about a filtered search or not. Using this attribute it
is possible to use this panel
-         * to
-         * show results about user list and user search.
+         * to show results about user list and user search.
          */
         protected final boolean filtered;
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/6ea34cd3/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
new file mode 100644
index 0000000..0d9c7ed
--- /dev/null
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/AnyObjectSearchResultPanel.java
@@ -0,0 +1,250 @@
+/*
+ * 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.panels;
+
+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.Collection;
+import java.util.Date;
+import java.util.List;
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.pages.AnyDisplayAttributesModalPage;
+import org.apache.syncope.client.console.pages.BasePage;
+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.ActionColumn;
+import org.apache.syncope.client.console.wicket.extensions.markup.html.repeater.data.table.AttrColumn;
+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.common.lib.SyncopeClientException;
+import org.apache.syncope.common.lib.to.AnyTO;
+import org.apache.syncope.common.lib.to.AnyTypeClassTO;
+import org.apache.syncope.common.lib.to.AnyObjectTO;
+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.markup.html.basic.Label;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.ResourceModel;
+import org.springframework.util.ReflectionUtils;
+
+public class AnyObjectSearchResultPanel<T extends AnyTO> extends AbstractSearchResultPanel<T>
{
+
+    private static final long serialVersionUID = -1100228004207271270L;
+
+    protected final SchemaRestClient schemaRestClient = new SchemaRestClient();
+
+    protected final List<String> schemaNames;
+
+    protected final List<String> dSchemaNames;
+
+    protected final String pageID = "Any";
+
+    protected final String entitlement;
+
+    protected AnyObjectSearchResultPanel(
+            final String type,
+            final String parentId,
+            final boolean filtered,
+            final String fiql,
+            final PageReference callerRef,
+            final AbstractAnyRestClient<T> restClient,
+            final List<AnyTypeClassTO> anyTypeClassTOs,
+            final String realm,
+            final String entitlement) {
+
+        super(parentId, filtered, fiql, callerRef, restClient, realm, type);
+        modal.size(Modal.Size.Large);
+
+        this.entitlement = entitlement;
+
+        add(new Label("name", type));
+
+        this.schemaNames = new ArrayList<>();
+        for (AnyTypeClassTO anyTypeClassTO : anyTypeClassTOs) {
+            this.schemaNames.addAll(anyTypeClassTO.getPlainSchemas());
+        }
+        this.dSchemaNames = new ArrayList<>();
+        for (AnyTypeClassTO anyTypeClassTO : anyTypeClassTOs) {
+            this.dSchemaNames.addAll(anyTypeClassTO.getDerSchemas());
+        }
+
+        initResultTable();
+    }
+
+    @Override
+    protected List<IColumn<T, String>> getColumns() {
+        final List<IColumn<T, String>> columns = new ArrayList<>();
+
+        for (String name : prefMan.getList(getRequest(), Constants.PREF_ANY_DETAILS_VIEW))
{
+            final Field field = ReflectionUtils.findField(AnyObjectTO.class, name);
+
+            if ("token".equalsIgnoreCase(name)) {
+                columns.add(new PropertyColumn<T, String>(new ResourceModel(name, name),
name, name));
+            } else if (field != null && field.getType().equals(Date.class)) {
+                columns.add(new PropertyColumn<T, String>(new ResourceModel(name, name),
name, name));
+            } else {
+                columns.add(new PropertyColumn<T, String>(new ResourceModel(name, name),
name, name));
+            }
+        }
+
+        for (String name : prefMan.getList(getRequest(), Constants.PREF_ANY_ATTRIBUTES_VIEW))
{
+            if (schemaNames.contains(name)) {
+                columns.add(new AttrColumn<T>(name, SchemaType.PLAIN));
+            }
+        }
+
+        for (String name : prefMan.getList(getRequest(), Constants.PREF_ANY_DERIVED_ATTRIBUTES_VIEW))
{
+            if (dSchemaNames.contains(name)) {
+                columns.add(new AttrColumn<T>(name, SchemaType.DERIVED));
+            }
+        }
+
+        // Add defaults in case of no selection
+        if (columns.isEmpty()) {
+            for (String name : AnyDisplayAttributesModalPage.ANY_DEFAULT_SELECTION) {
+                columns.add(new PropertyColumn<T, String>(new ResourceModel(name, name),
name, name));
+            }
+
+        }
+
+        columns.add(new ActionColumn<T, String>(new ResourceModel("actions", "")) {
+
+            private static final long serialVersionUID = -3503023501954863131L;
+
+            @Override
+            public ActionLinksPanel<T> getActions(final String componentId, final IModel<T>
model) {
+                final ActionLinksPanel.Builder<T> panel = ActionLinksPanel.builder(page.getPageReference());
+
+                panel.add(new ActionLink<T>() {
+
+                    private static final long serialVersionUID = -7978723352517770644L;
+
+                    @Override
+                    public void onClick(final AjaxRequestTarget target, final AnyTO anyTO)
{
+                        send(AnyObjectSearchResultPanel.this, Broadcast.EXACT,
+                                new AjaxWizard.EditItemActionEvent<>(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) {
+                        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);
+                        }
+                        ((BasePage) getPage()).getFeedbackPanel().refresh(target);
+                    }
+                }, ActionLink.ActionType.DELETE, entitlement);
+
+                return panel.build(componentId, model.getObject());
+            }
+
+            @Override
+            public ActionLinksPanel<Serializable> getHeader(final String componentId)
{
+                final ActionLinksPanel.Builder<Serializable> panel = ActionLinksPanel.builder(page.getPageReference());
+
+                panel.add(new ActionLink<Serializable>() {
+
+                    private static final long serialVersionUID = -7978723352517770644L;
+
+                    @Override
+                    public void onClick(final AjaxRequestTarget target, final Serializable
ignore) {
+                        // still missing content
+                        target.add(modal.setContent(new AnyDisplayAttributesModalPage<>(
+                                modal, page.getPageReference(), schemaNames, dSchemaNames)));
+
+                        modal.header(new ResourceModel("any.attr.display", ""));
+                        modal.show(true);
+                    }
+                }, ActionLink.ActionType.CHANGE_VIEW, entitlement).add(new ActionLink<Serializable>()
{
+
+                    private static final long serialVersionUID = -7978723352517770644L;
+
+                    @Override
+                    public void onClick(final AjaxRequestTarget target, final Serializable
ignore) {
+                        if (target != null) {
+                            target.add(container);
+                        }
+                    }
+                }, ActionLink.ActionType.RELOAD, entitlement);
+
+                return panel.build(componentId);
+            }
+        });
+
+        return columns;
+    }
+
+    @Override
+    protected <T extends AnyTO> Collection<ActionLink.ActionType> getBulkActions()
{
+        final List<ActionLink.ActionType> bulkActions = new ArrayList<>();
+
+        bulkActions.add(ActionLink.ActionType.DELETE);
+        bulkActions.add(ActionLink.ActionType.SUSPEND);
+        bulkActions.add(ActionLink.ActionType.REACTIVATE);
+
+        return bulkActions;
+    }
+
+    @Override
+    protected String getPageId() {
+        return pageID;
+    }
+
+    public static final class Builder extends AbstractSearchResultPanel.Builder<AnyObjectTO>
{
+
+        private static final long serialVersionUID = -6828423611982275640L;
+
+        private final List<AnyTypeClassTO> anyTypeClassTOs;
+
+        public Builder(
+                final boolean filtered,
+                final String fiql,
+                final PageReference pageRef,
+                final AbstractAnyRestClient<AnyObjectTO> restClient,
+                final List<AnyTypeClassTO> anyTypeClassTOs,
+                final String realm,
+                final String type) {
+
+            super(AnyObjectTO.class, filtered, fiql, pageRef, restClient, realm, type);
+            this.anyTypeClassTOs = anyTypeClassTOs;
+        }
+
+        @Override
+        protected WizardMgtPanel<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/6ea34cd3/client/console/src/main/java/org/apache/syncope/client/console/panels/AnySearchResultPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/AnySearchResultPanel.java
b/client/console/src/main/java/org/apache/syncope/client/console/panels/AnySearchResultPanel.java
deleted file mode 100644
index 77ca759..0000000
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/AnySearchResultPanel.java
+++ /dev/null
@@ -1,250 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.syncope.client.console.panels;
-
-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.Collection;
-import java.util.Date;
-import java.util.List;
-import org.apache.syncope.client.console.commons.Constants;
-import org.apache.syncope.client.console.pages.AnyDisplayAttributesModalPage;
-import org.apache.syncope.client.console.pages.BasePage;
-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.ActionColumn;
-import org.apache.syncope.client.console.wicket.extensions.markup.html.repeater.data.table.AttrColumn;
-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.common.lib.SyncopeClientException;
-import org.apache.syncope.common.lib.to.AnyTO;
-import org.apache.syncope.common.lib.to.AnyTypeClassTO;
-import org.apache.syncope.common.lib.to.AnyObjectTO;
-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.markup.html.basic.Label;
-import org.apache.wicket.model.IModel;
-import org.apache.wicket.model.ResourceModel;
-import org.springframework.util.ReflectionUtils;
-
-public class AnySearchResultPanel<T extends AnyTO> extends AbstractSearchResultPanel<T>
{
-
-    private static final long serialVersionUID = -1100228004207271270L;
-
-    protected final SchemaRestClient schemaRestClient = new SchemaRestClient();
-
-    protected final List<String> schemaNames;
-
-    protected final List<String> dSchemaNames;
-
-    protected final String pageID = "Any";
-
-    protected final String entitlement;
-
-    protected AnySearchResultPanel(
-            final String type,
-            final String parentId,
-            final boolean filtered,
-            final String fiql,
-            final PageReference callerRef,
-            final AbstractAnyRestClient<T> restClient,
-            final List<AnyTypeClassTO> anyTypeClassTOs,
-            final String realm,
-            final String entitlement) {
-
-        super(parentId, filtered, fiql, callerRef, restClient, realm, type);
-        modal.size(Modal.Size.Large);
-
-        this.entitlement = entitlement;
-
-        add(new Label("name", type));
-
-        this.schemaNames = new ArrayList<>();
-        for (AnyTypeClassTO anyTypeClassTO : anyTypeClassTOs) {
-            this.schemaNames.addAll(anyTypeClassTO.getPlainSchemas());
-        }
-        this.dSchemaNames = new ArrayList<>();
-        for (AnyTypeClassTO anyTypeClassTO : anyTypeClassTOs) {
-            this.dSchemaNames.addAll(anyTypeClassTO.getDerSchemas());
-        }
-
-        initResultTable();
-    }
-
-    @Override
-    protected List<IColumn<T, String>> getColumns() {
-        final List<IColumn<T, String>> columns = new ArrayList<>();
-
-        for (String name : prefMan.getList(getRequest(), Constants.PREF_ANY_DETAILS_VIEW))
{
-            final Field field = ReflectionUtils.findField(AnyObjectTO.class, name);
-
-            if ("token".equalsIgnoreCase(name)) {
-                columns.add(new PropertyColumn<T, String>(new ResourceModel(name, name),
name, name));
-            } else if (field != null && field.getType().equals(Date.class)) {
-                columns.add(new PropertyColumn<T, String>(new ResourceModel(name, name),
name, name));
-            } else {
-                columns.add(new PropertyColumn<T, String>(new ResourceModel(name, name),
name, name));
-            }
-        }
-
-        for (String name : prefMan.getList(getRequest(), Constants.PREF_ANY_ATTRIBUTES_VIEW))
{
-            if (schemaNames.contains(name)) {
-                columns.add(new AttrColumn<T>(name, SchemaType.PLAIN));
-            }
-        }
-
-        for (String name : prefMan.getList(getRequest(), Constants.PREF_ANY_DERIVED_ATTRIBUTES_VIEW))
{
-            if (dSchemaNames.contains(name)) {
-                columns.add(new AttrColumn<T>(name, SchemaType.DERIVED));
-            }
-        }
-
-        // Add defaults in case of no selection
-        if (columns.isEmpty()) {
-            for (String name : AnyDisplayAttributesModalPage.ANY_DEFAULT_SELECTION) {
-                columns.add(new PropertyColumn<T, String>(new ResourceModel(name, name),
name, name));
-            }
-
-        }
-
-        columns.add(new ActionColumn<T, String>(new ResourceModel("actions", "")) {
-
-            private static final long serialVersionUID = -3503023501954863131L;
-
-            @Override
-            public ActionLinksPanel<T> getActions(final String componentId, final IModel<T>
model) {
-                final ActionLinksPanel.Builder<T> panel = ActionLinksPanel.builder(page.getPageReference());
-
-                panel.add(new ActionLink<T>() {
-
-                    private static final long serialVersionUID = -7978723352517770644L;
-
-                    @Override
-                    public void onClick(final AjaxRequestTarget target, final AnyTO anyTO)
{
-                        send(AnySearchResultPanel.this, Broadcast.EXACT,
-                                new AjaxWizard.EditItemActionEvent<>(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) {
-                        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);
-                        }
-                        ((BasePage) getPage()).getFeedbackPanel().refresh(target);
-                    }
-                }, ActionLink.ActionType.DELETE, entitlement);
-
-                return panel.build(componentId, model.getObject());
-            }
-
-            @Override
-            public ActionLinksPanel<Serializable> getHeader(final String componentId)
{
-                final ActionLinksPanel.Builder<Serializable> panel = ActionLinksPanel.builder(page.getPageReference());
-
-                panel.add(new ActionLink<Serializable>() {
-
-                    private static final long serialVersionUID = -7978723352517770644L;
-
-                    @Override
-                    public void onClick(final AjaxRequestTarget target, final Serializable
ignore) {
-                        // still missing content
-                        target.add(modal.setContent(new AnyDisplayAttributesModalPage<>(
-                                modal, page.getPageReference(), schemaNames, dSchemaNames)));
-
-                        modal.header(new ResourceModel("any.attr.display", ""));
-                        modal.show(true);
-                    }
-                }, ActionLink.ActionType.CHANGE_VIEW, entitlement).add(new ActionLink<Serializable>()
{
-
-                    private static final long serialVersionUID = -7978723352517770644L;
-
-                    @Override
-                    public void onClick(final AjaxRequestTarget target, final Serializable
ignore) {
-                        if (target != null) {
-                            target.add(container);
-                        }
-                    }
-                }, ActionLink.ActionType.RELOAD, entitlement);
-
-                return panel.build(componentId);
-            }
-        });
-
-        return columns;
-    }
-
-    @Override
-    protected <T extends AnyTO> Collection<ActionLink.ActionType> getBulkActions()
{
-        final List<ActionLink.ActionType> bulkActions = new ArrayList<>();
-
-        bulkActions.add(ActionLink.ActionType.DELETE);
-        bulkActions.add(ActionLink.ActionType.SUSPEND);
-        bulkActions.add(ActionLink.ActionType.REACTIVATE);
-
-        return bulkActions;
-    }
-
-    @Override
-    protected String getPageId() {
-        return pageID;
-    }
-
-    public static final class Builder extends AbstractSearchResultPanel.Builder<AnyObjectTO>
{
-
-        private static final long serialVersionUID = -6828423611982275640L;
-
-        private final List<AnyTypeClassTO> anyTypeClassTOs;
-
-        public Builder(
-                final boolean filtered,
-                final String fiql,
-                final PageReference pageRef,
-                final AbstractAnyRestClient<AnyObjectTO> restClient,
-                final List<AnyTypeClassTO> anyTypeClassTOs,
-                final String realm,
-                final String type) {
-
-            super(AnyObjectTO.class, filtered, fiql, pageRef, restClient, realm, type);
-            this.anyTypeClassTOs = anyTypeClassTOs;
-        }
-
-        @Override
-        protected WizardMgtPanel<AnyObjectTO> newInstance(final String parentId) {
-            return new AnySearchResultPanel<>(
-                    type, parentId, filtered, fiql, pageRef, restClient, anyTypeClassTOs,
realm, type + "_LIST");
-        }
-
-    }
-}

http://git-wip-us.apache.org/repos/asf/syncope/blob/6ea34cd3/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 186e766..86ccb13 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
@@ -51,7 +51,7 @@ import org.apache.wicket.model.IModel;
 import org.apache.wicket.model.ResourceModel;
 import org.springframework.util.ReflectionUtils;
 
-public final class GroupSearchResultPanel extends AnySearchResultPanel<GroupTO> {
+public final class GroupSearchResultPanel extends AnyObjectSearchResultPanel<GroupTO>
{
 
     private static final long serialVersionUID = -1100228004207271270L;
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/6ea34cd3/client/console/src/main/java/org/apache/syncope/client/console/panels/Realm.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/Realm.java
b/client/console/src/main/java/org/apache/syncope/client/console/panels/Realm.java
index edf35ee..626bcaa 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/Realm.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/Realm.java
@@ -143,7 +143,7 @@ public class Realm extends Panel {
                 final AnyObjectTO anyObjectTO = new AnyObjectTO();
                 anyObjectTO.setRealm(realmTO.getFullPath());
                 anyObjectTO.setType(anyTypeTO.getKey());
-                panel = new AnySearchResultPanel.Builder(
+                panel = new AnyObjectSearchResultPanel.Builder(
                         false, null, pageReference, anyObjectRestClient,
                         anyTypeRestClient.getAnyTypeClass(anyTypeTO.getClasses().toArray(new
String[] {})),
                         realmTO.getFullPath(),

http://git-wip-us.apache.org/repos/asf/syncope/blob/6ea34cd3/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 1fd3289..3e7ce11 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
@@ -55,7 +55,7 @@ import org.apache.wicket.model.Model;
 import org.apache.wicket.model.ResourceModel;
 import org.springframework.util.ReflectionUtils;
 
-public final class UserSearchResultPanel extends AnySearchResultPanel<UserTO> {
+public final class UserSearchResultPanel extends AnyObjectSearchResultPanel<UserTO>
{
 
     private static final long serialVersionUID = -1100228004207271270L;
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/6ea34cd3/client/console/src/main/java/org/apache/syncope/client/console/rest/UserRestClient.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/rest/UserRestClient.java
b/client/console/src/main/java/org/apache/syncope/client/console/rest/UserRestClient.java
index 8fb4a6e..dd79b3a 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/rest/UserRestClient.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/rest/UserRestClient.java
@@ -65,8 +65,7 @@ public class UserRestClient extends AbstractAnyRestClient<UserTO>
{
             final String type) {
         return getService(UserService.class).
                 list(SyncopeClient.getAnyListQueryBuilder().realm(realm).page(page).size(size).
-                        orderBy(toOrderBy(sort)).details(false).build()).
-                getResult();
+                        orderBy(toOrderBy(sort)).details(false).build()).getResult();
     }
 
     public ProvisioningResult<UserTO> create(final UserTO userTO, final boolean storePassword)
{
@@ -115,8 +114,7 @@ public class UserRestClient extends AbstractAnyRestClient<UserTO>
{
 
         return getService(UserService.class).
                 search(SyncopeClient.getAnySearchQueryBuilder().realm(realm).fiql(fiql).page(page).size(size).
-                        orderBy(toOrderBy(sort)).details(false).build()).
-                getResult();
+                        orderBy(toOrderBy(sort)).details(false).build()).getResult();
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/syncope/blob/6ea34cd3/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/AjaxPalettePanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/AjaxPalettePanel.java
b/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/AjaxPalettePanel.java
index 97866e3..bb86e7f 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/AjaxPalettePanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/AjaxPalettePanel.java
@@ -51,7 +51,7 @@ public class AjaxPalettePanel<T> extends AbstractFieldPanel<List<T>>
{
         setOutputMarkupId(true);
     }
 
-    protected Palette<T> createPalette(final IModel<List<T>> model, final
ListModel<T> choices,
+    protected final Palette<T> createPalette(final IModel<List<T>> model,
final ListModel<T> choices,
             final IChoiceRenderer<T> renderer, final boolean allowOrder, final boolean
allowMoveAll) {
 
         return new NonI18nPalette<>("paletteField", model, choices, renderer, 8, allowOrder,
allowMoveAll);

http://git-wip-us.apache.org/repos/asf/syncope/blob/6ea34cd3/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 a722223..92ae247 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
@@ -16,8 +16,10 @@
 package org.apache.syncope.client.console.wizards.any;
 
 import java.io.Serializable;
+
 import java.util.Collections;
 import java.util.List;
+
 import org.apache.syncope.client.console.commons.Mode;
 import org.apache.syncope.client.console.commons.status.StatusBean;
 import org.apache.syncope.client.console.rest.AnyTypeRestClient;
@@ -55,11 +57,13 @@ public class AnyWizardBuilder<T extends AnyTO> extends AjaxWizardBuilder<T>
impl
 
     @Override
     protected WizardModel buildModelSteps(final T modelObject, final WizardModel wizardModel)
{
+        final String[] clazzes = anyTypeClasses.toArray(new String[] {});
         addOptionalDetailsPanel(modelObject, wizardModel);
-        wizardModel.add(new AuxClasses(modelObject, anyTypeClasses.toArray(new String[] {})));
-        wizardModel.add(new PlainAttrs(modelObject, null, Mode.ADMIN, anyTypeClasses.toArray(new
String[] {})));
-        wizardModel.add(new DerAttrs(modelObject, anyTypeClasses.toArray(new String[] {})));
-        wizardModel.add(new VirAttrs(modelObject, anyTypeClasses.toArray(new String[] {})));
+        wizardModel.add(new AuxClasses(modelObject, clazzes));
+        wizardModel.add(new PlainAttrs(modelObject, null, Mode.ADMIN, clazzes));
+        wizardModel.add(new DerAttrs(modelObject, clazzes));
+        wizardModel.add(new VirAttrs(modelObject, clazzes));
+        wizardModel.add(new Resources(modelObject));
         return wizardModel;
     }
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/6ea34cd3/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 a33df7c..c30ad98 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
@@ -34,11 +34,8 @@ public class AuxClasses extends WizardStep {
 
     private static final long serialVersionUID = 552437609667518888L;
 
-    private final AnyTO entityTO;
-
     public <T extends AnyTO> AuxClasses(final T entityTO, final String... anyTypeClass)
{
         this.setOutputMarkupId(true);
-        this.entityTO = entityTO;
 
         final AnyTypeClassService service = SyncopeConsoleSession.get().getService(AnyTypeClassService.class);
 
@@ -53,7 +50,7 @@ public class AuxClasses extends WizardStep {
 
         add(new AjaxPalettePanel<>(
                 "auxClasses",
-                new PropertyModel<List<String>>(this.entityTO, "auxClasses"),
+                new PropertyModel<List<String>>(entityTO, "auxClasses"),
                 new ListModel<>(choices),
                 true).setOutputMarkupId(true));
     }

http://git-wip-us.apache.org/repos/asf/syncope/blob/6ea34cd3/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/Resources.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/Resources.java
b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/Resources.java
new file mode 100644
index 0000000..194bbce
--- /dev/null
+++ b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/Resources.java
@@ -0,0 +1,67 @@
+/*
+ * 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.ArrayList;
+import java.util.List;
+import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.collections4.Transformer;
+import org.apache.syncope.client.console.SyncopeConsoleSession;
+import org.apache.syncope.client.console.wicket.markup.html.form.AjaxPalettePanel;
+import org.apache.syncope.common.lib.to.AnyTO;
+import org.apache.syncope.common.lib.to.ResourceTO;
+import org.apache.syncope.common.rest.api.service.ResourceService;
+import org.apache.wicket.extensions.wizard.WizardStep;
+import org.apache.wicket.model.PropertyModel;
+import org.apache.wicket.model.util.ListModel;
+
+public class Resources extends WizardStep {
+
+    private static final long serialVersionUID = 552437609667518888L;
+
+    public <T extends AnyTO> Resources(final T entityTO) {
+        this.setOutputMarkupId(true);
+
+        add(new AjaxPalettePanel<>("resources",
+                new PropertyModel<List<String>>(entityTO, "resources") {
+
+                    private static final long serialVersionUID = 1L;
+
+                    @Override
+                    public List<String> getObject() {
+                        return new ArrayList<>(entityTO.getResources());
+                    }
+
+                    @Override
+                    public void setObject(final List<String> object) {
+                        entityTO.getResources().clear();
+                        entityTO.getResources().addAll(object);
+                    }
+                },
+                new ListModel<>(CollectionUtils.collect(
+                                SyncopeConsoleSession.get().getService(ResourceService.class).list(),
+                                new Transformer<ResourceTO, String>() {
+
+                                    @Override
+                                    public String transform(final ResourceTO input) {
+                                        return input.getKey();
+                                    }
+                                }, new ArrayList<String>()))).setOutputMarkupId(true));
+    }
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/6ea34cd3/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 0e15e16..f18e6dd 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
@@ -60,7 +60,6 @@ public class UserWizardBuilder extends AnyWizardBuilder<UserTO> {
             actual = userRestClient.create(modelObject, StringUtils.isNotBlank(modelObject.getPassword()));
         } else {
             final UserPatch patch = AnyOperations.diff(modelObject, getOriginalItem(), true);
-
             if (!statusModel.getObject().isEmpty()) {
                 patch.setPassword(StatusUtils.buildPasswordPatch(modelObject.getPassword(),
statusModel.getObject()));
             }

http://git-wip-us.apache.org/repos/asf/syncope/blob/6ea34cd3/client/console/src/main/resources/org/apache/syncope/client/console/wizards/any/Resources.html
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/wizards/any/Resources.html
b/client/console/src/main/resources/org/apache/syncope/client/console/wizards/any/Resources.html
new file mode 100644
index 0000000..7ae16d6
--- /dev/null
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/wizards/any/Resources.html
@@ -0,0 +1,26 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
+  <head><title></title></head>
+  <body>
+    <wicket:panel>
+      <span wicket:id="resources">[RESOURCES]</span>
+    </wicket:panel>
+  </body>
+</html>
\ No newline at end of file


Mime
View raw message