KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > opencms > file > CmsBackupProject


1 /*
2  * File : $Source: /usr/local/cvs/opencms/src/org/opencms/file/CmsBackupProject.java,v $
3  * Date : $Date: 2005/06/27 23:22:15 $
4  * Version: $Revision: 1.13 $
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.file;
33
34 import org.opencms.db.CmsDbUtil;
35 import org.opencms.util.CmsUUID;
36
37 import java.sql.Timestamp JavaDoc;
38 import java.util.List JavaDoc;
39
40 /**
41  * Describes an OpenCms backup project.<p>
42  *
43  * @author Alexander Kandzior
44  *
45  * @version $Revision: 1.13 $
46  *
47  * @since 6.0.0
48  */

49 public class CmsBackupProject extends CmsProject implements Cloneable JavaDoc {
50
51     /** The publishing date of this project. */
52     private long m_datePublished;
53
54     /** The name of the manager group. */
55     private String JavaDoc m_nameGroupManagers;
56
57     /** The name of the user group. */
58     private String JavaDoc m_nameGroupUsers;
59
60     /** The name, firstname and lastname of the project owner. */
61     private String JavaDoc m_nameOwner;
62
63     /** The name, firstname and lastname of the user who has published the project. */
64     private String JavaDoc m_namePublisher;
65
66     /** The resources belonging to the project. */
67     private List JavaDoc m_projectResources;
68
69     /** The user id of the publisher. */
70     private CmsUUID m_userPublished;
71
72     /** The version id of the published project. */
73     private int m_versionId;
74
75     /**
76      * Creates a new CmsBackupProject.<p>
77      *
78      * @param versionId thw version id for this backup project
79      * @param projectId the id to use for this project
80      * @param name the name for this project
81      * @param description the description for this project
82      * @param taskId the task id for this project
83      * @param ownerId the owner id for this project
84      * @param groupId the group id for this project
85      * @param managerGroupId the manager group id for this project
86      * @param dateCreated the creation date of this project
87      * @param type the type of this project
88      * @param datePublished the date this backup project was published
89      * @param userPublished the id of the user who published
90      * @param namePublisher the name of the user who published
91      * @param nameOwner the name of the project owner
92      * @param nameGroupUsers the name of the project user group
93      * @param nameGroupManagers the name of the project manager group
94      * @param projectResources a list of resources that are the project "view"
95      */

96     public CmsBackupProject(
97         int versionId,
98         int projectId,
99         String JavaDoc name,
100         String JavaDoc description,
101         int taskId,
102         CmsUUID ownerId,
103         CmsUUID groupId,
104         CmsUUID managerGroupId,
105         long dateCreated,
106         int type,
107         Timestamp JavaDoc datePublished,
108         CmsUUID userPublished,
109         String JavaDoc namePublisher,
110         String JavaDoc nameOwner,
111         String JavaDoc nameGroupUsers,
112         String JavaDoc nameGroupManagers,
113         List JavaDoc projectResources) {
114
115         super(projectId, name, description, taskId, ownerId, groupId, managerGroupId, 0, dateCreated, type);
116
117         m_versionId = versionId;
118         if (datePublished != null) {
119             m_datePublished = datePublished.getTime();
120         } else {
121             m_datePublished = CmsDbUtil.UNKNOWN_ID;
122         }
123         m_userPublished = userPublished;
124         m_namePublisher = namePublisher;
125         m_nameOwner = nameOwner;
126         m_nameGroupUsers = nameGroupUsers;
127         m_nameGroupManagers = nameGroupManagers;
128         m_projectResources = projectResources;
129     }
130
131     /**
132      * Returns a clone of this Objects instance.<p>
133      *
134      * @return a clone of this instance
135      */

136     public Object JavaDoc clone() {
137
138         return new CmsBackupProject(
139             m_versionId,
140             getId(),
141             getName(),
142             getDescription(),
143             getTaskId(),
144             getOwnerId(),
145             getGroupId(),
146             getManagerGroupId(),
147             this.getDateCreated(),
148             getType(),
149             new Timestamp JavaDoc(this.m_datePublished),
150             m_userPublished,
151             m_namePublisher,
152             m_nameOwner,
153             m_nameGroupUsers,
154             m_nameGroupManagers,
155             m_projectResources);
156     }
157
158     /**
159      * @see java.lang.Object#equals(java.lang.Object)
160      */

161     public boolean equals(Object JavaDoc obj) {
162
163         if (obj == this) {
164             return true;
165         }
166         if (obj instanceof CmsBackupProject) {
167             return ((CmsBackupProject)obj).getId() == getId();
168         }
169         return false;
170     }
171
172     /**
173      * Returns the projects user group name.<p>
174      *
175      * @return the projects user group name
176      */

177     public String JavaDoc getGroupName() {
178
179         return m_nameGroupUsers;
180     }
181
182     /**
183      * Gets the project manager grou pname.<p>
184      *
185      * @return the projects manager group name
186      */

187     public String JavaDoc getManagerGroupName() {
188
189         return m_nameGroupManagers;
190     }
191
192     /**
193      * Gets the ownername.
194      *
195      * @return the ownername
196      */

197     public String JavaDoc getOwnerName() {
198
199         return m_nameOwner;
200     }
201
202     /**
203      * Returns the project resources (i.e. the "view" of the project).<p>
204      *
205      * @return the project resources
206      */

207     public List JavaDoc getProjectResources() {
208
209         return m_projectResources;
210     }
211
212     /**
213      * Gets the published-by value.
214      *
215      * @return the published-by value
216      */

217     public CmsUUID getPublishedBy() {
218
219         return m_userPublished;
220     }
221
222     /**
223      * Gets the publishers name.
224      *
225      * @return the publishers name
226      */

227     public String JavaDoc getPublishedByName() {
228
229         return m_namePublisher;
230     }
231
232     /**
233      * Returns the publishing date of this project.
234      *
235      * @return the publishing date of this project
236      */

237     public long getPublishingDate() {
238
239         return m_datePublished;
240     }
241
242     /**
243      * Gets the versionId.
244      *
245      * @return the versionId
246      */

247     public int getVersionId() {
248
249         return m_versionId;
250     }
251
252     /**
253      * @see java.lang.Object#hashCode()
254      */

255     public int hashCode() {
256
257         return (new Long JavaDoc(m_datePublished)).hashCode();
258     }
259 }
Popular Tags