com.webmethods.caf.faces.data.comments.impl
Class CommentEntry

java.lang.Object
  extended by com.webmethods.caf.faces.data.comments.impl.CommentEntry
All Implemented Interfaces:
ICommentEntry

public class CommentEntry
extends Object
implements ICommentEntry


Field Summary
protected  IAttachmentItem[] attachments
           
protected  PortalItemModel comment
           
 
Constructor Summary
CommentEntry()
           
CommentEntry(IThingID thingID)
           
 
Method Summary
 IAttachmentItem[] getAttachments()
          Returns list of attachments for this comment
 String getDisplayText()
          Returns processed text for the comment suitable for display
 String getID()
          Returns unique ID for this comment entry
 String getText()
          Returns original text for comment
 Date getTimestamp()
          Returns timestamp for the comment
 String getUserDisplayName()
          Returns display name of the user made the comment
 String getUserID()
          Returns ID of the user made the comment
 boolean isHtmlText()
           
protected static String processPlainText(String s)
          Adds html formatting to plain text.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

comment

protected PortalItemModel comment

attachments

protected IAttachmentItem[] attachments
Constructor Detail

CommentEntry

public CommentEntry()

CommentEntry

public CommentEntry(IThingID thingID)
             throws Exception
Throws:
Exception
Method Detail

isHtmlText

public boolean isHtmlText()

getUserDisplayName

public String getUserDisplayName()
Description copied from interface: ICommentEntry
Returns display name of the user made the comment

Specified by:
getUserDisplayName in interface ICommentEntry

getUserID

public String getUserID()
Description copied from interface: ICommentEntry
Returns ID of the user made the comment

Specified by:
getUserID in interface ICommentEntry

getTimestamp

public Date getTimestamp()
Description copied from interface: ICommentEntry
Returns timestamp for the comment

Specified by:
getTimestamp in interface ICommentEntry

getText

public String getText()
Description copied from interface: ICommentEntry
Returns original text for comment

Specified by:
getText in interface ICommentEntry

getDisplayText

public String getDisplayText()
Description copied from interface: ICommentEntry
Returns processed text for the comment suitable for display

Specified by:
getDisplayText in interface ICommentEntry

processPlainText

protected static String processPlainText(String s)
Adds html formatting to plain text. Applies following processing:
  1. HTML-encode &, <, and >.
  2. Insert br element after every line feed.
  3. Replaces ' ' [two-spaces] with '  ' [space + non-breaking space]; replaces \t [tab] with '    ' [four spaces].
  4. Wrap with hyperlink any word beginning with http:, https:, ftp:, or www..


getAttachments

public IAttachmentItem[] getAttachments()
                                 throws Exception
Description copied from interface: ICommentEntry
Returns list of attachments for this comment

Specified by:
getAttachments in interface ICommentEntry
Throws:
Exception

getID

public String getID()
Description copied from interface: ICommentEntry
Returns unique ID for this comment entry

Specified by:
getID in interface ICommentEntry