org.opencms.search.documents
Class CmsDocumentContainerPage

java.lang.Object
  extended by org.opencms.search.documents.A_CmsVfsDocument
      extended by org.opencms.search.documents.CmsDocumentContainerPage
All Implemented Interfaces:
I_CmsDocumentFactory, I_CmsSearchExtractor

public class CmsDocumentContainerPage
extends A_CmsVfsDocument

Lucene document factory class to extract index data from a resource of type CmsResourceTypeContainerPage.

Since:
8.0

Field Summary
 
Fields inherited from class org.opencms.search.documents.A_CmsVfsDocument
m_name
 
Constructor Summary
CmsDocumentContainerPage(String name)
          Creates a new instance of this lucene document factory.
 
Method Summary
 org.apache.lucene.document.Document createDocument(CmsObject cms, CmsResource resource, CmsSearchIndex index)
          Generates a new lucene document instance from contents of the given resource for the provided index.
 I_CmsExtractionResult extractContent(CmsObject cms, CmsResource resource, CmsSearchIndex index)
          Returns the raw text content of a VFS resource of type CmsResourceTypeContainerPage.
 boolean isLocaleDependend()
          Returns true if this document factory is locale depended.
 boolean isUsingCache()
          Returns true if result caching is supported for this factory.
 
Methods inherited from class org.opencms.search.documents.A_CmsVfsDocument
getCache, getDocumentKey, getDocumentKeys, getName, logContentExtraction, readFile, setCache
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CmsDocumentContainerPage

public CmsDocumentContainerPage(String name)
Creates a new instance of this lucene document factory.

Parameters:
name - name of the document type
Method Detail

createDocument

public org.apache.lucene.document.Document createDocument(CmsObject cms,
                                                          CmsResource resource,
                                                          CmsSearchIndex index)
                                                   throws CmsException
Generates a new lucene document instance from contents of the given resource for the provided index.

For container pages, we must not cache based on the container page content age, since the content of the included elements may change any time.

Specified by:
createDocument in interface I_CmsDocumentFactory
Overrides:
createDocument in class A_CmsVfsDocument
Parameters:
cms - the OpenCms user context used to access the OpenCms VFS
resource - the search index resource to create the Lucene document from
index - the search index to create the Document for
Returns:
the Lucene Document for the given index resource and the given search index
Throws:
CmsException - if something goes wrong
See Also:
I_CmsDocumentFactory.createDocument(CmsObject, CmsResource, CmsSearchIndex), CmsSearchFieldConfiguration.createDocument(CmsObject, CmsResource, CmsSearchIndex, I_CmsExtractionResult)

extractContent

public I_CmsExtractionResult extractContent(CmsObject cms,
                                            CmsResource resource,
                                            CmsSearchIndex index)
                                     throws CmsException
Returns the raw text content of a VFS resource of type CmsResourceTypeContainerPage.

Parameters:
cms - the cms object
resource - the resource to extract the content from
index - the index to extract the content for
Returns:
the extracted content of the resource
Throws:
CmsException - if somethin goes wrong
See Also:
I_CmsSearchExtractor.extractContent(CmsObject, CmsResource, CmsSearchIndex)

isLocaleDependend

public boolean isLocaleDependend()
Description copied from interface: I_CmsDocumentFactory
Returns true if this document factory is locale depended.

Returns:
true if this document factory is locale depended
See Also:
I_CmsDocumentFactory.isLocaleDependend()

isUsingCache

public boolean isUsingCache()
Description copied from interface: I_CmsDocumentFactory
Returns true if result caching is supported for this factory.

Returns:
true if result caching is supported for this factory
See Also:
I_CmsDocumentFactory.isUsingCache()