Headless implementation of Tridion Docs

I need to implement SDL Docs as a headless CMS.

With the OOB "Dynamic Delivery" Output Format the Topic Content(DITA XML) is published and stored as "HTML" in the Broker Database. When we retrieve rawContent.content of a topic via PCA service, the returned JSON has a TopicBody field with a value of type HTML. Of course, HTML is not headless and has all design aspects associated with it.

Now I need to serve this Topic Body content to some native mobile apps which don't want the content as HTML but a headless format like JSON.

I understand I can publish Topic Content as JSON in place of HTML to the Broker database but it requires heavy customization including DITA-OT, Post Process Plugins, Deployer extension, etc but I don't want to reinvent the wheel if there is already some solution provided by community or SDL.

Questions:

  1. Is there any out of the box offering from SDL to address this challenge?

  2. Do we have any community work related to it?

Parents
  • Hi Saurabh,

    I hope to somewhat learn more why the JSON part is important. In the end the XHTML format and the JSON format are both parse-able text based formats - I think we can abstract away the angular and curly braces in some object. That might be easier than rewriting the whole publish pipeline to have curly braces from the start :-)

    Furthermore XHTML contains DITA @class attributes to the edge, so you can find out what was a "shortdesc" or "title" as well.

    Can you help me understand why it has to be JSON?

    Thanks

  • Thanks for the answer Dave.

    Below are the main reasons we want to serve JSON in place of XHTML:
    1. JSON is a lightweight data format and preferred for storing and transporting data whereas XHTML is an XML-based version of HTML and not suitable to serve the native client apps.

    2. I understand XHTML could be parsed into the objects the same as JSON however the published XHTML losses most of the data semantics so it's not suitable for converting to Strongly Typed Data Objects.

    3. As you mentioned XHTML has class attributes however the clients need to do some semantic mapping while converting it to the data objects. Alternatively, we can also do that before serving the clients(similar to explained here) but it adds another layer of data transformation. So I was wondering why not to publish topics as JSON with all the semantics intact (similar to SDL Sites).

    Also, I am wondering what could be the advantages of publishing topics as XHTML by default?

Reply
  • Thanks for the answer Dave.

    Below are the main reasons we want to serve JSON in place of XHTML:
    1. JSON is a lightweight data format and preferred for storing and transporting data whereas XHTML is an XML-based version of HTML and not suitable to serve the native client apps.

    2. I understand XHTML could be parsed into the objects the same as JSON however the published XHTML losses most of the data semantics so it's not suitable for converting to Strongly Typed Data Objects.

    3. As you mentioned XHTML has class attributes however the clients need to do some semantic mapping while converting it to the data objects. Alternatively, we can also do that before serving the clients(similar to explained here) but it adds another layer of data transformation. So I was wondering why not to publish topics as JSON with all the semantics intact (similar to SDL Sites).

    Also, I am wondering what could be the advantages of publishing topics as XHTML by default?

Children