我正在尝试实现构面并创建目录组件。
我原来的方法是使用: org.onehippo.cms7.essentials.components.EssentialsContentComponent
然而,它似乎不适用于7.9。 我的下一个方法是扩展PresentationList组件,但是文档并不能创建主类和子类的值。
我想将此代码用于我的组件我只是不确定再次放置我的类别(值)。
try {
HstRequestContext requestContext = request.getRequestContext();
HippoBean scope = requestContext.getSiteContentBaseBean();
PresentationPageableListInfo info = getComponentParametersInfo(request);
LandingPage presentationPage = null;
String resolvedContentPath = PathUtils.normalizePath(requestContext
.getResolvedSiteMapItem().getRelativeContentPath());
createAndExecuteSearch(request, info, scope, (BaseFilter) null,
null, resolvedContentPath);
if (scope instanceof HippoFolderBean) {
presentationPage = getFirstLandingPageInFolder(request,
(HippoFolderBean) scope);
}
if (presentationPage != null) {
request.setAttribute("document", presentationPage);
}
if (request.getPathInfo().toLowerCase().contains("facet/")) {
request.setAttribute("faceted", true);
}
} catch (Exception e) {
throw new HstComponentException("Failed to query presentations.", e);
}