KickJava   Java API By Example, From Geeks To Geeks.

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


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.util.Calendar JavaDoc;
27 import java.util.Hashtable JavaDoc;
28 import java.util.Map JavaDoc;
29
30 import org.infoglue.cms.entities.kernel.BaseEntityVO;
31 import org.infoglue.cms.exception.ConstraintException;
32 import org.infoglue.cms.util.ConstraintExceptionBuffer;
33 import org.infoglue.cms.util.DateHelper;
34 import org.infoglue.cms.util.validators.ValidatorFactory;
35
36 public class SiteNodeVO implements BaseEntityVO
37 {
38
39     private java.lang.Integer JavaDoc siteNodeId = null;
40     private java.lang.String JavaDoc name = "";
41     private java.util.Date JavaDoc publishDateTime = DateHelper.getSecondPreciseDate();
42     private java.util.Date JavaDoc expireDateTime = DateHelper.getSecondPreciseDate();
43     private java.lang.Boolean JavaDoc isBranch = new Boolean JavaDoc(false);
44     private java.lang.Integer JavaDoc repositoryId = null;
45     private java.lang.Integer JavaDoc siteNodeTypeDefinitionId = null;
46     private Integer JavaDoc childCount;
47     
48     private String JavaDoc creatorName;
49     private Integer JavaDoc metaInfoContentId = null;
50     
51     private Integer JavaDoc parentSiteNodeId = null;
52
53     //Used if an application wants to add more properties to this item... used for performance reasons.
54
private Map JavaDoc extraProperties = new Hashtable JavaDoc();
55
56     public SiteNodeVO()
57     {
58         //Initilizing the expireDateTime...
59
Calendar JavaDoc calendar = Calendar.getInstance();
60         calendar.setTime(DateHelper.getSecondPreciseDate());
61         calendar.add(Calendar.YEAR, 50);
62         expireDateTime = calendar.getTime();
63     }
64     
65     /**
66      * Returns the childCount.
67      * @return Integer
68      */

69     public Integer JavaDoc getChildCount()
70     {
71         return childCount;
72     }
73
74     /**
75      * Sets the childCount.
76      * @param childCount The childCount to set
77      */

78     public void setChildCount(Integer JavaDoc childCount)
79     {
80         this.childCount = childCount;
81     }
82   
83     public java.lang.Integer JavaDoc getSiteNodeId()
84     {
85         return this.siteNodeId;
86     }
87                 
88     public void setSiteNodeId(java.lang.Integer JavaDoc siteNodeId)
89     {
90         this.siteNodeId = siteNodeId;
91     }
92     
93     public java.lang.String JavaDoc getName()
94     {
95         return this.name;
96     }
97                 
98     public void setRepositoryId(java.lang.Integer JavaDoc repositoryId)
99     {
100         this.repositoryId = repositoryId;
101     }
102     
103     public java.lang.Integer JavaDoc getRepositoryId()
104     {
105         return this.repositoryId;
106     }
107
108     public void setSiteNodeTypeDefinitionId(java.lang.Integer JavaDoc siteNodeTypeDefinitionId)
109     {
110         this.siteNodeTypeDefinitionId = siteNodeTypeDefinitionId;
111     }
112     
113     public java.lang.Integer JavaDoc getSiteNodeTypeDefinitionId()
114     {
115         return this.siteNodeTypeDefinitionId;
116     }
117     
118     public void setName(java.lang.String JavaDoc name)
119     {
120         this.name = name;
121     }
122     
123     public java.util.Date JavaDoc getPublishDateTime()
124     {
125         return this.publishDateTime;
126     }
127                 
128     public void setPublishDateTime(java.util.Date JavaDoc publishDateTime)
129     {
130         this.publishDateTime = publishDateTime;
131     }
132     
133     public java.util.Date JavaDoc getExpireDateTime()
134     {
135         return this.expireDateTime;
136     }
137                 
138     public void setExpireDateTime(java.util.Date JavaDoc expireDateTime)
139     {
140         this.expireDateTime = expireDateTime;
141     }
142     
143     public java.lang.Boolean JavaDoc getIsBranch()
144     {
145         return this.isBranch;
146     }
147     
148     public void setIsBranch(java.lang.Boolean JavaDoc isBranch)
149     {
150         this.isBranch = isBranch;
151     }
152     
153     public Integer JavaDoc getMetaInfoContentId()
154     {
155         return metaInfoContentId;
156     }
157     
158     public void setMetaInfoContentId(Integer JavaDoc metaInfoContentId)
159     {
160         this.metaInfoContentId = metaInfoContentId;
161     }
162
163     /**
164      * @see org.infoglue.cms.entities.kernel.BaseEntityVO#getId()
165      */

166     public Integer JavaDoc getId()
167     {
168         return getSiteNodeId();
169     }
170     
171     /**
172      * @see org.infoglue.cms.entities.kernel.BaseEntityVO#validate()
173      */

174     public ConstraintExceptionBuffer validate()
175     {
176         ConstraintExceptionBuffer ceb = new ConstraintExceptionBuffer();
177         ValidatorFactory.createStringValidator("SiteNode.name", true, 2, 100).validate(name, ceb);
178         
179         if(this.publishDateTime.after(this.expireDateTime))
180             ceb.add(new ConstraintException("SiteNode.publishDateTime", "308"));
181         
182         return ceb;
183     }
184               
185     /**
186      * Returns the creatorName.
187      * @return String
188      */

189     public String JavaDoc getCreatorName()
190     {
191         return creatorName;
192     }
193
194     /**
195      * Sets the creatorName.
196      * @param creatorName The creatorName to set
197      */

198     public void setCreatorName(String JavaDoc creatorName)
199     {
200         this.creatorName = creatorName;
201     }
202
203     public Map JavaDoc getExtraProperties()
204     {
205         return extraProperties;
206     }
207
208     public Integer JavaDoc getParentSiteNodeId()
209     {
210         return parentSiteNodeId;
211     }
212
213     public void setParentSiteNodeId(Integer JavaDoc parentSiteNodeId)
214     {
215         this.parentSiteNodeId = parentSiteNodeId;
216     }
217
218 }
219         
220
Popular Tags