KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > opencms > defaults > master > CmsMasterDataSet


1 /*
2 * File : $Source: /usr/local/cvs/opencms/src-modules/com/opencms/defaults/master/CmsMasterDataSet.java,v $
3 * Date : $Date: 2005/06/27 23:22:25 $
4 * Version: $Revision: 1.2 $
5 *
6 * This library is part of OpenCms -
7 * the Open Source Content Mananagement System
8 *
9 * Copyright (C) 2001 The OpenCms Group
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 OpenCms, please see the
22 * OpenCms Website: http://www.opencms.org
23 *
24 * You should have received a copy of the GNU Lesser General Public
25 * License along with this library; if not, write to the Free Software
26 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27 */

28
29 package com.opencms.defaults.master;
30
31 import org.opencms.db.CmsDbUtil;
32 import org.opencms.util.CmsUUID;
33
34 import java.io.Serializable JavaDoc;
35 import java.util.Vector JavaDoc;
36
37 /**
38  * This class defines the dataset of the master module. It carries a lot of
39  * generic data-fileds which can be used for a special Module. This class
40  * should only be used within this mastermodule.
41  *
42  * @author A. Schouten $
43  * $Revision: 1.2 $
44  * $Date: 2005/06/27 23:22:25 $
45  *
46  * @deprecated Will not be supported past the OpenCms 6 release.
47  */

