Class SuggestedRevisionHome
java.lang.Object
fr.paris.lutece.plugins.wiki.business.suggestedrevision.SuggestedRevisionHome
Static facade for SuggestedRevision persistence.
-
Method Summary
Modifier and TypeMethodDescriptioncountPendingByEntities(List<Integer> entityIds) Counts pending suggestions for a batch of entities in a single query.static intcountPendingByEntity(int nEntityId) Counts the pending suggestions on a single entity.static SuggestedRevisioncreate(SuggestedRevision suggestion) Persists a new suggestion.static SuggestedRevisionfindByPrimaryKey(int nKey) Loads a suggestion by its primary key.static List<SuggestedRevision>Returns all pending suggestions across the wiki.static List<SuggestedRevision>getByAuthor(String strAuthorGuid) Returns the suggestions submitted by the given author.static Optional<SuggestedRevision>getPendingByEntityAndAuthor(int nEntityId, String strAuthorGuid) Returns the pending suggestion from a given author on a given entity, if any.static voidremove(int nKey) Removes a suggestion by primary key.static SuggestedRevisionupdateStatus(SuggestedRevision suggestion) Updates the status, reviewer and review comment of an existing suggestion.
-
Method Details
-
create
Persists a new suggestion.- Parameters:
suggestion- the suggestion to persist- Returns:
- the persisted suggestion (with its generated id)
-
updateStatus
Updates the status, reviewer and review comment of an existing suggestion.- Parameters:
suggestion- the suggestion to update- Returns:
- the updated suggestion
-
remove
public static void remove(int nKey) Removes a suggestion by primary key.- Parameters:
nKey- the suggestion id
-
findByPrimaryKey
Loads a suggestion by its primary key.- Parameters:
nKey- the suggestion id- Returns:
- the suggestion or null
-
countPendingByEntity
public static int countPendingByEntity(int nEntityId) Counts the pending suggestions on a single entity.- Parameters:
nEntityId- the entity id- Returns:
- the count
-
countPendingByEntities
Counts pending suggestions for a batch of entities in a single query.- Parameters:
entityIds- the entity ids- Returns:
- a map of entity id to pending count (entities with no pending suggestion are absent)
-
getAllPending
Returns all pending suggestions across the wiki.- Returns:
- every pending suggestion
-
getByAuthor
Returns the suggestions submitted by the given author.- Parameters:
strAuthorGuid- the proposer's user guid- Returns:
- the suggestions submitted by this author
-
getPendingByEntityAndAuthor
public static Optional<SuggestedRevision> getPendingByEntityAndAuthor(int nEntityId, String strAuthorGuid) Returns the pending suggestion from a given author on a given entity, if any.- Parameters:
nEntityId- the wiki item idstrAuthorGuid- the proposer's user guid- Returns:
- the pending suggestion if exists
-