Class WikiSuggestionRest.SuggestionDto

java.lang.Object
fr.paris.lutece.plugins.wiki.rs.WikiSuggestionRest.SuggestionDto
Enclosing class:
WikiSuggestionRest

public static class WikiSuggestionRest.SuggestionDto extends Object
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 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 id
      nEntityId - the targeted wiki item id
      strTitle - the proposed title
      status - the suggestion status
      strAuthor - the proposer display name
      dateCreation - the creation timestamp
      strTargetCode - 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 revision
      nDeletions - number of lines deleted compared to the parent revision
      bHasConflict - 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 suggestion
      target - the targeted wiki item, may be null
      scope - "mine" or "review"
      stats - three-element array [additions, deletions, hasConflict] as returned by SuggestedRevisionService.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

      public String getTitle()
      Returns:
      the proposed title
    • getStatus

      public SuggestionStatus getStatus()
      Returns:
      the suggestion status
    • getAuthor

      public String getAuthor()
      Returns:
      the proposer display name
    • getDateCreation

      public Timestamp getDateCreation()
      Returns:
      the creation timestamp
    • getTargetCode

      public String getTargetCode()
      Returns:
      the targeted item code
    • getTargetViewUrl

      public String getTargetViewUrl()
      Returns:
      the targeted item view URL
    • getScope

      public String 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