Highlighted

CF backed by API

aemdeva19633268

10-06-2018

Is it possible to create a Content Fragment which is backed by a third-party API? My use case is to create an XF with a CF and the data in the CF is coming from an external endpoint.

Replies

Highlighted

Jörg_Hoh

Employee

11-06-2018

Hm, for content fragments I don't know ... You can only place widgets in CFs and not full-blown components which you could implement as Sling Models and add proper communication to an external endpoint.

But if you use Experience fragments that is possible, as they are backed by "real components" 🙂

Maybe it's also possible to implement CF with such data but it's definitly not that easy, and probably needs to rely on implementation details.  Nevertheless it would be nice to have an extension point for that without the need to import data in the repo (which you can do for CFs very easy, but sometimes that's not what you want).

regards,

Jörg

Highlighted

smacdonald2008

11-06-2018

If you want to get data from a 3rd party endpoint/API, then write a custom HTL component that uses Java to pull data from a 3rd party endpoint and the HTL will display the data result set. Something like this --  Creating an Adobe Experience Manager 6.4 HTL Component that displays data from a Restful Web Service

A content fragment is not the correct way here - use HTL and Java.

Highlighted

Ratna_Kumar

MVP

12-06-2018

Hi,

I think you cannot use content fragments with HTL.

As Scott suggested, the best way is HTL and Java. Also, you can use third party API and HTL will display the data result set: Creating an Adobe Experience Manager 6.4 HTL Component that displays data from a Restful Web Service

Thanks,

Ratna Kumar.