1 54 package org.apache.jetspeed.om.cms.slide; 55 56 import org.apache.turbine.util.Log; 57 58 import org.apache.jetspeed.om.cms.*; 59 60 61 68 69 public class SlideContentItem extends SlideResource implements ContentItem 70 { 71 private String logicalName = ""; 72 private String description = ""; 73 private String contentType= ""; private String contentReference = ""; private String contentClass="" ; private String title = ""; 77 private String author = ""; 78 private Integer creationDate_year; 79 private Integer creationDate_month; 80 private Integer creationDate_day; 81 private String parentUri; 82 83 public static String TYPE = "ContentItem"; 84 85 88 public String getKey() 89 { 90 return "2" + this.getTitle( ); } 93 94 public boolean contentTypeisURLPortal() 95 { 96 String type = this.getContentType(); 97 98 if (type == null) 99 { 100 return false; 101 } 102 103 return type.equals("URLPORT"); 104 } 105 106 public boolean contentTypeisURLInternet() 107 { 108 String type = this.getContentType(); 109 110 if (type == null) 111 { 112 return false; 113 } 114 115 return type.equals("URLINT"); 116 } 117 118 public boolean contentTypeisHTML() 119 { 120 String type = this.getContentType(); 121 122 if (type == null) 123 { 124 return false; 125 } 126 127 return type.equals("HTML"); 128 } 129 130 public boolean contentTypeisUpload() 131 { 132 String type = this.getContentType(); 133 134 if (type == null) 135 { 136 return false; 137 } 138 139 return type.equals("UPLOAD"); 140 } 141 142 public void setContentClass(String contentClass) 143 { 144 if (descriptor != null) 145 { 146 descriptor.setProperty("contentClass", contentClass); 147 } 148 149 this.contentClass = contentClass; 150 } 151 152 public String getContentClass() 153 { 154 if ((descriptor != null) && ((this.contentClass == null) || (this.contentClass.equals("")))) 155 { 156 this.contentClass = (String ) this.getProperty("contentClass"); 157 } 158 159 return this.contentClass; 160 } 161 162 public void setLogicalName(String logicalName) 163 { 164 if (descriptor != null) 165 { 166 descriptor.setProperty("logicalName", logicalName); 167 } 168 169 this.logicalName = logicalName; 170 } 171 172 public String getLogicalName() 173 { 174 175 if (Log.getLogger().isDebugEnabled()) 176 { 177 Log.debug("ContentItem.getLogicalName() :" + this.uri); 178 } 179 180 if ((descriptor != null) && ((this.logicalName == null) || (this.logicalName.equals("")))) 181 { 182 this.logicalName = (String ) this.getProperty("logicalName"); 183 } 184 185 return this.logicalName; 186 } 187 188 public void setDescription(String description) 189 { 190 if (descriptor != null) 191 { 192 descriptor.setProperty("description", description); 193 } 194 195 this.description = description; 196 } 197 198 public String getDescription() 199 { 200 if ((descriptor != null) && ((this.description == null) || (this.description.equals("")))) 201 { 202 this.description = (String ) this.getProperty("description"); 203 } 204 205 return this.description; 206 } 207 208 public void setContentType(String contentType) 209 { 210 if (descriptor != null) 211 { 212 descriptor.setProperty("contentType", contentType); 213 } 214 215 this.contentType = contentType; 216 } 217 218 public String getContentType() 219 { 220 if ((descriptor != null) && ((this.contentType == null) || (this.contentType.equals("")))) 221 { 222 this.contentType = (String ) this.getProperty("contentType"); 223 } 224 225 return this.contentType; 226 } 227 228 public void setContentReference(String contentReference) 229 { 230 if (descriptor != null) 231 { 232 descriptor.setProperty("contentReference", contentReference); 233 } 234 this.contentReference = contentReference; 235 } 236 237 public String getContentReference() 238 { 239 if ((descriptor != null) && ((this.contentReference == null) || (this.contentReference.equals("")))) 240 { 241 this.contentReference = (String ) this.getProperty("contentReference"); 242 } 243 244 return this.contentReference; 245 } 246 247 public void setTitle(String title) 248 { 249 if (descriptor != null) 250 { 251 descriptor.setProperty("title", title); 252 } 253 254 this.title = title; 255 } 256 257 public String getTitle() 258 { 259 if ((descriptor != null) && ((this.title == null) || (this.title.equals("")))) 260 { 261 this.title = (String ) this.getProperty("title"); 262 } 263 264 return this.title; 265 } 266 267 public void setAuthor(String author) 268 { 269 if (descriptor != null) 270 { 271 descriptor.setProperty("author", author); 272 } 273 274 this.author = author; 275 } 276 277 public String getAuthor() 278 { 279 if ((descriptor != null) && ((this.author == null) || (this.author.equals("")))) 280 { 281 this.author = (String ) this.getProperty("author"); 282 } 283 284 return this.author; 285 } 286 287 public void setCreationDate_year(Integer creationDate_year) 288 { 289 if (descriptor != null) 290 { 291 descriptor.setProperty("creationDate_year", creationDate_year); 292 } 293 294 this.creationDate_year = creationDate_year; 295 } 296 297 public Integer getCreationDate_year() 298 { 299 if ((descriptor != null) && ((this.creationDate_year == null))) 300 { 301 this.creationDate_year = (Integer )this.getProperty("creationDate_year"); 302 } 303 304 return this.creationDate_year; 305 } 306 307 public void setCreationDate_month(Integer creationDate_month) 308 { 309 if (descriptor != null) 310 { 311 descriptor.setProperty("creationDate_month", creationDate_month); 312 } 313 314 this.creationDate_month = creationDate_month; 315 } 316 317 public Integer getCreationDate_month() 318 { 319 if ((descriptor != null) && ((this.creationDate_month == null))) 320 { 321 this.creationDate_month = (Integer ) this.getProperty("creationDate_month"); 322 } 323 324 return this.creationDate_month; 325 } 326 327 public void setCreationDate_day(Integer creationDate_day) 328 { 329 if (descriptor != null) 330 { 331 descriptor.setProperty("creationDate_day", creationDate_day); 332 } 333 334 this.creationDate_day = creationDate_day; 335 } 336 337 public Integer getCreationDate_day() 338 { 339 if ((descriptor != null) && ((this.creationDate_day == null))) 340 { 341 this.creationDate_day = (Integer )this.getProperty("creationDate_day"); 342 } 343 344 return this.creationDate_day; 345 } 346 347 public void setParentUri(String parentUri) 348 { 349 if (descriptor != null) 350 { 351 descriptor.setProperty("parentUri", parentUri); 352 } 353 354 this.parentUri = parentUri; 355 } 356 357 public String getParentUri() 358 { 359 if ((descriptor != null) && ((this.parentUri == null) || (this.parentUri.equals("")))) 360 { 361 this.parentUri = (String ) this.getProperty("parentUri"); 362 } 363 364 return this.parentUri; 365 } 366 367 public String getType() 368 { 369 return SlideContentItem.TYPE; 370 } 371 } | Popular Tags |