001: /**
002: * Copyright (c) 2003-2007, David A. Czarnecki
003: * All rights reserved.
004: *
005: * Redistribution and use in source and binary forms, with or without
006: * modification, are permitted provided that the following conditions are met:
007: *
008: * Redistributions of source code must retain the above copyright notice, this list of conditions and the
009: * following disclaimer.
010: * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the
011: * following disclaimer in the documentation and/or other materials provided with the distribution.
012: * Neither the name of "David A. Czarnecki" and "blojsom" nor the names of its contributors may be used to
013: * endorse or promote products derived from this software without specific prior written permission.
014: * Products derived from this software may not be called "blojsom", nor may "blojsom" appear in their name,
015: * without prior written permission of David A. Czarnecki.
016: *
017: * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
018: * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
019: * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
020: * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
021: * EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
022: * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
023: * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
024: * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
025: * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
026: * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
027: * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
028: * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
029: * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
030: */package org.blojsom.blog;
031:
032: import java.util.Date;
033: import java.util.Map;
034: import java.util.Locale;
035:
036: /**
037: * Comment
038: *
039: * @author David Czarnecki
040: * @since blojsom 3.0
041: * @version $Id: Comment.java,v 1.8 2007/01/17 02:35:16 czarneckid Exp $
042: */
043: public interface Comment extends Response {
044:
045: /**
046: * Set the comment ID
047: *
048: * @param id Comment ID
049: */
050: void setId(Integer id);
051:
052: /**
053: * Get the comment ID
054: *
055: * @return Comment ID
056: */
057: public Integer getId();
058:
059: /**
060: * Set the blog ID
061: *
062: * @param blogId Blog ID
063: */
064: void setBlogId(Integer blogId);
065:
066: /**
067: * Get the blog ID
068: *
069: * @return Blog ID
070: */
071: Integer getBlogId();
072:
073: /**
074: * Get the blog entry ID
075: *
076: * @return Blog entry ID
077: */
078: public Integer getBlogEntryId();
079:
080: /**
081: * Set the blog entry ID
082: *
083: * @param blogEntryId Blog entry ID
084: */
085: public void setBlogEntryId(Integer blogEntryId);
086:
087: /**
088: * Get the author of the comment
089: *
090: * @return Comment author
091: */
092: String getAuthor();
093:
094: /**
095: * Get the author as an escaped string
096: *
097: * @return Escaped author
098: */
099: String getEscapedAuthor();
100:
101: /**
102: * Set the author of the comment
103: *
104: * @param author Comment's new author
105: */
106: void setAuthor(String author);
107:
108: /**
109: * Get the e-mail of the author of the comment
110: *
111: * @return Author's e-mail
112: */
113: String getAuthorEmail();
114:
115: /**
116: * Get the escaped e-mail of the author of the comment
117: *
118: * @return Escaped author e-mail
119: */
120: String getEscapedAuthorEmail();
121:
122: /**
123: * Set the e-mail of the author of the comment
124: *
125: * @param authorEmail Author's new e-mail
126: */
127: void setAuthorEmail(String authorEmail);
128:
129: /**
130: * Get the URL of the author
131: *
132: * @return Author's URL
133: */
134: String getAuthorURL();
135:
136: /**
137: * Get the escaped URL of the author
138: *
139: * @return Escaped URL
140: */
141: String getEscapedAuthorURL();
142:
143: /**
144: * Set the URL for the author
145: *
146: * @param authorURL New URL for the author
147: */
148: void setAuthorURL(String authorURL);
149:
150: /**
151: * Get the comment as a escaped string
152: *
153: * @return Escaped Comment
154: */
155: String getEscapedComment();
156:
157: /**
158: * Get the comment
159: *
160: * @return Comment
161: */
162: String getComment();
163:
164: /**
165: * Set the new comment
166: *
167: * @param comment New comment
168: */
169: void setComment(String comment);
170:
171: /**
172: * Get the date the comment was entered
173: *
174: * @return Comment date
175: */
176: Date getCommentDate();
177:
178: /**
179: * Return an ISO 8601 style date
180: * http://www.w3.org/TR/NOTE-datetime
181: *
182: * @return Date formatted in ISO 8601 format
183: */
184: String getISO8601Date();
185:
186: /**
187: * Return an RFC 822 style date
188: *
189: * @return Date formatted in RFC 822 format
190: */
191: String getRFC822Date();
192:
193: /**
194: * Get the comment meta-data
195: *
196: * @return Meta-data as a {@link Map}
197: */
198: Map getMetaData();
199:
200: /**
201: * Set the date for the comment
202: *
203: * @param commentDate Comment date
204: */
205: void setCommentDate(Date commentDate);
206:
207: /**
208: * Set the comment meta-data
209: *
210: * @param metaData {@link Map} containing meta-data for this comment
211: */
212: void setMetaData(Map metaData);
213:
214: /**
215: * Return the comment date formatted with a specified date format
216: *
217: * @param format Date format
218: * @return <code>null</code> if the comment date or format is null, otherwise returns the comment date
219: * formatted to the specified format. If the format is invalid, returns <tt>commentDate.toString()</tt>
220: */
221: String getDateAsFormat(String format);
222:
223: /**
224: * Return the comment date formatted with a specified date format
225: *
226: * @param format Date format
227: * @param locale Locale for date formatting
228: * @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>commentDate.toString()</tt>
229: */
230: String getDateAsFormat(String format, Locale locale);
231:
232: /**
233: * Retrieve the {@link Entry} associated with this comment
234: *
235: * @return {@link Entry} entry
236: */
237: Entry getEntry();
238:
239: /**
240: * Set the {@link Entry} associated with this comment
241: *
242: * @param entry {@link Entry}
243: */
244: void setEntry(Entry entry);
245:
246: /**
247: * Get the comment parent ID
248: *
249: * @return Comment parent ID
250: */
251: public Integer getParentId();
252:
253: /**
254: * Set the comment parent ID
255: *
256: * @param parentId Comment parent ID
257: */
258: public void setParentId(Integer parentId);
259: }
|