Class IndexEntry
- java.lang.Object
-
- org.silverpeas.core.index.indexing.model.IndexEntry
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
FullIndexEntry
,MatchingIndexEntry
public class IndexEntry extends Object implements Serializable
IndexEntry is the base class for all the entries which are indexed in the Silverpeas indexes. An IndexEntry is created by a Silverpeas component when it creates a new element or document. This IndexEntry will be returned later when the document matches a query.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static String
END_DATE_DEFAULT
static String
START_DATE_DEFAULT
-
Constructor Summary
Constructors Constructor Description IndexEntry(IndexEntryKey pk)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
To be equal two IndexEntry must have the same PK.String
getComponent()
Return the name of the component's instance which handles the object.String
getCreationDate()
Return the creation time of the indexed document.String
getCreationUser()
Return the author of the indexed document.String
getEndDate()
Get the end date until which the document will be displayed.String
getFilename()
String
getKeywords()
Return the key words of the index entry.String
getKeywords(String lang)
String
getLang()
Return the language of the indexed document.Iterator<String>
getLanguages()
String
getLastModificationDate()
String
getLastModificationUser()
String
getLinkedObjectId()
Gets the identifier of the object to which the object referred by this index entry is linked.String
getObjectId()
Return the object id.String
getObjectType()
Return the type of the indexed document.List<String>
getPaths()
IndexEntryKey
getPK()
Return the key part of the IndexEntryString
getPreview()
Return the pre-view text for the index entry as it will be displayed at the user when the document will be retrieved.String
getPreview(String lang)
String
getServerName()
String
getStartDate()
Get the start date from which the document will be displayed.String
getThumbnail()
String
getThumbnailDirectory()
String
getThumbnailMimeType()
String
getTitle()
Return the title of the index entry as it will be displayed to the user if the indexed document match his query.String
getTitle(String lang)
int
hashCode()
Returns the hash code of the indexEntry.boolean
isAlias()
boolean
isIndexId()
boolean
isLinkedObject()
Is the object referred by this index entry is linked to another object in Silverpeas?void
setAlias(boolean alias)
void
setCreationDate(LocalDate creationDate)
Set the creation time of the indexed document.void
setCreationDate(Date creationDate)
Set the creation time of the indexed document.void
setCreationUser(String creationUser)
Set the author of the indexed document.void
setEndDate(LocalDate date)
void
setEndDate(Date date)
Set the end date until which the document will be displayed.void
setFilename(String filename)
void
setIndexId(boolean indexId)
void
setKeywords(String keywords)
Set key words for the index entry.void
setKeywords(String keywords, String lang)
void
setLang(String lang)
Set the language of the indexed document.void
setLastModificationDate(LocalDate lastModificationDate)
void
setLastModificationDate(Date lastModificationDate)
void
setLastModificationUser(String lastModificationUser)
void
setPaths(List<String> paths)
void
setPK(IndexEntryKey pk)
void
setPreview(String preview)
Set a pre-view text for the index entry as it will be displayed at the user when the document will be retrieved.void
setPreview(String preview, String lang)
void
setServerName(String serverName)
void
setStartDate(LocalDate date)
void
setStartDate(Date date)
Set the start date from which the document will be displayed.void
setThumbnail(String thumbnail)
void
setThumbnailDirectory(String thumbnailDirectory)
void
setThumbnailMimeType(String thumbnailMimeType)
void
setTitle(String title)
Set the title of the index entry as it will be displayed to the user if the indexed document match his query.void
setTitle(String title, String lang)
String
toString()
Returns as a string the key part of the indexEntry. the key part of the IndexEntry
-
-
-
Field Detail
-
START_DATE_DEFAULT
public static final String START_DATE_DEFAULT
- See Also:
- Constant Field Values
-
END_DATE_DEFAULT
public static final String END_DATE_DEFAULT
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
IndexEntry
public IndexEntry(IndexEntryKey pk)
-
-
Method Detail
-
toString
public String toString()
Returns as a string the key part of the indexEntry. the key part of the IndexEntry
-
getPK
public IndexEntryKey getPK()
Return the key part of the IndexEntry
-
getComponent
public String getComponent()
Return the name of the component's instance which handles the object.
-
getObjectType
public String getObjectType()
Return the type of the indexed document. The meaning of this type is uniquely determined by the component handling the object.
-
getObjectId
public String getObjectId()
Return the object id.
-
getLinkedObjectId
public String getLinkedObjectId()
Gets the identifier of the object to which the object referred by this index entry is linked.- Returns:
- either the identifier of the linked object or an empty string if there is no such object.
-
setTitle
public void setTitle(String title)
Set the title of the index entry as it will be displayed to the user if the indexed document match his query.
-
getTitle
public String getTitle()
Return the title of the index entry as it will be displayed to the user if the indexed document match his query.
-
setKeywords
public void setKeywords(String keywords)
Set key words for the index entry.
-
getKeywords
public String getKeywords()
Return the key words of the index entry.
-
setPreview
public void setPreview(String preview)
Set a pre-view text for the index entry as it will be displayed at the user when the document will be retrieved.
-
getPreview
public String getPreview()
Return the pre-view text for the index entry as it will be displayed at the user when the document will be retrieved.
-
setLang
public void setLang(String lang)
Set the language of the indexed document.
-
getLang
public String getLang()
Return the language of the indexed document.
-
setCreationDate
public void setCreationDate(Date creationDate)
Set the creation time of the indexed document.
-
setCreationDate
public void setCreationDate(LocalDate creationDate)
Set the creation time of the indexed document.
-
getCreationDate
public String getCreationDate()
Return the creation time of the indexed document.
-
setCreationUser
public void setCreationUser(String creationUser)
Set the author of the indexed document. This is the full name of the user (and not his login or user_id).
-
getCreationUser
public String getCreationUser()
Return the author of the indexed document. This is the full name of the user (and not his login or user_id).
-
setStartDate
public void setStartDate(Date date)
Set the start date from which the document will be displayed.
-
setStartDate
public void setStartDate(LocalDate date)
-
getStartDate
public String getStartDate()
Get the start date from which the document will be displayed. Returns 0000/00/00 if the start date is not set.
-
setEndDate
public void setEndDate(Date date)
Set the end date until which the document will be displayed.
-
setEndDate
public void setEndDate(LocalDate date)
-
getEndDate
public String getEndDate()
Get the end date until which the document will be displayed. Returns 9999/99/99 if the end date is not set.
-
equals
public boolean equals(Object o)
To be equal two IndexEntry must have the same PK. The equals method is redefined so IndexEntry objects can be put in a Set or used as Map key.
-
hashCode
public int hashCode()
Returns the hash code of the indexEntry. The hashCode method is redefined so IndexEntry objects can be put in a Set or used as Map key. Only the primary key is used to compute the hash code, as only the primary key is used to compare two entries.
-
getThumbnail
public String getThumbnail()
-
setThumbnail
public void setThumbnail(String thumbnail)
-
getThumbnailDirectory
public String getThumbnailDirectory()
-
setThumbnailDirectory
public void setThumbnailDirectory(String thumbnailDirectory)
-
getThumbnailMimeType
public String getThumbnailMimeType()
-
setThumbnailMimeType
public void setThumbnailMimeType(String thumbnailMimeType)
-
isIndexId
public boolean isIndexId()
-
setIndexId
public void setIndexId(boolean indexId)
-
getLastModificationDate
public String getLastModificationDate()
-
setLastModificationDate
public void setLastModificationDate(Date lastModificationDate)
-
setLastModificationDate
public void setLastModificationDate(LocalDate lastModificationDate)
-
getLastModificationUser
public String getLastModificationUser()
-
setLastModificationUser
public void setLastModificationUser(String lastModificationUser)
-
getServerName
public String getServerName()
- Returns:
- the serverName in order to distinguish each server for external server research
-
setServerName
public void setServerName(String serverName)
- Parameters:
serverName
- the serverName to set
-
setFilename
public void setFilename(String filename)
-
getFilename
public String getFilename()
-
setPK
public void setPK(IndexEntryKey pk)
-
isLinkedObject
public boolean isLinkedObject()
Is the object referred by this index entry is linked to another object in Silverpeas? If yes, then the unique identifier of the object with which it has a link can be got with#getLinkedObjectId()
.- Returns:
- true if the indexed object is in fact linked to another object in the same component in Silverpeas.
-
isAlias
public boolean isAlias()
-
setAlias
public void setAlias(boolean alias)
-
-