Extending CQ5 List component

泄露秘密 提交于 2019-12-25 05:24:19

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/16848511/extending-cq5-list-component

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!