Extending CQ5 List component

2019-09-05 05:57发布

I'm looking into extending the cq5 list component to create custom list displays (obviously). The constructor takes a SlingHttpServletRequest and the minimal java doc says "creates a list from the specified request".

Can someone explain how those request settings are used to build the list? what things in the request should I change to alter the list? Is there better documentation somewhere?

标签: aem
1条回答
别忘想泡老子
2楼-- · 2019-09-05 06:24

The component uses the request to retrieve the resource object.

In the init method it retrieves a the resource node's properties. The "listFrom" property should matter for you the most as it controls how the list is created. Either by querybuilder, search, retrieving the children ("children") or tags. The List component does a simple string equals to find out which option is set and executes the associated logic.

At the end a PageIterator is returned, which is processed by the jsp.

查看更多
登录 后发表回答