Skip to content

Commit

Permalink
Merge branch 'release/13.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
markdaugherty committed Mar 7, 2019
2 parents 25fda96 + 9451d60 commit 44225c6
Show file tree
Hide file tree
Showing 134 changed files with 7,629 additions and 686 deletions.
19 changes: 10 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# AEM Groovy Console

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

## Overview

The AEM Groovy Console provides an interface for running [Groovy](http://www.groovy-lang.org/) scripts in the AEM container. Scripts can be created to manipulate content in the JCR, call OSGi services, or execute arbitrary code using the AEM, Sling, or JCR APIs. After installing the package in AEM (instructions below), see the [console page](http://localhost:4502/etc/groovyconsole.html) for documentation on the available bindings and methods. Sample scripts are included in the package for reference.
The AEM Groovy Console provides an interface for running [Groovy](http://www.groovy-lang.org/) scripts in Adobe Experience Manager. Scripts can be created to manipulate content in the JCR, call OSGi services, or execute arbitrary code using the AEM, Sling, or JCR APIs. After installing the package in AEM (instructions below), see the [console page](http://localhost:4502/apps/groovyconsole.html) for documentation on the available bindings and methods. Sample scripts are included in the package for reference.

![Screenshot](src/site/screenshot.png)

Expand All @@ -17,6 +17,7 @@ The AEM Groovy Console provides an interface for running [Groovy](http://www.gro

Groovy Console Version(s) | AEM Version
------------ | -------------
13.x.x | 6.3, 6.4, 6.5
12.x.x | 6.4
11.x.x | 6.3
10.x.x, 9.x.x | 6.2
Expand All @@ -27,13 +28,13 @@ Groovy Console Version(s) | AEM Version

## Installation

1. [Download the console package](https://github.com/OlsonDigital/aem-groovy-console/releases/download/12.0.0/aem-groovy-console-12.0.0.zip). For previous versions, tags can be checked out from GitHub and built directly from the source (e.g. `mvn install`).
1. [Download the console package](https://github.com/icfnext/aem-groovy-console/releases/download/14.0.0/aem-groovy-console-14.0.0.zip). For previous versions, tags can be checked out from GitHub and built directly from the source (e.g. `mvn install`).

2. [Verify](http://localhost:4502/etc/groovyconsole.html) the installation.
2. [Verify](http://localhost:4502/apps/groovyconsole.html) the installation.

Additional build profiles may be added in the project's `pom.xml` to support deployment to non-localhost AEM servers.

AEM 6.0 no longer allows vanity paths for pages in `/etc` by default. To enable access to the Groovy Console from `/groovyconsole` as in previous versions, the **Apache Sling Resource Resolver Factory** OSGi configuration must be updated to allow vanity paths from `/etc`. The **Groovy Console Configuration Service** can then be updated to enable the vanity path if so desired.
To enable access to the Groovy Console from `/groovyconsole`, update the **Groovy Console Configuration Service** via the [OSGi console configuration page](http://localhost:4502/system/console/configMgr) to enable the vanity path.

## Building From Source

Expand Down Expand Up @@ -62,7 +63,7 @@ Property | Description | Default Value
Email Enabled? | Check to enable email notification on completion of script execution. | `false`
Email Recipients | Email addresses to receive notification. | `[]`
Allowed Groups | List of group names that are authorized to use the console. If empty, no authorization check is performed. | `[]`
Vanity Path Enabled? | Enables `/groovyconsole` vanity path. **Apache Sling Resource Resolver Factory** OSGi configuration must also be updated to allow vanity paths from `/etc`. | `false`
Vanity Path Enabled? | Enables `/groovyconsole` vanity path. | `false`
Audit Disabled? | Disables auditing of script execution history. | `false`
Display All Audit Records? | If enabled, all audit records (including records for other users) will be displayed in the console history. | `false`

Expand All @@ -72,11 +73,11 @@ Saved scripts can be remotely executed by sending a POST request to the console

### Single Script

curl -d "scriptPath=/etc/groovyconsole/scripts/samples/JcrSearch.groovy" -X POST -u admin:admin http://localhost:4502/bin/groovyconsole/post.json
curl -d "scriptPath=/var/groovyconsole/scripts/samples/JcrSearch.groovy" -X POST -u admin:admin http://localhost:4502/bin/groovyconsole/post.json

### Multiple Scripts

curl -d "scriptPaths=/etc/groovyconsole/scripts/samples/JcrSearch.groovy&scriptPaths=/etc/groovyconsole/scripts/samples/FulltextQuery.groovy" -X POST -u admin:admin http://localhost:4502/bin/groovyconsole/post.json
curl -d "scriptPaths=/var/groovyconsole/scripts/samples/JcrSearch.groovy&scriptPaths=/var/groovyconsole/scripts/samples/FulltextQuery.groovy" -X POST -u admin:admin http://localhost:4502/bin/groovyconsole/post.json

## Extensions

Expand All @@ -86,7 +87,7 @@ Beginning in version 7.0.0, the Groovy Console provides extension hooks to furth

To provide custom notifications for script executions, bundles may implement the `com.icfolson.aem.groovy.console.notification.NotificationService` interface (see the `com.icfolson.aem.groovy.console.notification.impl.EmailNotificationService` class for an example). These services will be dynamically bound by the Groovy Console service and all registered notification services will be called for each script execution.

## Notes
## Sample Scripts

Sample scripts can be found in the `src/main/scripts` directory.

Expand Down
117 changes: 57 additions & 60 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,27 +1,31 @@
<?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</groupId>
<artifactId>aem-parent-uber-jar</artifactId>
<version>6.4.1</version>
<version>7.0.0</version>
</parent>

<modelVersion>4.0.0</modelVersion>
<groupId>com.icfolson.aem.groovy.console</groupId>
<artifactId>aem-groovy-console</artifactId>
<packaging>jar</packaging>
<version>12.1.0</version>
<version>13.0.0</version>
<name>AEM Groovy Console</name>
<description>
The AEM Groovy Console provides an interface for running Groovy scripts in the AEM container. Scripts can be
created to manipulate content in the JCR, call OSGi services, or execute arbitrary code using the AEM, Sling,
or JCR APIs.
</description>

<url>https://github.com/icfnext/aem-groovy-console</url>

<organization>
<name>ICF Olson</name>
<url>http://www.icfolson.com</url>
<name>ICF Next</name>
<url>http://www.icfnext.com</url>
</organization>

<licenses>
Expand All @@ -33,14 +37,14 @@
</licenses>

<scm>
<connection>scm:git:git@github.com:OlsonDigital/aem-groovy-console.git</connection>
<developerConnection>scm:git:git@github.com:OlsonDigital/aem-groovy-console.git</developerConnection>
<url>https://github.com/OlsonDigital/aem-groovy-console</url>
<connection>scm:git:git@github.com:icfnext/aem-groovy-console.git</connection>
<developerConnection>scm:git:git@github.com:icfnext/aem-groovy-console.git</developerConnection>
<url>https://github.com/icfnext/aem-groovy-console</url>
</scm>

<issueManagement>
<system>GitHub</system>
<url>https://github.com/OlsonDigital/aem-groovy-console/issues</url>
<url>https://github.com/icfnext/aem-groovy-console/issues</url>
</issueManagement>

<distributionManagement>
Expand All @@ -51,6 +55,7 @@
</distributionManagement>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.build.timestamp.format>yyyy-MM-dd'T'HH:mm:ss.SSSZ</maven.build.timestamp.format>
<timestamp>${maven.build.timestamp}</timestamp>
Expand Down Expand Up @@ -108,8 +113,6 @@
</profiles>

<build>
<sourceDirectory>src/main/groovy</sourceDirectory>
<testSourceDirectory>src/test/groovy</testSourceDirectory>
<resources>
<resource>
<directory>src/main/resources</directory>
Expand All @@ -124,7 +127,7 @@
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<version>3.8.0</version>
<configuration>
<compilerId>groovy-eclipse-compiler</compilerId>
<source>1.8</source>
Expand All @@ -144,44 +147,27 @@
</dependency>
</dependencies>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.19.1</version>
<configuration>
<includes>
<include>**/*Spec*</include>
</includes>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-scr-plugin</artifactId>
<version>1.24.0</version>
<artifactId>maven-bundle-plugin</artifactId>
<version>4.1.0</version>
<extensions>true</extensions>
<executions>
<execution>
<id>generate-scr-scrdescriptor</id>
<id>generate-manifest</id>
<goals>
<goal>scr</goal>
<goal>manifest</goal>
</goals>
</execution>
</executions>
<configuration>
<scanClasses>true</scanClasses>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>3.3.0</version>
<extensions>true</extensions>
<executions>
<execution>
<id>bundle</id>
<goals>
<goal>bundle</goal>
</goals>
</execution>
</executions>
<configuration>
<unpackBundle>true</unpackBundle>
<instructions>
<Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
<Bundle-Name>${project.name}</Bundle-Name>
Expand All @@ -193,6 +179,16 @@
</instructions>
</configuration>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.0</version>
<configuration>
<trimStackTrace>false</trimStackTrace>
<includes>
<include>**/*Spec*</include>
</includes>
</configuration>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.3</version>
Expand Down Expand Up @@ -279,6 +275,7 @@
<contextPath>${aem.context.path}</contextPath>
<username>${aem.username}</username>
<password>${aem.password}</password>
<retryDelay>5000</retryDelay>
</configuration>
</execution>
<execution>
Expand All @@ -298,6 +295,7 @@
<username>${aem.username}</username>
<password>${aem.password}</password>
<skip>${osgi.bundle.status.skip.publish}</skip>
<retryDelay>5000</retryDelay>
</configuration>
</execution>
</executions>
Expand Down Expand Up @@ -343,12 +341,7 @@
</build>

<dependencies>
<!-- inherited -->
<dependency>
<groupId>com.adobe.aem</groupId>
<artifactId>uber-jar</artifactId>
<classifier>apis</classifier>
</dependency>
<!-- inherited from parent -->
<dependency>
<groupId>javax.jcr</groupId>
<artifactId>jcr</artifactId>
Expand All @@ -357,10 +350,6 @@
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jsp-api</artifactId>
</dependency>
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
Expand All @@ -370,12 +359,20 @@
<artifactId>mail</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<groupId>org.osgi</groupId>
<artifactId>osgi.core</artifactId>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>osgi.cmpn</artifactId>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.core</artifactId>
<artifactId>osgi.annotation</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
Expand All @@ -386,33 +383,33 @@
<artifactId>commons-email</artifactId>
</dependency>

<!-- compile -->
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.scr.annotations</artifactId>
<version>1.12.0</version>
</dependency>

<!-- provided -->
<!-- groovy -->
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-all</artifactId>
<version>2.4.13</version>
<version>2.4.15</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.icfolson.aem.groovy.extension</groupId>
<artifactId>aem-groovy-extension-bundle</artifactId>
<version>5.0.0</version>
<version>7.0.0</version>
<scope>provided</scope>
</dependency>

<!-- test -->
<dependency>
<groupId>com.icfolson.aem.prosper</groupId>
<artifactId>prosper</artifactId>
<version>12.0.0</version>
<version>14.0.0</version>
<scope>test</scope>
</dependency>

<!-- uber jar included last to allow other dependencies to override included versions -->
<dependency>
<groupId>com.adobe.aem</groupId>
<artifactId>uber-jar</artifactId>
<classifier>apis</classifier>
</dependency>
</dependencies>
</project>
2 changes: 1 addition & 1 deletion src/main/assembly/zip-exclude-groovy-bundle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
</fileSet>
<fileSet>
<directory>${basedir}/src/main/scripts</directory>
<outputDirectory>jcr_root/etc/groovyconsole/scripts/samples</outputDirectory>
<outputDirectory>jcr_root/var/groovyconsole/scripts/samples</outputDirectory>
</fileSet>
<fileSet>
<directory>${basedir}/src/main/content/META-INF</directory>
Expand Down
2 changes: 1 addition & 1 deletion src/main/assembly/zip.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
</fileSet>
<fileSet>
<directory>${basedir}/src/main/scripts</directory>
<outputDirectory>jcr_root/etc/groovyconsole/scripts/samples</outputDirectory>
<outputDirectory>jcr_root/var/groovyconsole/scripts/samples</outputDirectory>
</fileSet>
<fileSet>
<directory>${basedir}/src/main/content/META-INF</directory>
Expand Down
14 changes: 5 additions & 9 deletions src/main/content/META-INF/vault/filter.xml
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<workspaceFilter version="1.0">
<filter root="/apps/groovyconsole/components"/>
<filter root="/apps/groovyconsole/config"/>
<filter root="/apps/groovyconsole/install"/>
<filter root="/apps/groovyconsole/templates"/>
<filter root="/etc/clientlibs/groovyconsole"/>
<filter root="/etc/groovyconsole">
<exclude pattern="/etc/groovyconsole/scripts(/.*)?"/>
<exclude pattern="/etc/groovyconsole/jcr:content/audit(/.*)?"/>
</filter>
<filter root="/apps/groovyconsole"/>
<filter root="/home/users/system/groovy-console-system-user"/>
<filter root="/var/groovyconsole">
<exclude pattern="/var/groovyconsole/scripts(/.*)?"/>
<exclude pattern="/var/groovyconsole/audit(/.*)?"/>
</filter>
<filter root="/rep:policy"/>
</workspaceFilter>
2 changes: 1 addition & 1 deletion src/main/content/META-INF/vault/properties.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<entry key="version">${project.version}</entry>
<entry key="requiresRoot">true</entry>
<entry key="dependencies">day/cq60/product:cq-content:6.3.64</entry>
<entry key="group">ICF Olson</entry>
<entry key="group">ICF Next</entry>
<entry key="packageFormatVersion">2</entry>
<entry key="lastWrapped">${timestamp}</entry>
<entry key="lastWrappedBy">${aem.username}</entry>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@
jcr:primaryType="cq:ClientLibraryFolder"
sling:resourceType="widgets/clientlib"
categories="[groovyconsole]"
dependencies="[cq.shared]"/>
allowProxy="{Boolean}true"
dependencies="[cq.shared]"/>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#base=css

bootstrap.min.css
bootstrap-theme.min.css
bootstrap.css
bootstrap-theme.css
daterangepicker-bs3.css
datatables.css
console.css
Loading

0 comments on commit 44225c6

Please sign in to comment.