KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > quikj > application > communicator > applications > webtalk > controller > DisplayGroupWizardCustomerInfoAction


1 /*
2  * DisplayGroupWizardCustomerInfoAction.java
3  *
4  */

5
6 package com.quikj.application.communicator.applications.webtalk.controller;
7
8 import com.quikj.application.communicator.admin.model.*;
9 import com.quikj.application.communicator.admin.controller.*;
10
11 import javax.servlet.http.*;
12 import org.apache.struts.action.*;
13
14 import java.sql.*;
15
16 /**
17  *
18  * @author bhm
19  */

20 public class DisplayGroupWizardCustomerInfoAction extends Action
21 {
22     
23     /** Creates a new instance of DisplayGroupManagementAction */
24     public DisplayGroupWizardCustomerInfoAction()
25     {
26     }
27     
28     public ActionForward execute(ActionMapping mapping,
29     ActionForm form,
30     HttpServletRequest request,
31     HttpServletResponse response)
32     {
33         ActionErrors errors = new ActionErrors();
34         
35         Connection c = (Connection)request.getSession().getAttribute("connection");
36         if (c == null)
37         {
38             errors.add(ActionErrors.GLOBAL_ERROR, new ActionError("error.not.logged.in"));
39             saveErrors(request, errors);
40             
41             return mapping.findForward("logon");
42         }
43         
44         AccountElement element = (AccountElement)request.getSession().getAttribute("userInfo");
45         if (element.isAdminLevel() == false)
46         {
47             errors.add(ActionErrors.GLOBAL_ERROR,
48             new ActionError("error.insufficient.privilege"));
49             saveErrors(request, errors);
50             
51             return mapping.findForward("main_menu");
52         }
53         
54         // add related tasks to the navigation bar
55
WebTalkRelatedTasks menu = new WebTalkRelatedTasks();
56         request.setAttribute("menu", menu);
57         
58         menu.addLink(new LinkAttribute("List all groups", "list_groups"));
59         menu.addLink(new LinkAttribute("Search users", "display_user_search"));
60         
61         return mapping.getInputForward();
62     }
63 }
64
Popular Tags