Uploaded image for project: 'Magnolia'
  1. Magnolia
  2. MAGNOLIA-2828

Node Builder Task

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Major Major
    • 4.2
    • 4.2
    • core
    • 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

              gjoseph Magnolia International
              norman Norman Wiechmann
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Task DoD