com.jalios.jcms.fileprocessor.repository.jcmsupload
Class JCMSUploadIndexer

java.lang.Object
  extended by com.jalios.jcms.fileprocessor.repository.jcmsupload.JCMSUploadIndexer
All Implemented Interfaces:
RepositoryIndexer

public class JCMSUploadIndexer
extends Object
implements RepositoryIndexer

Implementation of the RepositoryIndexer for the JCMS upload directory.

Version:
$Revision: 26564 $

Field Summary
static String JCMS_UPLOAD_INDEXER_INDEXED_FILE
          Key of the indexed file in the current context Map.
static String REVISION
           
 
Constructor Summary
JCMSUploadIndexer()
          Public contructor without argument.
 
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)
          Create a Lucene Document from the text parsed by extractText().
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REVISION

public static final String REVISION
See Also:
Constant Field Values

JCMS_UPLOAD_INDEXER_INDEXED_FILE

public static String JCMS_UPLOAD_INDEXER_INDEXED_FILE
Key of the indexed file in the current context Map.

Constructor Detail

JCMSUploadIndexer

public JCMSUploadIndexer()
Public contructor without argument.

Method Detail

getLuceneDocument

public org.apache.lucene.document.Document getLuceneDocument(File file,
                                                             String content,
                                                             Map<String,Object> ctxt)
                                                      throws ProcessingException
Create a Lucene Document from the text parsed by extractText().

Specified by:
getLuceneDocument in interface RepositoryIndexer
Parameters:
file - the File to process
ctxt - A context passed from one processor to another.
content - the text content of the file
Returns:
A Lucene Document for indexation
Throws:
ProcessingException - give the nature of a an exception of processing

removeFileFromIndex

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

Specified by:
removeFileFromIndex in interface RepositoryIndexer
Parameters:
file - to remove from index
ctxt - context

addFileInIndex

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

Specified by:
addFileInIndex in interface RepositoryIndexer
Parameters:
documentLucene - the document to add
ctxt - context

setLuceneIndex

public void setLuceneIndex(File pluceneIndex)
Description copied from interface: RepositoryIndexer
Set the directory of the Lucene Index in wich the files of the repository have to be indexed.

Specified by:
setLuceneIndex in interface RepositoryIndexer
Parameters:
pluceneIndex - the directory of the Lucene Index

getLuceneIndex

public File getLuceneIndex()
Description copied from interface: RepositoryIndexer
Gives the directory of the Lucene Index in wich the files of the repository have to be indexed.

Specified by:
getLuceneIndex in interface RepositoryIndexer
Returns:
the directory of the Lucene Index

getExternalURL

public String getExternalURL(File file,
                             javax.servlet.http.HttpServletRequest request,
                             Repository repository)
Description copied from interface: RepositoryIndexer
Gives an URL to access to files externally, given the file.

Specified by:
getExternalURL in interface RepositoryIndexer
Parameters:
file - the file to access
request - the current HTTP request
repository - the repository for the file
Returns:
an URL to access to files

provideExternalURLForFiles

public boolean provideExternalURLForFiles()
Description copied from interface: RepositoryIndexer
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.

Specified by:
provideExternalURLForFiles in interface RepositoryIndexer
Returns:
true if an URL is provided for access to files.


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