How to find OOTB Page Sling model exporter class ? | Community
Skip to main content
Mario248
Level 7
May 18, 2023

How to find OOTB Page Sling model exporter class ?

  • May 18, 2023
  • 4 replies
  • 1820 views

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?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

4 replies

Saravanan_Dharmaraj
Community Advisor
Community Advisor
May 18, 2023
Mario248
Mario248Author
Level 7
May 19, 2023

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)

@3484101(name = ExporterConstants.SLING_MODEL_EXPORTER_NAME, selector = "data",

extensions = ExporterConstants.SLING_MODEL_EXTENSION)

SantoshSai
Community Advisor
Community Advisor
May 18, 2023

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.

[0]: https://experienceleague.adobe.com/docs/experience-manager-learn/foundation/development/develop-sling-model-exporter.html?lang=en

[1]: https://experienceleague.adobe.com/docs/experience-manager-learn/foundation/development/understand-sling-model-exporter.html?lang=en

 

Hope that helps!

Regards,
Santosh

 

Santosh Sai
Mario248
Mario248Author
Level 7
May 19, 2023

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)

@3484101(name = ExporterConstants.SLING_MODEL_EXPORTER_NAME, selector = "data",

extensions = ExporterConstants.SLING_MODEL_EXTENSION)

 

 

 

arunpatidar
Community Advisor
Community Advisor
May 19, 2023

It will be inside

/libs/cq/page

Arun Patidar
Mario248
Mario248Author
Level 7
May 19, 2023

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 ?

joerghoh
Adobe Employee
Adobe Employee
May 20, 2023

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/org/apache/sling/models/jacksonexporter/impl

 

Start with the JacksonExporter.java file.