1 2 package org.roller.presentation.website.formbeans; 3 4 import javax.servlet.http.HttpServletRequest ; 5 6 import org.apache.struts.action.ActionMapping; 7 import org.roller.RollerException; 8 import org.roller.pojos.RollerConfigData; 9 import org.roller.presentation.forms.RollerConfigForm; 10 11 17 public class RollerConfigFormEx extends RollerConfigForm 18 { 19 public RollerConfigFormEx() 20 { 21 } 22 23 public RollerConfigFormEx( RollerConfigData config, java.util.Locale locale ) throws RollerException 24 { 25 super(config, locale); 26 } 27 28 31 public void copyFrom(org.roller.pojos.RollerConfigData dataHolder, java.util.Locale locale) throws RollerException 32 { 33 super.copyFrom(dataHolder, locale); 34 fixNulls(); 35 this.uploadMaxFileMB = dataHolder.getUploadMaxFileMB(); 36 this.uploadMaxDirMB = dataHolder.getUploadMaxDirMB(); 37 } 38 39 42 public void copyTo(org.roller.pojos.RollerConfigData dataHolder, java.util.Locale locale) throws RollerException 43 { 44 fixNulls(); 45 super.copyTo(dataHolder, locale); 46 dataHolder.setUploadMaxFileMB(this.uploadMaxFileMB); 47 dataHolder.setUploadMaxDirMB(this.uploadMaxDirMB); 48 } 49 50 53 public void reset(ActionMapping mapping, HttpServletRequest request) 54 { 55 setAbsoluteURL( null ); 56 fixNulls(); 57 } 58 59 private void fixNulls() 60 { 61 if (getRssUseCache() == null) setRssUseCache( Boolean.FALSE ); 62 if (getNewUserAllowed() == null) setNewUserAllowed( Boolean.FALSE ); 63 if (getEnableAggregator() == null) setEnableAggregator( Boolean.FALSE ); 64 if (getUploadEnabled() == null) setUploadEnabled( Boolean.FALSE ); 65 if (getMemDebug() == null) setMemDebug( Boolean.FALSE ); 66 if (getAutoformatComments() == null) setAutoformatComments( Boolean.FALSE ); 67 if (getEscapeCommentHtml() == null) setEscapeCommentHtml( Boolean.FALSE ); 68 if (getEmailComments() == null) setEmailComments( Boolean.FALSE ); 69 if (getEnableLinkback() == null) setEnableLinkback( Boolean.FALSE ); 70 if (getEncryptPasswords() == null) setEncryptPasswords( Boolean.FALSE ); 71 } 72 } | Popular Tags |