Index: topia2/src/java/org/codelutin/topia/TopiaContext.java diff -u topia2/src/java/org/codelutin/topia/TopiaContext.java:1.16 topia2/src/java/org/codelutin/topia/TopiaContext.java:1.17 --- topia2/src/java/org/codelutin/topia/TopiaContext.java:1.16 Mon Oct 9 14:20:18 2006 +++ topia2/src/java/org/codelutin/topia/TopiaContext.java Fri Oct 13 12:20:00 2006 @@ -23,9 +23,9 @@ * Created: 3 janv. 2006 21:18:34 * * @author poussin - * @version $Revision: 1.16 $ + * @version $Revision: 1.17 $ * - * Last update: $Date: 2006/10/09 14:20:18 $ + * Last update: $Date: 2006/10/13 12:20:00 $ * by : $Author: bpoussin $ */ @@ -41,7 +41,6 @@ import org.codelutin.topia.event.TopiaTransactionListener; import org.codelutin.topia.event.TopiaVetoableEntityListener; import org.codelutin.topia.event.TopiaVetoableEntityLoadListener; -import org.codelutin.topia.framework.IndexEngin; import org.codelutin.topia.persistence.TopiaEntity; import org.codelutin.topia.security.TopiaSecurityManager; @@ -239,7 +238,10 @@ public boolean isIndexEnabled(); - public IndexEngin getIndexEngin(); + /** + * Renvoie le moteur d'indexation, s'il n'y en a pas retourne null + */ + public IndexEnginService getIndexEngin(); /** * Renvoie le TopiaSecurityManager indiqué dans les propriétés. Si le type de Index: topia2/src/java/org/codelutin/topia/IndexEnginService.java diff -u /dev/null topia2/src/java/org/codelutin/topia/IndexEnginService.java:1.1 --- /dev/null Fri Oct 13 12:20:05 2006 +++ topia2/src/java/org/codelutin/topia/IndexEnginService.java Fri Oct 13 12:20:00 2006 @@ -0,0 +1,85 @@ +/* *##% + * Copyright (C) 2006 + * Code Lutin, Cédric Pineau, Benjamin Poussin + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + *##%*/ + +/* * + * IndexEngin.java + * + * Created: 8 oct. 06 17:15:00 + * + * @author poussin + * @version $Revision: 1.1 $ + * + * Last update: $Date: 2006/10/13 12:20:00 $ + * by : $Author: bpoussin $ + */ + +package org.codelutin.topia; + +import java.util.Map; +import java.util.SortedSet; + +import org.codelutin.topia.framework.TopiaService; +import org.codelutin.topia.index.IndexEntry; + + +/** + * User visible interface for indexation engin + * + * To use indexer you must have properties defined in config file: + *
  • topia.index.engin=[class used to indexation] + *
  • possible specific property for index engin used + * + * Usage example: + *
    + * SortedSet<IndexEntry> result = context.getIndexEngin().search("quelque chose")
    + * SortedSet<IndexEntry> result = context.getIndexEngin().search("class:org.codelutin.chorem.entities.Person name:poussin")
    + * // or with map 
    + * Map m = new HashMap();
    + * m.put("class", "org.codelutin.chorem.entities.Person");
    + * m.put("name", "poussin");
    + * SortedSet<IndexEntry> result = context.getIndexEngin().search(m);
    + * 
    + * + + * @author poussin + */ +public interface IndexEnginService extends TopiaService { + + /** + * Permet de faire une recherche, par exemple: + * + * class:org.codelutin.chorem.entities.Person name:poussin + * + * @param queryText + * @return une list triée, le premier élement a le plus gros score + */ + public SortedSet search(String queryText); + + /** + * Permet de faire une recherche + * + * @param query la cle de la map est le nom du champ sur lequel faire la + * recherche, et la valeur la valeur souhaitée pour ce champs + * @return une list triée, le premier élement a le plus gros score + */ + public SortedSet search(Map query); + +} + +