KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > cocoon > components > search > LuceneXMLIndexer


1 /*
2  * Copyright 1999-2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package org.apache.cocoon.components.search;
17
18 import org.apache.avalon.framework.component.Component;
19 import org.apache.cocoon.ProcessingException;
20
21 import java.net.URL JavaDoc;
22 import java.util.List JavaDoc;
23
24 /**
25  * The avalon behavioural component interface of generating
26  * lucene documents from an xml content.
27  *
28  * <p>
29  * The well-known fields of a lucene documents are defined as
30  * <code>*_FIELD</code> constants.
31  * </p>
32  * <p>
33  * You may access generated lucene documents via
34  * <code>allDocuments()</code>, or <code>iterator()</code>.
35  * </p>
36  * <p>
37  * You trigger the generating of lucene documents via
38  * <code>build()</code>.
39  * </p>
40  *
41  * @author <a HREF="mailto:berni_huber@a1.net">Bernhard Huber</a>
42  * @version CVS $Id: LuceneXMLIndexer.java 30932 2004-07-29 17:35:38Z vgritsenko $
43  */

44 public interface LuceneXMLIndexer extends Component
45 {
46
47     /**
48      * The ROLE name of this avalon component.
49      * <p>
50      * Its value if the FQN of this interface,
51      * ie. <code>org.apache.cocoon.components.search.LuceneXMLIndexer</code>.
52      * </p>
53      *
54      * @since
55      */

56     String JavaDoc ROLE = "org.apache.cocoon.components.search.LuceneXMLIndexer";
57
58     /**
59      * A Lucene document field name, containing xml content text of all xml elements.
60      * <p>
61      * A concrete implementation of this interface SHOULD
62      * provides a field named body.
63      * </p>
64      * <p>
65      * A concrete implementation MAY provide additional lucene
66      * document fields.
67      * </p>
68      *
69      * @since
70      */

71     String JavaDoc BODY_FIELD = "body";
72
73     /**
74      * A Lucene document field name, containg the URI/URL of the indexed
75      * document.
76      * <p>
77      * A concrete implementation of this interface SHOULD
78      * provide a field named url.
79      * </p>
80      *
81      * @since
82      */

83     String JavaDoc URL_FIELD = "url";
84
85     /**
86      * A Lucene document field name, containg the a unique key of the indexed
87      * document.
88      * <p>
89      * This document field is used internally to track document
90      * changes, and updates.
91      * </p>
92      * <p>
93      * A concrete implementation of this interface SHOULD
94      * provide a field named uid.
95      * </p>
96      *
97      * @since
98      */

99     String JavaDoc UID_FIELD = "uid";
100
101     /**
102      * Build lucene documents from a URL.
103      * <p>
104      * This method will read the content of the URL, and generates
105      * one or more lucene documents. The generated lucence documents
106      * can be fetched using methods allDocuments(), and iterator().
107      * </p>
108      *
109      * @param url the content of this url gets indexed.
110      * @exception ProcessingException Description of Exception
111      * @since
112      */

113     List JavaDoc build(URL JavaDoc url) throws ProcessingException;
114 }
115
Popular Tags