-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Limit permissions of service user and update docs for security
- Loading branch information
Showing
19 changed files
with
207 additions
and
180 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Configuration | ||
|
||
To check the OSGi configuration navigate to | ||
the [Groovy Console Configuration Service](http://localhost:4502/system/console/configMgr/be.orbinson.aem.groovy.console.configuration.impl.DefaultConfigurationService) | ||
OSGi configuration page. | ||
|
||
The following configuration properties are available: | ||
|
||
| Property | Description | Default Value | | ||
|---------------------------------|-----------------------------------------------------------------------------------------------------------------------------------|---------------| | ||
| Email Enabled? | Check to enable email notification on completion of script execution. | `false` | | ||
| Email Recipients | Email addresses to receive notification. | `[]` | | ||
| 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. | `[]` | | ||
| 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. | `[]` | | ||
| 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` | | ||
| Thread Timeout | Time in seconds that scripts are allowed to execute before being interrupted. If 0, no timeout is enforced. | 0 | | ||
| Distributed execution enabled? | If enabled, a script will be able to be replicated from an author and executed on all default replication agents. | `false` | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Execution | ||
|
||
There are a various way to run Groovy scripts with the AEM Groovy Console. | ||
|
||
## Batch script execution | ||
|
||
Saved scripts can be remotely executed by sending a POST request to the console servlet with either the `scriptPath` | ||
or `scriptPaths` query parameter. | ||
|
||
### Single script | ||
|
||
```shell | ||
curl -d "scriptPath=/conf/groovyconsole/scripts/samples/JcrSearch.groovy" -X POST -u admin:admin http://localhost:4502/bin/groovyconsole/post.json | ||
``` | ||
|
||
### Multiple scripts | ||
|
||
```shell | ||
curl -d "scriptPaths=/conf/groovyconsole/scripts/samples/JcrSearch.groovy&scriptPaths=/conf/groovyconsole/scripts/samples/FulltextQuery.groovy" -X POST -u admin:admin http://localhost:4502/bin/groovyconsole/post.json | ||
``` | ||
|
||
## Scheduler | ||
|
||
The Scheduler allows for immediate (asynchronous) or Cron-based script execution. Scripts are executed | ||
as [Sling Jobs](https://sling.apache.org/documentation/bundles/apache-sling-eventing-and-job-handling.html) and are | ||
audited in the same manner as scripts executed in the console. | ||
|
||
### Scheduled Job Event Handling | ||
|
||
Bundles may implement services | ||
extending `be.orbinson.aem.groovy.console.job.event.AbstractGroovyConsoleScheduledJobEventHandler` to provide | ||
additional post-processing or notifications for completed Groovy Console jobs. | ||
See `be.orbinson.aem.groovy.console.job.event.DefaultGroovyConsoleEmailNotificationEventHandler` for an example of the | ||
required annotations to register a custom event handler. |
Oops, something went wrong.