syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ilgro...@apache.org
Subject [1/2] syncope git commit: [SYNCOPE-962] Upgrade to Wicket 7.6.0
Date Mon, 02 Jan 2017 11:12:08 GMT
Repository: syncope
Updated Branches:
  refs/heads/2_0_X 8745cb34c -> 830fdee24
  refs/heads/master 4ccc1c404 -> 422140532


[SYNCOPE-962] Upgrade to Wicket 7.6.0


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

Branch: refs/heads/2_0_X
Commit: 830fdee246eff396118938fbab61e076fa499678
Parents: 8745cb3
Author: Francesco Chicchiriccò <ilgrosso@apache.org>
Authored: Mon Jan 2 12:11:46 2017 +0100
Committer: Francesco Chicchiriccò <ilgrosso@apache.org>
Committed: Mon Jan 2 12:11:46 2017 +0100

----------------------------------------------------------------------
 .../syncope/client/console/pages/BasePage.java  |  6 +-
 .../topology/TopologyWebSocketBehavior.java     |  4 +-
 .../ws/api/SyncopeWebSocketBehavior.java        | 93 --------------------
 .../client/console/widgets/JobActionPanel.java  | 64 ++++++--------
 pom.xml                                         |  2 +-
 5 files changed, 34 insertions(+), 135 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/830fdee2/client/console/src/main/java/org/apache/syncope/client/console/pages/BasePage.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/pages/BasePage.java
b/client/console/src/main/java/org/apache/syncope/client/console/pages/BasePage.java
index dc3f724..58c7804 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/pages/BasePage.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/pages/BasePage.java
@@ -34,7 +34,6 @@ import org.apache.syncope.client.console.rest.ConfigurationRestClient;
 import org.apache.syncope.client.console.topology.Topology;
 import org.apache.syncope.client.console.wicket.markup.head.MetaHeaderItem;
 import org.apache.syncope.client.console.wicket.markup.html.bootstrap.dialog.BaseModal;
-import org.apache.syncope.client.console.wicket.protocol.ws.api.SyncopeWebSocketBehavior;
 import org.apache.syncope.client.console.widgets.ApprovalsWidget;
 import org.apache.syncope.client.console.widgets.JobWidget;
 import org.apache.syncope.client.console.widgets.ReconciliationWidget;
@@ -61,6 +60,7 @@ import org.apache.wicket.markup.html.link.BookmarkablePageLink;
 import org.apache.wicket.markup.html.link.Link;
 import org.apache.wicket.markup.html.list.ListItem;
 import org.apache.wicket.markup.html.list.ListView;
+import org.apache.wicket.protocol.ws.api.WebSocketBehavior;
 import org.apache.wicket.protocol.ws.api.message.ConnectedMessage;
 import org.apache.wicket.request.handler.resource.ResourceStreamRequestHandler;
 import org.apache.wicket.request.mapper.parameter.PageParameters;
