public class CommentDAO extends Object implements ICommentDAO
Constructor and Description |
---|
CommentDAO() |
Modifier and Type | Method and Description |
---|---|
int |
countByIdParent(int nIdParent,
boolean bPublishedOnly,
fr.paris.lutece.portal.service.plugin.Plugin plugin)
Get the number of comments associated with a given parent
|
void |
delete(int nIdComment,
fr.paris.lutece.portal.service.plugin.Plugin plugin)
Delete.
|
void |
deleteByResource(String strIdExtendableResource,
String strExtendableResourceType,
fr.paris.lutece.portal.service.plugin.Plugin plugin)
Delete by id hub resource.
|
List<Comment> |
findByIdParent(int nIdParent,
CommentFilter commentFilter,
fr.paris.lutece.portal.service.plugin.Plugin plugin)
Get comments from their parent
|
List<Integer> |
findIdMostCommentedResources(String strExtendableResourceType,
boolean bPublishedOnly,
int nItemsOffset,
int nMaxItemsNumber,
fr.paris.lutece.portal.service.plugin.Plugin plugin)
Get the ids of resources ordered by their number of comments
|
List<Integer> |
findIdsByResource(String strIdExtendableResource,
String strExtendableResourceType,
boolean bPublishedOnly,
fr.paris.lutece.portal.service.plugin.Plugin plugin)
Select ids of comments associated with a given resource
|
List<Comment> |
findParentCommentsByResource(String strIdExtendableResource,
String strExtendableResourceType,
CommentFilter commentFilter,
int nItemsOffset,
int nMaxItemsNumber,
fr.paris.lutece.portal.service.plugin.Plugin plugin)
Get comments of a given resource.
|
int |
getCommentNb(String strIdExtendableResource,
String strExtendableResourceType,
boolean bParentsOnly,
boolean bPublishedOnly,
fr.paris.lutece.portal.service.plugin.Plugin plugin)
Check comment nb.
|
void |
insert(Comment comment,
fr.paris.lutece.portal.service.plugin.Plugin plugin)
Insert.
|
Comment |
load(int nIdComment,
fr.paris.lutece.portal.service.plugin.Plugin plugin)
Load.
|
List<Comment> |
selectLastComments(String strIdExtendableResource,
String strExtendableResourceType,
int nNbComments,
boolean bPublishedOnly,
boolean bParentsOnly,
fr.paris.lutece.portal.service.plugin.Plugin plugin)
Load last comments.
|
void |
store(Comment comment,
fr.paris.lutece.portal.service.plugin.Plugin plugin)
Store.
|
void |
updateCommentStatus(int nIdComment,
boolean bPublished,
fr.paris.lutece.portal.service.plugin.Plugin plugin)
Update comment status.
|
public void insert(Comment comment, fr.paris.lutece.portal.service.plugin.Plugin plugin)
insert
in interface ICommentDAO
comment
- the commentplugin
- the pluginpublic Comment load(int nIdComment, fr.paris.lutece.portal.service.plugin.Plugin plugin)
load
in interface ICommentDAO
nIdComment
- the n id commentplugin
- the pluginpublic void delete(int nIdComment, fr.paris.lutece.portal.service.plugin.Plugin plugin)
delete
in interface ICommentDAO
nIdComment
- the n id commentplugin
- the pluginpublic void deleteByResource(String strIdExtendableResource, String strExtendableResourceType, fr.paris.lutece.portal.service.plugin.Plugin plugin)
deleteByResource
in interface ICommentDAO
strIdExtendableResource
- the str id extendable resourcestrExtendableResourceType
- the str extendable resource typeplugin
- the pluginpublic void store(Comment comment, fr.paris.lutece.portal.service.plugin.Plugin plugin)
store
in interface ICommentDAO
comment
- the commentplugin
- the pluginpublic void updateCommentStatus(int nIdComment, boolean bPublished, fr.paris.lutece.portal.service.plugin.Plugin plugin)
updateCommentStatus
in interface ICommentDAO
nIdComment
- the n id commentbPublished
- the b publishedplugin
- the pluginpublic int getCommentNb(String strIdExtendableResource, String strExtendableResourceType, boolean bParentsOnly, boolean bPublishedOnly, fr.paris.lutece.portal.service.plugin.Plugin plugin)
getCommentNb
in interface ICommentDAO
strIdExtendableResource
- the id of the extendable resourcestrExtendableResourceType
- the extendable resource typebParentsOnly
- True to consider only comments with no parent, false
otherwisebPublishedOnly
- True to consider only published comments, false to
consider every comments.plugin
- the pluginpublic List<Comment> selectLastComments(String strIdExtendableResource, String strExtendableResourceType, int nNbComments, boolean bPublishedOnly, boolean bParentsOnly, fr.paris.lutece.portal.service.plugin.Plugin plugin)
selectLastComments
in interface ICommentDAO
strIdExtendableResource
- the id of the extendable resourcestrExtendableResourceType
- the extendable resource typenNbComments
- the number of commentsbPublishedOnly
- the b published onlybParentsOnly
- True to get only parent comments, false to get every
comments.plugin
- the pluginpublic List<Comment> findParentCommentsByResource(String strIdExtendableResource, String strExtendableResourceType, CommentFilter commentFilter, int nItemsOffset, int nMaxItemsNumber, fr.paris.lutece.portal.service.plugin.Plugin plugin)
findParentCommentsByResource
in interface ICommentDAO
strIdExtendableResource
- The id of the resourcestrExtendableResourceType
- The type of the resourcenItemsOffset
- 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 itemsplugin
- The pluginpublic List<Comment> findByIdParent(int nIdParent, CommentFilter commentFilter, fr.paris.lutece.portal.service.plugin.Plugin plugin)
findByIdParent
in interface ICommentDAO
nIdParent
- The id of the parent of comments to getcommentFilter
- The comment filterplugin
- The pluginpublic int countByIdParent(int nIdParent, boolean bPublishedOnly, fr.paris.lutece.portal.service.plugin.Plugin plugin)
countByIdParent
in interface ICommentDAO
nIdParent
- The id of the parent of comments to count.bPublishedOnly
- True to consider only published commentsplugin
- The pluginpublic List<Integer> findIdsByResource(String strIdExtendableResource, String strExtendableResourceType, boolean bPublishedOnly, fr.paris.lutece.portal.service.plugin.Plugin plugin)
findIdsByResource
in interface ICommentDAO
strIdExtendableResource
- The id of the extendable resourcestrExtendableResourceType
- The extendable resource typebPublishedOnly
- True to consider only published comments, false to
consider every commentplugin
- The pluginpublic List<Integer> findIdMostCommentedResources(String strExtendableResourceType, boolean bPublishedOnly, int nItemsOffset, int nMaxItemsNumber, fr.paris.lutece.portal.service.plugin.Plugin plugin)
findIdMostCommentedResources
in interface ICommentDAO
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 itemsplugin
- The pluginCopyright © 2016 City of Paris. All rights reserved.