// TODO: It will be good to remove MessageFormat usage here and pass the required information
// to the dashboard - rk
public int doStartTag() throws JspException{
HttpServletRequest request = (HttpServletRequest)pageContext.getRequest();
WebContext context = null;
try{
context = WebContext.get(request);
ApplicationConfig appConfig = context.getApplicationConfig();
// Graphs at cluster level are not supported yet
assert !appConfig.isCluster();
String dashboardId = request.getParameter("dashBID");
DashboardConfig currentDashboardConfig = DashboardRepository.getInstance().get(dashboardId);
assert currentDashboardConfig != null : "Error retrieving dashboard details";
DashboardComponent component =
currentDashboardConfig.getComponents().get(getId());
String componentDisplay = component.draw(new DashboardContextImpl(context, currentDashboardConfig,
(HttpServletRequest)pageContext.getRequest()));
componentDisplay = MessageFormat.format(componentDisplay, getWidth(),
getHeight(), Utils.getCookieValue(request, "JSESSIONID"));
pageContext.getOut().println(componentDisplay);
}catch(Throwable e){
logger.log(Level.SEVERE, "Error displaying component", e);
}finally{
if(context != null)
context.releaseResources();
}
return SKIP_BODY;
}