Package fr.paris.lutece.plugins.wiki.rs
Class WikiSuggestionRest.SuggestionDto
java.lang.Object
fr.paris.lutece.plugins.wiki.rs.WikiSuggestionRest.SuggestionDto
- Enclosing class:
- WikiSuggestionRest
Slim view of a suggestion suitable for list rendering, without heavy content. The scope tells whether the current user is the proposer
(
"mine") or a potential reviewer ("review").-
Constructor Summary
ConstructorsConstructorDescriptionSuggestionDto(int nId, int nEntityId, String strTitle, SuggestionStatus status, String strAuthor, Timestamp dateCreation, String strTargetCode, String strTargetViewUrl, String strScope, int nAdditions, int nDeletions, boolean bHasConflict) Constructs a DTO with all fields. -
Method Summary
Modifier and TypeMethodDescriptionfrom(SuggestedRevision s, AbstractWikiItem target, String scope, int[] stats) Builds a DTO from a domain suggestion, its target wiki item, a scope and pre-computed diff statistics.intintintbooleanintgetId()getScope()getTitle()
-
Constructor Details
-
SuggestionDto
public SuggestionDto(int nId, int nEntityId, String strTitle, SuggestionStatus status, String strAuthor, Timestamp dateCreation, String strTargetCode, String strTargetViewUrl, String strScope, int nAdditions, int nDeletions, boolean bHasConflict) Constructs a DTO with all fields.- Parameters:
nId- the suggestion idnEntityId- the targeted wiki item idstrTitle- the proposed titlestatus- the suggestion statusstrAuthor- the proposer display namedateCreation- the creation timestampstrTargetCode- the targeted item code (nullable when the item has been removed)strTargetViewUrl- the targeted item view URL (nullable when the item has been removed)strScope- the scope from the current user's perspective: "mine" or "review"nAdditions- number of lines added compared to the parent revisionnDeletions- number of lines deleted compared to the parent revisionbHasConflict- true when the suggestion is PENDING and no longer merges cleanly against the current revision
-
-
Method Details
-
from
public static WikiSuggestionRest.SuggestionDto from(SuggestedRevision s, AbstractWikiItem target, String scope, int[] stats) Builds a DTO from a domain suggestion, its target wiki item, a scope and pre-computed diff statistics.- Parameters:
s- the source suggestiontarget- the targeted wiki item, may be nullscope- "mine" or "review"stats- three-element array[additions, deletions, hasConflict]as returned bySuggestedRevisionService.diffStats(fr.paris.lutece.plugins.wiki.business.suggestedrevision.SuggestedRevision)- Returns:
- the DTO
-
getId
public int getId()- Returns:
- the suggestion id
-
getEntityId
public int getEntityId()- Returns:
- the targeted wiki item id
-
getTitle
- Returns:
- the proposed title
-
getStatus
- Returns:
- the suggestion status
-
getAuthor
- Returns:
- the proposer display name
-
getDateCreation
- Returns:
- the creation timestamp
-
getTargetCode
- Returns:
- the targeted item code
-
getTargetViewUrl
- Returns:
- the targeted item view URL
-
getScope
- Returns:
- "mine" (the current user is the proposer) or "review" (the current user is a potential reviewer)
-
getAdditions
public int getAdditions()- Returns:
- number of lines added compared to the parent revision
-
getDeletions
public int getDeletions()- Returns:
- number of lines deleted compared to the parent revision
-
getHasConflict
public boolean getHasConflict()- Returns:
- true when the suggestion is PENDING and conflicts with the current revision
-