KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > raptus > owxv3 > modules > base > PubBaseSingleEntryLoader


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

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

37 public class PubBaseSingleEntryLoader extends VModuleAnonAction
38 {
39     /**
40      *
41      */

42     protected String JavaDoc dispatchVModuleElement(HttpServletRequest JavaDoc request,
43                                             String JavaDoc element,
44                                             org.apache.struts.action.ActionForm form,
45                                             VModule vm,
46                                             Locale JavaDoc locale)
47     {
48         // 20030918/gz: hack for being able to use the sienlo in eadmin as well...
49
String JavaDoc section = getSelectedSection(form, request);
50         
51         String JavaDoc idParam = request.getParameter(BaseConstants.HTTPGET_PARAM_SIENLOID);
52         int id=0;
53         try
54         {
55             id = Integer.parseInt(idParam);
56         }
57         catch(NumberFormatException JavaDoc e) {
58             LoggingManager.log("NumberFormatException while converting parameter: " + idParam, this);
59             // return the requested action
60
return section + Constants.DEFAULT_SPACER + element;
61         }
62         BaseObject bo=new BaseObject(vm, locale);
63         ((PubBaseBean)form).setPubBaseEntry(bo.loadById(id));
64         
65         // return the requested action
66
return section + Constants.DEFAULT_SPACER + element;
67     }
68     
69 }
70
71 // eof
72
Popular Tags