fr.paris.lutece.plugins.ods.service.search
Class AbstractODSSearchIndexer<GSeance extends ISeance,GSeanceFilter extends ISeanceFilter,GElu extends IElu,GFichier extends IFichier<GSeance,GFichier>,GVoeuAmendement extends IVoeuAmendement<GVoeuAmendement,GSeance,GElu,GFichier,GPDD>,GPDD extends IPDD<GVoeuAmendement,GSeance,GElu,GFichier,GPDD>,GRequeteUtilisateur extends IRequeteUtilisateur<GSeance,GSeanceFilter>,GResultatRequete extends IResultatRequete<GSeance,GSeanceFilter,GRequeteUtilisateur,GElu,GFichier,GVoeuAmendement,GPDD>,GSearchDAO extends ISearchDAO<GFichier,GSeance,GSeanceFilter,GRequeteUtilisateur,GElu,GVoeuAmendement,GPDD>,GFichierFilter extends IFichierFilter,GTypeDocument extends ITypeDocument,GActeFilter extends IActeFilter<GFichier,GSeance>>

java.lang.Object
  extended by fr.paris.lutece.plugins.ods.service.search.AbstractODSSearchIndexer<GSeance,GSeanceFilter,GElu,GFichier,GVoeuAmendement,GPDD,GRequeteUtilisateur,GResultatRequete,GSearchDAO,GFichierFilter,GTypeDocument,GActeFilter>
All Implemented Interfaces:
IODSSearchIndexer, fr.paris.lutece.portal.service.search.SearchIndexer

public abstract class AbstractODSSearchIndexer<GSeance extends ISeance,GSeanceFilter extends ISeanceFilter,GElu extends IElu,GFichier extends IFichier<GSeance,GFichier>,GVoeuAmendement extends IVoeuAmendement<GVoeuAmendement,GSeance,GElu,GFichier,GPDD>,GPDD extends IPDD<GVoeuAmendement,GSeance,GElu,GFichier,GPDD>,GRequeteUtilisateur extends IRequeteUtilisateur<GSeance,GSeanceFilter>,GResultatRequete extends IResultatRequete<GSeance,GSeanceFilter,GRequeteUtilisateur,GElu,GFichier,GVoeuAmendement,GPDD>,GSearchDAO extends ISearchDAO<GFichier,GSeance,GSeanceFilter,GRequeteUtilisateur,GElu,GVoeuAmendement,GPDD>,GFichierFilter extends IFichierFilter,GTypeDocument extends ITypeDocument,GActeFilter extends IActeFilter<GFichier,GSeance>>
extends java.lang.Object
implements fr.paris.lutece.portal.service.search.SearchIndexer, IODSSearchIndexer

ODSSearchIndexer : permet de récupérer les documents pour indexer/supprimer dans/de l'index


Field Summary
protected  ActeHome<GSeance,GFichier,GActeFilter> _acteHome
           
protected  boolean _bArchiveIndexer
           
protected  IFichierHome<GFichier,GFichierFilter,GTypeDocument,GSeance> _fichierHome
           
protected  FichierPhysiqueHome _fichierPhysiqueHome
           
protected  ISearchHome<GFichier,GSeance,GSeanceFilter,GRequeteUtilisateur,GSearchDAO,GElu,GVoeuAmendement,GPDD> _searchHome
           
 
Constructor Summary
AbstractODSSearchIndexer(boolean bArchiveIndexer)
          Constructeur: récupère tous les documents à indexer, soit pour les archives soit pour la prochaine séance
 
Method Summary
protected  java.lang.String getContent(byte[] byteArray, int nIdFichier, int nIdFichierPhysique)
          Retourne le contenu du fichier PDF
 java.lang.String getDescription()
          Retourne la description de l'indexer
 java.util.List<org.apache.lucene.document.Document> getDocuments()
          Récupère la liste des documents
abstract  void getDocuments(org.apache.lucene.index.IndexWriter indexWriter)
          Retourne tous les documents à indexer, autrement dit la liste des documents pour l'initialisation de l'index
