Permalink
Browse files

Merge remote-tracking branch 'upstream/master'

  • Loading branch information...
2 parents 737ad3e + 0b6562d commit da8a4a9411cc9cae36f13d7e14a031ac045959d9 @rodikal rodikal committed Oct 11, 2012
View
@@ -1,11 +1,15 @@
-apache-tomcat
-work
-jenkins_home
-nbactions.xml
-release.properties
-target
-*~
-
-
-*.iml
-/.idea
+apache-tomcat
+work
+jenkins_home
+nbactions.xml
+release.properties
+target
+*~
+
+
+*.iml
+/.idea
+.settings
+.project
+.classpath
+pom.xml.releaseBackup
View
@@ -6,13 +6,13 @@
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
- <version>1.399</version>
+ <version>1.424</version>
</parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>jenkinswalldisplay</artifactId>
<packaging>hpi</packaging>
- <version>0.6.13-SNAPSHOT</version>
+ <version>0.6.14-SNAPSHOT</version>
<name>Jenkins Wall Display Master Project</name>
<url>http://wiki.jenkins-ci.org/display/JENKINS/Wall+Display+Plugin</url>
@@ -58,6 +58,12 @@
<version>1.8</version>
<optional>true</optional>
</dependency>
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-core</artifactId>
+ <version>1.9.0</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
</project>
@@ -19,9 +19,12 @@
private String theme = WallDisplayPlugin.themes[0];
private String fontFamily = WallDisplayPlugin.fontFamilies[0];
+ private String buildRange = WallDisplayPlugin.buildRange[0];
+ private String sortOrder = WallDisplayPlugin.sortOrder[0];
private int jenkinsTimeOut = 15;
private int jenkinsUpdateInterval = 20;
private Boolean showDetails = false;
+ private Boolean showGravatar = false;
private Boolean showBuildNumber = true;
private Boolean showDisabledBuilds = true;
@@ -66,6 +69,22 @@ public void setJenkinsUpdateInterval(int jenkinsUpdateInterval) {
}
@Exported
+ public String getSortOrder() {
+ if (sortOrder != null)
+ {
+ return sortOrder.toLowerCase();
+ }
+ else
+ {
+ return sortOrder;
+ }
+ }
+
+ public void setSortOrder(String sortOrder) {
+ this.sortOrder = sortOrder;
+ }
+
+ @Exported
public String getTheme() {
if (theme != null)
{
@@ -78,14 +97,30 @@ public String getTheme() {
}
public Boolean isValid() {
- return (theme != null);
+ return (theme != null && buildRange != null);
}
public void setTheme(String theme) {
this.theme = theme;
}
@Exported
+ public String getBuildRange() {
+ if (buildRange != null)
+ {
+ return buildRange.toLowerCase();
+ }
+ else
+ {
+ return buildRange;
+ }
+ }
+
+ public void setBuildRange(String buildRange) {
+ this.buildRange = buildRange;
+ }
+
+ @Exported
public boolean getShowDetails() {
return showDetails;
}
@@ -95,6 +130,15 @@ public void setShowDetails(Boolean showDetails) {
}
@Exported
+ public Boolean getShowGravatar() {
+ return showGravatar;
+ }
+
+ public void setShowGravatar(Boolean showGravatar) {
+ this.showGravatar = showGravatar;
+ }
+
+ @Exported
public String getFontFamily() {
if (fontFamily != null)
{
@@ -115,6 +159,6 @@ public void setFontFamily(String fontFamily) {
*/
@Override
public String toString() {
- return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).append("theme", theme).append("jenkinsTimeOut", jenkinsTimeOut).append("jenkinsUpdateInterval", jenkinsUpdateInterval).append("showDetails", showDetails).append("fontFamily", fontFamily).toString();
+ return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).append("theme", theme).append("jenkinsTimeOut", jenkinsTimeOut).append("jenkinsUpdateInterval", jenkinsUpdateInterval).append("showDetails", showDetails).append("showGravatar", showGravatar).append("fontFamily", fontFamily).append("buildRange", buildRange).append("sortOrder", sortOrder).toString();
}
}
@@ -26,11 +26,16 @@
public class WallDisplayPlugin extends Plugin {
private static final Logger LOGGER = Logger.getLogger("hudson." + WallDisplayPlugin.class.getName());
+
public final static String PLUGIN_NAME = "jenkinswalldisplay";
public static final String[] themes = new String[] { "Default", "Christmas", "Boss", "Dark", "Colorblind" };
public static final String[] fontFamilies = new String[] { "Sans-Serif", "Arial", "Helvetica", "Verdana" };
+
+ public static final String[] buildRange = new String[] { "All", "Active this month", "Active this week", "Active today" };
+
+ public static final String[] sortOrder = new String[] { "Job Name", "Job Status" };
@Exported
public Configuration config;
@@ -72,11 +77,14 @@ public void configure(StaplerRequest req, JSONObject formData) throws IOExceptio
config.setTheme(Util.fixEmptyAndTrim(formData.optString("theme")));
config.setFontFamily(Util.fixEmptyAndTrim(formData.optString("fontFamily")));
+ config.setBuildRange(Util.fixEmptyAndTrim(formData.optString("buildRange")));
config.setJenkinsTimeOut(formData.optInt("jenkinsTimeOut"));
config.setJenkinsUpdateInterval(formData.optInt("jenkinsUpdateInterval"));
config.setShowBuildNumber(formData.optBoolean("jenkinsShowBuildNumber"));
config.setShowDetails(formData.optBoolean("jenkinsShowDetails"));
+ config.setShowGravatar(formData.optBoolean("jenkinsShowGravatar"));
config.setShowDisabledBuilds(formData.optBoolean("jenkinsShowDisabledBuilds"));
+ config.setSortOrder(Util.fixEmptyAndTrim(formData.optString("jenkinsSortOrder")));
getConfigXml().write(config);
}
@@ -1,11 +1,10 @@
package de.pellepelster.jenkins.walldisplay;
-import hudson.FilePath;
import hudson.model.Action;
import hudson.model.Hudson;
-import java.io.File;
-import java.net.URLEncoder;
+
import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
/**
* Action providing the link to the actual walldisplay page
@@ -14,32 +13,39 @@
*/
public class WallDisplayViewAction implements Action {
+ private static final String ENCODING = "UTF-8";
private String viewName;
public WallDisplayViewAction(String viewName) {
this.viewName = viewName;
}
- @Override
public String getIconFileName() {
return "/plugin/jenkinswalldisplay/images/icon.png";
}
- @Override
public String getDisplayName() {
return "Wall Display";
}
- @Override
public String getUrlName() {
String encodedUrl = null;
+ String encodedViewName = null;
+ String rootUrl = getRootUrl();
try {
- encodedUrl = URLEncoder.encode(Hudson.getInstance().getRootUrl(), "UTF-8");
+ encodedUrl = URLEncoder.encode(rootUrl, ENCODING);
+ encodedViewName = URLEncoder.encode(viewName, ENCODING);
} catch (UnsupportedEncodingException e) {
- encodedUrl = Hudson.getInstance().getRootUrl();
+ encodedUrl = rootUrl;
+ encodedViewName = viewName;
}
-
- return String.format("%s/plugin/jenkinswalldisplay/walldisplay.html?viewName=%s&jenkinsUrl=%s", Hudson.getInstance().getRootUrl(), viewName, encodedUrl);
+ return String
+ .format("%s/plugin/jenkinswalldisplay/walldisplay.html?viewName=%s&jenkinsUrl=%s",
+ rootUrl, encodedViewName, encodedUrl);
+ }
+
+ protected String getRootUrl() {
+ return Hudson.getInstance().getRootUrl();
}
}
@@ -1,17 +1,27 @@
<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">
<f:section title="${%Walldisplay}">
- <f:entry title="${%Theme}" name="theme">
+ <f:entry title="${%Theme} ${rootURL}" name="theme" help="${rootURL}/../plugin/jenkinswalldisplay/help-globalConfig-theme.html">
<select name="theme">
<j:forEach var="m" items="${it.themes}">
<f:option value="${m.toLowerCase()}" selected="${it.config.theme.equals(m.toLowerCase())}">
${m}
</f:option>
</j:forEach>
</select>
- </f:entry>
+ </f:entry>
+
+ <f:entry title="${%Builds to display}" name="buildRange" help="${rootURL}/../plugin/jenkinswalldisplay/help-globalConfig-buildRange.html">
+ <select name="buildRange">
+ <j:forEach var="m" items="${it.buildRange}">
+ <f:option value="${m.toLowerCase()}" selected="${it.config.buildRange.equals(m.toLowerCase())}">
+ ${m}
+ </f:option>
+ </j:forEach>
+ </select>
+ </f:entry>
- <f:entry title="${%Font Family}" name="fontFamily">
+ <f:entry title="${%Font Family}" name="fontFamily" help="${rootURL}/../plugin/jenkinswalldisplay/help-globalConfig-fontFamily.html">
<select name="fontFamily">
<j:forEach var="m" items="${it.fontFamilies}">
<f:option value="${m.toLowerCase()}" selected="${it.config.fontFamily.equals(m.toLowerCase())}">
@@ -21,25 +31,39 @@
</select>
</f:entry>
- <f:entry title="${%API Read Timeout}" name="jenkinsTimeOut">
- <f:textbox name="jenkinsTimeOut" value="${it.config.jenkinsTimeOut}" default="15" />
+ <f:entry title="${%Sort Order}" name="sortOrder" help="${rootURL}/../plugin/jenkinswalldisplay/help-globalConfig-sortOrder.html">
+ <select name="sortOrder">
+ <j:forEach var="m" items="${it.sortOrder}">
+ <f:option value="${m.toLowerCase()}" selected="${it.config.sortOrder.equals(m.toLowerCase())}">
+ ${m}
+ </f:option>
+ </j:forEach>
+ </select>
</f:entry>
+
+ <f:entry title="${%API Read Timeout}" name="jenkinsTimeOut" help="${rootURL}/../plugin/jenkinswalldisplay/help-globalConfig-jenkinsTimeOut.html">
+ <f:textbox name="jenkinsTimeOut" value="${it.config.jenkinsTimeOut}" default="15" />
+ </f:entry>
- <f:entry title="${%Update Interval}" name="jenkinsUpdateInterval">
+ <f:entry title="${%Update Interval}" name="jenkinsUpdateInterval" help="${rootURL}/../plugin/jenkinswalldisplay/help-globalConfig-jenkinsUpdateInterval.html">
<f:textbox name="jenkinsUpdateInterval" value="${it.config.jenkinsUpdateInterval}" default="20" />
</f:entry>
- <f:entry title="${%Show Job Details}" name="jenkinsShowDetails">
+ <f:entry title="${%Show Job Details}" name="jenkinsShowDetails" help="${rootURL}/../plugin/jenkinswalldisplay/help-globalConfig-jenkinsShowDetails.html">
<f:checkbox name="jenkinsShowDetails" checked="${it.config.showDetails}" />
- </f:entry>
+ </f:entry>
+
+ <f:entry title="${%Show Job Show Gravatar}" name="jenkinsShowGravatar" help="${rootURL}/../plugin/jenkinswalldisplay/help-globalConfig-jenkinsShowGravatar.html">
+ <f:checkbox name="jenkinsShowGravatar" checked="${it.config.showGravatar}" />
+ </f:entry>
- <f:entry title="${%Show Build Number}" name="jenkinsShowBuildNumber">
+ <f:entry title="${%Show Build Number}" name="jenkinsShowBuildNumber" help="${rootURL}/../plugin/jenkinswalldisplay/help-globalConfig-jenkinsShowBuildNumber.html">
<f:checkbox name="jenkinsShowBuildNumber" checked="${it.config.showBuildNumber}" />
</f:entry>
- <f:entry title="${%Show Disabled Builds}" name="jenkinsShowDisabledBuilds">
+ <f:entry title="${%Show Disabled Builds}" name="jenkinsShowDisabledBuilds" help="${rootURL}/../plugin/jenkinswalldisplay/help-globalConfig-jenkinsShowDisabledBuilds.html">
<f:checkbox name="jenkinsShowDisabledBuilds" checked="${it.config.showDisabledBuilds}" />
</f:entry>
</f:section>
-</j:jelly>
+</j:jelly>
@@ -0,0 +1,16 @@
+<div>
+ <p>
+ Set the build range. If you have a large number of builds, showing every single passing build
+ can obscure the important information of "what's broken". Therefore, you may
+ wish to filter the builds that get shown using this setting.
+ </p>
+
+ <p>For example, if you set this to "Active today", the only passing builds that will be shown will
+ be builds that have been run in the last 24 hours.</p>
+
+ <p>Failing and unstable builds will always be shown, regardless of when they
+ were last run.</p>
+</div>
+
+
+
@@ -0,0 +1,5 @@
+<div>
+ <p>
+ Select a predefined font to use on the wall display
+ </p>
+</div>
@@ -0,0 +1,5 @@
+<div>
+ <p>
+ Check this box to show the build number with the build name
+ </p>
+</div>
@@ -0,0 +1,5 @@
+<div>
+ <p>
+ Check this box if you want to show the name of the person who broke the build
+ </p>
+</div>
@@ -0,0 +1,6 @@
+<div>
+ <p>
+ Check this box if you want to show disabled builds. These will appear in grey.
+ Leave it unchecked to hide disabled builds.
+ </p>
+</div>
@@ -0,0 +1,5 @@
+<div>
+ <p>
+ Check this box if you want to show the <a href=http://gravatar.com>Gravatar</a> of the person who launch the build.
+ </p>
+</div>
@@ -0,0 +1,5 @@
+<div>
+ <p>
+ Number of seconds to attempt communication with Jenkins before declaring a timeout
+ </p>
+</div>
@@ -0,0 +1,5 @@
+<div>
+ <p>
+ Choose how often to update the wall display - update every /n/ seconds
+ </p>
+</div>
@@ -0,0 +1,5 @@
+<div>
+ <p>
+ Select a sort order to use on the wall display
+ </p>
+</div>
@@ -0,0 +1,5 @@
+<div>
+ <p>
+ Select a predefined look and feel for this wall display
+ </p>
+</div>
Oops, something went wrong.

0 comments on commit da8a4a9

Please sign in to comment.