From 783e462eb7a8a42b16e5848789eaa374e7bf57b7 Mon Sep 17 00:00:00 2001 From: Aoibhe Wilson Date: Mon, 10 Feb 2025 18:11:31 +0100 Subject: [PATCH] feat(editor): finished csv output - output to csv file - gave more meaningful name --- .../frontend/model/samples/value-finder.json | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/main/frontend/model/samples/value-finder.json b/src/main/frontend/model/samples/value-finder.json index 17ee6f9..62e2f88 100644 --- a/src/main/frontend/model/samples/value-finder.json +++ b/src/main/frontend/model/samples/value-finder.json @@ -1,7 +1,18 @@ { "logLevel": "info", "hops": [ - { "type": "declare", "declarations": { "output": "utils.file.txt(\"properties_containing_hardcoded_urls\")" } }, + { + "type": "declare", + "declarations": { + "output": "file:csv(\"value_finder_results\")" + } + }, + { + "type": "runScript", + "code": "output.line(\"path\", \"property\", \"value\");", + "extension": "jexl", + "putLocalsBackIntoScope": true + }, { "type": "nodeQuery", "query": "SELECT * FROM [nt:base] AS node WHERE ISDESCENDANTNODE([${args.path}])\n${(args.resourceTypeInclude != null && args.resourceTypeInclude.trim() != '') ? ` AND node.[sling:resourceType] LIKE \"${args.resourceTypeInclude}\"` : ''}\n${(args.resourceTypeExclude != null && args.resourceTypeExclude.trim() != '') ? ` AND node.[sling:resourceType] LIKE \"${args.resourceTypeExclude}\"` : ''}", @@ -27,7 +38,7 @@ "hops": [ { "type": "runScript", - "code": "output.append(node.path);\noutput.append(\"-\");\noutput.append(property.name);\noutput.append(\":\");\noutput.append(joinedPropertyValue);\noutput.append(\"\\n\");", + "code": "output.line(node.path, property.name, joinedPropertyValue);", "extension": "jexl", "putLocalsBackIntoScope": true } @@ -73,4 +84,4 @@ "evaluation": "STRING" } ] -} +} \ No newline at end of file