Dekoh platform API

dekoh.portal.fwk.persistence
Class Comment

java.lang.Object
  extended by dekoh.portal.fwk.persistence.Comment

public class Comment
extends Object

Comment are posted on a Share. Replies can be posted on a Comment to make up a "Comment Thread".

Example Usage :

 Share share = entityManager.findShareById("SHARE000989");
 Comment topComment = share.postComment(userId, "comment", "dioId");
 Comment reply = topComment.replyToThisComment("buddy3","This is awesome");
 

Since:
Sep 19, 2006

Constructor Summary
protected Comment()
           
  Comment(Comment parent, LocalUser localUser, String comment, Share share, DigitalObject commentOn, String accessPath)
           
 
Method Summary
static Comment findCommentById(int commentId, DIOEntityManager em)
           
static List findMostRecentComments(DIOEntityManager em, int numComments, String applicationId, String owner)
           
 String getAccessPath()
           
static List getAllCommentsForDio(DIOEntityManager em, Integer dioId, String owner)
          Get the comments viewable to the owner
static List getAllCommentsForSharedDio(DIOEntityManager em, Integer dioId, Share share)
          Get the comments visible to the viewer for a dio that has been shared
 String getComment()
           
 DigitalObject getCommentedOn()
           
 int getCommentId()
           
 String getCommentorDisplayName()
           
static List getCommentThreadsForDio(DIOEntityManager em, Integer dioId)
           
static List getCommentThreadsForSharedDio(DIOEntityManager em, Integer dioId, Share share)
           
 int getNumberOfReplies()
           
 Comment getParentComment()
           
 Timestamp getPostedAt()
           
 String getPostedAtFormatted(Locale locale)
           
 List getReplyComments()
           
 Share getShare()
           
 boolean isViewOnlyToOwner()
           
 Comment replyToThisComment(Buddy commentor, String comment)
           
 Comment replyToThisComment(LocalUser localUser, String comment)
           
 Comment replyToThisComment(LocalUser localUser, String comment, DigitalObject commentOn)
           
 void setComment(String comment)
           
 void setCommentedOn(DigitalObject commentedOn)
           
 void setParentComment(Comment parentComment)
           
 void setPostedAt(Timestamp postedAt)
           
 void setReplyComments(List replyComments)
           
 void setShare(Share share)
           
 void setViewOnlyToOwner(boolean viewOnlyToOwner)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Comment

protected Comment()

Comment

public Comment(Comment parent,
               LocalUser localUser,
               String comment,
               Share share,
               DigitalObject commentOn,
               String accessPath)
Method Detail

getCommentThreadsForDio

public static List getCommentThreadsForDio(DIOEntityManager em,
                                           Integer dioId)

getCommentThreadsForSharedDio

public static List getCommentThreadsForSharedDio(DIOEntityManager em,
                                                 Integer dioId,
                                                 Share share)

getAllCommentsForSharedDio

public static List getAllCommentsForSharedDio(DIOEntityManager em,
                                              Integer dioId,
                                              Share share)
Get the comments visible to the viewer for a dio that has been shared


getAllCommentsForDio

public static List getAllCommentsForDio(DIOEntityManager em,
                                        Integer dioId,
                                        String owner)
Get the comments viewable to the owner


replyToThisComment

public Comment replyToThisComment(Buddy commentor,
                                  String comment)

replyToThisComment

public Comment replyToThisComment(LocalUser localUser,
                                  String comment,
                                  DigitalObject commentOn)

replyToThisComment

public Comment replyToThisComment(LocalUser localUser,
                                  String comment)

getCommentId

public int getCommentId()

getAccessPath

public String getAccessPath()

getCommentorDisplayName

public String getCommentorDisplayName()
Returns:
The name of the person who made the comment. This could be remote or local user.Method is not expected to return NULL;

getComment

public String getComment()

setComment

public void setComment(String comment)

getPostedAt

public Timestamp getPostedAt()
Returns:
See Also:
#getPostedAtFormatted(java.util.Locale)}

getPostedAtFormatted

public String getPostedAtFormatted(Locale locale)
Parameters:
locale -
Returns:
formatted date according to the locale.
See Also:
java.text.DateFormat#getDateInstance(int,Locale)}

setPostedAt

public void setPostedAt(Timestamp postedAt)

isViewOnlyToOwner

public boolean isViewOnlyToOwner()

setViewOnlyToOwner

public void setViewOnlyToOwner(boolean viewOnlyToOwner)

getReplyComments

public List getReplyComments()

setReplyComments

public void setReplyComments(List replyComments)

getParentComment

public Comment getParentComment()

setParentComment

public void setParentComment(Comment parentComment)

getShare

public Share getShare()

setShare

public void setShare(Share share)

getCommentedOn

public DigitalObject getCommentedOn()

setCommentedOn

public void setCommentedOn(DigitalObject commentedOn)

getNumberOfReplies

public int getNumberOfReplies()

toString

public String toString()
Overrides:
toString in class Object

findMostRecentComments

public static List findMostRecentComments(DIOEntityManager em,
                                          int numComments,
                                          String applicationId,
                                          String owner)

findCommentById

public static Comment findCommentById(int commentId,
                                      DIOEntityManager em)

Dekoh platform API

© 2009 Pramati Technologies - Dekoh - Portal for Developers