hi,
I want to read value forom job configuration page and display it on main project page (jobMain.jelly). On jenkins mailing list i found something like that to read value from config page:
public class ApplicationLinkJobProperty extends JobProperty<AbstractProject<?,?>> {
public final String applicationLink;
@DataBoundConstructor
public ApplicationLinkJobProperty(String applicationLink) {
this.applicationLink = applicationLink;
}
@Extension
public static class DescriptorImpl extends JobPropertyDescriptor
{
@Override
public String getDisplayName() {
return "Application Link";
}
@Override
public boolean isApplicable(java.lang.Class<? extends Job> jobType) {
return AbstractProject.class.isAssignableFrom(jobType);
}
}
}
And config.jelly:
<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:entry title="Application Link" field="applicationLink">
<f:textbox />
</f:entry>
</j:jelly>
i was trying to display it in my jobMain.jelly on different way, for example:
<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">
There:
${instance.applicationLink}
${it.applicationLink}
${it.getApplicationLink(job)}
</j:jelly>
I have appropriate class that implements Action for jobMain.jelly. Of course I have those two jelly file in different folders.
Any help will be greatly appreciated.