public class CmsGallerySearchResult extends java.lang.Object implements java.lang.Comparable<CmsGallerySearchResult>
Modifier and Type | Field and Description |
---|---|
static org.apache.commons.logging.Log |
LOG
The logger instance for this class.
|
protected java.lang.String |
m_additonalInfo
The additional information for the gallery search index.
|
protected java.util.List<java.lang.String> |
m_containerTypes
The supported container types of this search result.
|
protected java.util.Date |
m_dateCreated
The creation date of this search result.
|
protected java.util.Date |
m_dateExpired
The expiration date of this search result.
|
protected java.util.Date |
m_dateLastModified
The last modification date of this search result.
|
protected java.util.Date |
m_dateReleased
The release date of this search result.
|
protected java.lang.String |
m_description
The description of this search result.
|
protected java.lang.String |
m_excerpt
The excerpt of this search result.
|
protected int |
m_length
The length of the search result.
|
protected java.util.List<java.lang.String> |
m_locales
The locales in which the content is available.
|
protected java.lang.String |
m_path
The resource path of this search result.
|
protected java.lang.String |
m_resourceType
The resource type of the search result.
|
protected int |
m_score
The score of this search result.
|
protected int |
m_state
The state of the search result.
|
protected java.lang.String |
m_structureId
The structure UUID of the resource.
|
protected java.lang.String |
m_title
The title of this search result.
|
protected java.lang.String |
m_userCreated
The user who created the search result resource.
|
protected java.lang.String |
m_userLastModified
The user who last modified the search result resource.
|
Constructor and Description |
---|
CmsGallerySearchResult(CmsObject cms,
CmsResource res)
Creates a fake gallery search result by reading the necessary data from a VFS resource.
|
CmsGallerySearchResult(I_CmsSearchDocument doc,
CmsObject cms,
int score,
java.util.Locale locale)
Creates a new gallery search result.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(CmsGallerySearchResult other)
Compares two search results based on the score of the result.
|
boolean |
equals(java.lang.Object obj) |
java.lang.String |
getAdditonalInfo()
Returns the additional information stored for this search result in the gallery search index.
|
java.util.List<java.lang.String> |
getContainerTypes()
Returns the containers supported by this resource.
|
java.util.Date |
getDateCreated()
Returns the date created.
|
java.util.Date |
getDateExpired()
Returns the date the resource expires.
|
java.util.Date |
getDateLastModified()
Returns the date last modified.
|
java.util.Date |
getDateReleased()
Returns the date the resource is released.
|
java.lang.String |
getDescription()
Returns the description.
|
java.lang.String |
getExcerpt()
Returns the excerpt.
|
int |
getLength()
Returns the length of the resource.
|
java.util.List<java.lang.String> |
getLocales()
Returns the list of locales this search result is available for.
|
java.lang.String |
getPath()
Returns the resource root path.
|
static java.lang.String[] |
getRequiredSolrFields()
Returns the list of Solr fields a search result must have to initialize the gallery search result correctly.
|
java.lang.String |
getResourceType()
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.
|
java.lang.String |
getStructureId()
Returns the structure id of the resource.
|
java.lang.String |
getTitle()
Returns the title of the resource.
|
java.lang.String |
getUserCreated()
Returns the name of the user who created the resource.
|
java.lang.String |
getUserLastModified()
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 |
isReleaseAndNotExpired(CmsObject cms)
Returns if the related resource is released and not expired.
|
public static final org.apache.commons.logging.Log LOG
protected java.lang.String m_additonalInfo
protected java.util.List<java.lang.String> m_containerTypes
protected java.util.Date m_dateCreated
protected java.util.Date m_dateExpired
protected java.util.Date m_dateLastModified
protected java.util.Date m_dateReleased
protected java.lang.String m_description
protected java.lang.String m_excerpt
protected int m_length
protected java.util.List<java.lang.String> m_locales
protected java.lang.String m_path
protected java.lang.String m_resourceType
protected int m_score
protected int m_state
protected java.lang.String m_structureId
protected java.lang.String m_title
protected java.lang.String m_userCreated
protected java.lang.String m_userLastModified
public CmsGallerySearchResult(CmsObject cms, CmsResource res)
cms
- the current CMS contextres
- the resource from which the data should be readpublic CmsGallerySearchResult(I_CmsSearchDocument doc, CmsObject cms, int score, java.util.Locale locale)
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 forpublic static final java.lang.String[] getRequiredSolrFields()
public int compareTo(CmsGallerySearchResult other)
compareTo
in interface java.lang.Comparable<CmsGallerySearchResult>
other
- the result to compare this result withComparable.compareTo(java.lang.Object)
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
Object.equals(java.lang.Object)
public java.lang.String getAdditonalInfo()
public java.util.List<java.lang.String> getContainerTypes()
public java.util.Date getDateCreated()
public java.util.Date getDateExpired()
CmsResource.getDateExpired()
public java.util.Date getDateLastModified()
public java.util.Date getDateReleased()
CmsResource.getDateReleased()
public java.lang.String getDescription()
public java.lang.String getExcerpt()
public int getLength()
CmsResource.getLength()
public java.util.List<java.lang.String> getLocales()
public java.lang.String getPath()
CmsResource.getRootPath()
public java.lang.String getResourceType()
CmsResourceManager.getResourceType(String)
public int getScore()
public int getState()
CmsResource.getState()
public java.lang.String getStructureId()
public java.lang.String getTitle()
public java.lang.String getUserCreated()
CmsResource.getUserCreated()
public java.lang.String getUserLastModified()
CmsResource.getUserLastModified()
public int hashCode()
hashCode
in class java.lang.Object
Object.hashCode()
public boolean isReleaseAndNotExpired(CmsObject cms)
cms
- the cms contexttrue
if the related resource is released and not expiredprotected void initializeMissingFieldsFromVfs(CmsObject cms, CmsUUID structureId)
cms
- the current CMS contextstructureId
- the current structure id