Expand my Community achievements bar.

SOLVED

How to add Asset metadata to JSON output?

Avatar

Level 3

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

1 Accepted Solution

Avatar

Correct answer by
Level 3

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.

View solution in original post

5 Replies

Avatar

Level 6

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. 

AswiniLakshminarayanan_0-1688412639462.png

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

 

JSON_output_properties.png

Avatar

Level 3

I think I found the missing link in one of the posts by @DivrajSingh:

 

4) Enable the DITA-OT plugin to read the metadata and use it

Source: Use AEM Metadata in DITA-OT PDF output

 

There are indeed changes to a DITA-OT plugin necessary as already supposed. However, the example from Divraj is for the pdf2 plugin of the DITA-OT to generate PDF output. As far as I can see from the AEM log, the JSON generation is based on the "dita2dita" transformation from the org.dita.normalize DITA-OT plugin. But how is the conversion to JSON done? Any pointers welcome

 

EDIT

Just another (possible) piece of the puzzle: org.dita4publishers.json 

 

Avatar

Level 3

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

Avatar

Correct answer by
Level 3

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.