私は現在、最初の Jenkins プラグインを開発しています。
Java メソッドを介して入力されるジョブ ページにドロップダウン メニューが必要ですが、ゼリーと Java ファイルが正しく連携していないようです。
ジョブメイン.ゼリー
<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">
<h2>FooBar</h2>
<f:entry field="selection" title="Choose">
<f:select />
</f:entry>
</j:jelly>
JavaClass.java
public class JavaClass implements Action {
private AbstractProject ap;
public JavaClass(AbstractProject ap) {
this.ap = ap;
}
public String getIconFileName() {
return null;
}
public String getDisplayName() {
return "";
}
public String getUrlName() {
return "something";
}
@Extension
public static final class DescriptorImpl extends TransientProjectActionFactory {
String selection;
public DescriptorImpl() throws IOException {
}
@DataBoundConstructor
public DescriptorImpl(String selection) {
this.selection = selection;
}
public ListBoxModel doFillSelectionItems() throws IOException {
ListBoxModel model = new ListBoxModel();
model.add("test");
return model;
}
@Override
public Collection<? extends Action> createFor(AbstractProject target) {
return Arrays.asList(new JavaClass(target));
}
}
}
これを実行すると、求人ページに空のドロップダウンが表示されます。私は何が間違っているのでしょうか?