icfnext / aem-groovy-console

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.
Other
159 stars 94 forks source link

Request agnostic groovy console service script execution #96

Closed pun-ky closed 4 years ago

pun-ky commented 4 years ago

I am developing some new tool which will have integration with Groovy Console. The idea is for having scripts that could be pre-launched during bundle start lifecycle event.

However, AEM Groovy Console does not offer any method for running scripts without request specified. Should I use some request mock in that case or maybe you could do some work for extracting some code from

https://github.com/icfnext/aem-groovy-console/blob/develop/src/main/groovy/com/icfolson/aem/groovy/console/impl/DefaultGroovyConsoleService.groovy#L74

to separate groovy executing service method which will be request agnostic?

Any thoughts appreciated,

Greetings, Krystian.

PS some other tool integrating with Groovy Console also requires such feature and is doing some workaround, see:

markdaugherty commented 4 years ago

@pun-ky see linked pull request - does this align with your expectations?

pun-ky commented 4 years ago

Looks mostly good. I am wondering only why request is a part of script context interface. While viewing this on mobile 📱 I cannot see usages of that request 😉