You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by il...@apache.org on 2016/04/06 16:58:13 UTC

syncope git commit: [SYNCOPE-797] Fix provided

Repository: syncope
Updated Branches:
  refs/heads/master 97af20e14 -> 7300ccdf3


[SYNCOPE-797] Fix provided


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

Branch: refs/heads/master
Commit: 7300ccdf35693a02192d9d56ace592ee676c612f
Parents: 97af20e
Author: Francesco Chicchiriccò <il...@apache.org>
Authored: Wed Apr 6 16:58:06 2016 +0200
Committer: Francesco Chicchiriccò <il...@apache.org>
Committed: Wed Apr 6 16:58:06 2016 +0200

----------------------------------------------------------------------
 .../console/panels/ConnectorDetailsPanel.java   | 61 +++++++-------------
 .../console/panels/ConnectorDetailsPanel.html   |  2 +-
 .../console/panels/ConnectorModal.properties    |  3 +-
 .../console/panels/ConnectorModal_it.properties |  3 +-
 .../panels/ConnectorModal_pt_BR.properties      |  3 +-
 5 files changed, 27 insertions(+), 45 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/7300ccdf/client/console/src/main/java/org/apache/syncope/client/console/panels/ConnectorDetailsPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/ConnectorDetailsPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/ConnectorDetailsPanel.java
index 7bccd18..39c56bd 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/ConnectorDetailsPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/ConnectorDetailsPanel.java
@@ -38,9 +38,6 @@ import org.apache.wicket.markup.html.panel.Panel;
 import org.apache.wicket.model.IModel;
 import org.apache.wicket.model.PropertyModel;
 
