All Downloads are FREE. Search and download functionalities are using the official Maven repository.

be.orbinson.aem.groovy.console.builders.AbstractContentBuilder.groovy Maven / Gradle / Ivy

There is a newer version: 19.0.8
Show newest version
package be.orbinson.aem.groovy.console.builders

import javax.jcr.Node
import javax.jcr.Session

/**
 * Base class for Page and Node builders.
 */
abstract class AbstractContentBuilder extends BuilderSupport {

    Session session

    Node currentNode

    AbstractContentBuilder(Session session, Node currentNode) {
        this.session = session
        this.currentNode = currentNode
    }

    @Override
    void nodeCompleted(parent, node) {
        session.save()

        currentNode = currentNode.parent
    }

    @Override
    void setParent(parent, child) {

    }

    void setProperties(node, properties) {
        properties.each { name, value ->
            node.set(name, value)
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy