fr.paris.lutece.plugins.helpdesk.service.search
Class HelpdeskIndexer

java.lang.Object
  extended by fr.paris.lutece.plugins.helpdesk.service.search.HelpdeskIndexer
All Implemented Interfaces:
fr.paris.lutece.portal.service.search.SearchIndexer

public class HelpdeskIndexer
extends java.lang.Object
implements fr.paris.lutece.portal.service.search.SearchIndexer

Helpdesk Indexer


Field Summary
static java.lang.String PROPERTY_INDEXER_NAME
           
static java.lang.String SHORT_NAME_QUESTION_ANSWER
           
static java.lang.String SHORT_NAME_SUBJECT
           
 
Constructor Summary
HelpdeskIndexer()
           
 
Method Summary
 java.lang.String getDescription()
          Returns the indexer service description
static org.apache.lucene.document.Document getDocument(int nIdFaq, QuestionAnswer questionAnswer, java.lang.String strUrl, java.lang.String strRoleKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Builds a document which will be used by Lucene during the indexing of the question/answer list
static org.apache.lucene.document.Document getDocument(Subject subject, java.lang.String strRoleKey, java.lang.String strUrl, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Builds a document which will be used by Lucene during the indexing of the subject list
 java.util.List<org.apache.lucene.document.Document> getDocuments(java.lang.String strDocument)
          Get the subject document
 java.lang.String getName()
          Get the name of the indexer.
 java.lang.String getVersion()
          Get the version of the indexer
 void indexDocuments()
          Index all documents
 void indexSubject(Faq faq, Subject subject)
          Recursive method for indexing a subject and his children
 boolean isEnable()
          Get the state of indexer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROPERTY_INDEXER_NAME

public static final java.lang.String PROPERTY_INDEXER_NAME
See Also:
Constant Field Values

SHORT_NAME_SUBJECT

public static final java.lang.String SHORT_NAME_SUBJECT
See Also:
Constant Field Values

SHORT_NAME_QUESTION_ANSWER

public static final java.lang.String SHORT_NAME_QUESTION_ANSWER
See Also:
Constant Field Values
Constructor Detail

HelpdeskIndexer

public HelpdeskIndexer()
Method Detail

getDescription

public java.lang.String getDescription()
Returns the indexer service description

Specified by:
getDescription in interface fr.paris.lutece.portal.service.search.SearchIndexer
Returns:
The indexer service description

indexDocuments

public void indexDocuments()
                    throws java.io.IOException,
                           java.lang.InterruptedException,
                           fr.paris.lutece.portal.service.message.SiteMessageException
Index all documents

Specified by:
indexDocuments in interface fr.paris.lutece.portal.service.search.SearchIndexer
Throws:
java.io.IOException - the exception
java.lang.InterruptedException - the exception
fr.paris.lutece.portal.service.message.SiteMessageException - the exception

indexSubject

public void indexSubject(Faq faq,
                         Subject subject)
                  throws java.io.IOException,
                         java.lang.InterruptedException
Recursive method for indexing a subject and his children

Parameters:
faq - the faq linked to the subject
subject - the subject
Throws:
java.io.IOException - I/O Exception
java.lang.InterruptedException - interruptedException

getDocuments

public java.util.List<org.apache.lucene.document.Document> getDocuments(java.lang.String strDocument)
                                                                 throws java.io.IOException,
                                                                        java.lang.InterruptedException,
                                                                        fr.paris.lutece.portal.service.message.SiteMessageException
Get the subject document

Specified by:
getDocuments in interface fr.paris.lutece.portal.service.search.SearchIndexer
Parameters:
strDocument - id of the subject to index
Returns:
The list of lucene documents
Throws:
java.io.IOException - the exception
java.lang.InterruptedException - the exception
fr.paris.lutece.portal.service.message.SiteMessageException - the exception

getDocument

public static org.apache.lucene.document.Document getDocument(int nIdFaq,
                                                              QuestionAnswer questionAnswer,
                                                              java.lang.String strUrl,
                                                              java.lang.String strRoleKey,
                                                              fr.paris.lutece.portal.service.plugin.Plugin plugin)
                                                       throws java.io.IOException,
                                                              java.lang.InterruptedException
Builds a document which will be used by Lucene during the indexing of the question/answer list

Parameters:
nIdFaq - The Faq Id
questionAnswer - the QuestionAnswer to index
strUrl - the url of the subject
strRoleKey - The role key
plugin - The Plugin
Returns:
A Lucene Document containing QuestionAnswer Data
Throws:
java.io.IOException - The IO Exception
java.lang.InterruptedException - The InterruptedException

getDocument

public static org.apache.lucene.document.Document getDocument(Subject subject,
                                                              java.lang.String strRoleKey,
                                                              java.lang.String strUrl,
                                                              fr.paris.lutece.portal.service.plugin.Plugin plugin)
                                                       throws java.io.IOException,
                                                              java.lang.InterruptedException
Builds a document which will be used by Lucene during the indexing of the subject list

Parameters:
subject - the Subject to index
strUrl - the url of the subject
strRoleKey - The role key
plugin - The Plugin
Returns:
The Lucene Document containing Subject data
Throws:
java.io.IOException - The IO Exception
java.lang.InterruptedException - The InterruptedException

getName

public java.lang.String getName()
Get the name of the indexer.

Specified by:
getName in interface fr.paris.lutece.portal.service.search.SearchIndexer
Returns:
The name

getVersion

public java.lang.String getVersion()
Get the version of the indexer

Specified by:
getVersion in interface fr.paris.lutece.portal.service.search.SearchIndexer
Returns:
The version number

isEnable

public boolean isEnable()
Get the state of indexer

Specified by:
isEnable in interface fr.paris.lutece.portal.service.search.SearchIndexer
Returns:
Return true if the indexer is enabled, false else.


Copyright © 2010 Mairie de Paris. All Rights Reserved.