Par défaut cette méthode renvoie les documents de la prochaine séance du conseil
 java.util.List<org.apache.lucene.document.Document> getDocuments(java.lang.String arg0)
           
 void getDocumentsAArchiver(int nIdAncienneSeance, org.apache.lucene.index.IndexWriter indexWriter)
          Retourne tous les documents à indexer pour une séance
 void getDocumentsToIndex(org.apache.lucene.index.IndexWriter indexWriter)
          Indexe la liste des documents ajoutés ou modifiés à ajouter dans l'index
protected abstract  void getDocumentsToIndexSpec(org.apache.lucene.index.IndexWriter indexWriter, java.lang.Object object)
           
 java.util.List<org.apache.lucene.document.Document> getDocumentsToRemove()
          Retourne la liste des documents supprimés ou modifiés à supprimer de l'index
protected abstract  void getDocumentsToRemoveSpec(java.util.List<org.apache.lucene.document.Document> listDocs, java.lang.Object object)
           
 java.lang.String getName()
          Retourne le nom de l'indexer
protected abstract  java.lang.String getTypePDDSpec(GPDD pdd)
           
 java.lang.String getVersion()
          Retourne la version de l'indexer
protected  java.util.List<org.apache.lucene.document.Document> indexAllDocumentsDeliberationDesignation(fr.paris.lutece.portal.service.plugin.Plugin plugin, org.apache.lucene.index.IndexWriter indexWriter)
          Retourne la liste des documents Lucene créés à partir des délibérations de désignation de la base
protected  void indexAllDocumentsFichier(fr.paris.lutece.portal.service.plugin.Plugin plugin, org.apache.lucene.index.IndexWriter indexWriter)
          Indexe la liste de tous les fichiers à indexer dans les archives
protected  void indexAllDocumentsFichiersAArchiver(int nIdAncienneSeance, fr.paris.lutece.portal.service.plugin.Plugin plugin, org.apache.lucene.index.IndexWriter indexWriter)
          Indexe la liste des documents Lucene correspondant aux "autres documents" de séance
protected  java.util.List<org.apache.lucene.document.Document> indexAllDocumentsPDDs(GSeance prochaineSeance, fr.paris.lutece.portal.service.plugin.Plugin plugin, org.apache.lucene.index.IndexWriter indexWriter)
          Retourne la liste des documents Lucene créés à partir des PDD de la base
protected abstract  void indexAllDocumentsSpec(GSeance prochaineSeance, fr.paris.lutece.portal.service.plugin.Plugin plugin, org.apache.lucene.index.IndexWriter indexWriter)
           
protected  void indexAllDocumentsVAsAArchiver(int nIdAncienneSeance, fr.paris.lutece.portal.service.plugin.Plugin plugin, org.apache.lucene.index.IndexWriter indexWriter)
          Indexe la liste des documents Lucene correspondant aux VAs à ajouter dans l'index des archives
protected  void indexAllDocumentsVoeuAmendement(GSeance prochaineSeance, fr.paris.lutece.portal.service.plugin.Plugin plugin, org.apache.lucene.index.IndexWriter indexWriter)
          Indexe la liste des documents Lucene créé à partir des VoeuAmendement de la base
protected  void indexArreteDocument(Arrete<GSeance,GFichier> arrete, org.apache.lucene.index.IndexWriter indexWriter)
          Indexe le document Lucene correspondant à l'arreté
protected  void indexDeliberationDocument(IDeliberationDesignation<GSeance,GFichier> deliberation, org.apache.lucene.index.IndexWriter indexWriter)
          Indexe le document Lucene correspondant à la délibération de désignation
 void indexDocuments()
           
protected  void indexFichierDocument(GFichier fichier, org.apache.lucene.index.IndexWriter indexWriter)
          Indexe le document Lucene correspondant au fichier
protected  void indexPDDDocuments(GPDD pdd, org.apache.lucene.index.IndexWriter indexWriter)
          Indexe la liste des documents du PDD, c'est à dire le PDD lui-même et tous ses fichiers
