KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > raptus > owxv3 > api > components > CmpLinksAction


1 /*
2  * eAdmin/OWX
3  * Copyright (C) 1996-2003 OWX-Project Team <owx-team@gmx.net>
4  */

5
6 package com.raptus.owxv3.api.components;
7
8 import javax.servlet.http.HttpServletRequest JavaDoc;
9
10 import org.apache.struts.action.*;
11
12 import com.raptus.owxv3.modules.base.BaseConstants;
13
14 /**
15  *
16  * <hr>
17  * <table width="100%" border="0">
18  * <tr>
19  * <td width="24%"><b>Filename</b></td><td width="76%">CmpLinksAction.java</td>
20  * </tr>
21  * <tr>
22  * <td width="24%"><b>Author</b></td><td width="76%">Guy Zürcher (gzuercher@raptus.com)</td>
23  * </tr>
24  * <tr>
25  * <td width="24%"><b>Date</b></td><td width="76%">28th of June 2001</td>
26  * </tr>
27  * </table>
28  * <hr>
29  * <table width="100%" border="0">
30  * <tr>
31  * <td width="24%"><b>Date / Author</b></td><td width="76%"><b>Changes</b></td>
32  * </tr>
33  * </table>
34  * <hr>
35  */

36 public class CmpLinksAction extends ComponentAction
37 {
38     /**
39      *
40      */

41     public void dispatchComponent(HttpServletRequest JavaDoc request, ComponentBean cbean)
42     {
43         String JavaDoc 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                // cbean.setComponentChanged(true);
68
}
69         }
70     }
71
72 }
73
74 // eof
75
Popular Tags