KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > alfresco > repo > template > LuceneSearchResultsMap


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.template;
18
19 import java.io.StringReader JavaDoc;
20
21 import org.alfresco.error.AlfrescoRuntimeException;
22 import org.alfresco.model.ContentModel;
23 import org.alfresco.service.ServiceRegistry;
24 import org.alfresco.service.cmr.repository.ContentReader;
25 import org.alfresco.service.cmr.repository.NodeRef;
26 import org.alfresco.service.cmr.repository.TemplateNode;
27 import org.dom4j.Document;
28 import org.dom4j.Element;
29 import org.dom4j.io.SAXReader;
30
31 /**
32  * Provides functionality to execute a Lucene search string and return TemplateNode objects.
33  *
34  * @author Kevin Roast
35  */

36 public class LuceneSearchResultsMap extends BaseSearchResultsMap
37 {
38     /**
39      * Constructor
40      *
41      * @param parent The parent TemplateNode to execute searches from
42      * @param services The ServiceRegistry to use
43      */

44     public LuceneSearchResultsMap(TemplateNode parent, ServiceRegistry services)
45     {
46         super(parent, services);
47     }
48
49     /**
50      * @see org.alfresco.repo.template.BaseTemplateMap#get(java.lang.Object)
51      */

52     public Object JavaDoc get(Object JavaDoc key)
53     {
54         // execute the search
55
return query(key.toString());
56     }
57 }
58
Popular Tags