protected  void indexVADocument(GVoeuAmendement va, org.apache.lucene.index.IndexWriter indexWriter)
          Indexe le document correspondant au voeu ou amendement
 boolean isEnable()
          Indique si l'indexer est actif ou non
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_bArchiveIndexer

protected boolean _bArchiveIndexer

_searchHome

protected ISearchHome<GFichier extends IFichier<GSeance,GFichier>,GSeance extends ISeance,GSeanceFilter extends ISeanceFilter,GRequeteUtilisateur extends IRequeteUtilisateur<GSeance,GSeanceFilter>,GSearchDAO extends ISearchDAO<GFichier,GSeance,GSeanceFilter,GRequeteUtilisateur,GElu,GVoeuAmendement,GPDD>,GElu extends IElu,GVoeuAmendement extends IVoeuAmendement<GVoeuAmendement,GSeance,GElu,GFichier,GPDD>,GPDD extends IPDD<GVoeuAmendement,GSeance,GElu,GFichier,GPDD>> _searchHome

_fichierHome

protected IFichierHome<GFichier extends IFichier<GSeance,GFichier>,GFichierFilter extends IFichierFilter,GTypeDocument extends ITypeDocument,GSeance extends ISeance> _fichierHome

_fichierPhysiqueHome

protected FichierPhysiqueHome _fichierPhysiqueHome

_acteHome

protected ActeHome<GSeance extends ISeance,GFichier extends IFichier<GSeance,GFichier>,GActeFilter extends IActeFilter<GFichier,GSeance>> _acteHome
Constructor Detail

AbstractODSSearchIndexer

public AbstractODSSearchIndexer(boolean bArchiveIndexer)
Constructeur: récupère tous les documents à indexer, soit pour les archives soit pour la prochaine séance

Parameters:
bArchiveIndexer - le SearchIndexer agit sur les archives ou la prochaine séance
Method Detail

indexAllDocumentsSpec

protected abstract void indexAllDocumentsSpec(GSeance prochaineSeance,
                                              fr.paris.lutece.portal.service.plugin.Plugin plugin,
                                              org.apache.lucene.index.IndexWriter indexWriter)

getDocumentsToIndexSpec

protected abstract void getDocumentsToIndexSpec(org.apache.lucene.index.IndexWriter indexWriter,
                                                java.lang.Object object)

getTypePDDSpec

protected abstract java.lang.String getTypePDDSpec(GPDD pdd)

getDocuments

public abstract void getDocuments(org.apache.lucene.index.IndexWriter indexWriter)
                           throws java.io.IOException,
                                  java.lang.InterruptedException
Description copied from interface: IODSSearchIndexer
Retourne tous les documents à indexer, autrement dit la liste des documents pour l'initialisation de l'index
Par défaut cette méthode renvoie les documents de la prochaine séance du conseil

Specified by:
getDocuments in interface IODSSearchIndexer
Parameters:
indexWriter - l'index
Throws:
java.io.IOException - exception héritée de fr.paris.lutece.portal.service.search.SearchIndexer
java.lang.InterruptedException - exception héritée de fr.paris.lutece.portal.service.search.SearchIndexer

indexAllDocumentsPDDs

protected java.util.List<org.apache.lucene.document.Document> indexAllDocumentsPDDs(GSeance prochaineSeance,
                                                                                    fr.paris.lutece.portal.service.plugin.Plugin plugin,
                                                                                    org.apache.lucene.index.IndexWriter indexWriter)
Retourne la liste des documents Lucene créés à partir des PDD de la base

Parameters:
prochaineSeance - la prochaine séance
plugin - le plugin ODS
indexWriter - l'index
Returns:
la liste des documents Lucene créés à partir des PDD de la base

indexAllDocumentsDeliberationDesignation

protected java.util.List<org.apache.lucene.document.Document> indexAllDocumentsDeliberationDesignation(fr.paris.lutece.portal.service.plugin.Plugin plugin,
                                                                                                       org.apache.lucene.index.IndexWriter indexWriter)
