我的很多自定义组件都扩展了EssentialsListComponent。同一个标准 HST 组件有很多有用的参数,例如pageSize
和sortOrder
(通过控制台输入),我目前必须在我的类中单独处理这些参数。这个过程很繁琐并且容易出现人为错误。
如何在我的自定义 HST 组件中一次将所有标准参数应用于我的 HST 查询?例如,像下面这样的东西会很可爱:
@Override
protected <T extends EssentialsDocumentListComponentInfo> HstQuery buildQuery(HstRequest request, T paramInfo,
HippoBean scope) {
scope = request.getRequestContext().getSiteContentBaseBean();
try {
HstQuery hstQuery = request.getRequestContext().getQueryManager().createQuery(scope);
hstQuery.applyParameters(paramInfo);// paramInfo should already includes pageSize, sortOrder etc. right?
} catch (Exception e) {
}
}