April 2, 2020
Estimated Post Reading Time ~

Creating package with filters/exclusion using cUrl (CLI)

The article explains managing Packages on the Command-Line. In this blog post providing a sample to add the filter definitions with exclusion using cUrl. CQ 5.5 uses multipart/form-data to POST the data. The command referenced is for cq5.5 onwards. In case it is cq5.4 please use .

As an example for cq5.5 onwards, the cUrl command to add a filter definition /content/geometrixx/en and to exclude all the page below /content/geometrixx/en that starts with a range a to z for the already existing package (test-2.zip) and group mygroup is

curl -u admin:admin -X POST -F 'path=/etc/packages/mygroup/test-2.zip' -F 'packageName=test' -F 'groupName=mygroup' -F 'version=2' -F 'filter=[{"root":"/content/geometrixx/en","rules":[{"modifier":"exclude","pattern":"/content/geometrixx/en/[a-z].*"}]}]' -F '_charset_=UTF-8' http://localhost:4502/crx/packmgr/update.jsp

Sample curl command for cq5.4 to add two filters below

curl -u admin:admin -X POST --data _charset_=UTF-8 --data groupName=mygroup --data version=3 --data filter='[{"root":"/apps/cq/analytics/widgets/js.txt","rules":[]},{"root":"/etc/blueprints/geometrixx/jcr:content/thumbnail","rules":[]}]' --data packageName=test --data path=/etc/packages/mygroup/test-test-2.zip http://localhost:4502/crx/packmgr/update.jsp

http://dev.day.com/docs/en/crx/current/how_to/package_manager.html

CQ 5.5 Onwards includes AEM 5.6 etc
curl -u <uid>:<pwd> -X POST -F 'path=<full_path_of_package>' -F 'packageName=<packageName>' -F 'groupName=<group_name>' -F 'version=<Version_Number>' -F 'filter=<array_of_filter_definitions_containing_root_and_pattern>' -F '_charset_=UTF-8' http://<host>:<port>/crx/packmgr/update.jsp

CQ 5.4 & Below
curl -u admin:admin -X POST --data _charset_=UTF-8 --data groupName=<group_name> --data version=<Version_Number> --data filter='<array_of_filter_definitions_containing_root_and_pattern>' --data packageName=<packageName> --data path=<full_path_of_package> http://<host>:<port>/crx/packmgr/update.jsp


By aem4beginner

No comments:

Post a Comment

If you have any doubts or questions, please let us know.