{"id":23459529,"url":"https://github.com/orbinson/aem-groovy-console","last_synced_at":"2025-04-14T04:15:08.409Z","repository":{"id":64832613,"uuid":"577794876","full_name":"orbinson/aem-groovy-console","owner":"orbinson","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 CQ, Sling, or JCR APIs.","archived":false,"fork":false,"pushed_at":"2025-03-04T19:17:18.000Z","size":3955,"stargazers_count":20,"open_issues_count":7,"forks_count":5,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-14T04:15:00.310Z","etag":null,"topics":["aem","aem-groovy-console","aem-groovy-scripts","groovy"],"latest_commit_sha":null,"homepage":"https://orbinson.github.io/aem-groovy-console/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"CID15/aem-groovy-console","license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/orbinson.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["bdhoine","royteeuwen"]}},"created_at":"2022-12-13T14:41:30.000Z","updated_at":"2025-04-10T05:50:56.000Z","dependencies_parsed_at":"2024-02-10T12:25:10.938Z","dependency_job_id":"b63aa32f-f56d-477f-bccf-f6710d4b0ee5","html_url":"https://github.com/orbinson/aem-groovy-console","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orbinson%2Faem-groovy-console","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orbinson%2Faem-groovy-console/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orbinson%2Faem-groovy-console/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orbinson%2Faem-groovy-console/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/orbinson","download_url":"https://codeload.github.com/orbinson/aem-groovy-console/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248819408,"owners_count":21166477,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aem","aem-groovy-console","aem-groovy-scripts","groovy"],"created_at":"2024-12-24T06:14:58.462Z","updated_at":"2025-04-14T04:15:08.383Z","avatar_url":"https://github.com/orbinson.png","language":"JavaScript","funding_links":["https://github.com/sponsors/bdhoine","https://github.com/sponsors/royteeuwen"],"categories":[],"sub_categories":[],"readme":"[![Maven Central](https://img.shields.io/maven-central/v/be.orbinson.aem/aem-groovy-console)](https://search.maven.org/artifact/be.orbinson.aem/aem-groovy-console-all)\n[![GitHub](https://img.shields.io/github/v/release/orbinson/aem-groovy-console)](https://github.com/orbinson/aem-groovy-console/releases)\n[![Build and test for AEM 6.5](https://github.com/orbinson/aem-groovy-console/actions/workflows/build.yml/badge.svg)](https://github.com/orbinson/aem-groovy-console/actions/workflows/build.yml)\n[![Build with AEM IDE](https://img.shields.io/badge/Built%20with-AEM%20IDE-orange)](https://plugins.jetbrains.com/plugin/9269-aem-ide)\n\n\n# AEM Groovy Console\n\n\u003e [!IMPORTANT]\n\u003e Currently Adobe Managed Services is not allowing AEM Groovy Console to be installed on production publish environments for security reasons. We are taking actions in order to get it accepted.\n\n## Overview\n\nThe AEM Groovy Console provides an interface for running [Groovy](https://www.groovy-lang.org) scripts in Adobe\nExperience Manager. Scripts can be created to manipulate content in the JCR, call OSGi services, or execute arbitrary\ncode using the AEM, Sling, or JCR APIs. After installing the package in AEM (instructions below), see\nthe [console page](http://localhost:4502/groovyconsole) for documentation on the available bindings and methods. Sample\nscripts are included in the package for reference.\n\n![Screenshot](docs/assets/screenshot.png)\n\n## Compatibility\n\nAEM Groovy Console 19.0.1+ runs on Java 8 and 11 with an embedded Groovy version of 4.0.9\n\nSupported versions:\n\n* AEM On premise: `\u003e= 6.5.10`\n* AEM as a Cloud Service: `\u003e= 2022.11`\n* Sling: `\u003e=12`\n\nTo install the AEM Groovy Console on older AEM versions check the original\nproject [aem-groovy-console](https://github.com/CID15/aem-groovy-console)\n\n## Installation\n\n### Manual\n\n1. Download the\n   console [aem-groovy-console-all](https://github.com/orbinson/aem-groovy-console/releases/download/19.0.3/aem-groovy-console-all-19.0.3.zip)\n   content package and install with [PackMgr](http://localhost:4502/crx/packmgr). For previous versions you can search\n   on the [Maven Central repository](https://search.maven.org/search?q=a:aem-groovy-console).\n\n2. Navigate to the [groovyconsole](http://localhost:4502/groovyconsole) page.\n\n### Maven profiles\n\nMaven profiles can be used to install the bundles to AEM / Sling\n\n* AEM Author running on localhost:4502\n    * api, bundle, ui.apps, ui.apps.aem, ui.config, ui.content: `-P auto-deploy`\n    * all: `-P auto-deploy-single-package,aem`\n* AEM Publish running on localhost:4503\n    * api, bundle, ui.apps, ui.apps.aem, ui.config, ui.content: `-P auto-deploy,publish`\n    * all: `-P auto-deploy-single-package,aem,publish`\n* Sling running on localhost:8080\n    * api, bundle, ui.apps, ui.apps.aem, ui.config, ui.content: `-P auto-deploy,sling`\n    * all: `-P auto-deploy-single-package,sling`\n\n### Embedded package\n\nTo deploy the Groovy Console as an embedded package you need to update your `pom.xml`\n\n1. Add the `aem-groovy-console-all` to the `\u003cdependencies\u003e` section\n\n   ```xml\n   \u003cdependency\u003e\n     \u003cgroupId\u003ebe.orbinson.aem\u003c/groupId\u003e\n     \u003cartifactId\u003eaem-groovy-console-all\u003c/artifactId\u003e\n     \u003cversion\u003e19.0.3\u003c/version\u003e\n     \u003ctype\u003ezip\u003c/type\u003e\n   \u003c/dependency\u003e\n   ```\n2. Embed the package in with\n   the [filevault-package-maven-plugin](https://jackrabbit.apache.org/filevault-package-maven-plugin/) in\n   the `\u003cembeddeds\u003e` section\n\n   ```xml\n   \u003cembedded\u003e\n      \u003cgroupId\u003ebe.orbinson.aem\u003c/groupId\u003e\n      \u003cartifactId\u003eaem-groovy-console-all\u003c/artifactId\u003e\n      \u003ctarget\u003e/apps/vendor-packages/content/install\u003c/target\u003e\n   \u003c/embedded\u003e\n   ```\n\n### AEM Dispatcher\n\nIf you need to have the Groovy Console available through the dispatcher on a publish instance you can add the filters\nfollowing configuration.\n\n```text\n# Allow Groovy Console page\n/001 {\n    /type \"allow\"\n    /url \"/groovyconsole\"\n}\n/002 {\n    /type \"allow\"\n    /url \"/apps/groovyconsole.html\"\n}\n\n# Allow servlets\n/003 {\n    /type \"allow\"\n    /path \"/bin/groovyconsole/*\"\n}\n```\n\n## Building From Source\n\nTo build and install the latest development version of the Groovy Console to use in AEM (or if you've made source\nmodifications), run\nthe following Maven command.\n\n```shell\nmvn clean install -P autoInstallSinglePackage\n```\n\n## OSGi Configuration\n\nTo check the OSGi configuration navigate to\nthe [Groovy Console Configuration Service](http://localhost:4502/system/console/configMgr/be.orbinson.aem.groovy.console.configuration.impl.DefaultConfigurationService)\nOSGi configuration page.\n\n| Property                        | Description                                                                                                                       | Default Value |\n|---------------------------------|-----------------------------------------------------------------------------------------------------------------------------------|---------------|\n| Email Enabled?                  | Check to enable email notification on completion of script execution.                                                             | `false`       |\n| Email Recipients                | Email addresses to receive notification.                                                                                          | `[]`          |\n| Script Execution Allowed Groups | List of group names that are authorized to use the console.  By default, only the 'admin' user has permission to execute scripts. | `[]`          |\n| Scheduled Jobs Allowed Groups   | List of group names that are authorized to schedule jobs.  By default, only the 'admin' user has permission to schedule jobs.     | `[]`          |\n| Audit Disabled?                 | Disables auditing of script execution history.                                                                                    | `false`       |\n| Display All Audit Records?      | If enabled, all audit records (including records for other users) will be displayed in the console history.                       | `false`       |\n| Thread Timeout                  | Time in seconds that scripts are allowed to execute before being interrupted.  If 0, no timeout is enforced.                      | 0             |\n| Distributed execution enabled?  | If enabled, a script will be able to be replicated from an author and executed on all default replication agents.                 | `false`       |\n\n## Batch script execution\n\nSaved scripts can be remotely executed by sending a POST request to the console servlet with either the `scriptPath`\nor `scriptPaths` query parameter.\n\n### Single script\n\n```shell\ncurl -d \"scriptPath=/conf/groovyconsole/scripts/samples/JcrSearch.groovy\" -X POST -u admin:admin http://localhost:4502/bin/groovyconsole/post.json\n```\n\n### Multiple scripts\n\n```shell\ncurl -d \"scriptPaths=/conf/groovyconsole/scripts/samples/JcrSearch.groovy\u0026scriptPaths=/conf/groovyconsole/scripts/samples/FulltextQuery.groovy\" -X POST -u admin:admin http://localhost:4502/bin/groovyconsole/post.json\n```\n\n## Extensions\n\nThe Groovy Console provides extension hooks to further customize script execution. The console provides an API\ncontaining extension provider interfaces that can be implemented as OSGi services in any bundle deployed to an AEM\ninstance. See the default extension providers in the `be.orbinson.aem.groovy.console.extension.impl` package for\nexamples of how a bundle can implement these services to supply additional script bindings, compilation customizers,\nmetaclasses, and star imports.\n\n| Service Interface                                                           | Description                                                                                                                  |\n|-----------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------|\n| `be.orbinson.aem.groovy.console.api.BindingExtensionProvider`               | Customize the bindings that are provided for each script execution.                                                          |\n| `be.orbinson.aem.groovy.console.api.CompilationCustomizerExtensionProvider` | Restrict language features (via blacklist or whitelist) or provide AST transformations within the Groovy script compilation. |\n| `be.orbinson.aem.groovy.console.api.ScriptMetaClassExtensionProvider`       | Add runtime metaclasses (i.e. new methods) to the underlying script class.                                                   |\n| `be.orbinson.aem.groovy.console.api.StarImportExtensionProvider`            | Supply additional star imports that are added to the compiler configuration for each script execution.                       |\n\n## Registering Additional Metaclasses\n\nServices implementing the `be.orbinson.aem.groovy.console.extension.MetaClassExtensionProvider` will be automatically\ndiscovered and bound by the OSGi container. These services can be implemented in any deployed bundle. The AEM Groovy\nExtension bundle will handle the registration and removal of supplied metaclasses as these services are\nactivated/deactivated in the container. See the `DefaultMetaClassExtensionProvider` service for the proper closure\nsyntax for registering metaclasses.\n\n## Notifications\n\nTo provide custom notifications for script executions, bundles may implement\nthe `be.orbinson.aem.groovy.console.notification.NotificationService` interface (see\nthe `be.orbinson.aem.groovy.console.notification.impl.EmailNotificationService` class for an example). These services\nwill\nbe dynamically bound by the Groovy Console service and all registered notification services will be called for each\nscript execution.\n\n## Scheduler\n\nThe Scheduler allows for immediate (asynchronous) or Cron-based script execution. Scripts are executed\nas [Sling Jobs](https://sling.apache.org/documentation/bundles/apache-sling-eventing-and-job-handling.html) and are\naudited in the same manner as scripts executed in the console.\n\n### Scheduled Job Event Handling\n\nBundles may implement services\nextending `be.orbinson.aem.groovy.console.job.event.AbstractGroovyConsoleScheduledJobEventHandler` to provide\nadditional post-processing or notifications for completed Groovy Console jobs.\nSee `be.orbinson.aem.groovy.console.job.event.DefaultGroovyConsoleEmailNotificationEventHandler` for an example of the\nrequired annotations to register a custom event handler.\n\n## Sample Scripts\n\nSample scripts can be found in the [samples](ui.content/src/main/content/jcr_root/conf/groovyconsole/scripts/samples) directory.\n\n## Kudos\n\nKudos to [ICF Next](https://github.com/icfnext/aem-groovy-console)\nand [CID 15](https://github.com/CID15/aem-groovy-console) for the initial development of the AEM Groovy Console. We\nforked this plugin because the maintenance of the plugins seems to have stopped.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Forbinson%2Faem-groovy-console","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Forbinson%2Faem-groovy-console","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Forbinson%2Faem-groovy-console/lists"}