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 com.raptus.owxv3.*; 13 import com.raptus.owxv3.api.*; 14 15 16 44 public class EAFileMgrAssignedAction extends VModuleRoleAction 46 { 47 53 public String dispatchVModuleElement(HttpServletRequest request, 54 String element, 55 org.apache.struts.action.ActionForm form, 56 VModule vm, 57 com.raptus.owxv3.api.usermgr.User user) 58 { 59 60 if(element.compareToIgnoreCase(FileMgrConstants.ELEMENT_ASSIGNED) == 0) 61 { 62 63 EAFileMgrAssignedBean assignedbean=(EAFileMgrAssignedBean)form; 64 65 68 String action=request.getParameter(FileMgrConstants.HTTPGET_PARAM_ACTION); 69 70 73 if (action==null) action=FileMgrConstants.VMODULE_ACTION_LIST; 74 75 78 String filter=assignedbean.getFilter(); 79 if(filter==null) filter=""; 80 81 if(action.compareToIgnoreCase(FileMgrConstants.VMODULE_ACTION_UNLINK)==0){ 82 83 86 int linkid=0; 87 90 try 91 { 92 if(request.getParameter(FileMgrConstants.HTTPGET_PARAM_LINKID)!=null) 93 linkid=Integer.parseInt( request.getParameter(FileMgrConstants.HTTPGET_PARAM_LINKID) ); 94 95 if(linkid!=0){ 96 101 102 GlobalResources gres=new GlobalResources(); 103 FileMgrUnlinkObject unlinkobj=new FileMgrUnlinkObject(gres); 104 unlinkobj.unLink(linkid); 105 106 109 assignedbean.setList(gres.loadFileLinks(filter)); 110 } 111 }catch(NumberFormatException nfe) 112 { 113 LoggingManager.log("Wrong number supplied as linkid for deleting:"+nfe.getMessage(), this); 114 }catch(SQLException sqle){ 115 LoggingManager.log("Could not delete flink from database"+sqle.getMessage(), this); 116 } 117 118 } 120 124 125 127 try{ 129 GlobalResources gres=new GlobalResources(); 130 assignedbean.setList(gres.loadFileLinks(filter)); 131 132 }catch(SQLException e){LoggingManager.log("Error while calling loadFiles() from GlobalResources"+e.getMessage(), this);} 133 135 return Constants.SECTION_EADMIN + Constants.DEFAULT_SPACER + element; 136 } 138 139 142 return null; 143 } 144 145 } 146 147 | Popular Tags |