syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ilgro...@apache.org
Subject [1/4] syncope git commit: [SYNCOPE-1188] Making key mandatory for dynamic realms
Date Tue, 08 Aug 2017 10:40:55 GMT
Repository: syncope
Updated Branches:
  refs/heads/2_0_X c138cefd4 -> 4af3c2175
  refs/heads/master 2cab5d247 -> b7458d070


[SYNCOPE-1188] Making key mandatory for dynamic realms


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

Branch: refs/heads/2_0_X
Commit: c6ffe56b201687df6af77e98f07bc8326ca500b1
Parents: c138cef
Author: Francesco Chicchiriccò <ilgrosso@apache.org>
Authored: Tue Aug 8 11:49:25 2017 +0200
Committer: Francesco Chicchiriccò <ilgrosso@apache.org>
Committed: Tue Aug 8 11:54:33 2017 +0200

----------------------------------------------------------------------
 .../console/panels/DynRealmDirectoryPanel.java  | 22 ++++++++++++++++++++
 .../console/panels/DynRealmModalPanel.java      |  1 +
 .../console/panels/RoleDirectoryPanel.java      |  6 +++---
 3 files changed, 26 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/c6ffe56b/client/console/src/main/java/org/apache/syncope/client/console/panels/DynRealmDirectoryPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/DynRealmDirectoryPanel.java
b/client/console/src/main/java/org/apache/syncope/client/console/panels/DynRealmDirectoryPanel.java
index c20efb5..8098aef 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/DynRealmDirectoryPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/DynRealmDirectoryPanel.java
@@ -24,16 +24,19 @@ import java.util.Collection;
 import java.util.Collections;
 import java.util.Iterator;
 import java.util.List;
+import org.apache.commons.lang3.StringUtils;
 import org.apache.syncope.client.console.SyncopeConsoleSession;
 import org.apache.syncope.client.console.commons.Constants;
 import org.apache.syncope.client.console.commons.DirectoryDataProvider;
 import org.apache.syncope.client.console.commons.SortableDataProviderComparator;
+import org.apache.syncope.client.console.pages.BasePage;
 import org.apache.syncope.client.console.panels.DynRealmDirectoryPanel.DynRealmDataProvider;
 import org.apache.syncope.client.console.rest.DynRealmRestClient;
 import org.apache.syncope.client.console.wicket.markup.html.form.ActionLink;
 import org.apache.syncope.client.console.wicket.markup.html.form.ActionsPanel;
 import org.apache.syncope.client.console.wizards.DynRealmWrapper;
 import org.apache.syncope.client.console.wizards.WizardMgtPanel;
+import org.apache.syncope.common.lib.SyncopeClientException;
 import org.apache.syncope.common.lib.to.DynRealmTO;
 import org.apache.syncope.common.lib.types.StandardEntitlement;
 import org.apache.wicket.PageReference;
@@ -130,6 +133,25 @@ public class DynRealmDirectoryPanel extends
             }
         }, ActionLink.ActionType.EDIT, StandardEntitlement.DYNREALM_UPDATE);
 
+        panel.add(new ActionLink<DynRealmTO>() {
+
+            private static final long serialVersionUID = 3766262567901552032L;
+
+            @Override
+            public void onClick(final AjaxRequestTarget target, final DynRealmTO ignore)
{
+                try {
+                    restClient.delete(model.getObject().getKey());
+                    SyncopeConsoleSession.get().info(getString(Constants.OPERATION_SUCCEEDED));
+                    target.add(container);
+                } catch (SyncopeClientException e) {
+                    LOG.error("While deleting dynamic realm {}", model.getObject().getKey(),
e);
+                    SyncopeConsoleSession.get().error(StringUtils.isBlank(e.getMessage())
+                            ? e.getClass().getName() : e.getMessage());
+                }
+                ((BasePage) pageRef.getPage()).getNotificationPanel().refresh(target);
+            }
+        }, ActionLink.ActionType.DELETE, StandardEntitlement.DYNREALM_DELETE, true);
+
         return panel;
     }
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/c6ffe56b/client/console/src/main/java/org/apache/syncope/client/console/panels/DynRealmModalPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/DynRealmModalPanel.java
b/client/console/src/main/java/org/apache/syncope/client/console/panels/DynRealmModalPanel.java
index dd22e23..734bd62 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/DynRealmModalPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/DynRealmModalPanel.java
@@ -65,6 +65,7 @@ public class DynRealmModalPanel extends AbstractModalPanel<DynRealmWrapper>
{
         AjaxTextFieldPanel key = new AjaxTextFieldPanel(
                 "key", "key", new PropertyModel<String>(dynRealmWrapper.getInnerObject(),
"key"), false);
         key.setReadOnly(!create);
+        key.setRequired(true);
         add(key);
 
         add(new Accordion("cond", Collections.<ITab>singletonList(

http://git-wip-us.apache.org/repos/asf/syncope/blob/c6ffe56b/client/console/src/main/java/org/apache/syncope/client/console/panels/RoleDirectoryPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/RoleDirectoryPanel.java
b/client/console/src/main/java/org/apache/syncope/client/console/panels/RoleDirectoryPanel.java
index bb7d9d9..2231bdf 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/RoleDirectoryPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/RoleDirectoryPanel.java
@@ -246,9 +246,9 @@ public class RoleDirectoryPanel extends DirectoryPanel<RoleTO, RoleWrapper,
Role
                     SyncopeConsoleSession.get().info(getString(Constants.OPERATION_SUCCEEDED));
                     target.add(container);
                 } catch (SyncopeClientException e) {
-                    LOG.error("While deleting object {}", model.getObject().getKey(), e);
-                    SyncopeConsoleSession.get().error(StringUtils.isBlank(e.getMessage())
? e.getClass().
-                            getName() : e.getMessage());
+                    LOG.error("While deleting dynamic realm {}", model.getObject().getKey(),
e);
+                    SyncopeConsoleSession.get().error(StringUtils.isBlank(e.getMessage())
+                            ? e.getClass().getName() : e.getMessage());
                 }
                 ((BasePage) pageRef.getPage()).getNotificationPanel().refresh(target);
             }


Mime
View raw message