Class ConfigFilesManagement
java.lang.Object
hudson.model.ManagementLink
org.jenkinsci.plugins.configfiles.ConfigFilesManagement
- All Implemented Interfaces:
ExtensionPoint,Action,ModelObject,ConfigFilesUIContract,org.kohsuke.stapler.StaplerProxy
@Extension
public class ConfigFilesManagement
extends ManagementLink
implements ConfigFilesUIContract, org.kohsuke.stapler.StaplerProxy
Provides a new link in the "Manage Jenkins" view and builds the UI to manage the configfiles.
- Author:
- domi
-
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
FieldsFields inherited from class hudson.model.ManagementLink
LISTFields inherited from interface org.jenkinsci.plugins.configfiles.ConfigFilesUIContract
ID_PATTERN, JELLY_RESOURCES_PATH -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddoAddConfig(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp, String providerId, String configId) Requests a new config object from provider (defined by the given id) and forwards the request to "edit.jelly".doCheckConfigId(String configId) voiddoEditConfig(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp, String configId) Loads the config by its id and forwards the request to "edit.jelly".org.kohsuke.stapler.HttpResponsedoRemoveConfig(org.kohsuke.stapler.StaplerRequest2 res, org.kohsuke.stapler.StaplerResponse2 rsp, String configId) Removes a script from the config and filesystem.org.kohsuke.stapler.HttpResponsedoSaveConfig(org.kohsuke.stapler.StaplerRequest2 req) Insert or updatevoiddoSelectProvider(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp) voiddoShow(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp, String configId) getContentTypeForProvider(String providerId) getIconUrl(String rootUrl) used by configfiles.jelly to resolve the correct path to the icon (see JENKINS-24441)The global configuration actions are exclusive to Overall/Manage permission.Methods inherited from class hudson.model.ManagementLink
all, getBadge, getCategory, getRequiresConfirmation, getRequiresPOST
-
Field Details
-
ICON_PATH
- See Also:
-
-
Constructor Details
-
ConfigFilesManagement
public ConfigFilesManagement()
-
-
Method Details
-
getTarget
The global configuration actions are exclusive to Overall/Manage permission.- Specified by:
getTargetin interfaceorg.kohsuke.stapler.StaplerProxy- Returns:
- The target.
-
getRequiredPermission
- Overrides:
getRequiredPermissionin classManagementLink
-
getDisplayName
- Specified by:
getDisplayNamein interfaceAction- Specified by:
getDisplayNamein interfaceModelObject- See Also:
-
getDescription
- Overrides:
getDescriptionin classManagementLink
-
getIconFileName
- Specified by:
getIconFileNamein interfaceAction- Specified by:
getIconFileNamein classManagementLink- See Also:
-
getIconUrl
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public String getIconUrl(String rootUrl) used by configfiles.jelly to resolve the correct path to the icon (see JENKINS-24441) -
getUrlName
- Specified by:
getUrlNamein interfaceAction- Specified by:
getUrlNamein classManagementLink- See Also:
-
getCategoryName
- Overrides:
getCategoryNamein classManagementLink
-
getContentTypeForProvider
- Specified by:
getContentTypeForProviderin interfaceConfigFilesUIContract
-
getGroupedConfigs
- Specified by:
getGroupedConfigsin interfaceConfigFilesUIContract
-
getProviders
- Specified by:
getProvidersin interfaceConfigFilesUIContract
-
getConfigs
-
doSaveConfig
@POST public org.kohsuke.stapler.HttpResponse doSaveConfig(org.kohsuke.stapler.StaplerRequest2 req) Insert or update- Specified by:
doSaveConfigin interfaceConfigFilesUIContract- Parameters:
req- request- Returns:
-
doShow
public void doShow(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp, @QueryParameter("id") String configId) throws IOException, jakarta.servlet.ServletException - Specified by:
doShowin interfaceConfigFilesUIContract- Throws:
IOExceptionjakarta.servlet.ServletException
-
doEditConfig
public void doEditConfig(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp, @QueryParameter("id") String configId) throws IOException, jakarta.servlet.ServletException Loads the config by its id and forwards the request to "edit.jelly".- Specified by:
doEditConfigin interfaceConfigFilesUIContract- Parameters:
req- requestrsp- responseconfigId- the id of the config to be loaded in to the edit view.- Throws:
IOExceptionjakarta.servlet.ServletException
-
doAddConfig
@POST public void doAddConfig(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp, @QueryParameter("providerId") String providerId, @QueryParameter("configId") String configId) throws IOException, jakarta.servlet.ServletException Requests a new config object from provider (defined by the given id) and forwards the request to "edit.jelly".- Specified by:
doAddConfigin interfaceConfigFilesUIContract- Parameters:
req- requestrsp- responseproviderId- the id of the provider to create a new config instance withconfigId- the id of the new config instance- Throws:
IOExceptionjakarta.servlet.ServletException
-
doSelectProvider
public void doSelectProvider(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp) throws IOException, jakarta.servlet.ServletException - Specified by:
doSelectProviderin interfaceConfigFilesUIContract- Throws:
IOExceptionjakarta.servlet.ServletException
-
doRemoveConfig
public org.kohsuke.stapler.HttpResponse doRemoveConfig(org.kohsuke.stapler.StaplerRequest2 res, org.kohsuke.stapler.StaplerResponse2 rsp, @QueryParameter("id") String configId) throws IOException Removes a script from the config and filesystem.- Specified by:
doRemoveConfigin interfaceConfigFilesUIContract- Parameters:
res- responsersp- requestconfigId- the id of the config to be removed- Returns:
- forward to 'index'
- Throws:
IOException
-
doCheckConfigId
- Specified by:
doCheckConfigIdin interfaceConfigFilesUIContract
-