KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > infoglue > cms > entities > structure > SiteNodeVersionVO


1 /* ===============================================================================
2  *
3  * Part of the InfoGlue Content Management Platform (www.infoglue.org)
4  *
5  * ===============================================================================
6  *
7  * Copyright (C)
8  *
9  * This program is free software; you can redistribute it and/or modify it under
10  * the terms of the GNU General Public License version 2, as published by the
11  * Free Software Foundation. See the file LICENSE.html for more information.
12  *
13  * This program is distributed in the hope that it will be useful, but WITHOUT
14  * ANY WARRANTY, including the implied warranty of MERCHANTABILITY or FITNESS
15  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License along with
18  * this program; if not, write to the Free Software Foundation, Inc. / 59 Temple
19  * Place, Suite 330 / Boston, MA 02111-1307 / USA.
20  *
21  * ===============================================================================
22  */

23
24 package org.infoglue.cms.entities.structure;
25
26 import java.text.SimpleDateFormat JavaDoc;
27 import java.util.Date JavaDoc;
28
29 import org.infoglue.cms.entities.kernel.BaseEntityVO;
30 import org.infoglue.cms.util.ConstraintExceptionBuffer;
31 import org.infoglue.cms.util.DateHelper;
32
33 public class SiteNodeVersionVO implements BaseEntityVO
34 {
35
36     public static final Integer JavaDoc WORKING_STATE = new Integer JavaDoc(0);
37     public static final Integer JavaDoc FINAL_STATE = new Integer JavaDoc(1);
38     public static final Integer JavaDoc PUBLISH_STATE = new Integer JavaDoc(2);
39     public static final Integer JavaDoc PUBLISHED_STATE = new Integer JavaDoc(3);
40     public static final Integer JavaDoc UNPUBLISH_STATE = new Integer JavaDoc(4);
41
42     public static final Integer JavaDoc NO = new Integer JavaDoc(0);
43     public static final Integer JavaDoc YES = new Integer JavaDoc(1);
44     public static final Integer JavaDoc INHERITED = new Integer JavaDoc(2);
45     
46     private Integer JavaDoc siteNodeVersionId;
47     private Integer JavaDoc stateId = WORKING_STATE;
48     private Integer JavaDoc versionNumber = new Integer JavaDoc(1);
49     private Date JavaDoc modifiedDateTime = DateHelper.getSecondPreciseDate();
50     private String JavaDoc versionComment = "No comment";;
51     private String JavaDoc versionModifier = null;
52     private Boolean JavaDoc isCheckedOut = new Boolean JavaDoc(false);
53     private Boolean JavaDoc isActive = new Boolean JavaDoc(true);
54     
55     private Integer JavaDoc isProtected = INHERITED;
56     private Integer JavaDoc disablePageCache = INHERITED;
57     private Integer JavaDoc disableEditOnSight = INHERITED;
58     private Integer JavaDoc disableLanguages = INHERITED;
59     private String JavaDoc contentType = "text/html";
60     private String JavaDoc pageCacheKey = "default";
61     
62     private Integer JavaDoc siteNodeId = null;
63     private String JavaDoc siteNodeName = "";
64   
65     public java.lang.Integer JavaDoc getSiteNodeVersionId()
66     {
67         return this.siteNodeVersionId;
68     }
69                 
70     public void setSiteNodeVersionId(java.lang.Integer JavaDoc siteNodeVersionId)
71     {
72         this.siteNodeVersionId = siteNodeVersionId;
73     }
74
75     public java.lang.Integer JavaDoc getSiteNodeId()
76     {
77         return this.siteNodeId;
78     }
79                 
80     public void setSiteNodeId(java.lang.Integer JavaDoc siteNodeId)
81     {
82         this.siteNodeId = siteNodeId;
83     }
84     
85     public java.lang.Integer JavaDoc getStateId()
86     {
87         return this.stateId;
88     }
89                 
90     public void setStateId(java.lang.Integer JavaDoc stateId)
91     {
92         this.stateId = stateId;
93     }
94     
95     public java.lang.Integer JavaDoc getVersionNumber()
96     {
97         return this.versionNumber;
98     }
99                 
100     public void setVersionNumber(java.lang.Integer JavaDoc versionNumber)
101     {
102         this.versionNumber = versionNumber;
103     }
104     
105     public Date JavaDoc getModifiedDateTime()
106     {
107         return this.modifiedDateTime;
108     }
109                 
110     public void setModifiedDateTime(Date JavaDoc modifiedDateTime)
111     {
112         this.modifiedDateTime = modifiedDateTime;
113     }
114     
115     public java.lang.String JavaDoc getVersionComment()
116     {
117         return this.versionComment;
118     }
119                 
120     public void setVersionComment(java.lang.String JavaDoc versionComment)
121     {
122         if(versionComment != null && !versionComment.equals(""))
123             this.versionComment = versionComment;
124     }
125     
126     public java.lang.Boolean JavaDoc getIsCheckedOut()
127     {
128         return this.isCheckedOut;
129     }
130                 
131     public void setIsCheckedOut(java.lang.Boolean JavaDoc isCheckedOut)
132     {
133         this.isCheckedOut = isCheckedOut;
134     }
135       
136     public java.lang.Boolean JavaDoc getIsActive()
137     {
138         return this.isActive;
139     }
140     
141     public void setIsActive(java.lang.Boolean JavaDoc isActive)
142     {
143         this.isActive = isActive;
144     }
145     
146     public Integer JavaDoc getId()
147     {
148         return getSiteNodeVersionId();
149     }
150     
151     public ConstraintExceptionBuffer validate()
152     {
153         return null;
154     }
155     
156     public String JavaDoc getContentType()
157     {
158         return contentType;
159     }
160
161     public void setContentType(String JavaDoc contentType)
162     {
163         this.contentType = contentType;
164     }
165
166     public String JavaDoc getPageCacheKey()
167     {
168         return pageCacheKey;
169     }
170     
171     public void setPageCacheKey(String JavaDoc pageCacheKey)
172     {
173         if(pageCacheKey != null && !pageCacheKey.equalsIgnoreCase(""))
174             this.pageCacheKey = pageCacheKey;
175     }
176
177     public Integer JavaDoc getDisableEditOnSight()
178     {
179         return (disableEditOnSight == null) ? INHERITED : disableEditOnSight;
180     }
181
182     public void setDisableEditOnSight(Integer JavaDoc disableEditOnSight)
183     {
184         this.disableEditOnSight = disableEditOnSight;
185     }
186
187     public Integer JavaDoc getDisableLanguages()
188     {
189         return (disableLanguages == null) ? INHERITED : disableLanguages;
190     }
191
192     public void setDisableLanguages(Integer JavaDoc disableLanguages)
193     {
194         this.disableLanguages = disableLanguages;
195     }
196
197     public Integer JavaDoc getDisablePageCache()
198     {
199         return (disablePageCache == null) ? INHERITED : disablePageCache;
200     }
201
202     public void setDisablePageCache(Integer JavaDoc disablePageCache)
203     {
204         this.disablePageCache = disablePageCache;
205     }
206
207     public Integer JavaDoc getIsProtected()
208     {
209         return (isProtected == null) ? INHERITED : isProtected;
210     }
211
212     public void setIsProtected(Integer JavaDoc isProtected)
213     {
214         this.isProtected = isProtected;
215     }
216
217     public String JavaDoc getVersionModifier()
218     {
219         return this.versionModifier;
220     }
221
222     public void setVersionModifier(String JavaDoc versionModifier)
223     {
224         this.versionModifier = versionModifier;
225     }
226
227     public String JavaDoc getSiteNodeName()
228     {
229         return siteNodeName;
230     }
231
232     public void setSiteNodeName(String JavaDoc siteNodeName)
233     {
234         this.siteNodeName = siteNodeName;
235     }
236
237     public String JavaDoc toString()
238     {
239         StringBuffer JavaDoc sb = new StringBuffer JavaDoc();
240         sb.append("siteNodeVersionId:" + siteNodeVersionId + '\n');
241         sb.append("stateId:" + stateId + '\n');
242         sb.append("versionNumber:" + versionNumber + '\n');
243         SimpleDateFormat JavaDoc sdf = new SimpleDateFormat JavaDoc("yyyy-MM-dd HH:mm");
244         sb.append("modifiedDateTime:" + sdf.format(modifiedDateTime) + ":" + modifiedDateTime.getClass().getName() + '\n');
245         sb.append("versionComment:" + versionComment + '\n');
246         sb.append("versionModifier:" + versionModifier + '\n');
247         sb.append("isCheckedOut:" + isCheckedOut + '\n');
248         sb.append("isActive:" + isActive + '\n');
249         sb.append("isProtected:" + isProtected + '\n');
250         sb.append("disablePageCache:" + disablePageCache + '\n');
251         sb.append("disableEditOnSight:" + disableEditOnSight + '\n');
252         sb.append("disableLanguages:" + disableLanguages + '\n');
253         sb.append("contentType:" + contentType + '\n');
254         sb.append("pageCacheKey:" + pageCacheKey + '\n');
255         sb.append("siteNodeId:" + siteNodeId + '\n');
256         sb.append("siteNodeName:" + siteNodeName + '\n');
257         
258         return sb.toString();
259     }
260     
261     public boolean equals(Object JavaDoc o)
262     {
263         boolean equals = false;
264         
265         if(o instanceof SiteNodeVersionVO)
266         {
267             SiteNodeVersionVO sv = (SiteNodeVersionVO)o;
268             if(sv != null && sv.getSiteNodeVersionId().equals(this.siteNodeVersionId))
269                 equals = true;
270         }
271         
272         return equals;
273     }
274     
275     public int hashCode()
276     {
277         return this.siteNodeVersionId.intValue();
278     }
279
280
281 }
282         
283
Popular Tags