1 | <?php |
---|
2 | /*********************************************** |
---|
3 | * File : searchprovider.php |
---|
4 | * Project : Z-Push |
---|
5 | * Descr : The searchprovider can be used to |
---|
6 | * implement an alternative way perform |
---|
7 | * searches. |
---|
8 | * This is a stub implementation. |
---|
9 | * |
---|
10 | * Created : 03.08.2010 |
---|
11 | * |
---|
12 | * Copyright 2007 - 2012 Zarafa Deutschland GmbH |
---|
13 | * |
---|
14 | * This program is free software: you can redistribute it and/or modify |
---|
15 | * it under the terms of the GNU Affero General Public License, version 3, |
---|
16 | * as published by the Free Software Foundation with the following additional |
---|
17 | * term according to sec. 7: |
---|
18 | * |
---|
19 | * According to sec. 7 of the GNU Affero General Public License, version 3, |
---|
20 | * the terms of the AGPL are supplemented with the following terms: |
---|
21 | * |
---|
22 | * "Zarafa" is a registered trademark of Zarafa B.V. |
---|
23 | * "Z-Push" is a registered trademark of Zarafa Deutschland GmbH |
---|
24 | * The licensing of the Program under the AGPL does not imply a trademark license. |
---|
25 | * Therefore any rights, title and interest in our trademarks remain entirely with us. |
---|
26 | * |
---|
27 | * However, if you propagate an unmodified version of the Program you are |
---|
28 | * allowed to use the term "Z-Push" to indicate that you distribute the Program. |
---|
29 | * Furthermore you may use our trademarks where it is necessary to indicate |
---|
30 | * the intended purpose of a product or service provided you use it in accordance |
---|
31 | * with honest practices in industrial or commercial matters. |
---|
32 | * If you want to propagate modified versions of the Program under the name "Z-Push", |
---|
33 | * you may only do so if you have a written permission by Zarafa Deutschland GmbH |
---|
34 | * (to acquire a permission please contact Zarafa at trademark@zarafa.com). |
---|
35 | * |
---|
36 | * This program is distributed in the hope that it will be useful, |
---|
37 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
38 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
39 | * GNU Affero General Public License for more details. |
---|
40 | * |
---|
41 | * You should have received a copy of the GNU Affero General Public License |
---|
42 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
---|
43 | * |
---|
44 | * Consult LICENSE file for details |
---|
45 | ************************************************/ |
---|
46 | |
---|
47 | /********************************************************************* |
---|
48 | * The SearchProvider is a stub to implement own search funtionality |
---|
49 | * |
---|
50 | * If you wish to implement an alternative search method, you should implement the |
---|
51 | * ISearchProvider interface like the BackendSearchLDAP backend |
---|
52 | */ |
---|
53 | class SearchProvider implements ISearchProvider{ |
---|
54 | |
---|
55 | /** |
---|
56 | * Constructor |
---|
57 | * initializes the searchprovider to perform the search |
---|
58 | * |
---|
59 | * @access public |
---|
60 | * @return |
---|
61 | * @throws StatusException, FatalException |
---|
62 | */ |
---|
63 | public function SearchProvider() { |
---|
64 | } |
---|
65 | |
---|
66 | /** |
---|
67 | * Indicates if a search type is supported by this SearchProvider |
---|
68 | * Currently only the type ISearchProvider::SEARCH_GAL (Global Address List) is implemented |
---|
69 | * |
---|
70 | * @param string $searchtype |
---|
71 | * |
---|
72 | * @access public |
---|
73 | * @return boolean |
---|
74 | */ |
---|
75 | public function SupportsType($searchtype) { |
---|
76 | return ($searchtype == ISearchProvider::SEARCH_GAL); |
---|
77 | } |
---|
78 | |
---|
79 | /** |
---|
80 | * Searches the GAL |
---|
81 | * |
---|
82 | * @param string $searchquery string to be searched for |
---|
83 | * @param string $searchrange specified searchrange |
---|
84 | * |
---|
85 | * @access public |
---|
86 | * @return array search results |
---|
87 | * @throws StatusException |
---|
88 | */ |
---|
89 | public function GetGALSearchResults($searchquery, $searchrange) { |
---|
90 | return array(); |
---|
91 | } |
---|
92 | |
---|
93 | /** |
---|
94 | * Searches for the emails on the server |
---|
95 | * |
---|
96 | * @param ContentParameter $cpo |
---|
97 | * |
---|
98 | * @return array |
---|
99 | */ |
---|
100 | public function GetMailboxSearchResults($cpo){ |
---|
101 | return array(); |
---|
102 | } |
---|
103 | |
---|
104 | /** |
---|
105 | * Terminates a search for a given PID |
---|
106 | * |
---|
107 | * @param int $pid |
---|
108 | * |
---|
109 | * @return boolean |
---|
110 | */ |
---|
111 | public function TerminateSearch($pid) { |
---|
112 | return true; |
---|
113 | } |
---|
114 | |
---|
115 | /** |
---|
116 | * Disconnects from the current search provider |
---|
117 | * |
---|
118 | * @access public |
---|
119 | * @return boolean |
---|
120 | */ |
---|
121 | public function Disconnect() { |
---|
122 | return true; |
---|
123 | } |
---|
124 | } |
---|
125 | ?> |
---|