Test and run Sling RepoInit scripts from the web console.
Do not install in production systems. This bundle is not for production use and is only meant to be used for testing and development.
Either download the latest version of this bundle from the Sling Downloads page or build from source by checking out the project from Git and building with Maven:
mvn clean install sling:install
Note installing from source requires Java 11 or later and Maven 3.x or later.
To enable execute functionality of the web console, you must add a Apache Sling Login Admin Whitelist entry. Open the OSGi console to /system/console/configMgr and add an entry for org.apache.sling.repoinit.webconsole
either to an existing configuration fragment or a new one.
To use the plugin, navigate to /system/console/repoinit and enter the script you want to run into the source text area. Select the Evaluate
button to validate the script, if you want to execute the script, select the Execute
checkbox.
Assuming the script is valid a JSON representation will be displayed in the Parsed Statements
section and the corresponding Feature Model JSON will display in the Feature Model JSON
section.
If your script is not valid, an error message will be displayed in the Parsed Statements
section.
If you get the error message:
Failed to apply statements [LoginException]: Bundle org.apache.sling.repoinit.webconsole is NOT whitelisted
You need to add the bundle to the login admin whitelist. See Configuration above.