Package org.opencms.relations
Class CmsRelationFilter
java.lang.Object
org.opencms.relations.CmsRelationFilter
- All Implemented Interfaces:
Cloneable
A filter to retrieve the relations for a given resource.
- Since:
- 6.0.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final CmsRelationFilter
To filter all sources and targets.static final CmsRelationFilter
To filter all sources.static final CmsRelationFilter
To filter all targets. -
Method Summary
Modifier and TypeMethodDescriptionclone()
Returns an extended filter with defined in content type restriction.Returns an extended filter that will extend the result to the given path and all its subresources.Returns an extended filter with internal type restriction.Returns an extended filter with not defined in content type restriction.filterPath
(String path) Returns an extended filter with the given source relation path restriction.filterResource
(CmsResource resource) Returns an extended filter with the given resource (path and id) restriction.Returns an extended filter with strong type restriction.filterStructureId
(CmsUUID structureId) Returns an extended filter with the given structure id restriction.filterType
(CmsRelationType type) Returns an extended filter with the given type restriction.Returns an extended filter with user defined type restriction.Returns an extended filter with weak type restriction.getPath()
Returns the source relation path restriction.Returns the structure Id of the resource to filter.getTypes()
Returns the types to filter.boolean
Checks if this filter includes relations defined in the content.boolean
Returns the include subresources flag.boolean
isSource()
Returns the source flag.boolean
isTarget()
Returns the target flag.boolean
matchType
(CmsRelationType type) Returnstrue
if the given relation type matches this filter.static CmsRelationFilter
relationsFromStructureId
(CmsUUID structureId) Utility method which prepares a filter for relations which point *from* a given structure id.static CmsRelationFilter
relationsToStructureId
(CmsUUID structureId) Utility method which prepares a filter for relations which point *to* a given structure id.toString()
-
Field Details
-
ALL
To filter all sources and targets. -
SOURCES
To filter all sources. -
TARGETS
To filter all targets.
-
-
Method Details
-
relationsFromStructureId
Utility method which prepares a filter for relations which point *from* a given structure id.- Parameters:
structureId
- the structure id- Returns:
- the new relation filter
-
relationsToStructureId
Utility method which prepares a filter for relations which point *to* a given structure id.- Parameters:
structureId
- the structure id- Returns:
- the new relation filter
-
clone
-
filterDefinedInContent
Returns an extended filter with defined in content type restriction.- Returns:
- an extended filter with defined in content type restriction
-
filterIncludeChildren
Returns an extended filter that will extend the result to the given path and all its subresources.- Returns:
- an extended filter with including subresources
-
filterInternal
Returns an extended filter with internal type restriction.- Returns:
- an extended filter with internal type restriction
-
filterNotDefinedInContent
Returns an extended filter with not defined in content type restriction.- Returns:
- an extended filter with not defined in content type restriction
-
filterPath
Returns an extended filter with the given source relation path restriction.- Parameters:
path
- the source relation path to filter- Returns:
- an extended filter with the given source relation path restriction
-
filterResource
Returns an extended filter with the given resource (path and id) restriction.- Parameters:
resource
- the resource to filter- Returns:
- an extended filter with the given resource (path and id) restriction
-
filterStrong
Returns an extended filter with strong type restriction.- Returns:
- an extended filter with strong type restriction
-
filterStructureId
Returns an extended filter with the given structure id restriction.- Parameters:
structureId
- the structure id to filter- Returns:
- an extended filter with the given structure id restriction
-
filterType
Returns an extended filter with the given type restriction.- Parameters:
type
- the relation type to filter- Returns:
- an extended filter with the given type restriction
-
filterUserDefined
Returns an extended filter with user defined type restriction.- Returns:
- an extended filter with user defined type restriction
-
filterWeak
Returns an extended filter with weak type restriction.- Returns:
- an extended filter with weak type restriction
-
getPath
Returns the source relation path restriction.- Returns:
- the source relation path restriction
-
getStructureId
Returns the structure Id of the resource to filter.- Returns:
- the structure Id of the resource to filter
-
getTypes
Returns the types to filter.- Returns:
- the types to filter
-
includesDefinedInContent
Checks if this filter includes relations defined in the content.- Returns:
true
if this filter includes relations defined in the content
-
isIncludeSubresources
Returns the include subresources flag.- Returns:
- if set the filter extends the result to the given path and all its subresources
-
isSource
Returns the source flag.- Returns:
- if set the filter looks for matching targets
-
isTarget
Returns the target flag.- Returns:
- if set the filter looks for matching sources
-
matchType
Returnstrue
if the given relation type matches this filter.- Parameters:
type
- the relation type to test- Returns:
- if the given relation type matches this filter
-
toString
-