3

using 8.5 CME we need to publish components,pages,binaries to Broker DB and then on web application end the published items will be fetched using 8.5 CIL apis.

1)What is the best approach for publishing here. we do not find any OOTB TBB provided to support this. what i remember DD4T does provide those specific TBBs to publish these items. Are there any other good options ?

2)8.5 CIL APIs are restful so does the output response will be in JSON for ComponentPresentationAssembler.getContent(...) and PageContentAssembler.getContent(..)? or Any specific conditions here?

3)Do we have OOTB feature to Publish items as JSON format. or only option is to handle it at webpplication end at time of content retrieval.

2 Answers 2

2

Here are some answers to your questions. Hopefully they help to clarify things:


Q1. What is the best approach for publishing to the Broker database A1. Whether items are stored in the Broker database or on the web server’s filesystem (or elsewhere!) is normally determined by the configuration in the Deployer’s cd_storage_conf.xml file, rather than by the templating TBBs used. This can be configured per-Publication and/or by the type of item being published (Page, DCP, PDF binary, etc.).

The TBBs will determine the output of the publishing (e.g. JSON, HTML, XML, etc.).


Q3. Do we have OOTB feature to Publish items as JSON format (My answers are deliberately out of order!). A3. If you want to publish JSON from your templates then you probably have three options:

  • (i) Write your own TBBs that take the component fields and output the content of these (plus any ‘transformations’) in your own defined JSON structure.
  • (ii)Install and then use the DD4T TBBs to output the DD4T style of JSON
  • (iii) Install and then use the DXA TBBs (and Custom Resolver (optional, depending on your requirements)) to output the DXA style of JSON. If you just want the templating TBBs of DXA (and none of the other parts - Publications, Pages, etc.), then you’ll have to use the Content Manager part of the DXA installer and just unpick the templating parts (TBBs, Component Templates and Page Templates) that you need.

Q2. 8.5 CIL APIs are restful so does the output response will be in JSON A2. Both DXA and DD4T have built-in mechanisms for retrieving the published JSON and then making the content of this easily available in your MVC views.

If you don’t want to use either of these frameworks/products then you could retrieve the JSON yourself (using the Assemblers that you mention), parse the JSON (probably into objects) and output the content as required from within your web application code. However, if you’re taking this approach then you may want to consider whether it’s better to just publish HTML in the first place and then simply retrieve and render this.

Hope this helps!

1
  • Thanks for your detailed comments, it helped a lot. Q1-At webapplication(Java webapp) end we are only using 8.5 CIL libraries(no DXA, no DD4t, no MVC). So does CIL apis capable to render the content in JSON format if the items(components, Pages) are published as HTML/XML/Plain Text or any other type. Q2- What different CIL APIs had when they are said to be restful, what new/benefit it gives. Thanks Dec 12, 2018 at 18:46
2

Definitely consider using DXA 2.0 (or higher). It provides what you are asking for and, in general it provides a kick-start foundation for such “Dynamic Delivery” implementations.

Note that DXA is an evolution of DD4T which is supported by SDL. DD4T is still around, but mainly for existing implementations; for new implementations I would recommend DXA.

4
  • Hi Thanks for your comment. I want to understand what is the core objective of DXA birth ? why one should use it ? what are the key problems it can solve for Non-MVC Java web applications. Can you please share any pointers on same, any online link etc. Thanks Dec 12, 2018 at 18:39
  • DXA was designed around best/good practices and use of MVC architecture was considered one of those best/good practices. Can you explain why you want to publish raw data, but not use an MVC Web App? Dec 13, 2018 at 7:13
  • Business has existing java webapp (Non MVC) from past which is pulling required content from Tridion. Now from Tridion end new goal is to serve content to web-application in JSON format. We have Content Service in CD box and Web-application will make use of CIL Apis. To Serve content in JSON what do we need here ? Dec 13, 2018 at 23:59
  • It is possible to use the DXA Framework in a non-MVC Web Application. You will be able to leverage the JSON (de-)serialization and the Strongly Typed Models (incl. Semantic mapping). You will use the DXA Providers (e.g. ContentProvider) directly rather than through Controllers and Views. Dec 14, 2018 at 7:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.