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 2016/01/15 15:58:48 UTC

syncope git commit: [SYNCOPE-743] topology toggle menu improvements: still working on tasks management

Repository: syncope
Updated Branches:
  refs/heads/master 6fa78799b -> 084746e9a


[SYNCOPE-743] topology toggle menu improvements: still working on tasks management


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

Branch: refs/heads/master
Commit: 084746e9afd6007c6b3661b646ff79978ab8e345
Parents: 6fa7879
Author: fmartelli <fa...@gmail.com>
Authored: Fri Jan 15 15:58:36 2016 +0100
Committer: fmartelli <fa...@gmail.com>
Committed: Fri Jan 15 15:58:36 2016 +0100

----------------------------------------------------------------------
 .../client/console/topology/Topology.java       | 32 +++++----
 .../console/topology/TopologyNodePanel.java     | 18 ++++-
 .../console/topology/TopologyTogglePanel.java   | 70 +++++++++++++++++++-
 .../META-INF/resources/css/syncopeConsole.css   |  1 +
 .../META-INF/resources/css/topology.css         | 16 +++--
 .../console/topology/TopologyTogglePanel.html   |  9 +++
 .../topology/TopologyTogglePanel.properties     |  4 ++
 .../topology/TopologyTogglePanel_it.properties  |  4 ++
 .../TopologyTogglePanel_pt_BR.properties        |  4 ++
 9 files changed, 131 insertions(+), 27 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/084746e9/client/console/src/main/java/org/apache/syncope/client/console/topology/Topology.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/topology/Topology.java b/client/console/src/main/java/org/apache/syncope/client/console/topology/Topology.java
index 6a20d08..cc74ac8 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/topology/Topology.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/topology/Topology.java
@@ -551,26 +551,24 @@ public class Topology extends BasePage {
             }
         });
 
