|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectfr.paris.lutece.plugins.extend.modules.comment.service.CommentService
public class CommentService
CommentService
| Field Summary | |
|---|---|
static String |
BEAN_SERVICE
The Constant BEAN_SERVICE. |
| Constructor Summary | |
|---|---|
CommentService()
|
|
| Method Summary | |
|---|---|
int |
countByIdParent(int nIdParent,
boolean bPublishedOnly)
Get the number of comments associated with a given parent |
void |
create(Comment comment)
Insert. |
List<Comment> |
findByIdParent(int nIdParent,
boolean bPublishedOnly)
Get comments from their parent |
List<Comment> |
findByIdParent(int nIdParent,
boolean bPublishedOnly,
String strSortedAttributeName,
boolean bAscSort)
Get comments from their parent |
Comment |
findByPrimaryKey(int nIdComment)
Load. |
List<Comment> |
findByResource(String strIdExtendableResource,
String strExtendableResourceType,
boolean bPublishedOnly,
boolean bAscSort)
Select by resource. |
List<Comment> |
findByResource(String strIdExtendableResource,
String strExtendableResourceType,
boolean bPublishedOnly,
String strSortedAttributeName,
boolean bAscSort,
int nItemsOffset,
int nMaxItemsNumber,
boolean bLoadSubComments)
Get comments of a given resource |
List<Integer> |
findIdMostCommentedResources(String strExtendableResourceType,
boolean bPublishedOnly,
int nItemsOffset,
int nMaxItemsNumber)
Get the ids of resources ordered by their number of comments |
List<Integer> |
findIdsByResource(String strIdExtendableResource,
String strExtendableResourceType,
boolean bPublishedOnly)
Select ids of comments associated with a given resource |
List<Comment> |
findLastComments(String strIdExtendableResource,
String strExtendableResourceType,
int nNbComments,
boolean bPublishedOnly,
boolean bParentsOnly,
boolean bGetNumberSubComments)
Load last comments. |
int |
getCommentNb(String strIdExtendableResource,
String strExtendableResourceType,
boolean bParentsOnly,
boolean bPublishedOnly)
Get the number of comment |
void |
remove(int nIdComment)
Delete. |
void |
removeByResource(String strIdExtendableResource,
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 |
|---|
public static final String BEAN_SERVICE
| Constructor Detail |
|---|
public CommentService()
| Method Detail |
|---|
@Transactional(value="extend-comment.transactionManager") public void create(Comment comment)
create in interface ICommentServicecomment - the comment@Transactional(value="extend-comment.transactionManager") public void update(Comment comment)
update in interface ICommentServicecomment - the comment
@Transactional(value="extend-comment.transactionManager")
public void updateCommentStatus(int nIdComment,
boolean bPublished)
updateCommentStatus in interface ICommentServicenIdComment - the n id commentbPublished - the b published@Transactional(value="extend-comment.transactionManager") public void remove(int nIdComment)
remove in interface ICommentServicenIdComment - the n id comment
@Transactional(value="extend-comment.transactionManager")
public void removeByResource(String strIdExtendableResource,
String strExtendableResourceType)
removeByResource in interface ICommentServicestrIdExtendableResource - the str id extendable resourcestrExtendableResourceType - the str extendable resource typepublic Comment findByPrimaryKey(int nIdComment)
findByPrimaryKey in interface ICommentServicenIdComment - the n id comment
public List<Integer> findIdsByResource(String strIdExtendableResource,
String strExtendableResourceType,
boolean bPublishedOnly)
findIdsByResource in interface ICommentServicestrIdExtendableResource - The id of the extendable resourcestrExtendableResourceType - The extendable resource typebPublishedOnly - True to consider only published comments, false to
consider every comment
public List<Comment> findByResource(String strIdExtendableResource,
String strExtendableResourceType,
boolean bPublishedOnly,
boolean bAscSort)
findByResource in interface ICommentServicestrIdExtendableResource - the id of the extendable resourcestrExtendableResourceType - the extendable resource typebPublishedOnly - Get only published commentsbAscSort - True if comments should be sorted ascendantly, false
otherwise
public int getCommentNb(String strIdExtendableResource,
String strExtendableResourceType,
boolean bParentsOnly,
boolean bPublishedOnly)
getCommentNb in interface ICommentServicestrIdExtendableResource - the id of the extendable resourcestrExtendableResourceType - the extendable resource typebParentsOnly - True to consider only comments with no parent, false
otherwisebPublishedOnly - True to get only published comments, false to get
every comments
public List<Comment> findLastComments(String strIdExtendableResource,
String strExtendableResourceType,
int nNbComments,
boolean bPublishedOnly,
boolean bParentsOnly,
boolean bGetNumberSubComments)
findLastComments in interface ICommentServicestrIdExtendableResource - the id of the extendable resourcestrExtendableResourceType - the extendable resource typenNbComments - the number of commentsbPublishedOnly - True to get only published comments, false to get
every commentsbParentsOnly - True to get only parent comments, false to get every
comments.bGetNumberSubComments - True to get the number of sub comments of
each comment, false otherwise
public List<Comment> findByResource(String strIdExtendableResource,
String strExtendableResourceType,
boolean bPublishedOnly,
String strSortedAttributeName,
boolean bAscSort,
int nItemsOffset,
int nMaxItemsNumber,
boolean bLoadSubComments)
findByResource in interface ICommentServicestrIdExtendableResource - The id of the resourcestrExtendableResourceType - The type of the resourcebPublishedOnly - True to consider only published commentsstrSortedAttributeName - The name of the attribute to sort, or null
if no sort should be donebAscSort - True to sort ascendantly, false otherwisenItemsOffset - The offset of the items to get, or 0 to get items
from the first onenMaxItemsNumber - The maximum number of items to return, or 0 to get
every itemsbLoadSubComments - True if sub comments should be loaded, false if
they should be ignored
public List<Comment> findByIdParent(int nIdParent,
boolean bPublishedOnly)
findByIdParent in interface ICommentServicenIdParent - The id of the parent of comments to getbPublishedOnly - True to consider only published comments
public List<Comment> findByIdParent(int nIdParent,
boolean bPublishedOnly,
String strSortedAttributeName,
boolean bAscSort)
findByIdParent in interface ICommentServicenIdParent - The id of the parent of comments to getbPublishedOnly - True to consider only published commentsstrSortedAttributeName - The name of the attribute to sort, or null
if no sort should be donebAscSort - True to sort ascendantly, false otherwise
public int countByIdParent(int nIdParent,
boolean bPublishedOnly)
countByIdParent in interface ICommentServicenIdParent - The id of the parent of comments to count.bPublishedOnly - True to consider only published comments
public List<Integer> findIdMostCommentedResources(String strExtendableResourceType,
boolean bPublishedOnly,
int nItemsOffset,
int nMaxItemsNumber)
findIdMostCommentedResources in interface ICommentServicestrExtendableResourceType - The type of resources to considerbPublishedOnly - True to consider only published comments, false to
consider every commentsnItemsOffset - The offset of the items to get, or 0 to get items
from the first onenMaxItemsNumber - The maximum number of items to return, or 0 to get
every items
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||