KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > opencms > search > documents > I_CmsDocumentFactory


1 /*
2  * File : $Source: /usr/local/cvs/opencms/src/org/opencms/search/documents/I_CmsDocumentFactory.java,v $
3  * Date : $Date: 2005/06/23 11:11:29 $
4  * Version: $Revision: 1.24 $
5  *
6  * This library is part of OpenCms -
7  * the Open Source Content Mananagement System
8  *
9  * Copyright (c) 2005 Alkacon Software GmbH (http://www.alkacon.com)
10  *
11  * This library is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU Lesser General Public
13  * License as published by the Free Software Foundation; either
14  * version 2.1 of the License, or (at your option) any later version.
15  *
16  * This library is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19  * Lesser General Public License for more details.
20  *
21  * For further information about Alkacon Software GmbH, please see the
22  * company website: http://www.alkacon.com
23  *
24  * For further information about OpenCms, please see the
25  * project website: http://www.opencms.org
26  *
27  * You should have received a copy of the GNU Lesser General Public
28  * License along with this library; if not, write to the Free Software
29  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
30  */

31
32 package org.opencms.search.documents;
33
34 import org.opencms.file.CmsObject;
35 import org.opencms.main.CmsException;
36 import org.opencms.search.A_CmsIndexResource;
37
38 import java.util.List JavaDoc;
39
40 import org.apache.lucene.document.Document;
41
42 /**
43  * Implementation interface for lucene document factories used in OpenCms.<p>
44  *
45  * @author Carsten Weinholz
46  * @author Thomas Weckert
47  *
48  * @version $Revision: 1.24 $
49  *
50  * @since 6.0.0
51  */

52 public interface I_CmsDocumentFactory extends I_CmsSearchExtractor {
53
54     /** Contains the (optional) category of the document. */
55     String JavaDoc DOC_CATEGORY = "category";
56
57     /** Search field for document content. */
58     String JavaDoc DOC_CONTENT = "content";
59
60     /** Search field for document creation date. */
61     String JavaDoc DOC_DATE_CREATED = "created";
62
63     /** Search field for document last update. */
64     String JavaDoc DOC_DATE_LASTMODIFIED = "lastmodified";
65
66     /** Search field for document description. */
67     String JavaDoc DOC_DESCRIPTION = "description";
68
69     /** Search field for document keywords. */
70     String JavaDoc DOC_KEYWORDS = "keywords";
71
72     /** Combines all document "meta" information, that is "title", "keywords" and "description". */
73     String JavaDoc DOC_META = "meta";
74
75     /** Contains the document root path in the VFS. */
76     String JavaDoc DOC_PATH = "path";
77
78     /** Contains the (optional) document priority, which can be used to boost the document in the result list. */
79     String JavaDoc DOC_PRIORITY = "priority";
80
81     /** Contains a special format of the document root path in the VFS for optimized searches. */
82     String JavaDoc DOC_ROOT = "root";
83
84     /** Contains the document title in an analyzed form used for searching in the title. */
85     String JavaDoc DOC_TITLE_INDEXED = "title";
86
87     /** Contains the document title as a keyword used for sorting and also for retrieving the title text. */
88     String JavaDoc DOC_TITLE_KEY = "title-key";
89
90     /** Contains the type of the document. */
91     String JavaDoc DOC_TYPE = "type";
92
93     /** Value for "high" search priority. */
94     String JavaDoc SEARCH_PRIORITY_HIGH_VALUE = "high";
95
96     /** Value for "low" search priority. */
97     String JavaDoc SEARCH_PRIORITY_LOW_VALUE = "low";
98
99     /** Value for "maximum" search priority. */
100     String JavaDoc SEARCH_PRIORITY_MAX_VALUE = "max";
101
102     /** Value for "normal" search priority. */
103     String JavaDoc SEARCH_PRIORITY_NORMAL_VALUE = "normal";
104
105     /**
106      * Returns the document key for the search manager.<p>
107      *
108      * @param resourceType the resource type to get the document key for
109      * @return the document key for the search manager
110      * @throws CmsException if something goes wrong
111      */

112     String JavaDoc getDocumentKey(String JavaDoc resourceType) throws CmsException;
113
114     /**
115      * Returns a list of document keys for the documenttype.<p>
116      *
117      * The list of accepted resource types may contain a catch-all entry "*";
118      * in this case, a list for all possible resource types is returned,
119      * calculated by a logic depending on the document handler class.<p>
120      *
121      * @param resourceTypes list of accepted resource types
122      * @param mimeTypes list of accepted mime types
123      * @return a list of document keys for this document factory
124      * @throws CmsException if something goes wrong
125      */

126     List JavaDoc getDocumentKeys(List JavaDoc resourceTypes, List JavaDoc mimeTypes) throws CmsException;
127
128     /**
129      * Returns the name of the documenttype.<p>
130      *
131      * @return the name of the documenttype
132      */

133     String JavaDoc getName();
134
135     /**
136      * Creates a new instance of a lucene document type for the concrete file type.<p>
137      *
138      * @param cms the cms object
139      * @param resource a cms resource
140      * @param language the requested language
141      * @return a lucene document for the given resource
142      * @throws CmsException if something goes wrong
143      */

144     Document newInstance(CmsObject cms, A_CmsIndexResource resource, String JavaDoc language) throws CmsException;
145 }
Popular Tags