com.silverpeas.comment.model
Class Comment

java.lang.Object
  extended by com.silverpeas.comment.model.Comment
All Implemented Interfaces:
SilverpeasContent, Serializable

public class Comment
extends Object
implements SilverpeasContent

This object contains the description of document

Version:
1.0
Author:
Georgy Shakirin
See Also:
Serialized Form

Field Summary
static String CLASSIFIED_RESOURCETYPE
           
static String CONTRIBUTION_TYPE
           
static String NEWS_RESOURCETYPE
           
static String PHOTO_RESOURCETYPE
           
static String PUBLICATION_RESOURCETYPE
           
static String SCHEDULEEVENT_RESOURCETYPE
           
static String SOUND_RESOURCETYPE
           
static String STREAMING_RESOURCETYPE
           
static String SUGGESTION_RESOURCETYPE
           
static String VIDEO_RESOURCETYPE
           
 
Constructor Summary
Comment(CommentPK pk, String resourceType, WAPrimaryKey foreign_key, int owner_id, String owner, String message, Date creation_date, Date modification_date)
           
Comment(CommentPK pk, String resourceType, WAPrimaryKey contentPk, String authorId, String message, Date creationDate, Date modificationDate)
           
 
Method Summary
 boolean canBeAccessedBy(UserDetail user)
          Is the specified user can access this comment?
 CommentPK getCommentPK()
           
 String getComponentInstanceId()
          Gets the unique identifier of the Silverpeas component instance that manages this content.
 String getContributionType()
          Gets the type of this content.
 Date getCreationDate()
          Gets the date at which this content was created.
 UserDetail getCreator()
          Gets the author that has created this content.
 String getDescription()
          Gets the description of this content if any.
 WAPrimaryKey getForeignKey()
           
 String getId()
          Gets the identifier of this content in the Silverpeas component providing it.
 String getMessage()
           
 Date getModificationDate()
           
 String getOwner()
           
 UserDetail getOwnerDetail()
           
 int getOwnerId()
           
 String getResourceType()
           
 String getSilverpeasContentId()
          Gets the unique identifier of this content among all the contents managed in the Silverpeas collaborative portal.
 String getTitle()
          Gets the title of this content if any.
 void setCommentPK(CommentPK pk)
           
 void setCreationDate(Date creation_date)
           
 void setForeignKey(WAPrimaryKey foreign_key)
           
 void setMessage(String message)
           
 void setModificationDate(Date modification_date)
           
 void setOwnerDetail(UserDetail ownerDetail)
           
 void setResourceType(String resourceType)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CONTRIBUTION_TYPE

public static final String CONTRIBUTION_TYPE
See Also:
Constant Field Values

PUBLICATION_RESOURCETYPE

public static final String PUBLICATION_RESOURCETYPE
See Also:
Constant Field Values

NEWS_RESOURCETYPE

public static final String NEWS_RESOURCETYPE
See Also:
Constant Field Values

CLASSIFIED_RESOURCETYPE

public static final String CLASSIFIED_RESOURCETYPE
See Also:
Constant Field Values

SCHEDULEEVENT_RESOURCETYPE

public static final String SCHEDULEEVENT_RESOURCETYPE
See Also:
Constant Field Values

SUGGESTION_RESOURCETYPE

public static final String SUGGESTION_RESOURCETYPE
See Also:
Constant Field Values

PHOTO_RESOURCETYPE

public static final String PHOTO_RESOURCETYPE
See Also:
Constant Field Values

VIDEO_RESOURCETYPE

public static final String VIDEO_RESOURCETYPE
See Also:
Constant Field Values

SOUND_RESOURCETYPE

public static final String SOUND_RESOURCETYPE
See Also:
Constant Field Values

STREAMING_RESOURCETYPE

public static final String STREAMING_RESOURCETYPE
See Also:
Constant Field Values
Constructor Detail

Comment

public Comment(CommentPK pk,
               String resourceType,
               WAPrimaryKey foreign_key,
               int owner_id,
               String owner,
               String message,
               Date creation_date,
               Date modification_date)

Comment

public Comment(CommentPK pk,
               String resourceType,
               WAPrimaryKey contentPk,
               String authorId,
               String message,
               Date creationDate,
               Date modificationDate)
