1
votes

I try to extend the Carousel component with an extra functionality. The dialog works, the display of the carousel works too for other tabs.

But how does the Carousel know which pages have to be shown? The mode to use is shown by "listFrom" property. Depending on its value, the pages have to be fetched from other properties or have to be looked up.

I see in the /libs/foundation/components/list/init.jsp that the following call is made:

List list = new List(slingRequest, new PageFilter());
request.setAttribute("list", list);

And when it arrives in the carousel jsp, that list is filled in with the correct pages.

How does the mapping happen between that carousel node (with parameters from the dialog) and this List?

Edit: this actually explains the solution: Extending CQ5 List component

1

1 Answers

2
votes

List class in the foundation/components/list/init.jsp is not java.util.List but com.day.cq.wcm.foundation.List.

It takes the request object, extracts requested resource (in this case it's a carousel resource), reads the configuration and prepares a list of pages - all this happens during the object construction.

You can find the source for the List class at /libs/foundation/src/impl/src/main/java/com/day/cq/wcm/foundation/List.java