001 /*
002 *
003 * $Revision: 13085 $ $Date: 2008-02-06 18:27:24 +0100 (Mi, 06 Feb 2008) $
004 *
005 * This file is part of *** M y C o R e ***
006 * See http://www.mycore.de/ for details.
007 *
008 * This program is free software; you can use it, redistribute it
009 * and / or modify it under the terms of the GNU General Public License
010 * (GPL) as published by the Free Software Foundation; either version 2
011 * of the License or (at your option) any later version.
012 *
013 * This program is distributed in the hope that it will be useful, but
014 * WITHOUT ANY WARRANTY; without even the implied warranty of
015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
016 * GNU General Public License for more details.
017 *
018 * You should have received a copy of the GNU General Public License
019 * along with this program, in a file called gpl.txt or license.txt.
020 * If not, write to the Free Software Foundation Inc.,
021 * 59 Temple Place - Suite 330, Boston, MA 02111-1307 USA
022 */
023
024 package org.mycore.services.plugins;
025
026 import java.io.InputStream;
027 import java.io.Reader;
028 import java.util.HashSet;
029
030 import org.mycore.datamodel.ifs.MCRFileContentType;
031
032 /**
033 * The Plugin spec for filtering several documents for the fulltext search. A
034 * class implementing this interface may throw a
035 * FilterPluginInstantiationException if it fails to initialize correctly and
036 * though is not usable.
037 *
038 * @author Thomas Scheffler (yagee)
039 */
040 public interface TextFilterPlugin {
041 /**
042 * should return a Name of the plugin
043 *
044 * @return Plugin name
045 */
046 public String getName();
047
048 /**
049 * should return the major version number
050 *
051 * @return major version number
052 */
053 public int getMajorNumber();
054
055 /**
056 * should return the minor version number
057 *
058 * @return minor version number
059 */
060 public int getMinorNumber();
061
062 /**
063 * may contain some additional Information on the plugin
064 *
065 * @return further Informations on the plugin
066 */
067 public String getInfo();
068
069 /**
070 * returns a list of all supported MCRFileContentTypes.
071 *
072 * These file extensions must be delivered without the leading dot.
073 *
074 * @return HashSet List of file extensions
075 */
076 public HashSet getSupportedContentTypes();
077
078 /**
079 * onverts a given Inputstream to Textstream which should contain a textual
080 * representation of the source.
081 *
082 * @param input
083 * File in foreign format
084 * @return Inputstream textual representation of input
085 */
086 public Reader transform(MCRFileContentType ct, InputStream input) throws FilterPluginTransformException;
087 }