Sorry if the title doesn't make sense. To elaborate, I have tried replicating the scripting functions example to create documentation for my scripting functions through annotations, but it's not working as I'd expect it to. The tooltip for system.kpi.create just says "No return value" and the description is null.
In my common scripting folder I have:
public abstract class AbstractScriptApi<T extends Model> implements ScriptApi<T> {
public AbstractScriptApi() {
BundleUtil.get().addBundle("AbstractScriptApi", AbstractScriptApi.class.getClassLoader(), "AbstractScriptApi");
}
@Override
@ScriptFunction(docBundlePrefix = "AbstractScriptApi")
public T create() {
return createImpl();
}
protected abstract T createImpl();
}
and AbstractScriptApi.properties in the respective resources folder:
create.desc = test description.
create.returns = test return.
Then in client, AbstractClientScriptApi extends AbstractScriptApi, and KPIClientScriptApi extends AbstractClientScriptApi :
public abstract class AbstractClientScriptApi<T extends Model> extends AbstractScriptApi<T> implements ScriptApi<T> {
private final Class<? extends ScriptApi<T>> type;
protected final RpcProxy rpc;
public AbstractClientScriptApi(Class<? extends ScriptApi<T>> type) {
this.type = type;
//create rpc
BundleUtil.get().addBundle("AbstractClientScriptApi", AbstractClientScriptApi.class.getClassLoader(),"AbstractClientScriptApi");
}
@ScriptFunction(docBundlePrefix = "AbstractClientScriptApi")
public T createImpl() {
//rpc call to gateway
}
}
public class KPIClientScriptApi extends AbstractClientScriptApi<KPI> implements IKPIScriptApi{
public KPIClientScriptApi() {
super(IKPIScriptApi.class);
BundleUtil.get().addBundle("KPIClientScriptApi", getClass(),"KPIClientScriptApi");
}
}
I have similar structure for the respective gateway classes. In the client and designer hooks I have:
@Override
public void initializeScriptManager(ScriptManager manager) {
super.initializeScriptManager(manager);
manager.addScriptModule("system.kpi", injector.getInstance(KPIClientScriptApi.class), new PropertiesFileDocProvider());
}
And I have a similar initialization in the gateway hook for the respective gateway KPI class.
I will eventually have many classes that extend AbstractClientScriptApi which will have many more methods, so it would be nice to only have to put documentation in one place.
I've been on this for a while, so any help would be appreciated.