KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > portlet > forums > commands > admin > DeleteForumCommand


1 /*****************************************
2  * *
3  * JBoss Portal: The OpenSource Portal *
4  * *
5  * Forums JBoss Portlet *
6  * *
7  * Distributable under GPL license. *
8  * See terms of license at gnu.org. *
9  * *
10  *****************************************/

11 package org.jboss.portlet.forums.commands.admin;
12
13 import org.jboss.portal.common.command.result.Result;
14 import org.jboss.portal.core.modules.ModuleException;
15 import org.jboss.portlet.forums.ForumsModule;
16 import org.jboss.portlet.forums.commands.AbstractCommand;
17 import org.jboss.portlet.forums.model.Forum;
18 import org.jboss.portlet.JBossActionRequest;
19 import org.jboss.portlet.JBossActionResponse;
20
21 /**
22  * @author <a HREF="mailto:julien@jboss.org">Julien Viet</a>
23  * @author <a HREF="mailto:theute@jboss.org">Thomas Heute</a>
24  * @version $Revision: 1.2 $
25  */

26 public class DeleteForumCommand
27    extends AbstractCommand
28 {
29    /** DOCUMENT_ME */
30    public Forum forum;
31
32    /** DOCUMENT_ME */
33    public ForumsModule module;
34
35    public DeleteForumCommand(JBossActionRequest request, JBossActionResponse response)
36    {
37       super(request, response);
38    }
39
40    /**
41     * DOCUMENT_ME
42     *
43     * @return DOCUMENT_ME
44     */

45    public Result execute()
46    {
47       try
48       {
49          module.removeForum(forum);
50          return TYPE_FORUM_REMOVED;
51       }
52       catch (ModuleException e)
53       {
54          return TYPE_CANNOT_REMOVE_FORUM_REMOVAL_FAILED;
55       }
56    }
57 }
Popular Tags