KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > alfresco > repo > search > AbstractSearcherComponent


1 /*
2  * Copyright (C) 2005 Alfresco, Inc.
3  *
4  * Licensed under the Mozilla Public License version 1.1
5  * with a permitted attribution clause. You may obtain a
6  * copy of the License at
7  *
8  * http://www.alfresco.org/legal/license.txt
9  *
10  * Unless required by applicable law or agreed to in writing,
11  * software distributed under the License is distributed on an
12  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
13  * either express or implied. See the License for the specific
14  * language governing permissions and limitations under the
15  * License.
16  */

17 package org.alfresco.repo.search;
18
19 import java.io.Serializable JavaDoc;
20 import java.util.List JavaDoc;
21
22 import org.alfresco.service.cmr.repository.InvalidNodeRefException;
23 import org.alfresco.service.cmr.repository.NodeRef;
24 import org.alfresco.service.cmr.repository.Path;
25 import org.alfresco.service.cmr.repository.StoreRef;
26 import org.alfresco.service.cmr.repository.XPathException;
27 import org.alfresco.service.cmr.search.QueryParameterDefinition;
28 import org.alfresco.service.cmr.search.ResultSet;
29 import org.alfresco.service.cmr.search.SearchService;
30 import org.alfresco.service.namespace.NamespacePrefixResolver;
31 import org.alfresco.util.SearchLanguageConversion;
32
33 /**
34  * Provides basic searcher support
35  *
36  * @author Andy Hind
37  */

38 public abstract class AbstractSearcherComponent implements SearchService
39 {
40     /**
41      * Not implemented, but will eventually map directly to
42      * {@link SearchLanguageConversion}.
43      */

44     protected String JavaDoc translateQuery(String JavaDoc fromLanguage, String JavaDoc toLangage, String JavaDoc query)
45     {
46         throw new UnsupportedOperationException JavaDoc();
47     }
48
49     public ResultSet query(StoreRef store, String JavaDoc language, String JavaDoc query)
50     {
51         return query(store, language, query, null, null);
52     }
53
54     public ResultSet query(StoreRef store, String JavaDoc language, String JavaDoc query,
55             QueryParameterDefinition[] queryParameterDefintions)
56     {
57         return query(store, language, query, null, queryParameterDefintions);
58     }
59
60     public ResultSet query(StoreRef store, String JavaDoc language, String JavaDoc query, Path[] attributePaths)
61     {
62         return query(store, language, query, attributePaths, null);
63     }
64
65     public List JavaDoc<NodeRef> selectNodes(NodeRef contextNodeRef, String JavaDoc xpath, QueryParameterDefinition[] parameters,
66             NamespacePrefixResolver namespacePrefixResolver, boolean followAllParentLinks)
67             throws InvalidNodeRefException, XPathException
68     {
69         return selectNodes(contextNodeRef, xpath, parameters, namespacePrefixResolver, followAllParentLinks,
70                 SearchService.LANGUAGE_XPATH);
71     }
72
73     public List JavaDoc<Serializable JavaDoc> selectProperties(NodeRef contextNodeRef, String JavaDoc xpath,
74             QueryParameterDefinition[] parameters, NamespacePrefixResolver namespacePrefixResolver,
75             boolean followAllParentLinks) throws InvalidNodeRefException, XPathException
76     {
77         return selectProperties(contextNodeRef, xpath, parameters, namespacePrefixResolver, followAllParentLinks,
78                 SearchService.LANGUAGE_XPATH);
79     }
80 }
81
Popular Tags