Class DashboardWidgetComponent
- java.lang.Object
-
- org.pentaho.platform.engine.core.system.PentahoBase
-
- org.pentaho.platform.engine.services.PentahoMessenger
-
- org.pentaho.platform.uifoundation.component.BaseUIComponent
-
- org.pentaho.platform.uifoundation.component.xml.XmlComponent
-
- org.pentaho.platform.uifoundation.chart.DashboardWidgetComponent
-
- All Implemented Interfaces:
Serializable
,org.pentaho.platform.api.engine.ILogger
,org.pentaho.platform.api.ui.IUIComponent
,org.pentaho.platform.api.ui.IXMLComponent
public class DashboardWidgetComponent extends XmlComponent
This class is a Hitachi Vantara user interface component. It generates dial images that can be embedded into JSPs, portals or other HTML supporting user interface.- The creating object sets the width, height, the type of the dial, and the name of the dial.xml file that contains the definition of the dial.
- This class creates an instance of a DialWidgetDefinition using the specified XML definition file. The XML files are located in the solution folders and have .dial.xml extenstions. The dial XML files define the attributes that define how the dial looks.
- It uses the JFreeChartEngine to create an image of the dial.
- Once the image has been created this class creates an XML document describing the dial
- It uses an XSL to tranforms the XML description into HTML.
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static int
TYPE_DIAL
static int
TYPE_THERMOMETER
-
Fields inherited from class org.pentaho.platform.uifoundation.component.BaseUIComponent
contentTypes, debug, urlFactory, xslProperties
-
Fields inherited from class org.pentaho.platform.engine.core.system.PentahoBase
EMPTYLOGID, loggingLevel, LOGID_MASK1, LOGID_MASK2, LOGID_SEPARATOR
-
-
Constructor Summary
Constructors Constructor Description DashboardWidgetComponent(int type, String definitionPath, int width, int height, org.pentaho.platform.api.engine.IPentahoUrlFactory urlFactory, List messages)
Creates a DashboardWidgetComponent.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
dispose()
org.apache.commons.logging.Log
getLogger()
Gets the logger for his component.org.dom4j.Document
getXmlContent()
Create a dial image.void
setTitle(String title)
Sets the title for the dialvoid
setUnits(String units)
Sets the unit for the dial valuevoid
setValue(double value)
Sets the value to be displayed by the dial.boolean
validate()
Validate that this component can generate the requested dial-
Methods inherited from class org.pentaho.platform.uifoundation.component.xml.XmlComponent
getContent
-
Methods inherited from class org.pentaho.platform.uifoundation.component.BaseUIComponent
done, getObjectParameter, getParameter, getParameterAsArray, getParameterProviders, getRequestHandler, getSession, getSourcePath, getUrlFactory, getXsl, getXslProperties, handleRequest, setParameterProvider, setParameterProviders, setRequestHandler, setSourcePath, setUrlFactory, setXsl, setXslProperty, validate
-
Methods inherited from class org.pentaho.platform.engine.services.PentahoMessenger
debug, debug, error, error, error, fatal, fatal, getMessages, getUserString, info, info, setMessages, trace, trace, warn, warn
-
Methods inherited from class org.pentaho.platform.engine.core.system.PentahoBase
genLogIdFromInfo, genLogIdFromInfo, genLogIdFromSession, getLoggingLevel, getLogId, getObjectName, setLoggingLevel, setLogId
-
-
-
-
Field Detail
-
TYPE_DIAL
public static final int TYPE_DIAL
- See Also:
- Constant Field Values
-
TYPE_THERMOMETER
public static final int TYPE_THERMOMETER
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
DashboardWidgetComponent
public DashboardWidgetComponent(int type, String definitionPath, int width, int height, org.pentaho.platform.api.engine.IPentahoUrlFactory urlFactory, List messages)
Creates a DashboardWidgetComponent.After creating an instance of this class
validate
should be called.- Parameters:
type
- The type of the widget, currently only TYPE_DIAL is supporteddefinitionPath
- The path and name of the XML definition of the dialwidth
- The width of the image to be createdheight
- The height of the image to be createdurlFactory
- The urlFactory for the contentmessages
- The messages list for any logger messages
-
-
Method Detail
-
setValue
public void setValue(double value)
Sets the value to be displayed by the dial.- Parameters:
value
- The dial value
-
setTitle
public void setTitle(String title)
Sets the title for the dial- Parameters:
title
- The title of the dial
-
setUnits
public void setUnits(String units)
Sets the unit for the dial value- Parameters:
units
- The dial units
-
getLogger
public org.apache.commons.logging.Log getLogger()
Gets the logger for his component.- Specified by:
getLogger
in classBaseUIComponent
- Returns:
- logger This component's logger
-
validate
public boolean validate()
Validate that this component can generate the requested dial- Specified by:
validate
in interfaceorg.pentaho.platform.api.ui.IUIComponent
- Specified by:
validate
in classBaseUIComponent
-
getXmlContent
public org.dom4j.Document getXmlContent()
Create a dial image.- Load the specified XML document describing the dial definition
- Create a dial definition object from the XML definition
- Use the JFreeChartEngine to create a dial image
- Create an XML document describing the dial
- Return the XML document
- Specified by:
getXmlContent
in interfaceorg.pentaho.platform.api.ui.IXMLComponent
- Specified by:
getXmlContent
in classXmlComponent
- Returns:
- The XML document describing this dial
-
dispose
public void dispose()
-
-