0

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.

I am aware about how to create a model exporter class. I am using below code snippet. I just want to know if I can see source code for OOTB page model exporter ( http://localhost:4502/content/we-retail/la nguage-masters/en.model.json ) Is this open source to check ? Is it possible to see source code for this OOTB sling model exporter?

@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)
Mario R
  • 171
  • 6
  • I am trying to understand what OSGI bundle has the OOTB sling model exporter. Do you have any idea ? – Mario R May 19 '23 at 09:19

1 Answers1

0

It is OpenSource:

https://github.com/apache/sling-org-apache-sling-models-jacksonexporter/blob/master/src/main/java/org/apache/sling/models/jacksonexporter/impl/JacksonExporter.java

PS: I'm not sure, if this is a good idea. You can customize the JSON Export with all kind of Jackson annotations. Usually this is good enough. But it's your choice.

Alexander Berndt
  • 1,628
  • 9
  • 17