KickJava   Java API By Example, From Geeks To Geeks.

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


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%">CmpPicsAction.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 CmpPicsAction extends ComponentAction
37 {
38     /**
39      *
40      */

41     public void dispatchComponent(HttpServletRequest JavaDoc request, ComponentBean cbean)
42     {
43         String JavaDoc unlinkPicID = request.getParameter(ComponentConstants.HTTPGET_PARAM_UNLINKPICID);
44         if(unlinkPicID != null)
45         {
46             int ulpID = convertToInteger(-1, unlinkPicID);
47             if(ulpID != -1)
48             {
49                 ((CmpPicsBean) cbean).getPicsSelector().unlinkPicture(ulpID);
50                 //cbean.setComponentChanged(true);
51
}
52         }
53         else
54         {
55             boolean success=((CmpPicsBean) cbean).populateViewFields();
56             if(! success)
57             {
58
59                 ActionErrors errors=new ActionErrors();
60                 errors.add(ActionErrors.GLOBAL_ERROR,new ActionError(BaseConstants.COMPONENT_PICS_ERROR_PICTURELIMIT));
61                 saveErrors(request,errors);
62             }
63         }//end else
64
}
65
66 }
67
68 // eof
69
Popular Tags