@@ -88,7 +88,7 @@ public class BasePage extends WebPage implements IAjaxIndicatorAware {
         super(parameters);
 
         // Native WebSocket
-        add(new SyncopeWebSocketBehavior() {
+        add(new WebSocketBehavior() {
 
             private static final long serialVersionUID = 3109256773218160485L;
 
@@ -259,7 +259,7 @@ public class BasePage extends WebPage implements IAjaxIndicatorAware {
             }
         });
         body.add(new Label("domain", SyncopeConsoleSession.get().getDomain()));
-        body.add(new BookmarkablePageLink<Page>("logout", Logout.class));
+        body.add(new BookmarkablePageLink<>("logout", Logout.class));
 
         // set 'active' menu item for everything but extensions
         // 1. check if current class is set to top-level menu

http://git-wip-us.apache.org/repos/asf/syncope/blob/830fdee2/client/console/src/main/java/org/apache/syncope/client/console/topology/TopologyWebSocketBehavior.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/topology/TopologyWebSocketBehavior.java
b/client/console/src/main/java/org/apache/syncope/client/console/topology/TopologyWebSocketBehavior.java
index def404e..6346332 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/topology/TopologyWebSocketBehavior.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/topology/TopologyWebSocketBehavior.java
@@ -28,18 +28,18 @@ import java.util.Set;
 import org.apache.syncope.client.console.SyncopeConsoleSession;
 import org.apache.syncope.client.console.rest.ConnectorRestClient;
 import org.apache.syncope.client.console.rest.ResourceRestClient;
-import org.apache.syncope.client.console.wicket.protocol.ws.api.SyncopeWebSocketBehavior;
 import org.apache.syncope.common.lib.to.ConnInstanceTO;
 import org.apache.syncope.common.lib.to.ResourceTO;
 import org.apache.wicket.Application;
 import org.apache.wicket.Session;
 import org.apache.wicket.ThreadContext;
+import org.apache.wicket.protocol.ws.api.WebSocketBehavior;
 import org.apache.wicket.protocol.ws.api.WebSocketRequestHandler;
 import org.apache.wicket.protocol.ws.api.message.TextMessage;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-public class TopologyWebSocketBehavior extends SyncopeWebSocketBehavior {
+public class TopologyWebSocketBehavior extends WebSocketBehavior {
 
     private static final long serialVersionUID = -1653665542635275551L;
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/830fdee2/client/console/src/main/java/org/apache/syncope/client/console/wicket/protocol/ws/api/SyncopeWebSocketBehavior.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wicket/protocol/ws/api/SyncopeWebSocketBehavior.java
b/client/console/src/main/java/org/apache/syncope/client/console/wicket/protocol/ws/api/SyncopeWebSocketBehavior.java
deleted file mode 100644
index b104c77..0000000
--- a/client/console/src/main/java/org/apache/syncope/client/console/wicket/protocol/ws/api/SyncopeWebSocketBehavior.java
+++ /dev/null
@@ -1,93 +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.wicket.protocol.ws.api;
-
-import java.util.Map;
-import org.apache.wicket.Component;
-import org.apache.wicket.MetaDataKey;
-import org.apache.wicket.core.request.handler.IPartialPageRequestHandler;
-import org.apache.wicket.markup.head.IHeaderResponse;
-import org.apache.wicket.markup.head.JavaScriptHeaderItem;
-import org.apache.wicket.markup.head.OnDomReadyHeaderItem;
-import org.apache.wicket.protocol.ws.WebSocketSettings;
-import org.apache.wicket.protocol.ws.api.WebSocketBehavior;
-import org.apache.wicket.protocol.ws.api.WicketWebSocketJQueryResourceReference;
-import org.apache.wicket.request.cycle.RequestCycle;
-import org.apache.wicket.util.lang.Args;
-import org.apache.wicket.util.lang.Generics;
-import org.apache.wicket.util.template.PackageTextTemplate;
-
-/**
- * Temporary work-around class for WICKET-6262.
- */
-public abstract class SyncopeWebSocketBehavior extends WebSocketBehavior {
-
-    private static final long serialVersionUID = -2137694236966234985L;
-
-    private static final MetaDataKey<Object> IS_JAVA_SCRIPT_CONTRIBUTED = new MetaDataKey<Object>()
{
-
-        private static final long serialVersionUID = 3109256773218160485L;
-
-    };
-
-    @Override
-    public void renderHead(final Component component, final IHeaderResponse response) {
-        RequestCycle cycle = component.getRequestCycle();
-        if (cycle.find(IPartialPageRequestHandler.class) == null) {
-            Object contributed = cycle.getMetaData(IS_JAVA_SCRIPT_CONTRIBUTED);
-            if (contributed == null) {
-                cycle.setMetaData(IS_JAVA_SCRIPT_CONTRIBUTED, new Object());
-
-                response.render(JavaScriptHeaderItem.forReference(WicketWebSocketJQueryResourceReference.get()));
-
-                PackageTextTemplate webSocketSetupTemplate =
-                        new PackageTextTemplate(WicketWebSocketJQueryResourceReference.class,
-                                "res/js/wicket-websocket-setup.js.tmpl");
-
-                Map<String, Object> variables = Generics.newHashMap();
-
-                // set falsy JS values for the non-used parameter
-                int pageId = component.getPage().getPageId();
-                variables.put("pageId", pageId);
-                variables.put("resourceName", "");
-
-                WebSocketSettings webSocketSettings = WebSocketSettings.Holder.get(component.getApplication());
-
-                CharSequence baseUrl = getBaseUrl(webSocketSettings);
-                Args.notNull(baseUrl, "baseUrl");
-                variables.put("baseUrl", baseUrl);
-
-                CharSequence contextPath = getContextPath(webSocketSettings);
-                Args.notNull(contextPath, "contextPath");
-                variables.put("contextPath", contextPath);
-
-                // preserve the application name for JSR356 based impl
-                variables.put("applicationName", component.getApplication().getName());
-
-                CharSequence filterPrefix = getFilterPrefix(webSocketSettings);
-                Args.notNull(filterPrefix, "filterPrefix");
-                variables.put("filterPrefix", filterPrefix);
-
-                String webSocketSetupScript = webSocketSetupTemplate.asString(variables);
-
-                response.render(OnDomReadyHeaderItem.forScript(webSocketSetupScript));
-            }
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/syncope/blob/830fdee2/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 7f2c43a..ab245c7 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
@@ -70,53 +70,45 @@ public class JobActionPanel extends WizardMgtPanel<Serializable>
{
 
             @Override
             public void onClick(final AjaxRequestTarget target) {
+                switch (jobTO.getType()) {
+                    case NOTIFICATION:
+                        break;
 
-                if (null != jobTO.getType()) {
-                    switch (jobTO.getType()) {
+                    case REPORT:
+                        ReportTO reportTO = new ReportRestClient().read(jobTO.getRefKey());
 
-                        case NOTIFICATION:
-                            break;
+                        ReportWizardBuilder rwb = new ReportWizardBuilder(reportTO, pageRef);
+                        rwb.setEventSink(JobActionPanel.this);
 
-                        case REPORT:
+                        target.add(jobModal.setContent(rwb.build(BaseModal.CONTENT_ID, AjaxWizard.Mode.EDIT)));
 
-                            final ReportTO reportTO = new ReportRestClient().read(jobTO.getRefKey());
+                        jobModal.header(new StringResourceModel(
+                                "any.edit",
+                                this,
+                                new Model<>(reportTO)));
 
-                            final ReportWizardBuilder rwb = new ReportWizardBuilder(reportTO,
pageRef);
-                            rwb.setEventSink(JobActionPanel.this);
+                        jobModal.show(true);
+                        break;
 
-                            target.add(jobModal.setContent(rwb.build(BaseModal.CONTENT_ID,
AjaxWizard.Mode.EDIT)));
+                    case TASK:
+                        SchedTaskTO schedTaskTO = new TaskRestClient().
+                                readSchedTask(SchedTaskTO.class, jobTO.getRefKey());
 
-                            jobModal.header(new StringResourceModel(
-                                    "any.edit",
-                                    this,
-                                    new Model<>(reportTO)));
+                        SchedTaskWizardBuilder<SchedTaskTO> swb = new SchedTaskWizardBuilder<>(schedTaskTO,
pageRef);
+                        swb.setEventSink(JobActionPanel.this);
 
-                            jobModal.show(true);
+                        target.add(jobModal.setContent(swb.build(BaseModal.CONTENT_ID, AjaxWizard.Mode.EDIT)));
 
-                            break;
+                        jobModal.header(new StringResourceModel(
+                                "any.edit",
+                                this,
+                                new Model<>(schedTaskTO)));
 
-                        case TASK:
+                        jobModal.show(true);
+                        break;
 
-                            final SchedTaskTO schedTaskTO = new TaskRestClient().
-                                    readSchedTask(SchedTaskTO.class, jobTO.getRefKey());
-
-                            final SchedTaskWizardBuilder swb = new SchedTaskWizardBuilder(schedTaskTO,
pageRef);
-                            swb.setEventSink(JobActionPanel.this);
-
-                            target.add(jobModal.setContent(swb.build(BaseModal.CONTENT_ID,
AjaxWizard.Mode.EDIT)));
-
-                            jobModal.header(new StringResourceModel(
-                                    "any.edit",
-                                    this,
-                                    new Model<>(schedTaskTO)));
-
-                            jobModal.show(true);
-
-                            break;
-
-                        default:
-                            break;
-                    }
+                    default:
+                        break;
                 }
             }
         };

http://git-wip-us.apache.org/repos/asf/syncope/blob/830fdee2/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index abb0e2c..8d47402 100644
--- a/pom.xml
+++ b/pom.xml
@@ -420,7 +420,7 @@ under the License.
     <codemirror.version>5.13.2</codemirror.version>
     <jsplumb.version>2.0.7</jsplumb.version>
     
-    <wicket.version>7.5.0</wicket.version>
+    <wicket.version>7.6.0</wicket.version>
     <wicket-jqueryui.version>7.5.0</wicket-jqueryui.version>
     <wicket-bootstrap.version>0.10.11</wicket-bootstrap.version>
     <wicket-chartjs.version>7.0.1</wicket-chartjs.version>


Mime
View raw message