Problem Statement:
Create a tool similar to AEM Operations or ACS Commons for easy access and to run any maintenance process/tasks.
Introduction:
AEM OOTB comes with multiple tools in AEM and to access all the tools you need to navigate to the tool section and select the appropriate sections to perform all the operations
For example:
- AEM operations
- Managing templates
- Cloud configurations
- ACS Commons tools etc..
Tools are an essential part of AEM and avoid any dependency on Groovy scripts or any add scripts and can be managed or extended at any given point in time.
In order to create any tool from scratch takes a lot of time and man hours and once all the configs are ready then it takes more time to develop the services and servlet to handle the business logic.
By using this tool, you can avoid all kinds of configurations and initial setup and kick start with your own first tool from scratch
The tool generator consists of the:
- Sling model – to generate fields and handle inputs
- Servlet – to process request
- Component – to handle view (HTL), CSS, and JS
All the above sample scratch setups along with ready to check-in code will be added to the code base.
How to use the tool?
1. Click on the link to download the tool generator package and install it into your local instance
2. Once the package is installed go to sites -> tools -> and select the Tool Generator section

3. Select Tool Settings on the top right hand corner and provide your local repository paths like sling model path, servlet path, apps path, conf path, and CQ path if it already exists

4. Once all the settings are authored save the settings

5. After coming to the generator page provide your tool name and tool description

6. If you have an existing tool then select Yes else Select No and provide the Tool Section name
7. Click on Create tool to create your new tool from scratch

Check your repository for all the file changes as shown below:

You can also check your new tool component and other configs on CRXDE

You can also visit your new tool by accessing the tool section (sites -> Tools -> {Your section name})

For more info on how to add a Sling model field please visit the below link:
Once your Sling model, servlet, and other things are ready make sure you add the following filter in your META-INF folder and keep it merge as shown below:

This would avoid replacing/overriding any other tools like ACS Commons or your other repo tools.
Hi,
Thanks for the content, it was a good read.
The only thing is the most important that is the tool when installed it doesn’t show anything when accessed, just blank screen.
LikeLike
Hi Joe can you please check if bundle is up and running? And error log
LikeLike
Hi if I may piggy-back here, as I am seeing the same issue.
During installation, I get a “Could not start bundle toolgenerator.core” in the error log.
And when I click on the tool which opens a blank page, this is logged:
“com.toolgenerator.core.models.ToolGeneratorModel cannot be resolved to a type”
More detail here:
https://goofy-macrame-545.notion.site/Error-messages-ad75e92bb42b412f977a92612375cfa9
Great content btw!
LikeLike
Hi Shawn
Can you please check ACS commons installed on your environment and toolgenerator core Pom dependency declared
LikeLike
Installing ACS common worked for me. Thanks Kiran
But I did run into another issue on Step 3. When clicked on “Create Tool”, a red pop-up alerts “Unable to process package operation”.
Looking at the error log, it shows “POST /bin/triggerToolCreator HTTP/1.1] org.apache.sling.engine.impl.SlingRequestProcessorImpl service: Uncaught Throwable”.
Again more detail can be found here:
https://goofy-macrame-545.notion.site/Step-3-b19389762afb4389a2565a87b38fd1fb
The dependencies are all installed including 2.19.0 version of core.wvc.components. Not sure what am I missing…
LikeLike