Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(editor): add additional sample scripts #28

Merged
merged 12 commits into from
Jan 11, 2025
Merged
Prev Previous commit
Next Next commit
feat(editor): remove iteration, move declarations to parameters
  • Loading branch information
marcofra committed Dec 17, 2024
commit 36f8219502bc86e71c8d8cef4096107bb5cda028
60 changes: 31 additions & 29 deletions src/main/frontend/model/samples/add-node.json
Original file line number Diff line number Diff line change
@@ -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"
}
]
}