On Wed, Oct 22, 2014 at 10:32 AM, Gridi Serbo <
gridi...@gmail.com> wrote:
> Hi Ard,
>
> and thanks a lot for your reply.
>
> This is the complete peace of code.
>
> HippoFacetNavigationBean facetedNavBean = getFacetNavigationBean(request);
> //returns null if not instance of HippoFacetNavigationBean
> if (facetedNavBean != null) {
> HstQuery hstQuery = getHstQuery(request); //construct hstQuery based on
> dynamic parameters provided by end user
> if (hstQuery != null) {
> String relPath = PathUtils.absoluteToRelativePath(facetedNavBean.getPath(),
> request); //it is always a hippo:facetednavigation node path
> facetedNavBean = ContentBeanUtils.getFacetNavigationBean(hstQuery, relPath);
> }
> HippoResultSetBean resultSet = facetedNavBean.getResultSet();
> ....
> ....
> // ok // returned facetedNavBean has correct child nodes with
> correct counts
> // KO // resultSet is always the one provided by the first hstQuery
Although this last part is not completely clear to me, I suspect your
HippoFacetNavigationBean facetedNavBean =
getFacetNavigationBean(request); is also used for 'sub navigation
paths', and that one doesn't take the hst query into account...then
you already have a faceted navigation descendant bean which cannot
take a query any more. It can only handle a query exactly at a node of
type hippo:facetednavigation
To validate this, can you tell me which is the value for
String relPath = PathUtils.absoluteToRelativePath(facetedNavBean.getPath(),
for the resultsets that are correct and the ones that are not correct?
Most likely you need to replace your code with this
HippoFacetNavigationBean facetedNavBean;
HstQuery hstQuery = getHstQuery(request); //construct hstQuery based
on dynamic parameters provided by end user
if (hstQuery != null) {
facetedNavBean = ContentBeanUtils.getFacetNavigationBean(hstQuery);
} else {
facetedNavBean = getFacetNavigationBean(request); //returns null
if not instance of HippoFacetNavigationBean
}
HippoResultSetBean resultSet = facetedNavBean.getResultSet();
I understand it is a bit confusing. Pls let me know if this helps.
Otherwise pls explain your // ok //KO a bit better (which request
works, which doesn't etc etc)
Regards Ard