Class CmsRelationFilter

  • All Implemented Interfaces:
    java.lang.Cloneable

    public final class CmsRelationFilter
    extends java.lang.Object
    implements java.lang.Cloneable
    A filter to retrieve the relations for a given resource.

    Since:
    6.0.0
    • Method Detail

      • relationsFromStructureId

        public static CmsRelationFilter relationsFromStructureId​(CmsUUID structureId)
        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

        public static CmsRelationFilter relationsToStructureId​(CmsUUID structureId)
        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

        public java.lang.Object clone()
        Overrides:
        clone in class java.lang.Object
        See Also:
        Object.clone()
      • filterDefinedInContent

        public CmsRelationFilter filterDefinedInContent()
        Returns an extended filter with defined in content type restriction.

        Returns:
        an extended filter with defined in content type restriction
      • filterIncludeChildren

        public CmsRelationFilter 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

        public CmsRelationFilter filterInternal()
        Returns an extended filter with internal type restriction.

        Returns:
        an extended filter with internal type restriction
      • filterNotDefinedInContent

        public CmsRelationFilter filterNotDefinedInContent()
        Returns an extended filter with not defined in content type restriction.

        Returns:
        an extended filter with not defined in content type restriction
      • filterPath

        public CmsRelationFilter filterPath​(java.lang.String path)
        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

        public CmsRelationFilter filterResource​(CmsResource resource)
        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

        public CmsRelationFilter filterStrong()
        Returns an extended filter with strong type restriction.

        Returns:
        an extended filter with strong type restriction
      • filterStructureId

        public CmsRelationFilter filterStructureId​(CmsUUID structureId)
        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

        public CmsRelationFilter filterType​(CmsRelationType type)
        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

        public CmsRelationFilter filterUserDefined()
        Returns an extended filter with user defined type restriction.

        Returns:
        an extended filter with user defined type restriction
      • filterWeak

        public CmsRelationFilter filterWeak()
        Returns an extended filter with weak type restriction.

        Returns:
        an extended filter with weak type restriction
      • getPath

        public java.lang.String getPath()
        Returns the source relation path restriction.

        Returns:
        the source relation path restriction
      • getStructureId

        public CmsUUID getStructureId()
        Returns the structure Id of the resource to filter.

        Returns:
        the structure Id of the resource to filter
      • getTypes

        public java.util.Set<CmsRelationTypegetTypes()
        Returns the types to filter.

        Returns:
        the types to filter
      • includesDefinedInContent

        public boolean includesDefinedInContent()
        Checks if this filter includes relations defined in the content.

        Returns:
        true if this filter includes relations defined in the content
      • isIncludeSubresources

        public boolean isIncludeSubresources()
        Returns the include subresources flag.

        Returns:
        if set the filter extends the result to the given path and all its subresources
      • isSource

        public boolean isSource()
        Returns the source flag.

        Returns:
        if set the filter looks for matching targets
      • isTarget

        public boolean isTarget()
        Returns the target flag.

        Returns:
        if set the filter looks for matching sources
      • matchType

        public boolean matchType​(CmsRelationType type)
        Returns true 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

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
        See Also:
        Object.toString()