Search in sources :

Example 1 with WidgetDefinition

use of org.pentaho.platform.uifoundation.chart.WidgetDefinition in project pentaho-platform by pentaho.

the class WidgetGridComponent method getXmlContent.

@Override
public Document getXmlContent() {
    // get the data to populate the widgets
    IPentahoResultSet resultSet = null;
    if (solution != null) {
        resultSet = getActionData();
    }
    // create the widget to use
    // load the XML document that defines the dial
    Document dialDefinition = null;
    try {
        org.dom4j.io.SAXReader reader = new org.dom4j.io.SAXReader();
        reader.setEntityResolver(new SolutionURIResolver());
        dialDefinition = reader.read(ActionSequenceResource.getInputStream(definitionPath, LocaleHelper.getLocale()));
    } catch (Throwable t) {
    // XML document can't be read. We'll just return a null document.
    }
    // create a dial definition from the XML definition
    WidgetDefinition widgetDefinition = new DialWidgetDefinition(dialDefinition, 0, widgetWidth, widgetHeight, getSession());
    return createDials(resultSet, widgetDefinition);
}
Also used : IPentahoResultSet(org.pentaho.commons.connection.IPentahoResultSet) DialWidgetDefinition(org.pentaho.platform.uifoundation.chart.DialWidgetDefinition) WidgetDefinition(org.pentaho.platform.uifoundation.chart.WidgetDefinition) DialWidgetDefinition(org.pentaho.platform.uifoundation.chart.DialWidgetDefinition) Document(org.dom4j.Document) SolutionURIResolver(org.pentaho.platform.engine.services.SolutionURIResolver)

Aggregations

Document (org.dom4j.Document)1 IPentahoResultSet (org.pentaho.commons.connection.IPentahoResultSet)1 SolutionURIResolver (org.pentaho.platform.engine.services.SolutionURIResolver)1 DialWidgetDefinition (org.pentaho.platform.uifoundation.chart.DialWidgetDefinition)1 WidgetDefinition (org.pentaho.platform.uifoundation.chart.WidgetDefinition)1