Skip to content

Commit

Permalink
Merge branch 'release/7.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
markdaugherty committed Mar 7, 2019
2 parents 93c4abc + 2e5b2ff commit b9265ac
Show file tree
Hide file tree
Showing 11 changed files with 165 additions and 173 deletions.
24 changes: 17 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# AEM Groovy Extension

[Olson Digital](http://www.digitalatolson.com/)
[ICF Next](http://www.icfnext.com/)

## Overview

Expand All @@ -16,23 +16,33 @@ new NodeBuilder(session).content {
}
```

See [Groovydocs](http://icfnext.github.io/aem-groovy-extension/groovydocs/index.html) for complete API documentation.

## Requirements

* AEM 6.3 running on localhost:4502 (versions 1.x and above)
* Versions 2.x.x through 3.x.x are compatible with AEM 6.2.
* Versions 1.x.x are compatible with AEM 6.1.
* Versions 0.8.x - 0.9.x are compatible with AEM 6.0.
* Versions 0.7.x and below are compatible with CQ 5.6
* AEM 6.x running on localhost:4502
* [Maven](http://maven.apache.org/) 3.x

## Compatibility

Groovy Extension Version(s) | AEM Version
------------ | -------------
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>4.0.0</version>
<version>7.0.0</version>
<scope>provided</scope>
</dependency>

Expand Down
65 changes: 27 additions & 38 deletions aem-groovy-extension-bundle/pom.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

<parent>
<groupId>com.icfolson.aem.groovy.extension</groupId>
<artifactId>aem-groovy-extension</artifactId>
<version>6.0.0</version>
<version>7.0.0</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand All @@ -21,27 +23,10 @@
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-scr-plugin</artifactId>
<version>1.21.0</version>
<extensions>true</extensions>
<executions>
<execution>
<id>generate-scr-scrdescriptor</id>
<goals>
<goal>scr</goal>
</goals>
</execution>
</executions>
<configuration>
<scanClasses>true</scanClasses>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>2.5.3</version>
<version>4.1.0</version>
<extensions>true</extensions>
<configuration>
<instructions>
Expand All @@ -50,13 +35,6 @@
<Bundle-Vendor>${project.parent.organization.name}</Bundle-Vendor>
<Export-Package>!*.impl,com.icfolson.aem.groovy.extension.*</Export-Package>
<DynamicImport-Package>*</DynamicImport-Package>
<!-- Exported package versions differ in major version between AEM61 and AEM62 -->
<!--
<Import-Package>
com.day.cq.commons.jcr;version="[5.7,7)",
*
</Import-Package>
-->
</instructions>
</configuration>
</plugin>
Expand All @@ -72,14 +50,26 @@
</goals>
<configuration>
<target>
<taskdef name="groovydoc" classname="org.codehaus.groovy.ant.Groovydoc" classpathref="maven.compile.classpath" />
<groovydoc destdir="${project.reporting.outputDirectory}/groovydocs" sourcepath="${basedir}/src/main/groovy" use="true" windowtitle="${project.name}" doctitle="${project.name}">
<link packages="com.day.cq.wcm.api." href="https://docs.adobe.com/docs/en/aem/6-2/develop/ref/javadoc" />
<link packages="org.apache.sling." href="http://sling.apache.org/apidocs/sling7" />
<link packages="javax.jcr." href="https://docs.adobe.com/content/docs/en/spec/jsr170/javadocs/jcr-2.0/" />
<link packages="java." href="https://docs.oracle.com/javase/7/docs/api" />
<link packages="javax." href="https://docs.oracle.com/javaee/7/api" />
<link packages="groovy.,org.codehaus.groovy." href="http://groovy.codehaus.org/api/" />
<taskdef name="groovydoc"
classname="org.codehaus.groovy.ant.Groovydoc"
classpathref="maven.compile.classpath"/>
<groovydoc destdir="${project.reporting.outputDirectory}/groovydocs"
sourcepath="${basedir}/src/main/groovy"
use="true"
windowtitle="${project.name}"
doctitle="${project.name}">
<link packages="com.day.cq.wcm.api."
href="https://docs.adobe.com/docs/en/aem/6-2/develop/ref/javadoc"/>
<link packages="org.apache.sling."
href="http://sling.apache.org/apidocs/sling7"/>
<link packages="javax.jcr."
href="https://docs.adobe.com/content/docs/en/spec/jsr170/javadocs/jcr-2.0/"/>
<link packages="java."
href="https://docs.oracle.com/javase/7/docs/api"/>
<link packages="javax."
href="https://docs.oracle.com/javaee/7/api"/>
<link packages="groovy.,org.codehaus.groovy."
href="http://groovy.codehaus.org/api/"/>
</groovydoc>
</target>
</configuration>
Expand Down Expand Up @@ -149,9 +139,8 @@

<dependencies>
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.scr.annotations</artifactId>
<version>1.9.12</version>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
</dependencies>
</project>

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,39 +4,36 @@ import com.icfolson.aem.groovy.extension.api.MetaClassExtensionProvider
import com.icfolson.aem.groovy.extension.services.ExtensionService
import groovy.transform.Synchronized
import groovy.util.logging.Slf4j
import org.apache.felix.scr.annotations.Component
import org.apache.felix.scr.annotations.Reference
import org.apache.felix.scr.annotations.ReferenceCardinality
import org.apache.felix.scr.annotations.ReferencePolicy
import org.apache.felix.scr.annotations.Service
import org.codehaus.groovy.runtime.InvokerHelper
import org.osgi.service.component.annotations.Component
import org.osgi.service.component.annotations.Reference
import org.osgi.service.component.annotations.ReferenceCardinality
import org.osgi.service.component.annotations.ReferencePolicy

import java.util.concurrent.CopyOnWriteArrayList

/**
* This default extension service exposes the set of registered metaclasses while providing for the binding and
* unbinding of metaclass providers.
*/
@Service(ExtensionService)
@Component(immediate = true)
@Component(service = ExtensionService, immediate = true)
@Slf4j("LOG")
class DefaultExtensionService implements ExtensionService {

@Reference(cardinality = ReferenceCardinality.OPTIONAL_MULTIPLE,
referenceInterface = MetaClassExtensionProvider, policy = ReferencePolicy.DYNAMIC)
private List<MetaClassExtensionProvider> metaClassExtensionProviders = new CopyOnWriteArrayList<>()
private volatile List<MetaClassExtensionProvider> metaClassExtensionProviders = new CopyOnWriteArrayList<>()

@Override
Set<Class> getMetaClasses() {
def metaClasses = [] as LinkedHashSet

metaClassExtensionProviders.each {
metaClasses.addAll(it.metaClasses.keySet())
metaClassExtensionProviders.each { provider ->
metaClasses.addAll(provider.metaClasses.keySet())
}

metaClasses
}

@Reference(cardinality = ReferenceCardinality.MULTIPLE, policy = ReferencePolicy.DYNAMIC)
@Synchronized
void bindMetaClassExtensionProvider(MetaClassExtensionProvider extension) {
metaClassExtensionProviders.add(extension)
Expand Down
Loading

0 comments on commit b9265ac

Please sign in to comment.