com.jalios.jcms.fileprocessor.repository
Interface RepositoryIndexer

All Known Implementing Classes:
JCMSUploadIndexer

public interface RepositoryIndexer

Represents the way indexation must be done for a repository.

Version:
$Revision: 26564 $

Method Summary
 void addFileInIndex(org.apache.lucene.document.Document documentLucene, Map<String,Object> ctxt)
          Add a lucene Document to this Index.
 String getExternalURL(File file, javax.servlet.http.HttpServletRequest request, Repository repository)
          Gives an URL to access to files externally, given the file.
 org.apache.lucene.document.Document getLuceneDocument(File file, String content, Map<String,Object> ctxt)
          Gives the Lucene Document, used for indexing files.
 File getLuceneIndex()
          Gives the directory of the Lucene Index in wich the files of the repository have to be indexed.
 boolean provideExternalURLForFiles()
          This class may provide an external format for users to acces files.
 void removeFileFromIndex(File file, Map<String,Object> ctxt)
          Remove a file from this index
 void setLuceneIndex(File pluceneIndex)
          Set the directory of the Lucene Index in wich the files of the repository have to be indexed.
 

Method Detail

getLuceneIndex

File getLuceneIndex()
Gives the directory of the Lucene Index in wich the files of the repository have to be indexed.

Returns:
the directory of the Lucene Index

setLuceneIndex

void setLuceneIndex(File pluceneIndex)
Set the directory of the Lucene Index in wich the files of the repository have to be indexed.

Parameters:
pluceneIndex - the directory of the Lucene Index

getLuceneDocument

org.apache.lucene.document.Document getLuceneDocument(File file,
                                                      String content,
                                                      Map<String,Object> ctxt)
                                                      throws ProcessingException
Gives the Lucene Document, used for indexing files.

Parameters:
file -
content - the text content of the file
ctxt - the context
Returns:
The Lucene Document that will be used for indexation.
Throws:
ProcessingException - give the nature of a an exception of processing

removeFileFromIndex

void removeFileFromIndex(File file,
                         Map<String,Object> ctxt)
Remove a file from this index

Parameters:
file - to remove from index
ctxt - context

addFileInIndex

void addFileInIndex(org.apache.lucene.document.Document documentLucene,
                    Map<String,Object> ctxt)
Add a lucene Document to this Index.

Parameters:
documentLucene - the document to add
ctxt - context

provideExternalURLForFiles

boolean provideExternalURLForFiles()
This class may provide an external format for users to acces files. This is done by @see getExternalURL. This method returns true if it is possible to use the getExternalURL for the files.

Returns:
true if an URL is provided for access to files.

getExternalURL

String getExternalURL(File file,
                      javax.servlet.http.HttpServletRequest request,
                      Repository repository)
Gives an URL to access to files externally, given the file.

Parameters:
file - the file to access
request - the current HTTP request
repository - the repository for the file
Returns:
an URL to access to files


Copyright © 2001-2010 Jalios SA. All Rights Reserved.