KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > opencms > staticexport > CmsStaticExportData


1 /*
2  * File : $Source: /usr/local/cvs/opencms/src/org/opencms/staticexport/CmsStaticExportData.java,v $
3  * Date : $Date: 2005/06/23 11:11:28 $
4  * Version: $Revision: 1.14 $
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.staticexport;
33
34 import org.opencms.file.CmsResource;
35
36 /**
37  * Provides a data structure for the result of an export request.<p>
38  *
39  * @author Alexander Kandzior
40  *
41  * @version $Revision: 1.14 $
42  *
43  * @since 6.0.0
44  */

45 public class CmsStaticExportData {
46
47     /** The parameters. */
48     private String JavaDoc m_parameters;
49
50     /** The resource to export. */
51     private CmsResource m_resource;
52
53     /** The uri to export in the rfs. */
54     private String JavaDoc m_rfsName;
55
56     /** The uri in the vfs. */
57     private String JavaDoc m_vfsName;
58
59     /**
60      * Creates a new static export data object for use in the cache.<p>
61      *
62      * @param vfsName the vfs name of the resource
63      * @param parameters the parameter string of a resource
64      */

65     public CmsStaticExportData(String JavaDoc vfsName, String JavaDoc parameters) {
66
67         m_vfsName = vfsName;
68         m_rfsName = null;
69         m_resource = null;
70         m_parameters = parameters;
71     }
72
73     /**
74      * Creates a new static export data object.<p>
75      *
76      * @param vfsName the vfs name of the resource
77      * @param rfsName the rfs name of the resource
78      * @param resource the resource object
79      */

80     public CmsStaticExportData(String JavaDoc vfsName, String JavaDoc rfsName, CmsResource resource) {
81
82         m_vfsName = vfsName;
83         m_rfsName = rfsName;
84         m_resource = resource;
85         m_parameters = null;
86     }
87
88     /**
89      * Creates a new static export data object.<p>
90      *
91      * @param vfsName the vfs name of the resource
92      * @param rfsName the rfs name of the resource
93      * @param resource the resource object
94      * @param parameters the parameter string of a resource
95      */

96     public CmsStaticExportData(String JavaDoc vfsName, String JavaDoc rfsName, CmsResource resource, String JavaDoc parameters) {
97
98         m_vfsName = vfsName;
99         m_rfsName = rfsName;
100         m_resource = resource;
101         m_parameters = parameters;
102
103     }
104
105     /**
106      * Return the parameters of the resource to export.<p>
107      *
108      * @return the parameter map
109      */

110     public String JavaDoc getParameters() {
111
112         return m_parameters;
113     }
114
115     /**
116      * Returns the resource to export.<p>
117      *
118      * @return the resource to export
119      */

120     public CmsResource getResource() {
121
122         return m_resource;
123     }
124
125     /**
126      * Returns the rfs name of the resource to export.<p>
127      *
128      * @return the rfs name of the resource to export
129      */

130     public String JavaDoc getRfsName() {
131
132         return m_rfsName;
133     }
134
135     /**
136      * Returns the vfs name of the resource to export.<p>
137      *
138      * @return the vfs name of the resource to export
139      */

140     public String JavaDoc getVfsName() {
141
142         return m_vfsName;
143     }
144
145     /**
146      * @see java.lang.Object#toString()
147      */

148     public String JavaDoc toString() {
149
150         StringBuffer JavaDoc result = new StringBuffer JavaDoc();
151         result.append(this.getClass().getName());
152         result.append("[vfsName=");
153         result.append(m_vfsName);
154         result.append(", rfsName=");
155         result.append(m_rfsName);
156         if (m_resource != null) {
157             result.append(", structureId=");
158             result.append(m_resource.getStructureId());
159         }
160         result.append("]");
161         return result.toString();
162     }
163 }
Popular Tags