KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > opencms > search > CmsSearchDocumentType


1 /*
2  * File : $Source: /usr/local/cvs/opencms/src/org/opencms/search/CmsSearchDocumentType.java,v $
3  * Date : $Date: 2005/07/03 09:41:51 $
4  * Version: $Revision: 1.10 $
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;
33
34 import java.util.ArrayList JavaDoc;
35 import java.util.List JavaDoc;
36
37 /**
38  * A document type specifies which document factory class is used to pull the
39  * content of an OpenCms document into a Lucene index document.<p>
40  *
41  * The appropriate document factory class gets triggerd while the search index is built
42  * for OpenCms documents matching the specified resource type and/or mimetype combination
43  * in a document factory class instance.<p>
44  *
45  * @author Thomas Weckert
46  *
47  * @version $Revision: 1.10 $
48  *
49  * @since 6.0.0
50  */

51 public class CmsSearchDocumentType implements Cloneable JavaDoc {
52
53     /** The name of the document factory class. */
54     private String JavaDoc m_className;
55
56     /** The mimetype to trigger the document factory class. */
57     private List JavaDoc m_mimeTypes;
58
59     /** The logical key/name of this document type. */
60     private String JavaDoc m_name;
61
62     /** A list of Cms resource types to trigger the document factory. */
63     private List JavaDoc m_resourceTypes;
64
65     /**
66      * Default constructor.<p>
67      */

68     public CmsSearchDocumentType() {
69
70         m_resourceTypes = new ArrayList JavaDoc();
71         m_mimeTypes = new ArrayList JavaDoc();
72     }
73
74     /**
75      * Returns the name of the document factory class.<p>
76      *
77      * @return the name of the document factory class
78      */

79     public String JavaDoc getClassName() {
80
81         return m_className;
82     }
83
84     /**
85      * Returns the mimetypes to trigger the document factory class.<p>
86      *
87      * @return the mimetypes to trigger the document factory class
88      */

89     public List JavaDoc getMimeTypes() {
90
91         return m_mimeTypes;
92     }
93
94     /**
95      * Returns the logical key/name of this document type.<p>
96      *
97      * @return the logical key/name of this document type
98      */

99     public String JavaDoc getName() {
100
101         return m_name;
102     }
103
104     /**
105      * Returns the list of Cms resource types to trigger the document factory.<p>
106      *
107      * @return the list of Cms resource types to trigger the document factory
108      */

109     public List JavaDoc getResourceTypes() {
110
111         return m_resourceTypes;
112     }
113
114     /**
115      * Sets the name of the document factory class.<p>
116      *
117      * @param className the name of the document factory class
118      */

119     public void setClassName(String JavaDoc className) {
120
121         m_className = className;
122     }
123
124     /**
125      * Sets the mimetypes to trigger the document factory class.<p>
126      *
127      * @param mimetypes the mimetypes to trigger the document factory class
128      */

129     public void setMimeTypes(List JavaDoc mimetypes) {
130
131         m_mimeTypes = mimetypes;
132     }
133
134     /**
135      * Sets the logical key/name of this document type.<p>
136      *
137      * @param name the logical key/name of this document type
138      */

139     public void setName(String JavaDoc name) {
140
141         m_name = name;
142     }
143
144     /**
145      * Sets the list of Cms resource types to trigger the document factory.<p>
146      *
147      * @param resourceTypes the list of Cms resource types to trigger the document factory
148      */

149     public void setResourceTypes(List JavaDoc resourceTypes) {
150
151         m_resourceTypes = resourceTypes;
152     }
153
154     /**
155      * Adds the class name of a resource type.<p>
156      *
157      * @param resourceType the class name of a resource type
158      */

159     public void addResourceType(String JavaDoc resourceType) {
160
161         m_resourceTypes.add(resourceType);
162     }
163
164     /**
165      * Adds a mimetype.<p>
166      *
167      * @param mimeType a mimetype
168      */

169     public void addMimeType(String JavaDoc mimeType) {
170
171         m_mimeTypes.add(mimeType);
172     }
173
174 }
Popular Tags