KickJava   Java API By Example, From Geeks To Geeks.

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


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.nukes.addons.modules.bb.commands.ValidationException;
15
//import org.jboss.nukes.addons.modules.bb.ejb.TopicEJBLocal;
16
//import org.jboss.nukes.addons.modules.bb.BBConstants;
17
import org.jboss.portlet.forums.model.Topic;
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  * @version $Revision: 1.2 $
24  */

25 public abstract class TopicCommand
26    extends ForumCommand
27 {
28
29    protected TopicCommand(JBossActionRequest request, JBossActionResponse response)
30    {
31       super(request, response);
32    }
33
34    /** DOCUMENT_ME */
35    public int topicId;
36
37    /** DOCUMENT_ME */
38    public Topic topic;
39
40    /*
41       protected void find() throws ValidationException
42       {
43          try
44          {
45             topic = homes.topic.findByPrimaryKey(new Integer(topicId));
46             forum = topic.getForum();
47             category = forum.getCategory();
48          }
49          catch(ObjectNotFoundException e)
50          {
51             log.error("Topic not found", e);
52             throw new ValidationException(TYPE_NO_SUCH_TOPIC);
53          }
54          catch(FinderException e)
55          {
56             log.error("Cannot find topic", e);
57             throw new ValidationException(TYPE_CANNOT_QUERY);
58          }
59       }
60       protected void prepare() throws ValidationException
61       {
62          super.prepare();
63          if (topic.getStatus() == BBConstants.TOPIC_LOCKED && !isAuthMod)
64          {
65             throw new ValidationException(TYPE_TOPIC_IS_LOCKED);
66          }
67       }
68     */

69 }
Popular Tags