syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From matte...@apache.org
Subject syncope git commit: [SYNCOPE-773] resize job modals and add compose modal for reports
Date Thu, 12 Jan 2017 11:10:07 GMT
Repository: syncope
Updated Branches:
  refs/heads/2_0_X 5c92a9da5 -> f387fbb05


[SYNCOPE-773] resize job modals and add compose modal for reports


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

Branch: refs/heads/2_0_X
Commit: f387fbb057415c0b59ab4b026f3c808c4abaeac3
Parents: 5c92a9d
Author: Matteo Di Carlo <matteo.dicarlo@tirasa.net>
Authored: Tue Jan 10 10:10:58 2017 +0100
Committer: Matteo Di Carlo <matteo.dicarlo@tirasa.net>
Committed: Thu Jan 12 12:06:57 2017 +0100

----------------------------------------------------------------------
 .../reports/ReportletDirectoryPanel.java        |  2 +-
 .../client/console/widgets/JobActionPanel.java  | 62 +++++++++++++++++++-
 .../client/console/widgets/JobWidget.java       | 28 ++++++++-
 .../client/console/widgets/JobActionPanel.html  |  1 +
 .../client/console/widgets/JobWidget.html       |  1 +
 .../client/console/widgets/JobWidget.properties |  2 +
 .../console/widgets/JobWidget_it.properties     |  1 +
 .../console/widgets/JobWidget_pt_BR.properties  |  1 +
 .../console/widgets/JobWidget_ru.properties     |  1 +
 9 files changed, 95 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/f387fbb0/client/console/src/main/java/org/apache/syncope/client/console/reports/ReportletDirectoryPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/reports/ReportletDirectoryPanel.java
b/client/console/src/main/java/org/apache/syncope/client/console/reports/ReportletDirectoryPanel.java
index b9ef700..7968fe5 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/reports/ReportletDirectoryPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/reports/ReportletDirectoryPanel.java
@@ -84,7 +84,7 @@ public class ReportletDirectoryPanel extends DirectoryPanel<
 
     private final String report;
 
