How to add Asset metadata to JSON output? | Community
Skip to main content
FrankRalf
Level 2
July 3, 2023
Solved

How to add Asset metadata to JSON output?

  • July 3, 2023
  • 1 reply
  • 1816 views

Hello,

 

We want to add Asset metadata that is attached to DITA files to the JSON output. We already pass the required metadata as properties to the DITA-OT. I suppose, including this metadata in the JSON output requires a DITA-OT plugin? If so, how would I implement this?

 

Best regards,

Frank

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

I found some hints in the fmdita-publigh.log:

*DEBUG* [sling-oak-observation-2] com.adobe.fmdita.publishworkflow.ConversionWorkflowsListener Resource change handler triggered for /content/dam/fmdita-outputs/json/testContent
*DEBUG* [JobHandler: /var/workflow/instances/server0/publishditamap_491:/content/dam/en/testContent.ditamap] com.adobe.fmdita.publishworkflow.ConvertXMLToJSON


Found it: The conversion code is implemented in ConvertXMLToJSON.class within /libs/fmdita/osgi-bundles/install/publish-workflow-4.2.jar. The XML-to-JSON conversion is done directly in Java, without XSLT.

1 reply

Adobe Employee
July 3, 2023

Hi @frankralf 

If you have a custom asset metadata defined in the metadata schemas, it has to be added in the metadata list (/libs/fmdita/config/metadataList) and then it will be available in the JSON output preset like below, which will be propagated to the JSON output while publishing. 

FrankRalf
FrankRalfAuthor
Level 2
July 4, 2023

Hi Aswini,

Thanks for your quick reply. We did as you suggested but unfortunately the properties don't show in the JSON output. Do you perhaps have some sample JSON to see how this should look?

Best regards,

Frank

 

FrankRalf
FrankRalfAuthorAccepted solution
Level 2
July 6, 2023

I found some hints in the fmdita-publigh.log:

*DEBUG* [sling-oak-observation-2] com.adobe.fmdita.publishworkflow.ConversionWorkflowsListener Resource change handler triggered for /content/dam/fmdita-outputs/json/testContent
*DEBUG* [JobHandler: /var/workflow/instances/server0/publishditamap_491:/content/dam/en/testContent.ditamap] com.adobe.fmdita.publishworkflow.ConvertXMLToJSON


Found it: The conversion code is implemented in ConvertXMLToJSON.class within /libs/fmdita/osgi-bundles/install/publish-workflow-4.2.jar. The XML-to-JSON conversion is done directly in Java, without XSLT.