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.Category
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Field Summary
Fields Modifier and Type Field Description static String
ICON_PATH
-
Fields inherited from class hudson.model.ManagementLink
LIST
-
Fields inherited from interface org.jenkinsci.plugins.configfiles.ConfigFilesUIContract
ID_PATTERN, JELLY_RESOURCES_PATH
-
-
Constructor Summary
Constructors Constructor Description ConfigFilesManagement()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
doAddConfig(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp, String providerId, String configId)
Requests a new config object from provider (defined by the given id) and forwards the request to "edit.jelly".FormValidation
doCheckConfigId(String configId)
void
doEditConfig(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp, String configId)
Loads the config by its id and forwards the request to "edit.jelly".org.kohsuke.stapler.HttpResponse
doRemoveConfig(org.kohsuke.stapler.StaplerRequest res, org.kohsuke.stapler.StaplerResponse rsp, String configId)
Removes a script from the config and filesystem.org.kohsuke.stapler.HttpResponse
doSaveConfig(org.kohsuke.stapler.StaplerRequest req)
Insert or updatevoid
doSelectProvider(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
void
doShow(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp, String configId)
String
getCategoryName()
Collection<Config>
getConfigs()
ContentType
getContentTypeForProvider(String providerId)
String
getDescription()
String
getDisplayName()
Map<ConfigProvider,Collection<Config>>
getGroupedConfigs()
String
getIconFileName()
String
getIconUrl(String rootUrl)
used by configfiles.jelly to resolve the correct path to the icon (see JENKINS-24441)List<ConfigProvider>
getProviders()
Permission
getRequiredPermission()
Object
getTarget()
The global configuration actions are exclusive to Overall/Manage permission.String
getUrlName()
-
Methods inherited from class hudson.model.ManagementLink
all, getBadge, getCategory, getRequiresConfirmation, getRequiresPOST
-
-
-
-
Field Detail
-
ICON_PATH
public static final String ICON_PATH
- See Also:
- Constant Field Values
-
-
Method Detail
-
getTarget
public Object getTarget()
The global configuration actions are exclusive to Overall/Manage permission.- Specified by:
getTarget
in interfaceorg.kohsuke.stapler.StaplerProxy
- Returns:
- The target.
-
getRequiredPermission
@NonNull public Permission getRequiredPermission()
- Overrides:
getRequiredPermission
in classManagementLink
-
getDisplayName
public String getDisplayName()
- Specified by:
getDisplayName
in interfaceAction
- Specified by:
getDisplayName
in interfaceModelObject
- See Also:
Action.getDisplayName()
-
getDescription
public String getDescription()
- Overrides:
getDescription
in classManagementLink
-
getIconFileName
public String getIconFileName()
- Specified by:
getIconFileName
in interfaceAction
- Specified by:
getIconFileName
in classManagementLink
- See Also:
ManagementLink.getIconFileName()
-
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
public String getUrlName()
- Specified by:
getUrlName
in interfaceAction
- Specified by:
getUrlName
in classManagementLink
- See Also:
ManagementLink.getUrlName()
-
getCategoryName
public String getCategoryName()
- Overrides:
getCategoryName
in classManagementLink
-
getContentTypeForProvider
public ContentType getContentTypeForProvider(String providerId)
- Specified by:
getContentTypeForProvider
in interfaceConfigFilesUIContract
-
getGroupedConfigs
public Map<ConfigProvider,Collection<Config>> getGroupedConfigs()
- Specified by:
getGroupedConfigs
in interfaceConfigFilesUIContract
-
getProviders
public List<ConfigProvider> getProviders()
- Specified by:
getProviders
in interfaceConfigFilesUIContract
-
getConfigs
public Collection<Config> getConfigs()
-
doSaveConfig
@POST public org.kohsuke.stapler.HttpResponse doSaveConfig(org.kohsuke.stapler.StaplerRequest req)
Insert or update- Specified by:
doSaveConfig
in interfaceConfigFilesUIContract
- Parameters:
req
- request- Returns:
-
doShow
public void doShow(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp, @QueryParameter("id") String configId) throws IOException, javax.servlet.ServletException
- Specified by:
doShow
in interfaceConfigFilesUIContract
- Throws:
IOException
javax.servlet.ServletException
-
doEditConfig
public void doEditConfig(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp, @QueryParameter("id") String configId) throws IOException, javax.servlet.ServletException
Loads the config by its id and forwards the request to "edit.jelly".- Specified by:
doEditConfig
in interfaceConfigFilesUIContract
- Parameters:
req
- requestrsp
- responseconfigId
- the id of the config to be loaded in to the edit view.- Throws:
IOException
javax.servlet.ServletException
-
doAddConfig
@POST public void doAddConfig(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp, @QueryParameter("providerId") String providerId, @QueryParameter("configId") String configId) throws IOException, javax.servlet.ServletException
Requests a new config object from provider (defined by the given id) and forwards the request to "edit.jelly".- Specified by:
doAddConfig
in 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:
IOException
javax.servlet.ServletException
-
doSelectProvider
public void doSelectProvider(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws IOException, javax.servlet.ServletException
- Specified by:
doSelectProvider
in interfaceConfigFilesUIContract
- Throws:
IOException
javax.servlet.ServletException
-
doRemoveConfig
public org.kohsuke.stapler.HttpResponse doRemoveConfig(org.kohsuke.stapler.StaplerRequest res, org.kohsuke.stapler.StaplerResponse rsp, @QueryParameter("id") String configId) throws IOException
Removes a script from the config and filesystem.- Specified by:
doRemoveConfig
in interfaceConfigFilesUIContract
- Parameters:
res
- responsersp
- requestconfigId
- the id of the config to be removed- Returns:
- forward to 'index'
- Throws:
IOException
-
doCheckConfigId
public FormValidation doCheckConfigId(@QueryParameter("configId") String configId)
- Specified by:
doCheckConfigId
in interfaceConfigFilesUIContract
-
-