Class CmsGallerySearchParameters
- java.lang.Object
-
- org.opencms.search.galleries.CmsGallerySearchParameters
-
public class CmsGallerySearchParameters extends java.lang.Object
Parameters used for the gallery search index.- Since:
- 8.0.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CmsGallerySearchParameters.CmsGallerySortParam
Sort parameter constants.
-
Constructor Summary
Constructors Constructor Description CmsGallerySearchParameters()
Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<java.lang.String>
getCategories()
Returns the categories that have been included in the search.java.util.List<java.lang.String>
getContainerTypes()
Returns the container types that have been included in the search.org.opencms.search.galleries.CmsGallerySearchParameters.CmsGallerySearchTimeRange
getDateCreatedRange()
Returns the time range for the date of creation that has been used for the search result.org.opencms.search.galleries.CmsGallerySearchParameters.CmsGallerySearchTimeRange
getDateLastModifiedRange()
Returns the time range for the dadelete examplete of last modification that has been used for the search result.java.util.List<java.lang.String>
getFolders()
Returns the list of folders to search in.java.util.List<java.lang.String>
getGalleries()
Returns the galleries that have been included in the search.java.lang.String
getLocale()
Returns the locale that has been used for the search.int
getMatchesPerPage()
Returns the maximum number of matches per result page.CmsSolrQuery
getQuery(CmsObject cms)
Returns a CmsSolrQuery representation of this class.java.lang.String
getReferencePath()
Gets the reference path.java.util.List<java.lang.String>
getResourceTypes()
Returns the names of the resource types that have been included in the search result.int
getResultPage()
Returns the index of the requested result page.CmsGallerySearchScope
getScope()
The gallery search scope.java.lang.String
getSearchWords()
Returns the words (terms) that have been used for the full text search.CmsGallerySearchParameters.CmsGallerySortParam
getSortOrder()
Returns the sort order that has been used in the search.boolean
isIgnoreSearchExclude()
Returns the search exclude property ignore flag.boolean
isIncludeExpired()
Returns a flag, indicating if release and expiration date should be ignored.void
setCategories(java.util.List<java.lang.String> categories)
Sets the categories for the search.void
setContainerTypes(java.util.List<java.lang.String> containerTypes)
Sets the container types for the search.void
setDateCreatedTimeRange(long startTime, long endTime)
Sets the time range for the date of resource creation to consider in the search.void
setDateLastModifiedTimeRange(long startTime, long endTime)
Sets the time range for the date of resource last modification to consider in the search.void
setFolders(java.util.List<java.lang.String> folders)
Sets the folders to search in.void
setFunctionAvailability(CmsFunctionAvailability dynamicFunctionAvailability)
Sets the dynamic function availability.void
setGalleries(java.util.List<java.lang.String> galleries)
Sets the galleries for the search.void
setIgnoreSearchExclude(boolean excludeForPageEditor)
Sets the search exclude property ignore flag.void
setIncludeExpired(boolean includeExpired)
Set the flag, determining if expired and unreleased resources should be shown.void
setMatchesPerPage(int matchesPerPage)
Sets the maximum number of matches per result page.void
setReferencePath(java.lang.String referencePath)
Sets the gallery reference path.void
setResourceTypes(java.util.List<java.lang.String> resourceTypes)
Sets the names of the resource types to include in the search result.void
setResultPage(int resultPage)
Sets the index of the result page that should be returned.void
setScope(CmsGallerySearchScope scope)
Sets the search scope.void
setSearchLocale(java.lang.String locale)
Sets the locale for the search.void
setSearchWords(java.lang.String words)
Sets the words (terms) for the full text search.void
setSortOrder(CmsGallerySearchParameters.CmsGallerySortParam sortOrder)
Sets the sort order for the search.
-
-
-
Constructor Detail
-
CmsGallerySearchParameters
public CmsGallerySearchParameters()
Default constructor.
-
-
Method Detail
-
getCategories
public java.util.List<java.lang.String> getCategories()
Returns the categories that have been included in the search.If no categories have been set, then
null
is returned.- Returns:
- the categories that have been included in the search
-
getContainerTypes
public java.util.List<java.lang.String> getContainerTypes()
Returns the container types that have been included in the search.- Returns:
- the container types that have been included in the search
-
getDateCreatedRange
public org.opencms.search.galleries.CmsGallerySearchParameters.CmsGallerySearchTimeRange getDateCreatedRange()
Returns the time range for the date of creation that has been used for the search result.In case this time range has not been set, this will return an object where the start date is equal to
Long.MIN_VALUE
and the end date is equal toLong.MAX_VALUE
.- Returns:
- the time range for the date of creation that has been used for the search result
-
getDateLastModifiedRange
public org.opencms.search.galleries.CmsGallerySearchParameters.CmsGallerySearchTimeRange getDateLastModifiedRange()
Returns the time range for the dadelete examplete of last modification that has been used for the search result.In case this time range has not been set, this will return an object where the start date is equal to
Long.MIN_VALUE
and the end date is equal toLong.MAX_VALUE
.- Returns:
- the time range for the date of last modification that has been used for the search result
-
getFolders
public java.util.List<java.lang.String> getFolders()
Returns the list of folders to search in.- Returns:
- a list of paths of VFS folders
-
getGalleries
public java.util.List<java.lang.String> getGalleries()
Returns the galleries that have been included in the search.If no galleries have been set, then
null
is returned.- Returns:
- the galleries that have been included in the search
-
getLocale
public java.lang.String getLocale()
Returns the locale that has been used for the search.If no locale has been set, then
null
is returned.- Returns:
- the locale that has been used for the search
-
getMatchesPerPage
public int getMatchesPerPage()
Returns the maximum number of matches per result page.- Returns:
- the the maximum number of matches per result page
- See Also:
getMatchesPerPage()
,setResultPage(int)
-
getQuery
public CmsSolrQuery getQuery(CmsObject cms)
Returns a CmsSolrQuery representation of this class.- Parameters:
cms
- the openCms object.- Returns:
- CmsSolrQuery representation of this class.
-
getReferencePath
public java.lang.String getReferencePath()
Gets the reference path.- Returns:
- the gallery reference path
-
getResourceTypes
public java.util.List<java.lang.String> getResourceTypes()
Returns the names of the resource types that have been included in the search result.If no resource types have been set, then
null
is returned.- Returns:
- the names of the resource types that have been included in the search result
-
getResultPage
public int getResultPage()
Returns the index of the requested result page.- Returns:
- the index of the requested result page
- See Also:
setResultPage(int)
,getMatchesPerPage()
,setMatchesPerPage(int)
-
getScope
public CmsGallerySearchScope getScope()
The gallery search scope.- Returns:
- the gallery search scope
-
getSearchWords
public java.lang.String getSearchWords()
Returns the words (terms) that have been used for the full text search.If no search words have been set, then
null
is returned.- Returns:
- the words (terms) that have been used for the full text search
-
getSortOrder
public CmsGallerySearchParameters.CmsGallerySortParam getSortOrder()
Returns the sort order that has been used in the search.If the sort parameter has not been set the default sort order defined by
CmsGallerySearchParameters.CmsGallerySortParam.DEFAULT
is used.- Returns:
- the sort order that has been used in the search
-
isIgnoreSearchExclude
public boolean isIgnoreSearchExclude()
Returns the search exclude property ignore flag.- Returns:
- the search exclude property ignore flag
-
isIncludeExpired
public boolean isIncludeExpired()
Returns a flag, indicating if release and expiration date should be ignored.- Returns:
- a flag, indicating if release and expiration date should be ignored
-
setCategories
public void setCategories(java.util.List<java.lang.String> categories)
Sets the categories for the search.Results are found only if they are contained in at least one of the given categories.
- Parameters:
categories
- the categories to set
-
setContainerTypes
public void setContainerTypes(java.util.List<java.lang.String> containerTypes)
Sets the container types for the search.Results are found only if they are compatible with one of the given container types. If no container type is set, results compatible with any container will be returned in the search result.
- Parameters:
containerTypes
- the container types to set
-
setDateCreatedTimeRange
public void setDateCreatedTimeRange(long startTime, long endTime)
Sets the time range for the date of resource creation to consider in the search.- Parameters:
startTime
- the start time of the time rangeendTime
- the end time of the time range
-
setDateLastModifiedTimeRange
public void setDateLastModifiedTimeRange(long startTime, long endTime)
Sets the time range for the date of resource last modification to consider in the search.- Parameters:
startTime
- the start time of the time rangeendTime
- the end time of the time range
-
setFolders
public void setFolders(java.util.List<java.lang.String> folders)
Sets the folders to search in.- Parameters:
folders
- the list of VFS folders
-
setFunctionAvailability
public void setFunctionAvailability(CmsFunctionAvailability dynamicFunctionAvailability)
Sets the dynamic function availability.- Parameters:
dynamicFunctionAvailability
- the dynamic function availability
-
setGalleries
public void setGalleries(java.util.List<java.lang.String> galleries)
Sets the galleries for the search.Results are found only if they are contained in one of the given galleries. If no gallery is set, results from all galleries will be returned in the search result.
- Parameters:
galleries
- the galleries to set
-
setIgnoreSearchExclude
public void setIgnoreSearchExclude(boolean excludeForPageEditor)
Sets the search exclude property ignore flag.- Parameters:
excludeForPageEditor
- the search exclude property ignore flag
-
setIncludeExpired
public void setIncludeExpired(boolean includeExpired)
Set the flag, determining if expired and unreleased resources should be shown.- Parameters:
includeExpired
- ifftrue
expired and unreleased resources are shown.
-
setMatchesPerPage
public void setMatchesPerPage(int matchesPerPage)
Sets the maximum number of matches per result page.Use this together with
setResultPage(int)
in order to split the result in more than one page.- Parameters:
matchesPerPage
- the the maximum number of matches per result page to set- See Also:
getMatchesPerPage()
,setResultPage(int)
-
setReferencePath
public void setReferencePath(java.lang.String referencePath)
Sets the gallery reference path.- Parameters:
referencePath
- the gallery reference path
-
setResourceTypes
public void setResourceTypes(java.util.List<java.lang.String> resourceTypes)
Sets the names of the resource types to include in the search result.Results are found only if they resources match one of the given resource type names. If no resource type name is set, all resource types will be returned in the search result.
- Parameters:
resourceTypes
- the names of the resource types to include in the search result
-
setResultPage
public void setResultPage(int resultPage)
Sets the index of the result page that should be returned.Use this together with
setMatchesPerPage(int)
in order to split the result in more than one page.- Parameters:
resultPage
- the index of the result page to return- See Also:
getResultPage()
,getMatchesPerPage()
,setMatchesPerPage(int)
-
setScope
public void setScope(CmsGallerySearchScope scope)
Sets the search scope.- Parameters:
scope
- the search scope
-
setSearchLocale
public void setSearchLocale(java.lang.String locale)
Sets the locale for the search.Results are found only if they match the given locale. If no locale is set, results for all locales will be returned in the search result.
- Parameters:
locale
- the locale to set
-
setSearchWords
public void setSearchWords(java.lang.String words)
Sets the words (terms) for the full text search.Results are found only if they text extraction for the resource contains all given search words. If no search word is set, all resources will be returned in the search result.
Please note that this should be a list of words separated by white spaces. Simple Lucene modifiers such as (+), (-) and (*) are allowed, but anything more complex then this will be removed.
- Parameters:
words
- the words (terms) for the full text search to set
-
setSortOrder
public void setSortOrder(CmsGallerySearchParameters.CmsGallerySortParam sortOrder)
Sets the sort order for the search.- Parameters:
sortOrder
- the sort order to set
-
-