1 package net.sourceforge.blogentis.plugins.base;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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 }