001: /*
002: * File : $Source: /usr/local/cvs/opencms/src/org/opencms/search/CmsSearchDocumentType.java,v $
003: * Date : $Date: 2008-02-27 12:05:38 $
004: * Version: $Revision: 1.13 $
005: *
006: * This library is part of OpenCms -
007: * the Open Source Content Management System
008: *
009: * Copyright (c) 2002 - 2008 Alkacon Software GmbH (http://www.alkacon.com)
010: *
011: * This library is free software; you can redistribute it and/or
012: * modify it under the terms of the GNU Lesser General Public
013: * License as published by the Free Software Foundation; either
014: * version 2.1 of the License, or (at your option) any later version.
015: *
016: * This library is distributed in the hope that it will be useful,
017: * but WITHOUT ANY WARRANTY; without even the implied warranty of
018: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
019: * Lesser General Public License for more details.
020: *
021: * For further information about Alkacon Software GmbH, please see the
022: * company website: http://www.alkacon.com
023: *
024: * For further information about OpenCms, please see the
025: * project website: http://www.opencms.org
026: *
027: * You should have received a copy of the GNU Lesser General Public
028: * License along with this library; if not, write to the Free Software
029: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
030: */
031:
032: package org.opencms.search;
033:
034: import java.util.ArrayList;
035: import java.util.List;
036:
037: /**
038: * A document type specifies which document factory class is used to pull the
039: * content of an OpenCms document into a Lucene index document.<p>
040: *
041: * The appropriate document factory class gets triggerd while the search index is built
042: * for OpenCms documents matching the specified resource type and/or mimetype combination
043: * in a document factory class instance.<p>
044: *
045: * @author Thomas Weckert
046: *
047: * @version $Revision: 1.13 $
048: *
049: * @since 6.0.0
050: */
051: public class CmsSearchDocumentType {
052:
053: /** The name of the document factory class. */
054: private String m_className;
055:
056: /** The mimetype to trigger the document factory class. */
057: private List m_mimeTypes;
058:
059: /** The logical key/name of this document type. */
060: private String m_name;
061:
062: /** A list of Cms resource types to trigger the document factory. */
063: private List m_resourceTypes;
064:
065: /**
066: * Default constructor.<p>
067: */
068: public CmsSearchDocumentType() {
069:
070: m_resourceTypes = new ArrayList();
071: m_mimeTypes = new ArrayList();
072: }
073:
074: /**
075: * Adds a mimetype.<p>
076: *
077: * @param mimeType a mimetype
078: */
079: public void addMimeType(String mimeType) {
080:
081: m_mimeTypes.add(mimeType);
082: }
083:
084: /**
085: * Adds the class name of a resource type.<p>
086: *
087: * @param resourceType the class name of a resource type
088: */
089: public void addResourceType(String resourceType) {
090:
091: m_resourceTypes.add(resourceType);
092: }
093:
094: /**
095: * Returns the name of the document factory class.<p>
096: *
097: * @return the name of the document factory class
098: */
099: public String getClassName() {
100:
101: return m_className;
102: }
103:
104: /**
105: * Returns the mimetypes to trigger the document factory class.<p>
106: *
107: * @return the mimetypes to trigger the document factory class
108: */
109: public List getMimeTypes() {
110:
111: return m_mimeTypes;
112: }
113:
114: /**
115: * Returns the logical key/name of this document type.<p>
116: *
117: * @return the logical key/name of this document type
118: */
119: public String getName() {
120:
121: return m_name;
122: }
123:
124: /**
125: * Returns the list of Cms resource types to trigger the document factory.<p>
126: *
127: * @return the list of Cms resource types to trigger the document factory
128: */
129: public List getResourceTypes() {
130:
131: return m_resourceTypes;
132: }
133:
134: /**
135: * Sets the name of the document factory class.<p>
136: *
137: * @param className the name of the document factory class
138: */
139: public void setClassName(String className) {
140:
141: m_className = className;
142: }
143:
144: /**
145: * Sets the mimetypes to trigger the document factory class.<p>
146: *
147: * @param mimetypes the mimetypes to trigger the document factory class
148: */
149: public void setMimeTypes(List mimetypes) {
150:
151: m_mimeTypes = mimetypes;
152: }
153:
154: /**
155: * Sets the logical key/name of this document type.<p>
156: *
157: * @param name the logical key/name of this document type
158: */
159: public void setName(String name) {
160:
161: m_name = name;
162: }
163:
164: /**
165: * Sets the list of Cms resource types to trigger the document factory.<p>
166: *
167: * @param resourceTypes the list of Cms resource types to trigger the document factory
168: */
169: public void setResourceTypes(List resourceTypes) {
170:
171: m_resourceTypes = resourceTypes;
172: }
173: }
|