Skip to content

Commit

Permalink
feat(editor): move declaration to parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
marcofra committed Dec 17, 2024
1 parent 09f14ac commit 2f8c411
Showing 1 changed file with 23 additions and 12 deletions.
35 changes: 23 additions & 12 deletions src/main/frontend/model/samples/check-hardcoded-urls.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
{
"logLevel": "info",
"hops": [
{
"type": "declare",
"declarations": {
"path": "\"/content/swisscom/de\"",
"phrase": "\"https://www.swisscom.ch/content/de\"",
"extension": "\".html\""
}
},
{
"type": "runScript",
"code": "xPathQuery = str:join([\"/jcr:root\", path, \"//*[jcr:contains(., '\", phrase, \"') and jcr:contains(., '\", extension, \"') ]\"]);\n\n",
"code": "xPathQuery = str:join([\"/jcr:root\", args.path, \"//*[jcr:contains(., '\", args.phrase, \"') and jcr:contains(., '\", args.extension, \"') ]\"]);\n\n",
"extension": "jexl",
"putLocalsBackIntoScope": true
},
Expand All @@ -26,7 +18,7 @@
"hops": [
{
"type": "filterNode",
"expression": "property.type == 1 && !property.multiple && str:contains(jcr:val(node, property.name), phrase ) && str:contains(jcr:val(node, property.name), extension) ",
"expression": "property.type == 1 && !property.multiple && str:contains(jcr:val(node, property.name), args.phrase ) && str:contains(jcr:val(node, property.name), args.extension) ",
"hops": [
{
"type": "runScript",
Expand All @@ -48,7 +40,7 @@
},
{
"type": "filterNode",
"expression": "str:contains(joinedProperty, phrase) && str:contains(joinedProperty, extension)",
"expression": "str:contains(joinedProperty, args.phrase) && str:contains(joinedProperty, args.extension)",
"hops": [
{
"type": "runScript",
Expand All @@ -66,5 +58,24 @@
]
}
],
"parameters": []
"parameters": [
{
"name": "phrase",
"defaultValue": "https://www.project.ch/content/de",
"type": "text",
"evaluation": "STRING"
},
{
"name": "extension",
"defaultValue": ".html",
"type": "text",
"evaluation": "STRING"
},
{
"name": "path",
"defaultValue": "/content/project/de",
"type": "text",
"evaluation": "STRING"
}
]
}

0 comments on commit 2f8c411

Please sign in to comment.