org.opencms.search
Class CmsVfsIndexer

java.lang.Object
  extended byorg.opencms.search.CmsVfsIndexer
All Implemented Interfaces:
I_CmsIndexer

public class CmsVfsIndexer
extends Object
implements I_CmsIndexer

Implementation for an indexer indexing VFS Cms resources.

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

Constructor Summary
CmsVfsIndexer()
           
 
Method Summary
 A_CmsIndexResource getIndexResource(CmsObject cms, Document doc)
          Returns an index resource for a specified Lucene search result document.
 void init(I_CmsReport report, CmsSearchIndex index, CmsSearchIndexSource indexSource, IndexWriter writer, CmsIndexingThreadManager threadManager)
          Initializes the indexer.
 void updateIndex(CmsObject cms, String source, String path)
          Creates new index entries for all resources below the given path.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CmsVfsIndexer

public CmsVfsIndexer()
Method Detail

getIndexResource

public A_CmsIndexResource getIndexResource(CmsObject cms,
                                           Document doc)
                                    throws CmsException
Description copied from interface: I_CmsIndexer
Returns an index resource for a specified Lucene search result document.

Implementations of this method have to check if the current user has read permissions on the Cms resource represented by the Lucene document.

If this check fails, the implementation must return null as a result.

Specified by:
getIndexResource in interface I_CmsIndexer
Parameters:
cms - the current user's CmsObject
doc - the Lucene search result document
Returns:
a new index resource
Throws:
CmsException - if something goes wrong
See Also:
I_CmsIndexer.getIndexResource(org.opencms.file.CmsObject, org.apache.lucene.document.Document)

init

public void init(I_CmsReport report,
                 CmsSearchIndex index,
                 CmsSearchIndexSource indexSource,
                 IndexWriter writer,
                 CmsIndexingThreadManager threadManager)
Description copied from interface: I_CmsIndexer
Initializes the indexer.

Specified by:
init in interface I_CmsIndexer
Parameters:
report - the report
index - the search index
indexSource - the search index source
writer - writer to write the search index in the physical file system
threadManager - the tread manager
See Also:
I_CmsIndexer.init(org.opencms.report.I_CmsReport, org.opencms.search.CmsSearchIndex, org.opencms.search.CmsSearchIndexSource, org.apache.lucene.index.IndexWriter, org.opencms.search.CmsIndexingThreadManager)

updateIndex

public void updateIndex(CmsObject cms,
                        String source,
                        String path)
                 throws CmsIndexException
Description copied from interface: I_CmsIndexer
Creates new index entries for all resources below the given path.

Specified by:
updateIndex in interface I_CmsIndexer
Parameters:
cms - the current user's CmsObject
source - the source of the resources
path - the path to the root of the subtree to index
Throws:
CmsIndexException - if something goes wrong
See Also:
I_CmsIndexer.updateIndex(CmsObject, java.lang.String, java.lang.String)