Ok,
next problem/question: how does one add custom properties to a new plugin? For my event queue tracking plugin I need properties such as the MQ host, channel, port, queue manager and queue(s). Currently I have a hq-plugin.xml containing the following:
<plugin>
<service name="Websphere Event Queue Tracking">
<plugin type="event_queue_track"
class="org.hyperic.hq.product.EventQueueTrackPlugin"/>
<config name="eventqueues" type="global">
<option name="event.queue.track.host"
description="The MQ host machine"/>
<option name="event.queue.track.channel"
description="The MQ channel"/>
<option name="event.queue.track.port"
description="The MQ port"/>
<option name="event.queue.track.queuemanager"
description="The name of the queue manager"/>
<option name="event.queue.track.queue"
description="A comma-separated list of event queues you want to track"/>
</config>
</service>
<help name="Websphere Event Queue Tracking">
<![CDATA[
<p>
Some help information.
</p>
]]>
</help>
</plugin>
Looking at other plugins I think the idea is to override getConfigSchema so in my actual plugin class I have the following bit of code:
public ConfigSchema getConfigSchema(TypeInfo info, ConfigResponse config) {
log.info("Building config schema for EventQueueTrackPlugin");
ConfigSchema schema = super.getConfigSchema(info, config);
if (schema.getOptions().size() > 0) {
return schema; // from hq-plugin.xml
}
SchemaBuilder builder = new SchemaBuilder(config);
builder.add(PROP_HOST, "Websphere MQ host", "host");
builder.add(PROP_CHANNEL, "Websphere MQ channel", "channel");
builder.add(PROP_PORT, "Websphere MQ port", "port");
builder.add(PROP_QUEUEMANAGER, "Websphere MQ queue manager", "manager");
builder.add(PROP_QUEUE, "Websphere MQ event queue(s)", "eventqueue");
return builder.getSchema();
}
But this apparently isn't enough. I can deploy my plugin, register a new service of its type in the UI but I don't get to see my custom properties.
Any help?