GithubHelp home page GithubHelp logo

nickoriuk / aem-filebuilder Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 1.0 52 KB

Build AEM Touch UI dialogs using a simple yet powerful DSL.

Kotlin 100.00%
aem cq5 adobe-experience-manager kotlin-dsl dialog experimental sling touch-ui adobe-cq apache-sling

aem-filebuilder's Introduction

AEM Filebuilder

Introduction

This library helps build dialogs for AEM by providing a DSL to build a dialog model that can be transformed into XML during your project's compilation.

Why?

XML is great for configuration, but it's difficult for developers to quickly read and write. This project is intended to solve that by introducing a natural DSL which is easy to read and write. It also brings several other benefits:

  • Refer to your AEM bundle's constants directly in the Dialog DSL - ensure your dialog and Java classes are always dealing with the same property name
  • Share snippets of dialog code between different components using a shared DSL module
  • Provides a simple, extensible API so you can develop your own DSL functions and types.
  • Interoperable - use side by side with standard XML files
  • Less error prone - statically typed DSL helps enforce correct dialog definitions.

This project currently only supports AEM 6.3 and higher.

Quick Example

Example of a simple _cq_dialog.xml file written in Kotlin:

apps/project/components/example/_cq_dialog.xml.kts

import io.redcastle.aem.filebuilder.dsl.*
import io.redcastle.aem.filebuilder.model.dialog.field.Checkbox

dialog("My Dialog") {
    section("section1") {

        title = "My Section"

        textField("title", "./jcr:title") {
            fieldLabel = "Title"
            maxlength = 100
            emptyText = "Enter a title"
            required = true
        }

        textField("navTitle", "./navTitle") {
            fieldLabel = "Navigation Title"
            fieldDescription = "The title to be used in the the global nav when referring to this content"
            maxlength = 30
        }

        checkbox("showInNav", "./showInNav") {
            text = "Show In Nav"
            value = "{Boolean}true"
            fieldDescription = "If checked, the title will be displayed in the navigation"
            toolTipPosition = Checkbox.TooltipPosition.RIGHT
        }
    }
}

The above code creates the following dialog:

image of dialog

More samples can be found here.

Artifacts

This repository is not on Maven Central or Bintray yet - it will be added when the project is less experimental.

Dependencies

This project depends on the filegen-maven-plugin to convert the files to the typical XML format for AEM.

Project Status

Everything is currently experimental, still in development and subject to change as part of the 0.x.x releases. These versions should not be considered production ready, as the API and implementation may change at any time prior to the 1.0.0 release.

aem-filebuilder's People

Contributors

nickoriuk avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

odarochka

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.