mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-08 01:26:03 +00:00
rolled back rev.28991 until stapler is ready
git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@29004 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
1 parent
a0e9b05f78
commit
6dfd41e825
7 files changed
+3
-97
No files matched your search
+1
-1
@@ -334,7 +334,7 @@ THE SOFTWARE.
|
||||
<dependency>
|
||||
<groupId>org.kohsuke.stapler</groupId>
|
||||
<artifactId>stapler-jelly</artifactId>
|
||||
<version>1.139</version>
|
||||
<version>1.138</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>commons-jelly</groupId>
|
||||
|
||||
@@ -56,14 +56,6 @@ THE SOFTWARE.
|
||||
-->
|
||||
<finalName>${project.artifactId}</finalName>
|
||||
<defaultGoal>package</defaultGoal>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
</resource>
|
||||
<resource><!-- copy all Java source files as resources -->
|
||||
<directory>src/main/java</directory>
|
||||
</resource>
|
||||
</resources>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.jvnet.hudson.tools</groupId>
|
||||
|
||||
@@ -4,9 +4,6 @@ import hudson.Extension;
|
||||
import hudson.util.ListBoxModel;
|
||||
import org.kohsuke.stapler.QueryParameter;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
|
||||
import static java.util.Arrays.asList;
|
||||
|
||||
/**
|
||||
|
||||
@@ -5,14 +5,6 @@ import hudson.ExtensionPoint;
|
||||
import hudson.model.Action;
|
||||
import hudson.model.Describable;
|
||||
import hudson.model.Hudson;
|
||||
import org.kohsuke.stapler.StaplerResponse;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import static org.apache.commons.io.IOUtils.copy;
|
||||
|
||||
/**
|
||||
* @author Kohsuke Kawaguchi
|
||||
@@ -33,23 +25,6 @@ public abstract class UISample implements ExtensionPoint, Action, Describable<UI
|
||||
return getClass().getSimpleName();
|
||||
}
|
||||
|
||||
/**
|
||||
* Source files associated with this sample.
|
||||
*/
|
||||
public List<SourceFile> getSourceFiles() {
|
||||
return Arrays.asList(new SourceFile(getClass().getSimpleName()+".java"));
|
||||
}
|
||||
|
||||
/**
|
||||
* Binds {@link SourceFile}s into URL.
|
||||
*/
|
||||
public SourceFile getSourceFile(String name) {
|
||||
for (SourceFile sf : getSourceFiles())
|
||||
if (sf.name.equals(name))
|
||||
return sf;
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a paragraph of natural text that describes this sample.
|
||||
* Interpreted as HTML.
|
||||
@@ -67,27 +42,4 @@ public abstract class UISample implements ExtensionPoint, Action, Describable<UI
|
||||
return Hudson.getInstance().getExtensionList(UISample.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Kohsuke Kawaguchi
|
||||
*/
|
||||
public class SourceFile {
|
||||
public final String name;
|
||||
|
||||
public SourceFile(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public URL resolve() {
|
||||
return UISample.this.getClass().getResource(name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Serves this source file.
|
||||
*/
|
||||
public void doIndex(StaplerResponse rsp) throws IOException {
|
||||
rsp.setContentType("text/plain;charset=UTF-8");
|
||||
copy(resolve().openStream(),rsp.getOutputStream());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+1
-4
@@ -22,8 +22,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
-->
|
||||
<?jelly escape-by-default='true'?>
|
||||
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form" xmlns:s="/lib/samples"
|
||||
xmlns:this="this">
|
||||
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form" xmlns:s="/lib/samples">
|
||||
<l:layout title="Dynamic ComboBox Sample">
|
||||
<l:main-panel>
|
||||
<h1>Dynamic ComboBox Sample</h1>
|
||||
@@ -32,8 +31,6 @@ THE SOFTWARE.
|
||||
<j:out value="${it.description}"/>
|
||||
</p>
|
||||
|
||||
<this:_sources />
|
||||
|
||||
<s:sample>
|
||||
<form>
|
||||
<table>
|
||||
|
||||
-32
@@ -1,32 +0,0 @@
|
||||
<!--
|
||||
The MIT License
|
||||
|
||||
Copyright (c) 2004-2010, Oracle Corporation
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
-->
|
||||
<?jelly escape-by-default='true'?>
|
||||
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form" xmlns:s="/lib/samples">
|
||||
<h1>Source Files</h1>
|
||||
<ul>
|
||||
<j:forEach var="f" items="${it.sourceFiles}">
|
||||
<li><a href="sourceFile/${f.name}">${f.name}</a></li>
|
||||
</j:forEach>
|
||||
</ul>
|
||||
</j:jelly>
|
||||
+1
-1
@@ -192,7 +192,7 @@ THE SOFTWARE.
|
||||
<systemProperty>
|
||||
<!-- load view resources from the source directly, again for real time change -->
|
||||
<name>stapler.resourcePath</name>
|
||||
<value>../core/src/main/resources;../ui-samples-plugin/src/main/resources;../maven-plugin/src/main/resources</value>
|
||||
<value>../core/src/main/resources</value>
|
||||
</systemProperty>
|
||||
<systemProperty>
|
||||
<!-- enable the plugins in main by default -->
|
||||
|
||||
Reference in new issue
Block a user