Class 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.

    1. 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.
    2. 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.
    3. It uses the JFreeChartEngine to create an image of the dial.
    4. Once the image has been created this class creates an XML document describing the dial
    5. It uses an XSL to tranforms the XML description into HTML.
    This is an example image
    See Also:
    Serialized Form
    • 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 supported
        definitionPath - The path and name of the XML definition of the dial
        width - The width of the image to be created
        height - The height of the image to be created
        urlFactory - The urlFactory for the content
        messages - 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 class BaseUIComponent
        Returns:
        logger This component's logger
      • validate

        public boolean validate()
        Validate that this component can generate the requested dial
        Specified by:
        validate in interface org.pentaho.platform.api.ui.IUIComponent
        Specified by:
        validate in class BaseUIComponent
      • 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 interface org.pentaho.platform.api.ui.IXMLComponent
        Specified by:
        getXmlContent in class XmlComponent
        Returns:
        The XML document describing this dial
      • dispose

        public void dispose()