48 public class CmsMasterDataSet implements Serializable JavaDoc {
49
50     //// members for "core-handling" ////
51

52     /** The primary key of this master module. */
53     public CmsUUID m_masterId;
54
55     /** Defines the "type" of the module */
56     public int m_subId;
57
58     /** The id of the owner */
59     public CmsUUID m_userId;
60
61     /** The id of the group */
62     public CmsUUID m_groupId;
63
64     /** The project, this cd belongs to */
65     public int m_lockedInProject;
66
67     /** The generated project id (indicates, if the entry belongs to the
68      * current project) */

69     public int m_projectId;
70
71     /** The state of the cd (unchanged/changed/new/deleted) */
72     public int m_state;
73
74     /** The user-id who had locked this ressource or -1 */
75     public CmsUUID m_lockedBy;
76
77     /** The user who has lastly changed this cd */
78     public CmsUUID m_lastModifiedBy;
79
80     /** The date when this cd was created as long-value */
81     public long m_dateCreated;
82
83     /** The date of the last modification of this cd */
84     public long m_dateLastModified;
85
86     public int m_accessFlags;
87
88     //// memebers for "publication-handling" ////
89

90     /** the start-date this cd should be shown in the frontend */
91     public long m_publicationDate;
92
93     /** the ending-date this cd should be shown in the frontend */
94     public long m_purgeDate;
95
96     //// named "data members" ////
97

98     /** flags of this cd */
99     public int m_flags;
100
101     /** member for feed's */
102     public int m_feedId;
103
104     /** member for feed's */
105     public int m_feedReference;
106
107     /** member for feed's */
108     public String JavaDoc m_feedFilename;
109
110     /** The title of this cd */
111     public String JavaDoc m_title;
112
113     //// data members for history ////
114

115     /** The version-number of this record in history */
116     public int m_versionId = CmsDbUtil.UNKNOWN_ID;
117
118     /** The owner as String */
119     public String JavaDoc m_userName;
120
121     /** The group as String */
122     public String JavaDoc m_groupName;
123
124     /** The user who has changed this the last time as String */
125     public String JavaDoc m_lastModifiedByName;
126
127     //// generic "data members" ////
128

129     /** data memeber for String values type VARCHAR2(4000) */
130     public String JavaDoc[] m_dataBig = new String JavaDoc[10];
131
132     /** data memeber for String values type VARCHAR2(2000) */
133     public String JavaDoc[] m_dataMedium = new String JavaDoc[10];
134
135     /** data memeber for String values type VARCHAR2(500) */
136     public String JavaDoc[] m_dataSmall = new String JavaDoc[40];
137
138     /** data memeber for Date values */
139     public long[] m_dataDate = new long[5];
140
141     /** data memeber for Integer values type int */
142     public int[] m_dataInt = new int[10];
143
144     /** data refernces of type int */
145     public int[] m_dataReference = new int[10];
146
147     //// Media Data ////
148

149     /** The media objects registered for update */
150     public Vector JavaDoc m_mediaToUpdate = new Vector JavaDoc();
151
152     /** The media objects registered for deletion */
153     public Vector JavaDoc m_mediaToDelete = new Vector JavaDoc();
154
155     /** The media objects registered for deletion */
156     public Vector JavaDoc m_mediaToAdd = new Vector JavaDoc();
157
158     /** The current media objects */
159     public Vector JavaDoc m_media = null;
160
161     //// Channel Data ////
162
/** The channel objects registered for deletion */
163     public Vector JavaDoc m_channelToDelete = new Vector JavaDoc();
164
165     /** The channel objects registered for deletion */
166     public Vector JavaDoc m_channelToAdd = new Vector JavaDoc();
167
168     /** The current channel objects */
169     public Vector JavaDoc m_channel = null;
170
171     /**
172      * The default constructor should only be visible within this package.
173      */

174     public CmsMasterDataSet() {
175     }
176
177     /**
178      * Creates a new CmsMasterDataSet by cloning
179      */

180     public Object JavaDoc clone(){
181         CmsMasterDataSet retValue = new CmsMasterDataSet();
182         retValue.m_accessFlags = this.m_accessFlags;
183         retValue.m_channel = this.m_channel;
184         retValue.m_channelToAdd = this.m_channelToAdd;
185         retValue.m_channelToDelete = this.m_channelToDelete;
186         retValue.m_dataBig = this.m_dataBig;
187         retValue.m_dataDate = this.m_dataDate;
188         retValue.m_dataInt = this.m_dataInt;
189         retValue.m_dataMedium = this.m_dataMedium;
190         retValue.m_dataReference = this.m_dataReference;
191         retValue.m_dataSmall = this.m_dataSmall;
192         retValue.m_dateCreated = this.m_dateCreated;
193         retValue.m_dateLastModified = this.m_dateLastModified;
194         retValue.m_feedFilename = this.m_feedFilename;
195         retValue.m_feedId = this.m_feedId;
196         retValue.m_feedReference = this.m_feedReference;
197         retValue.m_flags = this.m_flags;
198         retValue.m_groupId = this.m_groupId;
199         retValue.m_groupName = this.m_groupName;
200         retValue.m_lastModifiedBy = this.m_lastModifiedBy;
201         retValue.m_lastModifiedByName = this.m_lastModifiedByName;
202         retValue.m_lockedBy = this.m_lockedBy;
203         retValue.m_lockedInProject = this.m_lockedInProject;
204         retValue.m_masterId = this.m_masterId;
205         retValue.m_media = this.m_media;
206         retValue.m_mediaToAdd = this.m_mediaToAdd;
207         retValue.m_mediaToDelete = this.m_mediaToDelete;
208         retValue.m_mediaToUpdate = this.m_mediaToUpdate;
209         retValue.m_projectId = this.m_projectId;
210         retValue.m_publicationDate = this.m_publicationDate;
211         retValue.m_purgeDate = this.m_purgeDate;
212         retValue.m_state = this.m_state;
213         retValue.m_subId = this.m_subId;
214         retValue.m_title = this.m_title;
215         retValue.m_userId = this.m_userId;
216         retValue.m_userName = this.m_userName;
217         retValue.m_versionId = this.m_versionId;
218         return retValue;
219     }
220     /**
221      * Returns all member-data in a long String. This can be used for debugging.
222      */

223     public String JavaDoc toString() {
224         StringBuffer JavaDoc returnValue = new StringBuffer JavaDoc();
225         returnValue.append(this.getClass().getName() + "{");
226         returnValue.append("m_masterId="+m_masterId+";");
227         returnValue.append("m_subId="+m_subId+";");
228         returnValue.append("m_userId="+m_userId+";");
229         returnValue.append("m_groupId="+m_groupId+";");
230         returnValue.append("m_title="+m_title+";");
231         returnValue.append("m_projectId="+m_projectId+";");
232         returnValue.append("m_state="+m_state+";");
233         returnValue.append("m_lockedBy="+m_lockedBy+";");
234         returnValue.append("m_lastModifiedBy="+m_lastModifiedBy+";");
235         returnValue.append("m_dateCreated="+m_dateCreated+";");
236         returnValue.append("m_dateLastModified="+m_dateLastModified+";");
237         returnValue.append("m_publicationDate="+m_publicationDate+";");
238         returnValue.append("m_purgeDate="+m_purgeDate+";");
239         returnValue.append("m_flags="+m_flags+";");
240         returnValue.append("m_feedId="+m_feedId+";");
241         returnValue.append("m_feedReference="+m_feedReference+";");
242         returnValue.append("m_feedFilename="+m_feedFilename+";");
243         returnValue.append("];");
244         returnValue.append("m_dataBig=[");
245         helperToString(m_dataBig, returnValue);
246         returnValue.append("];");
247         returnValue.append("m_dataMedium=[");
248         helperToString(m_dataMedium, returnValue);
249         returnValue.append("];");
250         returnValue.append("m_dataSmall=[");
251         helperToString(m_dataSmall, returnValue);
252         returnValue.append("];");
253         returnValue.append("m_dataInt=[");
254         for(int i = 0; i < m_dataInt.length; i++) {
255             returnValue.append((i==0?"":",") + m_dataInt[i] );
256         }
257         returnValue.append("];");
258         returnValue.append("m_dataReference=[");
259         for(int i = 0; i < m_dataReference.length; i++) {
260             returnValue.append((i==0?"":",") + m_dataInt[i] );
261         }
262         returnValue.append("]}");
263         return returnValue.toString();
264     }
265
266      /**
267      * Helper method for toString().
268      * @param a array of object for output.
269      * @param StringBuffer the buffer to append the return value.
270      */

271     private void helperToString(Object JavaDoc[] array, StringBuffer JavaDoc buffer) {
272         for(int i = 0; i < array.length; i++) {
273             buffer.append((i==0?"":",") + array[i] );
274         }
275     }
276 }
Free Books   Free Magazines  
Popular Tags