APACHE FELIX SCRIPT CONSOLE
————————————————–
Oak engineer Chetan Mehrotra (@chetanmeh) has published a few Oak DEBUG scripts written in Groovy here.
Steps
1) Install the Apache Felix Script Console OSGi bundle (this is NOT an AEM package, this is an OSGi bundle that has to be installed from the Apache Felix console at /system/console/bundles)
2) Install the Groovy runtime OSGi bundle as well
3) Load the Script Console at /system/console/sc in AEM
4) Choose the runtime as “Groovy” from the dropdownlist
5) Copy-paste the script you want to run
6) Click Execute
NOTE: If you’re using AEM 6.3, you need to whitelist the Script Console. To do this, in /system/console/configMgr, search for “Apache Sling Login Admin Whitelist Configuration Fragment” and add a new configuration with:
Name = ScriptConsole
Whitelisted BSN (Bundle Symbolic Name) = org.apache.felix.webconsole.plugins.scriptconsole
Otherwise, you will get the following exception:
javax.script.ScriptException: javax.script.ScriptException: javax.jcr.LoginException: Bundle org.apache.felix.webconsole.plugins.scriptconsole is NOT whitelisted
ICF OLSON GROOVY CONSOLE
———————————————
Adobe partner ICF Olson (the people behind the CIRCUIT AEM conference) has developed a Groovy Console for AEM - see this. Once installed, you can access the Groovy Console at /etc/groovyconsole.html and run your scripts.
GROOVY SCRIPTS WITH OAK-RUN CONSOLE
—————————————————————–
There are other Groovy scripts out there than need to be run with the oak-run utility (from a command prompt or shell). See this. To run those, here are the steps (Windows 10 example):
1) Download oak-run from here
2) Run it using Windows Command Prompt. Example command below (output here):
java -Xmx4g -jar oak-run-1.6.1.jar console –segment=true G:\AEM_6.2\Author\crx-quickstart\repository\segmentstore “:load https://gist.githubusercontent.com/chetanmeh/d7588d96a839dd2d26760913e4055215/raw/oakRepoStats.groovy”
Another example (get Oak index statistics):
java -Xmx4g -jar oak-run-1.6.1.jar console –segment=true G:\AEM_6.2\Author\crx-quickstart\repository\segmentstore “:load https://gist.githubusercontent.com/chetanmeh/ccaa10e6ee8c9b0775484e6a9f6ba06e/raw/0c7a5ce0a32847cd73f0d9014cdaeb3949f80b7f/consoleIndexStats.groovy”
https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/groovy-console-integration-to-aem-instance/qaq-p/278114
No comments:
Post a Comment
If you have any doubts or questions, please let us know.