KickJava   Java API By Example, From Geeks To Geeks.

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


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 CmpFilesAction extends ComponentAction
37 {
38     /**
39      *
40      */

41     public void dispatchComponent(HttpServletRequest JavaDoc request, ComponentBean cbean)
42     {
43         String JavaDoc 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                 //((CmpFilesBean) cbean).setComponentChanged(true);
51
}
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 // eof
71
Popular Tags