JellyException: Could not parse Jelly script : null - jenkins

I'm trying to configure some features in Jenkins for our project. In the process of configuring Editable Email Notification, I have created a new jelly script file in $JENKINS_HOME/email-templates folder as shown here
<j:choose>
<j:when test="${build.result=='SUCCESS'}">
<IMG SRC="${rooturl}static/test1.gif" />
</j:when>
<j:when test="${build.result=='FAILURE'}">
<IMG SRC="${rooturl}static/e59dfe28/images/32x32/red.gif" />
</j:when>
<j:otherwise>
<IMG SRC="${rooturl}static/e59dfe28/images/32x32/yellow.gif" />
</j:otherwise>
</j:choose>
and accessing it in Jenkins config like this
${JELLY_SCRIPT,template="groovy-html"}
When I build the job, with these setting, I'm getting email with the content
"JellyException: Could not parse Jelly script : null"
Please find below script jelly script.
Thanks in advance!!
<?jelly escape-by-default='true'?>
<!DOCTYPE html [
<!ENTITY nbsp "&#38;nbsp;">
]>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define">
<STYLE>
BODY, TABLE, TD, TH, P {
font-family:Verdana,Helvetica,sans serif;
font-size:11px;
color:black;
}
h1 { color:black; }
h2 { color:black; }
h3 { color:black; }
TD.bg1 { color:white; background-color:#0000C0; font-size:120% }
TD.bg2 { color:white; background-color:#4040FF; font-size:110% }
TD.bg3 { color:white; background-color:#8080FF; }
TD.test_passed { color:blue; }
TD.test_failed { color:red; }
TD.console { font-family:Courier New; }
</STYLE>
<BODY>
<!-- GENERAL INFO -->
<TABLE>
<TR><TD align="right">
<j:choose>
<j:when test="${build.result=='SUCCESS'}">
<IMG SRC="${rooturl}static/test1.gif" />
</j:when>
<j:when test="${build.result=='FAILURE'}">
<IMG SRC="${rooturl}static/e59dfe28/images/32x32/red.gif" />
</j:when>
<j:otherwise>
<IMG SRC="${rooturl}static/e59dfe28/images/32x32/yellow.gif" />
</j:otherwise>
</j:choose>
</TD><TD valign="center"><B style="font-size: 200%;">QTP Execution - ${build.result}</B></TD></TR>
<TR><TD>Execution URL</TD><TD>${rooturl}${build.url}</TD></TR>
<TR><TD>Project:</TD><TD>${project.name}</TD></TR>
<TR><TD>Date of Execution:</TD><TD>${it.timestampString}</TD></TR>
<TR><TD>Execution duration:</TD><TD>${build.durationString}</TD></TR>
</TABLE>
<BR/>
<!-- CHANGE SET -->
<j:set var="changeSet" value="${build.changeSet}" />
<j:if test="${changeSet!=null}">
<j:set var="hadChanges" value="false" />
<TABLE width="100%">
<TR><TD class="bg1" colspan="2"><B>CHANGES</B></TD></TR>
<j:forEach var="cs" items="${changeSet}" varStatus="loop">
<j:set var="hadChanges" value="true" />
<j:set var="aUser" value="${cs.hudsonUser}"/>
<TR>
<TD colspan="2" class="bg2"> Revision <B>${cs.commitId?:cs.revision?:cs.changeNumber}</B> by
<B>${aUser!=null?aUser.displayName:cs.author.displayName}: </B>
<B>(${cs.msgAnnotated})</B>
</TD>
</TR>
<j:forEach var="p" items="${cs.affectedFiles}">
<TR>
<TD width="10%"> ${p.editType.name}</TD>
<TD>${p.path}</TD>
</TR>
</j:forEach>
</j:forEach>
<j:if test="${!hadChanges}">
<TR><TD colspan="2">No Changes</TD></TR>
</j:if>
</TABLE>
<BR/>
</j:if>
<!-- ARTIFACTS -->
<j:set var="artifacts" value="${build.artifacts}" />
<j:if test="${artifacts!=null and artifacts.size()>0}">
<TABLE width="100%">
<TR><TD class="bg1"><B>LOG FILES</B></TD></TR>
<TR>
<TD>
<j:forEach var="f" items="${artifacts}">
<li>
${f}
</li>
</j:forEach>
</TD>
</TR>
</TABLE>
<BR/>
</j:if>
<!-- Email Content -->
<TABLE width="100%">
<TR><TD align="right">
<j:choose>
<j:when test="${build.result=='SUCCESS'}">
<TR><TD class="bg1"><B>Please find attached FIle Differences sheet and Logs. If there are any unexpected file differences then please investigate further.</B></TD></TR>
</j:when>
<j:when test="${build.result=='FAILURE'}">
<TR><TD class="bg1"><B>Something went wrong. Please check log file for more details and if required then restart the execution after making appropriate changes.</B></TD></TR>
</j:when>
<j:otherwise>
<TR><TD class="bg1"><B>Please contact Jenkins Administrator.</B></TD></TR>
</j:otherwise>
</j:choose>
</TABLE>
<BR/>
<!-- MAVEN ARTIFACTS -->
<j:set var="mbuilds" value="${build.moduleBuilds}" />
<j:if test="${mbuilds!=null}">
<TABLE width="100%">
<TR><TD class="bg1"><B>BUILD ARTIFACTS</B></TD></TR>
<j:forEach var="m" items="${mbuilds}">
<TR><TD class="bg2"><B>${m.key.displayName}</B></TD></TR>
<j:forEach var="mvnbld" items="${m.value}">
<j:set var="artifacts" value="${mvnbld.artifacts}" />
<j:if test="${artifacts!=null and artifacts.size()>0}">
<TR>
<TD>
<j:forEach var="f" items="${artifacts}">
<li>
${f}
</li>
</j:forEach>
</TD>
</TR>
</j:if>
</j:forEach>
</j:forEach>
</TABLE>
<BR/>
</j:if>
<!-- JUnit TEMPLATE -->
<j:set var="junitResultList" value="${it.JUnitTestResult}" />
<j:if test="${junitResultList.isEmpty()!=true}">
<TABLE width="100%">
<TR><TD class="bg1" colspan="2"><B>JUnit Tests</B></TD></TR>
<j:forEach var="junitResult" items="${it.JUnitTestResult}">
<j:forEach var="packageResult" items="${junitResult.getChildren()}">
<TR><TD class="bg2" colspan="2"> Name: ${packageResult.getName()} Failed: ${packageResult.getFailCount()} test(s), Passed: ${packageResult.getPassCount()} test(s), Skipped: ${packageResult.getSkipCount()} test(s), Total: ${packageResult.getPassCount()+packageResult.getFailCount()+packageResult.getSkipCount()} test(s)</TD></TR>
<j:forEach var="failed_test" items="${packageResult.getFailedTests()}">
<TR bgcolor="white"><TD class="test_failed" colspan="2"><B><li>Failed: ${failed_test.getFullName()} </li></B></TD></TR>
</j:forEach>
</j:forEach>
</j:forEach>
</TABLE>
<BR/>
</j:if>
<!-- COBERTURA TEMPLATE -->
<j:set var="coberturaAction" value="${it.coberturaAction}" />
<j:if test="${coberturaAction!=null}">
<j:set var="coberturaResult" value="${coberturaAction.result}" />
<j:if test="${coberturaResult!=null}">
<table width="100%"><TD class="bg1" colspan="2"><B>Cobertura Report</B></TD></table>
<table width="100%"><TD class="bg2" colspan="2"><B>Project Coverage Summary</B></TD></table>
<table border="1px" class="pane">
<tr>
<td>Name</td>
<j:forEach var="metric" items="${coberturaResult.metrics}">
<td>${metric.name}</td>
</j:forEach>
</tr>
<tr>
<td>${coberturaResult.name}</td>
<j:forEach var="metric" items="${coberturaResult.metrics}">
<td data="${coberturaResult.getCoverage(metric).percentageFloat}">${coberturaResult.getCoverage(metric).percentage}%
(${coberturaResult.getCoverage(metric)})
</td>
</j:forEach>
</tr>
</table>
<j:if test="${coberturaResult.sourceCodeLevel}">
<h2>Source</h2>
<j:choose>
<j:when test="${coberturaResult.sourceFileAvailable}">
<div style="overflow-x:scroll;">
<table class="source">
<thead>
<tr>
<th colspan="3">${coberturaResult.relativeSourcePath}</th>
</tr>
</thead>
${coberturaResult.sourceFileContent}
</table>
</div>
</j:when>
<j:otherwise>
<p>
<i>Source code is unavailable</i>
</p>
</j:otherwise>
</j:choose>
</j:if>
<j:forEach var="element" items="${coberturaResult.childElements}">
<j:set var="childMetrics" value="${coberturaResult.getChildMetrics(element)}"/>
<table width="100%"><TD class="bg2" colspan="2">Coverage Breakdown by ${element.displayName}</TD></table>
<table border="1px" class="pane sortable">
<tr>
<td>Name</td>
<j:forEach var="metric" items="${childMetrics}">
<td>${metric.name}</td>
</j:forEach>
</tr>
<j:forEach var="c" items="${coberturaResult.children}">
<j:set var="child" value="${coberturaResult.getChild(c)}"/>
<tr>
<td>
${child.xmlTransform(child.name)}
</td>
<j:forEach var="metric" items="${childMetrics}">
<j:set var="childResult" value="${child.getCoverage(metric)}"/>
<j:choose>
<j:when test="${childResult!=null}">
<td data="${childResult.percentageFloat}">${childResult.percentage}%
(${childResult})
</td>
</j:when>
<j:otherwise>
<td data="101">N/A</td>
</j:otherwise>
</j:choose>
</j:forEach>
</tr>
</j:forEach>
</table>
</j:forEach>
</j:if>
<BR/>
</j:if>
<!-- CONSOLE OUTPUT -->
<j:getStatic var="resultFailure" field="FAILURE" className="hudson.model.Result"/>
<j:if test="${build.result==resultFailure}">
<TABLE width="100%" cellpadding="0" cellspacing="0">
<TR><TD class="bg1"><B>CONSOLE OUTPUT</B></TD></TR>
<j:forEach var="line" items="${build.getLog(100)}"><TR><TD class="console">${line}</TD></TR></j:forEach>
</TABLE>
<BR/>
</j:if>
</BODY>
</j:jelly>

Related

error when sending jelly template using email ext plugin with jenkins

I want to send the cppcheck report through email but I had never used the email ext plugin before, so I found this Sending Cppcheck result/report on email from Jenkins using email-ext plugin with a nice jelly template to do so, I have also followed the steps in the documentation, to send my own templates in a pipeline job, I have created my template with a .jelly extension and set it into my $JENKINS_HOME\email-templates although the email-templates folder did not exist, so I am not sure if it should be created beforehand just by installing the plugin or what I am missing. This is my stage
stage('Mail cppcheck report') {
steps{
script{
def mailRecipients = "email#email.net"
def jobName = currentBuild.fullDisplayName
mimeType: 'text/html'
emailext body: '''${JELLY_SCRIPT, template="custom"}''',
subject: "[Jenkins] ${jobName}",
to: "${mailRecipients}"
}
}
}
And this is the template I want to use but I keep getting the following error JellyException: Could not parse Jelly script : null even though the email is sent the email body is just the error mentioned above.
<j:set var="cppcheckAction" value="${it.getAction('org.jenkinsci.plugins.cppcheck.CppcheckBuildAction')}" />
<j:if test="${cppcheckAction!=null}">
<j:set var="cppcheckResult" value="${cppcheckAction.getResult()}" />
<j:if test="${cppcheckResult!=null}">
<TABLE width="100%">
<TR><TD class="bg1" colspan="2"><B>CPPCHECK RESULT</B></TD></TR>
<TR bgcolor="white"><TD class="test_failed" colspan="2"><B><li>Found: ${cppcheckResult.report.getNumberTotal()}</li></B></TD></TR>
</TABLE>
<BR/>
</j:if>
</j:if>
I have also tried with some other templates and I get no error but I receive an empty email instead, like with this one.
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define">
<html>
<j:set var="cppcheckAction" value="${it.getAction('org.jenkinsci.plugins.cppcheck.CppcheckBuildAction')}" />
<j:if test="${cppcheckAction!=null}">
<j:set var="cppcheckResult" value="${cppcheckAction.getResult()}" />
<j:if test="${cppcheckResult!=null}">
<h2>Summary</h2>
<style type="text/css">
#cppcheckStatistics { width: auto; }
#cppcheckStatistics .number { text-align: right; }
</style>
<table class="pane sortable" id="cppcheckStatistics">
<thead>
<tr>
<td class="pane-header">Severity</td>
<td class="pane-header">Count</td>
<td class="pane-header">Delta</td>
</tr>
</thead>
<tbody>
<tr>
<td class="pane">Error</td>
<td class="pane number">${cppcheckResult.statistics.getNumberErrorSeverity()}</td>
<td class="pane number">${cppcheckResult.getDiff().getNumberErrorSeverity()}</td>
</tr>
<tr>
<td class="pane">Warning</td>
<td class="pane number">${cppcheckResult.statistics.getNumberWarningSeverity()}</td>
<td class="pane number">${cppcheckResult.getDiff().getNumberWarningSeverity()}</td>
</tr>
<tr>
<td class="pane">Style</td>
<td class="pane number">${cppcheckResult.statistics.getNumberStyleSeverity()}</td>
<td class="pane number">${cppcheckResult.getDiff().getNumberStyleSeverity()}</td>
</tr>
<tr>
<td class="pane">Performance</td>
<td class="pane number">${cppcheckResult.statistics.getNumberPerformanceSeverity()}</td>
<td class="pane number">${cppcheckResult.getDiff().getNumberPerformanceSeverity()}</td>
</tr>
<tr>
<td class="pane">Portability</td>
<td class="pane number">${cppcheckResult.statistics.getNumberPortabilitySeverity()}</td>
<td class="pane number">${cppcheckResult.getDiff().getNumberPortabilitySeverity()}</td>
</tr>
<tr>
<td class="pane">Information</td>
<td class="pane number">${cppcheckResult.statistics.getNumberInformationSeverity()}</td>
<td class="pane number">${cppcheckResult.getDiff().getNumberInformationSeverity()}</td>
</tr>
<tr>
<td class="pane">No category</td>
<td class="pane number">${cppcheckResult.statistics.getNumberNoCategorySeverity()}</td>
<td class="pane number">${cppcheckResult.getDiff().getNumberNoCategorySeverity()}</td>
</tr>
</tbody>
<tfoot>
<tr class="sortbottom">
<td class="pane-header">Total</td>
<td class="pane-header number"><B>${cppcheckResult.report.getNumberTotal()}</B></td>
<td class="pane-header number"><B>${cppcheckResult.getDiff().getNumberTotal()}</B></td>
</tr>
</tfoot>
</table>
</j:if>
</j:if>
</html>
</j:jelly>
However if I use the default template emailext body: '''${JELLY_SCRIPT, template="html"}''' it works fine

Not able to show committers list in Jenkins Jelly email template

We have recently migrated our jenkins to 1.6 version and I have findbug project set. While showing findbug results in email using below jelly template, "Find Bugs warnings info" section shows error message as "Find Bugs Publisher did not get invoked due to an error". But I do not see any error in console.
Also, "New Warnings" section is not showing up. It looks that fb variable is null and no results are showing up in email template.
Even the change sets section is not visible.
Is there any setting missing for findbug in Jenkins required to show up these results.
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define">
<html>
<head>
<title>${project.name}</title>
<style>
body table, td, th, p, h1, h2 {
margin:0;
font:normal normal
90% Georgia, Serif;
background-color: #ffffff;
}
h1, h2 {
border-bottom:dotted 1px #999999;
padding:5px;
margin-top:10px;
margin-bottom:10px;
color: #000000;
font: normal bold 90%
Georgia,Serif;
background-color:#f0f0f0;
}
</style>
</head>
<body>
<div class="header">
<j:set var="spc" value="&nbsp;&nbsp;" />
<h1>
<j:choose>
<j:when test="${build.result=='SUCCESS'}">
<img src="${rooturl}static/e59dfe28/images/32x32/blue.gif" />
</j:when>
<j:when test="${build.result=='FAILURE'}">
<img src="${rooturl}static/e59dfe28/images/32x32/red.gif" />
</j:when>
<j:otherwise>
<img
src="${rooturl}static/e59dfe28/images/32x32/yellow.gif" />
</j:otherwise>
</j:choose>
BUILD ${build.result}
</h1>
<table>
<tr>
<td>Build URL</td>
<td>
${rooturl}${build.url}
</td>
</tr>
<tr>
<td>Project:</td>
<td>${project.name}</td>
</tr>
<tr>
<td>Date of build:</td>
<td>${it.timestampString}</td>
</tr>
<tr>
<td>Build duration:</td>
<td>${build.durationString}</td>
</tr>
<tr>
<td>Build cause:</td>
<td>
<j:forEach var="cause" items="${build.causes}">${cause.shortDescription}
</j:forEach>
</td>
</tr>
<tr>
<td>Build description:</td>
<td>${build.description}</td>
</tr>
<tr>
<td>Built on:</td>
<td>
<j:choose>
<j:when test="${build.builtOnStr!=''}">${build.builtOnStr}
</j:when>
<j:otherwise>master</j:otherwise>
</j:choose>
</td>
</tr>
</table>
</div>
<!-- Static Analysis -->
<j:set var="actions" value="${it.staticAnalysisActions}" />
<j:if test="${!actions.isEmpty()}">
<div class="content">
<h1>Static Analysis Results</h1>
<table>
<tr>
<th></th>
<th>Name</th>
<th>Result</th>
<th>Total</th>
<th>High</th>
<th>Normal</th>
<th>Low</th>
</tr>
<j:forEach var="action" items="${actions}">
<tr>
<td>
<img src="${rooturl}${action.smallImageName}" />
</td>
<td>
<a href="${rooturl}${build.url}/${action.urlName}">${action.displayName}
</a>
</td>
<td class="center">
<j:choose>
<j:when test="${action.result.pluginResult=='SUCCESS'}">
<img src="${rooturl}static/e59dfe28/images/16x16/blue.gif" />
</j:when>
<j:when test="${action.result.pluginResult=='FAILURE'}">
<img src="${rooturl}static/e59dfe28/images/16x16/red.gif" />
</j:when>
<j:otherwise>
<img src="${rooturl}static/e59dfe28/images/16x16/yellow.gif" />
</j:otherwise>
</j:choose>
</td>
<td class="center">${action.result.numberOfAnnotations}
</td>
<td class="center">${action.result.getNumberOfAnnotations('HIGH')}
</td>
<td class="center">${action.result.getNumberOfAnnotations('NORMAL')}
</td>
<td class="center">${action.result.getNumberOfAnnotations('LOW')}
</td>
</tr>
</j:forEach>
</table>
</div>
</j:if>
<!-- More Find bugs info-->
<j:set var="fb" value="${it.getAction('hudson.plugins.findbugs.FindBugsResultAction')}" />
<div class="content">
<h1>Find Bugs warnings info</h1>
<table width="100%">
<tr>
<th>Total</th>
<th>Fixed</th>
<th>New</th>
<th >Report</th>
</tr>
<tr>
<td class="center">${fb.result.numberOfWarnings}</td>
<td class="center">${fb.result.numberOfFixedWarnings}</td>
<td class="center">${fb.result.numberOfNewWarnings}</td>
<td class="center">View Report</td>
</tr>
</table>
</div>
<j:set var="newWarnings" value="${fb.result.newWarnings}" />
<j:if test="${newWarnings!=null}">
<div class="content">
<h1>New warnings</h1>
<table width="100%" class="newWarningsborder">
<tr>
<th width="20%" class="newWarningsborder">Name</th>
<th width="5%" class="newWarningsborder">Line</th>
<th width="*" class="newWarningsborder">Message</th>
</tr>
<j:forEach var="fileAnnotation" items="${newWarnings}" varStatus="loop">
<tr>
<td width="20%" class="newWarningsborder">${fileAnnotation.shortFileName}</td>
<td width="5%" class="newWarningsborder">${fileAnnotation.primaryLineNumber}</td>
<td width="*" class="newWarningsborder">${fileAnnotation.message}</td>
</tr>
</j:forEach>
</table>
</div>
</j:if>
<!-- CHANGE SET -->
<div class="content">
<j:set var="changeSet" value="${build.changeSet}" />
<j:if test="${changeSet!=null}">
<j:set var="hadChanges" value="false" />
<a href="${rooturl}${build.url}/changes">
<h1>Changes</h1>
</a>
<j:forEach var="cs" items="${changeSet.logs}" varStatus="loop">
<j:set var="hadChanges" value="true" />
<h2>${cs.msgAnnotated}</h2>
<p>
by
<em>${cs.author}</em>
</p>
<table>
<j:forEach var="p" items="${cs.affectedFiles}">
<tr>
<td width="10%">${spc}${p.editType.name}</td>
<td>
<tt>${p.path}</tt>
</td>
</tr>
</j:forEach>
</table>
</j:forEach>
<j:if test="${!hadChanges}">
<p>No Changes</p>
</j:if>
<br />
</j:if>
</div>
<!-- ARTIFACTS -->
<j:set var="artifacts" value="${build.artifacts}" />
<j:if test="${artifacts!=null and artifacts.size()>0}">
<div class="content">
<h1>Build Artifacts</h1>
<ul>
<j:forEach var="f" items="${artifacts}">
<li>
${f}
</li>
</j:forEach>
</ul>
</div>
</j:if>
<!-- MAVEN ARTIFACTS -->
<j:set var="mbuilds" value="${build.moduleBuilds}" />
<j:if test="${mbuilds!=null}">
<div class="content">
<h1>Build Artifacts</h1>
<j:forEach var="m" items="${mbuilds}">
<h2>${m.key.displayName}</h2>
<j:forEach var="mvnbld" items="${m.value}">
<j:set var="artifacts" value="${mvnbld.artifacts}" />
<j:if test="${artifacts!=null and artifacts.size()>0}">
<ul>
<j:forEach var="f" items="${artifacts}">
<li>
${f}
</li>
</j:forEach>
</ul>
</j:if>
</j:forEach>
</j:forEach>
<br />
</div>
</j:if>
</body>
</html>

ViewScoped bean losing its state after clicking a commandLink

I'm using Icefaces 3.2 along with JSF 2.1.8. I have the below views included in the main xhtml page. It looks like myViewBean which is #ViewScoped is losing it's state after the link myLink is clicked. The actionListener has logic to get the myViewBean and set the required list of items. During the render response phase, the myViewBean seems to have empty empList. If the #ViewScoped is changed to #SessionScoped, it works in the expected way, but I have 10 other beans all of which need to be changed to SessionScoped. What makes the bean lose its state? Or is there any other way to make use of ViewScoped?
main.xhtml
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ice="http://www.icesoft.com/icefaces/component"
xmlns:ui="http://java.sun.com/jsf/facelets" >
<f:view contentType="text/html">
<h:head>
</h:head>
<h:body id="bodyId" bgcolor="white">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<ice:panelGroup>
<ice:form id="mainForm" name="mainForm">
<table>
<tbody>
<tr>
<td>
<ui:include src="myTabs.xhtml"/>
</td>
</tr>
</tbody>
</table>
</ice:form>
</ice:panelGroup>
</td>
</tr>
</table>
</h:body>
</f:view>
</html>
myTabs.xhtml
<f:subview
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ice="http://www.icesoft.com/icefaces/component"
xmlns:ui="http://java.sun.com/jsf/facelets">
<div>
<table class="icePnlTbSet" id="myTabSet"
border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td>
<table cellpadding="0" cellspacing="0">
<tbody>
<tr>
<!-- My Tab 1 -->
<td class="icePnlTb" style="vertical-align: bottom;" title="tab1">
<table cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td class="LftTop"><img alt="" src="/images/spacer.gif "
width="4" height="1" /></td>
<td class="MidTop"><img alt="" src="/images/spacer.gif "
width="4" height="1" /></td>
<td class="RtTop"><img alt="" src="/images/spacer.gif "
width="4" height="1" /></td>
</tr>
<tr>
<td class="LftMid"><img alt="" src="/images/spacer.gif "
width="4" height="1" /></td>
<td class="MidMid">
<ice:commandLink id="myLink" value="MyTab 1" title=""
actionListener="#{mySessionBean.tabChanged}">
<f:param value="0" name="tab" />
</ice:commandLink>
</td>
<td class="RtMid"><img alt="" src="/images/spacer.gif "
width="4" height="1" /></td>
</tr>
<tr>
<td class="LftBtm"><img alt="" src="/images/spacer.gif "
width="4" height="1" /></td>
<td class="MidBtm"><img alt="" src="/images/spacer.gif "
width="4" height="1" /></td>
<td class="RtBtm"><img alt="" src="/images/spacer.gif "
width="4" height="1" /></td>
</tr>
</tbody>
</table>
</td>
<!-- Repeat for n tabs -->
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
<ui:include src="tabcontent1.xhtml" />
</f:subview>
tabcontent1.xhtml
<f:subview
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ice="http://www.icesoft.com/icefaces/component"
xmlns:ui="http://java.sun.com/jsf/facelets">
<ice:panelGroup>
<ice:dataTable id="empTable" value="#{myViewBean.empList}"
var="emp">
...
</ice:dataTable>
</ice:panelGroup>
</f:subview>
A #ViewScoped bean will only hold data if you return null or void from action methods (which will navigate back to the same page), once you navigate away from the view the data is lost.
May be you can try #RequestScoped.

How to display subversion URL for the Project with jenkins email-ext plugin?

Here is the jelly script i am using:
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define">
<STYLE>BODY, TABLE, TD, TH, P { font-family:Verdana,Helvetica,sans serif; font-size:11px; color:black; } h1 { color:black; } h2 { color:black; } h3 {
color:black; } TD.bg1 { color:white; background-color:#0000C0; font-size:120% } TD.bg2 { color:white;
background-color:#4040FF; font-size:110% } TD.bg3 { color:white; background-color:#8080FF; } TD.test_passed { color:blue; } TD.test_failed { color:red
; } TD.console { font-family:Courier New; }</STYLE>
<BODY>
<j:set var="spc" value="&nbsp;&nbsp;" />
<!-- GENERAL INFO -->
<TABLE>
<TR>
<TD align="right">
<j:choose>
<j:when test="${build.result=='SUCCESS'}">
<IMG SRC="${rooturl}static/e59dfe28/images/32x32/blue.gif" />
</j:when>
<j:when test="${build.result=='FAILURE'}">
<IMG SRC="${rooturl}static/e59dfe28/images/32x32/red.gif" />
</j:when>
<j:otherwise>
<IMG SRC="${rooturl}static/e59dfe28/images/32x32/yellow.gif" />
</j:otherwise>
</j:choose>
</TD>
<TD valign="center">
<B style="font-size: 200%;">BUILD ${build.result}</B>
</TD>
</TR>
<TR>
<TD>Build URL</TD>
<TD>
${rooturl}${build.url}
</TD>
</TR>
<TR>
<TD>Project:</TD>
<TD>${project.name}</TD>
</TR>
<TR>
<TD>Date of build:</TD>
<TD>${it.timestampString}</TD>
</TR>
<TR>
<TD>Build duration:</TD>
<TD>${build.durationString}</TD>
</TR>
<TR>
<!-- BRANCH -->
<TD>Subversion Repo:</TD>
<TD>${build.scm}</TD>
</TR>
<tr>
<td>Build Cause:</td>
<td>
<j:forEach var="cause" items="${build.causes}">${cause.shortDescription} </j:forEach>
</td>
</tr>
</TABLE>
<BR />
<!-- CHANGE SET -->
<j:set var="changeSet" value="${build.changeSet}" />
<j:if test="${changeSet!=null}">
<j:set var="hadChanges" value="false" />
<TABLE width="100%">
<TR>
<TD class="bg1" colspan="2">
<B>CHANGES</B>
</TD>
</TR>
<j:forEach var="cs" items="${changeSet}" varStatus="loop">
<j:set var="hadChanges" value="true" />
<j:set var="aUser" value="${cs.hudsonUser}" />
<TR>
<TD colspan="2" class="bg2">${spc}Revision
<B>${cs.commitId?:cs.revision?:cs.changeNumber}</B>by
<B>${aUser!=null?aUser.displayName:cs.author.displayName}:</B>
<B>(${cs.msgAnnotated})</B></TD>
</TR>
<j:forEach var="p" items="${cs.affectedFiles}">
<TR>
<TD width="10%">${spc}${p.editType.name}</TD>
<TD>${p.path}</TD>
</TR>
</j:forEach>
</j:forEach>
<j:if test="${!hadChanges}">
<TR>
<TD colspan="2">No Changes</TD>
</TR>
</j:if>
</TABLE>
<BR />
</j:if>
<!-- ARTIFACTS -->
<j:set var="artifacts" value="${build.artifacts}" />
<j:if test="${artifacts!=null and artifacts.size()>0}">
<TABLE width="100%">
<TR>
<TD class="bg1">
<B>BUILD ATRIFACTS</B>
</TD>
</TR>
<TR>
<TD>
<j:forEach var="f" items="${artifacts}">
<li>
${f}
</li>
</j:forEach>
</TD>
</TR>
</TABLE>
<BR />
</j:if>
<!-- MAVEN ARTIFACTS -->
<j:set var="mbuilds" value="${build.moduleBuilds}" />
<j:if test="${mbuilds!=null}">
<TABLE width="100%">
<TR>
<TD class="bg1">
<B>BUILD ATRIFACTS</B>
</TD>
</TR>
<j:forEach var="m" items="${mbuilds}">
<TR>
<TD class="bg2">
<B>${m.key.displayName}</B>
</TD>
</TR>
<j:forEach var="mvnbld" items="${m.value}">
<j:set var="artifacts" value="${mvnbld.artifacts}" />
<j:if test="${artifacts!=null and artifacts.size()>0}">
<TR>
<TD>
<j:forEach var="f" items="${artifacts}">
<li>
${f}
</li>
</j:forEach>
</TD>
</TR>
</j:if>
</j:forEach>
</j:forEach>
</TABLE>
<BR />
</j:if>
<!-- JUnit TEMPLATE -->
<j:set var="junitResultList" value="${it.JUnitTestResult}" />
<j:if test="${junitResultList.isEmpty()!=true}">
<TABLE width="100%">
<TR>
<TD class="bg1" colspan="2">
<B>${project.name} Functional Tests</B>
</TD>
</TR>
<j:forEach var="junitResult" items="${it.JUnitTestResult}">
<j:forEach var="packageResult" items="${junitResult.getChildren()}">
<TR>
<TD class="bg2" colspan="2">Name: ${packageResult.getName()} Failed: ${packageResult.getFailCount()} test(s), Passed: ${packageResult.getP
assCount()} test(s), Skipped: ${packageResult.getSkipCount()} test(s), Total:
${packageResult.getPassCount()+packageResult.getFailCount()+packageResult.getSkipCount()} test(s)</TD>
</TR>
<j:forEach var="failed_test" items="${packageResult.getFailedTests()}">
<TR bgcolor="white">
<TD class="test_failed" colspan="2">
<B>
<li>Failed: ${failed_test.getFullName()}
<br />
<pre>
${failed_test.errorDetails}
</pre></li>
</B>
</TD>
</TR>
<TR bgcolor="white">
<TD class="test_failed" colspan="2">
<B>
<li>StackTrace: ${failed_test.getFullName()}
<br />
<pre>
${failed_test.errorStackTrace}
</pre></li>
</B>
</TD>
</TR>
</j:forEach>
</j:forEach>
</j:forEach>
</TABLE>
<BR />
</j:if>
<!-- COBERTURA TEMPLATE -->
<j:set var="coberturaAction" value="${it.coberturaAction}" />
<j:if test="${coberturaAction!=null}">
<j:set var="coberturaResult" value="${coberturaAction.result}" />
<j:if test="${coberturaResult!=null}">
<table width="100%">
<TD class="bg1" colspan="2">
<B>Cobertura Report</B>
</TD>
</table>
<table width="100%">
<TD class="bg2" colspan="2">
<B>Project Coverage Summary</B>
</TD>
</table>
<table border="1px" class="pane">
<tr>
<td>Name</td>
<j:forEach var="metric" items="${coberturaResult.metrics}">
<td>${metric.name}</td>
</j:forEach>
</tr>
<tr>
<td>${coberturaResult.name}</td>
<j:forEach var="metric" items="${coberturaResult.metrics}">
<td data="${coberturaResult.getCoverage(metric).percentageFloat}">${coberturaResult.getCoverage(metric).percentage}% (${coberturaResult.ge
tCoverage(metric)})</td>
</j:forEach>
</tr>
</table>
<j:if test="${coberturaResult.sourceCodeLevel}">
<h2>Source</h2>
<j:choose>
<j:when test="${coberturaResult.sourceFileAvailable}">
<div style="overflow-x:scroll;">
<table class="source">
<thead>
<tr>
<th colspan="3">${coberturaResult.relativeSourcePath}</th>
</tr>
</thead>${coberturaResult.sourceFileContent}</table>
</div>
</j:when>
<j:otherwise>
<p>
<i>Source code is unavailable</i>
</p>
</j:otherwise>
</j:choose>
</j:if>
<j:forEach var="element" items="${coberturaResult.childElements}">
<j:set var="childMetrics" value="${coberturaResult.getChildMetrics(element)}" />
<table width="100%">
<TD class="bg2" colspan="2">Coverage Breakdown by ${element.displayName}</TD>
</table>
<table border="1px" class="pane sortable">
<tr>
<td>Name</td>
<j:forEach var="metric" items="${childMetrics}">
<td>${metric.name}</td>
</j:forEach>
</tr>
<j:forEach var="c" items="${coberturaResult.children}">
<j:set var="child" value="${coberturaResult.getChild(c)}" />
<tr>
<td>${child.xmlTransform(child.name)}</td>
<j:forEach var="metric" items="${childMetrics}">
<j:set var="childResult" value="${child.getCoverage(metric)}" />
<j:choose>
<j:when test="${childResult!=null}">
<td data="${childResult.percentageFloat}">${childResult.percentage}% (${childResult})</td>
</j:when>
<j:otherwise>
<td data="101">N/A</td>
</j:otherwise>
</j:choose>
</j:forEach>
</tr>
</j:forEach>
</table>
</j:forEach>
</j:if>
<BR />
</j:if>
<!-- HEALTH TEMPLATE -->
<div class="content">
<j:set var="healthIconSize" value="16x16" />
<j:set var="healthReports" value="${project.buildHealthReports}" />
<j:if test="${healthReports!=null}">
<h1>Health Report</h1>
<table>
<tr>
<th>W</th>
<th>Description</th>
<th>Score</th>
</tr>
<j:forEach var="healthReport" items="${healthReports}">
<tr>
<td>
<img src="${rooturl}${healthReport.getIconUrl(healthIconSize)}" />
</td>
<td>${healthReport.description}</td>
<td>${healthReport.score}</td>
</tr>
</j:forEach>
</table>
<br />
</j:if>
</div>
<!-- CONSOLE OUTPUT -->
<j:getStatic var="resultFailure" field="FAILURE" className="hudson.model.Result" />
<j:if test="${build.result==resultFailure}">
<TABLE width="100%" cellpadding="0" cellspacing="0">
<TR>
<TD class="bg1">
<B>CONSOLE OUTPUT</B>
</TD>
</TR>
<j:forEach var="line" items="${build.getLog(100)}">
<TR>
<TD class="console">${line}</TD>
</TR>
</j:forEach>
</TABLE>
<BR />
</j:if>
</BODY>
</j:jelly>
<!-- BRANCH -->
<TD>Subversion Repo:</TD>
<TD>${build.scm}</TD>
</TR>
does not work, and i am not sure which argument to use with build object to get subversion url.
outside jelly script, i can get the Subversion URL, using:
Subversion URL: ${ENV, var="SVN_URL"}
This might work -
<j:set var="buildenv" value="${build.getEnvironment(listener)}"/>
<j:set var="myvar" value="${buildenv.get('SVN_URL')}"/>
Reference: Jelly script for ext-email plugin jenkins
<TD>${build.envVars.SVN_URL}</TD>

Obout controls (grid,textbox,calendar) problems

I have problem with Obout calendar and textbox inside obout grid edit template.
This is the code of my grid :
<obout2:Grid ID="grid1" runat="server" CallbackMode="false" Serialize="true"
ShowHeader="true" PageSize="10"
FolderStyle="~/styles/Grid/black_glass" AutoGenerateColumns="false" EnableRecordHover="true"
AllowAddingRecords="true" RowEditTemplateId="tplRowEdit">
<Columns>
<obout2:Column ID="Column1" DataField="ID_Nal" ReadOnly="true" Visible="false" HeaderText="ID_Nal"
Width="100" runat="server">
<TemplateSettings RowEditTemplateControlId="txtID_Nal" RowEditTemplateControlPropertyName="value" />
</obout2:Column>
<obout2:Column ID="Column2" DataField="ID_Wpl" Visible="false" HeaderText="ID_Wpl"
Width="200" runat="server">
<TemplateSettings RowEditTemplateControlId="txtID_Wpl" RowEditTemplateControlPropertyName="value" />
</obout2:Column>
<obout2:Column ID="Column3" DataField="Nazwa" HeaderText="Typ_Naleznosci" Width="150"
runat="server">
<TemplateSettings RowEditTemplateControlId="txtTyp" RowEditTemplateControlPropertyName="value" />
</obout2:Column>
<obout2:Column ID="Column4" DataField="KwotaN" HeaderText="Kwota Nalezności" Width="150"
runat="server">
<TemplateSettings RowEditTemplateControlId="txtKwotaN" RowEditTemplateControlPropertyName="value" />
</obout2:Column>
<obout2:Column ID="Column5" DataField="Termin_platnosci" HeaderText="Termin_platnosci"
Width="150" runat="server">
<TemplateSettings RowEditTemplateControlId="txtTermin" RowEditTemplateControlPropertyName="value" />
</obout2:Column>
<obout2:Column ID="Column7" DataField="Opis" HeaderText="Opis nal." Width="150" runat="server">
<TemplateSettings RowEditTemplateControlId="txtOpis" RowEditTemplateControlPropertyName="value" />
</obout2:Column>
<obout2:Column ID="Column8" DataField="KwotaW" HeaderText="Kwota wpłaty" Width="150"
runat="server">
<TemplateSettings RowEditTemplateControlId="txtKwotaW" RowEditTemplateControlPropertyName="value" />
</obout2:Column>
<obout2:Column ID="Column9" DataField="DataW" HeaderText="Data wpłaty" Width="150"
runat="server">
<TemplateSettings RowEditTemplateControlId="txtDataW" RowEditTemplateControlPropertyName="value" />
</obout2:Column>
<obout2:Column ID="Column10" DataField="OpisW" HeaderText="Opis wpłaty" Width="150"
runat="server">
<TemplateSettings RowEditTemplateControlId="txtOpisW" RowEditTemplateControlPropertyName="value" />
</obout2:Column>
<obout2:Column ID="Column11" HeaderText="" Width="200" AllowEdit="true" Align="center"
AllowDelete="true" runat="server" />
</Columns>
<TemplateSettings RowEditTemplateId="tplRowEdit" />
<Templates>
<obout2:GridTemplate runat="server" ID="tplRowEdit">
<Template>
<div style="position: relative;">
<table class="rowEditTable">
<tr>
<td valign="top">
<fieldset style="width: 275px; height: 250px;">
<legend>Ship Information</legend>
<table>
<tr>
<td width="120">
ID Nal:
</td>
<td>
<obout1:OboutTextBox runat="server" ID="txtID_Nal" Width="150" />
</td>
</tr>
<tr>
<td width="120">
Id Wpl:
</td>
<td>
<obout1:OboutTextBox runat="server" ID="txtID_Wpl" Width="150" />
</td>
</tr>
<tr>
<td width="120">
Typ:
</td>
<td>
<obout1:OboutTextBox runat="server" ID="txtTyp" Width="150" />
</td>
</tr>
<tr>
<td width="120">
Kwota:
</td>
<td>
<obout1:OboutTextBox runat="server" ID="txtKwotaN" Width="150" />
</td>
</tr>
<tr>
<td width="120">
Termin płatności:
</td>
<td>
<obout1:OboutTextBox runat="server" ID="txtTermin" Width="150" />
</td>
<td>
<obout:Calendar ID="Calendar1" runat="server" DatePickerMode="true" DatePickerImagePath="~/Styles/Calendar/icon2.gif"
StyleFolder="~/Styles/Calendar/default"
TextBoxId="txtTermin" CultureName="pl-PL" DateFormat="dd-MM-yyyy">
</obout:Calendar>
</td>
</tr>
<tr>
<td width="120">
Opis:
</td>
<td>
<obout1:OboutTextBox runat="server" ID="txtOpis" Width="150" />
</td>
</tr>
<tr>
<td width="120">
Kwota wpłaty:
</td>
<td>
<obout1:OboutTextBox runat="server" ID="txtKwotaW" Width="150" />
</td>
</tr>
<tr>
<td width="120">
Data wpłaty:
</td>
<td>
<obout1:OboutTextBox runat="server" ID="txtDataW" Width="150" />
</td>
<td>
<obout:Calendar ID="Calendar2" runat="server" DatePickerMode="true" DatePickerImagePath="~/Styles/Calendar/icon2.gif"
StyleFolder="~/Styles/Calendar/default" CultureName="pl-PL" DateFormat="dd-MM-yyyy"
ShowHourSelector="False" ShowMinuteSelector="False" ShowSecondSelector="False"
TextBoxId="txtDataW">
</obout:Calendar>
</td>
</tr>
<tr>
<td width="120">
Opis wpłaty:
</td>
<td>
<obout1:OboutTextBox runat="server" ID="txtOpisW" Width="150" />
</td>
</tr>
<tr>
<td colspan="2">
<br />
</td>
</tr>
</table> </fieldset> </td>
</tr>
<tr>
<td colspan="2" align="center">
<obout1:OboutButton ID="BtnSaveChanges" runat="server" Text="Save" OnClientClick="return saveChanges('BtnSaveChanges')" />
<obout1:OboutButton ID="BtnCancelChanges" runat="server" Text="Cancel" OnClientClick="return cancelChanges('BtnCancelChanges');" />
</td>
</tr>
</table>
<div class="loading-image-container" id="LoadingIndicator" style="display: none;">
<div class="loading-image">
</div>
</div>
</div>
</Template>
</obout2:GridTemplate>
</Templates>
</obout2:Grid>
When i run the code and click the calendar near "txtTermin" the calendar is displayed,but when i change the date in calendar it was not changed in textbox (txtTermin).
But when I replace
<obout1:OboutTextBox runat="server" ID="txtTermin" Width="150" />
with
<asp:TextBox runat="server" ID="txtTermin" Width="150" />
everything is working OK.
Of course the same problem is with txtDataW.
Please help, why calendar doesn't work with OboutTextBox,but works with standard ASP TextBox ? In this example : http://www.obout.com/grid/grid_commands_row_template.aspx it works (Order Date,Required Date..) with OboutTextBox'es.

Resources