Hello everyone,
I've got a task to create a service for deleting installed packages programmatically. According https://developer.adobe.com/experience-manager/reference-materials/6-5/javadoc/org/apache/jackrabbit... it does existing a way doing it so. Does exists somewhere an working an example how to get access to package manager?
I am completly new on this field.
Thanks in advanced.
Views
Replies
Total Likes
Views
Replies
Total Likes
Thanks for your answer. I read this post and I come up with new question:
According to linked post it is recommended to uninstall a package first. Unfortunatly I forgort to mention I want to delete old packages and want keep the latest three. So my question is: What will happend, if I uninstall previous version of a package, in case if it possible with curl
Views
Replies
Total Likes
@Magicr You will need to have Admin access to navigate to CRX package manager.
Step by step instructions for perform delete operation programmatically:
Decide lookup method
Create a Sling service user and mapping
Build an OSGi service interface (PackageDeletionService) and implementation.
Acquire a secure ResourceResolver and JCR Session
Preferred deletion: use Packaging API
Fallback: remove JCR nodes directly
Safety and checks
Error handling and cleanup
Test and deploy
Minimal example (conceptual):
Views
Replies
Total Likes
Hi @Magicr,
If you are using AEM 6.5 you can consider to use below tool from ACS Commons, so you may not need to implement anything custom.
However if the implementation is still the key, you can check how above feature has been implemented and how you can operate Package Manager api on code level, here is a link to sample code:
Views
Likes
Replies