-
Improvement
-
Resolution: Fixed
-
Major
-
4.2
-
None
I found a comment by Gregory regarding simplified Node Builder API in the wiki.
"I'd like to propose a simple DSL/API similar to the one used to build tasks and deltas for this."
When we had to configure the STK programmatically I created a Task to do node manipulation using a fluent language style. I would like to donate the code to the project if you like it. The following example will illustrate the usage of the Task:
import static com.aperto.magkit.module.delta.CreateConfigNodeTreeTask.*; ... private final Task _configurateTemplateStkSection = selectConfig("Config Task stkSection", "Configure stkSection template.", PATH_STK_TEMPLATES, select("stkSection/mainArea", setProperty("template", "/templates/xxx/pages/section/pageIntroMainArea.ftl"), createNode("floating", setProperty("columns", "2"), setProperty("enabled", "true")), createNode("opener/paragraphs/xxxTeaserOpener", setProperty("name", "xxxTeaserOpener")), createNode("paragraphs", createNode("xxxSingleLink", setProperty("name", "xxxSingleLink")), createNode("stkTeaserFingerTabbed", setProperty("name", "stkTeaserFingerTabbed")), createNode("xxxTeaserNewsList", setProperty("name", "xxxTeaserNewsList")), createNode("xxxExternalTeaser", setProperty("name", "xxxExternalTeaser")), createNode("xxxChronicleTeaser", setProperty("name", "xxxChronicleTeaser"))), remove("opener/paragraphs/stkTeaserOpener")));
Find the source of the Task is attached to the issue.
Acceptance criteria
- is superseded by
-
MAGNOLIA-2897 Introduce a simpler api to build nodes/properties
- Closed