KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > ivata > groupware > business > search > SearchEngine


1 /*
2  * Copyright (c) 2001 - 2005 ivata limited.
3  * All rights reserved.
4  * -----------------------------------------------------------------------------
5  * ivata groupware may be redistributed under the GNU General Public
6  * License as published by the Free Software Foundation;
7  * version 2 of the License.
8  *
9  * These programs are free software; you can redistribute them and/or
10  * modify them under the terms of the GNU General Public License
11  * as published by the Free Software Foundation; version 2 of the License.
12  *
13  * These programs are distributed in the hope that they will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16  *
17  * See the GNU General Public License in the file LICENSE.txt for more
18  * details.
19  *
20  * If you would like a copy of the GNU General Public License write to
21  *
22  * Free Software Foundation, Inc.
23  * 59 Temple Place - Suite 330
24  * Boston, MA 02111-1307, USA.
25  *
26  *
27  * To arrange commercial support and licensing, contact ivata at
28  * http://www.ivata.com/contact.jsp
29  * -----------------------------------------------------------------------------
30  * $Log: SearchEngine.java,v $
31  * Revision 1.4 2005/04/29 02:48:20 colinmacleod
32  * Data bugfixes.
33  * Changed primary key back to Integer.
34  *
35  * Revision 1.3 2005/04/10 20:09:47 colinmacleod
36  * Added new themes.
37  * Changed id type to String.
38  * Changed i tag to em and b tag to strong.
39  * Improved PicoContainerFactory with NanoContainer scripts.
40  *
41  * Revision 1.2 2005/04/09 17:19:55 colinmacleod
42  * Changed copyright text to GPL v2 explicitly.
43  *
44  * Revision 1.1.1.1 2005/03/10 17:52:38 colinmacleod
45  * Restructured ivata op around Hibernate/PicoContainer.
46  * Renamed ivata groupware.
47  *
48  * Revision 1.2 2004/11/12 15:57:17 colinmacleod
49  * Removed dependencies on SSLEXT.
50  * Moved Persistence classes to ivata masks.
51  *
52  * Revision 1.1 2004/08/01 11:40:30 colinmacleod
53  * Moved search classes to separate subproject.
54  *
55  * Revision 1.1 2004/07/13 19:47:29 colinmacleod
56  * Moved project to POJOs from EJBs.
57  * Applied PicoContainer to services layer (replacing session EJBs).
58  * Applied Hibernate to persistence layer (replacing entity EJBs).
59  * -----------------------------------------------------------------------------
60  */

61 package com.ivata.groupware.business.search;
62
63 import java.util.SortedSet JavaDoc;
64
65 import com.ivata.groupware.admin.security.server.SecuritySession;
66 import com.ivata.mask.util.SystemException;
67
68 /**
69  * @author Colin MacLeod
70  * <a HREF='mailto:colin.macleod@ivata.com'>colin.macleod@ivata.com</a>
71  * @since Apr 9, 2004
72  * @version $Revision: 1.4 $
73  */

74 public interface SearchEngine {
75     /**
76      * <p>removes an item or part of an item from index</p>
77      * @param type one of {@link: SearchConstant SearchContant}s values
78      * @param id the id of the document, when null, all entries for {@see:item
79      * item } will be removed
80      * @param item the item id of the library item which this document relates to
81      */

82     public void removeFromIndex(SecuritySession securitySession,
83             final String JavaDoc type,
84             final String JavaDoc id,
85             final String JavaDoc category)
86         throws SystemException;
87     /**
88      * <p>searches the index for the given query, returns appropriate DOs as a
89      * <code>Vector</code>, most relevant documents first</p>
90      * @param query the query of one or more space-separated words
91      * @param topic the id of the topic of the wanted documents, <code>null</code>
92      * when the all topics should be searched
93      * @param filter <code>Collection</code> of {@link: SearchConstant SearchContant}s,
94      * describing what parts of the system to search, when <code>null</code>,
95      * search is performed on all kinds of documents
96      * @return <code>Vector</code> of appropriate DOs,
97      * most relevant documents first
98      *
99      * @ejb.interface-method
100      * view-type = "both"
101      */

102     public SortedSet JavaDoc search(final SecuritySession securitySession,
103             final String JavaDoc query)
104         throws SystemException;
105     /**
106      * <p>stems the text content and indexes the document with the provided type
107      * {@see SearchConstants} and id</p>
108      * @param integerParam the id of the document - subpart of a library item,
109      * used as reference when searching
110      * @param type one of {@link: SearchConstant SearchContant}s values
111      * @param integer2Param TODO
112      * @param contentType TODO
113      * @param text the content (HTML is converted to plain text) of the document
114      * @param topic the id of the topic of this document, <code>null</code> when
115      * this document has no topic asscociated
116      * @param item the item id of the library item which this document relates to
117      * @param textType format of the text, see
118      * {@link com.ivata.intranet.jsp.format.FormatConstants}
119      */

120     public void updateIndex(SecuritySession securitySession,
121             Integer JavaDoc integerParam,
122             final String JavaDoc type,
123             final String JavaDoc category,
124             Integer JavaDoc integer2Param,
125             final String JavaDoc contentType,
126             final String JavaDoc text, int format)
127             throws SystemException;
128 }
Popular Tags