View Javadoc

1   package net.sourceforge.blogentis.plugins.base;
2   
3   //-----------------------------------------------------------------------
4   //Blogentis - a blog publishing platform.
5   //Copyright (C) 2004 Tassos Bassoukos <abassouk@gmail.com>
6   //
7   //This library is free software; you can redistribute it and/or
8   //modify it under the terms of the GNU Lesser General Public
9   //License as published by the Free Software Foundation; either
10  //version 2.1 of the License, or (at your option) any later version.
11  //
12  //This library is distributed in the hope that it will be useful,
13  //but WITHOUT ANY WARRANTY; without even the implied warranty of
14  //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  //Lesser General Public License for more details.
16  //
17  //You should have received a copy of the GNU Lesser General Public
18  //License along with this library; if not, write to the Free Software
19  //Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20  //-----------------------------------------------------------------------
21  //
22  //$Id: ICommentExtension.java,v 1.1 2004/10/22 17:34:12 tassos Exp $
23  //
24  
25  import java.util.List;
26  
27  import net.sourceforge.blogentis.om.Comment;
28  import net.sourceforge.blogentis.plugins.IBlogExtension;
29  import net.sourceforge.blogentis.turbine.BlogRunData;
30  
31  /***
32   * @author abas
33   */
34  public interface ICommentExtension
35          extends IBlogExtension {
36      /***
37       * Invoked for each comment creation. Plugins can modify the comment to
38       * their hearts content, and indicate wether the comment should be accepter
39       * or rejected via their return value.
40       * 
41       * Possible uses for this method include spam detection, banning, formatting
42       * functions, HTML tidying and restricting.
43       * 
44       * @param data
45       *            the BlogRunData of the current request.
46       * @param comment
47       *            the Comment that has been created, just before saving.
48       * @return true if the comment should be created, false if the comment
49       *         should be rejected. If the comment has been rejected, the
50       *         data.message will contain the reason.
51       */
52      public boolean commentCreated(BlogRunData data, Comment comment);
53  
54      /***
55       * Called before a comment will be removed by the user.
56       * 
57       * @param data
58       * @param comment
59       *            the coment that will be removed.
60       */
61      public void commentRemoved(BlogRunData data, Comment comment);
62  
63      /***
64       * A List of ILinkTo objects that can provide some comment actions.
65       * @param data
66       * @param c
67       * @return
68       */
69      public List commentActions(BlogRunData data, Comment c);
70  
71      /***
72       * Get a string that should be shown to the user on the new comment form.
73       * This could be used for explaining the appropriate tags etc.
74       * 
75       * @param data
76       * @param c
77       * @return
78       */
79      public String getNewCommentMessage(BlogRunData data);
80  }