Class BatchControlConfigurationLink
java.lang.Object
hudson.model.ManagementLink
io.jenkins.plugins.batchcontrol.config.BatchControlConfigurationLink
- All Implemented Interfaces:
ExtensionPoint,Action,ModelObject
@Extension
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class)
public class BatchControlConfigurationLink
extends ManagementLink
e2e-03 DEF-10 (SPEC section 6, usability):
BatchControl/Manage is enough to open and
save the Batch Control configuration. Core's system configuration page needs
Overall/Manage, which a BatchControl/Manage holder may not have, so the same
configuration is also served at /batch-control-configuration/ (Jenkins resolves a
management link at the root URL too). It is listed on "Manage Jenkins" for users who can open
that page, and linked from the Batch Control page for everyone else holding the permission.
The form is the configuration's own config.jelly; saving goes through
BatchControlGlobalConfiguration.configure(org.kohsuke.stapler.StaplerRequest2, net.sf.json.JSONObject), so validation (DEF-08), the transactional
write and the toggle records are exactly those of the system configuration page.
-
Nested Class Summary
Nested classes/interfaces inherited from class hudson.model.ManagementLink
ManagementLink.CategoryNested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringURL of the page, relative to the Jenkins root (and to/manage/).Fields inherited from class hudson.model.ManagementLink
LIST -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddoConfigSubmit(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp) POSTconfigSubmit: saves the form.The configuration the page edits (Jelly binds its fields to it).The entry is listed only once its page (index.jelly) is shipped, so the link can never lead to a 404 (SPEC section 6).The refusal message of the submission being answered, ornull(for the view).booleanWhether the current user may open and save this page.booleanWhether the page's view exists (Jelly: the Batch Control page links here only then).Methods inherited from class hudson.model.ManagementLink
all, getBadge, getCategoryName, getRequiresConfirmation, getRequiresPOSTMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface hudson.model.Action
getEvent, getGroup, getSemantic, isVisibleInContextMenu
-
Field Details
-
URL_NAME
URL of the page, relative to the Jenkins root (and to/manage/).- See Also:
-
-
Constructor Details
-
BatchControlConfigurationLink
public BatchControlConfigurationLink()
-
-
Method Details
-
getIconFileName
The entry is listed only once its page (index.jelly) is shipped, so the link can never lead to a 404 (SPEC section 6).- Specified by:
getIconFileNamein interfaceAction- Specified by:
getIconFileNamein classManagementLink
-
isPageAvailable
public boolean isPageAvailable()Whether the page's view exists (Jelly: the Batch Control page links here only then). -
getDisplayName
-
getDescription
- Specified by:
getDescriptionin interfaceAction- Overrides:
getDescriptionin classManagementLink
-
getUrlName
- Specified by:
getUrlNamein interfaceAction- Specified by:
getUrlNamein classManagementLink
-
getRequiredPermission
- Overrides:
getRequiredPermissionin classManagementLink
-
getCategory
- Overrides:
getCategoryin classManagementLink
-
isCanManage
public boolean isCanManage()Whether the current user may open and save this page. -
getConfiguration
The configuration the page edits (Jelly binds its fields to it). While a refused submission is being answered, the submitted values instead (a detached draft that is never saved), so the page keeps what the user typed and the field checks show the message next to the field. -
getSaveError
The refusal message of the submission being answered, ornull(for the view). -
doConfigSubmit
public void doConfigSubmit(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp) throws IOException, jakarta.servlet.ServletException, Descriptor.FormException POSTconfigSubmit: saves the form. An invalid value is refused byBatchControlGlobalConfiguration.configure(org.kohsuke.stapler.StaplerRequest2, net.sf.json.JSONObject)with aDescriptor.FormExceptionnaming the field, and nothing is saved.- Throws:
IOExceptionjakarta.servlet.ServletExceptionDescriptor.FormException
-