|
addingWebInterface
Adding a Web InterfaceMost modules will have a web interface. To keep it closely integrated to the general Clusterfest web app, the WebModule API is provided. You can see how this was implemented in the Monitor module. There are two ways of adding HTML code to the main page:
String getModuleHTML(); String getNodeHTML(Node node, int nodeNum); You can then register actions for the module with this method: List<String> getActions(); If you return a list containing "TheAction" and there is a request of index.jsp?action=TheAction the following method will be called in your module String action(String action, HttpServletRequest request); There are also two ways of adding new pages to the webapp:
void setup(WebServer server); PagesPages are rendered through velocity. If you want to add more pages and want to keep the style and coherence with the rest of the clustering webapp, you should include this at the top of your velocity files #set($pageTitle = "your page title")
#parse("include.top.vm")and this at the bottom #parse("include.bottom.vm")Here is an example of monitor node page. |
Sign in to add a comment
