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 CmpLinksAction extends ComponentAction 37 { 38 41 public void dispatchComponent(HttpServletRequest request, ComponentBean cbean) 42 { 43 String delUrlID = request.getParameter(ComponentConstants.HTTPGET_PARAM_DELURLID); 44 if(delUrlID == null) 45 { 46 int addsuccesfull=((CmpLinksBean) cbean).populateViewFields(); 47 if(addsuccesfull == 0) 48 { 49 50 ActionErrors errors=new ActionErrors(); 51 errors.add(ActionErrors.GLOBAL_ERROR,new ActionError(BaseConstants.COMPONENT_LINKS_ERROR_URLLIMIT)); 52 saveErrors(request,errors); 53 } 54 else if(addsuccesfull == -1) 55 { 56 ActionErrors errors=new ActionErrors(); 57 errors.add(ActionErrors.GLOBAL_ERROR,new ActionError(BaseConstants.COMPONENT_LINKS_ERROR_DUPLICATEURL)); 58 saveErrors(request,errors); 59 } 60 } 61 else 62 { 63 int duID = convertToInteger(-1, delUrlID); 64 if(duID != -1) 65 { 66 ((CmpLinksBean) cbean).getLinksSelector().removeLink(duID); 67 } 69 } 70 } 71 72 } 73 74 | Popular Tags |