Hello everyone, welcome to this new post where we will discuss a new utility to create an AEM JCR package from the entries present in an excel file.
Problem Statement
Sometimes we are given with the details of content paths in JCR (crx/de) also called filters (the same which we use to create a package in AEM via the package manager). If there are multiple different paths then it becomes tedious to add each content path as a filter one by one.
Solution
I have been working on a utility in AEM that will read the content paths in the excel file and will create a package in package manager based on that.
This utility contains an interface which lets you fill the package details like the package name, package group and an upload button to upload the excel file.
Steps to configure
Let's get started with the steps to configure this utility.
Step #1
Clone and build the AEM project from here. You may need to change the uber jar version as per your need in the project's parent pom.xml. Build and install the package
Step #2
Navigate to the link http://<host>:<port>/apps/ContentPackager/admin/ext/contentpackager/content/contentPackager.html
![]() |
Content Packager Console |
Step #3
Now, you will get a screen where you can upload your excel file (.xlsx) with the user details. After you click on the "Upload" button, your package will be created in the AEM.
The excel file should look like this.
![]() |
Sample excel file content |
As you can see, you can have as many as filters as you want.
Caution:
For this project, we have overlayed the path /libs/cq/core/content/nav/tools into /apps/ContentPackager/cq/core/content/nav/tools. Since the overlayed path is not directly in /apps but in /apps/ContentPackager, we have to change the sling resource resolver setting in the system.
We can do this by navigating to the ./system/console/configMgr and search for Apache Sling Resource Resolver Factory and change the Resource Search path from /apps to /apps/ContentPackager and save.
![]() |
Apache Sling Resource Resolver Factory |
However, if you do not wish to change the default configuration, you just have to move /apps/ContentPackager/cq to /apps/cq in crx/de.
Conclusion
The Content Packager utility enables you to just upload an excel file with the details of the filter and your work is done.
If you wish to see the complete code of this project and contribute towards the same with your suggestions and code, then you can find it on my GitHub.
I hope this will help you in your projects and speed up your development.
I would love to hear your thoughts on this post and would like to have suggestions from you to make this post better.
Happy Learning 😊
ArgilDX launched a bunch of tools in Jan 19 that includes this feature at https://adxtools.argildx.com
ReplyDeleteArgilDX has a similar tool they launched way back in January this year at https://adxtools.argildx.com
ReplyDeleteNice utility! Will help me in importing paths for my site.
ReplyDeleteThanks a lot for your feedback. I am glad that it is useful for you.
DeleteCheers!
I can't see the the html file as mentioned. Its blank there. Can you please provide the complete path.
ReplyDelete