KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * File : $Source: /usr/local/cvs/opencms/src/org/opencms/search/A_CmsIndexResource.java,v $
3  * Date : $Date: 2005/06/23 11:11:28 $
4  * Version: $Revision: 1.11 $
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 org.opencms.util.CmsUUID;
35
36 /**
37  * An index resource is a wrapper class that contains the data of a
38  * Cms resource specified by a Lucene search result document.<p>
39  *
40  * @author Carsten Weinholz
41  * @author Thomas Weckert
42  *
43  * @version $Revision: 1.11 $
44  *
45  * @since 6.0.0
46  */

47 public abstract class A_CmsIndexResource {
48
49     /** Concrete data object. */
50     protected Object JavaDoc m_data;
51
52     /** Id of the object. */
53     protected CmsUUID m_id;
54
55     /** Mimetype of the object, <code>null</code> if the object is a <code>CmsMasterDataSet</code>. */
56     protected String JavaDoc m_mimeType;
57
58     /** Name of the object. */
59     protected String JavaDoc m_name;
60
61     /** Path to access the object. */
62     protected String JavaDoc m_path;
63
64     /** Type of the object. */
65     protected int m_type;
66
67     /**
68      * Returns the wrapped data object.<p>
69      *
70      * The concrete type of the data object is either <code>CmsResource</code>
71      * or <code>CmsMasterDataSet</code>
72      *
73      * @return the wrapped data object
74      */

75     public Object JavaDoc getData() {
76
77         return m_data;
78     }
79
80     /**
81      * Returns the document key for the search manager.<p>
82      *
83      * @param withMimeType true if the mime type should be included in the key
84      * @return the document key for the search manager
85      */

86     public abstract String JavaDoc getDocumentKey(boolean withMimeType);
87
88     /**
89      * Returns the id of the wrapped object.<p>
90      *
91      * @return the id
92      */

93     public CmsUUID getId() {
94
95         return m_id;
96     }
97
98     /**
99      * Returns the mimetype of the wrapped object.<p>
100      *
101      * @return the mimetype of the wrapped object or <code>null</code>
102      */

103     public String JavaDoc getMimetype() {
104
105         return m_mimeType;
106     }
107
108     /**
109      * Returns the name of the wrapped object.<p>
110      *
111      * @return the name of the wrapped object
112      */

113     public String JavaDoc getName() {
114
115         return m_name;
116     }
117
118     /**
119      * Returns the access path of the wrapped object.<p>
120      *
121      * @return the access path of the wrapped object
122      */

123     public String JavaDoc getRootPath() {
124
125         return m_path;
126     }
127
128     /**
129      * Returns the type of the wrapped object.<p>
130      *
131      * The type is either the type of the wrapped <code>CmsResource</code>
132      * or the SubId of the <code>CmsMasterDataSet</code>.
133      *
134      * @return the type of the wrapped object
135      */

136     public int getType() {
137
138         return m_type;
139     }
140 }
Popular Tags