UI-Portlet-Plugins

Heiko W.Rupp hrupp at redhat.com
Sat Feb 8 18:43:48 UTC 2014


Hey,

after talking with Tristan Tarrant from Infinispan I got the idea, that we could create a generic Portlet, that
gets its content data as HTML from a server plugin. The server plugin then has access to all the server logic
to do its task and can e.g. compute various stats of an Infinispan cluster.

The following drawing illustrates that idea:

-------------- next part --------------
A non-text attachment was scrubbed...
Name: UI-Plugins.png
Type: image/png
Size: 22459 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/rhq-devel/attachments/20140208/54c17c55/attachment-0003.png>
-------------- next part --------------


Instances of the portlet will call to the selected server plugin and invoking a well known "interface" like "getMessage".
This message will then do the processing and return a HTML-snippet (not a full page), which is then displayed
inside the portlet window.

Attached are two screen shots from such a portlet + some PoC code.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: Bildschirmfoto 2014-02-08 um 19.35.01.png
Type: image/png
Size: 18198 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/rhq-devel/attachments/20140208/54c17c55/attachment-0004.png>
-------------- next part --------------


This is created in the backend via (abbreviated)

complexResults.put(new PropertySimple("results", "<h1>Hello World</h1>Welcome to RHQ<br/>Have FUN<br/>Current date: " + date));

This is the "generic" config screen:

-------------- next part --------------
A non-text attachment was scrubbed...
Name: Bildschirmfoto 2014-02-08 um 19.35.11.png
Type: image/png
Size: 17294 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/rhq-devel/attachments/20140208/54c17c55/attachment-0005.png>
-------------- next part --------------


The drop down shows the list of plugins available.

In this PoC, the plugin writer is responsible for creating sane HTML,
if we decided to put that into RHQ, we may want to do some additional
sanitation. I also have no idea about styling the inner content.

While this is probably not the way for the (long term) future, at least
the backend plugins can be re-used if we move to an Angular-based UI,
so this investment would not be lost.

  Heiko

-------------- next part --------------
A non-text attachment was scrubbed...
Name: ui-plugin.diff.zip
Type: application/zip
Size: 10367 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/rhq-devel/attachments/20140208/54c17c55/attachment-0001.zip>
-------------- next part --------------





More information about the rhq-devel mailing list