| 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 34 public class CmpCategoryAction extends ComponentAction 35 { 36 42 public void dispatchComponent(HttpServletRequest request, ComponentBean cbean) 43 { 44 String scat= request.getParameter("catid"); 45 if(scat != null) 46 { 47 48 49 ((com.raptus.owxv3.api.components.CmpCategoryBean) cbean).togleFolder(scat); 50 } 51 52 String selcat=request.getParameter("selcatid"); 53 if(selcat!=null) 54 { 55 56 int x=0; 57 try 58 { 59 x=Integer.parseInt(selcat); 60 }catch(NumberFormatException e) {}; 61 boolean linksuccess=true; 62 if(x!=0) linksuccess=((com.raptus.owxv3.api.components.CmpCategoryBean) cbean).linkItemToCategory(x); 63 64 if(! linksuccess) 65 { 66 69 71 ActionErrors errors=new ActionErrors(); 72 errors.add(ActionErrors.GLOBAL_ERROR,new ActionError("owx.api.components.fc_categories.error.catfull")); 73 74 saveErrors(request,errors); 75 return; 76 77 } 79 } 80 81 String unlinkcat=request.getParameter("unlinkcatid"); 82 if(unlinkcat!=null) 83 { 84 85 int x=0; 86 try 87 { 88 x=Integer.parseInt(unlinkcat); 89 }catch(NumberFormatException e) {}; 90 if(x!=0) ((com.raptus.owxv3.api.components.CmpCategoryBean) cbean).unlinkItemFromCategory(x); 91 } 92 93 } 94 95 } 96 97 | Popular Tags |