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: IPostEditExtension.java,v 1.1 2004/10/22 17:34:12 tassos Exp $
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 -&gt; published: when a user has finished editing a post and
83       * publishes the specific post</lI>
84       * <li>published -&gt; 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 }