-    protected ReportletDirectoryPanel(
+    public ReportletDirectoryPanel(
             final BaseModal<ReportTO> baseModal, final String report, final PageReference
pageRef) {
         super(BaseModal.CONTENT_ID, pageRef, false);
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/f387fbb0/client/console/src/main/java/org/apache/syncope/client/console/widgets/JobActionPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/widgets/JobActionPanel.java
b/client/console/src/main/java/org/apache/syncope/client/console/widgets/JobActionPanel.java
index 30797ae..400e0c7 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/widgets/JobActionPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/widgets/JobActionPanel.java
@@ -18,12 +18,14 @@
  */
 package org.apache.syncope.client.console.widgets;
 
+import de.agilecoders.wicket.core.markup.html.bootstrap.dialog.Modal;
 import java.io.Serializable;
 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.pages.BasePage;
 import org.apache.syncope.client.console.reports.ReportWizardBuilder;
+import org.apache.syncope.client.console.reports.ReportletDirectoryPanel;
 import org.apache.syncope.client.console.rest.ReportRestClient;
 import org.apache.syncope.client.console.rest.TaskRestClient;
 import org.apache.syncope.client.console.tasks.SchedTaskWizardBuilder;
@@ -36,11 +38,13 @@ import org.apache.syncope.common.lib.to.ReportTO;
 import org.apache.syncope.common.lib.to.SchedTaskTO;
 import org.apache.syncope.common.lib.types.JobAction;
 import org.apache.syncope.common.lib.types.JobType;
+import org.apache.syncope.common.lib.types.StandardEntitlement;
 import org.apache.syncope.common.rest.api.service.NotificationService;
 import org.apache.syncope.common.rest.api.service.ReportService;
 import org.apache.syncope.common.rest.api.service.TaskService;
 import org.apache.wicket.PageReference;
 import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy;
 import org.apache.wicket.event.Broadcast;
 import org.apache.wicket.event.IEvent;
 import org.apache.wicket.markup.html.panel.Fragment;
@@ -57,17 +61,23 @@ public class JobActionPanel extends WizardMgtPanel<Serializable>
{
 
     private final BaseModal<Serializable> jobModal;
 
+    private final BaseModal<ReportTO> reportModal;
+
     public JobActionPanel(
             final String id,
             final JobTO jobTO,
             final JobWidget widget,
             final BaseModal<Serializable> jobModal,
+            final BaseModal<ReportTO> reportModal,
             final PageReference pageRef) {
-
         super(id, true);
         this.jobModal = jobModal;
+        this.reportModal = reportModal;
         setOutputMarkupId(true);
-        setWindowClosedReloadCallback(modal);
+        setWindowClosedReloadCallback(jobModal);
+        jobModal.size(Modal.Size.Large);
+        setWindowClosedReloadCallback(reportModal);
+        this.reportModal.size(Modal.Size.Large);
 
         IndicatorAjaxLink<Void> link = new IndicatorAjaxLink<Void>("edit") {
 
@@ -121,6 +131,54 @@ public class JobActionPanel extends WizardMgtPanel<Serializable>
{
         link.setVisible(!(null != jobTO.getType() && JobType.NOTIFICATION.equals(jobTO.getType())));
         addInnerObject(link);
 
+        IndicatorAjaxLink<Void> composeLink;
+        composeLink =
+                new IndicatorAjaxLink<Void>("compose") {
+
+            private static final long serialVersionUID = -7978723352517770644L;
+
+            @Override
+            public void onClick(final AjaxRequestTarget target) {
+
+                if (null != jobTO.getType()) {
+                    switch (jobTO.getType()) {
+
+                        case NOTIFICATION:
+                            break;
+
+                        case REPORT:
+
+                            final ReportTO reportTO = new ReportRestClient().read(jobTO.getRefKey());
+
+                            target.add(JobActionPanel.this.reportModal.setContent(
+                                    new ReportletDirectoryPanel(reportModal, jobTO.getRefKey(),
pageRef)));
+
+                            MetaDataRoleAuthorizationStrategy.authorize(
+                                    reportModal.getForm(),
+                                    ENABLE, StandardEntitlement.REPORT_UPDATE);
+
+                            reportModal.header(new StringResourceModel(
+                                    "reportlet.conf", this, new Model<>(reportTO)
+                            ));
+
+                            reportModal.show(true);
+
+                            break;
+
+                        case TASK:
+                            break;
+
+                        default:
+                            break;
+                    }
+                }
+            }
+        };
+        composeLink.setOutputMarkupPlaceholderTag(true);
+        composeLink.setVisible(!(null != jobTO.getType() && (JobType.TASK.equals(jobTO.getType())
+                || JobType.NOTIFICATION.equals(jobTO.getType()))));
+        addInnerObject(composeLink);
+
         Fragment controls;
         if (jobTO.isRunning()) {
             controls = new Fragment("controls", "runningFragment", this);

http://git-wip-us.apache.org/repos/asf/syncope/blob/f387fbb0/client/console/src/main/java/org/apache/syncope/client/console/widgets/JobWidget.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/widgets/JobWidget.java
b/client/console/src/main/java/org/apache/syncope/client/console/widgets/JobWidget.java
index bc9db0d..dcd1b2b 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/widgets/JobWidget.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/widgets/JobWidget.java
@@ -18,6 +18,7 @@
  */
 package org.apache.syncope.client.console.widgets;
 
+import de.agilecoders.wicket.core.markup.html.bootstrap.dialog.Modal;
 import de.agilecoders.wicket.core.markup.html.bootstrap.tabs.AjaxBootstrapTabbedPanel;
 import java.io.Serializable;
 import java.util.ArrayList;
@@ -41,6 +42,7 @@ import org.apache.syncope.client.console.wicket.markup.html.form.ActionLinksPane
 import org.apache.syncope.client.console.wizards.WizardMgtPanel;
 import org.apache.syncope.common.lib.to.ExecTO;
 import org.apache.syncope.common.lib.to.JobTO;
+import org.apache.syncope.common.lib.to.ReportTO;
 import org.apache.syncope.common.lib.types.StandardEntitlement;
 import org.apache.syncope.common.rest.api.service.NotificationService;
 import org.apache.syncope.common.rest.api.service.ReportService;
@@ -106,6 +108,17 @@ public class JobWidget extends BaseWidget {
         }
     };
 
+    private final BaseModal<ReportTO> reportModal = new BaseModal<ReportTO>("reportModal")
{
+
+        private static final long serialVersionUID = 1L;
+
+        @Override
+        protected void onConfigure() {
+            super.onConfigure();
+            setFooterVisible(true);
+        }
+    };
+
     private static List<JobTO> getAvailable(final SyncopeConsoleSession session) {
         List<JobTO> available = new ArrayList<>();
 
@@ -171,6 +184,19 @@ public class JobWidget extends BaseWidget {
             }
         });
 
+        add(reportModal);
+        reportModal.setWindowClosedCallback(new ModalWindow.WindowClosedCallback() {
+
+            private static final long serialVersionUID = 1L;
+
+            @Override
+            public void onClose(final AjaxRequestTarget target) {
+                reportModal.show(false);
+            }
+        });
+
+        reportModal.size(Modal.Size.Large);
+
         available = getAvailable(SyncopeConsoleSession.get());
         recent = getRecent(SyncopeConsoleSession.get());
 
@@ -296,7 +322,7 @@ public class JobWidget extends BaseWidget {
 
                     JobTO jobTO = rowModel.getObject();
                     JobActionPanel panel = new JobActionPanel(componentId, jobTO, JobWidget.this,
JobWidget.this.modal,
-                            pageRef);
+                            JobWidget.this.reportModal, pageRef);
                     MetaDataRoleAuthorizationStrategy.authorize(panel, WebPage.ENABLE,
                             String.format("%s,%s%s,%s",
                                     StandardEntitlement.TASK_EXECUTE,

http://git-wip-us.apache.org/repos/asf/syncope/blob/f387fbb0/client/console/src/main/resources/org/apache/syncope/client/console/widgets/JobActionPanel.html
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/widgets/JobActionPanel.html
b/client/console/src/main/resources/org/apache/syncope/client/console/widgets/JobActionPanel.html
index 6be7c2b..1ca771a 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/widgets/JobActionPanel.html
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/widgets/JobActionPanel.html
@@ -29,5 +29,6 @@ under the License.
     </wicket:fragment>
     <!--<div wicket:id="modal"/>-->
     <a href="#" wicket:id="edit" ><i id="actionLink" class="glyphicon glyphicon-pencil"
alt="edit icon" title="Edit"></i></a> 
+    <a href="#" wicket:id="compose" ><i id="actionLink" class="fa fa-puzzle-piece"
alt="compose icon" title="Compose"></i></a> 
   </wicket:extend>
 </html>

http://git-wip-us.apache.org/repos/asf/syncope/blob/f387fbb0/client/console/src/main/resources/org/apache/syncope/client/console/widgets/JobWidget.html
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/widgets/JobWidget.html
b/client/console/src/main/resources/org/apache/syncope/client/console/widgets/JobWidget.html
index 2aa16c3..a062133 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/widgets/JobWidget.html
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/widgets/JobWidget.html
@@ -31,5 +31,6 @@ under the License.
     </div>
     <div wicket:id="modal"/>
     <div wicket:id="detailModal"/>
+    <div wicket:id="reportModal"/>
   </wicket:panel>
 </html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/syncope/blob/f387fbb0/client/console/src/main/resources/org/apache/syncope/client/console/widgets/JobWidget.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/widgets/JobWidget.properties
b/client/console/src/main/resources/org/apache/syncope/client/console/widgets/JobWidget.properties
index eb9f6d3..55aa441 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/widgets/JobWidget.properties
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/widgets/JobWidget.properties
@@ -24,3 +24,5 @@ available=Available
 recent=Recent
 jobs=Jobs
 execution.view=Result status of execution '${key}'
+reportlet.conf=Reportlet configuration for ${name}
+

http://git-wip-us.apache.org/repos/asf/syncope/blob/f387fbb0/client/console/src/main/resources/org/apache/syncope/client/console/widgets/JobWidget_it.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/widgets/JobWidget_it.properties
b/client/console/src/main/resources/org/apache/syncope/client/console/widgets/JobWidget_it.properties
index e898e38..f2666e4 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/widgets/JobWidget_it.properties
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/widgets/JobWidget_it.properties
@@ -24,3 +24,4 @@ available=Disponibili
 recent=Recenti
 jobs=Job
 execution.view=Stato dell'esecuzione'${key}'
+reportlet.conf=reportlet.conf=Configurazione reportlet per ${name}

http://git-wip-us.apache.org/repos/asf/syncope/blob/f387fbb0/client/console/src/main/resources/org/apache/syncope/client/console/widgets/JobWidget_pt_BR.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/widgets/JobWidget_pt_BR.properties
b/client/console/src/main/resources/org/apache/syncope/client/console/widgets/JobWidget_pt_BR.properties
index 109f3df..a90fcdd 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/widgets/JobWidget_pt_BR.properties
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/widgets/JobWidget_pt_BR.properties
@@ -24,3 +24,4 @@ available=Dispon\u00edvel
 recent=Recente
 jobs=Job
 execution.view=Status do resultado da execu\u00e7\u00e3o '${key}'
+reportlet.conf=reportlet.conf=Reportlet configuration for ${name}

http://git-wip-us.apache.org/repos/asf/syncope/blob/f387fbb0/client/console/src/main/resources/org/apache/syncope/client/console/widgets/JobWidget_ru.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/widgets/JobWidget_ru.properties
b/client/console/src/main/resources/org/apache/syncope/client/console/widgets/JobWidget_ru.properties
index e2b39d5..a64afd7 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/widgets/JobWidget_ru.properties
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/widgets/JobWidget_ru.properties
@@ -34,3 +34,4 @@ recent=\u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 \u0432\u044b\u043f
 # jobs=\u00d0\u0097\u00d0\u00b0\u00d0\u00b4\u00d0\u00b0\u00d1\u0087\u00d0\u00b8
 jobs=\u0417\u0430\u0434\u0430\u0447\u0438
 execution.view=\u0421\u0442\u0430\u0442\u0443\u0441 \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442
\u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f '${key}'
+reportlet.conf=reportlet.conf=\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043f\u0430\u043d\u0435\u043b\u0438
\u043e\u0442\u0447\u0435\u0442\u0430 \u0434\u043b\u044f ${name}


Mime
View raw message