From 48fe6fa826aed635d84c8411af617cfe3814f006 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francesco=20Chicchiricc=C3=B2?= Date: Mon, 2 Nov 2026 10:42:57 +0100 Subject: [PATCH 1/2] Upgrading to Wicket 11 --- pom.xml | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/pom.xml b/pom.xml index a49c1d4f55..9fe7a28391 100644 --- a/pom.xml +++ b/pom.xml @@ -483,7 +483,7 @@ under the License. 2.0.7 4.5.1 - 10.12.0 + 11.0.0 10.12.0 7.0.15 5.0.0 @@ -2451,27 +2451,6 @@ under the License. - - - jdk27 - - - [27,) - - - - - net.bytebuddy - byte-buddy - 1.17.8 - - - net.bytebuddy - byte-buddy-agent - 1.17.8 - - - From 62ae574f48308fd07df42820761835504543a4d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francesco=20Chicchiricc=C3=B2?= Date: Tue, 3 Nov 2026 11:43:36 +0100 Subject: [PATCH 2/2] Fixing Topology --- .../client/console/topology/Topology.java | 44 +++++++++---------- .../console/topology/TopologyNodePanel.java | 2 +- pom.xml | 2 +- 3 files changed, 22 insertions(+), 26 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 void onClick(final AjaxRequestTarget target, final Serializable ignore) { // 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 void onClick(final AjaxRequestTarget target, final Serializable ignore) { body.add(topologyNodePanel(Constants.SYNCOPE, syncopeTopologyNode, false)); - Map> connections = new HashMap<>(); - Map syncopeConnections = new HashMap<>(); - connections.put(syncopeTopologyNode.getKey(), syncopeConnections); + Map> connections = new HashMap<>(); + Map syncopeConnections = new HashMap<>(); + connections.put(sanitizeMarkupId(syncopeTopologyNode.getKey()), syncopeConnections); // required to retrieve parent positions Map servers = new HashMap<>(); @@ -273,8 +277,8 @@ protected void populateItem(final ListItem item) { 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 @@ protected void populateItem(final ListItem item) { 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 @@ protected void populateItem(final ListItem item) { item.add(topologyNodePanel("conn", topologynode, conn.isErrored())); // Update connections - Map remoteConnections; + Map remoteConnections; if (connections.containsKey(conn.getLocation())) { remoteConnections = connections.get(conn.getLocation()); } else { @@ -404,7 +408,7 @@ protected void populateItem(final ListItem item) { TopologyNode topologynode = new TopologyNode( resourceTO.getKey(), resourceTO.getKey(), TopologyNode.Kind.RESOURCE); - Map remoteConnections; + Map remoteConnections; if (connections.containsKey(resourceTO.getConnector())) { remoteConnections = connections.get(resourceTO.getConnector()); } else { @@ -480,10 +484,11 @@ protected void populateItem(final ListItem item) { @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 @@ protected void populateItem(final ListItem item) { newlyCreatedContainer.add(newlyCreated); } - private static List createConnections(final Map> targets) { - List 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 behaviors = new ArrayList<>(); @@ -561,7 +557,7 @@ private TopologyNodePanel topologyNodePanel(final String id, final TopologyNode @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 TopologyNodePanel(final String id, final TopologyNode node, final boolean 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 9fe7a28391..8f66c4bc99 100644 --- a/pom.xml +++ b/pom.xml @@ -484,7 +484,7 @@ under the License. 4.5.1 11.0.0 - 10.12.0 + 11.0.0-SNAPSHOT 7.0.15 5.0.0