Skip to content

Commit

Permalink
feat(editor): replace variables with parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
marcofra committed Jan 9, 2025
1 parent 5be490e commit a2e36c6
Showing 1 changed file with 23 additions and 12 deletions.
35 changes: 23 additions & 12 deletions src/main/frontend/model/samples/rename-property.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\"",
"sourcePropertyName": "\"navTitle\"",
"destinationPropertyName": "\"navTitle-new\""
}
},
{
"type": "runScript",
"code": "xPathQuery = str:join([\"/jcr:root\", path, \"//*[@\", sourcePropertyName, \"]\"]);",
"code": "xPathQuery = str:join([\"/jcr:root\", args.path, \"//*[@\", args.sourcePropertyName, \"]\"]);",
"extension": "jexl",
"putLocalsBackIntoScope": true
},
Expand All @@ -22,11 +14,30 @@
"hops": [
{
"type": "renameProperty",
"newName": "${destinationPropertyName}",
"propertyName": "${sourcePropertyName}"
"newName": "${args.destinationPropertyName}",
"propertyName": "${args.sourcePropertyName}"
}
]
}
],
"parameters": []
"parameters": [
{
"name": "sourcePropertyName",
"defaultValue": "navTitle",
"type": "text",
"evaluation": "STRING"
},
{
"name": "destinationPropertyName",
"defaultValue": "navTitle-new",
"type": "text",
"evaluation": "STRING"
},
{
"name": "path",
"defaultValue": "/content/project/de",
"type": "text",
"evaluation": "STRING"
}
]
}

0 comments on commit a2e36c6

Please sign in to comment.