Hi Team,
I'm trying to get used of Sling model exporter capability where http://localhost:4502/content/<prject>/en/page/jcr:content/parsys/component.model.json
But I 'm getting an error saying Invalid recursion selector value 'model'.
How I can get sorted this ?
Note - Is this we can use only for content fragment with a content fragment proxy component ?
Thanks!
Solved! Go to Solution.
Views
Replies
Total Likes
Hi @JakeCham
OOTB, It is not possible to get the specific component data in json format. but you can create your own servelt with that selector and return the json data.
HI @JakeCham
You have to use model with page
http://localhost:4502/content/<prject>/en/page/jcr:content/parsys/component.model.json
more info : https://experienceleague.adobe.com/docs/experience-manager-65/content/implementing/developing/compon...
Hi @arunpatidar
Can't we get specific component data inside page in json format rather whole page data ?
Hi @JakeCham
OOTB, It is not possible to get the specific component data in json format. but you can create your own servelt with that selector and return the json data.
Hi @JakeCham,
You need to make sure your component has Sling Model implementation; otherwise you'll encounter Invalid recursion selector value 'model' error.
@Model(
adaptables = { SlingHttpServletRequest.class },
adapters = { Article.class },
resourceType = { Article.RESOURCE_TYPE },
defaultInjectionStrategy = DefaultInjectionStrategy.OPTIONAL)
@Exporter(
name = ExporterConstants.SLING_MODEL_EXPORTER_NAME,
extensions = ExporterConstants.SLING_MODEL_EXTENSION)
public class Article {
protected static final String RESOURCE_TYPE = "aem-demo/components/article";
// Implementation
}
http://localhost:4502/content/aem-demo/us/en/jcr:content/root/container/container/artice.model.json
You can get any Sling Model exported, you just need to prepare the model for it, see the documentation here: https://experienceleague.adobe.com/docs/experience-manager-65/content/implementing/developing/compon...
Views
Likes
Replies