Retourne la liste des documents Lucene créés à partir des délibérations de désignation de la base

Parameters:
plugin - le plugin ODS
indexWriter - l'index
Returns:
la liste des documents Lucene créés à partir des délibérations de désignation de la base

indexAllDocumentsVoeuAmendement

protected void indexAllDocumentsVoeuAmendement(GSeance prochaineSeance,
                                               fr.paris.lutece.portal.service.plugin.Plugin plugin,
                                               org.apache.lucene.index.IndexWriter indexWriter)
Indexe la liste des documents Lucene créé à partir des VoeuAmendement de la base

Parameters:
prochaineSeance - la prochaine séance
plugin - le plugin ODS
indexWriter - l'index

indexAllDocumentsFichier

protected void indexAllDocumentsFichier(fr.paris.lutece.portal.service.plugin.Plugin plugin,
                                        org.apache.lucene.index.IndexWriter indexWriter)
Indexe la liste de tous les fichiers à indexer dans les archives

Parameters:
plugin - le plugin ODS
indexWriter - l'index

getDocumentsAArchiver

public void getDocumentsAArchiver(int nIdAncienneSeance,
                                  org.apache.lucene.index.IndexWriter indexWriter)
Description copied from interface: IODSSearchIndexer
Retourne tous les documents à indexer pour une séance

Specified by:
getDocumentsAArchiver in interface IODSSearchIndexer
Parameters:
nIdAncienneSeance - l'id de la dernière séance passée
indexWriter - l'index

indexAllDocumentsVAsAArchiver

protected void indexAllDocumentsVAsAArchiver(int nIdAncienneSeance,
                                             fr.paris.lutece.portal.service.plugin.Plugin plugin,
                                             org.apache.lucene.index.IndexWriter indexWriter)
Indexe la liste des documents Lucene correspondant aux VAs à ajouter dans l'index des archives

Parameters:
nIdAncienneSeance - l'id de la dernière séance
plugin - le plugin
indexWriter - l'index

indexAllDocumentsFichiersAArchiver

protected void indexAllDocumentsFichiersAArchiver(int nIdAncienneSeance,
                                                  fr.paris.lutece.portal.service.plugin.Plugin plugin,
                                                  org.apache.lucene.index.IndexWriter indexWriter)
Indexe la liste des documents Lucene correspondant aux "autres documents" de séance

Parameters:
nIdAncienneSeance - l'id de la dernière séance passée
plugin - le plugin
indexWriter - l'index

indexPDDDocuments

protected void indexPDDDocuments(GPDD pdd,
                                 org.apache.lucene.index.IndexWriter indexWriter)
Indexe la liste des documents du PDD, c'est à dire le PDD lui-même et tous ses fichiers

Parameters:
pdd - l'objet pdd
indexWriter - l'index

indexVADocument

protected void indexVADocument(GVoeuAmendement va,
                               org.apache.lucene.index.IndexWriter indexWriter)
Indexe le document correspondant au voeu ou amendement

Parameters:
va - le voeu ou amendement
indexWriter - l'index

indexFichierDocument

protected void indexFichierDocument(GFichier fichier,
                                    org.apache.lucene.index.IndexWriter indexWriter)
Indexe le document Lucene correspondant au fichier

Parameters:
fichier - le fichier
indexWriter - l'index

indexArreteDocument

protected void indexArreteDocument(Arrete<GSeance,GFichier> arrete,
                                   org.apache.lucene.index.IndexWriter indexWriter)
Indexe le document Lucene correspondant à l'arreté

Parameters:
arrete - l'arrete
indexWriter - l'index

indexDeliberationDocument

protected void indexDeliberationDocument(IDeliberationDesignation<GSeance,GFichier> deliberation,
                                         org.apache.lucene.index.IndexWriter indexWriter)
Indexe le document Lucene correspondant à la délibération de désignation

Parameters:
deliberation - la délibération
indexWriter - l'index

getDocumentsToRemove

