How can I include content fragment model property in the OOB asset model json exporter? | Community
Skip to main content
thatsmeadarsh
Level 3
May 19, 2021
Question

How can I include content fragment model property in the OOB asset model json exporter?

  • May 19, 2021
  • 1 reply
  • 798 views

Hi All,

I would like to include the property content fragment 'model' property in the default Asset API model exporter. Surprisingly this property will be exposed when we try page model json but not through asset json exporter. 

Is there any way we can enhance the behaviour to include an additional property?

 

Thanks

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

1 reply

Level 2
June 12, 2024

Hi @thatsmeadarsh ,

      If property has to expose via  page model json exporter ,you can use below snippet.

Session session = resourceResolver.adaptTo(Session.class); try { Node node = session.getNode("/content/practice/us/en/test"); logger.error(">>>>> node.getName() = '{}'", node.getName()); logger.error(">>>>> node.getPath() = '{}'", node.getPath()); node.setProperty("model", "This is model description."); logger.error(">>>> node.getProperty(model) = '{}'", node.getProperty("model")); session.save(); session.logout(); } catch (RepositoryException e) { e.printStackTrace(); }

    You can refer to this documentation on default asset api to add a property  if its through asset json exporter 

https://experienceleague.adobe.com/en/docs/experience-manager-cloud-service/content/assets/admin/mac-api-assets