Hi
I'm currently using Sling Models to adapt several Resources to customized models. One of my models must be aware of the original resource it was adapted from (I basically need the name of the node but I guess it wouldn't hurt to have the full path as it will provide me with more flexibility). It seems that @SlingObject is what I'm looking for. Unfortunately AEM 6.0 is using Sling Models 1.0.x and SlingObject requires 1.1.x or so. Updating to AEM 6.1 is currently no option so I was wondering if there is any other way that would get me the information I need.
As an alternative I could install the 1.1.x bundles in AEM6.0 but I'm not sure if it is safe to do so. I'm pretty sure it won't break our custom code but what about the AEM6 code base?
Any advice/help is greatly appreciated.
Cheers
Solved! Go to Solution.
Views
Replies
Total Likes
You can use the :
@Source('sling-object')
It will have the same effect as @SlingObject
Att.
Views
Replies
Total Likes
You can use the :
@Source('sling-object')
It will have the same effect as @SlingObject
Att.
Views
Replies
Total Likes
Hi
Thank you for your response. Unfortunately it doesn't seem to work for me in this particular case (original object was of type Resource.class). However I was able to get the resource by simply adding @Inject private Resource resource; to the class in question. I'll keep the @Source annotation in mind though. Thanks again for your help.
Cheers
Views
Replies
Total Likes
Views
Likes
Replies