[MGNLGROOVY-131] Provide a GroovyBuilder for Magnolia Created: 20/Nov/14 Updated: 01/Dec/14 Resolved: 20/Nov/14 |
|
| Status: | Closed |
| Project: | Magnolia Groovy Module |
| Component/s: | integration |
| Affects Version/s: | None |
| Fix Version/s: | 2.3.2 |
| Type: | New Feature | Priority: | Major |
| Reporter: | Federico Grilli | Assignee: | Federico Grilli |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Template: |
|
| Acceptance criteria: |
Empty
|
| Release notes required: |
Yes
|
| Description |
|
We can leverage the great Groovy support for creating fluent builders (http://groovy.codehaus.org/Make+a+builder) and achieve something like this session = ctx.getJCRSession('config') def builder = new GroovyBuilder(session.getNode('/modules')) builder.'my-module'(type: 'mgnl:content') { apps(type:'mgnl:content') { myApp { 'class'('info.magnolia.ui.api.app.registry.ConfiguredAppDescriptor') appClass('info.magnolia.ui.contentapp.ContentApp') icon('app-icon') label('app-display-name') subApps { browser { 'class'('info.magnolia.ui.contentapp.browser.BrowserSubAppDescriptor') subAppClass('info.magnolia.ui.contentapp.browser.BrowserSubApp') label('app-display-name') } } } } } session.save() |
| Comments |
| Comment by Federico Grilli [ 20/Nov/14 ] |
|
For the release notes/documentation: the javadoc of info.magnolia.module.groovy.xml.GroovyBuilder should be pretty exhaustive. |