KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jresearch > gossip > actions > admin > topic > MoveTopicAction


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

23 /*
24  * Created on Sep 27, 2003
25  *
26  */

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

47 public class MoveTopicAction extends BaseAction {
48     /**
49      * DOCUMENT ME!
50      *
51      * @param mapping
52      * DOCUMENT ME!
53      * @param form
54      * DOCUMENT ME!
55      * @param request
56      * DOCUMENT ME!
57      * @param response
58      * DOCUMENT ME!
59      *
60      * @return DOCUMENT ME!
61      */

62     public ActionForward process(ActionMapping mapping, ActionForm form,
63             HttpServletRequest JavaDoc request, HttpServletResponse JavaDoc response)
64             throws SystemException {
65         ForumDAO dao = ForumDAO.getInstance();
66         ProcessTopicForm ptForm = (ProcessTopicForm) form;
67         try {
68
69             dao.moveThread(ptForm.getTid(), ptForm.getFid());
70             log(request, "logs.LOG24", ptForm.getTid() + " to forum fid="
71                     + ptForm.getFid());
72         } catch (SQLException JavaDoc sqle) {
73             getServlet().log("Connection.process", sqle);
74             throw new SystemException(sqle);
75         }
76         return (new ActionForward("/ShowForum.do?fid=" + ptForm.getFid(), true));
77     }
78 }
Popular Tags