Method Detail

setCommentPK

public void setCommentPK(CommentPK pk)

getCommentPK

public CommentPK getCommentPK()

setResourceType

public void setResourceType(String resourceType)

getResourceType

public String getResourceType()

setForeignKey

public void setForeignKey(WAPrimaryKey foreign_key)

getForeignKey

public WAPrimaryKey getForeignKey()

getOwnerId

public int getOwnerId()

getOwner

public String getOwner()

setMessage

public void setMessage(String message)

getMessage

public String getMessage()

setCreationDate

public void setCreationDate(Date creation_date)

getCreationDate

public Date getCreationDate()
Description copied from interface: SilverpeasContent
Gets the date at which this content was created.

Specified by:
getCreationDate in interface SilverpeasContent
Returns:
the date at which this content was created.

setModificationDate

public void setModificationDate(Date modification_date)

getModificationDate

public Date getModificationDate()

getOwnerDetail

public UserDetail getOwnerDetail()

setOwnerDetail

public void setOwnerDetail(UserDetail ownerDetail)

toString

public String toString()
Overrides:
toString in class Object

getCreator

public UserDetail getCreator()
Description copied from interface: SilverpeasContent
Gets the author that has created this content.

Specified by:
getCreator in interface SilverpeasContent
Returns:
the detail about the user that created this content.

getTitle

public String getTitle()
Description copied from interface: SilverpeasContent
Gets the title of this content if any.

Specified by:
getTitle in interface SilverpeasContent
Returns:
the resource title. Can be empty if no title was set or no title is defined for a such content.

getDescription

public String getDescription()
Description copied from interface: SilverpeasContent
Gets the description of this content if any.

Specified by:
getDescription in interface SilverpeasContent
Returns:
the resource description. Can be empty if no description was set or no description is defined for a such content.

getId

public String getId()
Description copied from interface: SilverpeasContent
Gets the identifier of this content in the Silverpeas component providing it. This identifier is only unique among all of the contents managed by the same component (whatever its different instances). As each type of contents in Silverpeas is provided by a single Silverpeas component, the identifier of a content is then specific to the component it belongs to. It is a way for an instance of a such component to identify uniquely the different contents it manages. So, each component can have their own policy to identify their content, whatever the way they are identified in Silverpeas.

Specified by:
getId in interface SilverpeasContent
Returns:
the identifier of this content.

getComponentInstanceId

public String getComponentInstanceId()
Description copied from interface: SilverpeasContent
Gets the unique identifier of the Silverpeas component instance that manages this content.

Specified by:
getComponentInstanceId in interface SilverpeasContent
Returns:
the unique identifier of the component instance in the Silverpeas collaborative portal.

getContributionType

public String getContributionType()
Description copied from interface: SilverpeasContent
Gets the type of this content.

Specified by:
getContributionType in interface SilverpeasContent
Returns:
the resource type. This can be Post, Message, Publication, Survey...

canBeAccessedBy

public boolean canBeAccessedBy(UserDetail user)
Is the specified user can access this comment?

A user can access a comment if it has enough rights to access the application instance in which is managed this comment.

Be caution, the access control on the commented resource is usually more reliable than using this method.

Specified by:
canBeAccessedBy in interface SilverpeasContent
Parameters:
user - a user in Silverpeas.
Returns:
true if the user can access this comment, false otherwise.

getSilverpeasContentId

public String getSilverpeasContentId()
Description copied from interface: SilverpeasContent
Gets the unique identifier of this content among all the contents managed in the Silverpeas collaborative portal. It is the alone unique identifier of a content in the whole Silverpeas portal and it is refered as the Silverpeas content identifier or the silver content identifier. For each content put into the Silverpeas collaborative portal, an entry is uniquely created in the whole system so that is can be refered by transversal services and by component instances others the one that manages it. For compatibility reason, the Silverpeas content identifier of contents that are no yet taken into account in the whole system isn't defined, so an empty string is then returned.

Specified by:
getSilverpeasContentId in interface SilverpeasContent
Returns:
the unique identifier of this content in the whole Silverpeas collaborative portal. Can be empty if no such identifier is defined for the type of this content.


Copyright © 2016 Silverpeas. All Rights Reserved.