KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > opencms > legacy > CmsCosIndexResource


1 /*
2  * File : $Source: /usr/local/cvs/opencms/src-modules/com/opencms/legacy/CmsCosIndexResource.java,v $
3  * Date : $Date: 2005/06/27 23:27:46 $
4  * Version: $Revision: 1.6 $
5  *
6  * This library is part of OpenCms -
7  * the Open Source Content Mananagement System
8  *
9  * Copyright (C) 2002 Alkacon Software (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, 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 package com.opencms.legacy;
32
33 import org.opencms.search.A_CmsIndexResource;
34
35 import com.opencms.defaults.master.*;
36
37
38 /**
39  * Wrapper class to hide the concrete type of a data object.<p>
40  * The type is either <code>CmsResource</code> while indexing vfs data,
41  * or <code>CmsMasterDataSet</code> while indexing cos data.
42  *
43  * @version $Revision: 1.6 $ $Date: 2005/06/27 23:27:46 $
44  * @author Carsten Weinholz (c.weinholz@alkacon.com)
45  * @author Thomas Weckert (t.weckert@alkacon.com)
46  * @since 5.3.1
47  *
48  * @deprecated Will not be supported past the OpenCms 6 release.
49  */

50 public class CmsCosIndexResource extends A_CmsIndexResource {
51     
52     /**
53      * Creates a new instance to wrap the given <code>CmsMasterDataSet</code>.<p>
54      *
55      * @param ds the data object
56      * @param path access path of the data object
57      * @param channel channel of the data object
58      * @param contentDefinition content definition of the data object
59      */

60     public CmsCosIndexResource(CmsMasterDataSet ds, String JavaDoc path, String JavaDoc channel, String JavaDoc contentDefinition) {
61         m_data = ds;
62         m_id = ds.m_masterId;
63         m_name = ds.m_title;
64         m_type = ds.m_subId;
65         m_mimeType = null;
66         m_path = path;
67         m_channel = channel;
68         m_contentDefinition = contentDefinition;
69     }
70
71     /**
72      * @see org.opencms.search.A_CmsIndexResource#getDocumentKey(boolean)
73      */

74     public String JavaDoc getDocumentKey(boolean withMimeType) {
75         return CmsCosDocument.C_DOCUMENT_KEY_PREFIX + getType();
76     }
77
78     /**
79      * Channel of the object, <code>null</code> if the object is a <code>CmsResource</code>.
80      */

81     protected String JavaDoc m_channel;
82     /**
83      * Content definition of the object, <code>null</code> if the object is a <code>CmsResource</code>.
84      */

85     protected String JavaDoc m_contentDefinition;
86
87     /**
88      * Returns the channel of the wrapped object.<p>
89      *
90      * @return the channel of the wrapped object or <code>null</code>
91      */

92     public String JavaDoc getChannel() {
93         return m_channel;
94     }
95
96     /**
97      * Returns the content definition of the wrapped object.<p>
98      *
99      * @return the content definition or <code>null</code>
100      */

101     public String JavaDoc getContentDefinition() {
102         return m_contentDefinition;
103     }
104 }
105
Popular Tags