-/**
- * Modal window with Connector form.
- */
 public class ConnectorDetailsPanel extends Panel {
 
     private static final long serialVersionUID = -2435937897614232137L;
@@ -51,28 +48,23 @@ public class ConnectorDetailsPanel extends Panel {
         super(id, model);
         setOutputMarkupId(true);
 
-        final AjaxTextFieldPanel displayName = new AjaxTextFieldPanel(
+        AjaxTextFieldPanel displayName = new AjaxTextFieldPanel(
                 "displayName", "displayName", new PropertyModel<String>(model.getObject(), "displayName"), false);
         displayName.setOutputMarkupId(true);
         displayName.addRequiredLabel();
         add(displayName);
 
-        final AjaxTextFieldPanel location = new AjaxTextFieldPanel(
-                "location",
-                "location",
-                new PropertyModel<String>(model.getObject(), "location"),
-                false);
-        location.setRequired(true);
+        AjaxTextFieldPanel location = new AjaxTextFieldPanel(
+                "location", "location", new PropertyModel<String>(model.getObject(), "location"), false);
         location.addRequiredLabel();
         location.setOutputMarkupId(true);
         location.setEnabled(false);
         add(location);
 
         final AjaxDropDownChoicePanel<String> bundleName = new AjaxDropDownChoicePanel<>(
-                "connectorName",
-                "connectorName",
+                "bundleName",
+                "bundleName",
                 new PropertyModel<String>(model.getObject(), "bundleName"), false);
-
         ((DropDownChoice<String>) bundleName.getField()).setNullValid(true);
         bundleName.setChoices(CollectionUtils.collect(bundles, new Transformer<ConnBundleTO, String>() {
 
@@ -81,8 +73,6 @@ public class ConnectorDetailsPanel extends Panel {
                 return input.getBundleName();
             }
         }, new ArrayList<String>()));
-
-        bundleName.setRequired(true);
         bundleName.addRequiredLabel();
         bundleName.setOutputMarkupId(true);
         bundleName.setEnabled(model.getObject().getKey() == null || model.getObject().getKey() == 0);
@@ -90,17 +80,11 @@ public class ConnectorDetailsPanel extends Panel {
         add(bundleName);
 
         final AjaxDropDownChoicePanel<String> version = new AjaxDropDownChoicePanel<>(
-                "version",
-                "version",
-                new PropertyModel<String>(model.getObject(), "version"), false);
-
+                "version", "version", new PropertyModel<String>(model.getObject(), "version"), false);
         version.setChoices(getVersions(model.getObject(), bundles));
-
-        version.setRequired(true);
         version.addRequiredLabel();
         version.setEnabled(model.getObject().getBundleName() != null);
         version.setOutputMarkupId(true);
-        version.addRequiredLabel();
         version.getField().setOutputMarkupId(true);
         add(version);
 
@@ -111,8 +95,15 @@ public class ConnectorDetailsPanel extends Panel {
             @Override
             protected void onUpdate(final AjaxRequestTarget target) {
                 ((DropDownChoice<String>) bundleName.getField()).setNullValid(false);
-                version.setChoices(getVersions(model.getObject(), bundles));
                 version.setEnabled(true);
+
+                List<String> versions = getVersions(model.getObject(), bundles);
+                if (versions.size() == 1) {
+                    model.getObject().setVersion(versions.get(0));
+                    version.getField().setModelObject(versions.get(0));
+                }
+                version.setChoices(versions);
+
                 target.add(version);
             }
         });
@@ -122,39 +113,27 @@ public class ConnectorDetailsPanel extends Panel {
         }
 
         add(new AjaxSpinnerFieldPanel.Builder<Integer>().min(0).max(Integer.MAX_VALUE).build(
-                "connRequestTimeout",
-                "connRequestTimeout",
-                Integer.class,
+                "connRequestTimeout", "connRequestTimeout", Integer.class,
                 new PropertyModel<Integer>(model, "connRequestTimeout")));
 
         add(new AjaxSpinnerFieldPanel.Builder<Integer>().min(0).max(Integer.MAX_VALUE).build(
-                "poolMaxObjects",
-                "poolMaxObjects",
-                Integer.class,
+                "poolMaxObjects", "poolMaxObjects", Integer.class,
                 new PropertyModel<Integer>(model.getObject().getPoolConf(), "maxObjects")));
 
         add(new AjaxSpinnerFieldPanel.Builder<Integer>().min(0).max(Integer.MAX_VALUE).build(
-                "poolMinIdle",
-                "poolMinIdle",
-                Integer.class,
+                "poolMinIdle", "poolMinIdle", Integer.class,
                 new PropertyModel<Integer>(model.getObject().getPoolConf(), "minIdle")));
 
         add(new AjaxSpinnerFieldPanel.Builder<Integer>().min(0).max(Integer.MAX_VALUE).build(
-                "poolMaxIdle",
-                "poolMaxIdle",
-                Integer.class,
+                "poolMaxIdle", "poolMaxIdle", Integer.class,
                 new PropertyModel<Integer>(model.getObject().getPoolConf(), "maxIdle")));
 
         add(new AjaxSpinnerFieldPanel.Builder<Long>().min(0L).max(Long.MAX_VALUE).build(
-                "poolMaxWait",
-                "poolMaxWait",
-                Long.class,
+                "poolMaxWait", "poolMaxWait", Long.class,
                 new PropertyModel<Long>(model.getObject().getPoolConf(), "maxWait")));
 
         add(new AjaxSpinnerFieldPanel.Builder<Long>().min(0L).max(Long.MAX_VALUE).build(
-                "poolMinEvictableIdleTime",
-                "poolMinEvictableIdleTime",
-                Long.class,
+                "poolMinEvictableIdleTime", "poolMinEvictableIdleTime", Long.class,
                 new PropertyModel<Long>(model.getObject().getPoolConf(), "minEvictableIdleTimeMillis")));
     }
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/7300ccdf/client/console/src/main/resources/org/apache/syncope/client/console/panels/ConnectorDetailsPanel.html
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/panels/ConnectorDetailsPanel.html b/client/console/src/main/resources/org/apache/syncope/client/console/panels/ConnectorDetailsPanel.html
index 390176c..87fc624 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/panels/ConnectorDetailsPanel.html
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/panels/ConnectorDetailsPanel.html
@@ -31,7 +31,7 @@ under the License.
       </div>
 
       <div class="form-group">
-        <span wicket:id="connectorName">[connectorName]</span>
+        <span wicket:id="bundleName">[bundleName]</span>
       </div>
 
       <div class="form-group">

http://git-wip-us.apache.org/repos/asf/syncope/blob/7300ccdf/client/console/src/main/resources/org/apache/syncope/client/console/panels/ConnectorModal.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/panels/ConnectorModal.properties b/client/console/src/main/resources/org/apache/syncope/client/console/panels/ConnectorModal.properties
index 69ea457..91dae7b 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/panels/ConnectorModal.properties
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/panels/ConnectorModal.properties
@@ -19,7 +19,7 @@ configuration=Configuration
 capabilities=Capabilities
 
 displayName=Display name
-bundleName=Bundle name
+bundleName=Bundle
 version=Version
 connRequestTimeout=Request timeout (sec)
 action=Action
@@ -42,3 +42,4 @@ poolMaxIdle=Max idle objects
 poolMaxWait=Max waiting time (msec)
 poolMinEvictableIdleTime=Min eviction time (msec)
 new=New
+connectorName=Connector Bundle

http://git-wip-us.apache.org/repos/asf/syncope/blob/7300ccdf/client/console/src/main/resources/org/apache/syncope/client/console/panels/ConnectorModal_it.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/panels/ConnectorModal_it.properties b/client/console/src/main/resources/org/apache/syncope/client/console/panels/ConnectorModal_it.properties
index 50336ec..b012649 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/panels/ConnectorModal_it.properties
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/panels/ConnectorModal_it.properties
@@ -18,7 +18,7 @@ general=Generale
 configuration=Configurazione
 capabilities=Capability
 
-bundleName=Bundle name
+bundleName=Bundle
 version=Versione
 connRequestTimeout=Timeout richiesta (sec)
 action=Azione
@@ -42,3 +42,4 @@ poolMaxIdle=Max oggetti inattivi
 poolMaxWait=Tempo max attesa
 poolMinEvictableIdleTime=Tempo min espulsione
 new=Nuovo
+connectorName=Connector Bundle

http://git-wip-us.apache.org/repos/asf/syncope/blob/7300ccdf/client/console/src/main/resources/org/apache/syncope/client/console/panels/ConnectorModal_pt_BR.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/panels/ConnectorModal_pt_BR.properties b/client/console/src/main/resources/org/apache/syncope/client/console/panels/ConnectorModal_pt_BR.properties
index 28e5825..a209703 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/panels/ConnectorModal_pt_BR.properties
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/panels/ConnectorModal_pt_BR.properties
@@ -19,7 +19,7 @@ configuration=Configura\u00e7\u00e3o
 capabilities=Capacidades
 
 displayName=Mostrar Nome
-bundleName=Nome do Pacote
+bundleName=Bundle
 version=Vers\u00e3o
 connRequestTimeout=Timeout da Requisi\u00e7\u00e3o (seg)
 action=A\u00e7\u00e3o
@@ -42,3 +42,4 @@ poolMaxIdle=Max idle objects
 poolMaxWait=Max waiting time (msec)
 poolMinEvictableIdleTime=Min eviction time (msec)
 new=Novo
+connectorName=Connector Bundle