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