public java.util.List<org.apache.lucene.document.Document> getDocumentsToRemove()
Description copied from interface: IODSSearchIndexer
Retourne la liste des documents supprimés ou modifiés à supprimer de l'index

Specified by:
getDocumentsToRemove in interface IODSSearchIndexer
Returns:
une liste de documents

getDocumentsToRemoveSpec

protected abstract void getDocumentsToRemoveSpec(java.util.List<org.apache.lucene.document.Document> listDocs,
                                                 java.lang.Object object)

getDocumentsToIndex

public void getDocumentsToIndex(org.apache.lucene.index.IndexWriter indexWriter)
Description copied from interface: IODSSearchIndexer
Indexe la liste des documents ajoutés ou modifiés à ajouter dans l'index

Specified by:
getDocumentsToIndex in interface IODSSearchIndexer
Parameters:
indexWriter - l'index

getContent

protected java.lang.String getContent(byte[] byteArray,
                                      int nIdFichier,
                                      int nIdFichierPhysique)
Retourne le contenu du fichier PDF

Parameters:
byteArray - le contenu du fichier PDF
nIdFichier - l'identifiant du fichier
nIdFichierPhysique - l'identifiant du fichier physique
Returns:
le contenu du fichier

getDescription

public java.lang.String getDescription()
Description copied from interface: IODSSearchIndexer
Retourne la description de l'indexer

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

getName

public java.lang.String getName()
Description copied from interface: IODSSearchIndexer
Retourne le nom de l'indexer

Specified by:
getName in interface IODSSearchIndexer
Specified by:
getName in interface fr.paris.lutece.portal.service.search.SearchIndexer
Returns:
le nom de l'indexer

getVersion

public java.lang.String getVersion()
Description copied from interface: IODSSearchIndexer
Retourne la version de l'indexer

Specified by:
getVersion in interface IODSSearchIndexer
Specified by:
getVersion in interface fr.paris.lutece.portal.service.search.SearchIndexer
Returns:
la version de l'indexer

isEnable

public boolean isEnable()
Description copied from interface: IODSSearchIndexer
Indique si l'indexer est actif ou non

Specified by:
isEnable in interface IODSSearchIndexer
Specified by:
isEnable in interface fr.paris.lutece.portal.service.search.SearchIndexer
Returns:
true si l'indexer est actif, false sinon

getDocuments

public java.util.List<org.apache.lucene.document.Document> getDocuments()
                                                                 throws java.io.IOException,
                                                                        java.lang.InterruptedException,
                                                                        fr.paris.lutece.portal.service.message.SiteMessageException
Description copied from interface: IODSSearchIndexer
Récupère la liste des documents

Specified by:
getDocuments in interface IODSSearchIndexer
Returns:
la liste des documents
Throws:
java.io.IOException - IOException
java.lang.InterruptedException - InterruptedException
fr.paris.lutece.portal.service.message.SiteMessageException - SiteMessageException

getDocuments

public java.util.List<org.apache.lucene.document.Document> getDocuments(java.lang.String arg0)
                                                                 throws java.io.IOException,
                                                                        java.lang.InterruptedException,
                                                                        fr.paris.lutece.portal.service.message.SiteMessageException
Specified by:
getDocuments in interface IODSSearchIndexer
Specified by:
getDocuments in interface fr.paris.lutece.portal.service.search.SearchIndexer
Throws:
java.io.IOException
java.lang.InterruptedException
fr.paris.lutece.portal.service.message.SiteMessageException

indexDocuments

public void indexDocuments()
                    throws java.io.IOException,
                           java.lang.InterruptedException,
                           fr.paris.lutece.portal.service.message.SiteMessageException
Specified by:
indexDocuments in interface IODSSearchIndexer
Specified by:
indexDocuments in interface fr.paris.lutece.portal.service.search.SearchIndexer
Throws:
java.io.IOException
java.lang.InterruptedException
fr.paris.lutece.portal.service.message.SiteMessageException


Copyright © 2010 Mairie de Paris. All Rights Reserved.