1 18 19 package org.apache.roller.ui.authoring.struts.formbeans; 20 21 import javax.servlet.http.HttpServletRequest ; 22 23 import org.apache.struts.action.ActionMapping; 24 import org.apache.roller.RollerException; 25 import org.apache.roller.pojos.RollerConfigData; 26 import org.apache.roller.ui.authoring.struts.forms.RollerConfigForm; 27 28 34 public class RollerConfigFormEx extends RollerConfigForm 35 { 36 public RollerConfigFormEx() 37 { 38 } 39 40 public RollerConfigFormEx( RollerConfigData config, java.util.Locale locale ) throws RollerException 41 { 42 super(config, locale); 43 } 44 45 48 public void copyFrom(org.apache.roller.pojos.RollerConfigData dataHolder, java.util.Locale locale) throws RollerException 49 { 50 super.copyFrom(dataHolder, locale); 51 fixNulls(); 52 this.uploadMaxFileMB = dataHolder.getUploadMaxFileMB(); 53 this.uploadMaxDirMB = dataHolder.getUploadMaxDirMB(); 54 } 55 56 59 public void copyTo(org.apache.roller.pojos.RollerConfigData dataHolder, java.util.Locale locale) throws RollerException 60 { 61 fixNulls(); 62 super.copyTo(dataHolder, locale); 63 dataHolder.setUploadMaxFileMB(this.uploadMaxFileMB); 64 dataHolder.setUploadMaxDirMB(this.uploadMaxDirMB); 65 } 66 67 70 public void reset(ActionMapping mapping, HttpServletRequest request) 71 { 72 setAbsoluteURL( null ); 73 fixNulls(); 74 } 75 76 private void fixNulls() 77 { 78 if (getRssUseCache() == null) setRssUseCache( Boolean.FALSE ); 79 if (getNewUserAllowed() == null) setNewUserAllowed( Boolean.FALSE ); 80 if (getEnableAggregator() == null) setEnableAggregator( Boolean.FALSE ); 81 if (getUploadEnabled() == null) setUploadEnabled( Boolean.FALSE ); 82 if (getMemDebug() == null) setMemDebug( Boolean.FALSE ); 83 if (getAutoformatComments() == null) setAutoformatComments( Boolean.FALSE ); 84 if (getEscapeCommentHtml() == null) setEscapeCommentHtml( Boolean.FALSE ); 85 if (getEmailComments() == null) setEmailComments( Boolean.FALSE ); 86 if (getEnableLinkback() == null) setEnableLinkback( Boolean.FALSE ); 87 if (getEncryptPasswords() == null) setEncryptPasswords( Boolean.FALSE ); 88 } 89 } | Popular Tags |