Expand my Community achievements bar.

How to connect AEM with Rest service call using sightly?

Avatar

Level 2

Hi All,

I have to consume REST service using sightly.
Kindly guide me with any reference and samples.

Regards,
Maria Anto

3 Replies

Avatar

Administrator

Hi 

Please have a look at this article:-

Link:-http://conexiogroup.com/aem-ajax-pagination-using-the-sightly-list-component/

//AEM Ajax Pagination Using the Sightly List Component

Link:-https://github.com/Adobe-Marketing-Cloud/aem-sightly-sample-todomvc

//This example shows how to build components in AEM 6 with Sightly. It's a feature-complete implementation of the famous TodoMVC exercise, which is traditionally meant for client-side JavaScript frameworks. This implementation though shows how such an application can easily be built in AEM and it's status persisted on the server using the Apache Sling REST framework.

 

I hope on the same grounds you can do Ajex, or Rest call to any third part APIs.

Thanks and Regards

Kautuk Sahni



Kautuk Sahni

Avatar

Level 10

This will be a good AEM communtiy artilce - the 3rd party services (either Restful WS or SOAP WS) will be invoked from the Java part of the Sightly component and the values will be displayed in the HTML part of the Sightly component

Avatar

Level 10

We have created more HTL (used to be named Sightly) articles based on community feedback like this. Here is one on SOAP Web Services: 

1 - https://helpx.adobe.com/experience-manager/using/webservice_htl.html

Here is one on using AJAX from an HTL component: 

http://scottsdigitalcommunity.blogspot.ca/2016/08/creating-aem-html-template-language_16.html

As you can see, HTL is only HTML tags - it does not call a RESTFul or SOAP web service. That is done on the HTL Java classes - as shown in the 1 article. THen results are returned and displayed in the HTL component.  

We will write a HTL and RestFul Web Service article soon, It will be similar to 1 but instead of consuming a SOAP web service, it will consume a Restful web service. 

Also - we will create a video for these articles too.