public interface ICommentService
Modifier and Type | Method and Description |
---|---|
int |
countByIdParent(int nIdParent,
boolean bPublishedOnly)
Get the number of comments associated with a given parent
|
void |
create(Comment comment)
Insert.
|
void |
create(Comment comment,
javax.servlet.http.HttpServletRequest request)
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
|
List<Comment> |
findByListResource(List<String> listIdExtendableResource,
String strExtendableResourceType)
Find comment list by resource
|
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<Comment> |
findByResource(String strIdExtendableResource,
String strExtendableResourceType,
CommentFilter commentFilter,
int nItemsOffset,
int nMaxItemsNumber,
boolean bLoadSubComments)
Get comments of a given resource
|
List<Comment> |
findCommentsByLuteceUser(String strLuteceUserName)
Load comments by lutece user name.
|
List<Comment> |
findCommentsPinned(String strIdExtendableResource,
String strExtendableResourceType,
int nNbComments,
Integer nCommentState,
boolean bParentsOnly,
boolean bGetNumberSubComments,
String strFilterUserName)
Load comments pinned.
|
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,
boolean bDisplaySubComments,
boolean bSortedByDateCreation)
Load last comments.
|
int |
getCommentNb(String strIdExtendableResource,
String strExtendableResourceType,
boolean bParentsOnly,
boolean bPublishedOnly)
Get the number of comment
|
fr.paris.lutece.util.ReferenceList |
getRefListCommentStates(Locale locale)
return a referenceList of comment states
|
fr.paris.lutece.util.ReferenceList |
getRefListFilterAsImportant(Locale locale)
return a referenceList containing the filter on the flag important
|
fr.paris.lutece.util.ReferenceList |
getRefListFilterAsPinned(Locale locale)
return a referenceList containing the filter on the flag As Pinned
|
String |
getResourceType(String extendableResourceType)
return resource type
|
void |
remove(int nIdComment)
Delete.
|
void |
removeByResource(String strIdExtendableResource,
String strExtendableResourceType)
Delete by resource
|
void |
update(Comment comment)
Store.
|
void |
updateCommentPinned(int nIdComment,
boolean bPinned)
Update flag important.
|
void |
updateCommentStatus(int nIdComment,
boolean bPublished)
Update comment status.
|
void |
updateFlagImportant(int nIdComment,
boolean bImportant)
Update flag important.
|
@Transactional(value="extend-comment.transactionManager") void remove(int nIdComment)
nIdComment
- the n id comment@Transactional(value="extend-comment.transactionManager") void removeByResource(String strIdExtendableResource, String strExtendableResourceType)
strIdExtendableResource
- the str id extendable resourcestrExtendableResourceType
- the str extendable resource type@Transactional(value="extend-comment.transactionManager") void create(Comment comment)
comment
- the comment@Transactional(value="extend-comment.transactionManager") void create(Comment comment, javax.servlet.http.HttpServletRequest request)
comment
- the commentrequest
- the HTTP request@Transactional(value="extend-comment.transactionManager") void update(Comment comment)
comment
- the comment@Transactional(value="extend-comment.transactionManager") void updateCommentStatus(int nIdComment, boolean bPublished)
nIdComment
- the n id commentbPublished
- the b published@Transactional(value="extend-comment.transactionManager") void updateFlagImportant(int nIdComment, boolean bImportant)
nIdComment
- the n id commentbImportant
- true if the comment is important@Transactional(value="extend-comment.transactionManager") void updateCommentPinned(int nIdComment, boolean bPinned)
nIdComment
- the n id commentbPinned
- true if the comment must be pinnedComment findByPrimaryKey(int nIdComment)
nIdComment
- the n id commentList<Integer> findIdsByResource(String strIdExtendableResource, String strExtendableResourceType, boolean bPublishedOnly)
strIdExtendableResource
- The id of the extendable resourcestrExtendableResourceType
- The extendable resource typebPublishedOnly
- True to consider only published comments, false to consider every commentList<Comment> findByResource(String strIdExtendableResource, String strExtendableResourceType, boolean bPublishedOnly, boolean bAscSort)
strIdExtendableResource
- the id of the extendable resourcestrExtendableResourceType
- the extendable resource typebPublishedOnly
- Get only published commentsbAscSort
- True if comments should be sorted ascendantly, false otherwiseint getCommentNb(String strIdExtendableResource, String strExtendableResourceType, boolean bParentsOnly, boolean bPublishedOnly)
strIdExtendableResource
- 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 commentsList<Comment> findLastComments(String strIdExtendableResource, String strExtendableResourceType, int nNbComments, boolean bPublishedOnly, boolean bParentsOnly, boolean bGetNumberSubComments, boolean bDisplaySubComments, boolean bSortedByDateCreation)
strIdExtendableResource
- 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 otherwisebDisplaySubComments
- True if the mod display sub comments is enablebSortedByDateCreation
- true if the list is sorted by date creationList<Comment> findByResource(String strIdExtendableResource, String strExtendableResourceType, boolean bPublishedOnly, String strSortedAttributeName, boolean bAscSort, int nItemsOffset, int nMaxItemsNumber, boolean bLoadSubComments)
strIdExtendableResource
- 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 ignoredList<Comment> findByResource(String strIdExtendableResource, String strExtendableResourceType, CommentFilter commentFilter, int nItemsOffset, int nMaxItemsNumber, boolean bLoadSubComments)
strIdExtendableResource
- The id of the resourcestrExtendableResourceType
- The type of the resourcecommentFilter
- The commentFilter ObjectnItemsOffset
- 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 ignoredList<Comment> findByIdParent(int nIdParent, boolean bPublishedOnly)
nIdParent
- The id of the parent of comments to getbPublishedOnly
- True to consider only published commentsList<Comment> findByIdParent(int nIdParent, boolean bPublishedOnly, String strSortedAttributeName, boolean bAscSort)
nIdParent
- 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 otherwiseList<Comment> findCommentsPinned(String strIdExtendableResource, String strExtendableResourceType, int nNbComments, Integer nCommentState, boolean bParentsOnly, boolean bGetNumberSubComments, String strFilterUserName)
strIdExtendableResource
- 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 otherwiseadd
- filter on user name strFilterUserNameint countByIdParent(int nIdParent, boolean bPublishedOnly)
nIdParent
- The id of the parent of comments to count.bPublishedOnly
- True to consider only published commentsList<Integer> findIdMostCommentedResources(String strExtendableResourceType, boolean bPublishedOnly, int nItemsOffset, int nMaxItemsNumber)
strExtendableResourceType
- 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 itemsList<Comment> findByListResource(List<String> listIdExtendableResource, String strExtendableResourceType)
strIdExtendableResource
- the id of the extendable resourcestrExtendableResourceType
- the extendable resource typefr.paris.lutece.util.ReferenceList getRefListCommentStates(Locale locale)
locale
- the localefr.paris.lutece.util.ReferenceList getRefListFilterAsImportant(Locale locale)
locale
- the localefr.paris.lutece.util.ReferenceList getRefListFilterAsPinned(Locale locale)
locale
- the localeString getResourceType(String extendableResourceType)
extendableResourceType
- List<Comment> findCommentsByLuteceUser(String strLuteceUserName)
strLuteceUserName
- the name of the lutece usernItemsOffset
- 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 itemsCopyright © 2022 City of Paris. All rights reserved.