org.opencms.search.documents
Interface I_CmsDocumentFactory

All Superinterfaces:
I_CmsSearchExtractor
All Known Implementing Classes:
A_CmsVfsDocument

public interface I_CmsDocumentFactory
extends I_CmsSearchExtractor

Implementation interface for lucene document factories used in OpenCms.

Since:
6.0.0
Version:
$Revision: 1.24 $
Author:
Carsten Weinholz, Thomas Weckert

Field Summary
static java.lang.String DOC_CATEGORY
          Contains the (optional) category of the document.
static java.lang.String DOC_CONTENT
          Search field for document content.
static java.lang.String DOC_DATE_CREATED
          Search field for document creation date.
static java.lang.String DOC_DATE_LASTMODIFIED
          Search field for document last update.
static java.lang.String DOC_DESCRIPTION
          Search field for document description.
static java.lang.String DOC_KEYWORDS
          Search field for document keywords.
static java.lang.String DOC_META
          Combines all document "meta" information, that is "title", "keywords" and "description".
static java.lang.String DOC_PATH
          Contains the document root path in the VFS.
static java.lang.String DOC_PRIORITY
          Contains the (optional) document priority, which can be used to boost the document in the result list.
static java.lang.String DOC_ROOT
          Contains a special format of the document root path in the VFS for optimized searches.
static java.lang.String DOC_TITLE_INDEXED
          Contains the document title in an analyzed form used for searching in the title.
static java.lang.String DOC_TITLE_KEY
          Contains the document title as a keyword used for sorting and also for retrieving the title text.
static java.lang.String DOC_TYPE
          Contains the type of the document.
static java.lang.String SEARCH_PRIORITY_HIGH_VALUE
          Value for "high" search priority.
static java.lang.String SEARCH_PRIORITY_LOW_VALUE
          Value for "low" search priority.
static java.lang.String SEARCH_PRIORITY_MAX_VALUE
          Value for "maximum" search priority.
static java.lang.String SEARCH_PRIORITY_NORMAL_VALUE
          Value for "normal" search priority.
 
Method Summary
 java.lang.String getDocumentKey(java.lang.String resourceType)
          Returns the document key for the search manager.
 java.util.List getDocumentKeys(java.util.List resourceTypes, java.util.List mimeTypes)
          Returns a list of document keys for the documenttype.
 java.lang.String getName()
          Returns the name of the documenttype.
 org.apache.lucene.document.Document newInstance(CmsObject cms, A_CmsIndexResource resource, java.lang.String language)
          Creates a new instance of a lucene document type for the concrete file type.
 
Methods inherited from interface org.opencms.search.documents.I_CmsSearchExtractor
extractContent
 

Field Detail

DOC_CATEGORY

public static final java.lang.String DOC_CATEGORY
Contains the (optional) category of the document.

See Also:
Constant Field Values

DOC_CONTENT

public static final java.lang.String DOC_CONTENT
Search field for document content.

See Also:
Constant Field Values

DOC_DATE_CREATED

public static final java.lang.String DOC_DATE_CREATED
Search field for document creation date.

See Also:
Constant Field Values

DOC_DATE_LASTMODIFIED

public static final java.lang.String DOC_DATE_LASTMODIFIED
Search field for document last update.

See Also:
Constant Field Values

DOC_DESCRIPTION

public static final java.lang.String DOC_DESCRIPTION
Search field for document description.

See Also:
Constant Field Values

DOC_KEYWORDS

public static final java.lang.String DOC_KEYWORDS
Search field for document keywords.

See Also:
Constant Field Values

DOC_META

public static final java.lang.String DOC_META
Combines all document "meta" information, that is "title", "keywords" and "description".

See Also:
Constant Field Values

DOC_PATH

public static final java.lang.String DOC_PATH
Contains the document root path in the VFS.

See Also:
Constant Field Values

DOC_PRIORITY

public static final java.lang.String DOC_PRIORITY
Contains the (optional) document priority, which can be used to boost the document in the result list.

See Also:
Constant Field Values

DOC_ROOT

public static final java.lang.String DOC_ROOT
Contains a special format of the document root path in the VFS for optimized searches.

See Also:
Constant Field Values

DOC_TITLE_INDEXED

public static final java.lang.String DOC_TITLE_INDEXED
Contains the document title in an analyzed form used for searching in the title.

See Also:
Constant Field Values

DOC_TITLE_KEY

public static final java.lang.String DOC_TITLE_KEY
Contains the document title as a keyword used for sorting and also for retrieving the title text.

See Also:
Constant Field Values

DOC_TYPE

public static final java.lang.String DOC_TYPE
Contains the type of the document.

See Also:
Constant Field Values

SEARCH_PRIORITY_HIGH_VALUE

public static final java.lang.String SEARCH_PRIORITY_HIGH_VALUE
Value for "high" search priority.

See Also:
Constant Field Values

SEARCH_PRIORITY_LOW_VALUE

public static final java.lang.String SEARCH_PRIORITY_LOW_VALUE
Value for "low" search priority.

See Also:
Constant Field Values

SEARCH_PRIORITY_MAX_VALUE

public static final java.lang.String SEARCH_PRIORITY_MAX_VALUE
Value for "maximum" search priority.

See Also:
Constant Field Values

SEARCH_PRIORITY_NORMAL_VALUE

public static final java.lang.String SEARCH_PRIORITY_NORMAL_VALUE
Value for "normal" search priority.

See Also:
Constant Field Values
Method Detail

getDocumentKey

public java.lang.String getDocumentKey(java.lang.String resourceType)
                                throws CmsException
Returns the document key for the search manager.

Parameters:
resourceType - the resource type to get the document key for
Returns:
the document key for the search manager
Throws:
CmsException - if something goes wrong

getDocumentKeys

public java.util.List getDocumentKeys(java.util.List resourceTypes,
                                      java.util.List mimeTypes)
                               throws CmsException
Returns a list of document keys for the documenttype.

The list of accepted resource types may contain a catch-all entry "*"; in this case, a list for all possible resource types is returned, calculated by a logic depending on the document handler class.

Parameters:
resourceTypes - list of accepted resource types
mimeTypes - list of accepted mime types
Returns:
a list of document keys for this document factory
Throws:
CmsException - if something goes wrong

getName

public java.lang.String getName()
Returns the name of the documenttype.

Returns:
the name of the documenttype

newInstance

public org.apache.lucene.document.Document newInstance(CmsObject cms,
                                                       A_CmsIndexResource resource,
                                                       java.lang.String language)
                                                throws CmsException
Creates a new instance of a lucene document type for the concrete file type.

Parameters:
cms - the cms object
resource - a cms resource
language - the requested language
Returns:
a lucene document for the given resource
Throws:
CmsException - if something goes wrong