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 net.sourceforge.blogentis.om.Post;
26 import net.sourceforge.blogentis.plugins.IBlogExtension;
27 import net.sourceforge.blogentis.turbine.BlogRunData;
28 import net.sourceforge.blogentis.utils.AbsoluteLinkURL;
29
30 /***
31 * @author abas
32 */
33 public interface IPostEditExtension
34 extends IBlogExtension {
35 /***
36 * An action that can be performed on a post.
37 *
38 * @author abas
39 */
40 public interface IPostAction
41 extends ILinkTo {
42 /***
43 * Modify given link to perform the action.
44 *
45 * @param data
46 * @param post
47 */
48 public AbsoluteLinkURL makeLinkURI(BlogRunData data, Post post,
49 AbsoluteLinkURL link);
50 }
51
52 /***
53 * This method will be called for the creation of a new post. The post is
54 * complete and only lacks saving to disk, which will happen right after
55 * this method.
56 *
57 * Note that on a new post that will be published immediately,
58 * postPublicationStatusChanged() will be called imediately afterwards.
59 *
60 * @param data
61 * @param post
62 * the new Post.
63 */
64 public void postNew(BlogRunData data, Post post);
65
66 /***
67 * When a post's text or content has been changed by the user, this method
68 * will be called. The old text has been thrown away by this point, and the
69 * new post is about to be saved to disk.
70 *
71 * @param data
72 * the current rundata
73 * @param post
74 * the post that has been modified.
75 */
76 public void postModified(BlogRunData data, Post post);
77
78 /***
79 * This method will be called whenever a publication change has been
80 * requested by the user. The current publication changes are defined as:
81 * <ul>
82 * <li>draft -> published: when a user has finished editing a post and
83 * publishes the specific post</lI>
84 * <li>published -> draft: removed from publication</li>
85 * </ul>
86 *
87 * @param data
88 * the rundata of the request.
89 * @param post
90 * the post that will have its publication type changed.
91 * @param oldType
92 * the old post type, from the PostPeer constants.
93 */
94 public void postPublicationStatusChanged(BlogRunData data, Post post,
95 int oldType);
96
97 /***
98 * The user is about to delete a post. This method will be called before the
99 * actual deletion from the database.
100 *
101 * @param data
102 * The current RunData object.
103 * @param post
104 * The post that the user has requested to delete.
105 */
106 public void postDeleted(BlogRunData data, Post post);
107
108 /***
109 * Get extra HTML that should be inserted in the post edit screen.
110 *
111 * @param data
112 * the RunData of the current request
113 * @param post
114 * the current post, may be null if the post is new.
115 * @return an HTML fragment that should be inserted the final page.
116 */
117 public String buildOptionsHTML(BlogRunData data, Post post);
118 }