org.hippoecm.hst.util
Class ContentBeanUtils

java.lang.Object
  extended by org.hippoecm.hst.util.ContentBeanUtils

public class ContentBeanUtils
extends Object


Constructor Summary
ContentBeanUtils()
           
 
Method Summary
static HstQuery createIncomingBeansQuery(HippoDocumentBean bean, HippoBean scope, int depth, ObjectConverter converter, Class<? extends HippoBean> beanMappingClass, boolean includeSubTypes)
          Returns a HstQuery for incoming beans (incoming beans within scope scope).
static HstQuery createIncomingBeansQuery(HippoDocumentBean bean, HippoBean scope, List<String> linkPaths, ObjectConverter converter, Class<? extends HippoBean> beanMappingClass, boolean includeSubTypes)
          Returns a HstQuery for incoming beans (incoming beans within scope scope).
static HstQuery createIncomingBeansQuery(HippoDocumentBean bean, HippoBean scope, String linkPath, ObjectConverter converter, Class<? extends HippoBean> beanMappingClass, boolean includeSubTypes)
          Returns a HstQuery for incoming beans (incoming beans within scope scope).
static
<T extends HippoBean>
List<T>
getIncomingBeans(HstQuery query, Class<? extends HippoBean> beanMappingClass)
          Returns a list of beans of type T (the same type as beanMappingClass) that have a (facet)link to the HippoDocumentBean bean.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContentBeanUtils

public ContentBeanUtils()
Method Detail

createIncomingBeansQuery

public static HstQuery createIncomingBeansQuery(HippoDocumentBean bean,
                                                HippoBean scope,
                                                String linkPath,
                                                ObjectConverter converter,
                                                Class<? extends HippoBean> beanMappingClass,
                                                boolean includeSubTypes)
                                         throws QueryException
Returns a HstQuery for incoming beans (incoming beans within scope 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 = *

Parameters:
bean - The HippoDocumentBean that you have, and for which you want to find the other beans that have a link to it (incoming beans)
scope - the scope (hierarchical location) to search below for 'incoming beans'
linkPath - the path where the 'incoming beans' have there link (mirror) stored, for example at myns:links/@hippo:docbase
converter - the ObjectConverter
beanMappingClass - the type the 'incoming beans' should be of
includeSubTypes - true when subtypes of beanMappingClass should be included in the result
Returns:
a HstQuery that contains the constraints for 'incoming beans' to your bean
Throws:
QueryException

createIncomingBeansQuery

public static HstQuery createIncomingBeansQuery(HippoDocumentBean bean,
                                                HippoBean scope,
                                                int depth,
                                                ObjectConverter converter,
                                                Class<? extends HippoBean> beanMappingClass,
                                                boolean includeSubTypes)
                                         throws QueryException
Returns a HstQuery for incoming beans (incoming beans within scope scope). You can add filters and ordering to the query before executing it You need to add a depth: this is the maximum depth, that the incoming beans use to link to the HippoDocumentBean bean. For example, with 'myproject:link/@hippo:docbase' is depth 1, 'myproject:somecompound/myproject:link/@hippo:docbase' is depth 2

Parameters:
bean - The HippoDocumentBean that you have, and for which you want to find the other beans that have a link to it (incoming beans)
scope - the scope (hierarchical location) to search below for 'incoming beans'
depth - the depth until which the links below the HippoDocuments you want to find can be. Maximum depth is 4, when larger, a QueryException is thrown
converter - the ObjectConverter
beanMappingClass - the type the 'incoming beans' should be of
includeSubTypes - true when subtypes of beanMappingClass should be included in the result
Returns:
a HstQuery that contains the constraints for 'incoming beans' to your bean
Throws:
QueryException - when depth is larger than 4

createIncomingBeansQuery

public static HstQuery createIncomingBeansQuery(HippoDocumentBean bean,
                                                HippoBean scope,
                                                List<String> linkPaths,
                                                ObjectConverter converter,
                                                Class<? extends HippoBean> beanMappingClass,
                                                boolean includeSubTypes)
                                         throws QueryException
Returns a HstQuery for incoming beans (incoming beans within scope scope). You can add filters and ordering to the query before executing it You need to add linkPaths: these are the paths, 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 = *

Parameters:
bean - The HippoDocumentBean that you have, and for which you want to find the other beans that have a link to it (incoming beans)
scope - the scope (hierarchical location) to search below for 'incoming beans'
linkPaths - the paths where the 'incoming beans' have there link (mirror) stored, for example at {myns:links/@hippo:docbase, myns:alsolinks/@hippo:docbase }
converter - the ObjectConverter
beanMappingClass - the type the 'incoming beans' should be of
includeSubTypes - true when subtypes of beanMappingClass should be included in the result
Returns:
a HstQuery that contains the constraints for 'incoming beans' to your bean
Throws:
QueryException

getIncomingBeans

public static <T extends HippoBean> List<T> getIncomingBeans(HstQuery query,
                                                             Class<? extends HippoBean> beanMappingClass)
                                                  throws QueryException
Returns a list of beans of type T (the same type as beanMappingClass) that have a (facet)link to the HippoDocumentBean bean. If no incoming beans are found, an empty list will be returned.

Throws:
QueryException


Copyright © 2008-2012 Hippo. All Rights Reserved.