I'm using AEM Cloud and I want to retrieve some data for a page using sling model. For that appID or artifactId is required in sling model. Is there a way to get this is sling model?
Solved! Go to Solution.
Views
Replies
Total Likes
You can try to retrieve bundle version if that helps.
Not sure why you need appID or artifactId ? can you please provide your use case ?
If your use case is to just to read data from AEM JCR nodes and display on the page You don't need to have app id or artifact id.
You can use sling model :
You can simply read the data from JCR and map to the sling model variables . Using sightly you can simply display the data.
Sling Models:
Sling Models are annotation driven Java “POJO's” (Plain Old Java Objects) that facilitate the mapping of data from the JCR to Java variables.
Thanks
Siva
@NikitaTailor24 I dont think there is an option for this directly in Sling Model.
What is your use case?
However if you require just the app id or artifact id you can store it in an OSGI config and retrieve it in your sling model.
Views
Likes
Replies
Views
Likes
Replies