1 5 6 package com.raptus.owxv3.modules.filemgr; 7 8 import javax.servlet.http.HttpServletRequest ; 9 10 import org.apache.struts.action.*; 11 12 import com.raptus.owxv3.api.*; 13 14 46 public class EAFileMgrChangeBean extends OmniaWebBean 47 { 48 51 protected int categorytype=FileMgrConstants.EXISTING_CATEGORY; 52 53 56 protected String catname=""; 57 58 61 protected String newcatname=""; 62 63 64 67 protected int filelist=-1; 69 72 protected AllFileSelector fileSelector=null; 73 74 75 80 protected int changedFileCount=0; 81 82 83 84 85 86 87 90 91 public int getCategorytype() { return categorytype; } 92 93 96 public void setCategorytype(int c) { this.categorytype = c; } 97 98 99 102 public String getCatname() { return catname; } 103 104 107 public void setCatname(String name) { this.catname = name; } 108 109 110 113 public String getNewcatname() { return newcatname; } 114 115 116 119 public void setNewcatname(String name) { this.newcatname = name; } 120 121 124 public AllFileSelector getFileSelector() { return fileSelector; } 125 126 129 public void setFileSelector(AllFileSelector fs) { this.fileSelector=fs; } 130 131 134 public int getFilelist() { return filelist; } 135 136 139 public void setFilelist(int f) { this.filelist = f; } 140 141 142 143 146 public void reset(ActionMapping mapping, HttpServletRequest request) 147 { 148 super.reset(mapping, request); 149 categorytype=FileMgrConstants.EXISTING_CATEGORY; 150 catname=""; 151 newcatname=""; 152 filelist=-1; 153 154 } 155 156 public void reset() 157 { 158 categorytype=FileMgrConstants.EXISTING_CATEGORY; 159 catname=""; 160 newcatname=""; 161 filelist=-1; 162 } 163 164 165 168 public String getCategoryName() 169 { 170 if(categorytype==FileMgrConstants.EXISTING_CATEGORY && ! catname.equals("0") ) return catname; 171 172 if(categorytype==FileMgrConstants.NEW_CATEGORY && ! newcatname.equals("")) return newcatname; 173 174 if(catname.equals("0") && ! newcatname.equals("")) return newcatname; 175 176 if(!catname.equals("0") && newcatname.equals("")) return newcatname; 177 178 return catname; 179 } 180 181 182 189 public ActionErrors validate(HttpServletRequest request) 190 { 191 ActionErrors ret=new ActionErrors(); 192 if(catname.equals("0") && newcatname.equals("")) 193 { 194 if( categorytype==FileMgrConstants.EXISTING_CATEGORY && catname.equals("0") ) 195 { 196 ret.add(ActionErrors.GLOBAL_ERROR,new ActionError("module.change.error.catnotselected")); 197 198 } 199 if(categorytype==FileMgrConstants.NEW_CATEGORY && newcatname.equals("")) 200 { 201 ret.add(ActionErrors.GLOBAL_ERROR,new ActionError("module.change.error.emptynewcatname")); 202 203 } 204 } 206 if(filelist==0){ 207 ret.add(ActionErrors.GLOBAL_ERROR,new ActionError("module.change.error.emptyfile")); 208 } 209 210 211 return ret; 212 213 } 214 215 216 public void incChangedFileCount(){ 217 changedFileCount++; 218 } 219 220 public int getChangedFileCount(){ 221 return changedFileCount; 222 } 223 } 224 225 | Popular Tags |