JFree_ChartComponent.xaction 5.31 KB
Newer Older
Thitichaipun Wutthisak committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146
<?xml version="1.0" encoding="UTF-8"?>
<action-sequence> 
  <name>JFree_ChartComponent.xaction</name>
  <title>%title</title>
  <version>1</version>
  <logging-level>DEBUG</logging-level>
  <documentation> 
    <author>Michael D'Amour</author>  
    <description>%description</description>  
    <icon>JFree_ChartComponent.png</icon>  
    <help>Help</help>  
    <result-type>rule</result-type> 
  </documentation>

  <inputs> 
    <chart-type type="string"> 
      <default-value>.png</default-value>  
      <sources> 
        <request>type</request> 
      </sources> 
    </chart-type>  
    <report-type type="string"> 
      <default-value>pdf</default-value>  
      <sources> 
        <request>type</request> 
      </sources> 
    </report-type> 
  </inputs>

  <resources> 
    <!-- use this section to identify any files that the component needs to execute the report -->  
    <report-definition> 
      <solution-file> 
        <location>JFree_ChartComponent.xml</location>  
        <mime-type>text/xml</mime-type> 
      </solution-file> 
    </report-definition> 
  </resources>
  
  <actions> 
    <action-definition> 
      <component-name>SQLLookupRule</component-name>
      <action-type>Query For Chart Data</action-type>
      <action-outputs> 
        <query-result type="result-set" mapping="chartData"/> 
      </action-outputs>
      <component-definition> 
        <source>sql</source>  
        <live>true</live>  
        <jndi>SampleData</jndi>  
        <query> <![CDATA[select   QUADRANT_ACTUALS.REGION,   QUADRANT_ACTUALS.DEPARTMENT,   QUADRANT_ACTUALS.POSITIONTITLE,   QUADRANT_ACTUALS.ACTUAL,   QUADRANT_ACTUALS.BUDGET from QUADRANT_ACTUALS order by QUADRANT_ACTUALS.REGION, QUADRANT_ACTUALS.DEPARTMENT]]> </query> 
      </component-definition> 
    </action-definition>
  
    <action-definition> 
      <component-name>ChartComponent</component-name>
      <action-type>Create The Chart</action-type>
      <action-inputs> 
        <output-type type="string" mapping="chart-type"/>  
        <chart-data type="result-set" mapping="chartData"/> 
      </action-inputs>
      <action-outputs> 
        <chart-filename type="string"/>  
        <base-url type="string"/> 
      </action-outputs>
      <component-definition> 
        <by-row>false</by-row>  
        <height>300</height>  
        <width>600</width>  
        <title>Actual vs Budget by Region</title>  
        <chart-attributes> 
          <!--  this is the background for the whole image -->  
          <!--  TODO support gradient and texture painting -->  
          <chart-type>PieChart</chart-type>  
          <title-position>TOP</title-position>  
          <height></height>  
          <width></width>  
          <title></title>  
          <title-font> 
            <font-family>Serif</font-family>  
            <size>36</size>  
            <is-bold>false</is-bold>  
            <is-italic>false</is-italic> 
          </title-font>  
          <range-title>US Dollars</range-title>  
          <chart-background type="color">#FFFFFF</chart-background>  
          <plot-background type="color">#FF0000</plot-background>  
          <orientation>horizontal</orientation>  
          <is-3D>true</is-3D>  
          <is-stacked>false</is-stacked>  
          <category-label-rotation>90</category-label-rotation>  
          <border-visible>false</border-visible>  
          <border-paint>#3399FF</border-paint>  
          <include-legend>true</include-legend> 
        </chart-attributes> 
      </component-definition> 
    </action-definition>
  
    <action-definition> 
      <component-name>JavascriptRule</component-name>
      <action-type>Get The Chart URL</action-type>
      <action-inputs> 
        <CHARTOUTPUT type="string" mapping="chart-filename"/>  
        <BASEURL type="string" mapping="base-url"/> 
      </action-inputs>
      <action-outputs> 
        <chart_url type="string"/> 
      </action-outputs>
      <component-definition> 
        <script> <![CDATA[ 
			      function getImageURL( fileName ) {
			        return BASEURL + "getImage?image=" + fileName;
			      }
			    getImageURL( CHARTOUTPUT ); 
		      ]]> </script> 
      </component-definition> 
    </action-definition>
  
    <action-definition>
      <component-name>SQLLookupRule</component-name>
      <action-type>Query For Report Data</action-type>
      <action-outputs>
        <query-result type="result-set" mapping="reportData"/>
      </action-outputs>
      <component-definition>
        <jndi>SampleData</jndi>
        <query><![CDATA[select   QUADRANT_ACTUALS.REGION,   QUADRANT_ACTUALS.DEPARTMENT,   QUADRANT_ACTUALS.POSITIONTITLE,   QUADRANT_ACTUALS.ACTUAL,   QUADRANT_ACTUALS.BUDGET,   QUADRANT_ACTUALS.VARIANCE  from QUADRANT_ACTUALS order by QUADRANT_ACTUALS.REGION, QUADRANT_ACTUALS.DEPARTMENT]]></query>
        <live>true</live>
      </component-definition>
    </action-definition>

    <action-definition>
      <component-name>JFreeReportComponent</component-name>
      <action-type>Create The Pentaho Report</action-type>
      <action-inputs>
        <data type="result-set" mapping="reportData"/>
        <output-type type="string" mapping="report-type"/>
        <chart_url type="string"/>
      </action-inputs>
      <action-resources>
        <report-definition type="resource"/>
      </action-resources>
      <component-definition/>
    </action-definition>
  </actions> 
</action-sequence>