KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jresearch > gossip > actions > admin > group > EditGroupAction


1 /*
2  * $$Id: EditGroupAction.java,v 1.3 2005/06/07 12:32:30 bel70 Exp $$
3  *
4  * ***** BEGIN LICENSE BLOCK *****
5  *
6  *
7  * The contents of this file are subject to the Mozilla Public License Version
8  * 1.1 (the "License"); you may not use this file except in compliance with the
9  * License. You may obtain a copy of the License at http://www.mozilla.org/MPL/
10  *
11  * Software distributed under the License is distributed on an "AS IS" basis,
12  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
13  * the specific language governing rights and limitations under the License.
14  *
15  * The Original Code is JGossip forum code.
16  *
17  * The Initial Developer of the Original Code is the JResearch, Org. Portions
18  * created by the Initial Developer are Copyright (C) 2004 the Initial
19  * Developer. All Rights Reserved.
20  *
21  * Contributor(s): Dmitry Belov <bel@jresearch.org>
22  *
23  * ***** END LICENSE BLOCK *****
24  */

25 /*
26  * Created on Oct 1, 2003
27  *
28  */

29 package org.jresearch.gossip.actions.admin.group;
30
31 import java.sql.SQLException JavaDoc;
32
33 import javax.servlet.http.HttpServletRequest JavaDoc;
34 import javax.servlet.http.HttpServletResponse JavaDoc;
35
36 import org.apache.struts.action.ActionForm;
37 import org.apache.struts.action.ActionForward;
38 import org.apache.struts.action.ActionMapping;
39 import org.jresearch.gossip.actions.BaseAction;
40 import org.jresearch.gossip.beans.forum.Group;
41 import org.jresearch.gossip.dao.ForumDAO;
42 import org.jresearch.gossip.exception.SystemException;
43 import org.jresearch.gossip.forms.ProcessGroupForm;
44
45 /**
46  * DOCUMENT ME!
47  *
48  * @author Bel
49  */

50 public class EditGroupAction extends BaseAction {
51     /**
52      * DOCUMENT ME!
53      *
54      * @param mapping
55      * DOCUMENT ME!
56      * @param form
57      * DOCUMENT ME!
58      * @param request
59      * DOCUMENT ME!
60      * @param response
61      * DOCUMENT ME!
62      *
63      * @return DOCUMENT ME!
64      */

65     public ActionForward process(ActionMapping mapping, ActionForm form,
66             HttpServletRequest JavaDoc request, HttpServletResponse JavaDoc response)
67             throws SystemException {
68         ForumDAO dao = ForumDAO.getInstance();
69         ProcessGroupForm pgForm = (ProcessGroupForm) form;
70         try {
71
72             Group group = dao.getGroupInfo(pgForm.getGid());
73             request.setAttribute("group_name", group.getName());
74             request.setAttribute("group_sort", group.getSort());
75             request.setAttribute("gid", pgForm.getGid());
76         } catch (SQLException JavaDoc sqle) {
77             getServlet().log("Connection.process", sqle);
78             throw new SystemException(sqle);
79         }
80         return (mapping.findForward("editGroup"));
81     }
82 }
Popular Tags