扩展CQ5列表组件 [英] Extending CQ5 List component

查看:97
本文介绍了扩展CQ5列表组件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在考虑扩展cq5列表组件以创建自定义列表显示(显然)。构造函数使用SlingHttpServletRequest,最小的Java文档说从指定的请求创建列表。

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?

推荐答案

组件使用请求来检索资源对象。

The component uses the request to retrieve the resource object.

在init方法中,它检索资源节点的属性。
listFrom属性对您最重要,因为它控制如何创建列表。通过querybuilder进行搜索,检索子级( children)或标签。
List组件执行一个简单的字符串,等于找出设置了哪个选项并执行相关的逻辑。

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.

最后返回PageIterator,即由jsp处理。

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

这篇关于扩展CQ5列表组件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