org.olat.core.commons.services.search
Class OlatDocument

java.lang.Object
  extended by org.olat.core.commons.services.search.OlatDocument
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
ContextHelpDocument, CourseNodeDocument, FeedItemDocument, FeedNodeDocument, FileDocument, ForumMessageDocument, GroupDocument, IdentityDocument, IMSMetadataDocument, ProjectBrokerProjectDocument, RepositoryEntryDocument, ResultDocument, WikiPageDocument

public class OlatDocument
extends java.lang.Object
implements java.io.Serializable

Lucene document mapper.

Author:
Christian Guretzki
See Also:
Serialized Form

Field Summary
static java.lang.String AUTHOR_FIELD_NAME
           
static java.lang.String CHANGED_FIELD_NAME
           
static java.lang.String CONTENT_FIELD_NAME
           
static java.lang.String CREATED_FIELD_NAME
           
static java.lang.String CSS_ICON
           
static java.lang.String DESCRIPTION_FIELD_NAME
           
static java.lang.String DOCUMENTTYPE_FIELD_NAME
           
static java.lang.String FILETYPE_FIELD_NAME
           
static java.lang.String PARENT_CONTEXT_NAME_FIELD_NAME
           
static java.lang.String PARENT_CONTEXT_TYPE_FIELD_NAME
           
static java.lang.String RESOURCEURL_FIELD_NAME
           
static java.lang.String TIME_STAMP_NAME
           
static java.lang.String TITLE_FIELD_NAME
           
 
Constructor Summary
OlatDocument()
           
OlatDocument(org.apache.lucene.document.Document document)
           
 
Method Summary
 void addMetadata(java.lang.String key, java.lang.String value)
          Add generic metadata.
 java.lang.String getAuthor()
           
 java.lang.String getContent()
           
 java.util.Date getCreatedDate()
           
 java.lang.String getCssIcon()
           
 java.lang.String getDescription()
           
 java.lang.String getDocumentType()
           
 java.lang.String getFileType()
           
 java.util.Date getLastChange()
           
 org.apache.lucene.document.Document getLuceneDocument()
          Generate a lucene document from the data stored in this document
 java.util.List<java.lang.String> getMetadataValues(java.lang.String key)
          Get the list of metadata values for the given key.
 java.lang.String getParentContextName()
           
 java.lang.String getParentContextType()
           
 java.lang.String getResourceUrl()
           
 java.util.Date getTimestamp()
           
 java.lang.String getTitle()
           
 void setAuthor(java.lang.String author)
           
 void setContent(java.lang.String content)
           
 void setCreatedDate(java.util.Date createdDate)
           
 void setCssIcon(java.lang.String cssIcon)
           
 void setDescription(java.lang.String description)
           
 void setDocumentType(java.lang.String documentType)
           
 void setFileType(java.lang.String fileType)
           
 void setLastChange(java.util.Date lastChange)
           
 void setParentContextName(java.lang.String parentContextName)
           
 void setParentContextType(java.lang.String parentContextType)
           
 void setResourceUrl(java.lang.String resourceUrl)
           
 void setTitle(java.lang.String title)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TITLE_FIELD_NAME

public static final java.lang.String TITLE_FIELD_NAME
See Also:
Constant Field Values

DESCRIPTION_FIELD_NAME

public static final java.lang.String DESCRIPTION_FIELD_NAME
See Also:
Constant Field Values

CONTENT_FIELD_NAME

public static final java.lang.String CONTENT_FIELD_NAME
See Also:
Constant Field Values

DOCUMENTTYPE_FIELD_NAME

public static final java.lang.String DOCUMENTTYPE_FIELD_NAME
See Also:
Constant Field Values

FILETYPE_FIELD_NAME

public static final java.lang.String FILETYPE_FIELD_NAME
See Also:
Constant Field Values

RESOURCEURL_FIELD_NAME

public static final java.lang.String RESOURCEURL_FIELD_NAME
See Also:
Constant Field Values

AUTHOR_FIELD_NAME

public static final java.lang.String AUTHOR_FIELD_NAME
See Also:
Constant Field Values

