4

My question may not make much sense to many but want to clarify my doubts. I read DXA doc which says OOB we will have non-public restful web services:

1) Does this mean that these services are not exposed to the internet but if I need to expose content to different channels/applications within the same infrastructure it’s still possible to consume the API?

2) What if I register the hostname of model service in DNS, won’t this be public then?

3) If step 2 is not applicable then do I need a middleware like WSO2 to expose publically?

  • Can you explain why you want to provide public access to the DXA Model Service? – Rick Pannekoek Jun 26 '18 at 20:29
  • Thanks Rick.. I want to make SDL tridion a central repository to serve content as JSON for many of our web applications developed on different technologies and devices.. can I leverage the OOB model services? – tech17 Jun 26 '18 at 20:43
5

Instead of directly accessing the DXA Model Service, you can let your DXA Web Application act as a REST Service.

Any DXA Web Application can serve raw View Model data as JSON OOTB (try suffixing your Page URLs with ?format=json).

If you only access raw View Model data, you don’t need to have server-side Views (because you don’t do server-side rendering). This is effectively a “headless” delivery architecture.

You can also create your own Controllers if you want to customize the JSON format or if you want to serve DCPs directly.

This approach, based on “Strongly Typed View Models” is the most future-proof approach. That is: it shields your implementation from future changes in underlying Data Model and changes in the protocol used to communicate with the Model Service.

See also: How to get Page Content in Java DXA 1.7 without DXA PageModel?

  • I am a bit confused but yes we will have the main website on Java-DXA where I believe we will still need server side rendering but if I got your point correctly you are suggesting to also create own controllers separately to get raw model in JSON for all our connecting applications. But that also raise the question that what is the real significance of Model Service in DXA 2.0 when the implementation itself has to be changed for Tridion 9? – tech17 Jun 26 '18 at 22:00
  • The purpose of the DXA 2.0 Model Service is mainly performance improvement (preventing multiple CIS roundtrips for one Page). It is also an important architectural step towards the future, but not a public API. – Rick Pannekoek Jun 27 '18 at 6:24
  • Indeed, the suggestion is to create own Controllers if needed; if you only want to retrieve Page Models, the OOTB PageController can be used. If you also use server-side rendering, you should be able to use your Strongly Typed View Models for both use cases. – Rick Pannekoek Jun 27 '18 at 6:30
3

What is meant by that statement is that the DXA 2.0 Model Service should not be considered a Public API.

That means that you should not communicate with the DXA Model Service directly in your implementation, because there is no guarantee that its API will stay compatible in future versions.

This is not just a hypothetical disclaimer: the Model Service in DXA 2.1 will already be significantly different, because it is integrated in the new (GraphQL-based) Public Content API that ships as part of the Unified Delivery Platform in Tridion Sites 9.0.

In general, this new Public Content API will become the officially supported Public REST/GraphQL API.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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