我开发了一个自定义字段,xml是:
<customfield-type key="mailru-select" name="An easily filled select list" class="ru.mail.plugins.ms.MailSelectCF">
<description>An easily filled select list.</description>
<resource type="velocity" name="view" location="templates/view-mailselect.vm"/>
<resource type="velocity" name="column-view" location="templates/view-mailselect.vm">
<params key = "<strong>actionName</strong>" value="abcde">
</resource>
<resource type="velocity" name="xml" location="templates/view-mailselect.vm"/>
<resource type="velocity" name="edit" location="templates/edit-mailselect.vm"/>
getVelocityParameters 函数是:
public Map<String, Object> getVelocityParameters(Issue issue,
CustomField field, FieldLayoutItem fieldLayoutItem) {
// how to get the actionName
Map<String, Object> params = super.getVelocityParameters(issue, field,
fieldLayoutItem);
long a = System.currentTimeMillis();
Set<String> cfVals;
if (field.isGlobal()) {
cfVals = msMgr.getValues(Consts.GROBAL_CF_PROJ, field.getId());
} else {
if (issue == null || issue.getProjectObject() == null) {
return params;
}
cfVals = msMgr.getValues(issue.getProjectObject().getKey(),
field.getId());
}
params.put("selectVal", issue.getCustomFieldValue(field));
params.put("cfVals", cfVals);
return params;
}
如何在函数 getVelocityParameters 上获取 actionName