CREATED_FIELD_NAME

public static final java.lang.String CREATED_FIELD_NAME
See Also:
Constant Field Values

CHANGED_FIELD_NAME

public static final java.lang.String CHANGED_FIELD_NAME
See Also:
Constant Field Values

TIME_STAMP_NAME

public static final java.lang.String TIME_STAMP_NAME
See Also:
Constant Field Values

PARENT_CONTEXT_TYPE_FIELD_NAME

public static final java.lang.String PARENT_CONTEXT_TYPE_FIELD_NAME
See Also:
Constant Field Values

PARENT_CONTEXT_NAME_FIELD_NAME

public static final java.lang.String PARENT_CONTEXT_NAME_FIELD_NAME
See Also:
Constant Field Values

CSS_ICON

public static final java.lang.String CSS_ICON
See Also:
Constant Field Values
Constructor Detail

OlatDocument

public OlatDocument()

OlatDocument

public OlatDocument(org.apache.lucene.document.Document document)
Method Detail

getAuthor

public java.lang.String getAuthor()
Returns:
Returns the author.

setAuthor

public void setAuthor(java.lang.String author)
Parameters:
author - The author to set.

getContent

public java.lang.String getContent()
Returns:
Returns the content.

setContent

public void setContent(java.lang.String content)
Parameters:
content - The content to set.

getDescription

public java.lang.String getDescription()
Returns:
Returns the description.

setDescription

public void setDescription(java.lang.String description)
Parameters:
description - The description to set.

getDocumentType

public java.lang.String getDocumentType()
Returns:
Returns the documentType.

setDocumentType

public void setDocumentType(java.lang.String documentType)
Parameters:
documentType - The documentType to set.

getFileType

public java.lang.String getFileType()
Returns:
Returns the fileType.

setFileType

public void setFileType(java.lang.String fileType)
Parameters:
fileType - The fileType to set.

getLastChange

public java.util.Date getLastChange()
Returns:
Returns the lastChange.

setLastChange

public void setLastChange(java.util.Date lastChange)
Parameters:
lastChange - The lastChange to set.

getResourceUrl

public java.lang.String getResourceUrl()
Returns:
Returns the resourceUrl.

setResourceUrl

public void setResourceUrl(java.lang.String resourceUrl)
Parameters:
resourceUrl - The resourceUrl to set.

getTitle

public java.lang.String getTitle()
Returns:
Returns the title.

setTitle

public void setTitle(java.lang.String title)
Parameters:
title - The title to set.

addMetadata

public void addMetadata(java.lang.String key,
                        java.lang.String value)
Add generic metadata. It is strongly recommended not to use anything else than the doublin core metadata namespace here. See ://en.wikipedia.org/wiki/Dublin_Core for more information.

A metadata element consists of a key-value pair. It is possible to have more than one value for a key. In this case use the method multiple times with the same key.

Example:
DC.subject OLAT - the best Open Source LMS
DC.creator Florian GnÔøΩgi

Parameters:
key - The metadata key
value - The metadata value

getMetadataValues

public java.util.List<java.lang.String> getMetadataValues(java.lang.String key)
Get the list of metadata values for the given key. This might return NULL if no such metadata is linked to this document.

Parameters:
key - The metadata key, e.g. DC.subject
Returns:
The list of values or NULL if not found

getLuceneDocument

public org.apache.lucene.document.Document getLuceneDocument()
Generate a lucene document from the data stored in this document

Returns:

getParentContextType

public java.lang.String getParentContextType()

setParentContextType

public void setParentContextType(java.lang.String parentContextType)

getParentContextName

public java.lang.String getParentContextName()

setParentContextName

public void setParentContextName(java.lang.String parentContextName)

getCssIcon

public java.lang.String getCssIcon()

setCssIcon

public void setCssIcon(java.lang.String cssIcon)

getTimestamp

public java.util.Date getTimestamp()

getCreatedDate

public java.util.Date getCreatedDate()
Returns:
Returns the createdDate.

setCreatedDate

public void setCreatedDate(java.util.Date createdDate)
Parameters:
createdDate - The createdDate to set.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object