KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > portlet > forums > commands > post > DeletePollCommand


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.post;
12
13
14 import org.jboss.portal.common.command.result.Result;
15 import org.jboss.portlet.forums.commands.ValidationException;
16 import org.jboss.portlet.forums.model.AuthType;
17 import org.jboss.portlet.JBossActionRequest;
18 import org.jboss.portlet.JBossActionResponse;
19
20 /**
21  * @author <a HREF="mailto:julien@jboss.org">Julien Viet</a>
22  * @version $Revision: 1.3 $
23  */

24 public class DeletePollCommand
25    extends PostCommand
26 {
27
28    public DeletePollCommand(JBossActionRequest request, JBossActionResponse response)
29    {
30       super(request, response);
31    }
32
33    /**
34     * DOCUMENT_ME
35     *
36     * @return DOCUMENT_ME
37     */

38    public int authType()
39    {
40       return AuthType.DELETE;
41    }
42
43    /**
44     * DOCUMENT_ME
45     *
46     * @throws ValidationException DOCUMENT_ME
47     */

48    protected void prepare()
49    throws ValidationException
50    {
51       /* super.prepare();
52          if (!isAuthMod)
53          {
54             throw new ValidationException(TYPE_CANNOT_DELETE_POLL);
55          }
56        */

57    }
58
59    /**
60     * DOCUMENT_ME
61     *
62     * @return DOCUMENT_ME
63     */

64    protected Result __execute()
65    {
66       /* try
67          {
68             topic.getPoll().remove();
69             topic.setVote(false);
70          }
71          catch(RemoveException e)
72          {
73             log.error("Cannot remove poll", e);
74             return TYPE_ERROR_IN_DELETING_POLL;
75          }
76        */

77       return TYPE_POLL_DELETED;
78    }
79 }
Popular Tags