This is an automated email from the ASF dual-hosted git repository.

ilgrosso pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/syncope.git


The following commit(s) were added to refs/heads/master by this push:
     new 70c08d0e80 Upgrading to Wicket 11 (#1599)
70c08d0e80 is described below

commit 70c08d0e80580e84e0cff5bc59f7989ab6be54bb
Author: Francesco Chicchiriccò <[email protected]>
AuthorDate: Tue Nov 3 12:28:53 2026 +0100

    Upgrading to Wicket 11 (#1599)
---
 .../syncope/client/console/topology/Topology.java  | 44 ++++++++++------------
 .../client/console/topology/TopologyNodePanel.java |  2 +-
 pom.xml                                            | 25 +-----------
 3 files changed, 23 insertions(+), 48 deletions(-)

diff --git 
a/client/idm/console/src/main/java/org/apache/syncope/client/console/topology/Topology.java
 
b/client/idm/console/src/main/java/org/apache/syncope/client/console/topology/Topology.java
index 7708dbe392..6d0c3cb2ea 100644
--- 
a/client/idm/console/src/main/java/org/apache/syncope/client/console/topology/Topology.java
+++ 
b/client/idm/console/src/main/java/org/apache/syncope/client/console/topology/Topology.java
@@ -73,6 +73,10 @@ public class Topology extends BasePage {
 
     public static final String CONNECTOR_SERVER_LOCATION_PREFIX = "connid://";
 
+    public static String sanitizeMarkupId(final String input) {
+        return input.replaceAll("[^a-zA-Z0-9._-]", "_");
+    }
+
     @SpringBean
     protected ServiceOps serviceOps;
 
@@ -224,7 +228,7 @@ public class Topology extends BasePage {
         // Add Syncope (root topologynode)
         // -----------------------------------------
         String rootName = StringUtils.capitalize(Constants.SYNCOPE);
-        final TopologyNode syncopeTopologyNode = new TopologyNode(rootName, 
rootName, TopologyNode.Kind.SYNCOPE);
+        TopologyNode syncopeTopologyNode = new TopologyNode(rootName, 
rootName, TopologyNode.Kind.SYNCOPE);
         syncopeTopologyNode.setX(origX);
         syncopeTopologyNode.setY(origY);
 
@@ -234,9 +238,9 @@ public class Topology extends BasePage {
 
         body.add(topologyNodePanel(Constants.SYNCOPE, syncopeTopologyNode, 
false));
 
-        Map<Serializable, Map<Serializable, TopologyNode>> connections = new 
HashMap<>();
-        Map<Serializable, TopologyNode> syncopeConnections = new HashMap<>();
-        connections.put(syncopeTopologyNode.getKey(), syncopeConnections);
+        Map<String, Map<String, TopologyNode>> connections = new HashMap<>();
+        Map<String, TopologyNode> syncopeConnections = new HashMap<>();
+        connections.put(sanitizeMarkupId(syncopeTopologyNode.getKey()), 
syncopeConnections);
 
         // required to retrieve parent positions
         Map<String, TopologyNode> servers = new HashMap<>();
@@ -273,8 +277,8 @@ public class Topology extends BasePage {
 
                 item.add(topologyNodePanel("cs", topologynode, false));
 
-                syncopeConnections.put(url, topologynode);
-                connections.put(url, new HashMap<>());
+                syncopeConnections.put(sanitizeMarkupId(url), topologynode);
+                connections.put(sanitizeMarkupId(url), new HashMap<>());
             }
         };
 
@@ -312,8 +316,8 @@ public class Topology extends BasePage {
 
                 item.add(topologyNodePanel("fp", topologynode, false));
 
-                syncopeConnections.put(url, topologynode);
-                connections.put(url, new HashMap<>());
+                syncopeConnections.put(sanitizeMarkupId(url), topologynode);
+                connections.put(sanitizeMarkupId(url), new HashMap<>());
             }
         };
 
@@ -369,7 +373,7 @@ public class Topology extends BasePage {
                         item.add(topologyNodePanel("conn", topologynode, 
conn.isErrored()));
 
                         // Update connections
-                        Map<Serializable, TopologyNode> remoteConnections;
+                        Map<String, TopologyNode> remoteConnections;
                         if (connections.containsKey(conn.getLocation())) {
                             remoteConnections = 
connections.get(conn.getLocation());
                         } else {
@@ -404,7 +408,7 @@ public class Topology extends BasePage {
                     TopologyNode topologynode = new TopologyNode(
                             resourceTO.getKey(), resourceTO.getKey(), 
TopologyNode.Kind.RESOURCE);
 
-                    Map<Serializable, TopologyNode> remoteConnections;
+                    Map<String, TopologyNode> remoteConnections;
                     if (connections.containsKey(resourceTO.getConnector())) {
                         remoteConnections = 
connections.get(resourceTO.getConnector());
                     } else {
@@ -480,10 +484,11 @@ public class Topology extends BasePage {
 
             @Override
             public void renderHead(final Component component, final 
IHeaderResponse response) {
-                final StringBuilder jsPlumbConf = new StringBuilder();
-                jsPlumbConf.append(String.format(Locale.US, "activate(%.2f);", 
0.68f));
+                StringBuilder jsPlumbConf = new 
StringBuilder(String.format(Locale.US, "activate(%.2f);", 0.68f));
+
+                connections.forEach((key, value) -> value.forEach((label, 
node) -> jsPlumbConf.append(
+                        
"connect('%s','%s','%s');".formatted(sanitizeMarkupId(key), label, 
node.getKind()))));
 
-                createConnections(connections).forEach(jsPlumbConf::append);
                 jsPlumbConf.append("restoreTopologyLayout();");
 
                 
response.render(OnDomReadyHeaderItem.forScript(jsPlumbConf.toString()));
@@ -538,18 +543,9 @@ public class Topology extends BasePage {
         newlyCreatedContainer.add(newlyCreated);
     }
 
-    private static List<String> createConnections(final Map<Serializable, 
Map<Serializable, TopologyNode>> targets) {
-        List<String> list = new ArrayList<>();
-
-        targets.forEach((key, value) -> value.forEach((label, node) -> 
list.add(
-                "connect('%s','%s','%s');".formatted(key, label, 
node.getKind()))));
-
-        return list;
-    }
-
     private TopologyNodePanel topologyNodePanel(final String id, final 
TopologyNode node, final boolean errored) {
         TopologyNodePanel panel = new TopologyNodePanel(id, node, errored);
-        panel.setMarkupId(String.valueOf(node.getKey()));
+        panel.setMarkupId(sanitizeMarkupId(node.getKey()));
         panel.setOutputMarkupId(true);
 
         List<Behavior> behaviors = new ArrayList<>();
@@ -561,7 +557,7 @@ public class Topology extends BasePage {
             @Override
             public void renderHead(final Component component, final 
IHeaderResponse response) {
                 
response.render(OnDomReadyHeaderItem.forScript("setPosition('%s', %d, %d)".
-                        formatted(node.getKey(), node.getX(), node.getY())));
+                        formatted(sanitizeMarkupId(node.getKey()), 
node.getX(), node.getY())));
             }
         });
 
diff --git 
a/client/idm/console/src/main/java/org/apache/syncope/client/console/topology/TopologyNodePanel.java
 
b/client/idm/console/src/main/java/org/apache/syncope/client/console/topology/TopologyNodePanel.java
index e2f773deb8..4fec79e306 100644
--- 
a/client/idm/console/src/main/java/org/apache/syncope/client/console/topology/TopologyNodePanel.java
+++ 
b/client/idm/console/src/main/java/org/apache/syncope/client/console/topology/TopologyNodePanel.java
@@ -94,7 +94,7 @@ public class TopologyNodePanel extends Panel implements 
IAjaxIndicatorAware {
             add(AttributeModifier.append("data-original-title", title));
         }
 
-        this.setMarkupId(node.getDisplayName());
+        setMarkupId(Topology.sanitizeMarkupId(node.getDisplayName()));
     }
 
     @Override
diff --git a/pom.xml b/pom.xml
index a49c1d4f55..8f66c4bc99 100644
--- a/pom.xml
+++ b/pom.xml
@@ -483,8 +483,8 @@ under the License.
     <jsplumb.version>2.0.7</jsplumb.version>
     <chartjs.version>4.5.1</chartjs.version>
 
-    <wicket.version>10.12.0</wicket.version>
-    <wicketstuff.version>10.12.0</wicketstuff.version>
+    <wicket.version>11.0.0</wicket.version>
+    <wicketstuff.version>11.0.0-SNAPSHOT</wicketstuff.version>
     <wicket-bootstrap.version>7.0.15</wicket-bootstrap.version>
     <wicket-spring-boot.version>5.0.0</wicket-spring-boot.version>
 
@@ -2451,27 +2451,6 @@ under the License.
         </plugins>
       </build>
     </profile>
-
-    <profile>
-      <id>jdk27</id>
-
-      <activation>
-        <jdk>[27,)</jdk>
-      </activation>
-
-      <dependencies>
-        <dependency>
-          <groupId>net.bytebuddy</groupId>
-          <artifactId>byte-buddy</artifactId>
-          <version>1.17.8</version>
-        </dependency>
-        <dependency>
-          <groupId>net.bytebuddy</groupId>
-          <artifactId>byte-buddy-agent</artifactId>
-          <version>1.17.8</version>
-        </dependency>
-      </dependencies>
-    </profile>
   </profiles>
 
   <modules>

Reply via email to