Skip to content
Permalink
Browse files
Merge pull request #30 from cfs-pure/master
[FIXED JENKINS-22796] Added REST API support for root and job actions.
  • Loading branch information
Stefan Brausch committed Apr 29, 2014
2 parents 7eff75b + a18dfd1 commit b8ec84565b70181cf848abdceac34b4d1274657c
@@ -3,6 +3,7 @@
import hudson.XmlFile;
import hudson.maven.MavenModule;
import hudson.model.AbstractItem;
import hudson.model.Api;
import hudson.model.Hudson;
import hudson.model.Item;
import hudson.plugins.jobConfigHistory.SideBySideView.Line;
@@ -24,10 +25,13 @@

import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.StaplerResponse;
import org.kohsuke.stapler.export.ExportedBean;
import org.kohsuke.stapler.export.Exported;

/**
* @author Stefan Brausch
*/
@ExportedBean
public class JobConfigHistoryProjectAction extends JobConfigHistoryBaseAction {

/** The project. */
@@ -78,6 +82,7 @@ public final String getIconFileName() {
* @throws IOException
* if {@link JobConfigHistoryConsts#HISTORY_FILE} might not be read or the path might not be urlencoded.
*/
@Exported
public final List<ConfigInfo> getJobConfigs() throws IOException {
checkConfigurePermission();
final ArrayList<ConfigInfo> configs = new ArrayList<ConfigInfo>();
@@ -330,4 +335,7 @@ HistoryDao getHistoryDao() {
return PluginUtils.getHistoryDao();
}

public Api getApi() {
return new Api(this);
}
}
@@ -2,6 +2,7 @@

import hudson.Extension;
import hudson.XmlFile;
import hudson.model.Api;
import hudson.model.Item;
import hudson.model.RootAction;
import hudson.model.TopLevelItem;
@@ -24,12 +25,15 @@
import javax.servlet.ServletException;
import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.StaplerResponse;
import org.kohsuke.stapler.export.ExportedBean;
import org.kohsuke.stapler.export.Exported;

/**
*
* @author Stefan Brausch, mfriedenhagen
*/

@ExportedBean
@Extension
public class JobConfigHistoryRootAction extends JobConfigHistoryBaseAction
implements RootAction {
@@ -79,6 +83,7 @@ public final String getIconFileName() {
* @throws IOException
* if one of the history entries might not be read.
*/
@Exported
public final List<ConfigInfo> getConfigs() throws IOException {
final String filter = getRequestParameter("filter");
List<ConfigInfo> configs = null;
@@ -447,4 +452,8 @@ HistoryDao getHistoryDao() {
OverviewHistoryDao getOverviewHistoryDao() {
return PluginUtils.getHistoryDao();
}

public Api getApi() {
return new Api(this);
}
}

0 comments on commit b8ec845

Please sign in to comment.