Class CmsRelationFilter

java.lang.Object
org.opencms.relations.CmsRelationFilter
All Implemented Interfaces:
Cloneable

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

Since:
6.0.0
  • Field Details

  • Method Details

    • 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 Object clone()
      Overrides:
      clone in class Object
      See Also:
    • 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

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

      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 String toString()
      Overrides:
      toString in class Object
      See Also: