diff --git a/.gitignore b/.gitignore index 57e314d4aaf234221e00b55a62dc1d5748ab015d..acf9c8f4fcd61478495ebb890ef3e16879280cc7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,10 @@ **/*.iml -idea +.idea +.DS_Store + +# maven stuff target + +# jenkins stuff +work diff --git a/src/main/java/hudson/plugins/localization/I18nDispatcher.java b/src/main/java/hudson/plugins/localization/I18nDispatcher.java index b67322c9a3b2d63f077e2d43f1836d8e75693a9c..24ef503e661c64e5b24615223d5a17aa7e3fca3c 100644 --- a/src/main/java/hudson/plugins/localization/I18nDispatcher.java +++ b/src/main/java/hudson/plugins/localization/I18nDispatcher.java @@ -12,6 +12,7 @@ public class I18nDispatcher extends Dispatcher { @Override public boolean dispatch(RequestImpl req, ResponseImpl rsp, Object node) throws IOException, ServletException, IllegalAccessException, InvocationTargetException { if(req.getOriginalRequestURI().endsWith("help")) { +// new I18nRequestDispatcher().forward(req.getRequest(), rsp.getResponse()); return true; } diff --git a/src/main/java/hudson/plugins/localization/I18nRequestDispatcher.java b/src/main/java/hudson/plugins/localization/I18nRequestDispatcher.java index d33d60d3db26f890c5f6061e6747257367946569..b696c2aa1a6430b079c3a31c2209cd01dd189e1a 100644 --- a/src/main/java/hudson/plugins/localization/I18nRequestDispatcher.java +++ b/src/main/java/hudson/plugins/localization/I18nRequestDispatcher.java @@ -1,5 +1,8 @@ package hudson.plugins.localization; +import org.kohsuke.stapler.RequestImpl; +import org.kohsuke.stapler.lang.Klass; + import javax.servlet.RequestDispatcher; import javax.servlet.ServletException; import javax.servlet.ServletRequest; @@ -7,9 +10,26 @@ import javax.servlet.ServletResponse; import java.io.IOException; public class I18nRequestDispatcher implements RequestDispatcher { + private RequestImpl request; + private Klass type; + private Object it; + private String viewName; + public I18nRequestDispatcher(RequestImpl request, Klass type, Object it, String viewName) { + this.request = request; + this.type = type; + this.it = it; + this.viewName = viewName; + } + @Override - public void forward(ServletRequest servletRequest, ServletResponse servletResponse) throws ServletException, IOException { + public void forward(ServletRequest req, ServletResponse servletResponse) throws ServletException, IOException { System.out.println("forward"); + String path = this.request.getOriginalRestOfPath(); + String uri = this.request.getOriginalRequestURI(); + +// this.getClass().getResource("/hudson/model/FreeStyleProject/help_zh_CN.html").openStream() == null + servletResponse.getWriter().println("sff"); +// /jenkins/descriptor/hudson.model.FreeStyleProject/help/concurrentBuild } @Override diff --git a/src/main/java/hudson/plugins/localization/LocalizationFacet.java b/src/main/java/hudson/plugins/localization/LocalizationFacet.java index 697b5312b5b9ca0dd977e679090855f24c4fe4aa..afe410368e4828a3436780e87035c1c224ff0e17 100644 --- a/src/main/java/hudson/plugins/localization/LocalizationFacet.java +++ b/src/main/java/hudson/plugins/localization/LocalizationFacet.java @@ -17,7 +17,12 @@ public class LocalizationFacet extends Facet { @Override public RequestDispatcher createRequestDispatcher(RequestImpl request, Klass type, Object it, String viewName) throws IOException { - return super.createRequestDispatcher(request, type, it, viewName); + RequestDispatcher dispatcher = super.createRequestDispatcher(request, type, it, viewName); + if(dispatcher == null) { +// dispatcher = new I18nRequestDispatcher(request, type, it, viewName); + } + + return dispatcher; } @Override diff --git a/src/main/java/hudson/plugins/localization/abcDispatcher.java b/src/main/java/hudson/plugins/localization/abcDispatcher.java new file mode 100644 index 0000000000000000000000000000000000000000..ab2748bbfacbb9a0c26538f8090fa057b94e2047 --- /dev/null +++ b/src/main/java/hudson/plugins/localization/abcDispatcher.java @@ -0,0 +1,10 @@ +//package hudson.plugins.localization; +// +//import org.apache.commons.jelly.Script; +//import org.kohsuke.stapler.jelly.JellyRequestDispatcher; +// +//public class abcDispatcher extends JellyRequestDispatcher { +// public abcDispatcher(Object it, Script script) { +// super(it, script); +// } +//} diff --git a/src/main/resources/hudson/model/AbstractProject/help-concurrentBuild.html b/src/main/resources/hudson/model/AbstractProject/help-concurrentBuild.html new file mode 100644 index 0000000000000000000000000000000000000000..2d100ace90d57308aeca0430c25b7bc9caf021be --- /dev/null +++ b/src/main/resources/hudson/model/AbstractProject/help-concurrentBuild.html @@ -0,0 +1,39 @@ +111 +
+ When this option is checked, multiple builds of this project may be executed + in parallel. +

+ By default, only a single build of a project is executed at a time — any + other requests to start building that project will remain in the build queue + until the first build is complete.
+ This is a safe default, as projects can often require exclusive access to + certain resources, such as a database, or a piece of hardware. +

+ But with this option enabled, if there are enough build executors available + that can handle this project, then multiple builds of this project will take + place in parallel. If there are not enough available executors at any point, + any further build requests will be held in the build queue as normal. +

+ Enabling concurrent builds is useful for projects that execute lengthy test + suites, as it allows each build to contain a smaller number of changes, while + the total turnaround time decreases as subsequent builds do not need to wait + for previous test runs to complete.
+ This feature is also useful for parameterized projects, whose individual build + executions — depending on the parameters used — can be + completely independent from one another. +

+ Each concurrently executed build occurs in its own build workspace, isolated + from any other builds. By default, Jenkins appends "@<num>" to + the workspace directory name, e.g. "@2".
+ The separator "@" can be changed by setting the + hudson.slaves.WorkspaceList Java system property when starting + Jenkins. For example, "hudson.slaves.WorkspaceList=-" would change + the separator to a hyphen.
+ For more information on setting system properties, see the wiki page. +

+ However, if you enable the Use custom workspace option, all builds will + be executed in the same workspace. Therefore caution is required, as multiple + builds may end up altering the same directory at the same time. +

diff --git a/src/main/resources/hudson/model/FreeStyleProject/help_zh_CN.html b/src/main/resources/hudson/model/FreeStyleProject/help_zh_CN.html new file mode 100644 index 0000000000000000000000000000000000000000..42df6e507b03b07384d5e2c81eb18c24153c5a3f --- /dev/null +++ b/src/main/resources/hudson/model/FreeStyleProject/help_zh_CN.html @@ -0,0 +1 @@ +sdfsf \ No newline at end of file