|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.hippoecm.hst.utils.BeanUtils
public class BeanUtils
Class containing utility methods for Beans
Constructor Summary | |
---|---|
BeanUtils()
|
Method Summary | ||
---|---|---|
static HstQuery |
createIncomingBeansQuery(HippoDocumentBean bean,
HippoBean scope,
int depth,
BaseHstComponent component,
Class<? extends HippoBean> beanMappingClass,
boolean includeSubTypes)
Deprecated. use ContentBeanUtils.createIncomingBeansQuery(HippoDocumentBean, HippoBean, int, ObjectConverter, Class, boolean) instead.
The objectConverter can be fetched from BaseHstComponent.getObjectConverter() |
|
static HstQuery |
createIncomingBeansQuery(HippoDocumentBean bean,
HippoBean scope,
List<String> linkPaths,
BaseHstComponent component,
Class<? extends HippoBean> beanMappingClass,
boolean includeSubTypes)
Deprecated. use ContentBeanUtils.createIncomingBeansQuery(HippoDocumentBean, HippoBean, List, ObjectConverter, Class, boolean) instead.
The objectConverter can be fetched from BaseHstComponent.getObjectConverter() |
|
static HstQuery |
createIncomingBeansQuery(HippoDocumentBean bean,
HippoBean scope,
String linkPath,
BaseHstComponent component,
Class<? extends HippoBean> beanMappingClass,
boolean includeSubTypes)
Deprecated. use ContentBeanUtils.createIncomingBeansQuery(HippoDocumentBean, HippoBean, String, ObjectConverter, Class, boolean) instead.
The objectConverter can be fetched from BaseHstComponent.getObjectConverter() |
|
static javax.jcr.Session |
getDisposablePoolSession(HstRequestContext requestContext,
String disposablePoolIdentifier)
This method tries to get a Session from a disposable pool which is identified by disposablePoolIdentifier
If disposablePoolIdentifier is empty or null an HstComponentException will be thrown. |
|
static javax.jcr.Session |
getDisposablePoolSession(HstRequest hstRequest,
String disposablePoolIdentifier)
|
|
static
|
getFacetedNavigationResultDocument(HstRequest hstRequest,
HstQuery query,
ObjectConverter objectConverter,
Class<T> beanMappingClass)
Tries to return a bean that is located in a faceted navigation tree below a result set. |
|
static
|
getFacetedNavigationResultDocument(HstRequest hstRequest,
HstQuery query,
String relPath,
ObjectConverter objectConverter,
Class<T> beanMappingClass)
Tries to return a bean that is located in a faceted navigation tree below a result set. |
|
static
|
getFacetedNavigationResultDocument(HstRequest hstRequest,
String query,
ObjectConverter objectConverter,
Class<T> beanMappingClass)
Tries to return a bean that is located in a faceted navigation tree below a result set. |
|
static
|
getFacetedNavigationResultDocument(HstRequest hstRequest,
String query,
String relPath,
ObjectConverter objectConverter,
Class<T> beanMappingClass)
Tries to return a bean that is located in a faceted navigation tree below a result set. |
|
static HippoFacetNavigationBean |
getFacetNavigationBean(HstRequest hstRequest,
HstQuery query,
ObjectConverter objectConverter)
Same as getFacetNavigationBean(HstRequest, String, ObjectConverter) only now instead of a String query we
pass in a HstQuery |
|
static HippoFacetNavigationBean |
getFacetNavigationBean(HstRequest hstRequest,
HstQuery query,
String relPath,
ObjectConverter objectConverter)
Same as getFacetNavigationBean(HstRequest, HstQuery, ObjectConverter) only now instead of having the faceted navigation
node from the ResolvedSiteMapItem we add a relPath where it should be found |
|
static HippoFacetNavigationBean |
getFacetNavigationBean(HstRequest hstRequest,
String query,
ObjectConverter objectConverter)
Returns the HippoFacetNavigationBean for this HstRequest from the ResolvedSiteMapItem where it is accounted for the free text query . |
|
static HippoFacetNavigationBean |
getFacetNavigationBean(HstRequest hstRequest,
String relPath,
String query,
ObjectConverter objectConverter)
Returns the HippoFacetNavigationBean for this HstRequest and relPath where it is accounted for the free text query . |
|
static
|
getIncomingBeans(HstQuery query,
Class<? extends HippoBean> beanMappingClass)
Deprecated. use ContentBeanUtils.getIncomingBeans(HstQuery, Class) instead |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BeanUtils()
Method Detail |
---|
@Deprecated public static HstQuery createIncomingBeansQuery(HippoDocumentBean bean, HippoBean scope, String linkPath, BaseHstComponent component, Class<? extends HippoBean> beanMappingClass, boolean includeSubTypes) throws QueryException
ContentBeanUtils.createIncomingBeansQuery(HippoDocumentBean, HippoBean, String, ObjectConverter, Class, boolean)
instead.
The objectConverter can be fetched from BaseHstComponent.getObjectConverter()
scope
). You can add filters and ordering to the query before executing it
You need to add a linkPath
: this is that path, that the incoming beans use to link to the HippoDocumentBean bean
. For example, with '/myproject:link/@hippo:docbase' or even 'wildcard/@hippo:docbase' or
'wildcard/wildcard/@hippo:docbase' where wildcard = *
QueryException
@Deprecated public static HstQuery createIncomingBeansQuery(HippoDocumentBean bean, HippoBean scope, int depth, BaseHstComponent component, Class<? extends HippoBean> beanMappingClass, boolean includeSubTypes) throws QueryException
ContentBeanUtils.createIncomingBeansQuery(HippoDocumentBean, HippoBean, int, ObjectConverter, Class, boolean)
instead.
The objectConverter can be fetched from BaseHstComponent.getObjectConverter()
scope
). You can add filters and ordering to the query before executing it
The depth indicates how many child nodes deep is searched for a link to the HippoDocumentBean bean
. The depth is allowed to range from 0 (direct hippo:docbase) to 4 (at most 4 levels deep searching is done)
QueryException
@Deprecated public static HstQuery createIncomingBeansQuery(HippoDocumentBean bean, HippoBean scope, List<String> linkPaths, BaseHstComponent component, Class<? extends HippoBean> beanMappingClass, boolean includeSubTypes) throws QueryException
ContentBeanUtils.createIncomingBeansQuery(HippoDocumentBean, HippoBean, List, ObjectConverter, Class, boolean)
instead.
The objectConverter can be fetched from BaseHstComponent.getObjectConverter()
bean
. For example {/myproject:link/@hippo:docbase, /myproject:body/hippostd:content/@hippo:docbase}
QueryException
@Deprecated public static <T extends HippoBean> List<T> getIncomingBeans(HstQuery query, Class<? extends HippoBean> beanMappingClass) throws QueryException
ContentBeanUtils.getIncomingBeans(HstQuery, Class)
instead
beanMappingClass
) that have a (facet)link to the HippoDocumentBean bean
. If no incoming beans are found,
an empty
list will be returned.
Listbean
. For example {/myproject:link/@hippo:docbase, /myproject:body/hippostd:content/@hippo:docbase}
QueryException
public static HippoFacetNavigationBean getFacetNavigationBean(HstRequest hstRequest, String relPath, String query, ObjectConverter objectConverter) throws HstComponentException
Returns the HippoFacetNavigationBean
for this HstRequest
and relPath
where it is accounted for the free text query
. When query
is null
or
empty, we return the HippoFacetNavigationBean without free text search. Else, we try to return the HippoFacetNavigationBean with free text search. If the
HippoFacetNavigationBean does not exist in the faceted navigation tree in combination with the free text search, we return null
.
Note we can only return the HippoFacetNavigationBean if the current ResolvedSiteMapItem
has a ResolvedSiteMapItem.getRelativeContentPath()
that
points to points to a HippoFacetNavigationBean
or to some lower descendant HippoBean
, for example to a HippoResultSetBean
. In this latter case,
we traverse up until we find a HippoFacetNavigationBean
, and return that one.
The relPath
is relative to the site content base path and must not start with a /
HstComponentException
hstRequest
- the hstRequestrelPath
- the relative path to the faceted navigation node, which must not start with a / and is relative to the site content base pathquery
- the free text query that should be accounted for for this facNavBean
objectConverter
- the objectConverter to be used
HippoFacetNavigationBean
accounted for this query
and null
if we could not find the HippoFacetNavigationBean when the query
is applied
HstComponentException
public static HippoFacetNavigationBean getFacetNavigationBean(HstRequest hstRequest, String query, ObjectConverter objectConverter) throws HstComponentException
Returns the HippoFacetNavigationBean
for this HstRequest
from the ResolvedSiteMapItem
where it is accounted for the free text query
. When query
is null
or
empty, we return the HippoFacetNavigationBean without free text search. Else, we try to return the HippoFacetNavigationBean with free text search. If the
HippoFacetNavigationBean does not exist in the faceted navigation tree in combination with the free text search, we return null
.
Note we can only return the HippoFacetNavigationBean if the current ResolvedSiteMapItem
has a ResolvedSiteMapItem.getRelativeContentPath()
that
points to points to a HippoFacetNavigationBean
or to some lower descendant HippoBean
, for example to a HippoResultSetBean
. In this latter case,
we traverse up until we find a HippoFacetNavigationBean
, and return that one.
If you need a HippoFacetNavigationBean
that is not on for the ResolvedSiteMapItem
, but at some fixed location,
you can use getFacetNavigationBean(HstRequest, String, String, ObjectConverter)
HstComponentException
hstRequest
- the hstRequestquery
- the free text query that should be accounted for for this facNavBean
objectConverter
- the objectConverter to be used
HippoFacetNavigationBean
accounted for this query
and null
if we could not find the HippoFacetNavigationBean when the query
is applied
HstComponentException
public static HippoFacetNavigationBean getFacetNavigationBean(HstRequest hstRequest, HstQuery query, ObjectConverter objectConverter) throws HstComponentException
getFacetNavigationBean(HstRequest, String, ObjectConverter)
only now instead of a String
query we
pass in a HstQuery
hstRequest
- the hstRequestquery
- a HstQuery
object. If null
the call returns as if there is no queryobjectConverter
- the objectConverter to be used
HippoFacetNavigationBean
accounted for this query
and null
if we could not find the HippoFacetNavigationBean when the query
is applied
HstComponentException
#getFacetNavigationBean(HstRequest, String, ObjectConverter)}
public static HippoFacetNavigationBean getFacetNavigationBean(HstRequest hstRequest, HstQuery query, String relPath, ObjectConverter objectConverter) throws HstComponentException
getFacetNavigationBean(HstRequest, HstQuery, ObjectConverter)
only now instead of having the faceted navigation
node from the ResolvedSiteMapItem
we add a relPath
where it should be found
hstRequest
- the hstRequestquery
- a HstQuery
objectrelPath
- the relative path from site base content to the faceted navigation node, which must not start with a / and is relative to the site content base pathobjectConverter
- the objectConverter to be used
HippoFacetNavigationBean
accounted for this query
and relPath
and null
if we could not find the HippoFacetNavigationBean when the query
is applied
HstComponentException
#getFacetNavigationBean(HstRequest, String, ObjectConverter)}
public static <T extends HippoBean> T getFacetedNavigationResultDocument(HstRequest hstRequest, String query, ObjectConverter objectConverter, Class<T> beanMappingClass)
beanMappingClass
, null
will be returned.
T
- hstRequest
- the hstRequestquery
- the free text search as String that is used for this faceted navigationobjectConverter
- beanMappingClass
- the class T must be of
null
if it cannot be found or is not of type T
public static <T extends HippoBean> T getFacetedNavigationResultDocument(HstRequest hstRequest, String query, String relPath, ObjectConverter objectConverter, Class<T> beanMappingClass)
beanMappingClass
, null
will be returned.
T
- hstRequest
- the hstRequestquery
- the free text search as String that is used for this faceted navigation. The query should already
have been processed by SearchInputParsingUtils.parse(String, boolean)
if necessary.relPath
- the relative path from site base content to the faceted navigation node, which must not start with a / and is relative to the site content base pathobjectConverter
- beanMappingClass
- the class T must be of
null
if it cannot be found or is not of type T
public static <T extends HippoBean> T getFacetedNavigationResultDocument(HstRequest hstRequest, HstQuery query, ObjectConverter objectConverter, Class<T> beanMappingClass)
beanMappingClass
, null
will be returned.
T
- hstRequest
- the hstRequestquery
- the free text search as HstQuery
that is used for this faceted navigationobjectConverter
- beanMappingClass
- the class T must be of
null
if it cannot be found or is not of type T
public static <T extends HippoBean> T getFacetedNavigationResultDocument(HstRequest hstRequest, HstQuery query, String relPath, ObjectConverter objectConverter, Class<T> beanMappingClass)
beanMappingClass
, null
will be returned.
T
- hstRequest
- the hstRequestquery
- the free text search as HstQuery
that is used for this faceted navigationrelPath
- the relative path from site base content to the faceted navigation node, which must not start with a / and is relative to the site content base pathobjectConverter
- beanMappingClass
- the class T must be of
null
if it cannot be found or is not of type T
public static javax.jcr.Session getDisposablePoolSession(HstRequestContext requestContext, String disposablePoolIdentifier) throws HstComponentException
Session
from a disposable pool which is identified by disposablePoolIdentifier
If disposablePoolIdentifier
is empty or null
an HstComponentException will be thrown. If it is not possible to return a
Session
for the disposablePoolIdentifier
, for example because there is configured a MultipleRepositoryImpl instead of
LazyMultipleRepositoryImpl, also a HstComponentException
will be thrown.
requestContext
- the hstRequest for this HstComponentdisposablePoolIdentifier
- the identifier for this disposable pool. It is not allowed to be empty or null
Session
from a disposable pool
HstComponentException
public static javax.jcr.Session getDisposablePoolSession(HstRequest hstRequest, String disposablePoolIdentifier) throws HstComponentException
hstRequest
- the current HstRequest
disposablePoolIdentifier
- the identifier for this disposable pool. It is not allowed to be empty or null
Session
from a disposable pool
HstComponentException
#getDisposablePoolSession(org.hippoecm.hst.core.request.HstRequestContext, String)}
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |