KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > nextime > ion > backoffice > action > workflow > ChoixMDDAction


1 package org.nextime.ion.backoffice.action.workflow;
2
3 import java.io.IOException JavaDoc;
4 import java.util.Hashtable JavaDoc;
5 import javax.servlet.ServletException JavaDoc;
6 import javax.servlet.http.HttpServletRequest JavaDoc;
7 import javax.servlet.http.HttpServletResponse JavaDoc;
8 import org.apache.struts.action.ActionForm;
9 import org.apache.struts.action.ActionForward;
10 import org.apache.struts.action.ActionMapping;
11
12 import org.nextime.ion.framework.business.Group;
13 import org.nextime.ion.framework.mapping.Mapping;
14
15 import org.nextime.ion.backoffice.action.BaseAction;
16
17 public class ChoixMDDAction extends BaseAction {
18
19     public ActionForward perform(
20         ActionMapping mapping,
21         ActionForm form,
22         HttpServletRequest JavaDoc request,
23         HttpServletResponse JavaDoc response)
24         throws IOException JavaDoc, ServletException JavaDoc {
25
26         // check if user is correctly logged
27
checkUser(request);
28
29         // si on a tous les elements
30
if (request.getParameter("membreDD") != null) {
31             Hashtable JavaDoc inputs = new Hashtable JavaDoc();
32             inputs.put("membreDDLogin", request.getParameter("membreDD"));
33             request.setAttribute("inputs", inputs);
34             request.setAttribute("id", request.getParameter("id"));
35             request.setAttribute("version", request.getParameter("version"));
36             request.setAttribute("action", request.getParameter("action"));
37             return (mapping.findForward("actions"));
38         }
39
40         // liste des membres du directoire
41
try {
42             Mapping.begin();
43             request.setAttribute(
44                 "users",
45                 Group.getInstance("MembresDD").listUsers());
46         } catch (Exception JavaDoc e) {
47             e.printStackTrace();
48         } finally {
49             Mapping.rollback();
50         }
51
52         // Forward to the next page
53
return (mapping.findForward("view"));
54
55     }
56
57 }
58
Popular Tags