Class ActivationItem
java.lang.Object
io.jenkins.plugins.batchcontrol.action.ActivationItem
- All Implemented Interfaces:
ModelObject
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class)
public class ActivationItem
extends Object
implements ModelObject
One activation or hold request at
/batch-control/activations/<id>/ (SPEC item 6a),
the URL the notifications link to: detail view plus the state-changing POST endpoints
approve, reject, cancel and changeApprover, following
RequestItem.
Every endpoint is @RequirePOST with its permission check on the next line; the
business rules (designated approver only, self-approval, requester-or-Manage cancel,
requester-only approver change, atomic transitions) are enforced by ActivationService.
-
Method Summary
Modifier and TypeMethodDescriptionvoiddoApprove(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp, String comment) POSTapprovewith an optionalcomment.voiddoCancel(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp) POSTcancel; Request on the request's item (D-38b) or Manage, and the service enforces requester-or-Manage.voiddoChangeApprover(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp) POSTchangeApproverwith the repeatedapproversfield (D-26, D-37).voiddoReject(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp, String comment) POSTrejectwith acomment(the service refuses an empty one).Jelly helper: human-readable timestamp.formErrors(String form) The refusal of formformon this request, or an empty one (DEF-09, Jelly).S-13-08: ACTIVATE and HOLD worded so they cannot be mistaken for each other.Approver candidates for the change-approver form (global list ∩ job restriction).getId()Root-relative URL of the job or computed folder (D-46c) when the viewer may read it, elsenull(plain text).Permissions for this screen'sl:layout(the same set its section gate checks).booleanView gating for the cancel link; the service enforces requester-or-Manage.booleanView gating for the change-approver form; the service enforces requester-only.booleanView gating for the decision forms: a designated approver holding Approve (D-29, D-37).booleanisDesignated(String approver) Whether the change-approver picker starts with this candidate checked.booleanisHold()Whether the request asks to put the job on hold (the view words the decision accordingly).booleanJelly helper: an approver set for display (a1, a2).
-
Method Details
-
getRequest
-
getId
-
getDisplayName
- Specified by:
getDisplayNamein interfaceModelObject
-
getActionLabel
S-13-08: ACTIVATE and HOLD worded so they cannot be mistaken for each other. -
getViewPermissions
Permissions for this screen'sl:layout(the same set its section gate checks). -
format
Jelly helper: human-readable timestamp. -
join
Jelly helper: an approver set for display (a1, a2). -
getJobUrl
Root-relative URL of the job or computed folder (D-46c) when the viewer may read it, elsenull(plain text). -
isPending
public boolean isPending() -
isHold
public boolean isHold()Whether the request asks to put the job on hold (the view words the decision accordingly). -
isCanDecide
public boolean isCanDecide()View gating for the decision forms: a designated approver holding Approve (D-29, D-37). -
isCanCancel
public boolean isCanCancel()View gating for the cancel link; the service enforces requester-or-Manage. -
isCanChangeApprover
public boolean isCanChangeApprover()View gating for the change-approver form; the service enforces requester-only. -
getApproverOptions
Approver candidates for the change-approver form (global list ∩ job restriction). -
isDesignated
Whether the change-approver picker starts with this candidate checked. -
doApprove
public void doApprove(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp, @QueryParameter String comment) throws IOException, jakarta.servlet.ServletException POSTapprovewith an optionalcomment.- Throws:
IOExceptionjakarta.servlet.ServletException
-
doReject
public void doReject(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp, @QueryParameter String comment) throws IOException, jakarta.servlet.ServletException POSTrejectwith acomment(the service refuses an empty one).- Throws:
IOExceptionjakarta.servlet.ServletException
-
doCancel
public void doCancel(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp) throws IOException, jakarta.servlet.ServletException POSTcancel; Request on the request's item (D-38b) or Manage, and the service enforces requester-or-Manage.- Throws:
IOExceptionjakarta.servlet.ServletException
-
doChangeApprover
public void doChangeApprover(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp) throws IOException, jakarta.servlet.ServletException POSTchangeApproverwith the repeatedapproversfield (D-26, D-37).- Throws:
IOExceptionjakarta.servlet.ServletException
-
formErrors
The refusal of formformon this request, or an empty one (DEF-09, Jelly).
-