HQU Scaffolding
Creating a basic plugin for HQU can be easily done with the scaffolding. It creates a complete plugin directory structure which can be edited and deployed immediately.
Before using the scaffolding, complete the following prerequisites:
- Hyperic HQ (3.1 or greater) must be installed and running
- Your JBOSS_HOME environment variable must point at your JBoss home directory (for example export JBOSS_HOME=/home/hyperic/server-3.2.2/hq-engine)
As an example, we'll create a plugin called 'cool' .. which maybe manages our freezers.
To create the basic plugin layout, execute:
cd hq ant clean all ant hqu-gen-scaffold -Dplugin=cool -Dcontroller=Freezer -DcontrollerDir=freezer
The location of your newly created plugin will be in ui_plugins/cool
If you'd like to see your new plugin in action, simply execute:
ant hqu-redeploy-plugin -Dplugin=cool
Point your web-browser at http://localhost:7080/hqu/cool/freezer/index.hqu and you should see your new plugin.
Files Created
Under the covers, this command creates all files necessary to run a plugin in ./ui_plugins/cool/
Plugin.groovy plugin.properties app/FreezerController.groovy views/freezer/index.gsp etc/cool_i18n.properties
Comments ( Hide )
|
|
Mirko Pluhar says:Apr 20, 2008 08:48 ( Permalink ) |
ant hqu-gen-scaffold -Dplugin=mailcheck -Dcontroller=Mailcheck -DcontrollerDir=mailer
causes me some trouble:
javax.servlet.ServletException: java.lang.Exception: Invalid request path
org.hyperic.hq.ui.servlet.RenditServlet.handleRequest(RenditServlet.java:195)
org.hyperic.hq.ui.servlet.RenditServlet.doGet(RenditServlet.java:61)
javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
org.hyperic.hq.ui.RenditFilter.doFilter(RenditFilter.java:60)
org.hyperic.hq.ui.AuthenticationFilter.doFilter(AuthenticationFilter.java:151)
org.hyperic.hibernate.filter.SessionFilter$1.run(SessionFilter.java:59)
org.hyperic.hq.hibernate.SessionManager.runInSessionInternal(SessionManager.java:79)
org.hyperic.hq.hibernate.SessionManager.runInSession(SessionManager.java:68)
org.hyperic.hibernate.filter.SessionFilter.doFilter(SessionFilter.java:57)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
org.hyperic.hq.product.servlet.filter.JMXFilter.doFilter(JMXFilter.java:324)
Obviously "-DcontrollerDir=mailer" is the reason. Looks like "mailer" is already specified somewhere else and you can't define it here again.