getUrlName() can return existing links or do the mapping of given object to
URL, see Action javadoc [1] for details.
Probably the most easy way how to display something is e.g. this:
@Extension
public class DataPlotRoot implements RootAction {
public String getIconFileName() {
return "/plugin/data-processing-plugin/img/x-office-presentation.png";
}
public String getDisplayName() {
return "Data processing";
}
public String getUrlName() {
return "data-processing";
}
}
and in put into (applies for plugin org.jenkinsci.plugins.dataprocessing)
src/main/resources/org/jenkinsci/plugins/dataprocessing/DataPlotRoot/
file called index.jelly
Content of this file will be shown when you click the link.
[1] http://javadoc.jenkins-ci.org/hudson/model/Action.html#getUrlName()
On Friday 20 April 2012 04:29:53 MaxiTrompe wrote:
Yes, this is what I have already done: I have a class RootAction that return a
url for a new page, but when I click on it, I have the following error
404 Not Found
Stapler processed this HTTP request as follows, but couldn't find the resource
to consume the request
-> evaluate(<hudson.model.Hudson@1299db6> :hudson.model.Hudson,"/dummyurl")
->
evaluate(((StaplerProxy)<hudson.model.Hudson@1299db6>).getTarget(),"/dummyurl")
-> evaluate(<hudson.model.Hudson@1299db6>.getDynamic("dummyurl",...),"")
-> evaluate(<hudson.plugins.sidebar_link.LinkAction@ebb788>
:hudson.plugins.sidebar_link.LinkAction,"")
-> No matching rule was found on
<hudson.plugins.sidebar_link.LinkAction@ebb788> for ""
<hudson.plugins.sidebar_link.LinkAction@ebb788> has the following URL
mappings, in the order of preference:
TOKEN.groovy for url=/TOKEN/...
VIEW.jelly for url=/VIEW
hudson.plugins.sidebar_link.LinkAction.getIconFileName() for
url=/iconFileName/...
hudson.plugins.sidebar_link.LinkAction.getUrlName() for url=/urlName/...
hudson.plugins.sidebar_link.LinkAction.getDisplayName() for
url=/displayName/...
java.lang.Object.getClass() for url=/class/...