1 5 6 package com.raptus.owxv3.api.components; 7 8 import javax.servlet.http.HttpServletRequest ; 9 10 import org.apache.struts.action.*; 11 12 import com.raptus.owxv3.modules.base.BaseConstants; 13 14 36 public class CmpFilesAction extends ComponentAction 37 { 38 41 public void dispatchComponent(HttpServletRequest request, ComponentBean cbean) 42 { 43 String unlinkFileID = request.getParameter(ComponentConstants.HTTPGET_PARAM_UNLINKFILEID); 44 if(unlinkFileID != null) 45 { 46 int ulfID = convertToInteger(-1, unlinkFileID); 47 if(ulfID != -1) 48 { 49 ((CmpFilesBean) cbean).getFilesSelector().unlinkFile(ulfID); 50 } 52 53 } 54 else 55 { 56 boolean success=((CmpFilesBean) cbean).populateViewFields(); 57 if(! success) 58 { 59 60 ActionErrors errors=new ActionErrors(); 61 errors.add(ActionErrors.GLOBAL_ERROR,new ActionError(BaseConstants.COMPONENT_FILES_ERROR_FILELIMIT)); 62 saveErrors(request,errors); 63 } 64 65 } 66 } 67 68 } 69 70 | Popular Tags |