📄 rollerconfigdata.java
字号:
*/ public String getUploadPath() { return uploadPath; } /** @ejb:persistent-field */ public void setUploadPath(String str) { uploadPath = str; } /** * @ejb:persistent-field * @hibernate.property column="memdebug" non-null="true" unique="false" */ public Boolean getMemDebug() { return mMemDebug; } /** * Set memory debugging on or off. * @param mMemDebug The mMemDebug to set * @ejb:persistent-field */ public void setMemDebug(Boolean memDebug) { mMemDebug = memDebug; } /** * @ejb:persistent-field * @hibernate.property column="autoformatcomments" non-null="true" unique="false" */ public Boolean getAutoformatComments() { return mAutoformatComments; } /** @ejb:persistent-field */ public void setAutoformatComments(Boolean value) { mAutoformatComments = value; } /** * @ejb:persistent-field * @hibernate.property column="escapecommenthtml" non-null="true" unique="false" */ public Boolean getEscapeCommentHtml() { return mEscapeCommentHtml; } /** @ejb:persistent-field */ public void setEscapeCommentHtml(Boolean value) { mEscapeCommentHtml = value; } /** * Does website allow Should Comments be emailed to participants? * * @ejb:persistent-field * @hibernate.property column="emailcomments" non-null="true" unique="false" */ public Boolean getEmailComments() { return mEmailComments; } /** * @ejb:persistent-field */ public void setEmailComments(Boolean emailComments) { this.mEmailComments = emailComments; } /** * Enable linkback. * @ejb:persistent-field * @hibernate.property column="enablelinkback" non-null="true" unique="false" */ public Boolean getEnableLinkback() { return mEnableLinkback; } /** * Enable linkback. * @ejb:persistent-field */ public void setEnableLinkback(Boolean b) { mEnableLinkback = b; } /** * @ejb:persistent-field * @hibernate.property column="sitedescription" non-null="false" unique="false" */ public String getSiteDescription() { return mSiteDescription; } /** * @param string * @ejb:persistent-field */ public void setSiteDescription(String string) { mSiteDescription = string; } /** * @ejb:persistent-field * @hibernate.property column="sitename" non-null="false" unique="false" */ public String getSiteName() { return mSiteName; } /** * @param string * @ejb:persistent-field */ public void setSiteName(String string) { mSiteName = string; } /** * @ejb:persistent-field * @hibernate.property column="emailaddress" non-null="false" unique="false" */ public String getEmailAddress() { return mEmailAddress; } /** * @param string * @ejb:persistent-field */ public void setEmailAddress(String emailAddress) { mEmailAddress = emailAddress; } /** * @ejb:persistent-field * @hibernate.property column="indexdir" non-null="false" unique="false" */ public String getIndexDir() { return mIndexDir; } /** * @param the new index directory * @ejb:persistent-field */ public void setIndexDir(String indexDir) { mIndexDir = indexDir; } /** * @ejb:persistent-field * @hibernate.property column="encryptpasswords" non-null="true" unique="false" */ public Boolean getEncryptPasswords() { return mEncryptPasswords; } /** @ejb:persistent-field */ public void setEncryptPasswords(Boolean value) { mEncryptPasswords = value; } /** * @ejb:persistent-field * @hibernate.property column="algorithm" non-null="false" unique="false" */ public String getAlgorithm() { return mAlgorithm; } /** * @param the new algorithm for encrypting passwords * @ejb:persistent-field */ public void setAlgorithm(String algorithm) { mAlgorithm = algorithm; } /** * @return Returns the mDatabaseVersion. * @hibernate.property column="dbversion" non-null="false" unique="false" */ public String getDatabaseVersion() { return mDatabaseVersion; } /** * @param databaseVersion The mDatabaseVersion to set. * @ejb:persistent-field */ public void setDatabaseVersion(String databaseVersion) { mDatabaseVersion = databaseVersion; } /** * @return Returns the mRefererSpamWords. * @hibernate.property column="refspamwords" non-null="false" unique="false" */ public String getRefererSpamWords() { return this.mRefererSpamWords; } /** * @param refererSpamWords The mRefererSpamWords to set. * @ejb:persistent-field */ public void setRefererSpamWords(String refererSpamWords) { this.mRefererSpamWords = refererSpamWords; } //---------------------------------------- end requisite getters & setters /** * Convenience method for getAdminUsers. **/ public String[] adminUsersArray() { return StringUtils.split(StringUtils.deleteWhitespace(mAdminUsers), ","); } /** * Convenience method for getEditorPages. **/ public List getEditorPagesList() { return Arrays.asList( StringUtils.split(StringUtils.deleteWhitespace(mEditorPages), ",")); } /** * Convenience method for getUploadAllow. **/ public String[] uploadAllowArray() { return StringUtils.split(StringUtils.deleteWhitespace(mUploadAllow), ","); } /** * Convenience method for getUploadForbid. **/ public String[] uploadForbidArray() { return StringUtils.split(StringUtils.deleteWhitespace(mUploadForbid), ","); } /** * Convenience method for getRefererSpamWords. **/ public String[] refererSpamWordsArray() { return StringUtils.split(StringUtils.deleteWhitespace(mRefererSpamWords), ","); } public void updateValues( RollerConfigData child ) { this.mAbsoluteURL = child.getAbsoluteURL(); this.mRssUseCache = child.getRssUseCache(); this.mRssCacheTime = child.getRssCacheTime(); this.mNewUserAllowed = child.getNewUserAllowed(); this.mAdminUsers = child.getAdminUsers(); this.mDatabaseVersion = child.getDatabaseVersion(); this.mUserThemes = child.getUserThemes(); this.mEditorPages = child.getEditorPages(); this.mEnableAggregator = child.getEnableAggregator(); this.mUploadEnabled = child.getUploadEnabled(); this.mUploadMaxDirMB = child.getUploadMaxDirMB(); this.mUploadMaxFileMB = child.getUploadMaxFileMB(); this.mUploadAllow = child.getUploadAllow(); this.mUploadForbid = child.getUploadForbid(); this.mUploadDir = child.getUploadDir(); this.uploadPath = child.getUploadPath(); this.mMemDebug = child.getMemDebug(); this.mAutoformatComments = child.getAutoformatComments(); this.mEscapeCommentHtml = child.getEscapeCommentHtml(); this.mEmailComments = child.getEmailComments(); this.mEnableLinkback = child.getEnableLinkback(); this.mSiteName = child.getSiteName(); this.mSiteDescription = child.getSiteDescription(); this.mEmailAddress = child.getEmailAddress(); this.mIndexDir = child.getIndexDir(); this.mEncryptPasswords = child.getEncryptPasswords(); this.mAlgorithm = child.getAlgorithm(); this.mRefererSpamWords = child.getRefererSpamWords(); } /** nice output for debugging */ public String toString() { StringBuffer buf = new StringBuffer(); buf.append("RollerConfig \n"); Class clazz = getClass(); Field[] fields = clazz.getDeclaredFields(); try { AccessibleObject.setAccessible(fields, true); for (int i = 0; i < fields.length; i++) { buf.append( "\t[" + fields[i].getName() + "=" + fields[i].get(this) + "], \n"); } } catch (Exception e) { // ignored! } return buf.toString(); } public void setData(PersistentObject vo) { if (vo instanceof RollerConfigData) { this.id = ((RollerConfigData)vo).id; updateValues((RollerConfigData)vo); } } public boolean equals(Object pOther) { if (pOther instanceof WebsiteData) { RollerConfigData lTest = (RollerConfigData) pOther; boolean lEquals = true; lEquals = PojoUtil.equals(lEquals, this.id, lTest.id); lEquals = PojoUtil.equals(lEquals, this.mAbsoluteURL, lTest.getAbsoluteURL()); lEquals = PojoUtil.equals(lEquals, this.mRssUseCache, lTest.getRssUseCache()); lEquals = PojoUtil.equals(lEquals, this.mRssCacheTime, lTest.getRssCacheTime()); lEquals = PojoUtil.equals(lEquals, this.mNewUserAllowed, lTest.getNewUserAllowed()); lEquals = PojoUtil.equals(lEquals, this.mAdminUsers, lTest.getAdminUsers()); lEquals = PojoUtil.equals(lEquals, this.mUserThemes, lTest.getUserThemes()); lEquals = PojoUtil.equals(lEquals, this.mEditorPages, lTest.getEditorPages()); lEquals = PojoUtil.equals(lEquals, this.mEnableAggregator, lTest.getEnableAggregator()); lEquals = PojoUtil.equals(lEquals, this.mUploadEnabled, lTest.getUploadEnabled()); lEquals = PojoUtil.equals(lEquals, this.mUploadMaxDirMB, lTest.getUploadMaxDirMB()); lEquals = PojoUtil.equals(lEquals, this.mUploadMaxFileMB, lTest.getUploadMaxFileMB()); lEquals = PojoUtil.equals(lEquals, this.mUploadAllow, lTest.getUploadAllow()); lEquals = PojoUtil.equals(lEquals, this.mUploadForbid, lTest.getUploadForbid()); lEquals = PojoUtil.equals(lEquals, this.mUploadDir, lTest.getUploadDir()); lEquals = PojoUtil.equals(lEquals, this.uploadPath, lTest.getUploadPath()); lEquals = PojoUtil.equals(lEquals, this.mMemDebug, lTest.getMemDebug()); lEquals = PojoUtil.equals(lEquals, this.mAutoformatComments, lTest.getAutoformatComments()); lEquals = PojoUtil.equals(lEquals, this.mEscapeCommentHtml, lTest.getEscapeCommentHtml()); lEquals = PojoUtil.equals(lEquals, this.mEmailComments, lTest.getEmailComments()); lEquals = PojoUtil.equals(lEquals, this.mEnableLinkback, lTest.getEnableLinkback()); lEquals = PojoUtil.equals(lEquals, this.mSiteName, lTest.getSiteName()); lEquals = PojoUtil.equals(lEquals, this.mSiteDescription, lTest.getSiteDescription()); lEquals = PojoUtil.equals(lEquals, this.mEmailAddress, lTest.getEmailAddress()); lEquals = PojoUtil.equals(lEquals, this.mIndexDir, lTest.getIndexDir()); lEquals = PojoUtil.equals(lEquals, this.mEncryptPasswords, lTest.getEncryptPasswords()); lEquals = PojoUtil.equals(lEquals, this.mAlgorithm, lTest.getAlgorithm()); lEquals = PojoUtil.equals(lEquals, this.mRefererSpamWords, lTest.getRefererSpamWords()); return lEquals; } else { return false; } } public int hashCode() { return super.hashCode(); } public boolean canSave() throws RollerException { Roller roller = RollerFactory.getRoller(); if (roller.getUser().equals(UserData.SYSTEM_USER)) { return true; } if (roller.getUser().hasRole("admin")) { return true; } return false; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -