01: package org.emforge.comment;
02:
03: import javax.faces.convert.Converter;
04:
05: import org.apache.commons.collections.Transformer;
06: import org.emforge.xfer.CommentTO;
07:
08: import ru.emdev.EmForge.wiki.WikiTextToXHTMLConverter;
09:
10: import com.ecyrd.jspwiki.WikiEngine;
11:
12: /** base class for different comment transformers.
13: *
14: * in any case, then we are doing transformation, we need to convert comment text from wiki to HTML
15: * This base class is responsible for such transformation
16: */
17: public abstract class CommentTransformer implements Transformer {
18: protected Converter m_converter;
19: protected String m_parentName;
20:
21: public CommentTransformer(WikiEngine i_wikiEngine,
22: String i_parentName) {
23: m_parentName = i_parentName;
24: m_converter = new WikiTextToXHTMLConverter(i_wikiEngine,
25: i_parentName);
26: }
27:
28: protected String getCommentAsHtml(String comment) {
29: return m_converter.getAsString(null, null, comment);
30: }
31:
32: public abstract CommentTO transform(Object i_input);
33: }
|