You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by md...@apache.org on 2016/03/07 14:56:27 UTC
syncope git commit: [SYNCOPE-156] Added the possibility to choose
which attributes to show
Repository: syncope
Updated Branches:
refs/heads/master 48b5a10f4 -> 24f035b4e
[SYNCOPE-156] Added the possibility to choose which attributes to show
Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/24f035b4
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/24f035b4
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/24f035b4
Branch: refs/heads/master
Commit: 24f035b4e8cf110f86d2821f901662697c275373
Parents: 48b5a10
Author: Marco Di Sabatino Di Diodoro <md...@apache.org>
Authored: Mon Mar 7 14:22:31 2016 +0100
Committer: Marco Di Sabatino Di Diodoro <md...@apache.org>
Committed: Mon Mar 7 14:28:56 2016 +0100
----------------------------------------------------------------------
.../AnyObjectDisplayAttributesModalPage.java | 72 ------
.../pages/DisplayAttributesModalPage.java | 242 -------------------
.../pages/GroupDisplayAttributesModalPage.java | 67 -----
.../syncope/client/console/pages/Realms.java | 6 +-
.../pages/UserDisplayAttributesModalPage.java | 68 ------
.../panels/AbstractSearchResultPanel.java | 4 +-
.../AnyObjectDisplayAttributesModalPage.java | 69 ++++++
.../panels/AnyObjectSearchResultPanel.java | 43 ++--
.../panels/DisplayAttributesModalPanel.java | 186 ++++++++++++++
.../GroupDisplayAttributesModalPanel.java | 67 +++++
.../console/panels/GroupSearchResultPanel.java | 17 +-
.../client/console/panels/RealmModalPanel.java | 2 +-
.../panels/UserDisplayAttributesModalPanel.java | 68 ++++++
.../console/panels/UserSearchResultPanel.java | 16 +-
.../search/AnySelectionSearchResultPanel.java | 13 +-
.../client/console/wizards/WizardMgtPanel.java | 3 +
.../pages/DisplayAttributesModalPage.html | 118 ---------
.../pages/DisplayAttributesModalPage.properties | 32 ---
.../panels/DisplayAttributesModalPanel.html | 56 +++++
.../DisplayAttributesModalPanel.properties | 20 ++
.../DisplayAttributesModalPanel_it.properties | 20 ++
...DisplayAttributesModalPanel_pt_BR.properties | 20 ++
.../client/console/wizards/WizardMgtPanel.html | 1 +
.../fit/console/DisplayAttributesITCase.java | 72 ++++++
24 files changed, 635 insertions(+), 647 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/syncope/blob/24f035b4/client/console/src/main/java/org/apache/syncope/client/console/pages/AnyObjectDisplayAttributesModalPage.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/pages/AnyObjectDisplayAttributesModalPage.java b/client/console/src/main/java/org/apache/syncope/client/console/pages/AnyObjectDisplayAttributesModalPage.java
deleted file mode 100644
index 1505819..0000000
--- a/client/console/src/main/java/org/apache/syncope/client/console/pages/AnyObjectDisplayAttributesModalPage.java
+++ /dev/null
@@ -1,72 +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.pages;
-
-import java.io.Serializable;
-import java.util.List;
-import org.apache.syncope.client.console.commons.Constants;
-import org.apache.syncope.client.console.wicket.markup.html.bootstrap.dialog.BaseModal;
-import org.apache.syncope.common.lib.to.AnyObjectTO;
-import org.apache.wicket.PageReference;
-
-/**
- * Modal window with Display user attributes form.
- *
- * @param <T> can be {@link org.apache.syncope.common.lib.to.AnyTO} or
- * {@link org.apache.syncope.client.console.wizards.any.AnyHandler}
- */
-public class AnyObjectDisplayAttributesModalPage<T extends Serializable> extends DisplayAttributesModalPage<T> {
-
- private static final long serialVersionUID = 5194630813773543054L;
-
- public static final String[] ANY_OBJECT_DEFAULT_SELECTION = { "key" };
-
- private final String type;
-
- public AnyObjectDisplayAttributesModalPage(
- final BaseModal<T> modal,
- final PageReference pageRef,
- final List<String> schemaNames,
- final List<String> dSchemaNames,
- final String type) {
-
- super(modal, pageRef, schemaNames, dSchemaNames);
- this.type = type;
- }
-
- @Override
- public String getPrefDetailView() {
- return String.format(Constants.PREF_ANY_OBJECT_DETAILS_VIEW, type);
- }
-
- @Override
- public String getPrefAttributeView() {
- return String.format(Constants.PREF_ANY_OBJECT_PLAIN_ATTRS_VIEW, type);
- }
-
- @Override
- public String getPrefDerivedAttributeView() {
- return String.format(Constants.PREF_ANY_OBJECT_DER_ATTRS_VIEW, type);
- }
-
- @Override
- public Class<AnyObjectTO> getTOClass() {
- return AnyObjectTO.class;
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/24f035b4/client/console/src/main/java/org/apache/syncope/client/console/pages/DisplayAttributesModalPage.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/pages/DisplayAttributesModalPage.java b/client/console/src/main/java/org/apache/syncope/client/console/pages/DisplayAttributesModalPage.java
deleted file mode 100644
index 47ae42e..0000000
--- a/client/console/src/main/java/org/apache/syncope/client/console/pages/DisplayAttributesModalPage.java
+++ /dev/null
@@ -1,242 +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.pages;
-
-import java.io.Serializable;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import org.apache.syncope.client.console.PreferenceManager;
-import org.apache.syncope.client.console.SyncopeConsoleSession;
-import org.apache.syncope.client.console.commons.Constants;
-import org.apache.syncope.client.console.panels.AbstractModalPanel;
-import org.apache.syncope.client.console.wicket.markup.html.bootstrap.dialog.BaseModal;
-import org.apache.syncope.common.lib.search.SearchableFields;
-import org.apache.syncope.common.lib.to.AnyTO;
-import org.apache.wicket.PageReference;
-import org.apache.wicket.ajax.AjaxRequestTarget;
-import org.apache.wicket.ajax.markup.html.form.AjaxButton;
-import org.apache.wicket.extensions.ajax.markup.html.IndicatingAjaxButton;
-import org.apache.wicket.markup.html.basic.Label;
-import org.apache.wicket.markup.html.form.Check;
-import org.apache.wicket.markup.html.form.CheckGroup;
-import org.apache.wicket.markup.html.form.Form;
-import org.apache.wicket.markup.html.list.ListItem;
-import org.apache.wicket.markup.html.list.ListView;
-import org.apache.wicket.markup.html.panel.Fragment;
-import org.apache.wicket.model.CompoundPropertyModel;
-import org.apache.wicket.model.IModel;
-import org.apache.wicket.model.LoadableDetachableModel;
-import org.apache.wicket.model.PropertyModel;
-import org.apache.wicket.model.ResourceModel;
-
-/**
- * Modal window with Display attributes form.
- *
- * @param <T> can be {@link AnyTO} or {@link org.apache.syncope.client.console.wizards.any.AnyHandler}
- */
-public abstract class DisplayAttributesModalPage<T extends Serializable> extends AbstractModalPanel<T> {
-
- private static final long serialVersionUID = -4274117450918385110L;
-
- /**
- * Max allowed selections.
- */
- private static final int MAX_SELECTIONS = 9;
-
- private final PreferenceManager prefMan = new PreferenceManager();
-
- private final List<String> selectedDetails;
-
- private final List<String> selectedPlainSchemas;
-
- private final List<String> selectedDerSchemas;
-
- public DisplayAttributesModalPage(
- final BaseModal<T> modal,
- final PageReference pageRef,
- final List<String> schemaNames,
- final List<String> dSchemaNames) {
-
- super(modal, pageRef);
-
- final IModel<List<String>> fnames = new LoadableDetachableModel<List<String>>() {
-
- private static final long serialVersionUID = 5275935387613157437L;
-
- @Override
- protected List<String> load() {
- return SearchableFields.get(getTOClass());
- }
- };
-
- final IModel<List<String>> names = new LoadableDetachableModel<List<String>>() {
-
- private static final long serialVersionUID = 5275935387613157437L;
-
- @Override
- protected List<String> load() {
- return schemaNames;
- }
- };
-
- final IModel<List<String>> dsnames = new LoadableDetachableModel<List<String>>() {
-
- private static final long serialVersionUID = 5275935387613157437L;
-
- @Override
- protected List<String> load() {
- return dSchemaNames;
- }
- };
-
- final Form<DisplayAttributesModalPage<T>> form = new Form<>(FORM);
- form.setModel(new CompoundPropertyModel<>(this));
-
- selectedDetails = prefMan.getList(getRequest(), getPrefDetailView());
-
- selectedPlainSchemas = prefMan.getList(getRequest(), getPrefAttributeView());
-
- selectedDerSchemas = prefMan.getList(getRequest(), getPrefDerivedAttributeView());
-
- final CheckGroup<String> dgroup =
- new CheckGroup<>("dCheckGroup", new PropertyModel<List<String>>(this, "selectedDetails"));
- form.add(dgroup);
-
- final ListView<String> details = new ListView<String>("details", fnames) {
-
- private static final long serialVersionUID = 9101744072914090143L;
-
- @Override
- protected void populateItem(final ListItem<String> item) {
- item.add(new Check<>("dcheck", item.getModel()));
- item.add(new Label("dname", new ResourceModel(item.getModelObject(), item.getModelObject())));
- }
- };
- dgroup.add(details);
-
- if (names.getObject() == null || names.getObject().isEmpty()) {
- final Fragment fragment = new Fragment("plainSchemas", "emptyFragment", form);
- form.add(fragment);
-
- selectedPlainSchemas.clear();
- } else {
- final Fragment fragment = new Fragment("plainSchemas", "sfragment", form);
- form.add(fragment);
-
- final CheckGroup<String> sgroup =
- new CheckGroup<>("psCheckGroup", new PropertyModel<List<String>>(this, "selectedPlainSchemas"));
- fragment.add(sgroup);
-
- final ListView<String> schemas = new ListView<String>("plainSchemas", names) {
-
- private static final long serialVersionUID = 9101744072914090143L;
-
- @Override
- protected void populateItem(final ListItem<String> item) {
- item.add(new Check<>("scheck", item.getModel()));
- item.add(new Label("sname", new ResourceModel(item.getModelObject(), item.getModelObject())));
- }
- };
- sgroup.add(schemas);
- }
-
- if (dsnames.getObject() == null || dsnames.getObject().isEmpty()) {
- final Fragment fragment = new Fragment("dschemas", "emptyFragment", form);
- form.add(fragment);
-
- selectedDerSchemas.clear();
- } else {
- final Fragment fragment = new Fragment("dschemas", "dsfragment", form);
- form.add(fragment);
-
- final CheckGroup<String> dsgroup =
- new CheckGroup<>("dsCheckGroup", new PropertyModel<List<String>>(this, "selectedDerSchemas"));
- fragment.add(dsgroup);
-
- final ListView<String> derSchemas = new ListView<String>("derSchemas", dsnames) {
-
- private static final long serialVersionUID = 9101744072914090143L;
-
- @Override
- protected void populateItem(final ListItem<String> item) {
- item.add(new Check<>("dscheck", item.getModel()));
- item.add(new Label("dsname", new ResourceModel(item.getModelObject(), item.getModelObject())));
- }
- };
- dsgroup.add(derSchemas);
- }
-
- final AjaxButton submit = new IndicatingAjaxButton(SUBMIT, new ResourceModel(SUBMIT)) {
-
- private static final long serialVersionUID = -4804368561204623354L;
-
- @Override
- protected void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
- if (selectedDetails.size() + selectedPlainSchemas.size() + selectedDerSchemas.size()
- > MAX_SELECTIONS) {
-
- error(getString("tooManySelections"));
- onError(target, form);
- } else {
- final Map<String, List<String>> prefs = new HashMap<>();
-
- prefs.put(getPrefDetailView(), selectedDetails);
- prefs.put(getPrefAttributeView(), selectedPlainSchemas);
- prefs.put(getPrefDerivedAttributeView(), selectedDerSchemas);
- prefMan.setList(getRequest(), getResponse(), prefs);
-
- info(getString(Constants.OPERATION_SUCCEEDED));
- modal.close(target);
- }
- }
-
- @Override
- protected void onError(final AjaxRequestTarget target, final Form<?> form) {
- SyncopeConsoleSession.get().getNotificationPanel().refresh(target);
- }
- };
-
- form.add(submit);
-
- final AjaxButton cancel = new IndicatingAjaxButton(CANCEL, new ResourceModel(CANCEL)) {
-
- private static final long serialVersionUID = -958724007591692537L;
-
- @Override
- protected void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
- modal.close(target);
- }
- };
-
- cancel.setDefaultFormProcessing(false);
- form.add(cancel);
-
- add(form);
- }
-
- public abstract String getPrefDetailView();
-
- public abstract String getPrefAttributeView();
-
- public abstract String getPrefDerivedAttributeView();
-
- public abstract Class<? extends AnyTO> getTOClass();
-
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/24f035b4/client/console/src/main/java/org/apache/syncope/client/console/pages/GroupDisplayAttributesModalPage.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/pages/GroupDisplayAttributesModalPage.java b/client/console/src/main/java/org/apache/syncope/client/console/pages/GroupDisplayAttributesModalPage.java
deleted file mode 100644
index 6ca51ad..0000000
--- a/client/console/src/main/java/org/apache/syncope/client/console/pages/GroupDisplayAttributesModalPage.java
+++ /dev/null
@@ -1,67 +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.pages;
-
-import java.io.Serializable;
-import java.util.List;
-import org.apache.syncope.client.console.commons.Constants;
-import org.apache.syncope.client.console.wicket.markup.html.bootstrap.dialog.BaseModal;
-import org.apache.syncope.common.lib.to.GroupTO;
-import org.apache.wicket.PageReference;
-
-/**
- * Modal window with Display group attributes form.
- *
- * @param <T> can be {@link org.apache.syncope.common.lib.to.AnyTO} or
- * {@link org.apache.syncope.client.console.wizards.any.AnyHandler}
- */
-public class GroupDisplayAttributesModalPage<T extends Serializable> extends DisplayAttributesModalPage<T> {
-
- private static final long serialVersionUID = 5194630813773543054L;
-
- public static final String[] GROUP_DEFAULT_SELECTION = { "key", "name" };
-
- public GroupDisplayAttributesModalPage(
- final BaseModal<T> modal,
- final PageReference pageRef,
- final List<String> schemaNames,
- final List<String> dSchemaNames) {
- super(modal, pageRef, schemaNames, dSchemaNames);
- }
-
- @Override
- public String getPrefDetailView() {
- return Constants.PREF_GROUP_DETAILS_VIEW;
- }
-
- @Override
- public String getPrefAttributeView() {
- return Constants.PREF_GROUP_PLAIN_ATTRS_VIEW;
- }
-
- @Override
- public String getPrefDerivedAttributeView() {
- return Constants.PREF_GROUP_DER_ATTRS_VIEW;
- }
-
- @Override
- public Class<GroupTO> getTOClass() {
- return GroupTO.class;
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/24f035b4/client/console/src/main/java/org/apache/syncope/client/console/pages/Realms.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/pages/Realms.java b/client/console/src/main/java/org/apache/syncope/client/console/pages/Realms.java
index 2db04c4..58928a0 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/pages/Realms.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/pages/Realms.java
@@ -148,10 +148,10 @@ public class Realms extends BasePage {
realmRestClient.delete(realmTO.getFullPath());
RealmTO parent = realmChoicePanel.moveToParentRealm(realmTO.getKey());
target.add(realmChoicePanel.reloadRealmTree(target));
-
- updateRealmContent(parent);
- target.add(content);
+
info(getString(Constants.OPERATION_SUCCEEDED));
+ updateRealmContent(parent);
+ target.add(content);
} catch (Exception e) {
LOG.error("While deleting realm", e);
// Excape line breaks
http://git-wip-us.apache.org/repos/asf/syncope/blob/24f035b4/client/console/src/main/java/org/apache/syncope/client/console/pages/UserDisplayAttributesModalPage.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/pages/UserDisplayAttributesModalPage.java b/client/console/src/main/java/org/apache/syncope/client/console/pages/UserDisplayAttributesModalPage.java
deleted file mode 100644
index 2442697..0000000
--- a/client/console/src/main/java/org/apache/syncope/client/console/pages/UserDisplayAttributesModalPage.java
+++ /dev/null
@@ -1,68 +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.pages;
-
-import java.io.Serializable;
-import java.util.List;
-import org.apache.syncope.client.console.commons.Constants;
-import org.apache.syncope.client.console.wicket.markup.html.bootstrap.dialog.BaseModal;
-import org.apache.syncope.common.lib.to.UserTO;
-import org.apache.wicket.PageReference;
-
-/**
- * Modal window with Display user attributes form.
- *
- * @param <T> can be {@link org.apache.syncope.common.lib.to.AnyTO} or
- * {@link org.apache.syncope.client.console.wizards.any.AnyHandler}
- */
-public class UserDisplayAttributesModalPage<T extends Serializable> extends DisplayAttributesModalPage<T> {
-
- private static final long serialVersionUID = 5194630813773543054L;
-
- public static final String[] USER_DEFAULT_SELECTION = { "key", "username", "status" };
-
- public UserDisplayAttributesModalPage(
- final BaseModal<T> modal,
- final PageReference pageRef,
- final List<String> schemaNames,
- final List<String> dSchemaNames) {
- super(modal, pageRef, schemaNames, dSchemaNames);
- }
-
- @Override
- public String getPrefDetailView() {
- return Constants.PREF_USERS_DETAILS_VIEW;
- }
-
- @Override
- public String getPrefAttributeView() {
- return Constants.PREF_USERS_PLAIN_ATTRS_VIEW;
- }
-
- @Override
- public String getPrefDerivedAttributeView() {
- return Constants.PREF_USERS_DER_ATTRS_VIEW;
- }
-
- @Override
- public Class<UserTO> getTOClass() {
- return UserTO.class;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/24f035b4/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 e62a5d8..e2a6686 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
@@ -144,7 +144,7 @@ public abstract class AbstractSearchResultPanel<
setWindowClosedReloadCallback(modal);
}
-
+
protected abstract DP dataProvider();
protected abstract String paginatorRowsKey();
@@ -252,7 +252,7 @@ public abstract class AbstractSearchResultPanel<
super.onEvent(event);
}
- private void setWindowClosedReloadCallback(final BaseModal<?> modal) {
+ protected void setWindowClosedReloadCallback(final BaseModal<?> modal) {
modal.setWindowClosedCallback(new ModalWindow.WindowClosedCallback() {
private static final long serialVersionUID = 8804221891699487139L;
http://git-wip-us.apache.org/repos/asf/syncope/blob/24f035b4/client/console/src/main/java/org/apache/syncope/client/console/panels/AnyObjectDisplayAttributesModalPage.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/AnyObjectDisplayAttributesModalPage.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/AnyObjectDisplayAttributesModalPage.java
new file mode 100644
index 0000000..7e1bd2a
--- /dev/null
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/AnyObjectDisplayAttributesModalPage.java
@@ -0,0 +1,69 @@
+/*
+ * 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 java.io.Serializable;
+import java.util.List;
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.wicket.markup.html.bootstrap.dialog.BaseModal;
+import org.apache.syncope.common.lib.to.AnyObjectTO;
+import org.apache.wicket.PageReference;
+
+/**
+ * Modal window with Display any attributes form.
+ *
+ * @param <T> can be {@link org.apache.syncope.common.lib.to.AnyTO} or
+ * {@link org.apache.syncope.client.console.wizards.any.AnyHandler}
+ */
+public class AnyObjectDisplayAttributesModalPage<T extends Serializable> extends DisplayAttributesModalPanel<T> {
+
+ private static final long serialVersionUID = 5194630813773543054L;
+
+ public static final String[] ANY_OBJECT_DEFAULT_SELECTION = { "key" };
+
+ public AnyObjectDisplayAttributesModalPage(
+ final BaseModal<T> modal,
+ final PageReference pageRef,
+ final List<String> schemaNames,
+ final List<String> dSchemaNames,
+ final String type) {
+
+ super(modal, pageRef, schemaNames, dSchemaNames, type);
+ }
+
+ @Override
+ public String getPrefDetailView() {
+ return String.format(Constants.PREF_ANY_OBJECT_DETAILS_VIEW, type);
+ }
+
+ @Override
+ public String getPrefAttributeView() {
+ return String.format(Constants.PREF_ANY_OBJECT_PLAIN_ATTRS_VIEW, type);
+ }
+
+ @Override
+ public String getPrefDerivedAttributeView() {
+ return String.format(Constants.PREF_ANY_OBJECT_DER_ATTRS_VIEW, type);
+ }
+
+ @Override
+ public Class<AnyObjectTO> getTOClass() {
+ return AnyObjectTO.class;
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/24f035b4/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 b07db36..6cd7521 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
@@ -26,7 +26,6 @@ import java.util.List;
import org.apache.commons.lang3.SerializationUtils;
import org.apache.syncope.client.console.SyncopeConsoleSession;
import org.apache.syncope.client.console.commons.Constants;
-import org.apache.syncope.client.console.pages.AnyObjectDisplayAttributesModalPage;
import org.apache.syncope.client.console.rest.AnyObjectRestClient;
import org.apache.syncope.client.console.status.StatusModal;
import org.apache.syncope.client.console.wicket.extensions.markup.html.repeater.data.table.ActionColumn;
@@ -108,6 +107,8 @@ public class AnyObjectSearchResultPanel extends AnySearchResultPanel<AnyObjectTO
}
+ setWindowClosedReloadCallback(displayAttributeModal);
+
columns.add(new ActionColumn<AnyObjectTO, String>(new ResourceModel("actions", "")) {
private static final long serialVersionUID = -3503023501954863131L;
@@ -116,26 +117,25 @@ public class AnyObjectSearchResultPanel extends AnySearchResultPanel<AnyObjectTO
public ActionLinksPanel<AnyObjectTO> getActions(final String componentId, final IModel<AnyObjectTO> model) {
final ActionLinksPanel.Builder<AnyObjectTO> panel = ActionLinksPanel.builder(page.getPageReference());
- panel.
- add(new ActionLink<AnyObjectTO>() {
+ panel.add(new ActionLink<AnyObjectTO>() {
- private static final long serialVersionUID = -7978723352517770645L;
+ private static final long serialVersionUID = -7978723352517770645L;
- @Override
- public void onClick(final AjaxRequestTarget target, final AnyObjectTO ignore) {
+ @Override
+ public void onClick(final AjaxRequestTarget target, final AnyObjectTO ignore) {
final IModel<AnyHandler<AnyObjectTO>> formModel
= new CompoundPropertyModel<>(new AnyHandler<>(model.getObject()));
- altDefaultModal.setFormModel(formModel);
+ altDefaultModal.setFormModel(formModel);
- target.add(altDefaultModal.setContent(new StatusModal<AnyObjectTO>(
- altDefaultModal, pageRef, formModel.getObject().getInnerObject(), false)));
+ target.add(altDefaultModal.setContent(new StatusModal<AnyObjectTO>(
+ altDefaultModal, pageRef, formModel.getObject().getInnerObject(), false)));
- altDefaultModal.header(new Model<>(
- getString("any.edit", new Model<>(new AnyHandler<>(model.getObject())))));
+ altDefaultModal.header(new Model<>(
+ getString("any.edit", new Model<>(new AnyHandler<>(model.getObject())))));
- altDefaultModal.show(true);
- }
- }, ActionLink.ActionType.MANAGE_RESOURCES, StandardEntitlement.USER_READ).
+ altDefaultModal.show(true);
+ }
+ }, ActionLink.ActionType.MANAGE_RESOURCES, StandardEntitlement.USER_READ).
add(new ActionLink<AnyObjectTO>() {
private static final long serialVersionUID = -7978723352517770644L;
@@ -192,12 +192,11 @@ public class AnyObjectSearchResultPanel extends AnySearchResultPanel<AnyObjectTO
@Override
public void onClick(final AjaxRequestTarget target, final Serializable ignore) {
- // still missing content
- target.add(modal.setContent(new AnyObjectDisplayAttributesModalPage<>(
- modal, page.getPageReference(), pSchemaNames, dSchemaNames, type)));
-
- modal.header(new ResourceModel("any.attr.display", ""));
- modal.show(true);
+ target.add(displayAttributeModal.setContent(new AnyObjectDisplayAttributesModalPage<>(
+ displayAttributeModal, page.getPageReference(), pSchemaNames, dSchemaNames, type)));
+ displayAttributeModal.addSumbitButton();
+ displayAttributeModal.header(new ResourceModel("any.attr.display", ""));
+ displayAttributeModal.show(true);
}
}, ActionLink.ActionType.CHANGE_VIEW, String.format("%s_%s", type, AnyEntitlement.READ)).add(
new ActionLink<Serializable>() {
@@ -214,9 +213,11 @@ public class AnyObjectSearchResultPanel extends AnySearchResultPanel<AnyObjectTO
return panel.build(componentId);
}
- });
+ }
+ );
return columns;
+
}
public static class Builder extends AnySearchResultPanel.Builder<AnyObjectTO> {
http://git-wip-us.apache.org/repos/asf/syncope/blob/24f035b4/client/console/src/main/java/org/apache/syncope/client/console/panels/DisplayAttributesModalPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/DisplayAttributesModalPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/DisplayAttributesModalPanel.java
new file mode 100644
index 0000000..87398c2
--- /dev/null
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/DisplayAttributesModalPanel.java
@@ -0,0 +1,186 @@
+/*
+ * 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 java.io.Serializable;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import org.apache.syncope.client.console.PreferenceManager;
+import org.apache.syncope.client.console.SyncopeConsoleSession;
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.wicket.markup.html.bootstrap.dialog.BaseModal;
+import org.apache.syncope.client.console.wicket.markup.html.form.AjaxPalettePanel;
+import org.apache.syncope.common.lib.search.SearchableFields;
+import org.apache.syncope.common.lib.to.AnyTO;
+import org.apache.wicket.PageReference;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.LoadableDetachableModel;
+import org.apache.wicket.model.PropertyModel;
+import org.apache.wicket.model.util.ListModel;
+
+/**
+ * Modal window with Display attributes form.
+ *
+ * @param <T> can be {@link AnyTO} or {@link org.apache.syncope.client.console.wizards.any.AnyHandler}
+ */
+public abstract class DisplayAttributesModalPanel<T extends Serializable> extends AbstractModalPanel<T> {
+
+ private static final long serialVersionUID = -4274117450918385110L;
+
+ /**
+ * Max allowed selections.
+ */
+ private static final int MAX_SELECTIONS = 9;
+
+ private final PreferenceManager prefMan = new PreferenceManager();
+
+ private final List<String> selectedDetails;
+
+ private final List<String> selectedPlainSchemas;
+
+ private final List<String> selectedDerSchemas;
+
+ protected final String type;
+
+ public DisplayAttributesModalPanel(
+ final BaseModal<T> modal,
+ final PageReference pageRef,
+ final List<String> schemaNames,
+ final List<String> dSchemaNames) {
+ this(modal, pageRef, schemaNames, dSchemaNames, null);
+ }
+
+ public DisplayAttributesModalPanel(
+ final BaseModal<T> modal,
+ final PageReference pageRef,
+ final List<String> schemaNames,
+ final List<String> dSchemaNames,
+ final String type) {
+
+ super(modal, pageRef);
+ this.type = type;
+
+ final IModel<List<String>> fnames = new LoadableDetachableModel<List<String>>() {
+
+ private static final long serialVersionUID = 5275935387613157437L;
+
+ @Override
+ protected List<String> load() {
+ return SearchableFields.get(getTOClass());
+ }
+ };
+
+ final IModel<List<String>> names = new LoadableDetachableModel<List<String>>() {
+
+ private static final long serialVersionUID = 5275935387613157437L;
+
+ @Override
+ protected List<String> load() {
+ return schemaNames;
+ }
+ };
+
+ final IModel<List<String>> dsnames = new LoadableDetachableModel<List<String>>() {
+
+ private static final long serialVersionUID = 5275935387613157437L;
+
+ @Override
+ protected List<String> load() {
+ return dSchemaNames;
+ }
+ };
+
+ selectedDetails = prefMan.getList(getRequest(), getPrefDetailView());
+ selectedPlainSchemas = prefMan.getList(getRequest(), getPrefAttributeView());
+ selectedDerSchemas = prefMan.getList(getRequest(), getPrefDerivedAttributeView());
+
+ final WebMarkupContainer container = new WebMarkupContainer("container");
+ container.setOutputMarkupId(true);
+ add(container);
+
+ final AjaxPalettePanel<String> plainSchema =
+ new AjaxPalettePanel.Builder<String>()
+ .setAllowOrder(true)
+ .setAllowMoveAll(true)
+ .build("plainSchemas",
+ new PropertyModel<List<String>>(this, "selectedPlainSchemas"),
+ new ListModel<>(names.getObject()));
+
+ plainSchema.hideLabel();
+ plainSchema.setOutputMarkupId(true);
+ container.add(plainSchema);
+
+ final AjaxPalettePanel<String> details =
+ new AjaxPalettePanel.Builder<String>()
+ .setAllowOrder(true)
+ .setAllowMoveAll(true)
+ .build("details",
+ new PropertyModel<List<String>>(this, "selectedDetails"),
+ new ListModel<>(fnames.getObject()));
+
+ details.hideLabel();
+ details.setOutputMarkupId(true);
+ container.add(details);
+
+ final AjaxPalettePanel<String> derSchema =
+ new AjaxPalettePanel.Builder<String>()
+ .setAllowOrder(true)
+ .setAllowMoveAll(true)
+ .build("derSchemas",
+ new PropertyModel<List<String>>(this, "selectedDerSchemas"),
+ new ListModel<>(dsnames.getObject()));
+ derSchema.hideLabel();
+ derSchema.setOutputMarkupId(true);
+ container.add(derSchema);
+ }
+
+ @Override
+ public void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
+ if (selectedDetails.size() + selectedPlainSchemas.size() + selectedDerSchemas.size()
+ > MAX_SELECTIONS) {
+
+ error(getString("tooManySelections"));
+ onError(target, form);
+ } else {
+ final Map<String, List<String>> prefs = new HashMap<>();
+
+ prefs.put(getPrefDetailView(), selectedDetails);
+ prefs.put(getPrefAttributeView(), selectedPlainSchemas);
+ prefs.put(getPrefDerivedAttributeView(), selectedDerSchemas);
+ prefMan.setList(getRequest(), getResponse(), prefs);
+
+ info(getString(Constants.OPERATION_SUCCEEDED));
+ modal.close(target);
+ SyncopeConsoleSession.get().getNotificationPanel().refresh(target);
+ }
+ }
+
+ public abstract String getPrefDetailView();
+
+ public abstract String getPrefAttributeView();
+
+ public abstract String getPrefDerivedAttributeView();
+
+ public abstract Class<? extends AnyTO> getTOClass();
+
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/24f035b4/client/console/src/main/java/org/apache/syncope/client/console/panels/GroupDisplayAttributesModalPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/GroupDisplayAttributesModalPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/GroupDisplayAttributesModalPanel.java
new file mode 100644
index 0000000..0519781
--- /dev/null
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/GroupDisplayAttributesModalPanel.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.panels;
+
+import java.io.Serializable;
+import java.util.List;
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.wicket.markup.html.bootstrap.dialog.BaseModal;
+import org.apache.syncope.common.lib.to.GroupTO;
+import org.apache.wicket.PageReference;
+
+/**
+ * Modal window with Display group attributes form.
+ *
+ * @param <T> can be {@link org.apache.syncope.common.lib.to.AnyTO} or
+ * {@link org.apache.syncope.client.console.wizards.any.AnyHandler}
+ */
+public class GroupDisplayAttributesModalPanel<T extends Serializable> extends DisplayAttributesModalPanel<T> {
+
+ private static final long serialVersionUID = 5194630813773543054L;
+
+ public static final String[] GROUP_DEFAULT_SELECTION = { "key", "name" };
+
+ public GroupDisplayAttributesModalPanel(
+ final BaseModal<T> modal,
+ final PageReference pageRef,
+ final List<String> schemaNames,
+ final List<String> dSchemaNames) {
+ super(modal, pageRef, schemaNames, dSchemaNames);
+ }
+
+ @Override
+ public String getPrefDetailView() {
+ return Constants.PREF_GROUP_DETAILS_VIEW;
+ }
+
+ @Override
+ public String getPrefAttributeView() {
+ return Constants.PREF_GROUP_PLAIN_ATTRS_VIEW;
+ }
+
+ @Override
+ public String getPrefDerivedAttributeView() {
+ return Constants.PREF_GROUP_DER_ATTRS_VIEW;
+ }
+
+ @Override
+ public Class<GroupTO> getTOClass() {
+ return GroupTO.class;
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/24f035b4/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 8fe8502..17d2d87 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
@@ -27,7 +27,6 @@ import java.util.List;
import org.apache.commons.lang3.SerializationUtils;
import org.apache.syncope.client.console.SyncopeConsoleSession;
import org.apache.syncope.client.console.commons.Constants;
-import org.apache.syncope.client.console.pages.GroupDisplayAttributesModalPage;
import org.apache.syncope.client.console.rest.GroupRestClient;
import org.apache.syncope.client.console.status.StatusModal;
import org.apache.syncope.client.console.wicket.extensions.markup.html.repeater.data.table.ActionColumn;
@@ -97,14 +96,16 @@ public class GroupSearchResultPanel extends AnySearchResultPanel<GroupTO> {
// Add defaults in case of no selection
if (columns.isEmpty()) {
- for (String name : GroupDisplayAttributesModalPage.GROUP_DEFAULT_SELECTION) {
+ for (String name : GroupDisplayAttributesModalPanel.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));
+ Arrays.asList(GroupDisplayAttributesModalPanel.GROUP_DEFAULT_SELECTION));
}
+ setWindowClosedReloadCallback(displayAttributeModal);
+
columns.add(new ActionColumn<GroupTO, String>(new ResourceModel("actions", "")) {
private static final long serialVersionUID = -3503023501954863131L;
@@ -188,11 +189,11 @@ public class GroupSearchResultPanel extends AnySearchResultPanel<GroupTO> {
@Override
public void onClick(final AjaxRequestTarget target, final Serializable ignore) {
- target.add(modal.setContent(new GroupDisplayAttributesModalPage<>(
- modal, page.getPageReference(), pSchemaNames, dSchemaNames)));
-
- modal.header(new ResourceModel("any.attr.display", ""));
- modal.show(true);
+ target.add(displayAttributeModal.setContent(new GroupDisplayAttributesModalPanel<>(
+ displayAttributeModal, page.getPageReference(), pSchemaNames, dSchemaNames)));
+ displayAttributeModal.addSumbitButton();
+ displayAttributeModal.header(new ResourceModel("any.attr.display", ""));
+ displayAttributeModal.show(true);
}
}, ActionLink.ActionType.CHANGE_VIEW, StandardEntitlement.GROUP_READ).add(
new ActionLink<Serializable>() {
http://git-wip-us.apache.org/repos/asf/syncope/blob/24f035b4/client/console/src/main/java/org/apache/syncope/client/console/panels/RealmModalPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/RealmModalPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/RealmModalPanel.java
index fdb6f70..af64f81 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/RealmModalPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/RealmModalPanel.java
@@ -78,8 +78,8 @@ public class RealmModalPanel extends AbstractModalPanel<RealmTO> {
} else {
realmRestClient.update(updatedRealmTO);
}
- info(getString(Constants.OPERATION_SUCCEEDED));
modal.close(target);
+ info(getString(Constants.OPERATION_SUCCEEDED));
} catch (Exception e) {
LOG.error("While creating or updating realm", e);
error(getString(Constants.ERROR) + ": " + e.getMessage());
http://git-wip-us.apache.org/repos/asf/syncope/blob/24f035b4/client/console/src/main/java/org/apache/syncope/client/console/panels/UserDisplayAttributesModalPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/UserDisplayAttributesModalPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/UserDisplayAttributesModalPanel.java
new file mode 100644
index 0000000..baf5f4e
--- /dev/null
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/UserDisplayAttributesModalPanel.java
@@ -0,0 +1,68 @@
+/*
+ * 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 java.io.Serializable;
+import java.util.List;
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.wicket.markup.html.bootstrap.dialog.BaseModal;
+import org.apache.syncope.common.lib.to.UserTO;
+import org.apache.wicket.PageReference;
+
+/**
+ * Modal window with Display user attributes form.
+ *
+ * @param <T> can be {@link org.apache.syncope.common.lib.to.AnyTO} or
+ * {@link org.apache.syncope.client.console.wizards.any.AnyHandler}
+ */
+public class UserDisplayAttributesModalPanel<T extends Serializable> extends DisplayAttributesModalPanel<T> {
+
+ private static final long serialVersionUID = 5194630813773543054L;
+
+ public static final String[] USER_DEFAULT_SELECTION = { "key", "username", "status" };
+
+ public UserDisplayAttributesModalPanel(
+ final BaseModal<T> modal,
+ final PageReference pageRef,
+ final List<String> schemaNames,
+ final List<String> dSchemaNames) {
+ super(modal, pageRef, schemaNames, dSchemaNames);
+ }
+
+ @Override
+ public String getPrefDetailView() {
+ return Constants.PREF_USERS_DETAILS_VIEW;
+ }
+
+ @Override
+ public String getPrefAttributeView() {
+ return Constants.PREF_USERS_PLAIN_ATTRS_VIEW;
+ }
+
+ @Override
+ public String getPrefDerivedAttributeView() {
+ return Constants.PREF_USERS_DER_ATTRS_VIEW;
+ }
+
+ @Override
+ public Class<UserTO> getTOClass() {
+ return UserTO.class;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/24f035b4/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 837e985..11e3ffa 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
@@ -27,7 +27,6 @@ import java.util.List;
import org.apache.commons.lang3.SerializationUtils;
import org.apache.syncope.client.console.SyncopeConsoleSession;
import org.apache.syncope.client.console.commons.Constants;
-import org.apache.syncope.client.console.pages.UserDisplayAttributesModalPage;
import org.apache.syncope.client.console.rest.UserRestClient;
import org.apache.syncope.client.console.status.StatusModal;
import org.apache.syncope.client.console.wicket.extensions.markup.html.repeater.data.table.ActionColumn;
@@ -97,14 +96,16 @@ public class UserSearchResultPanel extends AnySearchResultPanel<UserTO> {
// Add defaults in case of no selection
if (columns.isEmpty()) {
- for (String name : UserDisplayAttributesModalPage.USER_DEFAULT_SELECTION) {
+ for (String name : UserDisplayAttributesModalPanel.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));
+ Arrays.asList(UserDisplayAttributesModalPanel.USER_DEFAULT_SELECTION));
}
+ setWindowClosedReloadCallback(displayAttributeModal);
+
columns.add(new ActionColumn<UserTO, String>(new ResourceModel("actions", "")) {
private static final long serialVersionUID = -3503023501954863131L;
@@ -204,11 +205,12 @@ public class UserSearchResultPanel extends AnySearchResultPanel<UserTO> {
@Override
public void onClick(final AjaxRequestTarget target, final Serializable ignore) {
- target.add(modal.setContent(new UserDisplayAttributesModalPage<>(
- modal, page.getPageReference(), pSchemaNames, dSchemaNames)));
+ target.add(displayAttributeModal.setContent(new UserDisplayAttributesModalPanel<>(
+ displayAttributeModal, page.getPageReference(), pSchemaNames, dSchemaNames)));
- modal.header(new ResourceModel("any.attr.display", ""));
- modal.show(true);
+ displayAttributeModal.header(new ResourceModel("any.attr.display", ""));
+ displayAttributeModal.addSumbitButton();
+ displayAttributeModal.show(true);
}
}, ActionLink.ActionType.CHANGE_VIEW, StandardEntitlement.USER_READ).add(
new ActionLink<Serializable>() {
http://git-wip-us.apache.org/repos/asf/syncope/blob/24f035b4/client/console/src/main/java/org/apache/syncope/client/console/panels/search/AnySelectionSearchResultPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/search/AnySelectionSearchResultPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/search/AnySelectionSearchResultPanel.java
index eea91f0..b194981 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/search/AnySelectionSearchResultPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/search/AnySelectionSearchResultPanel.java
@@ -26,7 +26,7 @@ import java.util.Collection;
import java.util.Collections;
import java.util.Date;
import java.util.List;
-import org.apache.syncope.client.console.pages.AnyObjectDisplayAttributesModalPage;
+import org.apache.syncope.client.console.panels.AnyObjectDisplayAttributesModalPage;
import org.apache.syncope.client.console.panels.AnySearchResultPanel;
import org.apache.syncope.client.console.rest.AbstractAnyRestClient;
import org.apache.syncope.client.console.wicket.extensions.markup.html.repeater.data.table.ActionColumn;
@@ -129,11 +129,12 @@ public abstract class AnySelectionSearchResultPanel<T extends AnyTO> extends Any
@Override
public void onClick(final AjaxRequestTarget target, final T ignore) {
// still missing content
- target.add(modal.setContent(new AnyObjectDisplayAttributesModalPage<>(
- modal, page.getPageReference(), pSchemaNames, dSchemaNames, type)));
-
- modal.header(new ResourceModel("any.attr.display", ""));
- modal.show(true);
+ target.add(altDefaultModal.setContent(new AnyObjectDisplayAttributesModalPage<>(
+ altDefaultModal, page.getPageReference(), pSchemaNames, dSchemaNames, type)));
+
+ altDefaultModal.addSumbitButton();
+ altDefaultModal.header(new ResourceModel("any.attr.display", ""));
+ altDefaultModal.show(true);
}
}, ActionLink.ActionType.CHANGE_VIEW, String.format("%s_%s", type, AnyEntitlement.READ)).
add(new ActionLink<T>() {
http://git-wip-us.apache.org/repos/asf/syncope/blob/24f035b4/client/console/src/main/java/org/apache/syncope/client/console/wizards/WizardMgtPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wizards/WizardMgtPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/wizards/WizardMgtPanel.java
index 601aeac..6d295f7 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/wizards/WizardMgtPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/wizards/WizardMgtPanel.java
@@ -83,6 +83,8 @@ public abstract class WizardMgtPanel<T extends Serializable> extends Panel imple
* Modal window.
*/
protected final BaseModal<T> altDefaultModal = new BaseModal<T>("alternativeDefaultModal");
+
+ protected final BaseModal<T> displayAttributeModal = new BaseModal<T>("displayAttributeModal");
protected WizardMgtPanel(final String id) {
this(id, false);
@@ -96,6 +98,7 @@ public abstract class WizardMgtPanel<T extends Serializable> extends Panel imple
super.add(modal);
super.add(altDefaultModal);
+ super.add(displayAttributeModal);
container = new WebMarkupContainer("container");
container.setOutputMarkupPlaceholderTag(true).setOutputMarkupId(true);
http://git-wip-us.apache.org/repos/asf/syncope/blob/24f035b4/client/console/src/main/resources/org/apache/syncope/client/console/pages/DisplayAttributesModalPage.html
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/pages/DisplayAttributesModalPage.html b/client/console/src/main/resources/org/apache/syncope/client/console/pages/DisplayAttributesModalPage.html
deleted file mode 100644
index c48612f..0000000
--- a/client/console/src/main/resources/org/apache/syncope/client/console/pages/DisplayAttributesModalPage.html
+++ /dev/null
@@ -1,118 +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.
--->
-<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
- <wicket:head>
- <style>
- div.group{
- width:450px;
- }
-
- div.group div{
- width:150;
- height: 25px;
- float:left;
- }
-
- div.group div input {
- width: 30px;
- }
-
- div#attributes-view {
- display: block;
- clear: both;
- float: none;
- overflow: auto;
- margin-top: 0px;
- margin-bottom: 20px;
- margin-left: 10px;
- margin-right: 10px;
- }
-
- .submit{
- display: block;
- clear: both;
- float: none;
- margin-left: 10px;
- }
-
- span.grouplabel{
- display:block;
- clear: both;
- margin-left: 10px;
- margin-bottom: 10px;
- font-weight: bold;
- }
- </style>
- </wicket:head>
- <wicket:extend>
- <form wicket:id="form">
- <div id="attributes-view">
- <p class="ui-widget ui-corner-all ui-widget-header">
- <wicket:message key="title"/>
- </p>
-
- <span class="grouplabel"><wicket:message key="plainSchemas"/></span>
- <span wicket:id="dCheckGroup">
- <div class="group">
- <div wicket:id="details">
- <input type="checkbox" wicket:id="dcheck"/>
- <span wicket:id="dname">[schema name]</span>
- </div>
- </div>
- </span>
-
- <span wicket:id="plainSchemas">[schemas]</span>
-
- <span wicket:id="dschemas">[derived schemas]</span>
-
- </div>
-
- <wicket:fragment wicket:id="sfragment">
- <span wicket:id="psCheckGroup">
- <div class="group">
- <div wicket:id="plainSchemas">
- <input type="checkbox" wicket:id="scheck"/>
- <span wicket:id="sname">[schema name]</span>
- </div>
- </div>
- </span>
- </wicket:fragment>
-
- <wicket:fragment wicket:id="dsfragment">
- <span class="grouplabel"><wicket:message key="derSchemas"/></span>
- <span wicket:id="dsCheckGroup">
- <div class="group">
- <div wicket:id="derSchemas">
- <input type="checkbox" wicket:id="dscheck"/>
- <span wicket:id="dsname">[schema name]</span>
- </div>
- </div>
- </span>
- </wicket:fragment>
-
- <wicket:fragment wicket:id="emptyFragment">
- </wicket:fragment>
-
- <div class="submit">
- <input type="submit" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" wicket:id="submit"/>
- <input type="button" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" wicket:id="cancel"/>
- </div>
- </form>
- </wicket:extend>
-</html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/24f035b4/client/console/src/main/resources/org/apache/syncope/client/console/pages/DisplayAttributesModalPage.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/pages/DisplayAttributesModalPage.properties b/client/console/src/main/resources/org/apache/syncope/client/console/pages/DisplayAttributesModalPage.properties
deleted file mode 100644
index 2b5c573..0000000
--- a/client/console/src/main/resources/org/apache/syncope/client/console/pages/DisplayAttributesModalPage.properties
+++ /dev/null
@@ -1,32 +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.
-title=Change display attributes
-tooManySelections=Too many columns to be shown
-plainSchemas=Plain attributes
-derSchemas=Derived attributes
-
-firstname=Firstname
-surname=Surname
-userId=User Id
-edit=Edit
-delete=Delete
-status=Status
-token=Token
-username=Username
-creationDate=Creation Date
-tokenValued=Valued
-tokenNotValued=Not valued
http://git-wip-us.apache.org/repos/asf/syncope/blob/24f035b4/client/console/src/main/resources/org/apache/syncope/client/console/panels/DisplayAttributesModalPanel.html
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/panels/DisplayAttributesModalPanel.html b/client/console/src/main/resources/org/apache/syncope/client/console/panels/DisplayAttributesModalPanel.html
new file mode 100644
index 0000000..069f48a
--- /dev/null
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/panels/DisplayAttributesModalPanel.html
@@ -0,0 +1,56 @@
+<!--
+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">
+ <wicket:extend>
+ <div class="form-group">
+ <span wicket:id="container">
+ <div class="box">
+ <div class="box-header with-border">
+ <h3 class="box-title"><wicket:message key="details"/></h3>
+ </div>
+ <div class="box-body">
+ <div id="group-forum">
+ <span wicket:id="details">[details]</span>
+ </div>
+ </div>
+ </div>
+ <div class="box">
+ <div class="box-header with-border">
+ <h3 class="box-title"><wicket:message key="plainSchemas"/></h3>
+ </div>
+ <div class="box-body">
+ <div id="group-forum">
+ <span wicket:id="plainSchemas">[plainSchemas]</span>
+ </div>
+ </div>
+ </div>
+ <div class="box">
+ <div class="box-header with-border">
+ <h3 class="box-title"><wicket:message key="derSchemas"/></h3>
+ </div>
+ <div class="box-body">
+ <div id="group-forum">
+ <span wicket:id="derSchemas">[derSchemas]</span>
+ </div>
+ </div>
+ </div>
+ </span>
+ </div>
+ </wicket:extend>
+</html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/24f035b4/client/console/src/main/resources/org/apache/syncope/client/console/panels/DisplayAttributesModalPanel.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/panels/DisplayAttributesModalPanel.properties b/client/console/src/main/resources/org/apache/syncope/client/console/panels/DisplayAttributesModalPanel.properties
new file mode 100644
index 0000000..02e70e0
--- /dev/null
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/panels/DisplayAttributesModalPanel.properties
@@ -0,0 +1,20 @@
+# 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.
+tooManySelections=Too many columns to be shown
+plainSchemas=Plain attributes
+derSchemas=Derived attributes
+details=Details
http://git-wip-us.apache.org/repos/asf/syncope/blob/24f035b4/client/console/src/main/resources/org/apache/syncope/client/console/panels/DisplayAttributesModalPanel_it.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/panels/DisplayAttributesModalPanel_it.properties b/client/console/src/main/resources/org/apache/syncope/client/console/panels/DisplayAttributesModalPanel_it.properties
new file mode 100644
index 0000000..6ec4cad
--- /dev/null
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/panels/DisplayAttributesModalPanel_it.properties
@@ -0,0 +1,20 @@
+# 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.
+tooManySelections=Sono state selezionate troppe colonne
+plainSchemas=Plain attributes
+derSchemas=Derived attributes
+details=Dettagli
http://git-wip-us.apache.org/repos/asf/syncope/blob/24f035b4/client/console/src/main/resources/org/apache/syncope/client/console/panels/DisplayAttributesModalPanel_pt_BR.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/panels/DisplayAttributesModalPanel_pt_BR.properties b/client/console/src/main/resources/org/apache/syncope/client/console/panels/DisplayAttributesModalPanel_pt_BR.properties
new file mode 100644
index 0000000..47f1774
--- /dev/null
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/panels/DisplayAttributesModalPanel_pt_BR.properties
@@ -0,0 +1,20 @@
+# 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.
+tooManySelections=Muitas colunas para exibir
+plainSchemas=Plain attributes
+derSchemas=Derived attributes
+details=Detalhes
http://git-wip-us.apache.org/repos/asf/syncope/blob/24f035b4/client/console/src/main/resources/org/apache/syncope/client/console/wizards/WizardMgtPanel.html
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/wizards/WizardMgtPanel.html b/client/console/src/main/resources/org/apache/syncope/client/console/wizards/WizardMgtPanel.html
index 64e4a90..7a00891 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/wizards/WizardMgtPanel.html
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/wizards/WizardMgtPanel.html
@@ -45,6 +45,7 @@ under the License.
<div wicket:id="modal" />
<div wicket:id="alternativeDefaultModal" />
+ <div wicket:id="displayAttributeModal" />
</wicket:panel>
</body>
</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/24f035b4/fit/core-reference/src/test/java/org/apache/syncope/fit/console/DisplayAttributesITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/console/DisplayAttributesITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/console/DisplayAttributesITCase.java
new file mode 100644
index 0000000..d8b2068
--- /dev/null
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/console/DisplayAttributesITCase.java
@@ -0,0 +1,72 @@
+/*
+ * 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.fit.console;
+
+import de.agilecoders.wicket.core.markup.html.bootstrap.dialog.Modal;
+import org.apache.syncope.client.console.pages.Realms;
+import org.apache.syncope.client.console.pages.Types;
+import org.apache.wicket.util.tester.FormTester;
+import org.junit.Before;
+import org.junit.FixMethodOrder;
+import org.junit.Test;
+import org.junit.runners.MethodSorters;
+
+@FixMethodOrder(MethodSorters.JVM)
+public class DisplayAttributesITCase extends AbstractConsoleITCase<String> {
+
+ @Before
+ public void login() {
+ doLogin(ADMIN_UNAME, ADMIN_PWD);
+ wicketTester.clickLink("body:realmsLI:realms");
+ wicketTester.assertRenderedPage(Realms.class);
+ }
+
+ @Test
+ public void read() {
+ wicketTester.clickLink("body:content:body:tabbedPanel:tabs-container:tabs:3:link");
+ wicketTester.clickLink("body:content:body:tabbedPanel:panel:"
+ + "container:content:searchContainer:resultTable:"
+ + "tablePanel:groupForm:checkgroup:dataTable:topToolbars:"
+ + "toolbars:1:headers:3:header:label:panelChangeView:changeViewLink");
+
+ wicketTester.assertComponent("body:content:body:tabbedPanel:panel:displayAttributeModal", Modal.class);
+ }
+
+ @Test
+ public void set() {
+ wicketTester.clickLink("body:content:body:tabbedPanel:tabs-container:tabs:3:link");
+ wicketTester.clickLink("body:content:body:tabbedPanel:panel:"
+ + "container:content:searchContainer:resultTable:"
+ + "tablePanel:groupForm:checkgroup:dataTable:topToolbars:"
+ + "toolbars:1:headers:3:header:label:panelChangeView:changeViewLink");
+
+ wicketTester.assertComponent("body:content:body:tabbedPanel:panel:displayAttributeModal", Modal.class);
+
+ final FormTester formTester =
+ wicketTester.newFormTester("body:content:body:tabbedPanel:panel:displayAttributeModal:form");
+
+ formTester.setValue("content:container:details:paletteField:recorder", "status");
+
+ wicketTester.
+ clickLink("body:content:body:tabbedPanel:panel:displayAttributeModal:dialog:footer:inputs:0:submit");
+ wicketTester.assertInfoMessages("Operation executed successfully");
+
+ wicketTester.clearFeedbackMessages();
+ }
+}