KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > roller > pojos > RollerConfigData


1 package org.roller.pojos;
2
3 import java.io.File JavaDoc;
4 import java.lang.reflect.AccessibleObject JavaDoc;
5 import java.lang.reflect.Field JavaDoc;
6 import java.math.BigDecimal JavaDoc;
7 import java.util.Arrays JavaDoc;
8 import java.util.List JavaDoc;
9
10 import org.apache.commons.lang.StringUtils;
11 import org.roller.RollerException;
12 import org.roller.model.Roller;
13 import org.roller.model.RollerFactory;
14 import org.roller.util.PojoUtil;
15
16 /**
17  * Configuration object for Roller. Reads and writes roller-config.xml.
18  * RollerConfig extends Struts ActionForm so that it can be extended by
19  * RollerConfigForm in the administrator pages.
20  * <p />
21  * This is where you set default Roller configuration values.
22  *
23  * @ejb:bean name="RollerConfigData"
24  * @struts.form include-all="true"
25  * @hibernate.class table="rollerconfig"
26  * hibernate.jcs-cache usage="read-write"
27  */

28 public class RollerConfigData
29     extends org.roller.pojos.PersistentObject
30     implements java.io.Serializable JavaDoc
31 {
32     static final long serialVersionUID = -6354583200913127875L;
33
34     protected java.lang.String JavaDoc id = null;
35     
36     /**
37      * Roller database version.
38      */

39     protected String JavaDoc mDatabaseVersion = "995"; // 1.0 will be '1000'
40

41     /**
42      * Absolute URL for site, for cases where infered absolute URL doesn't work.
43      */

44     protected String JavaDoc mAbsoluteURL = null;
45
46     /**
47      * Should Roller cache return RSS pages.
48      */

49     protected Boolean JavaDoc mRssUseCache = Boolean.FALSE;
50
51     /**
52      * Duration to cache RSS pages (in seconds).
53      */

54     protected Integer JavaDoc mRssCacheTime = new Integer JavaDoc(3000);
55
56     /**
57      * Does Roller allow the creation of new users.
58      */

59     protected Boolean JavaDoc mNewUserAllowed = Boolean.TRUE;
60
61     /**
62      * @deprecated Admins now indicated by roles in userroles table.
63      */

64     protected String JavaDoc mAdminUsers = "admin";
65
66     /**
67      * Where to get Themes presented to new users.
68      */

69     protected String JavaDoc mUserThemes = "/themes";
70
71     /**
72      * List of "editor pages" for the Weblog entry editor
73      * seperated with commas.
74      */

75     protected String JavaDoc mEditorPages =
76            "editor-text.jsp,editor-text-js.jsp,editor-rte.jsp,editor-dhtml.jsp,editor-ekit.jsp,editor-wiki-js.jsp";
77
78     /**
79      * Dis/enble RSS aggregation capabilities.
80      */

81     protected Boolean JavaDoc mEnableAggregator = Boolean.FALSE;
82
83     /**
84      * Are file uploads enabled.
85      */

86     protected Boolean JavaDoc mUploadEnabled = Boolean.TRUE;
87
88     /**
89      * The maximum size of each user's upload directory.
90      */

91     protected BigDecimal JavaDoc mUploadMaxDirMB = new BigDecimal JavaDoc("2");
92
93     /**
94      * The maximum size allowed per uploaded file.
95      */

96     protected BigDecimal JavaDoc mUploadMaxFileMB = new BigDecimal JavaDoc(".5");
97
98     /**
99      * List of permitted file extensions (not including the "dot")
100      * seperated with commas.
101      * This attribute is mutually exclusive with uploadForbid.
102      */

103     protected String JavaDoc mUploadAllow = "";
104
105     /**
106      * List of forbidden file extensions (not including the "dot")
107      * seperated with commas.
108      * This attribute is mutually exclusive with uploadAllow.
109      */

110     protected String JavaDoc mUploadForbid = "";
111
112     /**
113      * Directory where uploaded files will be stored.
114      * May end with a slash. Optional, this value will
115      * default to RollerContext.USER_RESOURCES. If specified,
116      * should be a full path on the system harddrive or
117      * relative to the WebApp.
118      */

119     protected String JavaDoc mUploadDir = "";
120
121     /**
122      * The path from which the webserver will serve upload files.
123      * This values must not end in a slash.
124      */

125     protected String JavaDoc uploadPath = "/resources";
126
127     protected Boolean JavaDoc mMemDebug = Boolean.FALSE;
128
129     /**
130      * Determines if the Comment page will "autoformat"
131      * comments. That is, replace carriage-returns with <br />.
132      */

133     protected Boolean JavaDoc mAutoformatComments = Boolean.FALSE;
134
135     /**
136      * Determines if the Comment page will escape html in comments.
137      */

138     protected Boolean JavaDoc mEscapeCommentHtml = Boolean.FALSE;
139
140     /**
141      * Determines if e-mailing comments is enabled.
142      */

143     protected Boolean JavaDoc mEmailComments = Boolean.FALSE;
144
145     /**
146      * Enable linkback extraction.
147      */

148     protected Boolean JavaDoc mEnableLinkback = Boolean.FALSE;
149
150     /**
151      * Name of this site
152      */

153     protected String JavaDoc mSiteName = "Roller-based Site";
154
155     /**
156      * Description of this site
157      */

158     protected String JavaDoc mSiteDescription = "Roller-based Site";
159
160     /**
161      * Site administrator's email address
162      */

163     protected String JavaDoc mEmailAddress = "";
164
165     /**
166      * Lucene index directory
167      */

168     protected String JavaDoc mIndexDir = "${user.home}" + File.separator
169                                  + "roller-index";
170     
171     /**
172      * Flag for encrypting passwords
173      */

174     protected Boolean JavaDoc mEncryptPasswords = Boolean.FALSE;
175     
176     protected String JavaDoc mAlgorithm = "SHA";
177     
178     /**
179      * Comma-delimited list of "words" for filtering referrer spam.
180      */

181     protected String JavaDoc mRefererSpamWords = "";
182     
183     //-------------------------------------- begin requisite getters & setters
184

185     /**
186      * Not remote since primary key may be extracted by other means.
187      *
188      * @struts.validator type="required" msgkey="errors.required"
189      * @ejb:persistent-field
190      * @hibernate.id column="id" type="string"
191      * generator-class="uuid.hex" unsaved-value="null"
192      */

193     public String JavaDoc getId() {
194         return this.id;
195     }
196
197     /** @ejb:persistent-field */
198     public void setId(String JavaDoc id) {
199         this.id = id;
200     }
201
202     /**
203      * @ejb:persistent-field
204      * @hibernate.property column="absoluteurl" non-null="false" unique="false"
205      */

206     public String JavaDoc getAbsoluteURL()
207     {
208         return mAbsoluteURL;
209     }
210     /** @ejb:persistent-field */
211     public void setAbsoluteURL(String JavaDoc string)
212     {
213         mAbsoluteURL = string;
214     }
215
216     /**
217      * @ejb:persistent-field
218      * @hibernate.property column="rssusecache" non-null="true" unique="false"
219      */

220     public Boolean JavaDoc getRssUseCache()
221     {
222         return mRssUseCache;
223     }
224     /** @ejb:persistent-field */
225     public void setRssUseCache(Boolean JavaDoc use)
226     {
227         mRssUseCache = use;
228     }
229
230     /**
231      * @ejb:persistent-field
232      * @hibernate.property column="rsscachetime" non-null="true" unique="false"
233      */

234     public Integer JavaDoc getRssCacheTime()
235     {
236         return mRssCacheTime;
237     }
238     /** @ejb:persistent-field */
239     public void setRssCacheTime(Integer JavaDoc cacheTime)
240     {
241         mRssCacheTime = cacheTime;
242     }
243
244     /**
245     * @ejb:persistent-field
246     * @hibernate.property column="newuserallowed" non-null="true" unique="false"
247     */

248     public Boolean JavaDoc getNewUserAllowed()
249     {
250         return mNewUserAllowed;
251     }
252     /** @ejb:persistent-field */
253     public void setNewUserAllowed(Boolean JavaDoc use)
254     {
255         mNewUserAllowed = use;
256     }
257
258     /**
259      * @deprecated Admins now indicated by roles in userroles table.
260      */

261     public String JavaDoc getAdminUsers()
262     {
263         return mAdminUsers;
264     }
265     /**
266      * @deprecated Admins now indicated by roles in userroles table.
267      */

268     public void setAdminUsers(String JavaDoc _adminUsers)
269     {
270         mAdminUsers = _adminUsers;
271     }
272
273     /**
274      * @ejb:persistent-field
275      * @hibernate.property column="userthemes" non-null="true" unique="false"
276      */

277     public String JavaDoc getUserThemes()
278     {
279         return mUserThemes;
280     }
281     /** @ejb:persistent-field */
282     public void setUserThemes(String JavaDoc str)
283     {
284         mUserThemes = str;
285     }
286
287     /**
288      * @ejb:persistent-field
289      * @hibernate.property column="editorpages" non-null="false" unique="false"
290      */

291     public String JavaDoc getEditorPages()
292     {
293         return mEditorPages;
294     }
295     /** @ejb:persistent-field */
296     public void setEditorPages(String JavaDoc _editorPages)
297     {
298         mEditorPages = _editorPages;
299     }
300
301     /**
302     * @ejb:persistent-field
303     * @hibernate.property column="enableaggregator" non-null="true" unique="false"
304     */

305     public Boolean JavaDoc getEnableAggregator()
306     {
307         return mEnableAggregator;
308     }
309     /** @ejb:persistent-field */
310     public void setEnableAggregator(Boolean JavaDoc use)
311     {
312         mEnableAggregator = use;
313     }
314
315     /**
316     * @ejb:persistent-field
317     * @hibernate.property column="uploadenabled" non-null="true" unique="false"
318     */

319     public Boolean JavaDoc getUploadEnabled()
320     {
321         return mUploadEnabled;
322     }
323     /** @ejb:persistent-field */
324     public void setUploadEnabled(Boolean JavaDoc use)
325     {
326         mUploadEnabled = use;
327     }
328
329     /**
330     * @ejb:persistent-field
331     * @hibernate.property column="uploadmaxdirmb"
332     * non-null="true" unique="false" type="big_decimal"
333     */

334     public BigDecimal JavaDoc getUploadMaxDirMB()
335     {
336         return mUploadMaxDirMB;
337     }
338     /** @ejb:persistent-field */
339     public void setUploadMaxDirMB(BigDecimal JavaDoc use)
340     {
341         mUploadMaxDirMB = use;
342     }
343
344     /**
345     * @ejb:persistent-field
346     * @hibernate.property column="uploadmaxfilemb"
347     * non-null="true" unique="false" type="big_decimal"
348     */

349     public BigDecimal JavaDoc getUploadMaxFileMB()
350     {
351         return mUploadMaxFileMB;
352     }
353     /** @ejb:persistent-field */
354     public void setUploadMaxFileMB(BigDecimal JavaDoc use)
355     {
356         mUploadMaxFileMB = use;
357     }
358
359     /**
360      * @ejb:persistent-field
361      * @hibernate.property column="uploadallow" non-null="true" unique="false"
362      */

363     public String JavaDoc getUploadAllow()
364     {
365         return mUploadAllow;
366     }
367     /** @ejb:persistent-field */
368     public void setUploadAllow(String JavaDoc _uploadAllow)
369     {
370         mUploadAllow = _uploadAllow;
371     }
372
373     /**
374      * @ejb:persistent-field
375      * @hibernate.property column="uploadforbid" non-null="true" unique="false"
376      */

377     public String JavaDoc getUploadForbid()
378     {
379         return mUploadForbid;
380     }
381     /** @ejb:persistent-field */
382     public void setUploadForbid(String JavaDoc _uploadForbid)
383     {
384         mUploadForbid = _uploadForbid;
385     }
386
387     /**
388      * @ejb:persistent-field
389      * @hibernate.property column="uploaddir" non-null="true" unique="false"
390      */

391     public String JavaDoc getUploadDir()
392     {
393         return mUploadDir;
394     }
395     /** @ejb:persistent-field */
396     public void setUploadDir(String JavaDoc str)
397     {
398         mUploadDir = str;
399     }
400
401     /**
402      * @ejb:persistent-field
403      * @hibernate.property column="uploadpath" non-null="true" unique="false"
404      */

405     public String JavaDoc getUploadPath()
406     {
407         return uploadPath;
408     }
409     /** @ejb:persistent-field */
410     public void setUploadPath(String JavaDoc str)
411     {
412         uploadPath = str;
413     }
414
415     /**
416     * @ejb:persistent-field
417     * @hibernate.property column="memdebug" non-null="true" unique="false"
418     */

419     public Boolean JavaDoc getMemDebug() { return mMemDebug; }
420
421     /**
422      * Set memory debugging on or off.
423      * @param mMemDebug The mMemDebug to set
424      * @ejb:persistent-field
425      */

426     public void setMemDebug(Boolean JavaDoc memDebug)
427     {
428         mMemDebug = memDebug;
429     }
430
431     /**
432     * @ejb:persistent-field
433     * @hibernate.property column="autoformatcomments" non-null="true" unique="false"
434     */

435     public Boolean JavaDoc getAutoformatComments()
436     {
437         return mAutoformatComments;
438     }
439     /** @ejb:persistent-field */
440     public void setAutoformatComments(Boolean JavaDoc value)
441     {
442         mAutoformatComments = value;
443     }
444
445     /**
446     * @ejb:persistent-field
447     * @hibernate.property column="escapecommenthtml" non-null="true" unique="false"
448     */

449     public Boolean JavaDoc getEscapeCommentHtml()
450     {
451         return mEscapeCommentHtml;
452     }
453     /** @ejb:persistent-field */
454     public void setEscapeCommentHtml(Boolean JavaDoc value)
455     {
456         mEscapeCommentHtml = value;
457     }
458     
459     /**
460      * Does website allow Should Comments be emailed to participants?
461      *
462      * @ejb:persistent-field
463      * @hibernate.property column="emailcomments" non-null="true" unique="false"
464      */

465     public Boolean JavaDoc getEmailComments()
466     {
467         return mEmailComments;
468     }
469
470     /**
471      * @ejb:persistent-field
472      */

473     public void setEmailComments(Boolean JavaDoc emailComments)
474     {
475         this.mEmailComments = emailComments;
476     }
477
478     /**
479      * Enable linkback.
480      * @ejb:persistent-field
481      * @hibernate.property column="enablelinkback" non-null="true" unique="false"
482     */

483     public Boolean JavaDoc getEnableLinkback()
484     {
485         return mEnableLinkback;
486     }
487
488     /**
489      * Enable linkback.
490      * @ejb:persistent-field
491      */

492     public void setEnableLinkback(Boolean JavaDoc b)
493     {
494         mEnableLinkback = b;
495     }
496
497
498     /**
499      * @ejb:persistent-field
500      * @hibernate.property column="sitedescription" non-null="false" unique="false"
501      */

502     public String JavaDoc getSiteDescription()
503     {
504         return mSiteDescription;
505     }
506
507     /**
508      * @param string
509      * @ejb:persistent-field
510      */

511     public void setSiteDescription(String JavaDoc string)
512     {
513         mSiteDescription = string;
514     }
515
516     /**
517      * @ejb:persistent-field
518      * @hibernate.property column="sitename" non-null="false" unique="false"
519      */

520     public String JavaDoc getSiteName()
521     {
522         return mSiteName;
523     }
524
525     /**
526      * @param string
527      * @ejb:persistent-field
528      */

529     public void setSiteName(String JavaDoc string)
530     {
531         mSiteName = string;
532     }
533
534     /**
535      * @ejb:persistent-field
536      * @hibernate.property column="emailaddress" non-null="false" unique="false"
537      */

538     public String JavaDoc getEmailAddress()
539     {
540         return mEmailAddress;
541     }
542
543     /**
544      * @param string
545      * @ejb:persistent-field
546      */

547     public void setEmailAddress(String JavaDoc emailAddress)
548     {
549         mEmailAddress = emailAddress;
550     }
551
552     /**
553      * @ejb:persistent-field
554      * @hibernate.property column="indexdir" non-null="false" unique="false"
555      */

556     public String JavaDoc getIndexDir() {
557
558         return mIndexDir;
559     }
560
561     /**
562      * @param the new index directory
563      * @ejb:persistent-field
564      */

565     public void setIndexDir(String JavaDoc indexDir)
566     {
567         mIndexDir = indexDir;
568     }
569
570     /**
571      * @ejb:persistent-field
572      * @hibernate.property column="encryptpasswords" non-null="true" unique="false"
573      */

574     public Boolean JavaDoc getEncryptPasswords()
575     {
576         return mEncryptPasswords;
577     }
578     /** @ejb:persistent-field */
579     public void setEncryptPasswords(Boolean JavaDoc value)
580     {
581         mEncryptPasswords = value;
582     }
583     
584     /**
585      * @ejb:persistent-field
586      * @hibernate.property column="algorithm" non-null="false" unique="false"
587      */

588     public String JavaDoc getAlgorithm() {
589
590         return mAlgorithm;
591     }
592
593     /**
594      * @param the new algorithm for encrypting passwords
595      * @ejb:persistent-field
596      */

597     public void setAlgorithm(String JavaDoc algorithm)
598     {
599         mAlgorithm = algorithm;
600     }
601         
602     /**
603      * @return Returns the mDatabaseVersion.
604      * @hibernate.property column="dbversion" non-null="false" unique="false"
605      */

606     public String JavaDoc getDatabaseVersion() {
607         return mDatabaseVersion;
608     }
609     /**
610      * @param databaseVersion The mDatabaseVersion to set.
611      * @ejb:persistent-field
612      */

613     public void setDatabaseVersion(String JavaDoc databaseVersion) {
614         mDatabaseVersion = databaseVersion;
615     }
616
617     /**
618      * @return Returns the mRefererSpamWords.
619      * @hibernate.property column="refspamwords" non-null="false" unique="false"
620      */

621     public String JavaDoc getRefererSpamWords()
622     {
623         return this.mRefererSpamWords;
624     }
625     /**
626      * @param refererSpamWords The mRefererSpamWords to set.
627      * @ejb:persistent-field
628      */

629     public void setRefererSpamWords(String JavaDoc refererSpamWords)
630     {
631         this.mRefererSpamWords = refererSpamWords;
632     }
633
634     //---------------------------------------- end requisite getters & setters
635

636     /**
637      * Convenience method for getAdminUsers.
638      **/

639     public String JavaDoc[] adminUsersArray()
640     {
641         return StringUtils.split(StringUtils.deleteWhitespace(mAdminUsers), ",");
642     }
643
644     /**
645      * Convenience method for getEditorPages.
646      **/

647     public List JavaDoc getEditorPagesList()
648     {
649         return Arrays.asList(
650             StringUtils.split(StringUtils.deleteWhitespace(mEditorPages), ","));
651     }
652
653     /**
654      * Convenience method for getUploadAllow.
655      **/

656     public String JavaDoc[] uploadAllowArray()
657     {
658         return StringUtils.split(StringUtils.deleteWhitespace(mUploadAllow), ",");
659     }
660
661     /**
662      * Convenience method for getUploadForbid.
663      **/

664     public String JavaDoc[] uploadForbidArray()
665     {
666         return StringUtils.split(StringUtils.deleteWhitespace(mUploadForbid), ",");
667     }
668
669     /**
670      * Convenience method for getRefererSpamWords.
671      **/

672     public String JavaDoc[] refererSpamWordsArray()
673     {
674         return StringUtils.split(StringUtils.deleteWhitespace(mRefererSpamWords), ",");
675     }
676
677     public void updateValues( RollerConfigData child )
678     {
679         this.mAbsoluteURL = child.getAbsoluteURL();
680         this.mRssUseCache = child.getRssUseCache();
681         this.mRssCacheTime = child.getRssCacheTime();
682         this.mNewUserAllowed = child.getNewUserAllowed();
683         this.mAdminUsers = child.getAdminUsers();
684         this.mDatabaseVersion = child.getDatabaseVersion();
685         this.mUserThemes = child.getUserThemes();
686         this.mEditorPages = child.getEditorPages();
687         this.mEnableAggregator = child.getEnableAggregator();
688         this.mUploadEnabled = child.getUploadEnabled();
689         this.mUploadMaxDirMB = child.getUploadMaxDirMB();
690         this.mUploadMaxFileMB = child.getUploadMaxFileMB();
691         this.mUploadAllow = child.getUploadAllow();
692         this.mUploadForbid = child.getUploadForbid();
693         this.mUploadDir = child.getUploadDir();
694         this.uploadPath = child.getUploadPath();
695         this.mMemDebug = child.getMemDebug();
696         this.mAutoformatComments = child.getAutoformatComments();
697         this.mEscapeCommentHtml = child.getEscapeCommentHtml();
698         this.mEmailComments = child.getEmailComments();
699         this.mEnableLinkback = child.getEnableLinkback();
700         this.mSiteName = child.getSiteName();
701         this.mSiteDescription = child.getSiteDescription();
702         this.mEmailAddress = child.getEmailAddress();
703         this.mIndexDir = child.getIndexDir();
704         this.mEncryptPasswords = child.getEncryptPasswords();
705         this.mAlgorithm = child.getAlgorithm();
706         this.mRefererSpamWords = child.getRefererSpamWords();
707     }
708
709     /** nice output for debugging */
710     public String JavaDoc toString()
711     {
712         StringBuffer JavaDoc buf = new StringBuffer JavaDoc();
713         buf.append("RollerConfig \n");
714         Class JavaDoc clazz = getClass();
715         Field JavaDoc[] fields = clazz.getDeclaredFields();
716
717         try {
718             AccessibleObject.setAccessible(fields, true);
719             for (int i = 0; i < fields.length; i++) {
720                 buf.append(
721                     "\t["
722                         + fields[i].getName()
723                         + "="
724                         + fields[i].get(this)
725                         + "], \n");
726             }
727         } catch (Exception JavaDoc e) {
728             // ignored!
729
}
730
731         return buf.toString();
732     }
733
734
735     public void setData(PersistentObject vo) {
736         if (vo instanceof RollerConfigData) {
737             this.id = ((RollerConfigData)vo).id;
738             updateValues((RollerConfigData)vo);
739         }
740     }
741
742     public boolean equals(Object JavaDoc pOther)
743     {
744         if (pOther instanceof WebsiteData)
745         {
746             RollerConfigData lTest = (RollerConfigData) pOther;
747             boolean lEquals = true;
748
749             lEquals = PojoUtil.equals(lEquals, this.id, lTest.id);
750             lEquals = PojoUtil.equals(lEquals, this.mAbsoluteURL, lTest.getAbsoluteURL());
751             lEquals = PojoUtil.equals(lEquals, this.mRssUseCache, lTest.getRssUseCache());
752             lEquals = PojoUtil.equals(lEquals, this.mRssCacheTime, lTest.getRssCacheTime());
753             lEquals = PojoUtil.equals(lEquals, this.mNewUserAllowed, lTest.getNewUserAllowed());
754             lEquals = PojoUtil.equals(lEquals, this.mAdminUsers, lTest.getAdminUsers());
755             lEquals = PojoUtil.equals(lEquals, this.mUserThemes, lTest.getUserThemes());
756             lEquals = PojoUtil.equals(lEquals, this.mEditorPages, lTest.getEditorPages());
757             lEquals = PojoUtil.equals(lEquals, this.mEnableAggregator, lTest.getEnableAggregator());
758             lEquals = PojoUtil.equals(lEquals, this.mUploadEnabled, lTest.getUploadEnabled());
759             lEquals = PojoUtil.equals(lEquals, this.mUploadMaxDirMB, lTest.getUploadMaxDirMB());
760             lEquals = PojoUtil.equals(lEquals, this.mUploadMaxFileMB, lTest.getUploadMaxFileMB());
761             lEquals = PojoUtil.equals(lEquals, this.mUploadAllow, lTest.getUploadAllow());
762             lEquals = PojoUtil.equals(lEquals, this.mUploadForbid, lTest.getUploadForbid());
763             lEquals = PojoUtil.equals(lEquals, this.mUploadDir, lTest.getUploadDir());
764             lEquals = PojoUtil.equals(lEquals, this.uploadPath, lTest.getUploadPath());
765             lEquals = PojoUtil.equals(lEquals, this.mMemDebug, lTest.getMemDebug());
766             lEquals = PojoUtil.equals(lEquals, this.mAutoformatComments, lTest.getAutoformatComments());
767             lEquals = PojoUtil.equals(lEquals, this.mEscapeCommentHtml, lTest.getEscapeCommentHtml());
768             lEquals = PojoUtil.equals(lEquals, this.mEmailComments, lTest.getEmailComments());
769             lEquals = PojoUtil.equals(lEquals, this.mEnableLinkback, lTest.getEnableLinkback());
770             lEquals = PojoUtil.equals(lEquals, this.mSiteName, lTest.getSiteName());
771             lEquals = PojoUtil.equals(lEquals, this.mSiteDescription, lTest.getSiteDescription());
772             lEquals = PojoUtil.equals(lEquals, this.mEmailAddress, lTest.getEmailAddress());
773             lEquals = PojoUtil.equals(lEquals, this.mIndexDir, lTest.getIndexDir());
774             lEquals = PojoUtil.equals(lEquals, this.mEncryptPasswords, lTest.getEncryptPasswords());
775             lEquals = PojoUtil.equals(lEquals, this.mAlgorithm, lTest.getAlgorithm());
776             lEquals = PojoUtil.equals(lEquals, this.mRefererSpamWords, lTest.getRefererSpamWords());
777
778             return lEquals;
779         }
780         else
781         {
782             return false;
783         }
784     }
785     
786     public int hashCode()
787     {
788         return super.hashCode();
789     }
790
791     public boolean canSave() throws RollerException
792     {
793         Roller roller = RollerFactory.getRoller();
794         if (roller.getUser().equals(UserData.SYSTEM_USER))
795         {
796             return true;
797         }
798         if (roller.getUser().hasRole("admin"))
799         {
800             return true;
801         }
802         return false;
803     }
804 }
805
Popular Tags