|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.silverpeas.comment.service.CommentActionNotifier
com.silverpeas.comment.service.DefaultCommentService
@Named(value="commentService") public class DefaultCommentService
A service that provide the features to handle the comments in Silverpeas. Such features are, for example, retrieving comments on a given content, creating a comment into the business layer, indexing them, notifying components interested by the creation or the deletion of a comment, and so on. A comment is text written by users about a content published in Silverpeas. Such comment, as any other contents in Silverpeas, can be indexed in order to be found by the Silverpeas search engine. This service is managed by an IoC container and this be retrieved by dependency injection.
Constructor Summary | |
---|---|
protected |
DefaultCommentService()
Constructs a new DefaultCommentService instance. |
Method Summary | |
---|---|
void |
createAndIndexComment(Comment cmt)
Creates and indexes the specified comment into the business layer. |
void |
createComment(Comment cmt)
Creates the specified comment into the business layer. |
void |
deleteAllCommentsByComponentInstanceId(String instanceId)
Deletes all of the comments by the component instance identifier. |
void |
deleteAllCommentsOnPublication(String resourceType,
WAPrimaryKey pk)
Deletes all of the comments on the publication identified by the resource type and the specified identifier. |
void |
deleteComment(Comment comment)
Deletes the specified comment. |
void |
deleteComment(CommentPK pk)
Deletes the comment identified by the specified identifier. |
List<Comment> |
getAllCommentsOnPublication(String resourceType,
WAPrimaryKey pk)
Gets all of the comments on the publication identified by the resource type and the specified identifier. |
List<CommentedPublicationInfo> |
getAllMostCommentedPublicationsInfo()
Gets information about all the commented publications in Silverpeas. |
Comment |
getComment(CommentPK pk)
Gets the comment that identified by the specified identifier. |
protected CommentDAO |
getCommentDAO()
Gets the comment DAO with wich operations with the underlying data source can be performed. |
int |
getCommentsCountOnPublication(String resourceType,
WAPrimaryKey pk)
Gets the count of comments on the publication identified by the resource type and the specified identifier. |
ResourceLocator |
getComponentMessages(String language)
Gets the localized messages defined in this Silverpeas component. |
ResourceLocator |
getComponentSettings()
Gets the settings of this Silverpeas component. |
Comment |
getContentById(String contentId)
Gets the content handled by an instance of the component with the specified unique identifier. |
List<Comment> |
getLastComments(String resourceType,
int count)
|
List<CommentedPublicationInfo> |
getMostCommentedPublicationsInfo(String resourceType)
Gets information about the most commented publications of the specified type. |
List<CommentedPublicationInfo> |
getMostCommentedPublicationsInfo(String resourceType,
List<? extends WAPrimaryKey> pks)
Gets information about the commented publications among the specified ones. |
protected OrganisationController |
getOrganisationController()
Gets an organization controller. |
List<SocialInformationComment> |
getSocialInformationCommentsListByUserId(List<String> resourceTypes,
String userId,
Period period)
Get the list of SocialInformationComment added by userId in a period |
List<SocialInformationComment> |
getSocialInformationCommentsListOfMyContacts(List<String> resourceTypes,
List<String> myContactsIds,
List<String> instanceIds,
Period period)
Gets the list of SocialInformationComment added by myContactsIds in a period |
void |
indexAllCommentsOnPublication(String resourceType,
WAPrimaryKey pk)
Indexes all the comments on the publication identified by the resource type and the specified identifier. |
void |
moveAndReindexComments(String resourceType,
WAPrimaryKey fromPK,
WAPrimaryKey toPK)
Moves the comments on the specified publication to the another specified publication and reindexes them. |
void |
moveComments(String resourceType,
WAPrimaryKey fromPK,
WAPrimaryKey toPK)
Moves the comments on the specified publication to the another specified publication. |
void |
unindexAllCommentsOnPublication(String resourceType,
WAPrimaryKey pk)
Removes the indexes on all the comments of the publication identified by the resource type and the specified identifier. |
void |
updateAndIndexComment(Comment cmt)
Updates and indexes the specified comment in the business layer. |
void |
updateComment(Comment cmt)
Updates the specified comment in the business layer. |
Methods inherited from class com.silverpeas.comment.service.CommentActionNotifier |
---|
notifyCommentAdding, notifyCommentRemoval |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected DefaultCommentService()
Method Detail |
---|
protected CommentDAO getCommentDAO()
public void createComment(Comment cmt)
createComment
in interface CommentService
cmt
- the comment to save.public void createAndIndexComment(Comment cmt)
createAndIndexComment
in interface CommentService
cmt
- the comment to save.public void deleteComment(CommentPK pk)
deleteComment
in interface CommentService
pk
- the unique identifier of the comment to remove from the business layer (the primary
key).public void deleteAllCommentsOnPublication(String resourceType, WAPrimaryKey pk)
deleteAllCommentsOnPublication
in interface CommentService
resourceType
- the type of the commented publication.pk
- the identifier of the publication the comments are on.public void deleteAllCommentsByComponentInstanceId(String instanceId)
deleteAllCommentsByComponentInstanceId
in interface CommentService
instanceId
- public void deleteComment(Comment comment)
deleteComment
in interface CommentService
comment
- the comment to remove.public void moveComments(String resourceType, WAPrimaryKey fromPK, WAPrimaryKey toPK)
moveComments
in interface CommentService
resourceType
- the type of the commented publication.fromPK
- the identifier of the source publication.toPK
- the identifier of the destination publication.public void moveAndReindexComments(String resourceType, WAPrimaryKey fromPK, WAPrimaryKey toPK)
moveAndReindexComments
in interface CommentService
resourceType
- the type of the commented publication.fromPK
- the identifier of the source publication.toPK
- the identifier of the destination publication.public void updateComment(Comment cmt)
updateComment
in interface CommentService
cmt
- the updated comment.public void updateAndIndexComment(Comment cmt)
updateAndIndexComment
in interface CommentService
cmt
- the comment to update and to index.public Comment getComment(CommentPK pk)
getComment
in interface CommentService
pk
- the identifier of the comment in the business layer.
public List<Comment> getAllCommentsOnPublication(String resourceType, WAPrimaryKey pk)
getAllCommentsOnPublication
in interface CommentService
resourceType
- the type of the commented publication.pk
- the identifier of the publication.
public List<CommentedPublicationInfo> getMostCommentedPublicationsInfo(String resourceType, List<? extends WAPrimaryKey> pks)
getMostCommentedPublicationsInfo
in interface CommentService
resourceType
- the type of the commented publication.pks
- a collection of primary keys refering the publications to get information and to
order by comments count.
public List<CommentedPublicationInfo> getMostCommentedPublicationsInfo(String resourceType)
getMostCommentedPublicationsInfo
in interface CommentService
resourceType
- the type of the commented publication.
public List<CommentedPublicationInfo> getAllMostCommentedPublicationsInfo()
getAllMostCommentedPublicationsInfo
in interface CommentService
public int getCommentsCountOnPublication(String resourceType, WAPrimaryKey pk)
getCommentsCountOnPublication
in interface CommentService
resourceType
- the type of the commented publication.pk
- the identifier of the publication.
public void indexAllCommentsOnPublication(String resourceType, WAPrimaryKey pk)
indexAllCommentsOnPublication
in interface CommentService
resourceType
- the type of the commented publication.pk
- the identifier of the publication.public void unindexAllCommentsOnPublication(String resourceType, WAPrimaryKey pk)
unindexAllCommentsOnPublication
in interface CommentService
resourceType
- the type of the commented publication.pk
- the identifier of the publication.protected OrganisationController getOrganisationController()
public Comment getContentById(String contentId)
SilverpeasComponentService
getContentById
in interface SilverpeasComponentService<Comment>
contentId
- the unique identifier of the content to get.
public ResourceLocator getComponentSettings()
SilverpeasComponentService
getComponentSettings
in interface SilverpeasComponentService<Comment>
public ResourceLocator getComponentMessages(String language)
SilverpeasComponentService
getComponentMessages
in interface SilverpeasComponentService<Comment>
language
- the language in which the messages has to be localized. If empty or null, then
the bundle with default messages is returned.
public List<Comment> getLastComments(String resourceType, int count)
getLastComments
in interface CommentService
public List<SocialInformationComment> getSocialInformationCommentsListByUserId(List<String> resourceTypes, String userId, Period period)
getSocialInformationCommentsListByUserId
in interface CommentService
resourceTypes
- the aimed resources types.userId
- the author of comments.period
- the period into which the comment has been created or modified.
SocialInformation
public List<SocialInformationComment> getSocialInformationCommentsListOfMyContacts(List<String> resourceTypes, List<String> myContactsIds, List<String> instanceIds, Period period)
getSocialInformationCommentsListOfMyContacts
in interface CommentService
resourceTypes
- the aimed resources types.myContactsIds
- the aimed user identifiers of contacts.instanceIds
- the aimed identifiers of component instances.period
- the period into which the comment has been created or modified.
SocialInformation
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |