Hi All,
I am working on a use case where I need to override the sling model of the OOTB asset share commons code. I have ModelA implementing Interface. I want to write ModelB which will implement interface only with the custom logic. Rest of the code should stay as is. Is there any way we can do it ? I tried Sling Model Delegation but it did not work. Can anybody help on this ?
Views
Replies
Total Likes
When you say it didn't work with Delegation pattern, what is the issue you are facing? Can you specify.
Are you seeing null values for the properties? Is the custom logic not working?
Are you following this? https://github.com/adobe/aem-core-wcm-components/wiki/Delegation-Pattern-for-Sling-Models
Views
Replies
Total Likes
Yes @gkalyan I have followed the same link. For null values for the properties I understand we need to override the functions of the interface. But the problem is that custom sling model is not getting invoked.I am trying to write custom sling model for interface asset-share-commons/core/src/main/java/com/adobe/aem/commons/assetshare/components/actions/download/....
I have tried the below.
Views
Replies
Total Likes
Can you check the below if not already:
1. Your custom sling model is registered and active in OSGI console.
2. Sling:resourceSuperType property of the component is set to OOTB Download component resource type.
Finally, try clear component cache and restrart AEM.
If the above doesn't work, let's look at the logs
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies