Class ReviewDocument
java.lang.Object
io.jenkins.plugins.interactiveinput.view.ReviewDocument
- All Implemented Interfaces:
Serializable
A durable, reviewable snapshot of a file published by the
interactiveView pipeline step.
At step time the named file's content is copied ("snapshotted") into the plugin store so the
review still works after the workspace/build is cleaned. Reviewers can add ReviewComments,
edit the durable review copy (each edit is a new ContentVersion; the original
workspace file is never touched), and record a ReviewStatus decision. For a blocking
(wait:true) view the decision resumes the paused pipeline.
Only metadata (this object, including comments and version metadata) is persisted via XStream to
views.xml; the version bytes live in per-document files. State transitions are guarded by
ViewStore, which synchronises on the individual document instance.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final StringContent format; drives how the review page renders and highlights the snapshot.static final Stringstatic final StringInformational mode: a read-only viewer (still commentable) with no decision.static final StringReview mode: a decision (approve/reject/acknowledge/request-changes) is required. -
Constructor Summary
ConstructorsConstructorDescriptionReviewDocument(String id, String jobFullName, int buildNumber, String reportName, String title, String fileName, String format, String language, String createdBy, long createdTs, boolean commentable, boolean editable, boolean notify, boolean blocking, String submitterFilter, long slaMs, String groupId, String mode) -
Method Summary
Modifier and TypeMethodDescriptionintintlongintlonglonggetId()getMode()longgetSlaMs()getTitle()booleanbooleanbooleanbooleanbooleanbooleanisExpired(long now) booleanbooleanisNotify()longremainingMs(long now) net.sf.json.JSONObjecttoJson(boolean includeComments, long now) Serialise the document metadata to JSON for the REST API and the review page.
-
Field Details
-
FORMAT_MARKDOWN
Content format; drives how the review page renders and highlights the snapshot.- See Also:
-
FORMAT_HTML
- See Also:
-
FORMAT_TEXT
- See Also:
-
FORMAT_CODE
- See Also:
-
MODE_REVIEW
Review mode: a decision (approve/reject/acknowledge/request-changes) is required.- See Also:
-
MODE_INFO
Informational mode: a read-only viewer (still commentable) with no decision.- See Also:
-
-
Constructor Details
-
ReviewDocument
public ReviewDocument(@NonNull String id, @NonNull String jobFullName, int buildNumber, @NonNull String reportName, @NonNull String title, @NonNull String fileName, @NonNull String format, @NonNull String language, @NonNull String createdBy, long createdTs, boolean commentable, boolean editable, boolean notify, boolean blocking, @CheckForNull String submitterFilter, long slaMs, @CheckForNull String groupId, @CheckForNull String mode)
-
-
Method Details
-
getId
-
getJobFullName
-
getBuildNumber
public int getBuildNumber() -
getReportName
-
getTitle
-
getFileName
-
getFormat
-
getLanguage
-
getCreatedBy
-
getCreatedTs
public long getCreatedTs() -
isCommentable
public boolean isCommentable() -
isEditable
public boolean isEditable() -
isNotify
public boolean isNotify() -
isBlocking
public boolean isBlocking() -
getSubmitterFilter
-
getGroupId
- Returns:
- the grouping key for files published together, or this document's own id when it was published on its own — so callers can always group by a stable, non-null key. Legacy documents (no stored group) return their id and therefore form singleton groups.
-
isGrouped
public boolean isGrouped()- Returns:
trueif this review was published as one of a multi-file group (glob/dir).
-
getMode
- Returns:
MODE_INFOfor a read-only informational viewer, otherwiseMODE_REVIEW(a decision is required). Legacy documents with no stored mode are treated as review.
-
isDecisionRequired
public boolean isDecisionRequired()- Returns:
trueif this review needs an approve/reject/acknowledge decision (review mode).
-
getSlaMs
public long getSlaMs() -
getExpiresAt
public long getExpiresAt() -
getStatus
-
getDecidedBy
-
getDecidedTs
public long getDecidedTs() -
getCurrentVersion
public int getCurrentVersion() -
isBuildDeleted
public boolean isBuildDeleted()- Returns:
trueif the owning build has been deleted. The review is retained (its history is durable) but is excluded from the notification centre and the sidebar/badge counts, and the per-job interactive-view page renders it as "build deleted" without a live build link.
-
getComments
- Returns:
- an unmodifiable view of the comments (never
null).
-
getCommentCount
public int getCommentCount()- Returns:
- the number of comments (convenience for Jelly views).
-
getCreatedDate
- Returns:
- the creation time as a
Date(convenience for Jelly date formatting).
-
getVersions
- Returns:
- an unmodifiable view of the content-version metadata (never
null).
-
isExpired
public boolean isExpired(long now) - Returns:
trueif a blocking SLA is configured and it has elapsed relative tonow.
-
remainingMs
public long remainingMs(long now) - Returns:
- remaining SLA milliseconds (
-1when no SLA,0when already due).
-
toJson
@NonNull public net.sf.json.JSONObject toJson(boolean includeComments, long now) Serialise the document metadata to JSON for the REST API and the review page.- Parameters:
includeComments- whether to include the comment list (raw markdown bodies; the caller adds sanitisedbodyHtml)now- reference time forremainingMs
-