org.silverpeas.search.indexEngine.model
Class IndexEntry

java.lang.Object
  extended by org.silverpeas.search.indexEngine.model.IndexEntry
All Implemented Interfaces:
Serializable, Cloneable
Direct Known Subclasses:
FullIndexEntry, MatchingIndexEntry

public class IndexEntry
extends Object
implements Serializable, Cloneable

IndexEntry is the base class for all the entries which are indexed in the web'activ index. A IndexEntry is create by a web'activ's component when it creates a new element or document. This IndexEntry will be return later when the document matchs a query.

See Also:
Serialized Form

Field Summary
static String ENDDATE_DEFAULT
          The end date defaults to 9999/99/99 so the document will be visible for ever.
static String STARTDATE_DEFAULT
          The start date defaults to 0000/00/00 so the document is visible as soon as published.
 
Constructor Summary
IndexEntry(IndexEntryPK pk)
          The constructor only set the key part of the IndexEntry.
IndexEntry(String component, String objectType, String objectId)
           
IndexEntry(String space, String component, String objectType, String objectId)
          Deprecated. - parameter space is no more used
IndexEntry(WAPrimaryKey key)
          This constructor set the key part of the IndexEntry but leave empty the object type.
IndexEntry(WAPrimaryKey key, String type)
          This constructor set the key part of the IndexEntry from WAPrimaryKey completed with a type given as a String.
 
Method Summary
 IndexEntry clone()
           
 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 getObjectId()
          Return the object id.
 String getObjectType()
          Return the type of the indexed document.
 List<String> getPaths()
           
 IndexEntryPK getPK()
          Return the key part of the IndexEntry
 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.
 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()
           
 void setAlias(boolean alias)
           
 void setCreationDate(Date creationDate)
          Set the creation time of the indexed document.
 void setCreationDate(String creationDate)
          Set the creation time of the indexed document.
 void setCreationUser(String creationUser)
          Set the author of the indexed document.
 void setEndDate(String endDate)
          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(Date lastModificationDate)
           
 void setLastModificationDate(String lastModificationDate)
           
 void setLastModificationUser(String lastModificationUser)
           
 void setPaths(List<String> paths)
           
 void setPK(IndexEntryPK 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(String startDate)
          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
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

STARTDATE_DEFAULT

public static final String STARTDATE_DEFAULT
The start date defaults to 0000/00/00 so the document is visible as soon as published.

See Also:
Constant Field Values

ENDDATE_DEFAULT

public static final String ENDDATE_DEFAULT
The end date defaults to 9999/99/99 so the document will be visible for ever.

See Also:
Constant Field Values
Constructor Detail

IndexEntry

public IndexEntry(WAPrimaryKey key)
This constructor set the key part of the IndexEntry but leave empty the object type. This constructor can be used by any component which indexes only one kind of entities and then doesn't need to tag them with a type.


IndexEntry

public IndexEntry(WAPrimaryKey key,
                  String type)
This constructor set the key part of the IndexEntry from WAPrimaryKey completed with a type given as a String. When the indexed document will be retrieved, this type will be used to distinguish the real type of the document between all the indexed document kind.


IndexEntry

public IndexEntry(String space,
                  String component,
                  String objectType,
                  String objectId)
Deprecated. - parameter space is no more used

The constructor only set the key part of the IndexEntry.


IndexEntry

public IndexEntry(String component,
                  String objectType,
                  String objectId)

IndexEntry

public IndexEntry(IndexEntryPK pk)
The constructor only set the key part of the IndexEntry.

Method Detail

toString

public String toString()
Returns as a string the key part of the indexEntry. the key part of the IndexEntry

Overrides:
toString in class Object

getPK

public IndexEntryPK 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.


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.


setTitle

public void setTitle(String title,
                     String lang)

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.


getTitle

public String getTitle(String lang)

setKeyWords

public void setKeyWords(String keywords)
Set key words for the index entry.


setKeywords

public void setKeywords(String keywords,
                        String lang)

getKeyWords

public String getKeyWords()
Return the key words of the index entry.


getKeywords

public String getKeywords(String lang)

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.


setPreview

public void setPreview(String preview,
                       String lang)

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.


getPreview

public String getPreview(String lang)

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(String creationDate)
Set the creation time of the indexed document.


setCreationDate

public void setCreationDate(Date 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(String startDate)
Set the start date from which the document will be displayed.


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(String endDate)
Set the end date until which the document will be displayed.


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.

Overrides:
equals in class Object

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.

Overrides:
hashCode in class Object

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)

getLanguages

public Iterator<String> getLanguages()

isIndexId

public boolean isIndexId()

setIndexId

public void setIndexId(boolean indexId)

getLastModificationDate

public String getLastModificationDate()

setLastModificationDate

public void setLastModificationDate(String lastModificationDate)

setLastModificationDate

public void setLastModificationDate(Date 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()

setPaths

public void setPaths(List<String> paths)

getPaths

public List<String> getPaths()

setPK

public void setPK(IndexEntryPK pk)

isAlias

public boolean isAlias()

setAlias

public void setAlias(boolean alias)

clone

public IndexEntry clone()
Overrides:
clone in class Object


Copyright © 2016 Silverpeas. All Rights Reserved.