Class Comment
- java.lang.Object
-
- org.silverpeas.core.comment.model.Comment
-
- All Implemented Interfaces:
Serializable
,Contribution
,SilverpeasContent
,Identifiable
,Instance<Contribution>
,Nameable
,Securable
,SilverpeasResource
public class Comment extends Object implements SilverpeasContent
A comment on a given user contribution.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static String
CONTRIBUTION_TYPE
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canBeModifiedBy(User user)
Checks the given user can modify this resource.String
getComponentInstanceId()
Gets the unique identifier of the Silverpeas component instance that manages this content.String
getContributionType()
Gets the type of this contribution.Date
getCreationDate()
Gets the date at which the resource has been created.User
getCreator()
Gets the user that has created the resource.String
getCreatorId()
String
getDescription()
Gets a description about this contribution if any.String
getId()
Gets the identifier of this content in the Silverpeas component providing it.CommentId
getIdentifier()
Contribution
default implementations.Date
getLastUpdateDate()
Gets the date at which the resource has been lastly updated.User
getLastUpdater()
Gets the user that has lastly updated the resource.String
getMessage()
ResourceReference
getResourceReference()
Gets a reference to the resource commented out by this comment.String
getResourceType()
Gets the type of the resource commented out by this comment.String
getTitle()
Gets the title of this contribution if any.void
setLastUpdateDate(Date modificationDate)
void
setMessage(String message)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.silverpeas.core.contribution.model.Contribution
canBeAccessedBy, getModel, getName, getResourcePath, isIndexable
-
Methods inherited from interface org.silverpeas.core.security.Securable
canBeDeletedBy, canBeFiledInBy
-
Methods inherited from interface org.silverpeas.core.contribution.model.SilverpeasContent
getSilverpeasContentId
-
-
-
-
Field Detail
-
CONTRIBUTION_TYPE
public static final String CONTRIBUTION_TYPE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Comment
public Comment(CommentId id, String authorId, String resourceType, ResourceReference resource, Date creationDate)
Constructs a comment about the given resource and written by the specified author at the given date.- Parameters:
id
- the unique identifier of the comment.authorId
- the unique identifier of the author.resourceType
- the type of the commented resource.resource
- a reference to the commented resource.creationDate
- the date at which the comment has been written.
-
-
Method Detail
-
getIdentifier
public CommentId getIdentifier()
Description copied from interface:SilverpeasContent
Contribution
default implementations.- Specified by:
getIdentifier
in interfaceContribution
- Specified by:
getIdentifier
in interfaceSilverpeasContent
- Specified by:
getIdentifier
in interfaceSilverpeasResource
- Returns:
- the unique identifier of the contribution.
-
getResourceType
public String getResourceType()
Gets the type of the resource commented out by this comment.- Returns:
- the type of the commented resource.
-
getResourceReference
public ResourceReference getResourceReference()
Gets a reference to the resource commented out by this comment.- Returns:
- a reference to the commented resource.
-
getCreatorId
public String getCreatorId()
-
setMessage
public void setMessage(String message)
-
getMessage
public String getMessage()
-
getCreationDate
public Date getCreationDate()
Description copied from interface:SilverpeasResource
Gets the date at which the resource has been created.- Specified by:
getCreationDate
in interfaceSilverpeasResource
- Returns:
- the date of creation of the resource.
-
setLastUpdateDate
public void setLastUpdateDate(Date modificationDate)
-
getLastUpdateDate
public Date getLastUpdateDate()
Description copied from interface:SilverpeasResource
Gets the date at which the resource has been lastly updated. If the resource doesn't have such an information, then this method should return the date of the resource creation.- Specified by:
getLastUpdateDate
in interfaceSilverpeasResource
- Returns:
- the date of the last update of the resource.
-
getLastUpdater
public User getLastUpdater()
Description copied from interface:SilverpeasResource
Gets the user that has lastly updated the resource. If the resource doesn't have such an information, then this method should return the user that has created the resource.- Specified by:
getLastUpdater
in interfaceSilverpeasResource
- Returns:
- a
User
in Silverpeas.
-
getCreator
public User getCreator()
Description copied from interface:SilverpeasResource
Gets the user that has created the resource.- Specified by:
getCreator
in interfaceSilverpeasResource
- Returns:
- a
User
in Silverpeas.
-
getTitle
public String getTitle()
Description copied from interface:Contribution
Gets the title of this contribution if any. By default returns an empty String.- Specified by:
getTitle
in interfaceContribution
- Returns:
- the contribution's title in the specified language. Can be empty if no title was set or no title is defined for a such contribution.
-
getDescription
public String getDescription()
Description copied from interface:Contribution
Gets a description about this contribution if any. By default returns an empty String.- Specified by:
getDescription
in interfaceContribution
- Specified by:
getDescription
in interfaceNameable
- Returns:
- the description on this contribution. Can be empty if no description was set or no description is defined for a such contribution.
-
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 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 interfaceIdentifiable
- Specified by:
getId
in interfaceSilverpeasContent
- 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 interfaceSilverpeasContent
- Returns:
- the unique identifier of the component instance in the Silverpeas collaborative portal.
-
getContributionType
public String getContributionType()
Description copied from interface:Contribution
Gets the type of this contribution. The type is a label that identifies uniquely a kind of contribution handled by a Silverpeas application. By default, this method returns the simple name of the class implementing this interface.- Specified by:
getContributionType
in interfaceContribution
- Returns:
- the label of the type of this contribution.
-
canBeModifiedBy
public boolean canBeModifiedBy(User user)
Description copied from interface:Securable
Checks the given user can modify this resource. By default, if the user can access this securable resource, then it can also modify it.- Specified by:
canBeModifiedBy
in interfaceSecurable
- Parameters:
user
- a user in Silverpeas.- Returns:
- true if the user can modify the data managed by this instance, false otherwise.
-
-