KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > blojsom > blog > Entry


1 /**
2  * Copyright (c) 2003-2006, David A. Czarnecki
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  *
8  * Redistributions of source code must retain the above copyright notice, this list of conditions and the
9  * following disclaimer.
10  * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the
11  * following disclaimer in the documentation and/or other materials provided with the distribution.
12  * Neither the name of "David A. Czarnecki" and "blojsom" nor the names of its contributors may be used to
13  * endorse or promote products derived from this software without specific prior written permission.
14  * Products derived from this software may not be called "blojsom", nor may "blojsom" appear in their name,
15  * without prior written permission of David A. Czarnecki.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
18  * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
19  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
20  * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
21  * EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
22  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
26  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
27  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
29  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30  */

31 package org.blojsom.blog;
32
33 import java.util.Date JavaDoc;
34 import java.util.List JavaDoc;
35 import java.util.Locale JavaDoc;
36 import java.util.Map JavaDoc;
37
38 /**
39  * Entry
40  *
41  * @author David Czarnecki
42  * @since blojsom 3.0
43  * @version $Id: Entry.java,v 1.5 2006/09/26 02:55:21 czarneckid Exp $
44  */

45 public interface Entry {
46
47     /**
48      * Get the entry ID
49      *
50      * @return Entry ID
51      */

52     Integer JavaDoc getId();
53
54     /**
55      * Set the entry ID
56      *
57      * @param id Entry ID
58      */

59     void setId(Integer JavaDoc id);
60
61     /**
62      * Get the blog ID
63      *
64      * @return Blog ID
65      */

66     Integer JavaDoc getBlogId();
67
68     /**
69      * Set the blog ID
70      *
71      * @param blogId Blog ID
72      */

73     void setBlogId(Integer JavaDoc blogId);
74
75     /**
76      * Get the blog category ID
77      *
78      * @return Blog category ID
79      */

80     public Integer JavaDoc getBlogCategoryId();
81
82     /**
83      * Set the blog category ID
84      *
85      * @param blogCategoryId Blog category ID
86      */

87     public void setBlogCategoryId(Integer JavaDoc blogCategoryId);
88
89     /**
90      * Date of the blog entry
91      * <p/>
92      * This value is constructed from the lastModified value of the file
93      *
94      * @return Date of the blog entry
95      */

96     Date JavaDoc getDate();
97
98     /**
99      * Date of this blog entry
100      *
101      * @param entryDate Date of the blog entry
102      */

103     void setDate(Date JavaDoc entryDate);
104
105     /**
106      * Return an RFC 822 style date
107      *
108      * @return Date formatted in RFC 822 format
109      */

110     String JavaDoc getRFC822Date();
111
112     /**
113      * Return an UTC style date
114      *
115      * @return Date formatted in UTC format
116      */

117     String JavaDoc getUTCDate();
118
119     /**
120      * Return an ISO 8601 style date
121      * http://www.w3.org/TR/NOTE-datetime
122      *
123      * @return Date formatted in ISO 8601 format
124      */

125     String JavaDoc getISO8601Date();
126
127     /**
128      * Return the blog entry date formatted with a specified date format
129      *
130      * @param format Date format
131      * @return <code>null</code> if the entry date or format is null, otherwise returns the entry date formatted to the specified format. If the format is invalid, returns <tt>entryDate.toString()</tt>
132      */

133     String JavaDoc getDateAsFormat(String JavaDoc format);
134
135     /**
136      * Return the blog entry date formatted with a specified date format
137      *
138      * @param format Date format
139      * @param locale Locale for date formatting
140      * @return <code>null</code> if the entry date or format is null, otherwise returns the entry date formatted to the specified format. If the format is invalid, returns <tt>entryDate.toString()</tt>
141      */

142     String JavaDoc getDateAsFormat(String JavaDoc format, Locale JavaDoc locale);
143
144     /**
145      * Title of the blog entry
146      *
147      * @return Blog title
148      */

149     String JavaDoc getTitle();
150
151     /**
152      * Set the title of the blog entry
153      *
154      * @param title Title for the blog entry
155      */

156     void setTitle(String JavaDoc title);
157
158     /**
159      * Title for the entry where the &lt;, &gt;, and &amp; characters are escaped
160      *
161      * @return Escaped entry title
162      */

163     String JavaDoc getEscapedTitle();
164
165     /**
166      * Description of the blog entry
167      *
168      * @return Blog entry description
169      */

170     String JavaDoc getDescription();
171
172     /**
173      * Escaped description of the blog entry
174      * This method would be used for generating RSS feeds where the &lt;, &gt;, and &amp; characters are escaped
175      *
176      * @return Blog entry description where &amp;, &lt;, and &gt; have been escaped
177      */

178     String JavaDoc getEscapedDescription();
179
180     /**
181      * Set the description for the blog entry
182      *
183      * @param description Description for the blog entry
184      */

185     void setDescription(String JavaDoc description);
186
187     /**
188      * Category for the blog entry. This corresponds to the category directory name.
189      *
190      * @return Blog entry category
191      */

192     String JavaDoc getCategory();
193
194     /**
195      * Return the category name encoded.
196      *
197      * @return Category name encoded as UTF-8
198      */

199     String JavaDoc getEncodedCategory();
200
201     /**
202      * Determines whether or not this blog entry supports comments.
203      *
204      * @return <code>true</code> if the blog entry supports comments, <code>false</code> otherwise
205      */

206     Integer JavaDoc getAllowComments();
207
208     /**
209      * Whether or not comments are allowed
210      *
211      * @return <code>true</code> if comments are allowed, <code>false</code> otherwise
212      */

213     Boolean JavaDoc allowsComments();
214
215     /**
216      * Set whether comments are allowed
217      *
218      * @param allowComments <code>true</code> if comments are allowed, <code>false</code> otherwise
219      */

220     void setAllowComments(Integer JavaDoc allowComments);
221
222     /**
223      * Get the comments
224      *
225      * @return List of comments
226      */

227     List JavaDoc getComments();
228
229     /**
230      * Set the comments for this blog entry. The comments must be an <code>List</code>
231      * of {@link org.blojsom.blog.Comment}. This method will not writeback or change the comments on disk.
232      *
233      * @param comments Comments for this entry
234      */

235     void setComments(List JavaDoc comments);
236
237     /**
238      * Get the comments as an array of {@link Comment} objects
239      *
240      * @return BlogComment[] array
241      */

242     Comment[] getCommentsAsArray();
243
244     /**
245      * Get the number of comments for this entry
246      *
247      * @return 0 if comments is <code>null</code>, or the number of comments otherwise, which could be 0
248      */

249     int getNumComments();
250
251     /**
252      * Determines whether or not this blog entry supports trackbacks.
253      *
254      * @return <code>true</code> if the blog entry supports trackbacks, <code>false</code> otherwise
255      */

256     Integer JavaDoc getAllowTrackbacks();
257
258     /**
259      * Whether or not trackbacks are allowed
260      *
261      * @return <code>true</code> if trackbacks are allowed, <code>false</code> otherwise
262      */

263     Boolean JavaDoc allowsTrackbacks();
264
265     /**
266      * Set whether trackbacks are allowed
267      *
268      * @param allowTrackbacks <code>true</code> if trackbacks are allowed, <code>false</code> otherwise
269      */

270     void setAllowTrackbacks(Integer JavaDoc allowTrackbacks);
271
272     /**
273      * Get the trackbacks
274      *
275      * @return List of trackbacks
276      */

277     List JavaDoc getTrackbacks();
278
279     /**
280      * Set the trackbacks for this blog entry. The trackbacks must be an <code>List</code>
281      * of {@link org.blojsom.blog.Trackback}. This method will not writeback or change the trackbacks to disk.
282      *
283      * @param trackbacks Trackbacks for this entry
284      */

285     void setTrackbacks(List JavaDoc trackbacks);
286
287     /**
288      * Get the trackbacks as an array of Trackback objects
289      *
290      * @return Trackback[] array
291      */

292     Trackback[] getTrackbacksAsArray();
293
294     /**
295      * Get the number of trackbacks for this entry
296      *
297      * @return 0 if trackbacks is <code>null</code>, or the number of trackbacks otherwise, which could be 0
298      */

299     int getNumTrackbacks();
300
301     /**
302      * Get the {@link org.blojsom.blog.Category} object for this blog entry
303      *
304      * @return {@link org.blojsom.blog.Category} object
305      */

306     Category getBlogCategory();
307
308     /**
309      * Set the {@link org.blojsom.blog.Category} object for this blog entry
310      *
311      * @param blogCategory New {@link org.blojsom.blog.Category} object
312      */

313     void setBlogCategory(Category blogCategory);
314
315     /**
316      * Return meta data for this blog entry. This method may return <code>null</code>.
317      *
318      * @return Meta data
319      */

320     Map JavaDoc getMetaData();
321
322     /**
323      * Set the meta-data associated with this blog entry
324      *
325      * @param metaData Meta-data
326      */

327     void setMetaData(Map JavaDoc metaData);
328
329     /**
330      * Determines whether or not this blog entry supports pingbacks.
331      *
332      * @return <code>true</code> if the blog entry supports pingbacks, <code>false</code> otherwise
333      */

334     Integer JavaDoc getAllowPingbacks();
335
336     /**
337      * Whether or not pingbacks are allowed
338      *
339      * @return <code>true</code> if pingbacks are allowed, <code>false</code> otherwise
340      */

341     Boolean JavaDoc allowsPingbacks();
342
343     /**
344      * Set whether pingbacks are allowed
345      *
346      * @param allowPingbacks <code>true</code> if pingbacks are allowed, <code>false</code> otherwise
347      */

348     void setAllowPingbacks(Integer JavaDoc allowPingbacks);
349
350     /**
351      * Get the pingbacks for this entry
352      *
353      * @return List of {@link org.blojsom.blog.Pingback}
354      */

355     List JavaDoc getPingbacks();
356
357     /**
358      * Set the pingbacks for this blog entry. The pingbacks must be a <code>List</code>
359      * of {@link org.blojsom.blog.Pingback}. This method will not writeback or change the pingbacks to disk.
360      *
361      * @param pingbacks {@link org.blojsom.blog.Pingback}s for this entry
362      */

363     void setPingbacks(List JavaDoc pingbacks);
364
365     /**
366      * Get the pingbacks as an array of {@link org.blojsom.blog.Pingback}s objects
367      *
368      * @return {@link org.blojsom.blog.Pingback}[] array
369      */

370     Pingback[] getPingbacksAsArray();
371
372     /**
373      * Get the number of pingbacks for this entry
374      *
375      * @return 0 if pingbacks is <code>null</code>, or the number of pingbacks otherwise, which could be 0
376      */

377     int getNumPingbacks();
378
379     /**
380      * Get the status
381      *
382      * @return Status
383      */

384     public String JavaDoc getStatus();
385
386     /**
387      * Set the status
388      *
389      * @param status Status
390      */

391     public void setStatus(String JavaDoc status);
392
393     /**
394      * Get the author
395      *
396      * @return Author
397      */

398     public String JavaDoc getAuthor();
399
400     /**
401      * Set the author
402      *
403      * @param author Author
404      */

405     public void setAuthor(String JavaDoc author);
406
407     /**
408      * Get the post slug
409      *
410      * @return Post slug
411      */

412     public String JavaDoc getPostSlug();
413
414     /**
415      * Set the post slug
416      *
417      * @param postSlug Post slug
418      */

419     public void setPostSlug(String JavaDoc postSlug);
420
421     /**
422      * Get the last modified date
423      *
424      * @return Last modified date
425      */

426     public Date JavaDoc getModifiedDate();
427
428     /**
429      * Set the last modified date
430      *
431      * @param modifiedDate Last modified date
432      */

433     public void setModifiedDate(Date JavaDoc modifiedDate);
434
435     /**
436      * Get the responses (comments, trackbacks, pingbacks)
437      *
438      * @return Responses (comments, trackbacks, pingbacks)
439      */

440     public List JavaDoc getResponses();
441
442     /**
443      * Get the responses (comments, trackbacks, pingbacks) matching some status code
444      *
445      * @param status Status code
446      * @return Responses (comments, trackbacks, pingbacks) matching some status code
447      */

448     public List JavaDoc getResponsesMatchingStatus(String JavaDoc status);
449
450     /**
451      * Get the responses (comments, trackbacks, pingbacks) not matching some status code
452      *
453      * @param status Status code
454      * @return Responses (comments, trackbacks, pingbacks) not matching some status code
455      */

456     public List JavaDoc getResponsesNotMatchingStatus(String JavaDoc status);
457 }
458
Popular Tags