Interface ISuggestedRevisionDAO
- All Known Implementing Classes:
SuggestedRevisionDAO
public interface ISuggestedRevisionDAO
Data Access contract for SuggestedRevision objects.
-
Method Summary
Modifier and TypeMethodDescriptioncountPendingByEntities(List<Integer> entityIds, fr.paris.lutece.portal.service.plugin.Plugin plugin) Counts pending suggestions for a batch of entities in a single query.intcountPendingByEntity(int nEntityId, fr.paris.lutece.portal.service.plugin.Plugin plugin) Counts pending suggestions for a single entity.voiddelete(int nKey, fr.paris.lutece.portal.service.plugin.Plugin plugin) Removes a suggestion by primary key.voidinsert(SuggestedRevision suggestion, fr.paris.lutece.portal.service.plugin.Plugin plugin) Inserts a new suggestion.load(int nKey, fr.paris.lutece.portal.service.plugin.Plugin plugin) Loads a suggestion by primary key.selectAllPending(fr.paris.lutece.portal.service.plugin.Plugin plugin) Returns every pending suggestion, ordered by creation date desc.selectByAuthor(String strAuthorGuid, fr.paris.lutece.portal.service.plugin.Plugin plugin) Returns the suggestions submitted by the given author, ordered by creation date desc.selectPendingByEntityAndAuthor(int nEntityId, String strAuthorGuid, fr.paris.lutece.portal.service.plugin.Plugin plugin) Returns the pending suggestion from a given author on a given entity, if any.voidupdateStatus(SuggestedRevision suggestion, fr.paris.lutece.portal.service.plugin.Plugin plugin) Updates the status, reviewer and review comment of a suggestion.
-
Method Details
-
insert
Inserts a new suggestion.- Parameters:
suggestion- the suggestion to persistplugin- the wiki plugin
-
updateStatus
void updateStatus(SuggestedRevision suggestion, fr.paris.lutece.portal.service.plugin.Plugin plugin) Updates the status, reviewer and review comment of a suggestion.- Parameters:
suggestion- the suggestion to updateplugin- the wiki plugin
-
delete
void delete(int nKey, fr.paris.lutece.portal.service.plugin.Plugin plugin) Removes a suggestion by primary key.- Parameters:
nKey- the suggestion idplugin- the wiki plugin
-
load
Loads a suggestion by primary key.- Parameters:
nKey- the suggestion idplugin- the wiki plugin- Returns:
- the suggestion if found
-
selectAllPending
Returns every pending suggestion, ordered by creation date desc.- Parameters:
plugin- the wiki plugin- Returns:
- all pending suggestions
-
selectByAuthor
List<SuggestedRevision> selectByAuthor(String strAuthorGuid, fr.paris.lutece.portal.service.plugin.Plugin plugin) Returns the suggestions submitted by the given author, ordered by creation date desc.- Parameters:
strAuthorGuid- the proposer's user guidplugin- the wiki plugin- Returns:
- the suggestions submitted by this author
-
selectPendingByEntityAndAuthor
Optional<SuggestedRevision> selectPendingByEntityAndAuthor(int nEntityId, String strAuthorGuid, fr.paris.lutece.portal.service.plugin.Plugin plugin) Returns the pending suggestion from a given author on a given entity, if any.- Parameters:
nEntityId- the wiki item idstrAuthorGuid- the proposer's user guidplugin- the wiki plugin- Returns:
- the pending suggestion if exists
-
countPendingByEntity
int countPendingByEntity(int nEntityId, fr.paris.lutece.portal.service.plugin.Plugin plugin) Counts pending suggestions for a single entity.- Parameters:
nEntityId- the entity idplugin- the wiki plugin- Returns:
- the number of pending suggestions on this entity
-
countPendingByEntities
Map<Integer,Integer> countPendingByEntities(List<Integer> entityIds, fr.paris.lutece.portal.service.plugin.Plugin plugin) Counts pending suggestions for a batch of entities in a single query. Entities with no pending suggestion are absent from the result.- Parameters:
entityIds- the entity ids to count forplugin- the wiki plugin- Returns:
- a map of entity id to pending count
-