From bf8cb13049b827e8d906ac142211368296e26c68 Mon Sep 17 00:00:00 2001
From: marcofra <marco.fratazzi@gmail.com>
Date: Thu, 9 Jan 2025 18:04:15 +0100
Subject: [PATCH] feat(editor): replace declarations with parameters, changed
 query path

---
 .../frontend/model/samples/rename-node.json   | 28 +++++++++++--------
 1 file changed, 17 insertions(+), 11 deletions(-)

diff --git a/src/main/frontend/model/samples/rename-node.json b/src/main/frontend/model/samples/rename-node.json
index f9eb103..97ce0ef 100644
--- a/src/main/frontend/model/samples/rename-node.json
+++ b/src/main/frontend/model/samples/rename-node.json
@@ -1,30 +1,23 @@
 {
 	"logLevel": "info",
 	"hops": [
-		{
-			"type": "declare",
-			"declarations": {
-				"nodeOldName": "\"oldName\"",
-				"nodeNewName": "\"newName\""
-			}
-		},
 		{
 			"type": "each",
 			"expression": "['de', 'fr', 'it', 'en']",
 			"hops": [
 				{
 					"type": "nodeQuery",
-					"query": "/* The search query has to return the parent nodes we want to act on. */\nSELECT * FROM [nt:unstructured] AS s WHERE ISDESCENDANTNODE([/content/swisscom/${lang}/res/_/aaaaaaaaaaaaaaaaaaaaaaaa])",
+					"query": "/* The search query has to return the parent nodes we want to act on. */\nSELECT * FROM [nt:unstructured] AS s WHERE ISDESCENDANTNODE([/content/project/${lang}])",
 					"queryType": "JCR-SQL2",
 					"hops": [
 						{
 							"type": "childNodes",
-							"namePattern": "${nodeOldName}",
+							"namePattern": "${args.nodeOldName}",
 							"hops": [
 								{
 									"type": "moveNode",
 									"conflict": "force",
-									"newName": "${nodeNewName}"
+									"newName": "${args.nodeNewName}"
 								}
 							]
 						}
@@ -34,5 +27,18 @@
 			"iterator": "lang"
 		}
 	],
-	"parameters": []
+	"parameters": [
+		{
+			"name": "nodeOldName",
+			"defaultValue": "oldName",
+			"type": "text",
+			"evaluation": "STRING"
+		},
+		{
+			"name": "nodeNewName",
+			"defaultValue": "newName",
+			"type": "text",
+			"evaluation": "STRING"
+		}
+	]
 }