1 23 24 package org.infoglue.cms.entities.structure; 25 26 import java.util.Calendar ; 27 import java.util.Hashtable ; 28 import java.util.Map ; 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 siteNodeId = null; 40 private java.lang.String name = ""; 41 private java.util.Date publishDateTime = DateHelper.getSecondPreciseDate(); 42 private java.util.Date expireDateTime = DateHelper.getSecondPreciseDate(); 43 private java.lang.Boolean isBranch = new Boolean (false); 44 private java.lang.Integer repositoryId = null; 45 private java.lang.Integer siteNodeTypeDefinitionId = null; 46 private Integer childCount; 47 48 private String creatorName; 49 private Integer metaInfoContentId = null; 50 51 private Integer parentSiteNodeId = null; 52 53 private Map extraProperties = new Hashtable (); 55 56 public SiteNodeVO() 57 { 58 Calendar calendar = Calendar.getInstance(); 60 calendar.setTime(DateHelper.getSecondPreciseDate()); 61 calendar.add(Calendar.YEAR, 50); 62 expireDateTime = calendar.getTime(); 63 } 64 65 69 public Integer getChildCount() 70 { 71 return childCount; 72 } 73 74 78 public void setChildCount(Integer childCount) 79 { 80 this.childCount = childCount; 81 } 82 83 public java.lang.Integer getSiteNodeId() 84 { 85 return this.siteNodeId; 86 } 87 88 public void setSiteNodeId(java.lang.Integer siteNodeId) 89 { 90 this.siteNodeId = siteNodeId; 91 } 92 93 public java.lang.String getName() 94 { 95 return this.name; 96 } 97 98 public void setRepositoryId(java.lang.Integer repositoryId) 99 { 100 this.repositoryId = repositoryId; 101 } 102 103 public java.lang.Integer getRepositoryId() 104 { 105 return this.repositoryId; 106 } 107 108 public void setSiteNodeTypeDefinitionId(java.lang.Integer siteNodeTypeDefinitionId) 109 { 110 this.siteNodeTypeDefinitionId = siteNodeTypeDefinitionId; 111 } 112 113 public java.lang.Integer getSiteNodeTypeDefinitionId() 114 { 115 return this.siteNodeTypeDefinitionId; 116 } 117 118 public void setName(java.lang.String name) 119 { 120 this.name = name; 121 } 122 123 public java.util.Date getPublishDateTime() 124 { 125 return this.publishDateTime; 126 } 127 128 public void setPublishDateTime(java.util.Date publishDateTime) 129 { 130 this.publishDateTime = publishDateTime; 131 } 132 133 public java.util.Date getExpireDateTime() 134 { 135 return this.expireDateTime; 136 } 137 138 public void setExpireDateTime(java.util.Date expireDateTime) 139 { 140 this.expireDateTime = expireDateTime; 141 } 142 143 public java.lang.Boolean getIsBranch() 144 { 145 return this.isBranch; 146 } 147 148 public void setIsBranch(java.lang.Boolean isBranch) 149 { 150 this.isBranch = isBranch; 151 } 152 153 public Integer getMetaInfoContentId() 154 { 155 return metaInfoContentId; 156 } 157 158 public void setMetaInfoContentId(Integer metaInfoContentId) 159 { 160 this.metaInfoContentId = metaInfoContentId; 161 } 162 163 166 public Integer getId() 167 { 168 return getSiteNodeId(); 169 } 170 171 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 189 public String getCreatorName() 190 { 191 return creatorName; 192 } 193 194 198 public void setCreatorName(String creatorName) 199 { 200 this.creatorName = creatorName; 201 } 202 203 public Map getExtraProperties() 204 { 205 return extraProperties; 206 } 207 208 public Integer getParentSiteNodeId() 209 { 210 return parentSiteNodeId; 211 } 212 213 public void setParentSiteNodeId(Integer parentSiteNodeId) 214 { 215 this.parentSiteNodeId = parentSiteNodeId; 216 } 217 218 } 219 220 | Popular Tags |