1 25 26 package com.j2biz.blogunity.pojo; 27 28 import java.io.ByteArrayInputStream ; 29 import java.io.File ; 30 import java.io.InputStream ; 31 import java.io.Serializable ; 32 import java.util.Locale ; 33 34 import com.j2biz.blogunity.util.PasswordEncryptionService; 35 36 50 public class SystemConfiguration implements Serializable { 51 52 private static final long serialVersionUID = 3689635791537977654L; 53 54 private Long id; 55 56 private String dataDir; 57 58 private String tempDir; 59 60 62 private String velocityProperties; 63 64 private String dateFormat = "d.MM.yyyy"; 65 66 private String timeFormat = "HH:mm:ss"; 67 68 private String datetimeFormat = "d.MM.yyyy, HH:mm:ss"; 69 70 private String siteTitle = "Blogunity"; 71 72 private String siteDescription = "Blogunity is a lightweight community blog software."; 73 74 private String siteKeywords = "blogunity, blog, community, java, calendar, diary"; 75 76 private int individualBlogsPerUser = -1; 77 78 private int communityBlogsPerUser = -1; 79 80 private int userpicsPerUser = 5; 81 82 85 private int maxUserpicSize = 52700; 86 87 90 private int maxUserpicWidth = 100; 91 92 95 private int maxUserpicHeight = 100; 96 97 private boolean allowNewUsers = true; 98 99 private boolean validateNewUsers = false; 100 101 private boolean rankingOn = false; 102 103 private boolean themeEditingAllowed = true; 104 105 private boolean accessLoggingEnabled = true; 106 107 private Locale systemLocale = Locale.ENGLISH; 108 109 private String smtpHost; 110 111 private String smtpUser; 112 113 private String smtpPassword; 114 115 private boolean passwordEncriptionEnabled = false; 116 117 private int passwordEncryptionType = PasswordEncryptionService.MD5; 118 119 private File blogsDirectory = null; 120 121 private File usersDirectory = null; 122 123 130 public boolean getPasswordEncriptionEnabled() { 131 return passwordEncriptionEnabled; 132 } 133 134 public boolean isPasswordEncriptionEnabled() { 135 return passwordEncriptionEnabled; 136 } 137 138 public void setPasswordEncriptionEnabled(boolean passwordEncriptionEnabled) { 139 this.passwordEncriptionEnabled = passwordEncriptionEnabled; 140 } 141 142 149 public int getPasswordEncryptionType() { 150 return passwordEncryptionType; 151 } 152 153 156 public void setPasswordEncryptionType(int passwordEncryptionType) { 157 this.passwordEncryptionType = passwordEncryptionType; 158 } 159 160 166 public String getSmtpHost() { 167 return smtpHost; 168 } 169 170 public void setSmtpHost(String smtpHost) { 171 this.smtpHost = smtpHost; 172 } 173 174 180 public String getSmtpPassword() { 181 return smtpPassword; 182 } 183 184 public void setSmtpPassword(String smtpPassword) { 185 this.smtpPassword = smtpPassword; 186 } 187 188 194 public String getSmtpUser() { 195 return smtpUser; 196 } 197 198 public void setSmtpUser(String smtpUser) { 199 this.smtpUser = smtpUser; 200 } 201 202 208 public Locale getSystemLocale() { 209 return systemLocale; 210 } 211 212 216 public void setSystemLocale(Locale systemLocale) { 217 this.systemLocale = systemLocale; 218 } 219 220 234 public boolean getAccessLoggingEnabled() { 235 return accessLoggingEnabled; 236 } 237 238 245 public boolean isAccessLoggingEnabled() { 246 return accessLoggingEnabled; 247 } 248 249 public void setAccessLoggingEnabled(boolean accessLoggingEnabled) { 250 this.accessLoggingEnabled = accessLoggingEnabled; 251 } 252 253 260 public boolean getAllowNewUsers() { 261 return allowNewUsers; 262 } 263 264 267 public boolean isAllowNewUsers() { 268 return allowNewUsers; 269 } 270 271 275 public void setAllowNewUsers(boolean allowNewUsers) { 276 this.allowNewUsers = allowNewUsers; 277 } 278 279 285 public String getDataDir() { 286 return dataDir; 287 } 288 289 293 public void setDataDir(String dataDir) { 294 this.dataDir = dataDir; 295 } 296 297 308 public String getTempDir() { 309 return tempDir; 310 } 311 312 319 public void setTempDir(String tempDir) { 320 this.tempDir = tempDir; 321 } 322 323 329 public Long getId() { 330 return id; 331 } 332 333 337 public void setId(Long id) { 338 this.id = id; 339 } 340 341 360 366 public boolean getValidateNewUsers() { 367 return validateNewUsers; 368 } 369 370 373 public boolean isValidateNewUsers() { 374 return validateNewUsers; 375 } 376 377 381 public void setValidateNewUsers(boolean validateNewUsers) { 382 this.validateNewUsers = validateNewUsers; 383 } 384 385 388 public InputStream getVelocityPropertiesAsStream() { 389 390 return new ByteArrayInputStream (getVelocityProperties().getBytes()); 391 392 } 393 394 401 public String getVelocityProperties() { 402 return velocityProperties; 403 } 404 405 409 public void setVelocityProperties(String velocityProperties) { 410 this.velocityProperties = velocityProperties; 411 } 412 413 419 public String getDateFormat() { 420 return dateFormat; 421 } 422 423 427 public void setDateFormat(String dateFormat) { 428 this.dateFormat = dateFormat; 429 } 430 431 437 public String getDatetimeFormat() { 438 return datetimeFormat; 439 } 440 441 445 public void setDatetimeFormat(String datetimeFormat) { 446 this.datetimeFormat = datetimeFormat; 447 } 448 449 455 public String getTimeFormat() { 456 return timeFormat; 457 } 458 459 463 public void setTimeFormat(String timeFormat) { 464 this.timeFormat = timeFormat; 465 } 466 467 473 public String getSiteDescription() { 474 return siteDescription; 475 } 476 477 481 public void setSiteDescription(String siteDescription) { 482 this.siteDescription = siteDescription; 483 } 484 485 490 public String getSiteKeywords() { 491 return siteKeywords; 492 } 493 494 498 public void setSiteKeywords(String siteKeywords) { 499 this.siteKeywords = siteKeywords; 500 } 501 502 507 public String getSiteTitle() { 508 return siteTitle; 509 } 510 511 515 public void setSiteTitle(String siteTitle) { 516 this.siteTitle = siteTitle; 517 } 518 519 526 public int getCommunityBlogsPerUser() { 527 return communityBlogsPerUser; 528 } 529 530 534 public void setCommunityBlogsPerUser(int communityBlogsPerUser) { 535 this.communityBlogsPerUser = communityBlogsPerUser; 536 } 537 538 544 public int getIndividualBlogsPerUser() { 545 return individualBlogsPerUser; 546 } 547 548 552 public void setIndividualBlogsPerUser(int individualBlogsPerUser) { 553 this.individualBlogsPerUser = individualBlogsPerUser; 554 } 555 556 561 public int getUserpicsPerUser() { 562 return userpicsPerUser; 563 } 564 565 569 public void setUserpicsPerUser(int userpicsPerUser) { 570 this.userpicsPerUser = userpicsPerUser; 571 } 572 573 578 public int getMaxUserpicHeight() { 579 return maxUserpicHeight; 580 } 581 582 585 public void setMaxUserpicHeight(int maxUserpicHeight) { 586 this.maxUserpicHeight = maxUserpicHeight; 587 } 588 589 594 public int getMaxUserpicSize() { 595 return maxUserpicSize; 596 } 597 598 601 public void setMaxUserpicSize(int maxUserpicSize) { 602 this.maxUserpicSize = maxUserpicSize; 603 } 604 605 610 public int getMaxUserpicWidth() { 611 return maxUserpicWidth; 612 } 613 614 617 public void setMaxUserpicWidth(int maxUserpicWidth) { 618 this.maxUserpicWidth = maxUserpicWidth; 619 } 620 621 627 public boolean getRankingOn() { 628 return rankingOn; 629 } 630 631 634 public boolean isRankingOn() { 635 return rankingOn; 636 } 637 638 642 public void setRankingOn(boolean rankingOn) { 643 this.rankingOn = rankingOn; 644 } 645 646 653 public boolean getThemeEditingAllowed() { 654 return themeEditingAllowed; 655 } 656 657 660 public boolean isThemeEditingAllowed() { 661 return themeEditingAllowed; 662 } 663 664 668 public void setThemeEditingAllowed(boolean themeEditingAllowed) { 669 this.themeEditingAllowed = themeEditingAllowed; 670 } 671 672 677 public File getBlogsDirectory() { 678 if (blogsDirectory == null) blogsDirectory = new File (dataDir, "blogs"); 679 return blogsDirectory; 680 } 681 682 687 public File getUsersDirectory() { 688 if (usersDirectory == null) usersDirectory = new File (dataDir, "users"); 689 return usersDirectory; 690 } 691 } | Popular Tags |