fr.paris.lutece.plugins.extend.modules.comment.service
Class CommentService

java.lang.Object
  extended by fr.paris.lutece.plugins.extend.modules.comment.service.CommentService
All Implemented Interfaces:
ICommentService

public class CommentService
extends java.lang.Object
implements ICommentService

CommentService


Field Summary
static java.lang.String BEAN_SERVICE
          The Constant BEAN_SERVICE.
 
Constructor Summary
CommentService()
           
 
Method Summary
 void create(Comment comment)
          Insert.
 Comment findByPrimaryKey(int nIdComment)
          Load.
 java.util.List<Comment> findByResource(java.lang.String strIdExtendableResource, java.lang.String strExtendableResourceType, boolean bPublishedOnly, boolean bAscSort)
          Select by resource.
 java.util.List<Comment> findLastComments(java.lang.String strIdExtendableResource, java.lang.String strExtendableResourceType, int nNbComments, boolean bPublishedOnly)
          Load last comments.
 int getCommentNb(java.lang.String strIdExtendableResource, java.lang.String strExtendableResourceType)
          Check comment nb.
 void remove(int nIdComment)
          Delete.
 void removeByResource(java.lang.String strIdExtendableResource, java.lang.String strExtendableResourceType)
          Delete by resource
 void update(Comment comment)
          Store.
 void updateCommentStatus(int nIdComment, boolean bPublished)
          Update comment status.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BEAN_SERVICE

public static final java.lang.String BEAN_SERVICE
The Constant BEAN_SERVICE.

See Also:
Constant Field Values
Constructor Detail

CommentService

public CommentService()
Method Detail

create

@Transactional(value="extend-comment.transactionManager")
public void create(Comment comment)
Insert.

Specified by:
create in interface ICommentService
Parameters:
comment - the comment

update

@Transactional(value="extend-comment.transactionManager")
public void update(Comment comment)
Store.

Specified by:
update in interface ICommentService
Parameters:
comment - the comment

updateCommentStatus

@Transactional(value="extend-comment.transactionManager")
public void updateCommentStatus(int nIdComment,
                                              boolean bPublished)
Update comment status.

Specified by:
updateCommentStatus in interface ICommentService
Parameters:
nIdComment - the n id comment
bPublished - the b published

remove

@Transactional(value="extend-comment.transactionManager")
public void remove(int nIdComment)
Delete.

Specified by:
remove in interface ICommentService
Parameters:
nIdComment - the n id comment

removeByResource

@Transactional(value="extend-comment.transactionManager")
public void removeByResource(java.lang.String strIdExtendableResource,
                                           java.lang.String strExtendableResourceType)
Delete by resource

Specified by:
removeByResource in interface ICommentService
Parameters:
strIdExtendableResource - the str id extendable resource
strExtendableResourceType - the str extendable resource type

findByPrimaryKey

public Comment findByPrimaryKey(int nIdComment)
Load.

Specified by:
findByPrimaryKey in interface ICommentService
Parameters:
nIdComment - the n id comment
Returns:
the comment

findByResource

public java.util.List<Comment> findByResource(java.lang.String strIdExtendableResource,
                                              java.lang.String strExtendableResourceType,
                                              boolean bPublishedOnly,
                                              boolean bAscSort)
Select by resource.

Specified by:
findByResource in interface ICommentService
Parameters:
strIdExtendableResource - the str id extendable resource
strExtendableResourceType - the str extendable resource type
bPublishedOnly - the b only published
bAscSort - True if comments should be sorted ascendantly, false otherwise
Returns:
the list

getCommentNb

public int getCommentNb(java.lang.String strIdExtendableResource,
                        java.lang.String strExtendableResourceType)
Check comment nb.

Specified by:
getCommentNb in interface ICommentService
Parameters:
strIdExtendableResource - the str id extendable resource
strExtendableResourceType - the str extendable resource type
Returns:
the int

findLastComments

public java.util.List<Comment> findLastComments(java.lang.String strIdExtendableResource,
                                                java.lang.String strExtendableResourceType,
                                                int nNbComments,
                                                boolean bPublishedOnly)
Load last comments.

Specified by:
findLastComments in interface ICommentService
Parameters:
strIdExtendableResource - the str id extendable resource
strExtendableResourceType - the str extendable resource type
nNbComments - the n nb commentss
bPublishedOnly - the b published only
Returns:
the list


Copyright © 2012 Mairie de Paris. All Rights Reserved.