From 2a7034aec66e350b4d363bc6ad665e6094f68a1b Mon Sep 17 00:00:00 2001 From: Mark Daugherty Date: Mon, 24 Sep 2018 16:16:58 -0500 Subject: [PATCH 01/16] version. --- aem-groovy-extension-bundle/pom.xml | 2 +- aem-groovy-extension-package/pom.xml | 2 +- aem-groovy-extension-tests/pom.xml | 2 +- pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/aem-groovy-extension-bundle/pom.xml b/aem-groovy-extension-bundle/pom.xml index df790ef..3393029 100644 --- a/aem-groovy-extension-bundle/pom.xml +++ b/aem-groovy-extension-bundle/pom.xml @@ -4,7 +4,7 @@ com.icfolson.aem.groovy.extension aem-groovy-extension - 6.0.0 + 6.0.1-SNAPSHOT 4.0.0 diff --git a/aem-groovy-extension-package/pom.xml b/aem-groovy-extension-package/pom.xml index c641c5d..07a6f9f 100644 --- a/aem-groovy-extension-package/pom.xml +++ b/aem-groovy-extension-package/pom.xml @@ -3,7 +3,7 @@ com.icfolson.aem.groovy.extension aem-groovy-extension - 6.0.0 + 6.0.1-SNAPSHOT 4.0.0 diff --git a/aem-groovy-extension-tests/pom.xml b/aem-groovy-extension-tests/pom.xml index 533b71e..e46854a 100644 --- a/aem-groovy-extension-tests/pom.xml +++ b/aem-groovy-extension-tests/pom.xml @@ -4,7 +4,7 @@ com.icfolson.aem.groovy.extension aem-groovy-extension - 6.0.0 + 6.0.1-SNAPSHOT 4.0.0 diff --git a/pom.xml b/pom.xml index 841707e..3be79b5 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ com.icfolson.aem.groovy.extension aem-groovy-extension pom - 6.0.0 + 6.0.1-SNAPSHOT AEM Groovy Extension OSGi bundle containing Groovy builders and metaclasses for Adobe Experience Manager. From 1d42630622f8ecf32f89b7bdb518ef9c261ba206 Mon Sep 17 00:00:00 2001 From: Mark Daugherty Date: Tue, 25 Sep 2018 08:38:52 -0500 Subject: [PATCH 02/16] added version table to readme. --- README.md | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 2c3c55c..fda73ec 100644 --- a/README.md +++ b/README.md @@ -18,13 +18,20 @@ new NodeBuilder(session).content { ## 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 +------------ | ------------- +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`. @@ -32,7 +39,7 @@ new NodeBuilder(session).content { com.icfolson.aem.groovy.extension aem-groovy-extension-bundle - 4.0.0 + 6.0.0 provided From 3a4bc357c9a945ab5e058c8e06d31b4dca796193 Mon Sep 17 00:00:00 2001 From: Mark Daugherty Date: Tue, 25 Sep 2018 08:56:58 -0500 Subject: [PATCH 03/16] updated groovydocs for metaclasses. --- .../impl/DefaultMetaClassExtensionProvider.groovy | 9 --------- 1 file changed, 9 deletions(-) diff --git a/aem-groovy-extension-bundle/src/main/groovy/com/icfolson/aem/groovy/extension/services/impl/DefaultMetaClassExtensionProvider.groovy b/aem-groovy-extension-bundle/src/main/groovy/com/icfolson/aem/groovy/extension/services/impl/DefaultMetaClassExtensionProvider.groovy index ed7e4d2..00b9246 100644 --- a/aem-groovy-extension-bundle/src/main/groovy/com/icfolson/aem/groovy/extension/services/impl/DefaultMetaClassExtensionProvider.groovy +++ b/aem-groovy-extension-bundle/src/main/groovy/com/icfolson/aem/groovy/extension/services/impl/DefaultMetaClassExtensionProvider.groovy @@ -63,15 +63,6 @@ import javax.servlet.ServletRequest * the closure completes. The closure accepts a single argument with the current binary instance. * * - * javax.servlet.jsp.JspContext - * - *
    - *
  • getAt(String name) - Supports use of the subscript operator to get an attribute value.
  • - *
  • putAt(String name, Object value) - Supports use of the subscript operator to set an attribute value.
  • - *
- * * javax.servlet.ServletRequest * *
    From 556d4f52693f3304c0b56a745707d63ea595152d Mon Sep 17 00:00:00 2001 From: Mark Daugherty Date: Tue, 25 Sep 2018 10:11:45 -0500 Subject: [PATCH 04/16] updated project urls. --- pom.xml | 6 ++++-- src/site/site.xml | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 3be79b5..825424a 100644 --- a/pom.xml +++ b/pom.xml @@ -14,9 +14,11 @@ AEM Groovy Extension OSGi bundle containing Groovy builders and metaclasses for Adobe Experience Manager. + https://github.com/OlsonDigital/aem-groovy-extension + Olson Digital - http://www.digitalatolson.com + http://www.olsondigital.com @@ -181,7 +183,7 @@ lt.velykis.maven.skins reflow-velocity-tools - 1.0.0 + 1.1.1 org.apache.velocity diff --git a/src/site/site.xml b/src/site/site.xml index 6f516ff..7444b1e 100644 --- a/src/site/site.xml +++ b/src/site/site.xml @@ -27,10 +27,10 @@ reports ${project.name} - http://code.digitalatolson.com/aem-groovy-extension + ./index.html - + reports From 6fe79cc3e4893bfafe001650b1916ff9fa5b3ecf Mon Sep 17 00:00:00 2001 From: Mark Daugherty Date: Tue, 25 Sep 2018 10:15:55 -0500 Subject: [PATCH 05/16] groovydocs link. --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index fda73ec..346c37d 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,8 @@ new NodeBuilder(session).content { } ``` +See [Groovydocs](http://code.digitalatolson.com/aem-groovy-extension/groovydocs/index.html) for complete API documentation. + ## Requirements * AEM 6.x running on localhost:4502 From 680ee08b6d6f0d6d2a059ee84ca1528fd66c0fe6 Mon Sep 17 00:00:00 2001 From: Mark Daugherty Date: Wed, 6 Feb 2019 16:24:00 -0600 Subject: [PATCH 06/16] version. --- aem-groovy-extension-bundle/pom.xml | 2 +- aem-groovy-extension-package/pom.xml | 2 +- aem-groovy-extension-tests/pom.xml | 2 +- pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/aem-groovy-extension-bundle/pom.xml b/aem-groovy-extension-bundle/pom.xml index 3393029..eef3f67 100644 --- a/aem-groovy-extension-bundle/pom.xml +++ b/aem-groovy-extension-bundle/pom.xml @@ -4,7 +4,7 @@ com.icfolson.aem.groovy.extension aem-groovy-extension - 6.0.1-SNAPSHOT + 7.0.0-SNAPSHOT 4.0.0 diff --git a/aem-groovy-extension-package/pom.xml b/aem-groovy-extension-package/pom.xml index 07a6f9f..3abd06f 100644 --- a/aem-groovy-extension-package/pom.xml +++ b/aem-groovy-extension-package/pom.xml @@ -3,7 +3,7 @@ com.icfolson.aem.groovy.extension aem-groovy-extension - 6.0.1-SNAPSHOT + 7.0.0-SNAPSHOT 4.0.0 diff --git a/aem-groovy-extension-tests/pom.xml b/aem-groovy-extension-tests/pom.xml index e46854a..c60994a 100644 --- a/aem-groovy-extension-tests/pom.xml +++ b/aem-groovy-extension-tests/pom.xml @@ -4,7 +4,7 @@ com.icfolson.aem.groovy.extension aem-groovy-extension - 6.0.1-SNAPSHOT + 7.0.0-SNAPSHOT 4.0.0 diff --git a/pom.xml b/pom.xml index 825424a..1f51c70 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ com.icfolson.aem.groovy.extension aem-groovy-extension pom - 6.0.1-SNAPSHOT + 7.0.0-SNAPSHOT AEM Groovy Extension OSGi bundle containing Groovy builders and metaclasses for Adobe Experience Manager. From bdde61bcf01a1039b8a75912347356472a240b88 Mon Sep 17 00:00:00 2001 From: Mark Daugherty Date: Wed, 6 Feb 2019 16:39:01 -0600 Subject: [PATCH 07/16] updates for 6.3/6.4 compatibility. --- aem-groovy-extension-bundle/pom.xml | 33 +++-------------- .../impl/DefaultExtensionService.groovy | 15 ++++---- .../DefaultMetaClassExtensionProvider.groovy | 6 ++-- .../extension/GroovyExtensionSpec.groovy | 7 ++-- pom.xml | 35 +++++++++++-------- src/site/markdown/index.md | 2 +- src/site/site.xml | 2 +- 7 files changed, 40 insertions(+), 60 deletions(-) diff --git a/aem-groovy-extension-bundle/pom.xml b/aem-groovy-extension-bundle/pom.xml index eef3f67..d3a8f05 100644 --- a/aem-groovy-extension-bundle/pom.xml +++ b/aem-groovy-extension-bundle/pom.xml @@ -21,27 +21,10 @@ maven-compiler-plugin - - org.apache.felix - maven-scr-plugin - 1.21.0 - true - - - generate-scr-scrdescriptor - - scr - - - - - true - - org.apache.felix maven-bundle-plugin - 2.5.3 + 4.1.0 true @@ -50,13 +33,6 @@ ${project.parent.organization.name} !*.impl,com.icfolson.aem.groovy.extension.* * - - @@ -149,9 +125,10 @@ - org.apache.felix - org.apache.felix.scr.annotations - 1.9.12 + org.osgi + osgi.cmpn + 6.0.0 + provided \ No newline at end of file diff --git a/aem-groovy-extension-bundle/src/main/groovy/com/icfolson/aem/groovy/extension/services/impl/DefaultExtensionService.groovy b/aem-groovy-extension-bundle/src/main/groovy/com/icfolson/aem/groovy/extension/services/impl/DefaultExtensionService.groovy index c102ce4..ff86516 100644 --- a/aem-groovy-extension-bundle/src/main/groovy/com/icfolson/aem/groovy/extension/services/impl/DefaultExtensionService.groovy +++ b/aem-groovy-extension-bundle/src/main/groovy/com/icfolson/aem/groovy/extension/services/impl/DefaultExtensionService.groovy @@ -4,12 +4,11 @@ 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 @@ -17,13 +16,11 @@ 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) + @Reference(cardinality = ReferenceCardinality.MULTIPLE, policy = ReferencePolicy.DYNAMIC) private List metaClassExtensionProviders = new CopyOnWriteArrayList<>() @Override diff --git a/aem-groovy-extension-bundle/src/main/groovy/com/icfolson/aem/groovy/extension/services/impl/DefaultMetaClassExtensionProvider.groovy b/aem-groovy-extension-bundle/src/main/groovy/com/icfolson/aem/groovy/extension/services/impl/DefaultMetaClassExtensionProvider.groovy index 00b9246..265ec96 100644 --- a/aem-groovy-extension-bundle/src/main/groovy/com/icfolson/aem/groovy/extension/services/impl/DefaultMetaClassExtensionProvider.groovy +++ b/aem-groovy-extension-bundle/src/main/groovy/com/icfolson/aem/groovy/extension/services/impl/DefaultMetaClassExtensionProvider.groovy @@ -4,8 +4,7 @@ import com.icfolson.aem.groovy.extension.api.MetaClassExtensionProvider import com.day.cq.wcm.api.Page import com.google.common.base.Optional import groovy.util.logging.Slf4j -import org.apache.felix.scr.annotations.Component -import org.apache.felix.scr.annotations.Service +import org.osgi.service.component.annotations.Component import javax.jcr.Binary import javax.jcr.Node @@ -71,8 +70,7 @@ import javax.servlet.ServletRequest * value is an array, a list will be returned. *
*/ -@Service(MetaClassExtensionProvider) -@Component(immediate = true) +@Component(service = MetaClassExtensionProvider, immediate = true) @Slf4j("LOG") class DefaultMetaClassExtensionProvider implements MetaClassExtensionProvider { diff --git a/aem-groovy-extension-tests/src/test/groovy/com/icfolson/aem/groovy/extension/GroovyExtensionSpec.groovy b/aem-groovy-extension-tests/src/test/groovy/com/icfolson/aem/groovy/extension/GroovyExtensionSpec.groovy index a643eb6..710d6f9 100644 --- a/aem-groovy-extension-tests/src/test/groovy/com/icfolson/aem/groovy/extension/GroovyExtensionSpec.groovy +++ b/aem-groovy-extension-tests/src/test/groovy/com/icfolson/aem/groovy/extension/GroovyExtensionSpec.groovy @@ -1,11 +1,14 @@ package com.icfolson.aem.groovy.extension -import com.icfolson.aem.groovy.extension.metaclass.GroovyExtensionMetaClassRegistry +import com.icfolson.aem.groovy.extension.api.MetaClassExtensionProvider +import com.icfolson.aem.groovy.extension.services.impl.DefaultMetaClassExtensionProvider import com.icfolson.aem.prosper.specs.ProsperSpec abstract class GroovyExtensionSpec extends ProsperSpec { def setupSpec() { - GroovyExtensionMetaClassRegistry.registerMetaClasses() + slingContext.registerService(MetaClassExtensionProvider, new DefaultMetaClassExtensionProvider()) + + // GroovyExtensionMetaClassRegistry.registerMetaClasses() } } diff --git a/pom.xml b/pom.xml index 1f51c70..8b317e0 100644 --- a/pom.xml +++ b/pom.xml @@ -1,10 +1,6 @@ - - - - com.icfolson.aem - aem-parent-uber-jar - 6.4.1.1 - + 4.0.0 com.icfolson.aem.groovy.extension @@ -17,13 +13,13 @@ https://github.com/OlsonDigital/aem-groovy-extension - Olson Digital - http://www.olsondigital.com + ICF Next + http://www.icfnext.com GitHub - https://github.com/OlsonDigital/aem-groovy-extension/issues + https://github.com/icfnext/aem-groovy-extension/issues @@ -33,12 +29,13 @@ - scm:git:git@github.com:OlsonDigital/aem-groovy-extension.git - https://github.com/OlsonDigital/aem-groovy-extension - scm:git:git@github.com:OlsonDigital/aem-groovy-extension.git + scm:git:git@github.com:icfnext/aem-groovy-extension.git + https://github.com/icfnext/aem-groovy-extension + scm:git:git@github.com:icfnext/aem-groovy-extension.git + UTF-8 false yyyy-MM-dd'T'HH:mm:ss.SSSZ ${maven.build.timestamp} @@ -253,20 +250,28 @@ - + com.adobe.aem uber-jar apis + 6.3.2.2 + provided javax.jcr jcr + 2.0 + provided javax.servlet - jsp-api + javax.servlet-api + 3.1.0 + provided + + org.codehaus.groovy groovy-all diff --git a/src/site/markdown/index.md b/src/site/markdown/index.md index 41e1afb..8911647 100644 --- a/src/site/markdown/index.md +++ b/src/site/markdown/index.md @@ -1,3 +1,3 @@ ## About AEM Groovy Extension -OSGi bundle containing Groovy builders and metaclasses for AEM (Adobe CQ). \ No newline at end of file +OSGi bundle containing Groovy builders and metaclasses for Adobe Experience Manager. \ No newline at end of file diff --git a/src/site/site.xml b/src/site/site.xml index 7444b1e..49087ed 100644 --- a/src/site/site.xml +++ b/src/site/site.xml @@ -39,7 +39,7 @@ - + From d061674ff43273b418d0cc1a4f56087dd2789699 Mon Sep 17 00:00:00 2001 From: Mark Daugherty Date: Wed, 20 Feb 2019 10:39:10 -0600 Subject: [PATCH 08/16] updated github url. --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 8b317e0..369a180 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ AEM Groovy Extension OSGi bundle containing Groovy builders and metaclasses for Adobe Experience Manager. - https://github.com/OlsonDigital/aem-groovy-extension + https://github.com/icfnext/aem-groovy-extension ICF Next From 49546d42148894ce8a370c456f1f9aeb53876a14 Mon Sep 17 00:00:00 2001 From: Mark Daugherty Date: Wed, 20 Feb 2019 10:39:27 -0600 Subject: [PATCH 09/16] added volatile modifier to list. --- .../extension/services/impl/DefaultExtensionService.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aem-groovy-extension-bundle/src/main/groovy/com/icfolson/aem/groovy/extension/services/impl/DefaultExtensionService.groovy b/aem-groovy-extension-bundle/src/main/groovy/com/icfolson/aem/groovy/extension/services/impl/DefaultExtensionService.groovy index ff86516..5ad44e3 100644 --- a/aem-groovy-extension-bundle/src/main/groovy/com/icfolson/aem/groovy/extension/services/impl/DefaultExtensionService.groovy +++ b/aem-groovy-extension-bundle/src/main/groovy/com/icfolson/aem/groovy/extension/services/impl/DefaultExtensionService.groovy @@ -21,7 +21,7 @@ import java.util.concurrent.CopyOnWriteArrayList class DefaultExtensionService implements ExtensionService { @Reference(cardinality = ReferenceCardinality.MULTIPLE, policy = ReferencePolicy.DYNAMIC) - private List metaClassExtensionProviders = new CopyOnWriteArrayList<>() + private volatile List metaClassExtensionProviders = new CopyOnWriteArrayList<>() @Override Set getMetaClasses() { From 9d67dc4f3b6a85e8c90df0ddbb4ee38083906dd5 Mon Sep 17 00:00:00 2001 From: Mark Daugherty Date: Wed, 20 Feb 2019 17:41:43 -0600 Subject: [PATCH 10/16] osgi metadata update. --- .../extension/services/impl/DefaultExtensionService.groovy | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/aem-groovy-extension-bundle/src/main/groovy/com/icfolson/aem/groovy/extension/services/impl/DefaultExtensionService.groovy b/aem-groovy-extension-bundle/src/main/groovy/com/icfolson/aem/groovy/extension/services/impl/DefaultExtensionService.groovy index 5ad44e3..af04986 100644 --- a/aem-groovy-extension-bundle/src/main/groovy/com/icfolson/aem/groovy/extension/services/impl/DefaultExtensionService.groovy +++ b/aem-groovy-extension-bundle/src/main/groovy/com/icfolson/aem/groovy/extension/services/impl/DefaultExtensionService.groovy @@ -20,7 +20,10 @@ import java.util.concurrent.CopyOnWriteArrayList @Slf4j("LOG") class DefaultExtensionService implements ExtensionService { - @Reference(cardinality = ReferenceCardinality.MULTIPLE, policy = ReferencePolicy.DYNAMIC) + @Reference(cardinality = ReferenceCardinality.MULTIPLE, + policy = ReferencePolicy.DYNAMIC, + bind = "bindMetaClassExtensionProvider", + unbind = "unbindMetaClassExtensionProvider") private volatile List metaClassExtensionProviders = new CopyOnWriteArrayList<>() @Override From fd09d8fcd79beab0a6712d20fde8ae4020ad7337 Mon Sep 17 00:00:00 2001 From: Mark Daugherty Date: Thu, 21 Feb 2019 08:57:15 -0600 Subject: [PATCH 11/16] updated reference annotation. --- .../extension/services/impl/DefaultExtensionService.groovy | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/aem-groovy-extension-bundle/src/main/groovy/com/icfolson/aem/groovy/extension/services/impl/DefaultExtensionService.groovy b/aem-groovy-extension-bundle/src/main/groovy/com/icfolson/aem/groovy/extension/services/impl/DefaultExtensionService.groovy index af04986..02f4de6 100644 --- a/aem-groovy-extension-bundle/src/main/groovy/com/icfolson/aem/groovy/extension/services/impl/DefaultExtensionService.groovy +++ b/aem-groovy-extension-bundle/src/main/groovy/com/icfolson/aem/groovy/extension/services/impl/DefaultExtensionService.groovy @@ -20,10 +20,6 @@ import java.util.concurrent.CopyOnWriteArrayList @Slf4j("LOG") class DefaultExtensionService implements ExtensionService { - @Reference(cardinality = ReferenceCardinality.MULTIPLE, - policy = ReferencePolicy.DYNAMIC, - bind = "bindMetaClassExtensionProvider", - unbind = "unbindMetaClassExtensionProvider") private volatile List metaClassExtensionProviders = new CopyOnWriteArrayList<>() @Override @@ -37,6 +33,7 @@ class DefaultExtensionService implements ExtensionService { metaClasses } + @Reference(cardinality = ReferenceCardinality.MULTIPLE, policy = ReferencePolicy.DYNAMIC) @Synchronized void bindMetaClassExtensionProvider(MetaClassExtensionProvider extension) { metaClassExtensionProviders.add(extension) From 9fff41eca5fea90c5c1aaa4bf401c1598d103405 Mon Sep 17 00:00:00 2001 From: Mark Daugherty Date: Wed, 6 Mar 2019 13:46:05 -0600 Subject: [PATCH 12/16] dependency updates. --- README.md | 1 + aem-groovy-extension-bundle/pom.xml | 36 +++++++++++++++++++--------- aem-groovy-extension-package/pom.xml | 4 +++- aem-groovy-extension-tests/pom.xml | 8 ++++--- pom.xml | 33 ++++++++++++++----------- 5 files changed, 53 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index 346c37d..d61cc97 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,7 @@ See [Groovydocs](http://code.digitalatolson.com/aem-groovy-extension/groovydocs/ Groovy Extension Version(s) | AEM Version ------------ | ------------- +7.x.x | 6.3.3, 6.4 6.x.x, 5.x.x | 6.4 4.x.x | 6.3 3.x.x, 2.x.x | 6.2 diff --git a/aem-groovy-extension-bundle/pom.xml b/aem-groovy-extension-bundle/pom.xml index d3a8f05..6996798 100644 --- a/aem-groovy-extension-bundle/pom.xml +++ b/aem-groovy-extension-bundle/pom.xml @@ -1,5 +1,7 @@ - + com.icfolson.aem.groovy.extension @@ -48,14 +50,26 @@ - - - - - - - - + + + + + + + + @@ -123,12 +137,12 @@ + \ No newline at end of file diff --git a/aem-groovy-extension-package/pom.xml b/aem-groovy-extension-package/pom.xml index 3abd06f..3487e0d 100644 --- a/aem-groovy-extension-package/pom.xml +++ b/aem-groovy-extension-package/pom.xml @@ -1,5 +1,7 @@ - + com.icfolson.aem.groovy.extension aem-groovy-extension diff --git a/aem-groovy-extension-tests/pom.xml b/aem-groovy-extension-tests/pom.xml index c60994a..06e5364 100644 --- a/aem-groovy-extension-tests/pom.xml +++ b/aem-groovy-extension-tests/pom.xml @@ -1,5 +1,7 @@ - + com.icfolson.aem.groovy.extension @@ -72,7 +74,7 @@ org.slf4j slf4j-nop - 1.6.4 + ${slf4j.version} @@ -85,7 +87,7 @@ com.icfolson.aem.prosper prosper - 13.0.0 + 14.0.0-SNAPSHOT test diff --git a/pom.xml b/pom.xml index 369a180..524494c 100644 --- a/pom.xml +++ b/pom.xml @@ -2,6 +2,12 @@ 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"> + + com.icfolson.aem + aem-parent-uber-jar + 7.0.0-SNAPSHOT + + 4.0.0 com.icfolson.aem.groovy.extension aem-groovy-extension @@ -250,31 +256,30 @@ - - - com.adobe.aem - uber-jar - apis - 6.3.2.2 - provided - javax.jcr jcr - 2.0 - provided javax.servlet javax.servlet-api - 3.1.0 - provided - - + + org.osgi + osgi.cmpn + + + org.osgi + osgi.core + org.codehaus.groovy groovy-all + + com.adobe.aem + uber-jar + apis + From 1fe9db237a1ad9be4837381a3294ceb7b9da3f91 Mon Sep 17 00:00:00 2001 From: Mark Daugherty Date: Thu, 7 Mar 2019 09:20:36 -0600 Subject: [PATCH 13/16] version updates. --- README.md | 8 ++++---- aem-groovy-extension-tests/pom.xml | 1 + pom.xml | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index d61cc97..55c1740 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # AEM Groovy Extension -[Olson Digital](http://www.digitalatolson.com/) +[ICF Next](http://www.icfnext.com/) ## Overview @@ -16,7 +16,7 @@ new NodeBuilder(session).content { } ``` -See [Groovydocs](http://code.digitalatolson.com/aem-groovy-extension/groovydocs/index.html) for complete API documentation. +See [Groovydocs](http://icfnext.github.io/aem-groovy-extension/groovydocs/index.html) for complete API documentation. ## Requirements @@ -27,7 +27,7 @@ See [Groovydocs](http://code.digitalatolson.com/aem-groovy-extension/groovydocs/ Groovy Extension Version(s) | AEM Version ------------ | ------------- -7.x.x | 6.3.3, 6.4 +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 @@ -42,7 +42,7 @@ Groovy Extension Version(s) | AEM Version com.icfolson.aem.groovy.extension aem-groovy-extension-bundle - 6.0.0 + 7.0.0 provided diff --git a/aem-groovy-extension-tests/pom.xml b/aem-groovy-extension-tests/pom.xml index 06e5364..053f38f 100644 --- a/aem-groovy-extension-tests/pom.xml +++ b/aem-groovy-extension-tests/pom.xml @@ -35,6 +35,7 @@ maven-surefire-plugin 2.18.1 + false **/*Spec* diff --git a/pom.xml b/pom.xml index 524494c..f49d410 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ com.icfolson.aem aem-parent-uber-jar - 7.0.0-SNAPSHOT + 7.0.0 4.0.0 From 520c647a1bc522f137fe8ac0b2ef585ec106ed63 Mon Sep 17 00:00:00 2001 From: Mark Daugherty Date: Thu, 7 Mar 2019 09:22:23 -0600 Subject: [PATCH 14/16] version. --- aem-groovy-extension-bundle/pom.xml | 2 +- aem-groovy-extension-package/pom.xml | 2 +- aem-groovy-extension-tests/pom.xml | 2 +- pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/aem-groovy-extension-bundle/pom.xml b/aem-groovy-extension-bundle/pom.xml index 6996798..160263e 100644 --- a/aem-groovy-extension-bundle/pom.xml +++ b/aem-groovy-extension-bundle/pom.xml @@ -6,7 +6,7 @@ com.icfolson.aem.groovy.extension aem-groovy-extension - 7.0.0-SNAPSHOT + 7.0.0 4.0.0 diff --git a/aem-groovy-extension-package/pom.xml b/aem-groovy-extension-package/pom.xml index 3487e0d..4c8701a 100644 --- a/aem-groovy-extension-package/pom.xml +++ b/aem-groovy-extension-package/pom.xml @@ -5,7 +5,7 @@ com.icfolson.aem.groovy.extension aem-groovy-extension - 7.0.0-SNAPSHOT + 7.0.0 4.0.0 diff --git a/aem-groovy-extension-tests/pom.xml b/aem-groovy-extension-tests/pom.xml index 053f38f..78ceacd 100644 --- a/aem-groovy-extension-tests/pom.xml +++ b/aem-groovy-extension-tests/pom.xml @@ -6,7 +6,7 @@ com.icfolson.aem.groovy.extension aem-groovy-extension - 7.0.0-SNAPSHOT + 7.0.0 4.0.0 diff --git a/pom.xml b/pom.xml index f49d410..3ee8a6d 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ com.icfolson.aem.groovy.extension aem-groovy-extension pom - 7.0.0-SNAPSHOT + 7.0.0 AEM Groovy Extension OSGi bundle containing Groovy builders and metaclasses for Adobe Experience Manager. From 7821e1d78e17efd7028bf15ffffe287968d68628 Mon Sep 17 00:00:00 2001 From: Mark Daugherty Date: Thu, 7 Mar 2019 09:45:07 -0600 Subject: [PATCH 15/16] versions. --- aem-groovy-extension-bundle/pom.xml | 9 --------- aem-groovy-extension-tests/pom.xml | 2 +- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/aem-groovy-extension-bundle/pom.xml b/aem-groovy-extension-bundle/pom.xml index 160263e..7a79f86 100644 --- a/aem-groovy-extension-bundle/pom.xml +++ b/aem-groovy-extension-bundle/pom.xml @@ -136,13 +136,4 @@ - - \ No newline at end of file diff --git a/aem-groovy-extension-tests/pom.xml b/aem-groovy-extension-tests/pom.xml index 78ceacd..64b263a 100644 --- a/aem-groovy-extension-tests/pom.xml +++ b/aem-groovy-extension-tests/pom.xml @@ -88,7 +88,7 @@ com.icfolson.aem.prosper prosper - 14.0.0-SNAPSHOT + 14.0.0 test From 2e5b2ff862514233d14f3c7ac7c7873743dd058c Mon Sep 17 00:00:00 2001 From: Mark Daugherty Date: Thu, 7 Mar 2019 10:32:07 -0600 Subject: [PATCH 16/16] removed static registry. --- aem-groovy-extension-bundle/pom.xml | 7 ++ .../GroovyExtensionMetaClassRegistry.groovy | 35 ------ .../impl/DefaultExtensionService.groovy | 4 +- .../DefaultMetaClassExtensionProvider.groovy | 100 +++++++++++------- 4 files changed, 70 insertions(+), 76 deletions(-) delete mode 100644 aem-groovy-extension-bundle/src/main/groovy/com/icfolson/aem/groovy/extension/metaclass/GroovyExtensionMetaClassRegistry.groovy diff --git a/aem-groovy-extension-bundle/pom.xml b/aem-groovy-extension-bundle/pom.xml index 7a79f86..d070149 100644 --- a/aem-groovy-extension-bundle/pom.xml +++ b/aem-groovy-extension-bundle/pom.xml @@ -136,4 +136,11 @@ + + + + org.slf4j + slf4j-api + + \ No newline at end of file diff --git a/aem-groovy-extension-bundle/src/main/groovy/com/icfolson/aem/groovy/extension/metaclass/GroovyExtensionMetaClassRegistry.groovy b/aem-groovy-extension-bundle/src/main/groovy/com/icfolson/aem/groovy/extension/metaclass/GroovyExtensionMetaClassRegistry.groovy deleted file mode 100644 index 898ba95..0000000 --- a/aem-groovy-extension-bundle/src/main/groovy/com/icfolson/aem/groovy/extension/metaclass/GroovyExtensionMetaClassRegistry.groovy +++ /dev/null @@ -1,35 +0,0 @@ -package com.icfolson.aem.groovy.extension.metaclass - -import com.icfolson.aem.groovy.extension.services.impl.DefaultMetaClassExtensionProvider -import org.codehaus.groovy.runtime.InvokerHelper - -/** - * Provides access to AEM metaclasses outside of the OSGi container (e.g. for testing). - */ -class GroovyExtensionMetaClassRegistry { - - private static final Map EXTENSIONS = new DefaultMetaClassExtensionProvider().metaClasses - - /** - * Register metaclasses. - */ - static void registerMetaClasses() { - // remove any existing metaclasses - removeMetaClasses() - - EXTENSIONS.each { clazz, closure -> - clazz.metaClass(closure) - } - } - - /** - * Remove all metaclasses from the registry. - */ - static void removeMetaClasses() { - def metaRegistry = InvokerHelper.metaRegistry - - EXTENSIONS.keySet().each { clazz -> - metaRegistry.removeMetaClass(clazz) - } - } -} diff --git a/aem-groovy-extension-bundle/src/main/groovy/com/icfolson/aem/groovy/extension/services/impl/DefaultExtensionService.groovy b/aem-groovy-extension-bundle/src/main/groovy/com/icfolson/aem/groovy/extension/services/impl/DefaultExtensionService.groovy index 02f4de6..63cf6f0 100644 --- a/aem-groovy-extension-bundle/src/main/groovy/com/icfolson/aem/groovy/extension/services/impl/DefaultExtensionService.groovy +++ b/aem-groovy-extension-bundle/src/main/groovy/com/icfolson/aem/groovy/extension/services/impl/DefaultExtensionService.groovy @@ -26,8 +26,8 @@ class DefaultExtensionService implements ExtensionService { Set getMetaClasses() { def metaClasses = [] as LinkedHashSet - metaClassExtensionProviders.each { - metaClasses.addAll(it.metaClasses.keySet()) + metaClassExtensionProviders.each { provider -> + metaClasses.addAll(provider.metaClasses.keySet()) } metaClasses diff --git a/aem-groovy-extension-bundle/src/main/groovy/com/icfolson/aem/groovy/extension/services/impl/DefaultMetaClassExtensionProvider.groovy b/aem-groovy-extension-bundle/src/main/groovy/com/icfolson/aem/groovy/extension/services/impl/DefaultMetaClassExtensionProvider.groovy index 265ec96..9e90fd9 100644 --- a/aem-groovy-extension-bundle/src/main/groovy/com/icfolson/aem/groovy/extension/services/impl/DefaultMetaClassExtensionProvider.groovy +++ b/aem-groovy-extension-bundle/src/main/groovy/com/icfolson/aem/groovy/extension/services/impl/DefaultMetaClassExtensionProvider.groovy @@ -76,13 +76,16 @@ class DefaultMetaClassExtensionProvider implements MetaClassExtensionProvider { static def OPTIONAL_METACLASS = { asBoolean { - delegate != null && delegate.present + def optional = delegate as Optional + + optional != null && optional.present } } static def SERVLET_REQUEST_METACLASS = { getAt { String parameterName -> - def value = delegate.parameterMap[parameterName] as String[] + def request = delegate as ServletRequest + def value = request.parameterMap[parameterName] as String[] def result if (value) { @@ -97,12 +100,13 @@ class DefaultMetaClassExtensionProvider implements MetaClassExtensionProvider { static def BINARY_METACLASS = { withBinary { Closure c -> + def binary = delegate as Binary def result = null try { - result = c(delegate) + result = c(binary) } finally { - delegate.dispose() + binary.dispose() } result @@ -111,47 +115,55 @@ class DefaultMetaClassExtensionProvider implements MetaClassExtensionProvider { static def NODE_METACLASS = { iterator { - delegate.nodes + (delegate as Node).nodes } recurse { Closure closure -> + def node = delegate as Node + closure(delegate) - delegate.nodes.each { node -> - node.recurse(closure) + node.nodes.each { child -> + child.recurse(closure) } } recurse { String primaryNodeTypeName, Closure closure -> - if (delegate.primaryNodeType.name == primaryNodeTypeName) { + def node = delegate as Node + + if (node.primaryNodeType.name == primaryNodeTypeName) { closure(delegate) } - delegate.nodes.findAll { it.primaryNodeType.name == primaryNodeTypeName }.each { node -> - node.recurse(primaryNodeTypeName, closure) + node.nodes.findAll { it.primaryNodeType.name == primaryNodeTypeName }.each { child -> + child.recurse(primaryNodeTypeName, closure) } } recurse { Collection primaryNodeTypeNames, Closure closure -> - if (primaryNodeTypeNames.contains(delegate.primaryNodeType.name)) { - closure(delegate) + def node = delegate as Node + + if (primaryNodeTypeNames.contains(node.primaryNodeType.name)) { + closure(node) } - delegate.nodes.findAll { primaryNodeTypeNames.contains(it.primaryNodeType.name) }.each { node -> - node.recurse(primaryNodeTypeNames, closure) + node.nodes.findAll { primaryNodeTypeNames.contains(it.primaryNodeType.name) }.each { child -> + child.recurse(primaryNodeTypeNames, closure) } } get { String propertyName -> def result = null - if (delegate.hasProperty(propertyName)) { - def property = delegate.getProperty(propertyName) + def node = delegate as Node + + if (node.hasProperty(propertyName)) { + def property = node.getProperty(propertyName) if (property.multiple) { - result = property.values.collect { getResult(delegate.session, it) } + result = property.values.collect { getResult(node.session, it) } } else { - result = getResult(delegate.session, property.value) + result = getResult(node.session, property.value) } } @@ -159,21 +171,23 @@ class DefaultMetaClassExtensionProvider implements MetaClassExtensionProvider { } set { String propertyName, value -> + def node = delegate as Node + if (value == null) { - if (delegate.hasProperty(propertyName)) { - delegate.getProperty(propertyName).remove() + if (node.hasProperty(propertyName)) { + node.getProperty(propertyName).remove() } } else { - def valueFactory = delegate.session.valueFactory + def valueFactory = node.session.valueFactory if (value instanceof Object[] || value instanceof Collection) { - def values = value.collect { valueFactory.createValue(it) }.toArray(new javax.jcr.Value[0]) + def values = value.collect { valueFactory.createValue(it) }.toArray(new Value[0]) - delegate.setProperty(propertyName, values) + node.setProperty(propertyName, values) } else { def jcrValue = valueFactory.createValue(value) - delegate.setProperty(propertyName, jcrValue) + node.setProperty(propertyName, jcrValue) } } } @@ -185,18 +199,24 @@ class DefaultMetaClassExtensionProvider implements MetaClassExtensionProvider { } getOrAddNode { String name -> - delegate.hasNode(name) ? delegate.getNode(name) : delegate.addNode(name) + def node = delegate as Node + + node.hasNode(name) ? node.getNode(name) : node.addNode(name) } getOrAddNode { String name, String primaryNodeTypeName -> - delegate.hasNode(name) ? delegate.getNode(name) : delegate.addNode(name, primaryNodeTypeName) + def node = delegate as Node + + node.hasNode(name) ? node.getNode(name) : node.addNode(name, primaryNodeTypeName) } removeNode { String name -> + def node = delegate as Node + boolean removed = false - if (delegate.hasNode(name)) { - delegate.getNode(name).remove() + if (node.hasNode(name)) { + node.getNode(name).remove() removed = true } @@ -204,10 +224,12 @@ class DefaultMetaClassExtensionProvider implements MetaClassExtensionProvider { } getNextSibling { - def siblings = delegate.parent.nodes + def node = delegate as Node + + def siblings = node.parent.nodes while (siblings.hasNext()) { - if (delegate.isSame(siblings.nextNode())) { + if (node.isSame(siblings.nextNode())) { break } } @@ -216,14 +238,16 @@ class DefaultMetaClassExtensionProvider implements MetaClassExtensionProvider { } getPrevSibling { - def siblings = delegate.parent.nodes + def node = delegate as Node + + def siblings = node.parent.nodes def prevSibling = null def result = null while (siblings.hasNext()) { def sibling = siblings.nextNode() - if (delegate.isSame(sibling)) { + if (node.isSame(sibling)) { result = prevSibling break } @@ -237,29 +261,27 @@ class DefaultMetaClassExtensionProvider implements MetaClassExtensionProvider { static def PAGE_METACLASS = { iterator { - delegate.listChildren() + (delegate as Page).listChildren() } recurse { Closure closure -> closure(delegate) - delegate.listChildren().each { child -> + (delegate as Page).listChildren().each { child -> child.recurse(closure) } } getNode { - delegate.contentResource?.adaptTo(Node) + (delegate as Page).contentResource?.adaptTo(Node) } get { String name -> - def node = delegate.contentResource?.adaptTo(Node) - - node?.get(name) + (delegate as Page).contentResource?.adaptTo(Node)?.get(name) } set { String name, value -> - def node = delegate.contentResource?.adaptTo(Node) + def node = (delegate as Page).contentResource?.adaptTo(Node) if (node) { node.set(name, value)