1 5 6 package com.raptus.owxv3.modules.filemgr; 7 8 import java.sql.SQLException ; 9 10 import javax.servlet.http.HttpServletRequest ; 11 12 import org.apache.struts.action.ActionErrors; 13 14 import com.raptus.owxv3.*; 15 import com.raptus.owxv3.api.*; 16 17 18 19 20 50 public class EAFileMgrChangeAction extends VModuleRoleAction 52 { 53 58 public String dispatchVModuleElement(HttpServletRequest request, 59 String element, 60 org.apache.struts.action.ActionForm form, 61 VModule vm, 62 com.raptus.owxv3.api.usermgr.User user) 63 { 64 if(element.compareToIgnoreCase(FileMgrConstants.ELEMENT_CHANGE) == 0) 65 { 66 EAFileMgrChangeBean changebean=(EAFileMgrChangeBean)form; 67 ActionErrors acterrors=changebean.validate(request); 68 69 70 if(acterrors!=null) 71 if(acterrors.size()>0) 72 { 73 saveErrors(request,acterrors); 74 return Constants.SECTION_EADMIN + Constants.DEFAULT_SPACER + element; 75 } 76 77 80 81 String action=""; 82 if(request.getParameter(FileMgrConstants.HTTPGET_PARAM_ACTION)!=null){ 83 action=request.getParameter(FileMgrConstants.HTTPGET_PARAM_ACTION); 84 } 85 86 if(action.compareToIgnoreCase(FileMgrConstants.VMODULE_ACTION_SAVE)==0) 87 { 88 92 93 GlobalResources gres=new GlobalResources(); 94 String cname=changebean.getCategoryName(); 95 try{ 96 gres.saveFileCategory( changebean.getFilelist(),cname ); 97 changebean.incChangedFileCount(); 98 } 99 catch(SQLException e) 100 { 101 LoggingManager.log("Error saving changed category for a file"+e, this); 102 } 103 104 changebean.reset(); 105 106 } 107 108 else if(request.getParameter(FileMgrConstants.HTTPGET_PARAM_FILEID)!=null) 109 { 110 114 115 int filelist=Integer.parseInt( request.getParameter(FileMgrConstants.HTTPGET_PARAM_FILEID) ); 116 117 changebean.setFilelist(filelist); 118 changebean.setCategorytype(FileMgrConstants.EXISTING_CATEGORY); 119 changebean.setCatname(""); 120 changebean.setNewcatname(""); 121 122 } 123 124 128 129 130 try{ 131 GlobalResources gres=new GlobalResources(); 132 AllFileSelector fileselector=new AllFileSelector(gres); 133 changebean.setFileSelector(fileselector); 134 135 }catch(SQLException e){LoggingManager.log("Error while instantiating the FileSelector object", this);} 136 137 return Constants.SECTION_EADMIN + Constants.DEFAULT_SPACER + element; 138 } return null; 140 } 141 142 } 143 144 | Popular Tags |