Package org.opencms.search.galleries
Class CmsGallerySearchResult
java.lang.Object
org.opencms.search.galleries.CmsGallerySearchResult
- All Implemented Interfaces:
Cloneable
,Comparable<CmsGallerySearchResult>
public class CmsGallerySearchResult
extends Object
implements Comparable<CmsGallerySearchResult>, Cloneable
-
Field Summary
Modifier and TypeFieldDescriptionstatic final org.apache.commons.logging.Log
The logger instance for this class.The supported container types of this search result.protected Date
The creation date of this search result.protected Date
The expiration date of this search result.protected Date
The last modification date of this search result.protected Date
The release date of this search result.protected String
The description of this search result.protected String
The excerpt of this search result.protected int
The length of the search result.The locales in which the content is available.protected String
The resource path of this search result.protected String
The resource type of the search result.protected int
The score of this search result.protected int
The state of the search result.protected String
The structure UUID of the resource.protected String
The title of this search result.protected String
The user who created the search result resource.protected String
The user who last modified the search result resource. -
Constructor Summary
ConstructorDescriptionCmsGallerySearchResult
(CmsObject cms, CmsResource res, String title) Creates a fake gallery search result by reading the necessary data from a VFS resource.CmsGallerySearchResult
(I_CmsSearchDocument doc, CmsObject cms, int score, Locale locale) Creates a new gallery search result. -
Method Summary
Modifier and TypeMethodDescriptionint
compareTo
(CmsGallerySearchResult other) Compares two search results based on the score of the result.boolean
Returns the containers supported by this resource.Returns the date created.Returns the date the resource expires.Returns the date last modified.Returns the date the resource is released.Returns the description.Returns the excerpt.int
Returns the length of the resource.Returns the list of locales this search result is available for.getPath()
Returns the resource root path.static final String[]
Returns the list of Solr fields a search result must have to initialize the gallery search result correctly.Returns the resource type of the search result document.int
getScore()
Returns the Lucene search score for this result.int
getState()
Returns the state of the resource.Returns the structure id of the resource.getTitle()
Returns the title of the resource.Returns the name of the user who created the resource.Returns the name of the user who last modified the resource.int
hashCode()
protected void
initializeMissingFieldsFromVfs
(CmsObject cms, CmsUUID structureId) Initializes missing fields by reading the information from the VFS.boolean
Returns if the related resource is released and not expired.Returns a shallow copy of this result, with a changed title.
-
Field Details
-
LOG
The logger instance for this class. -
m_containerTypes
The supported container types of this search result. -
m_dateCreated
The creation date of this search result. -
m_dateExpired
The expiration date of this search result. -
m_dateLastModified
The last modification date of this search result. -
m_dateReleased
The release date of this search result. -
m_description
The description of this search result. -
m_excerpt
The excerpt of this search result. -
m_length
The length of the search result. -
m_locales
The locales in which the content is available. -
m_path
The resource path of this search result. -
m_resourceType
The resource type of the search result. -
m_score
The score of this search result. -
m_state
The state of the search result. -
m_structureId
The structure UUID of the resource. -
m_title
The title of this search result. -
m_userCreated
The user who created the search result resource. -
m_userLastModified
The user who last modified the search result resource.
-
-
Constructor Details
-
CmsGallerySearchResult
Creates a fake gallery search result by reading the necessary data from a VFS resource.- Parameters:
cms
- the current CMS contextres
- the resource from which the data should be readtitle
- optional value that can be used to override the title (if null, the title is not overridden)
-
CmsGallerySearchResult
Creates a new gallery search result.- Parameters:
cms
- the current CMS context (used for reading information missing from the index)doc
- the I_CmsSearchResult document to extract information from.score
- the score of this search resultlocale
- the locale to create the result for
-
-
Method Details
-
getRequiredSolrFields
Returns the list of Solr fields a search result must have to initialize the gallery search result correctly.- Returns:
- the list of Solr fields.
-
compareTo
Compares two search results based on the score of the result.- Specified by:
compareTo
in interfaceComparable<CmsGallerySearchResult>
- Parameters:
other
- the result to compare this result with- Returns:
- the comparison result
- See Also:
-
equals
-
getContainerTypes
Returns the containers supported by this resource.- Returns:
- the containers supported by this resource
-
getDateCreated
Returns the date created.- Returns:
- the date created
-
getDateExpired
Returns the date the resource expires.- Returns:
- the date the resource expires
- See Also:
-
getDateLastModified
Returns the date last modified.- Returns:
- the date last modified
-
getDateReleased
Returns the date the resource is released.- Returns:
- the date the resource is released
- See Also:
-
getDescription
Returns the description.- Returns:
- the description
-
getExcerpt
Returns the excerpt.- Returns:
- the excerpt
-
getLength
Returns the length of the resource.- Returns:
- the length of the resource
- See Also:
-
getLocales
Returns the list of locales this search result is available for.- Returns:
- the list of locales this search result is available for
-
getPath
Returns the resource root path.- Returns:
- the resource root path
- See Also:
-
getResourceType
Returns the resource type of the search result document.- Returns:
- the resource type of the search result document
- See Also:
-
getScore
Returns the Lucene search score for this result.- Returns:
- the Lucene search score for this result
-
getState
Returns the state of the resource.- Returns:
- the state of the resource
- See Also:
-
getStructureId
Returns the structure id of the resource.- Returns:
- the structure id of the resource
-
getTitle
Returns the title of the resource.- Returns:
- the title of the resource
-
getUserCreated
Returns the name of the user who created the resource.- Returns:
- the name of the user who created the resource
- See Also:
-
getUserLastModified
Returns the name of the user who last modified the resource.- Returns:
- the name of the user who last modified the resource
- See Also:
-
hashCode
-
isReleaseAndNotExpired
Returns if the related resource is released and not expired.- Parameters:
cms
- the cms context- Returns:
true
if the related resource is released and not expired
-
withTitle
Returns a shallow copy of this result, with a changed title.- Parameters:
title
- the new title- Returns:
- the shallow copy with the changed title
-
initializeMissingFieldsFromVfs
Initializes missing fields by reading the information from the VFS.- Parameters:
cms
- the current CMS contextstructureId
- the current structure id
-