public class ContentBeanUtils extends Object
Modifier and Type | Method and Description |
---|---|
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> |
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 . |
static boolean |
isBeanType(Object bean,
String typeName)
Determines if the class or interface represented by this content bean object is either the same as, or is a
subclass of, the class or interface represented by the specified fully qualified class name parameter.
|
public static boolean isBeanType(Object bean, String typeName)
bean
- content bean objecttypeName
- fully qualified class name or simple class namepublic static HstQuery createIncomingBeansQuery(HippoDocumentBean bean, HippoBean scope, String linkPath, ObjectConverter converter, Class<? extends HippoBean> beanMappingClass, boolean includeSubTypes) throws QueryException
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 = *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:docbaseconverter
- the ObjectConverterbeanMappingClass
- the type the 'incoming beans' should be ofincludeSubTypes
- true
when subtypes of beanMappingClass should be included in the resultbean
QueryException
public static HstQuery createIncomingBeansQuery(HippoDocumentBean bean, HippoBean scope, int depth, ObjectConverter converter, Class<? extends HippoBean> beanMappingClass, boolean includeSubTypes) throws QueryException
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 2bean
- 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 thrownconverter
- the ObjectConverterbeanMappingClass
- the type the 'incoming beans' should be ofincludeSubTypes
- true
when subtypes of beanMappingClass should be included in the resultbean
QueryException
- when depth
is larger than 4public static HstQuery createIncomingBeansQuery(HippoDocumentBean bean, HippoBean scope, List<String> linkPaths, ObjectConverter converter, Class<? extends HippoBean> beanMappingClass, boolean includeSubTypes) throws QueryException
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 = *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 ObjectConverterbeanMappingClass
- the type the 'incoming beans' should be ofincludeSubTypes
- true
when subtypes of beanMappingClass should be included in the resultbean
QueryException
public static <T extends HippoBean> List<T> getIncomingBeans(HstQuery query, Class<? extends HippoBean> beanMappingClass) throws QueryException
beanMappingClass
) that have a (facet)link to the HippoDocumentBean bean
. If no incoming beans are found,
an empty
list will be returned.QueryException
Copyright © 2008-2013 Hippo B.V. (http://www.onehippo.com). All Rights Reserved.