You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by fm...@apache.org on 2015/12/16 18:16:09 UTC
syncope git commit: [SYNCOPE-156] providing user and group ownership
Repository: syncope
Updated Branches:
refs/heads/master dbc909278 -> 05478375f
[SYNCOPE-156] providing user and group ownership
Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/05478375
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/05478375
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/05478375
Branch: refs/heads/master
Commit: 05478375f5d286323e993e8057f95a272fed38c6
Parents: dbc9092
Author: fmartelli <fa...@gmail.com>
Authored: Wed Dec 16 18:15:51 2015 +0100
Committer: fmartelli <fa...@gmail.com>
Committed: Wed Dec 16 18:15:51 2015 +0100
----------------------------------------------------------------------
.../panels/AbstractSearchResultPanel.java | 97 +++++-----
.../console/panels/AjaxDataTablePanel.java | 141 +++++++++++---
.../panels/AnyObjectSearchResultPanel.java | 48 +++--
.../console/panels/GroupSearchResultPanel.java | 50 ++---
.../syncope/client/console/panels/Realm.java | 18 +-
.../console/panels/UserSearchResultPanel.java | 47 ++---
.../panels/search/AbstractSearchPanel.java | 15 +-
.../console/panels/search/GroupSearchPanel.java | 2 +-
.../search/GroupSelectionSearchResultPanel.java | 189 ++++++++++++++++++
.../panels/search/SearchClausePanel.java | 3 +-
.../console/panels/search/UserSearchPanel.java | 23 ---
.../search/UserSelectionSearchResultPanel.java | 191 +++++++++++++++++++
.../paging/AjaxDataNavigationToolbar.java | 6 +-
.../data/table/AjaxFallbackDataTable.java | 4 +-
.../console/wizards/any/AnyWizardBuilder.java | 2 +-
.../client/console/wizards/any/Ownership.java | 162 ++++++++++++++--
.../META-INF/resources/css/syncopeConsole.css | 6 +
.../markup/html/form/ActionLinksPanel.html | 2 +-
.../client/console/wizards/any/Ownership.html | 10 +-
.../syncope/common/lib/AnyOperations.java | 4 +-
20 files changed, 806 insertions(+), 214 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/syncope/blob/05478375/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 d3bdd34..35851ab 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
@@ -78,6 +78,8 @@ public abstract class AbstractSearchResultPanel<T extends AnyTO> extends WizardM
*/
private final boolean filtered;
+ private final boolean checkBoxEnabled;
+
/**
* Filter used in case of filtered search.
*/
@@ -108,26 +110,20 @@ public abstract class AbstractSearchResultPanel<T extends AnyTO> extends WizardM
*/
private final String type;
- protected AbstractSearchResultPanel(
- final String id,
- final boolean filtered,
- final String fiql,
- final PageReference pageRef,
- final AbstractAnyRestClient<T> restClient,
- final String realm,
- final String type) {
+ protected AbstractSearchResultPanel(final String id, final Builder<T> builder) {
- super(id, pageRef, true);
+ super(id, builder.getPageRef(), true);
setOutputMarkupId(true);
- this.page = (AbstractBasePage) pageRef.getPage();
+ this.page = (AbstractBasePage) builder.getPageRef().getPage();
- this.filtered = filtered;
- this.fiql = fiql;
+ this.filtered = builder.filtered;
+ this.checkBoxEnabled = builder.checkBoxEnabled;
+ this.fiql = builder.fiql;
this.feedbackPanel = page.getFeedbackPanel();
- this.restClient = restClient;
+ this.restClient = builder.restClient;
// Container for user search result
container = new WebMarkupContainer("searchContainer");
@@ -136,8 +132,8 @@ public abstract class AbstractSearchResultPanel<T extends AnyTO> extends WizardM
rows = prefMan.getPaginatorRows(getRequest(), Constants.PREF_USERS_PAGINATOR_ROWS);
- this.realm = realm;
- this.type = type;
+ this.realm = builder.realm;
+ this.type = builder.type;
setWindowClosedReloadCallback(modal);
}
@@ -194,22 +190,21 @@ public abstract class AbstractSearchResultPanel<T extends AnyTO> extends WizardM
final int currentPage = resultTable != null
? (create ? (int) resultTable.getPageCount() - 1 : (int) resultTable.getCurrentPage()) : 0;
- resultTable = new AjaxDataTablePanel<>(
- "resultTable",
- getColumns(),
- dataProvider,
- rows,
- getBulkActions(),
- restClient,
- "key",
- getPageId(),
- page.getPageReference(),
- container);
+ AjaxDataTablePanel.Builder<T, String> resultTableBuilder = new AjaxDataTablePanel.Builder<>(
+ dataProvider, getPageId(), page.getPageReference()).
+ setColumns(getColumns()).
+ setRowsPerPage(rows).
+ setBulkActions(getBulkActions(), restClient, "key").
+ setContainer(container);
- resultTable.setCurrentPage(currentPage);
+ if (!checkBoxEnabled) {
+ resultTableBuilder.disableCheckBoxes();
+ }
- resultTable.setOutputMarkupId(true);
+ resultTable = resultTableBuilder.build("resultTable");
+ resultTable.setCurrentPage(currentPage);
+ resultTable.setOutputMarkupId(true);
container.addOrReplace(resultTable);
}
@@ -300,44 +295,58 @@ public abstract class AbstractSearchResultPanel<T extends AnyTO> extends WizardM
private static final long serialVersionUID = 5088962796986706805L;
/**
- * 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.
+ * Specify if results are about a filtered search or not.
+ * By using this attribute it is possible to force this panel to show results about user list and user search.
*/
- protected final boolean filtered;
+ protected boolean filtered = false;
+
+ protected boolean checkBoxEnabled = true;
/**
* Filter used in case of filtered search.
*/
- protected final String fiql;
+ protected String fiql;
protected final AbstractAnyRestClient<T> restClient;
/**
* Realm related to current panel.
*/
- protected final String realm;
+ protected String realm = "/";
/**
* Any type related to current panel.
*/
protected final String type;
- protected Builder(
- final Class<T> reference,
- final boolean filtered,
- final String fiql,
- final PageReference pageRef,
- final AbstractAnyRestClient<T> restClient,
- final String realm,
- final String type) {
-
+ protected Builder(final AbstractAnyRestClient<T> restClient, final String type, final PageReference pageRef) {
super(pageRef);
+ this.restClient = restClient;
+ this.type = type;
+ }
+
+ public Builder<T> setFiltered(final boolean filtered) {
this.filtered = filtered;
+ return this;
+ }
+
+ public Builder<T> disableCheckBoxes() {
+ this.checkBoxEnabled = false;
+ return this;
+ }
+
+ public Builder<T> setFiql(final String fiql) {
this.fiql = fiql;
- this.restClient = restClient;
+ return this;
+ }
+
+ public Builder<T> setRealm(final String realm) {
this.realm = realm;
- this.type = type;
+ return this;
}
+ private PageReference getPageRef() {
+ return pageRef;
+ }
}
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/05478375/client/console/src/main/java/org/apache/syncope/client/console/panels/AjaxDataTablePanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/AjaxDataTablePanel.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/AjaxDataTablePanel.java
index e1dba17..fc653c1 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/AjaxDataTablePanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/AjaxDataTablePanel.java
@@ -18,6 +18,8 @@
*/
package org.apache.syncope.client.console.panels;
+import java.io.Serializable;
+import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import org.apache.syncope.client.console.rest.BaseRestClient;
@@ -43,21 +45,106 @@ import org.apache.wicket.markup.html.form.CheckGroup;
import org.apache.wicket.markup.html.form.Form;
import org.apache.wicket.markup.html.panel.Fragment;
-public class AjaxDataTablePanel<T, S> extends DataTablePanel<T, S> {
+public final class AjaxDataTablePanel<T, S> extends DataTablePanel<T, S> {
private static final long serialVersionUID = -7264400471578272966L;
- public AjaxDataTablePanel(
- final String id,
- final List<IColumn<T, S>> columns,
- final ISortableDataProvider<T, S> dataProvider,
- final int rowsPerPage,
- final Collection<ActionLink.ActionType> actions,
- final BaseRestClient bulkActionExecutor,
- final String itemKeyField,
- final String pageId,
- final PageReference pageRef,
- final WebMarkupContainer container) {
+ public static class Builder<T, S> implements Serializable {
+
+ private static final long serialVersionUID = 8876232177473972722L;
+
+ private boolean checkBoxEnabled = true;
+
+ private final List<IColumn<T, S>> columns = new ArrayList<>();
+
+ private final ISortableDataProvider<T, S> dataProvider;
+
+ private int rowsPerPage = 10;
+
+ private final Collection<ActionLink.ActionType> bulkActions = new ArrayList<>();
+
+ private BaseRestClient bulkActionExecutor;
+
+ private String itemKeyField;
+
+ private final String pageId;
+
+ private final PageReference pageRef;
+
+ private WebMarkupContainer container;
+
+ public Builder(final ISortableDataProvider<T, S> provider, final String pageId, final PageReference pageRef) {
+ this.dataProvider = provider;
+ this.pageId = pageId;
+ this.pageRef = pageRef;
+ }
+
+ public AjaxDataTablePanel<T, S> build(final String id) {
+ return new AjaxDataTablePanel<>(id, this);
+ }
+
+ public Builder<T, S> setContainer(final WebMarkupContainer container) {
+ this.container = container;
+ return this;
+ }
+
+ public Builder<T, S> addBulkAction(final ActionLink.ActionType actionType) {
+ bulkActions.add(actionType);
+ return this;
+ }
+
+ public Builder<T, S> setBulkActionExecutor(final BaseRestClient bulkActionExecutor) {
+ this.bulkActionExecutor = bulkActionExecutor;
+ return this;
+ }
+
+ public Builder<T, S> setItemKeyField(final String itemKeyField) {
+ this.itemKeyField = itemKeyField;
+ return this;
+ }
+
+ public Builder<T, S> setBulkActions(
+ final Collection<ActionLink.ActionType> bulkActions,
+ final BaseRestClient bulkActionExecutor,
+ final String itemKeyField) {
+ this.bulkActions.clear();
+ if (bulkActions != null) {
+ this.bulkActions.addAll(bulkActions);
+ }
+ this.bulkActionExecutor = bulkActionExecutor;
+ this.itemKeyField = itemKeyField;
+ return this;
+ }
+
+ public Builder<T, S> addColumn(final IColumn<T, S> column) {
+ columns.add(column);
+ return this;
+ }
+
+ public Builder<T, S> setColumns(final List<IColumn<T, S>> columns) {
+ this.columns.clear();
+ if (columns != null) {
+ this.columns.addAll(columns);
+ }
+ return this;
+ }
+
+ public Builder<T, S> setRowsPerPage(final int rowsPerPage) {
+ this.rowsPerPage = rowsPerPage;
+ return this;
+ }
+
+ public Builder<T, S> disableCheckBoxes() {
+ this.checkBoxEnabled = false;
+ return this;
+ }
+
+ private boolean isBulkEnabled() {
+ return checkBoxEnabled && bulkActionExecutor != null && !bulkActions.isEmpty();
+ }
+ }
+
+ private AjaxDataTablePanel(final String id, final Builder<T, S> builder) {
super(id);
@@ -72,11 +159,11 @@ public class AjaxDataTablePanel<T, S> extends DataTablePanel<T, S> {
public void onClose(final AjaxRequestTarget target) {
final EventDataWrapper data = new EventDataWrapper();
data.setTarget(target);
- data.setRows(rowsPerPage);
+ data.setRows(builder.rowsPerPage);
- send(pageRef.getPage(), Broadcast.BREADTH, data);
+ send(builder.pageRef.getPage(), Broadcast.BREADTH, data);
- final AbstractBasePage page = (AbstractBasePage) pageRef.getPage();
+ final AbstractBasePage page = (AbstractBasePage) builder.pageRef.getPage();
if (page.isModalResult()) {
// reset modal result
@@ -106,13 +193,17 @@ public class AjaxDataTablePanel<T, S> extends DataTablePanel<T, S> {
});
bulkActionForm.add(group);
- columns.add(0, new CheckGroupColumn<T, S>(group));
- dataTable = new AjaxFallbackDataTable<>("dataTable", columns, dataProvider, rowsPerPage, container);
+ if (builder.checkBoxEnabled) {
+ builder.columns.add(0, new CheckGroupColumn<T, S>(group));
+ }
+
+ dataTable = new AjaxFallbackDataTable<>(
+ "dataTable", builder.columns, builder.dataProvider, builder.rowsPerPage, builder.container);
dataTable.add(new AttributeModifier("class", "table table-bordered table-hover dataTable"));
group.add(dataTable);
- fragment.add(new ClearIndicatingAjaxButton("bulkActionLink", bulkActionForm, pageRef) {
+ fragment.add(new ClearIndicatingAjaxButton("bulkActionLink", bulkActionForm, builder.pageRef) {
private static final long serialVersionUID = 382302811235019988L;
@@ -120,16 +211,16 @@ public class AjaxDataTablePanel<T, S> extends DataTablePanel<T, S> {
protected void onSubmitInternal(final AjaxRequestTarget target, final Form<?> form) {
bulkModalWin.setContent(new BulkActionModalPage<>(
bulkModalWin,
- pageRef,
+ builder.pageRef,
group.getModelObject(),
- columns,
- actions,
- bulkActionExecutor,
- itemKeyField,
- pageId));
+ builder.columns,
+ builder.bulkActions,
+ builder.bulkActionExecutor,
+ builder.itemKeyField,
+ builder.pageId));
bulkModalWin.show(target);
}
- });
+ }.setEnabled(builder.isBulkEnabled()).setVisible(builder.isBulkEnabled()));
}
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/05478375/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 2bb56d7..271f848 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
@@ -67,29 +67,21 @@ public class AnyObjectSearchResultPanel<T extends AnyTO> extends AbstractSearchR
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);
+ final String id, final AbstractSearchResultPanel.Builder<T> builder, final String entitlement) {
+ super(id, builder);
+
modal.size(Modal.Size.Large);
this.entitlement = entitlement;
- add(new Label("name", type));
+ add(new Label("name", builder.type));
this.schemaNames = new ArrayList<>();
- for (AnyTypeClassTO anyTypeClassTO : anyTypeClassTOs) {
+ for (AnyTypeClassTO anyTypeClassTO : AnySearchResultPanelBuilder.class.cast(builder).getAnyTypeClassTOs()) {
this.schemaNames.addAll(anyTypeClassTO.getPlainSchemas());
}
this.dSchemaNames = new ArrayList<>();
- for (AnyTypeClassTO anyTypeClassTO : anyTypeClassTOs) {
+ for (AnyTypeClassTO anyTypeClassTO : AnySearchResultPanelBuilder.class.cast(builder).getAnyTypeClassTOs()) {
this.dSchemaNames.addAll(anyTypeClassTO.getDerSchemas());
}
@@ -223,30 +215,36 @@ public class AnyObjectSearchResultPanel<T extends AnyTO> extends AbstractSearchR
return pageID;
}
- public static final class Builder extends AbstractSearchResultPanel.Builder<AnyObjectTO> {
+ public interface AnySearchResultPanelBuilder extends Serializable {
+
+ List<AnyTypeClassTO> getAnyTypeClassTOs();
+ }
+
+ public static final class Builder extends AbstractSearchResultPanel.Builder<AnyObjectTO>
+ implements AnySearchResultPanelBuilder {
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) {
+ final AbstractAnyRestClient<AnyObjectTO> restClient,
+ final String type,
+ final PageReference pageRef) {
- super(AnyObjectTO.class, filtered, fiql, pageRef, restClient, realm, type);
+ super(restClient, type, pageRef);
this.anyTypeClassTOs = anyTypeClassTOs;
}
@Override
- protected WizardMgtPanel<AnyHandler<AnyObjectTO>> newInstance(final String parentId) {
- return new AnyObjectSearchResultPanel<>(
- type, parentId, filtered, fiql, pageRef, restClient, anyTypeClassTOs, realm, type + "_LIST");
+ protected WizardMgtPanel<AnyHandler<AnyObjectTO>> newInstance(final String id) {
+ return new AnyObjectSearchResultPanel<>(id, this, type + "_LIST");
}
+ @Override
+ public List<AnyTypeClassTO> getAnyTypeClassTOs() {
+ return this.anyTypeClassTOs;
+ }
}
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/05478375/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 eb692f8..ee76089 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
@@ -53,22 +53,12 @@ import org.apache.wicket.model.IModel;
import org.apache.wicket.model.ResourceModel;
import org.springframework.util.ReflectionUtils;
-public final class GroupSearchResultPanel extends AnyObjectSearchResultPanel<GroupTO> {
+public class GroupSearchResultPanel extends AnyObjectSearchResultPanel<GroupTO> {
private static final long serialVersionUID = -1100228004207271270L;
- private GroupSearchResultPanel(
- final String type,
- final String parentId,
- final boolean filtered,
- final String fiql,
- final PageReference callerRef,
- final AbstractAnyRestClient<GroupTO> restClient,
- final List<AnyTypeClassTO> anyTypeClassTOs,
- final String realm,
- final String entitlement) {
-
- super(type, parentId, filtered, fiql, callerRef, restClient, anyTypeClassTOs, realm, entitlement);
+ protected GroupSearchResultPanel(final String id, final Builder builder, final String entitlement) {
+ super(id, builder, entitlement);
}
@Override
@@ -177,7 +167,7 @@ public final class GroupSearchResultPanel extends AnyObjectSearchResultPanel<Gro
public ActionLinksPanel<Serializable> getHeader(final String componentId) {
final ActionLinksPanel.Builder<Serializable> panel = ActionLinksPanel.builder(page.getPageReference());
- panel.add(new ActionLink<Serializable>() {
+ return panel.add(new ActionLink<Serializable>() {
private static final long serialVersionUID = -7978723352517770644L;
@@ -189,9 +179,7 @@ public final class GroupSearchResultPanel extends AnyObjectSearchResultPanel<Gro
modal.header(new ResourceModel("any.attr.display", ""));
modal.show(true);
}
- }, ActionLink.ActionType.CHANGE_VIEW, entitlement);
-
- panel.add(new ActionLink<Serializable>() {
+ }, ActionLink.ActionType.CHANGE_VIEW, entitlement).add(new ActionLink<Serializable>() {
private static final long serialVersionUID = -7978723352517770644L;
@@ -201,9 +189,7 @@ public final class GroupSearchResultPanel extends AnyObjectSearchResultPanel<Gro
target.add(container);
}
}
- }, ActionLink.ActionType.RELOAD, entitlement);
-
- return panel.build(componentId);
+ }, ActionLink.ActionType.RELOAD, entitlement).build(componentId);
}
});
@@ -226,31 +212,31 @@ public final class GroupSearchResultPanel extends AnyObjectSearchResultPanel<Gro
return pageID;
}
- public static final class Builder extends AbstractSearchResultPanel.Builder<GroupTO> {
+ public static class Builder extends AbstractSearchResultPanel.Builder<GroupTO>
+ implements AnySearchResultPanelBuilder {
private static final long serialVersionUID = 1L;
private final List<AnyTypeClassTO> anyTypeClassTOs;
public Builder(
- final boolean filtered,
- final String fiql,
- final PageReference pageRef,
- final AbstractAnyRestClient<GroupTO> restClient,
final List<AnyTypeClassTO> anyTypeClassTOs,
- final String realm,
- final String type) {
+ final AbstractAnyRestClient<GroupTO> restClient,
+ final String type,
+ final PageReference pageRef) {
- super(GroupTO.class, filtered, fiql, pageRef, restClient, realm, type);
+ super(restClient, type, pageRef);
this.anyTypeClassTOs = anyTypeClassTOs;
}
@Override
- protected WizardMgtPanel<AnyHandler<GroupTO>> newInstance(final String parentId) {
- return new GroupSearchResultPanel(
- type, parentId, filtered, fiql, pageRef, restClient, anyTypeClassTOs, realm,
- StandardEntitlement.GROUP_SEARCH);
+ protected WizardMgtPanel<AnyHandler<GroupTO>> newInstance(final String id) {
+ return new GroupSearchResultPanel(id, this, StandardEntitlement.GROUP_SEARCH);
}
+ @Override
+ public List<AnyTypeClassTO> getAnyTypeClassTOs() {
+ return this.anyTypeClassTOs;
+ }
}
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/05478375/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 3eb8c5b..32ae031 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
@@ -117,10 +117,10 @@ public class Realm extends Panel {
final UserTO userTO = new UserTO();
userTO.setRealm(realmTO.getFullPath());
panel = new UserSearchResultPanel.Builder(
- false, null, pageReference, userRestClient,
anyTypeRestClient.getAnyTypeClass(anyTypeTO.getClasses().toArray(new String[] {})),
- realmTO.getFullPath(),
- anyTypeTO.getKey()).
+ userRestClient,
+ anyTypeTO.getKey(),
+ pageReference).setRealm(realmTO.getFullPath()).
addNewItemPanelBuilder(new UserWizardBuilder(
BaseModal.CONTENT_ID, userTO, anyTypeTO.getClasses(), pageRef)).
addNotificationPanel(BasePage.class.cast(this.pageRef.getPage()).getFeedbackPanel()).
@@ -130,10 +130,10 @@ public class Realm extends Panel {
final GroupTO groupTO = new GroupTO();
groupTO.setRealm(realmTO.getFullPath());
panel = new GroupSearchResultPanel.Builder(
- false, null, pageReference, groupRestClient,
anyTypeRestClient.getAnyTypeClass(anyTypeTO.getClasses().toArray(new String[] {})),
- realmTO.getFullPath(),
- anyTypeTO.getKey()).
+ groupRestClient,
+ anyTypeTO.getKey(),
+ pageReference).setRealm(realmTO.getFullPath()).
addNewItemPanelBuilder(new GroupWizardBuilder(
BaseModal.CONTENT_ID, groupTO, anyTypeTO.getClasses(), pageRef)).
addNotificationPanel(BasePage.class.cast(this.pageRef.getPage()).getFeedbackPanel()).
@@ -144,10 +144,10 @@ public class Realm extends Panel {
anyObjectTO.setRealm(realmTO.getFullPath());
anyObjectTO.setType(anyTypeTO.getKey());
panel = new AnyObjectSearchResultPanel.Builder(
- false, null, pageReference, anyObjectRestClient,
anyTypeRestClient.getAnyTypeClass(anyTypeTO.getClasses().toArray(new String[] {})),
- realmTO.getFullPath(),
- anyTypeTO.getKey()).
+ anyObjectRestClient,
+ anyTypeTO.getKey(),
+ pageReference).setRealm(realmTO.getFullPath()).
addNewItemPanelBuilder(new AnyWizardBuilder<AnyObjectTO>(
BaseModal.CONTENT_ID, anyObjectTO, anyTypeTO.getClasses(), pageRef)).
addNotificationPanel(BasePage.class.cast(this.pageRef.getPage()).getFeedbackPanel()).
http://git-wip-us.apache.org/repos/asf/syncope/blob/05478375/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 7bc12b3..29341a7 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
@@ -56,22 +56,12 @@ import org.apache.wicket.model.Model;
import org.apache.wicket.model.ResourceModel;
import org.springframework.util.ReflectionUtils;
-public final class UserSearchResultPanel extends AnyObjectSearchResultPanel<UserTO> {
+public class UserSearchResultPanel extends AnyObjectSearchResultPanel<UserTO> {
private static final long serialVersionUID = -1100228004207271270L;
- private UserSearchResultPanel(
- final String type,
- final String parentId,
- final boolean filtered,
- final String fiql,
- final PageReference callerRef,
- final AbstractAnyRestClient<UserTO> restClient,
- final List<AnyTypeClassTO> anyTypeClassTOs,
- final String realm,
- final String entitlement) {
-
- super(type, parentId, filtered, fiql, callerRef, restClient, anyTypeClassTOs, realm, entitlement);
+ protected UserSearchResultPanel(final String id, final Builder builder, final String entitlement) {
+ super(id, builder, entitlement);
}
@Override
@@ -191,7 +181,7 @@ public final class UserSearchResultPanel extends AnyObjectSearchResultPanel<User
public ActionLinksPanel<Serializable> getHeader(final String componentId) {
final ActionLinksPanel.Builder<Serializable> panel = ActionLinksPanel.builder(page.getPageReference());
- panel.add(new ActionLink<Serializable>() {
+ return panel.add(new ActionLink<Serializable>() {
private static final long serialVersionUID = -7978723352517770644L;
@@ -213,9 +203,7 @@ public final class UserSearchResultPanel extends AnyObjectSearchResultPanel<User
target.add(container);
}
}
- }, ActionLink.ActionType.RELOAD, entitlement);
-
- return panel.build(componentId);
+ }, ActionLink.ActionType.RELOAD, entitlement).build(componentId);
}
});
@@ -238,30 +226,31 @@ public final class UserSearchResultPanel extends AnyObjectSearchResultPanel<User
return pageID;
}
- public static final class Builder extends AbstractSearchResultPanel.Builder<UserTO> {
+ public static class Builder extends AbstractSearchResultPanel.Builder<UserTO>
+ implements AnySearchResultPanelBuilder {
private static final long serialVersionUID = 1L;
private final List<AnyTypeClassTO> anyTypeClassTOs;
public Builder(
- final boolean filtered,
- final String fiql,
- final PageReference pageRef,
- final AbstractAnyRestClient<UserTO> restClient,
final List<AnyTypeClassTO> anyTypeClassTOs,
- final String realm,
- final String type) {
+ final AbstractAnyRestClient<UserTO> restClient,
+ final String type,
+ final PageReference pageRef) {
- super(UserTO.class, filtered, fiql, pageRef, restClient, realm, type);
+ super(restClient, type, pageRef);
this.anyTypeClassTOs = anyTypeClassTOs;
}
@Override
- protected WizardMgtPanel<AnyHandler<UserTO>> newInstance(final String parentId) {
- return new UserSearchResultPanel(
- type, parentId, filtered, fiql, pageRef, restClient, anyTypeClassTOs, realm,
- StandardEntitlement.USER_LIST);
+ protected WizardMgtPanel<AnyHandler<UserTO>> newInstance(final String id) {
+ return new UserSearchResultPanel(id, this, StandardEntitlement.USER_LIST);
+ }
+
+ @Override
+ public List<AnyTypeClassTO> getAnyTypeClassTOs() {
+ return this.anyTypeClassTOs;
}
}
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/05478375/client/console/src/main/java/org/apache/syncope/client/console/panels/search/AbstractSearchPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/search/AbstractSearchPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/search/AbstractSearchPanel.java
index 9a8dad8..fae623a 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/search/AbstractSearchPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/search/AbstractSearchPanel.java
@@ -25,12 +25,15 @@ import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.Transformer;
import org.apache.commons.lang3.tuple.Pair;
import org.apache.syncope.client.console.panels.NotificationPanel;
+import org.apache.syncope.client.console.rest.AnyTypeRestClient;
import org.apache.syncope.client.console.rest.ResourceRestClient;
import org.apache.syncope.client.console.rest.SchemaRestClient;
import org.apache.syncope.client.console.wicket.markup.html.form.MultiFieldPanel;
import org.apache.syncope.common.lib.search.SearchableFields;
+import org.apache.syncope.common.lib.to.AbstractSchemaTO;
import org.apache.syncope.common.lib.to.ResourceTO;
import org.apache.syncope.common.lib.types.AnyTypeKind;
+import org.apache.syncope.common.lib.types.SchemaType;
import org.apache.wicket.feedback.FeedbackMessage;
import org.apache.wicket.feedback.IFeedbackMessageFilter;
import org.apache.wicket.markup.html.WebMarkupContainer;
@@ -50,6 +53,8 @@ public abstract class AbstractSearchPanel extends Panel {
*/
protected static final Logger LOG = LoggerFactory.getLogger(AbstractSearchPanel.class);
+ protected AnyTypeRestClient anyTypeRestClient = new AnyTypeRestClient();
+
protected SchemaRestClient schemaRestClient = new SchemaRestClient();
protected ResourceRestClient resourceRestClient = new ResourceRestClient();
@@ -180,7 +185,15 @@ public abstract class AbstractSearchPanel extends Panel {
@Override
protected List<String> load() {
- return schemaRestClient.getPlainSchemaNames();
+ return CollectionUtils.collect(schemaRestClient.getSchemas(SchemaType.PLAIN,
+ anyTypeRestClient.get(typeKind.name()).getClasses().toArray(new String[] {})),
+ new Transformer<AbstractSchemaTO, String>() {
+
+ @Override
+ public String transform(final AbstractSchemaTO input) {
+ return input.getKey();
+ }
+ }, new ArrayList<String>());
}
};
http://git-wip-us.apache.org/repos/asf/syncope/blob/05478375/client/console/src/main/java/org/apache/syncope/client/console/panels/search/GroupSearchPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/search/GroupSearchPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/search/GroupSearchPanel.java
index b151568..2e3de8f 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/search/GroupSearchPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/search/GroupSearchPanel.java
@@ -45,7 +45,7 @@ public final class GroupSearchPanel extends AbstractSearchPanel {
}
private GroupSearchPanel(final String id, final GroupSearchPanel.Builder builder) {
- super(id, AnyTypeKind.USER, builder);
+ super(id, AnyTypeKind.GROUP, builder);
}
@Override
http://git-wip-us.apache.org/repos/asf/syncope/blob/05478375/client/console/src/main/java/org/apache/syncope/client/console/panels/search/GroupSelectionSearchResultPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/search/GroupSelectionSearchResultPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/search/GroupSelectionSearchResultPanel.java
new file mode 100644
index 0000000..b47647f
--- /dev/null
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/search/GroupSelectionSearchResultPanel.java
@@ -0,0 +1,189 @@
+/*
+ * 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.search;
+
+import java.io.Serializable;
+import java.lang.reflect.Field;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Date;
+import java.util.List;
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.pages.GroupDisplayAttributesModalPage;
+import org.apache.syncope.client.console.panels.GroupSearchResultPanel;
+import org.apache.syncope.client.console.rest.AbstractAnyRestClient;
+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.WizardMgtPanel;
+import org.apache.syncope.client.console.wizards.any.AnyHandler;
+import org.apache.syncope.common.lib.to.AnyTO;
+import org.apache.syncope.common.lib.to.AnyTypeClassTO;
+import org.apache.syncope.common.lib.to.GroupTO;
+import org.apache.syncope.common.lib.types.SchemaType;
+import org.apache.syncope.common.lib.types.StandardEntitlement;
+import org.apache.wicket.PageReference;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.event.Broadcast;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.ResourceModel;
+import org.springframework.util.ReflectionUtils;
+
+public final class GroupSelectionSearchResultPanel extends GroupSearchResultPanel {
+
+ private static final long serialVersionUID = -1100228004207271271L;
+
+ private GroupSelectionSearchResultPanel(final String id, final Builder builder) {
+ super(id, builder, StandardEntitlement.GROUP_SEARCH);
+ }
+
+ @Override
+ protected List<IColumn<GroupTO, String>> getColumns() {
+ final List<IColumn<GroupTO, String>> columns = new ArrayList<>();
+
+ for (String name : prefMan.getList(getRequest(), Constants.PREF_GROUP_DETAILS_VIEW)) {
+ final Field field = ReflectionUtils.findField(GroupTO.class, name);
+
+ if ("token".equalsIgnoreCase(name)) {
+ columns.add(new PropertyColumn<GroupTO, String>(new ResourceModel(name, name), name, name));
+ } else if (field != null && field.getType().equals(Date.class)) {
+ columns.add(new PropertyColumn<GroupTO, String>(new ResourceModel(name, name), name, name));
+ } else {
+ columns.add(new PropertyColumn<GroupTO, String>(new ResourceModel(name, name), name, name));
+ }
+ }
+
+ for (String name : prefMan.getList(getRequest(), Constants.PREF_GROUP_ATTRIBUTES_VIEW)) {
+ if (schemaNames.contains(name)) {
+ columns.add(new AttrColumn<GroupTO>(name, SchemaType.PLAIN));
+ }
+ }
+
+ for (String name : prefMan.getList(getRequest(), Constants.PREF_GROUP_DERIVED_ATTRIBUTES_VIEW)) {
+ if (dSchemaNames.contains(name)) {
+ columns.add(new AttrColumn<GroupTO>(name, SchemaType.DERIVED));
+ }
+ }
+
+ // Add defaults in case of no selection
+ if (columns.isEmpty()) {
+ for (String name : GroupDisplayAttributesModalPage.GROUP_DEFAULT_SELECTION) {
+ columns.add(new PropertyColumn<GroupTO, String>(new ResourceModel(name, name), name, name));
+ }
+
+ prefMan.setList(getRequest(), getResponse(), Constants.PREF_GROUP_DETAILS_VIEW,
+ Arrays.asList(GroupDisplayAttributesModalPage.GROUP_DEFAULT_SELECTION));
+ }
+
+ columns.add(new ActionColumn<GroupTO, String>(new ResourceModel("actions", "")) {
+
+ private static final long serialVersionUID = -3503023501954863131L;
+
+ @Override
+ public ActionLinksPanel<GroupTO> getActions(final String componentId, final IModel<GroupTO> model) {
+ final ActionLinksPanel.Builder<GroupTO> panel = ActionLinksPanel.builder(page.getPageReference());
+
+ panel.add(new ActionLink<GroupTO>() {
+
+ private static final long serialVersionUID = -7978723352517770644L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target, final GroupTO ignore) {
+ send(GroupSelectionSearchResultPanel.this,
+ Broadcast.BUBBLE, new GroupSelection(target, model.getObject()));
+ }
+ }, ActionLink.ActionType.SELECT, StandardEntitlement.GROUP_READ);
+
+ return panel.build(componentId);
+ }
+
+ @Override
+ public ActionLinksPanel<Serializable> getHeader(final String componentId) {
+ final ActionLinksPanel.Builder<Serializable> panel = ActionLinksPanel.builder(page.getPageReference());
+
+ return panel.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).build(componentId);
+ }
+ });
+
+ return columns;
+ }
+
+ @Override
+ protected <T extends AnyTO> Collection<ActionLink.ActionType> getBulkActions() {
+ return Collections.<ActionLink.ActionType>emptyList();
+ }
+
+ public static final class Builder extends GroupSearchResultPanel.Builder {
+
+ private static final long serialVersionUID = 1L;
+
+ public Builder(
+ final List<AnyTypeClassTO> anyTypeClassTOs,
+ final AbstractAnyRestClient<GroupTO> restClient,
+ final String type,
+ final PageReference pageRef) {
+
+ super(anyTypeClassTOs, restClient, type, pageRef);
+ this.filtered = true;
+ this.checkBoxEnabled = false;
+ }
+
+ @Override
+ protected WizardMgtPanel<AnyHandler<GroupTO>> newInstance(final String id) {
+ return new GroupSelectionSearchResultPanel(id, this);
+ }
+ }
+
+ public static class GroupSelection implements Serializable {
+
+ private static final long serialVersionUID = 1242677935378149180L;
+
+ private final AjaxRequestTarget target;
+
+ private final GroupTO grp;
+
+ public GroupSelection(final AjaxRequestTarget target, final GroupTO grp) {
+ this.target = target;
+ this.grp = grp;
+ }
+
+ public AjaxRequestTarget getTarget() {
+ return target;
+ }
+
+ public GroupTO getSelection() {
+ return grp;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/05478375/client/console/src/main/java/org/apache/syncope/client/console/panels/search/SearchClausePanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/search/SearchClausePanel.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/search/SearchClausePanel.java
index 2904053..be9834f 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/search/SearchClausePanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/search/SearchClausePanel.java
@@ -115,7 +115,6 @@ public class SearchClausePanel extends FieldPanel<SearchClause> {
protected void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
send(this, Broadcast.BUBBLE, new SearchEvent(target));
}
-
};
searchButtonFragment = new Fragment("operator", "searchButtonFragment", this);
@@ -608,7 +607,7 @@ public class SearchClausePanel extends FieldPanel<SearchClause> {
}
}
- protected static class SearchEvent implements Serializable {
+ public static class SearchEvent implements Serializable {
private static final long serialVersionUID = 2693338614198749301L;
http://git-wip-us.apache.org/repos/asf/syncope/blob/05478375/client/console/src/main/java/org/apache/syncope/client/console/panels/search/UserSearchPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/search/UserSearchPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/search/UserSearchPanel.java
index 8f9af18..910986a 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/search/UserSearchPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/search/UserSearchPanel.java
@@ -19,20 +19,13 @@
package org.apache.syncope.client.console.panels.search;
import java.util.List;
-import org.apache.syncope.client.console.rest.UserRestClient;
-import org.apache.syncope.client.lib.SyncopeClient;
-import org.apache.syncope.common.lib.to.UserTO;
import org.apache.syncope.common.lib.types.AnyTypeKind;
-import org.apache.wicket.event.IEvent;
-import org.apache.wicket.extensions.markup.html.repeater.util.SortParam;
import org.apache.wicket.model.IModel;
public final class UserSearchPanel extends AnyObjectSearchPanel {
private static final long serialVersionUID = -1769527800450203738L;
- private final UserRestClient userRestClient = new UserRestClient();
-
public static class Builder extends AnyObjectSearchPanel.Builder {
private static final long serialVersionUID = 6308997285778809578L;
@@ -51,20 +44,4 @@ public final class UserSearchPanel extends AnyObjectSearchPanel {
super(id, AnyTypeKind.USER, builder);
}
- @Override
- public void onEvent(final IEvent<?> event) {
- if (event.getPayload() instanceof SearchClausePanel.SearchEvent) {
- final String fiql = SearchUtils.buildFIQL(
- UserSearchPanel.this.getModel().getObject(), SyncopeClient.getUserSearchConditionBuilder());
-
- final List<UserTO> res = userRestClient.search(
- "/", fiql, 1, 50, new SortParam<>("username", true), AnyTypeKind.USER.name());
-
- // let's provide result panel to be populated ....
-
- } else {
- super.onEvent(event);
- }
- }
-
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/05478375/client/console/src/main/java/org/apache/syncope/client/console/panels/search/UserSelectionSearchResultPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/search/UserSelectionSearchResultPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/search/UserSelectionSearchResultPanel.java
new file mode 100644
index 0000000..929c280
--- /dev/null
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/search/UserSelectionSearchResultPanel.java
@@ -0,0 +1,191 @@
+/*
+ * 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.search;
+
+import java.io.Serializable;
+import java.lang.reflect.Field;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Date;
+import java.util.List;
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.pages.UserDisplayAttributesModalPage;
+import org.apache.syncope.client.console.panels.UserSearchResultPanel;
+import org.apache.syncope.client.console.rest.AbstractAnyRestClient;
+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.WizardMgtPanel;
+import org.apache.syncope.client.console.wizards.any.AnyHandler;
+import org.apache.syncope.common.lib.to.AnyTO;
+import org.apache.syncope.common.lib.to.AnyTypeClassTO;
+import org.apache.syncope.common.lib.to.UserTO;
+import org.apache.syncope.common.lib.types.SchemaType;
+import org.apache.syncope.common.lib.types.StandardEntitlement;
+import org.apache.wicket.PageReference;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.event.Broadcast;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.ResourceModel;
+import org.springframework.util.ReflectionUtils;
+
+public final class UserSelectionSearchResultPanel extends UserSearchResultPanel {
+
+ private static final long serialVersionUID = -1100228004207271272L;
+
+ private UserSelectionSearchResultPanel(final String id, final UserSelectionSearchResultPanel.Builder builder) {
+ super(id, builder, StandardEntitlement.USER_LIST);
+ }
+
+ @Override
+ protected List<IColumn<UserTO, String>> getColumns() {
+
+ final List<IColumn<UserTO, String>> columns = new ArrayList<>();
+
+ for (String name : prefMan.getList(getRequest(), Constants.PREF_USERS_DETAILS_VIEW)) {
+ final Field field = ReflectionUtils.findField(UserTO.class, name);
+
+ if ("token".equalsIgnoreCase(name)) {
+ columns.add(new PropertyColumn<UserTO, String>(new ResourceModel(name, name), name, name));
+ } else if (field != null && field.getType().equals(Date.class)) {
+ columns.add(new PropertyColumn<UserTO, String>(new ResourceModel(name, name), name, name));
+ } else {
+ columns.add(new PropertyColumn<UserTO, String>(new ResourceModel(name, name), name, name));
+ }
+ }
+
+ for (String name : prefMan.getList(getRequest(), Constants.PREF_USERS_ATTRIBUTES_VIEW)) {
+ if (schemaNames.contains(name)) {
+ columns.add(new AttrColumn<UserTO>(name, SchemaType.PLAIN));
+ }
+ }
+
+ for (String name : prefMan.getList(getRequest(), Constants.PREF_USERS_DERIVED_ATTRIBUTES_VIEW)) {
+ if (dSchemaNames.contains(name)) {
+ columns.add(new AttrColumn<UserTO>(name, SchemaType.DERIVED));
+ }
+ }
+
+ // Add defaults in case of no selection
+ if (columns.isEmpty()) {
+ for (String name : UserDisplayAttributesModalPage.USER_DEFAULT_SELECTION) {
+ columns.add(new PropertyColumn<UserTO, String>(new ResourceModel(name, name), name, name));
+ }
+
+ prefMan.setList(getRequest(), getResponse(), Constants.PREF_USERS_DETAILS_VIEW,
+ Arrays.asList(UserDisplayAttributesModalPage.USER_DEFAULT_SELECTION));
+ }
+
+ columns.add(new ActionColumn<UserTO, String>(new ResourceModel("actions", "")) {
+
+ private static final long serialVersionUID = -3503023501954863131L;
+
+ @Override
+ public ActionLinksPanel<UserTO> getActions(final String componentId, final IModel<UserTO> model) {
+
+ final ActionLinksPanel.Builder<UserTO> panel = ActionLinksPanel.builder(page.getPageReference());
+
+ panel.add(new ActionLink<UserTO>() {
+
+ private static final long serialVersionUID = -7978723352517770644L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target, final UserTO ignore) {
+ send(UserSelectionSearchResultPanel.this,
+ Broadcast.BUBBLE, new UserSelection(target, model.getObject()));
+ }
+ }, ActionLink.ActionType.SELECT, StandardEntitlement.USER_READ);
+
+ return panel.build(componentId, model.getObject());
+ }
+
+ @Override
+ public ActionLinksPanel<Serializable> getHeader(final String componentId) {
+ final ActionLinksPanel.Builder<Serializable> panel = ActionLinksPanel.builder(page.getPageReference());
+
+ return panel.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).build(componentId);
+ }
+ });
+
+ return columns;
+ }
+
+ @Override
+ protected <T extends AnyTO> Collection<ActionLink.ActionType> getBulkActions() {
+ return Collections.<ActionLink.ActionType>emptyList();
+ }
+
+ public static final class Builder extends UserSearchResultPanel.Builder {
+
+ private static final long serialVersionUID = 1L;
+
+ public Builder(
+ final List<AnyTypeClassTO> anyTypeClassTOs,
+ final AbstractAnyRestClient<UserTO> restClient,
+ final String type,
+ final PageReference pageRef) {
+
+ super(anyTypeClassTOs, restClient, type, pageRef);
+ this.filtered = true;
+ this.checkBoxEnabled = false;
+ }
+
+ @Override
+ protected WizardMgtPanel<AnyHandler<UserTO>> newInstance(final String id) {
+ return new UserSelectionSearchResultPanel(id, this);
+ }
+ }
+
+ public static class UserSelection implements Serializable {
+
+ private static final long serialVersionUID = 1242677935378149180L;
+
+ private final AjaxRequestTarget target;
+
+ private final UserTO usr;
+
+ public UserSelection(final AjaxRequestTarget target, final UserTO usr) {
+ this.target = target;
+ this.usr = usr;
+ }
+
+ public AjaxRequestTarget getTarget() {
+ return target;
+ }
+
+ public UserTO getSelection() {
+ return usr;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/05478375/client/console/src/main/java/org/apache/syncope/client/console/wicket/ajax/markup/html/navigation/paging/AjaxDataNavigationToolbar.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wicket/ajax/markup/html/navigation/paging/AjaxDataNavigationToolbar.java b/client/console/src/main/java/org/apache/syncope/client/console/wicket/ajax/markup/html/navigation/paging/AjaxDataNavigationToolbar.java
index 4316b47..020e55f 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/wicket/ajax/markup/html/navigation/paging/AjaxDataNavigationToolbar.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/wicket/ajax/markup/html/navigation/paging/AjaxDataNavigationToolbar.java
@@ -30,7 +30,7 @@ public class AjaxDataNavigationToolbar extends AjaxNavigationToolbar {
private static final long serialVersionUID = -225570234877133351L;
private final WebMarkupContainer container;
-
+
public AjaxDataNavigationToolbar(final DataTable<?, ?> table, final WebMarkupContainer container) {
super(table);
this.container = container;
@@ -44,7 +44,9 @@ public class AjaxDataNavigationToolbar extends AjaxNavigationToolbar {
@Override
protected void onAjaxEvent(final AjaxRequestTarget target) {
- target.add(container);
+ if (container != null) {
+ target.add(container);
+ }
}
};
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/05478375/client/console/src/main/java/org/apache/syncope/client/console/wicket/extensions/markup/html/repeater/data/table/AjaxFallbackDataTable.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wicket/extensions/markup/html/repeater/data/table/AjaxFallbackDataTable.java b/client/console/src/main/java/org/apache/syncope/client/console/wicket/extensions/markup/html/repeater/data/table/AjaxFallbackDataTable.java
index 5c7ccbb..44b892c 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/wicket/extensions/markup/html/repeater/data/table/AjaxFallbackDataTable.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/wicket/extensions/markup/html/repeater/data/table/AjaxFallbackDataTable.java
@@ -56,7 +56,9 @@ public class AjaxFallbackDataTable<T, S> extends DataTable<T, S> {
@Override
protected void onAjaxClick(final AjaxRequestTarget target) {
- target.add(container);
+ if (container != null) {
+ target.add(container);
+ }
}
};
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/05478375/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 57f0980..809b1cd 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
@@ -82,7 +82,7 @@ public class AnyWizardBuilder<T extends AnyTO> extends AjaxWizardBuilder<AnyHand
addOptionalDetailsPanel(modelObject, wizardModel);
if ((this instanceof GroupWizardBuilder) && (modelObject.getInnerObject() instanceof GroupTO)) {
- wizardModel.add(new Ownership(GroupHandler.class.cast(modelObject)));
+ wizardModel.add(new Ownership(GroupHandler.class.cast(modelObject), pageRef));
wizardModel.add(new DynamicMemberships(GroupHandler.class.cast(modelObject)));
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/05478375/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/Ownership.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/Ownership.java b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/Ownership.java
index 65cc758..c7881a5 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/Ownership.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/Ownership.java
@@ -21,16 +21,29 @@ package org.apache.syncope.client.console.wizards.any;
import de.agilecoders.wicket.extensions.markup.html.bootstrap.form.checkbox.bootstraptoggle.BootstrapToggle;
import de.agilecoders.wicket.extensions.markup.html.bootstrap.form.checkbox.bootstraptoggle.BootstrapToggleConfig;
import java.util.ArrayList;
+import org.apache.commons.lang3.StringUtils;
import org.apache.syncope.client.console.commons.Constants;
-import org.apache.syncope.client.console.panels.search.AnyObjectSearchPanel;
import org.apache.syncope.client.console.panels.search.GroupSearchPanel;
+import org.apache.syncope.client.console.panels.search.GroupSelectionSearchResultPanel;
import org.apache.syncope.client.console.panels.search.SearchClause;
+import org.apache.syncope.client.console.panels.search.SearchClausePanel;
+import org.apache.syncope.client.console.panels.search.SearchUtils;
import org.apache.syncope.client.console.panels.search.UserSearchPanel;
+import org.apache.syncope.client.console.panels.search.UserSelectionSearchResultPanel;
+import org.apache.syncope.client.console.rest.AnyTypeRestClient;
+import org.apache.syncope.client.console.rest.GroupRestClient;
+import org.apache.syncope.client.console.rest.UserRestClient;
import org.apache.syncope.client.console.wicket.markup.html.form.AjaxTextFieldPanel;
+import org.apache.syncope.client.lib.SyncopeClient;
+import org.apache.syncope.common.lib.to.AnyTypeTO;
import org.apache.syncope.common.lib.to.GroupTO;
+import org.apache.syncope.common.lib.to.UserTO;
import org.apache.syncope.common.lib.types.AnyTypeKind;
+import org.apache.wicket.PageReference;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
+import org.apache.wicket.event.Broadcast;
+import org.apache.wicket.event.IEvent;
import org.apache.wicket.extensions.ajax.markup.html.IndicatingAjaxLink;
import org.apache.wicket.extensions.wizard.WizardStep;
import org.apache.wicket.markup.html.WebMarkupContainer;
@@ -38,22 +51,42 @@ import org.apache.wicket.markup.html.form.CheckBox;
import org.apache.wicket.markup.html.panel.Fragment;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.Model;
+import org.apache.wicket.model.PropertyModel;
import org.apache.wicket.model.util.ListModel;
public class Ownership extends WizardStep {
private static final long serialVersionUID = 855618618337931784L;
+ private final GroupHandler handler;
+
private final WebMarkupContainer ownerContainer;
+ private final AnyTypeRestClient anyTypeRestClient = new AnyTypeRestClient();
+
+ private final GroupSearchPanel groupSearchPanel;
+
+ private final GroupRestClient groupRestClient = new GroupRestClient();
+
private final Fragment groupSearchFragment;
+ private final GroupSelectionSearchResultPanel groupSearchResultPanel;
+
+ private final UserSearchPanel userSearchPanel;
+
+ private final UserRestClient userRestClient = new UserRestClient();
+
private final Fragment userSearchFragment;
- public Ownership(final GroupHandler groupHandler) {
+ private final UserSelectionSearchResultPanel userSearchResultPanel;
+
+ private final Model<Boolean> isGroupOwnership;
+
+ public Ownership(final GroupHandler groupHandler, final PageReference pageRef) {
super();
+ this.handler = groupHandler;
- final Model<Boolean> isGroupOwnership = Model.of(groupHandler.getInnerObject().getGroupOwner() != null);
+ isGroupOwnership = Model.of(groupHandler.getInnerObject().getGroupOwner() != null);
final BootstrapToggleConfig config = new BootstrapToggleConfig();
config
@@ -101,8 +134,10 @@ public class Ownership extends WizardStep {
isGroupOwnership.setObject(!isGroupOwnership.getObject());
if (isGroupOwnership.getObject()) {
ownerContainer.addOrReplace(groupSearchFragment);
+ groupSearchResultPanel.search(null, target);
} else {
ownerContainer.addOrReplace(userSearchFragment);
+ userSearchResultPanel.search(null, target);
}
target.add(ownerContainer);
}
@@ -116,25 +151,65 @@ public class Ownership extends WizardStep {
this.add(ownerContainer);
groupSearchFragment = new Fragment("search", "groupSearchFragment", this);
- final GroupSearchPanel groupSearchPanel = new GroupSearchPanel.Builder(
+ groupSearchPanel = new GroupSearchPanel.Builder(
new ListModel<>(new ArrayList<SearchClause>())).required(false).enableSearch().build("groupsearch");
groupSearchFragment.add(groupSearchPanel.setRenderBodyOnly(true));
+ AnyTypeTO anyTypeTO = anyTypeRestClient.get(AnyTypeKind.GROUP.name());
+
+ groupSearchResultPanel = GroupSelectionSearchResultPanel.class.cast(new GroupSelectionSearchResultPanel.Builder(
+ anyTypeRestClient.getAnyTypeClass(anyTypeTO.getClasses().toArray(new String[] {})),
+ groupRestClient,
+ anyTypeTO.getKey(),
+ pageRef).build("searchResult"));
+
+ groupSearchFragment.add(groupSearchResultPanel);
+
userSearchFragment = new Fragment("search", "userSearchFragment", this);
- final AnyObjectSearchPanel userSearchPanel = new UserSearchPanel.Builder(
- new ListModel<>(new ArrayList<SearchClause>())).required(false).enableSearch().build("usersearch");
+ userSearchPanel = UserSearchPanel.class.cast(new UserSearchPanel.Builder(
+ new ListModel<>(new ArrayList<SearchClause>())).required(false).enableSearch().build("usersearch"));
userSearchFragment.add(userSearchPanel.setRenderBodyOnly(true));
+ anyTypeTO = anyTypeRestClient.get(AnyTypeKind.USER.name());
+
+ userSearchResultPanel = UserSelectionSearchResultPanel.class.cast(new UserSelectionSearchResultPanel.Builder(
+ anyTypeRestClient.getAnyTypeClass(anyTypeTO.getClasses().toArray(new String[] {})),
+ userRestClient,
+ anyTypeTO.getKey(),
+ pageRef).build("searchResult"));
+
+ userSearchFragment.add(userSearchResultPanel);
+
if (isGroupOwnership.getObject()) {
ownerContainer.add(groupSearchFragment);
} else {
ownerContainer.add(userSearchFragment);
}
- final GroupTO groupTO = GroupHandler.class.cast(groupHandler).getInnerObject();
-
final AjaxTextFieldPanel userOwner
- = new AjaxTextFieldPanel("userOwner", "userOwner", new Model<String>(), false);
+ = new AjaxTextFieldPanel("userOwner", "userOwner",
+ new PropertyModel<String>(groupHandler.getInnerObject(), "userOwner") {
+
+ private static final long serialVersionUID = -3743432456095828573L;
+
+ @Override
+ public String getObject() {
+ if (groupHandler.getInnerObject().getUserOwner() == null) {
+ return StringUtils.EMPTY;
+ } else {
+ return String.valueOf(groupHandler.getInnerObject().getUserOwner());
+ }
+ }
+
+ @Override
+ public void setObject(final String object) {
+ if (StringUtils.isBlank(object)) {
+ groupHandler.getInnerObject().setUserOwner(null);
+ } else {
+ groupHandler.getInnerObject().setUserOwner(Long.parseLong(object));
+ }
+ }
+ }, false);
userOwner.setPlaceholder("userOwner");
userOwner.hideLabel();
userOwner.setReadOnly(true).setOutputMarkupId(true);
@@ -146,13 +221,35 @@ public class Ownership extends WizardStep {
@Override
public void onClick(final AjaxRequestTarget target) {
- target.add(userOwner);
+ send(Ownership.this, Broadcast.EXACT, new GroupSelectionSearchResultPanel.GroupSelection(target, null));
}
};
- userSearchFragment.add(userOwnerReset.setEnabled(false));
+ userSearchFragment.add(userOwnerReset);
final AjaxTextFieldPanel groupOwner
- = new AjaxTextFieldPanel("groupOwner", "groupOwner", new Model<String>(), false);
+ = new AjaxTextFieldPanel("groupOwner", "groupOwner",
+ new PropertyModel<String>(groupHandler.getInnerObject(), "groupOwner") {
+
+ private static final long serialVersionUID = -3743432456095828573L;
+
+ @Override
+ public String getObject() {
+ if (groupHandler.getInnerObject().getGroupOwner() == null) {
+ return StringUtils.EMPTY;
+ } else {
+ return String.valueOf(groupHandler.getInnerObject().getGroupOwner());
+ }
+ }
+
+ @Override
+ public void setObject(final String object) {
+ if (StringUtils.isBlank(object)) {
+ groupHandler.getInnerObject().setGroupOwner(null);
+ } else {
+ groupHandler.getInnerObject().setGroupOwner(Long.parseLong(object));
+ }
+ }
+ }, false);
groupOwner.setPlaceholder("groupOwner");
groupOwner.hideLabel();
groupOwner.setReadOnly(true).setOutputMarkupId(true);
@@ -164,9 +261,46 @@ public class Ownership extends WizardStep {
@Override
public void onClick(final AjaxRequestTarget target) {
- target.add(groupOwner);
+ send(Ownership.this, Broadcast.EXACT, new GroupSelectionSearchResultPanel.GroupSelection(target, null));
}
};
- groupSearchFragment.add(groupOwnerReset.setEnabled(false));
+ groupSearchFragment.add(groupOwnerReset);
+ }
+
+ @Override
+
+ public void onEvent(final IEvent<?> event) {
+ if (event.getPayload() instanceof SearchClausePanel.SearchEvent) {
+ final AjaxRequestTarget target = SearchClausePanel.SearchEvent.class.cast(event.getPayload()).getTarget();
+ if (Ownership.this.isGroupOwnership.getObject()) {
+ final String fiql = SearchUtils.buildFIQL(
+ groupSearchPanel.getModel().getObject(), SyncopeClient.getUserSearchConditionBuilder());
+ groupSearchResultPanel.search(fiql, target);
+ } else {
+ final String fiql = SearchUtils.buildFIQL(
+ userSearchPanel.getModel().getObject(), SyncopeClient.getUserSearchConditionBuilder());
+ userSearchResultPanel.search(fiql, target);
+ }
+ } else if (event.getPayload() instanceof UserSelectionSearchResultPanel.UserSelection) {
+ final UserTO sel = ((UserSelectionSearchResultPanel.UserSelection) event.getPayload()).getSelection();
+ if (sel == null) {
+ handler.getInnerObject().setUserOwner(null);
+ } else {
+ handler.getInnerObject().setUserOwner(sel.getKey());
+ handler.getInnerObject().setGroupOwner(null);
+ }
+ ((UserSelectionSearchResultPanel.UserSelection) event.getPayload()).getTarget().add(ownerContainer);
+ } else if (event.getPayload() instanceof GroupSelectionSearchResultPanel.GroupSelection) {
+ final GroupTO sel = ((GroupSelectionSearchResultPanel.GroupSelection) event.getPayload()).getSelection();
+ if (sel == null) {
+ handler.getInnerObject().setGroupOwner(null);
+ } else {
+ handler.getInnerObject().setGroupOwner(sel.getKey());
+ handler.getInnerObject().setUserOwner(null);
+ }
+ ((GroupSelectionSearchResultPanel.GroupSelection) event.getPayload()).getTarget().add(ownerContainer);
+ } else {
+ super.onEvent(event);
+ }
}
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/05478375/client/console/src/main/resources/META-INF/resources/css/syncopeConsole.css
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/META-INF/resources/css/syncopeConsole.css b/client/console/src/main/resources/META-INF/resources/css/syncopeConsole.css
index 39a0942..36874d0 100644
--- a/client/console/src/main/resources/META-INF/resources/css/syncopeConsole.css
+++ b/client/console/src/main/resources/META-INF/resources/css/syncopeConsole.css
@@ -338,3 +338,9 @@ END - Style for Information panel
width: 110px !important;
}
+div.searchResult{
+ margin-top: 30px;
+ display: block;
+ clear: both;
+}
+
http://git-wip-us.apache.org/repos/asf/syncope/blob/05478375/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/ActionLinksPanel.html
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/ActionLinksPanel.html b/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/ActionLinksPanel.html
index 2830a79..772222e 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/ActionLinksPanel.html
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/ActionLinksPanel.html
@@ -132,7 +132,7 @@ under the License.
</wicket:fragment>
<wicket:fragment wicket:id="fragmentSelect">
- <a href="#" wicket:id="selectLink"><img id="actionLink" src="img/actions/select.png" alt="select icon" title="Select"/></a>
+ <a href="#" wicket:id="selectLink"><i class="glyphicon glyphicon-ok"></i></a>
</wicket:fragment>
<wicket:fragment wicket:id="fragmentExport">
http://git-wip-us.apache.org/repos/asf/syncope/blob/05478375/client/console/src/main/resources/org/apache/syncope/client/console/wizards/any/Ownership.html
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/wizards/any/Ownership.html b/client/console/src/main/resources/org/apache/syncope/client/console/wizards/any/Ownership.html
index 2a3a916..1e1629b 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/wizards/any/Ownership.html
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/wizards/any/Ownership.html
@@ -31,17 +31,23 @@ under the License.
<wicket:fragment wicket:id="userSearchFragment">
<div class="form-group input-group">
<span wicket:id="userOwner"/>
- <a href="#" wicket:id="userOwnerReset" class="input-group-addon"><i class="glyphicon glyphicon-remove-circle" alt="reset user owner" title="Delete"></i></a>
+ <a href="#" wicket:id="userOwnerReset" class="input-group-addon"><i class="glyphicon glyphicon-remove-circle" alt="reset user owner" title="Reset"></i></a>
</div>
<span wicket:id="usersearch">[USER SEARCH]</span>
+ <div class="searchResult">
+ <span wicket:id="searchResult">[USER SEARCH RESULT]</span>
+ </div>
</wicket:fragment>
<wicket:fragment wicket:id="groupSearchFragment">
<div class="form-group input-group">
<span wicket:id="groupOwner"/>
- <a href="#" wicket:id="groupOwnerReset" class="input-group-addon"><i class="glyphicon glyphicon-remove-circle" alt="reset group owner" title="Delete"></i></a>
+ <a href="#" wicket:id="groupOwnerReset" class="input-group-addon"><i class="glyphicon glyphicon-remove-circle" alt="reset group owner" title="Reset"></i></a>
</div>
<span wicket:id="groupsearch">[GROUP SEARCH]</span>
+ <div class="searchResult">
+ <span wicket:id="searchResult">[GROUP SEARCH RESULT]</span>
+ </div>
</wicket:fragment>
</wicket:panel>
</body>
http://git-wip-us.apache.org/repos/asf/syncope/blob/05478375/common/lib/src/main/java/org/apache/syncope/common/lib/AnyOperations.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/AnyOperations.java b/common/lib/src/main/java/org/apache/syncope/common/lib/AnyOperations.java
index 8ae413c..7cd4c84 100644
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/AnyOperations.java
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/AnyOperations.java
@@ -324,9 +324,9 @@ public final class AnyOperations {
// 2. ownership
result.setUserOwner(replacePatchItem(
- original.getUserOwner(), updated.getUserOwner(), new LongReplacePatchItem()));
+ updated.getUserOwner(), original.getUserOwner(), new LongReplacePatchItem()));
result.setGroupOwner(replacePatchItem(
- original.getGroupOwner(), updated.getGroupOwner(), new LongReplacePatchItem()));
+ updated.getGroupOwner(), original.getGroupOwner(), new LongReplacePatchItem()));
// 3. dynamic membership
result.setUDynMembershipCond(updated.getUDynMembershipCond());