@ExportedBean(defaultVisibility=-1) @Extension public class JobConfigHistoryRootAction extends JobConfigHistoryBaseAction implements hudson.model.RootAction
| Constructor and Description |
|---|
JobConfigHistoryRootAction()
Constructor necessary for testing.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
checkConfigurePermission()
See whether the current user may read configurations in the object
returned by
JobConfigHistoryBaseAction.getAccessControlledObject(). |
String |
createLinkToFiles(ConfigInfo config,
String type)
Creates links to the correct configOutput.jellys for job history vs.
|
void |
doDiffFiles(org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse rsp)
Parses the incoming POST request and redirects as
GET showDiffFiles.
|
void |
doForwardToRestoreQuestion(org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse rsp)
Action when 'restore' button in history.jelly is pressed.
|
void |
doRestore(org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse rsp)
Action when 'restore' button is pressed: Restore deleted project.
|
protected hudson.security.AccessControlled |
getAccessControlledObject()
Returns the object for which we want to provide access control.
|
hudson.model.Api |
getApi() |
List<ConfigInfo> |
getConfigs()
Returns the configuration history entries for either
AbstractItem
s or system changes or deleted jobs or all of the above. |
String |
getFile()
Returns
JobConfigHistoryBaseAction#getConfigXml(String) as
String. |
String |
getIconFileName()
Make method final, as we always want the same icon file.
|
hudson.XmlFile |
getLastAvailableConfigXml(String name)
Retrieves the last or second to last config.xml.
|
List<SideBySideView.Line> |
getLines()
Returns the diff between two config files as a list of single lines.
|
protected hudson.XmlFile |
getOldConfigXml(String name,
String timestamp)
Gets the version of the config.xml that was saved at a certain time.
|
List<ConfigInfo> |
getSingleConfigs(String name)
Returns the configuration history entries for one group of system files
or deleted jobs.
|
String |
getUrlName()
This actions always starts from the context directly, so prefix
JobConfigHistoryConsts.URLNAME with a slash. |
boolean |
hasConfigurePermission()
Returns whether the current user may read configurations in the object
returned by
JobConfigHistoryBaseAction.getAccessControlledObject(). |
boolean |
hasJobConfigurePermission()
Returns whether the current user may configure jobs.
|
checkTimestamp, doDiffFilesPrevNext, getDiffAsString, getDiffLines, getDisplayName, getHudson, getOutputType, getRequestParameterpublic JobConfigHistoryRootAction()
public final String getUrlName()
JobConfigHistoryConsts.URLNAME with a slash.getUrlName in interface hudson.model.ActiongetUrlName in class JobConfigHistoryBaseActionpublic final String getIconFileName()
getIconFileName in interface hudson.model.Action@Exported(visibility=1) public final List<ConfigInfo> getConfigs() throws IOException
AbstractItem
s or system changes or deleted jobs or all of the above.IOException - if one of the history entries might not be read.public final List<ConfigInfo> getSingleConfigs(String name) throws IOException
name - of the item.IOException - if one of the history entries might not be read.public final String getFile() throws IOException
JobConfigHistoryBaseAction#getConfigXml(String) as
String.IOException - if the config file could not be read or converted to an xml
string.public final String createLinkToFiles(ConfigInfo config, String type)
config - ConfigInfo.type - Output type ('xml' or 'plain').protected hudson.security.AccessControlled getAccessControlledObject()
JobConfigHistoryBaseActiongetAccessControlledObject in class JobConfigHistoryBaseActionprotected void checkConfigurePermission()
JobConfigHistoryBaseActionJobConfigHistoryBaseAction.getAccessControlledObject().checkConfigurePermission in class JobConfigHistoryBaseActionpublic boolean hasConfigurePermission()
JobConfigHistoryBaseActionJobConfigHistoryBaseAction.getAccessControlledObject().hasConfigurePermission in class JobConfigHistoryBaseActionpublic boolean hasJobConfigurePermission()
public final void doDiffFiles(org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse rsp)
throws javax.servlet.ServletException,
IOException
doDiffFiles in class JobConfigHistoryBaseActionreq - incoming requestrsp - outgoing responsejavax.servlet.ServletException - when parsing the request as MultipartFormDataParser
does not succeed.IOException - when the redirection does not succeed.public final List<SideBySideView.Line> getLines() throws IOException
IOException - If diff doesn't work or xml files can't be read.protected hudson.XmlFile getOldConfigXml(String name, String timestamp)
name - The name of the system property or deleted job.timestamp - The timestamp as String.public final void doRestore(org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse rsp)
throws IOException
req - Incoming StaplerRequestrsp - Outgoing StaplerResponseIOException - If something goes wrongpublic hudson.XmlFile getLastAvailableConfigXml(String name)
name - The name of the deleted project.public final void doForwardToRestoreQuestion(org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse rsp)
throws IOException
req - StaplerRequest created by pressing the buttonrsp - Outgoing StaplerResponseIOException - If redirect goes wrongpublic hudson.model.Api getApi()
Copyright © 2004–2015. All rights reserved.