-        if (node.getKind() == TopologyNode.Kind.CONNECTOR_SERVER
-                || node.getKind() == TopologyNode.Kind.FS_PATH
-                || node.getKind() == TopologyNode.Kind.CONNECTOR
-                || node.getKind() == TopologyNode.Kind.RESOURCE) {
+        behaviors.add(new AjaxEventBehavior(Constants.ON_CLICK) {
 
-            behaviors.add(new AjaxEventBehavior(Constants.ON_CLICK) {
+            private static final long serialVersionUID = -9027652037484739586L;
 
-                private static final long serialVersionUID = -9027652037484739586L;
-
-                @Override
-                protected String findIndicatorId() {
-                    return StringUtils.EMPTY;
-                }
+            @Override
+            protected String findIndicatorId() {
+                return StringUtils.EMPTY;
+            }
 
-                @Override
-                protected void onEvent(final AjaxRequestTarget target) {
-                    togglePanel.toggleWithContent(target, node);
-                }
-            });
-        }
+            @Override
+            protected void onEvent(final AjaxRequestTarget target) {
+                togglePanel.toggleWithContent(target, node);
+                target.appendJavaScript(String.format(
+                        "$('.window').removeClass(\"active-window\").addClass(\"inactive-window\"); "
+                        + "$(document.getElementById('%s'))."
+                        + "removeClass(\"inactive-window\").addClass(\"active-window\");", node.getKey()));
+            }
+        });
 
         panel.add(behaviors.toArray(new Behavior[] {}));
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/084746e9/client/console/src/main/java/org/apache/syncope/client/console/topology/TopologyNodePanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/topology/TopologyNodePanel.java b/client/console/src/main/java/org/apache/syncope/client/console/topology/TopologyNodePanel.java
index f692f02..1982b09 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/topology/TopologyNodePanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/topology/TopologyNodePanel.java
@@ -32,14 +32,22 @@ public class TopologyNodePanel extends Panel implements IAjaxIndicatorAware {
 
     private static final long serialVersionUID = -8775095410207013913L;
 
+    protected enum Status {
+        ACTIVE,
+        INACTIVE
+
+    }
+
+    private Status status = Status.INACTIVE;
+
     public TopologyNodePanel(
             final String id,
             final TopologyNode node) {
 
         super(id);
 
-        final String resourceName = node.getDisplayName().length() > 20
-                ? node.getDisplayName().subSequence(0, 19) + "..."
+        final String resourceName = node.getDisplayName().length() > 14
+                ? node.getDisplayName().subSequence(0, 12) + "..."
                 : node.getDisplayName();
 
         add(new Label("label", resourceName));
@@ -65,7 +73,7 @@ public class TopologyNodePanel extends Panel implements IAjaxIndicatorAware {
                 add(new AttributeAppender("class", "topology_conn", " "));
                 break;
             default:
-                title = node.getDisplayName().length() > 20 ? node.getDisplayName() : "";
+                title = node.getDisplayName().length() > 14 ? node.getDisplayName() : "";
                 add(new AttributeAppender("class", "topology_res", " "));
         }
 
@@ -95,4 +103,8 @@ public class TopologyNodePanel extends Panel implements IAjaxIndicatorAware {
     public String getAjaxIndicatorMarkupId() {
         return "veil";
     }
+
+    public void setStatus(final Status status) {
+        this.status = status;
+    }
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/084746e9/client/console/src/main/java/org/apache/syncope/client/console/topology/TopologyTogglePanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/topology/TopologyTogglePanel.java b/client/console/src/main/java/org/apache/syncope/client/console/topology/TopologyTogglePanel.java
index 360fbc7..61e19ac 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/topology/TopologyTogglePanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/topology/TopologyTogglePanel.java
@@ -42,6 +42,7 @@ 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.Model;
+import org.apache.wicket.model.ResourceModel;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -79,6 +80,9 @@ public class TopologyTogglePanel extends TogglePanel {
         setHeader(target, node.getDisplayName());
 
         switch (node.getKind()) {
+            case SYNCOPE:
+                container.addOrReplace(getSyncopeFragment(pageRef));
+                break;
             case CONNECTOR_SERVER:
                 container.addOrReplace(getLocationFragment(node, pageRef));
                 break;
@@ -104,6 +108,29 @@ public class TopologyTogglePanel extends TogglePanel {
         return new Fragment("actions", "emptyFragment", this);
     }
 
+    private Fragment getSyncopeFragment(final PageReference pageRef) {
+        final Fragment fragment = new Fragment("actions", "syncopeActions", this);
+
+        final AjaxLink<String> tasks = new IndicatingAjaxLink<String>("tasks") {
+
+            private static final long serialVersionUID = 3776750333491622263L;
+
+            @Override
+            public void onClick(final AjaxRequestTarget target) {
+                final IModel<ConnInstanceTO> model = new CompoundPropertyModel<>(null);
+                modal.setFormModel(model);
+                target.add(modal);
+                modal.header(new ResourceModel("task.generic.list", "Generic tasks"));
+                modal.show(true);
+            }
+        };
+        fragment.add(tasks);
+
+        MetaDataRoleAuthorizationStrategy.authorize(tasks, ENABLE, StandardEntitlement.TASK_LIST);
+
+        return fragment;
+    }
+
     private Fragment getLocationFragment(final TopologyNode node, final PageReference pageRef) {
         final Fragment fragment = new Fragment("actions", "locationActions", this);
 
@@ -265,9 +292,50 @@ public class TopologyTogglePanel extends TogglePanel {
             }
         };
         fragment.add(edit);
-
         MetaDataRoleAuthorizationStrategy.authorize(edit, ENABLE, StandardEntitlement.RESOURCE_UPDATE);
 
+        final AjaxLink<String> propagation = new IndicatingAjaxLink<String>("propagation") {
+
+            private static final long serialVersionUID = 3776750333491622263L;
+
+            @Override
+            public void onClick(final AjaxRequestTarget target) {
+                target.add(modal);
+                modal.header(new ResourceModel("task.propagation.list", "Propagation tasks"));
+                modal.show(true);
+            }
+        };
+        fragment.add(propagation);
+        MetaDataRoleAuthorizationStrategy.authorize(propagation, ENABLE, StandardEntitlement.TASK_LIST);
+
+        final AjaxLink<String> synchronization = new IndicatingAjaxLink<String>("synchronization") {
+
+            private static final long serialVersionUID = 3776750333491622263L;
+
+            @Override
+            public void onClick(final AjaxRequestTarget target) {
+                target.add(modal);
+                modal.header(new ResourceModel("task.synchronization.list", "Synchronization tasks"));
+                modal.show(true);
+            }
+        };
+        fragment.add(synchronization);
+        MetaDataRoleAuthorizationStrategy.authorize(synchronization, ENABLE, StandardEntitlement.TASK_LIST);
+
+        final AjaxLink<String> push = new IndicatingAjaxLink<String>("push") {
+
+            private static final long serialVersionUID = 3776750333491622263L;
+
+            @Override
+            public void onClick(final AjaxRequestTarget target) {
+                target.add(modal);
+                modal.header(new ResourceModel("task.push.list", "Push tasks"));
+                modal.show(true);
+            }
+        };
+        fragment.add(push);
+        MetaDataRoleAuthorizationStrategy.authorize(push, ENABLE, StandardEntitlement.TASK_LIST);
+
         return fragment;
     }
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/084746e9/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 d9bd850..d0ff401 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
@@ -188,6 +188,7 @@ div.basepage-content{
 
 .modal {
   background: rgba(0, 0, 0, 0) none repeat scroll 0 0;
+  z-index: 7000 !important;
 }
 
 .wizard-view {

http://git-wip-us.apache.org/repos/asf/syncope/blob/084746e9/client/console/src/main/resources/META-INF/resources/css/topology.css
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/META-INF/resources/css/topology.css b/client/console/src/main/resources/META-INF/resources/css/topology.css
index 23093ca..65ca712 100644
--- a/client/console/src/main/resources/META-INF/resources/css/topology.css
+++ b/client/console/src/main/resources/META-INF/resources/css/topology.css
@@ -35,11 +35,21 @@
   font-family:helvetica;padding:0.0em;
   font-size:0.9em;
   vertical-align: middle;
+  cursor: pointer;
+}
+
+.active-window {
+  box-shadow: 2px 2px 8px rgb(0, 166, 90);
+}
+
+.inactive-window {
+  box-shadow: 2px 2px 19px #aaa;
 }
 
 .window p {
   margin: 0px !important;
   line-height: 1.5em;
+  font-size: 1.5em;
   display: inline-table;
 }
 
@@ -59,12 +69,6 @@
   background-color:rgba(250,230,0,0.09);
 }
 
-.topology_cs,
-.topology_conn,
-.topology_res {
-  cursor: pointer;
-}
-
 .window:hover {
   box-shadow: 2px 2px 19px #444;
   -o-box-shadow: 2px 2px 19px #444;

http://git-wip-us.apache.org/repos/asf/syncope/blob/084746e9/client/console/src/main/resources/org/apache/syncope/client/console/topology/TopologyTogglePanel.html
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/topology/TopologyTogglePanel.html b/client/console/src/main/resources/org/apache/syncope/client/console/topology/TopologyTogglePanel.html
index 99f3a3a..fb861a4 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/topology/TopologyTogglePanel.html
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/topology/TopologyTogglePanel.html
@@ -36,6 +36,9 @@ under the License.
         <ul class="menu">
           <li><i class="fa fa-minus"></i><a href="#" wicket:id="delete"><wicket:message key="resource.menu.remove"/></a></li>
           <li><i class="fa fa-pencil"></i><a href="#" wicket:id="edit"><wicket:message key="resource.menu.edit"/></a></li>
+          <li><i class="fa fa-arrow-right"></i><a href="#" wicket:id="propagation"><wicket:message key="task.propagation.list"/></a></li>
+          <li><i class="fa fa-chevron-circle-left"></i><a href="#" wicket:id="synchronization"><wicket:message key="task.synchronization.list"/></a></li>
+          <li><i class="fa fa-chevron-circle-right"></i><a href="#" wicket:id="push"><wicket:message key="task.push.list"/></a></li>
         </ul>
       </wicket:fragment>
 
@@ -45,6 +48,12 @@ under the License.
         </ul>
       </wicket:fragment>
 
+      <wicket:fragment wicket:id="syncopeActions">
+        <ul class="menu">
+          <li><i class="fa fa-tasks"></i><a href="#" wicket:id="tasks"><wicket:message key="task.generic.list"/></a></li>
+        </ul>
+      </wicket:fragment>
+
       <wicket:fragment wicket:id="emptyFragment"></wicket:fragment>
     </wicket:extend>
   </body>

http://git-wip-us.apache.org/repos/asf/syncope/blob/084746e9/client/console/src/main/resources/org/apache/syncope/client/console/topology/TopologyTogglePanel.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/topology/TopologyTogglePanel.properties b/client/console/src/main/resources/org/apache/syncope/client/console/topology/TopologyTogglePanel.properties
index 8bbd6e7..cd9654d 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/topology/TopologyTogglePanel.properties
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/topology/TopologyTogglePanel.properties
@@ -26,3 +26,7 @@ resource.menu.edit=Edit resource
 
 connector.edit=Edit connector {0}
 resource.edit=Edit resource {0}
+task.generic.list=Generic tasks
+task.propagation.list=Propagation tasks
+task.synchronization.list=Synchronization tasks
+task.push.list=Push tasks

http://git-wip-us.apache.org/repos/asf/syncope/blob/084746e9/client/console/src/main/resources/org/apache/syncope/client/console/topology/TopologyTogglePanel_it.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/topology/TopologyTogglePanel_it.properties b/client/console/src/main/resources/org/apache/syncope/client/console/topology/TopologyTogglePanel_it.properties
index 7204af1..da88de1 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/topology/TopologyTogglePanel_it.properties
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/topology/TopologyTogglePanel_it.properties
@@ -24,3 +24,7 @@ connector.menu.edit=Modifica connettore
 resource.menu.add=Aggiungi nuova risorsa
 resource.menu.remove=Rimuovi risorsa
 resource.menu.edit=Modifica risorsa
+task.generic.list=Task generici
+task.propagation.list=Task di propagazione
+task.synchronization.list=Task di sincronizzazione
+task.push.list=Push task

http://git-wip-us.apache.org/repos/asf/syncope/blob/084746e9/client/console/src/main/resources/org/apache/syncope/client/console/topology/TopologyTogglePanel_pt_BR.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/topology/TopologyTogglePanel_pt_BR.properties b/client/console/src/main/resources/org/apache/syncope/client/console/topology/TopologyTogglePanel_pt_BR.properties
index 0ee9526..5484c4b 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/topology/TopologyTogglePanel_pt_BR.properties
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/topology/TopologyTogglePanel_pt_BR.properties
@@ -24,3 +24,7 @@ connector.menu.edit=Alterar conector
 resource.menu.add=Adicionar novo recurso
 resource.menu.remove=Retire recurso
 resource.menu.edit=Alterar recurso
+task.generic.list=Generic tasks
+task.propagation.list=Propagation tasks
+task.synchronization.list=Synchronization tasks
+task.push.list=Push tasks