1 4 package org.roller.presentation.website.formbeans; 5 6 import org.apache.commons.lang.StringUtils; 7 import org.roller.RollerException; 8 import org.roller.pojos.WebsiteData; 9 import org.roller.presentation.forms.WebsiteForm; 10 11 14 public class WebsiteFormEx extends WebsiteForm 15 { 16 private String bloggerCategoryId; 17 private String defaultCategoryId; 18 private String [] defaultPluginsArray; 19 20 23 public String getBloggerCategoryId() 24 { 25 return bloggerCategoryId; 26 } 27 28 31 public void setBloggerCategoryId(String bloggerCategoryId) 32 { 33 this.bloggerCategoryId = bloggerCategoryId; 34 } 35 36 39 public String getDefaultCategoryId() 40 { 41 return defaultCategoryId; 42 } 43 44 47 public void setDefaultCategoryId(String defeaultCategoryId) 48 { 49 this.defaultCategoryId = defeaultCategoryId; 50 } 51 52 55 public String [] getDefaultPluginsArray() 56 { 57 return defaultPluginsArray; 58 } 59 60 63 public void setDefaultPluginsArray(String [] strings) 64 { 65 defaultPluginsArray = strings; 66 } 67 68 69 72 public void copyFrom(WebsiteData dataHolder, java.util.Locale locale) throws RollerException 73 { 74 super.copyFrom(dataHolder, locale); 75 if (dataHolder.getDefaultCategory() != null) 76 { 77 defaultCategoryId = dataHolder.getDefaultCategory().getId(); 78 } 79 if (dataHolder.getBloggerCategory() != null) 80 { 81 bloggerCategoryId = dataHolder.getBloggerCategory().getId(); 82 } 83 if (dataHolder.getDefaultPlugins() != null) 84 { 85 defaultPluginsArray = StringUtils.split(dataHolder.getDefaultPlugins(), ","); 86 } 87 } 88 89 92 public void copyTo(WebsiteData dataHolder, java.util.Locale locale) throws RollerException 93 { 94 super.copyTo(dataHolder, locale); 95 dataHolder.setDefaultPlugins( StringUtils.join(this.defaultPluginsArray,",") ); 96 } 97 98 public void reset( 99 org.apache.struts.action.ActionMapping mapping, 100 javax.servlet.ServletRequest request) 101 { 102 doReset(mapping, request); 103 defaultPluginsArray = new String [0]; 104 } 105 106 public void reset( 107 org.apache.struts.action.ActionMapping mapping, 108 javax.servlet.http.HttpServletRequest request) 109 { 110 doReset(mapping, request); 111 defaultPluginsArray = new String [0]; 112 } 113 } 114 | Popular Tags |