01: package org.emforge.comment;
02:
03: import org.emforge.xfer.CommentTO;
04:
05: import com.ecyrd.jspwiki.WikiEngine;
06:
07: /** Implementation of comment transformer for transforming comments from DO object stored in database
08: * to CommentTO
09: * @author akakunin
10: *
11: */
12: public class CommentTransformerImpl extends CommentTransformer {
13: public CommentTransformerImpl(WikiEngine i_wikiEngine,
14: String i_wikiName) {
15: super (i_wikiEngine, i_wikiName);
16: }
17:
18: public CommentTO transform(Object i_input) {
19: CommentDO commentDO = (CommentDO) i_input;
20: CommentTO commentTO = new CommentTO();
21:
22: commentTO.setAuthor(commentDO.getActorId());
23: commentTO.setParentName(commentDO.getPageName());
24: commentTO.setTime(commentDO.getTime());
25: commentTO.setMessage(commentDO.getMessage());
26: commentTO.setHtmlMessage(getCommentAsHtml(commentDO
27: .getMessage()));
28:
29: return commentTO;
30: }
31:
32: }
|