I want to override OOTB Page Sling model exporter class. For example - http://localhost:4502/content/we-retail/language-masters/en.model.json this makes a call to OOTB sling model exporter. I want to have similar functionalities with with changes. Is it possible to see source code for this OOTB sling model exporter?
Views
Replies
Total Likes
I am aware about how to create a model exporter class. I am using below code snippet. I just want to if I can see source code for OOTB page model exporter ( http://localhost:4502/content/we-retail/language-masters/en.model.json ) Is this open source to check ?
@Model(adaptables = SlingHttpServletRequest.class, adapters = {Page.class, ContainerExporter.class},
resourceType = "sling/servlet/default", defaultInjectionStrategy = DefaultInjectionStrategy.OPTIONAL)
@exporter(name = ExporterConstants.SLING_MODEL_EXPORTER_NAME, selector = "data",
extensions = ExporterConstants.SLING_MODEL_EXTENSION)
I am trying to understand what OSGI bundle has the OOTB sling model exporter. Do you have any idea ?
Hi @Mario248 ,
It is recommended to implement custom model to export the page basing on your resourceType where you can customize extension Exporter framework etc.
for more details kindly refer the article shared by @Saravanan_Dharmaraj as below along with understanding it in depth.
Hope that helps!
Regards,
Santosh
I am aware about how to create a model exporter class. I am using below code snippet. I just want to if I can see source code for OOTB page model exporter ( http://localhost:4502/content/we-retail/language-masters/en.model.json ) Is this open source to check ?
@Model(adaptables = SlingHttpServletRequest.class, adapters = {Page.class, ContainerExporter.class},
resourceType = "sling/servlet/default", defaultInjectionStrategy = DefaultInjectionStrategy.OPTIONAL)
@exporter(name = ExporterConstants.SLING_MODEL_EXPORTER_NAME, selector = "data",
extensions = ExporterConstants.SLING_MODEL_EXTENSION)
It will be inside
/libs/cq/page
Thank you @arunpatidar . I looked at /libs/cq/Page but it does not have any logic. proxy.jsp is forwarding or including requests to another resource within the AEM environment. There is no supertype for this as it is a folder. any other location you could think of ?
The code for the default Jackson Exporter can be found at https://github.com/apache/sling-org-apache-sling-models-jacksonexporter/tree/master/src/main/java/or...
Start with the JacksonExporter.java file.
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies