Skip to content

Commit

Permalink
feat(editor): remove iteration, move declarations to parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
marcofra committed Dec 17, 2024
1 parent 3700132 commit 36f8219
Showing 1 changed file with 31 additions and 29 deletions.
60 changes: 31 additions & 29 deletions src/main/frontend/model/samples/add-node.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,44 @@
"logLevel": "info",
"hops": [
{
"type": "declare",
"declarations": {
"nodeName": "\"nName\"",
"jcrPrimaryType": "\"cq:PageContent\"",
"slingResourceType": "\"swisscom/components/structure/page\""
}
},
{
"type": "each",
"expression": "['de', 'fr', 'it', 'en']",
"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/project])",
"queryType": "JCR-SQL2",
"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}])",
"queryType": "JCR-SQL2",
"type": "createChildNode",
"conflict": "force",
"name": "${args.nName}",
"runOnExistingNode": false,
"hops": [
{
"type": "createChildNode",
"type": "setProperty",
"conflict": "force",
"name": "${nodeName}",
"runOnExistingNode": false,
"hops": [
{
"type": "setProperty",
"conflict": "force",
"propertyName": "sling:resourceType",
"value": "slingResourceType"
}
],
"primaryType": "${jcrPrimaryType}"
"propertyName": "sling:resourceType",
"value": "args.slingResourceType"
}
]
],
"primaryType": "${args.jcrPrimaryType}"
}
],
"iterator": "lang"
]
}
],
"parameters": []
"parameters": [
{
"name": "nName",
"defaultValue": "nName",
"evaluation": "STRING"
},
{
"name": "jcrPrimaryType",
"defaultValue": "cq:PageContent",
"evaluation": "STRING",
"type": "text"
},
{
"name": "slingResourceType",
"defaultValue": "project/components/page",
"evaluation": "STRING"
}
]
}

0 comments on commit 36f8219

Please sign in to comment.