java.lang.Object
org.opencastproject.elasticsearch.impl.AbstractSearchQuery
org.opencastproject.elasticsearch.index.objects.theme.ThemeSearchQuery
All Implemented Interfaces:
org.opencastproject.elasticsearch.api.SearchQuery

public class ThemeSearchQuery extends org.opencastproject.elasticsearch.impl.AbstractSearchQuery
This interface defines a fluent api for a query object used to lookup themes in the search index.
  • Field Details

    • identifiers

      protected List<Long> identifiers
  • Constructor Details

    • ThemeSearchQuery

      public ThemeSearchQuery(String organization, org.opencastproject.security.api.User user)
      Creates a query that will return theme documents. The user's organization must match the query's organization.
      Parameters:
      organization - The organization to run this query with. Cannot be null.
      user - The user to run this query as. Cannot be null.
      Throws:
      IllegalStateException - Thrown if the current user's organization doesn't match the search organization, the organization is null, or user is null.
  • Method Details

    • sortOrderFieldName

      protected String sortOrderFieldName(String field)
      Specified by:
      sortOrderFieldName in class org.opencastproject.elasticsearch.impl.AbstractSearchQuery
    • withIdentifier

      public ThemeSearchQuery withIdentifier(long id)
      Selects themes with the given identifier.

      Note that this method may be called multiple times to support selection of multiple themes.

      Parameters:
      id - the theme identifier
      Returns:
      the enhanced search query
    • getIdentifiers

      public Long[] getIdentifiers()
      Returns the list of theme identifiers or an empty array if no identifiers have been specified.
      Returns:
      the identifiers
    • withDescription

      public ThemeSearchQuery withDescription(String description)
      Selects themes with the given description.
      Parameters:
      description - the description
      Returns:
      the enhanced search query
    • getDescription

      public String getDescription()
      Returns the description of the theme query.
      Returns:
      the description
    • getOrganization

      public String getOrganization()
      Returns the organization of the theme query.
      Returns:
      the organization
    • getUser

      public org.opencastproject.security.api.User getUser()
      Returns the user of this search query
      Returns:
      the user of this search query
    • withCreator

      public ThemeSearchQuery withCreator(String creator)
      Selects themes with the given creator.
      Parameters:
      creator - the creator
      Returns:
      the enhanced search query
    • getCreator

      public String getCreator()
      Returns the creator of the themes.
      Returns:
      the creator
    • withCreatedFrom

      public ThemeSearchQuery withCreatedFrom(Date createdFrom)
      The created date to start looking for themes.
      Parameters:
      createdFrom - The created date to start looking for themes
      Returns:
      the enhanced search query
    • getCreatedFrom

      public Date getCreatedFrom()
      Returns:
      The Date after which all series returned should have been created
    • withCreatedTo

      public ThemeSearchQuery withCreatedTo(Date createdTo)
      The created date to stop looking for series.
      Parameters:
      createdTo - The created date to stop looking for series
      Returns:
      the enhanced search query
    • getCreatedTo

      public Date getCreatedTo()
      Returns:
      The Date before which all series returned should have been created
    • withIsDefault

      public ThemeSearchQuery withIsDefault(Boolean isDefault)
      Selects themes that are default.
      Parameters:
      isDefault - Whether to search for themes that are default or not.
      Returns:
      the enhanced search query
    • getIsDefault

      public Boolean getIsDefault()
      Returns whether the theme query is searching for default themes.
      Returns:
      whether the search is looking for default themes.
    • withName

      public ThemeSearchQuery withName(String name)
      Selects themes with the given name.
      Parameters:
      name - the name
      Returns:
      the enhanced search query
    • getName

      public String getName()
      Returns the name looked for by the theme query.
      Returns:
      the name
    • withBumperActive

      public ThemeSearchQuery withBumperActive(Boolean bumperActive)
      Selects themes with where the bumper is active.
      Parameters:
      bumperActive - Whether the bumperActive
      Returns:
      the enhanced search query
    • getBumperActive

      public Boolean getBumperActive()
      Returns whether the theme query is searching for themes where the bumper is active.
      Returns:
      the bumperActive
    • withBumperFile

      public ThemeSearchQuery withBumperFile(String bumperFile)
      Selects themes with the given bumper file id.
      Parameters:
      bumperFile - the bumper file id
      Returns:
      the enhanced search query
    • getBumperFile

      public String getBumperFile()
      Returns the bumperFile of the theme query.
      Returns:
      the bumperFile
    • withLicenseSlideActive

      public ThemeSearchQuery withLicenseSlideActive(Boolean licenseSlideActive)
      Selects themes where the license slide is active.
      Parameters:
      licenseSlideActive - If the license slide is active or not.
      Returns:
      the enhanced search query
    • getLicenseSlideActive

      public Boolean getLicenseSlideActive()
      Returns whether the theme query is looking for themes where the license slide is active.
      Returns:
      the license
    • withLicenseSlideBackground

      public ThemeSearchQuery withLicenseSlideBackground(String licenseSlideBackground)
      Selects themes with the given license slide background.
      Parameters:
      licenseSlideBackground - the license slide background file
      Returns:
      the enhanced search query
    • getLicenseSlideBackground

      public String getLicenseSlideBackground()
      Returns the license slide background this query is looking for.
      Returns:
      the licenseSlideBackground
    • withLicenseSlideDescription

      public ThemeSearchQuery withLicenseSlideDescription(String licenseSlideDescription)
      Selects themes with the given license slide description.
      Parameters:
      licenseSlideDescription - the license slide description
      Returns:
      the enhanced search query
    • getLicenseSlideDescription

      public String getLicenseSlideDescription()
      Returns the license slide description this query is looking for.
      Returns:
      the license slide description
    • withTrailerActive

      public ThemeSearchQuery withTrailerActive(Boolean trailerActive)
      Selects themes that have the trailer active
      Parameters:
      trailerActive - whether the trailer is active or not
      Returns:
      the enhanced search query
    • getTrailerActive

      public Boolean getTrailerActive()
      Returns whether the query is looking for themes where the trailer is active
      Returns:
      Whether the query is looking for themes where the trailer is active
    • withTrailerFile

      public ThemeSearchQuery withTrailerFile(String trailerFile)
      Selects themes with the given trailer file
      Parameters:
      trailerFile - the trailer file that should be in the themes
      Returns:
      the enhanced search query
    • getTrailerFile

      public String getTrailerFile()
      Returns the trailer file id that is being matched in this query
      Returns:
      the trailer file id
    • withTitleSlideActive

      public ThemeSearchQuery withTitleSlideActive(Boolean titleSlideActive)
      Selects themes where the title slide is active.
      Parameters:
      titleSlideActive - Whether to search for themes where the title slide is active
      Returns:
      the enhanced search query
    • getTitleSlideActive

      public Boolean getTitleSlideActive()
      Returns whether this query is searching for themes where the title slide is active.
      Returns:
      Whether the query is looking for themes where the title slide is active
    • withTitleSlideMetadata

      public ThemeSearchQuery withTitleSlideMetadata(String titleSlideMetadata)
      Selects themes with matching title slide metadata
      Parameters:
      titleSlideMetadata - Search themes for this title slide metadata
      Returns:
      the enhanced search query
    • getTitleSlideMetadata

      public String getTitleSlideMetadata()
      Returns the title slide metadata this query is searching for
      Returns:
      the title slide metadata being searched for
    • withTitleSlideBackground

      public ThemeSearchQuery withTitleSlideBackground(String titleSlideBackground)
      Selects themes with the given title slide background id.
      Parameters:
      titleSlideBackground - the id for the title slide background file.
      Returns:
      the enhanced search query
    • getTitleSlideBackground

      public String getTitleSlideBackground()
      Returns:
      Returns the title slide background id this query is searching for.
    • withWatermarkActive

      public ThemeSearchQuery withWatermarkActive(Boolean watermarkActive)
      Selects themes where a watermark is active
      Parameters:
      watermarkActive - Whether to search for themes where the watermark is active
      Returns:
      the enhanced search query
    • getWatermarkActive

      public Boolean getWatermarkActive()
      Returns:
      Returns whether this query is searching for themes where the watermark is active.
    • withWatermarkFile

      public ThemeSearchQuery withWatermarkFile(String watermarkFile)
      Selects themes with the given watermark file
      Parameters:
      watermarkFile - the id of the watermark file
      Returns:
      the enhanced search query
    • getWatermarkFile

      public String getWatermarkFile()
      Returns:
      Returns the watermark file id this query is searching for.
    • withLicense

      public ThemeSearchQuery withLicense(String watermarkPosition)
      Selects themes with the given watermark position.
      Parameters:
      watermarkPosition - the watermark position to select
      Returns:
      the enhanced search query
    • getWatermarkPosition

      public String getWatermarkPosition()
      Returns:
      Returns the watermark position this query is searching for.
    • sortByCreator

      public ThemeSearchQuery sortByCreator(org.opencastproject.util.requests.SortCriterion.Order order)
      Defines the sort order for the theme by creator username.
      Parameters:
      order - the order
      Returns:
      the enhanced search query
    • getThemeCreatorSortOrder

      public org.opencastproject.util.requests.SortCriterion.Order getThemeCreatorSortOrder()
      Returns the sort order for the theme creator username.
      Returns:
      the sort order
    • sortByCreatedDateTime

      public ThemeSearchQuery sortByCreatedDateTime(org.opencastproject.util.requests.SortCriterion.Order order)
      Defines the sort order for the theme created date & time.
      Parameters:
      order - the order
      Returns:
      the enhanced search query
    • sortByDefault

      public ThemeSearchQuery sortByDefault(org.opencastproject.util.requests.SortCriterion.Order order)
      Defines the sort order for the theme default property
      Parameters:
      order - the order
      Returns:
      the enhanced search query
    • getSeriesDateSortOrder

      public org.opencastproject.util.requests.SortCriterion.Order getSeriesDateSortOrder()
      Returns the sort order for the theme created date.
      Returns:
      the sort order
    • sortByName

      public ThemeSearchQuery sortByName(org.opencastproject.util.requests.SortCriterion.Order order)
      Defines the sort order for the theme by names.
      Parameters:
      order - the order
      Returns:
      the enhanced search query
    • getThemeNameSortOrder

      public org.opencastproject.util.requests.SortCriterion.Order getThemeNameSortOrder()
      Returns the sort order for the theme name.
      Returns:
      the sort order
    • sortByDescription

      public ThemeSearchQuery sortByDescription(org.opencastproject.util.requests.SortCriterion.Order order)
      Defines the sort order for the theme by description.
      Parameters:
      order - the order
      Returns:
      the enhanced search query
    • getThemeDescriptionSortOrder

      public org.opencastproject.util.requests.SortCriterion.Order getThemeDescriptionSortOrder()
      Returns the sort order for the theme name.
      Returns:
      the sort order
    • toString

      public String toString()
      Overrides:
      toString in class Object