AEM Groovy Extension

OSGi bundle containing Groovy builders and metaclasses for AEM (Adobe CQ).

License

License

Categories

Categories

Groovy Languages
GroupId

GroupId

com.citytechinc.aem.groovy.extension
ArtifactId

ArtifactId

aem-groovy-extension
Last Version

Last Version

1.1.0
Release Date

Release Date

Type

Type

pom
Description

Description

AEM Groovy Extension
OSGi bundle containing Groovy builders and metaclasses for AEM (Adobe CQ).
Project Organization

Project Organization

CITYTECH, Inc.
Source Code Management

Source Code Management

https://github.com/Citytechinc/aem-groovy-extension

Download aem-groovy-extension

How to add to project

<!-- https://jarcasting.com/artifacts/com.citytechinc.aem.groovy.extension/aem-groovy-extension/ -->
<dependency>
    <groupId>com.citytechinc.aem.groovy.extension</groupId>
    <artifactId>aem-groovy-extension</artifactId>
    <version>1.1.0</version>
    <type>pom</type>
</dependency>
// https://jarcasting.com/artifacts/com.citytechinc.aem.groovy.extension/aem-groovy-extension/
implementation 'com.citytechinc.aem.groovy.extension:aem-groovy-extension:1.1.0'
// https://jarcasting.com/artifacts/com.citytechinc.aem.groovy.extension/aem-groovy-extension/
implementation ("com.citytechinc.aem.groovy.extension:aem-groovy-extension:1.1.0")
'com.citytechinc.aem.groovy.extension:aem-groovy-extension:pom:1.1.0'
<dependency org="com.citytechinc.aem.groovy.extension" name="aem-groovy-extension" rev="1.1.0">
  <artifact name="aem-groovy-extension" type="pom" />
</dependency>
@Grapes(
@Grab(group='com.citytechinc.aem.groovy.extension', module='aem-groovy-extension', version='1.1.0')
)
libraryDependencies += "com.citytechinc.aem.groovy.extension" % "aem-groovy-extension" % "1.1.0"
[com.citytechinc.aem.groovy.extension/aem-groovy-extension "1.1.0"]

Dependencies

compile (9)

Group / Artifact Type Version
javax.jcr : jcr jar 2.0
javax.servlet : jsp-api jar 2.0
org.apache.sling : org.apache.sling.api jar 2.9.0
org.apache.sling : org.apache.sling.jcr.resource jar 2.5.0
com.day.cq : cq-tagging jar 5.8.20
com.day.cq.wcm : cq-wcm-api jar 5.9.4
com.day.cq : cq-commons jar 5.8.32
org.slf4j : slf4j-api jar 1.7.6
com.adobe.granite.osgi.wrapper » com.adobe.granite.osgi.wrapper.guava jar 15.0.0-0002

provided (1)

Group / Artifact Type Version
org.codehaus.groovy : groovy-all jar 2.4.6

Project Modules

  • aem-groovy-extension-bundle
  • aem-groovy-extension-tests
  • aem-groovy-extension-package

AEM Groovy Extension

ICF Next

Overview

OSGi bundle containing Groovy builders and metaclasses for Adobe Experience Manager. The bundle exposes an API to implement extension "provider" services to register additional Groovy metaclasses in the container.

new NodeBuilder(session).content {
    satirists("sling:Folder") {
        bierce(firstName: "Ambrose", lastName: "Bierce", birthDate: Calendar.instance.updated(year: 1842, month: 5, date: 24))
        mencken(firstName: "H.L.", lastName: "Mencken", birthDate: Calendar.instance.updated(year: 1880, month: 8, date: 12))
        other("sling:Folder", "jcr:title": "Other")
    }
}

See Groovydocs for complete API documentation.

Requirements

  • AEM 6.x running on localhost:4502
  • Maven 3.x

Compatibility

Groovy Extension Version(s) AEM Version(s)
7.x.x 6.3, 6.4, 6.5
6.x.x, 5.x.x 6.4
4.x.x 6.3
3.x.x, 2.x.x 6.2
1.x.x 6.1
0.9.x, 0.8.x 6.0
<= 0.7.x 5.6 (CQ5)

Usage and Installation

  1. Add dependency to your project's Maven pom.xml.

     <dependency>
         <groupId>com.icfolson.aem.groovy.extension</groupId>
         <artifactId>aem-groovy-extension-bundle</artifactId>
         <version>7.0.0</version>
         <scope>provided</scope>
     </dependency>
    
  2. Install the AEM Groovy Extension package.

     mvn install -P local
    

    or

     mvn install -P local,replicate
    

    The optional replicate profile activates the deployed package to the local publish instance.

    To install to a non-localhost AEM environment, connection parameters can be passed as Maven properties on the command line (see the parent POM file for additional environment property names).

     mvn install -P local -Daem.host=hostname -Daem.port.author=7402
    

Context Path Support

If you are running AEM with a context path, set the Maven property aem.context.path during installation.

mvn install -P local -Daem.context.path=/context

Registering Additional Metaclasses

Services implementing the com.icfolson.aem.groovy.extension.api.MetaClassExtensionProvider will be automatically discovered and bound by the OSGi container. These services can be implemented in any deployed bundle. The AEM Groovy Extension bundle will handle the registration and removal of supplied metaclasses as these services are activated/deactivated in the container. See the DefaultMetaClassExtensionProvider service for the proper closure syntax for registering metaclasses.

Versioning

Follows Semantic Versioning guidelines.

com.citytechinc.aem.groovy.extension

ICF Next

Versions

Version
1.1.0
1.0.1
1.0.0