Skip to content

Commit

Permalink
[JENKINS-34200] New API to set a custom successful destination
Browse files Browse the repository at this point in the history
  • Loading branch information
recena committed Apr 19, 2016
1 parent f9a65b3 commit de3411c
Showing 1 changed file with 13 additions and 5 deletions.
@@ -1,7 +1,7 @@
/*
* The MIT License
*
* Copyright 2015 CloudBees, Inc.
* Copyright 2015-2016 CloudBees, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -40,9 +40,6 @@
import hudson.model.Descriptor;
import hudson.model.HealthReport;
import hudson.model.Item;
import static hudson.model.Item.CONFIGURE;
import static hudson.model.Item.CREATE;
import static hudson.model.Item.DELETE;
import hudson.model.ItemGroup;
import static hudson.model.ItemGroupMixIn.loadChildren;
import hudson.model.Items;
Expand Down Expand Up @@ -705,10 +702,21 @@ public void doConfigSubmit(StaplerRequest req, StaplerResponse rsp) throws IOExc
if (namingStrategy.isForceExistingJobs()) {
namingStrategy.checkName(name);
}
FormApply.success(".").generateResponse(req, rsp, this);
FormApply.success(getSuccessfulDestination()).generateResponse(req, rsp, this);
}
}

/**
* Where user will be redirected after creating a {@code AbstractFolder}.
*
* @return A string that represents the redirect location URL.
*
* @see javax.servlet.http.HttpServletResponse#sendRedirect(String)
*/
protected String getSuccessfulDestination() {
return ".";
}

protected void submit(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException, Descriptor.FormException {}

// TODO boilerplate like this should not be necessary: JENKINS-22936
Expand Down

0 comments on commit de3411c

Please sign in to comment.