<?xml version="1.0" encoding="UTF-8"?>
<action-sequence> 
  <name>Sales_by_Supplier.xaction</name>
  <title>%title</title>
  <version>1</version>
  <logging-level>ERROR</logging-level>
  <documentation> 
    <author>Kurtis Cruzada</author>  
    <description>%description</description>  
    <icon>salerep.png</icon>  
    <help/>  
    <result-type>report</result-type> 
  </documentation>

  <inputs> 
    <output-type type="string"> 
      <default-value>pdf</default-value>  
      <sources> 
        <request>type</request> 
      </sources> 
    </output-type>  
    <time_stop type="string"> 
      <sources> 
        <request>time_stop</request> 
      </sources>  
      <default-value>2005-06-01</default-value> 
    </time_stop>  
    <time_stop_list type="property-map-list"> 
      <sources> 
        <request>time_stop_list</request> 
      </sources>  
      <default-value type="property-map-list"> 
        <property-map> 
          <entry key="TIME_ID">2003-02-01</entry>  
          <entry key="TIME_STOP_DESC">Jan 31 2003</entry> 
        </property-map>  
        <property-map> 
          <entry key="TIME_ID">2003-03-01</entry>  
          <entry key="TIME_STOP_DESC">Feb 28 2003</entry> 
        </property-map>  
        <property-map> 
          <entry key="TIME_ID">2003-04-01</entry>  
          <entry key="TIME_STOP_DESC">Mar 31 2003</entry> 
        </property-map>  
        <property-map> 
          <entry key="TIME_ID">2003-05-01</entry>  
          <entry key="TIME_STOP_DESC">Apr 30 2003</entry> 
        </property-map>  
        <property-map> 
          <entry key="TIME_ID">2003-06-01</entry>  
          <entry key="TIME_STOP_DESC">May 31 2003</entry> 
        </property-map>  
        <property-map> 
          <entry key="TIME_ID">2003-07-01</entry>  
          <entry key="TIME_STOP_DESC">June 30 2003</entry> 
        </property-map>  
        <property-map> 
          <entry key="TIME_ID">2003-08-01</entry>  
          <entry key="TIME_STOP_DESC">July 31 2003</entry> 
        </property-map>  
        <property-map> 
          <entry key="TIME_ID">2003-09-01</entry>  
          <entry key="TIME_STOP_DESC">Aug 31 2003</entry> 
        </property-map>  
        <property-map> 
          <entry key="TIME_ID">2003-10-01</entry>  
          <entry key="TIME_STOP_DESC">Sep 30 2003</entry> 
        </property-map>  
        <property-map> 
          <entry key="TIME_ID">2003-11-01</entry>  
          <entry key="TIME_STOP_DESC">Oct 31 2003</entry> 
        </property-map>  
        <property-map> 
          <entry key="TIME_ID">2003-12-01</entry>  
          <entry key="TIME_STOP_DESC">Nov 30 2003</entry> 
        </property-map>  
        <property-map> 
          <entry key="TIME_ID">2004-01-01</entry>  
          <entry key="TIME_STOP_DESC">Dec 31 2003</entry> 
        </property-map>  
        <property-map> 
          <entry key="TIME_ID">2004-02-01</entry>  
          <entry key="TIME_STOP_DESC">Jan 31 2004</entry> 
        </property-map>  
        <property-map> 
          <entry key="TIME_ID">2004-03-01</entry>  
          <entry key="TIME_STOP_DESC">Feb 29 2004</entry> 
        </property-map>  
        <property-map> 
          <entry key="TIME_ID">2004-04-01</entry>  
          <entry key="TIME_STOP_DESC">Mar 31 2004</entry> 
        </property-map>  
        <property-map> 
          <entry key="TIME_ID">2004-05-01</entry>  
          <entry key="TIME_STOP_DESC">Apr 30 2004</entry> 
        </property-map>  
        <property-map> 
          <entry key="TIME_ID">2004-06-01</entry>  
          <entry key="TIME_STOP_DESC">May 31 2004</entry> 
        </property-map>  
        <property-map> 
          <entry key="TIME_ID">2004-07-01</entry>  
          <entry key="TIME_STOP_DESC">Jun 30 2004</entry> 
        </property-map>  
        <property-map> 
          <entry key="TIME_ID">2004-08-01</entry>  
          <entry key="TIME_STOP_DESC">Jul 31 2004</entry> 
        </property-map>  
        <property-map> 
          <entry key="TIME_ID">2004-09-01</entry>  
          <entry key="TIME_STOP_DESC">Aug 31 2004</entry> 
        </property-map>  
        <property-map> 
          <entry key="TIME_ID">2004-10-01</entry>  
          <entry key="TIME_STOP_DESC">Sep 30 2004</entry> 
        </property-map>  
        <property-map> 
          <entry key="TIME_ID">2004-11-01</entry>  
          <entry key="TIME_STOP_DESC">Oct 31 2004</entry> 
        </property-map>  
        <property-map> 
          <entry key="TIME_ID">2004-12-01</entry>  
          <entry key="TIME_STOP_DESC">Nov 30 2004</entry> 
        </property-map>  
        <property-map> 
          <entry key="TIME_ID">2005-01-01</entry>  
          <entry key="TIME_STOP_DESC">Dec 31 2004</entry> 
        </property-map>  
        <property-map> 
          <entry key="TIME_ID">2005-02-01</entry>  
          <entry key="TIME_STOP_DESC">Jan 31 2005</entry> 
        </property-map>  
        <property-map> 
          <entry key="TIME_ID">2005-03-01</entry>  
          <entry key="TIME_STOP_DESC">Feb 28 2005</entry> 
        </property-map>  
        <property-map> 
          <entry key="TIME_ID">2005-04-01</entry>  
          <entry key="TIME_STOP_DESC">Mar 31 2005</entry> 
        </property-map>  
        <property-map> 
          <entry key="TIME_ID">2005-05-01</entry>  
          <entry key="TIME_STOP_DESC">Apr 30 2005</entry> 
        </property-map>  
        <property-map> 
          <entry key="TIME_ID">2005-06-01</entry>  
          <entry key="TIME_STOP_DESC">May 31 2005</entry> 
        </property-map>  
        <property-map> 
          <entry key="TIME_ID">2005-07-01</entry>  
          <entry key="TIME_STOP_DESC">Jun 30 2005</entry> 
        </property-map>  
        <property-map> 
          <entry key="TIME_ID">2005-08-01</entry>  
          <entry key="TIME_STOP_DESC">Jul 31 2005</entry> 
        </property-map> 
      </default-value> 
    </time_stop_list>  
    <time_start type="string"> 
      <sources> 
        <request>time_start</request> 
      </sources>  
      <default-value>2005-01-01</default-value> 
    </time_start>  
    <time_start_list type="property-map-list"> 
      <sources> 
        <request>time_start_list</request> 
      </sources>  
      <default-value type="property-map-list"> 
        <property-map> 
          <entry key="TIME_ID">2003-01-01</entry>  
          <entry key="TIME_START_DESC">Jan 01 2003</entry> 
        </property-map>  
        <property-map> 
          <entry key="TIME_ID">2003-02-01</entry>  
          <entry key="TIME_START_DESC">Feb 01 2003</entry> 
        </property-map>  
        <property-map> 
          <entry key="TIME_ID">2003-03-01</entry>  
          <entry key="TIME_START_DESC">Mar 01 2003</entry> 
        </property-map>  
        <property-map> 
          <entry key="TIME_ID">2003-04-01</entry>  
          <entry key="TIME_START_DESC">Apr 01 2003</entry> 
        </property-map>  
        <property-map> 
          <entry key="TIME_ID">2003-05-01</entry>  
          <entry key="TIME_START_DESC">May 01 2003</entry> 
        </property-map>  
        <property-map> 
          <entry key="TIME_ID">2003-06-01</entry>  
          <entry key="TIME_START_DESC">June 01 2003</entry> 
        </property-map>  
        <property-map> 
          <entry key="TIME_ID">2003-07-01</entry>  
          <entry key="TIME_START_DESC">July 01 2003</entry> 
        </property-map>  
        <property-map> 
          <entry key="TIME_ID">2003-08-01</entry>  
          <entry key="TIME_START_DESC">Aug 01 2003</entry> 
        </property-map>  
        <property-map> 
          <entry key="TIME_ID">2003-09-01</entry>  
          <entry key="TIME_START_DESC">Sep 01 2003</entry> 
        </property-map>  
        <property-map> 
          <entry key="TIME_ID">2003-10-01</entry>  
          <entry key="TIME_START_DESC">Oct 01 2003</entry> 
        </property-map>  
        <property-map> 
          <entry key="TIME_ID">2003-11-01</entry>  
          <entry key="TIME_START_DESC">Nov 01 2003</entry> 
        </property-map>  
        <property-map> 
          <entry key="TIME_ID">2003-12-01</entry>  
          <entry key="TIME_START_DESC">Dec 01 2003</entry> 
        </property-map>  
        <property-map> 
          <entry key="TIME_ID">2004-01-01</entry>  
          <entry key="TIME_START_DESC">Jan 01 2004</entry> 
        </property-map>  
        <property-map> 
          <entry key="TIME_ID">2004-02-01</entry>  
          <entry key="TIME_START_DESC">Feb 01 2004</entry> 
        </property-map>  
        <property-map> 
          <entry key="TIME_ID">2004-03-01</entry>  
          <entry key="TIME_START_DESC">Mar 01 2004</entry> 
        </property-map>  
        <property-map> 
          <entry key="TIME_ID">2004-04-01</entry>  
          <entry key="TIME_START_DESC">Apr 01 2004</entry> 
        </property-map>  
        <property-map> 
          <entry key="TIME_ID">2004-05-01</entry>  
          <entry key="TIME_START_DESC">May 01 2004</entry> 
        </property-map>  
        <property-map> 
          <entry key="TIME_ID">2004-06-01</entry>  
          <entry key="TIME_START_DESC">Jun 01 2004</entry> 
        </property-map>  
        <property-map> 
          <entry key="TIME_ID">2004-07-01</entry>  
          <entry key="TIME_START_DESC">Jul 01 2004</entry> 
        </property-map>  
        <property-map> 
          <entry key="TIME_ID">2004-08-01</entry>  
          <entry key="TIME_START_DESC">Aug 01 2004</entry> 
        </property-map>  
        <property-map> 
          <entry key="TIME_ID">2004-09-01</entry>  
          <entry key="TIME_START_DESC">Sep 01 2004</entry> 
        </property-map>  
        <property-map> 
          <entry key="TIME_ID">2004-10-01</entry>  
          <entry key="TIME_START_DESC">Oct 01 2004</entry> 
        </property-map>  
        <property-map> 
          <entry key="TIME_ID">2004-11-01</entry>  
          <entry key="TIME_START_DESC">Nov 01 2004</entry> 
        </property-map>  
        <property-map> 
          <entry key="TIME_ID">2004-12-01</entry>  
          <entry key="TIME_START_DESC">Dec 01 2004</entry> 
        </property-map>  
        <property-map> 
          <entry key="TIME_ID">2005-01-01</entry>  
          <entry key="TIME_START_DESC">Jan 01 2005</entry> 
        </property-map>  
        <property-map> 
          <entry key="TIME_ID">2005-02-01</entry>  
          <entry key="TIME_START_DESC">Feb 01 2005</entry> 
        </property-map>  
        <property-map> 
          <entry key="TIME_ID">2005-03-01</entry>  
          <entry key="TIME_START_DESC">Mar 01 2005</entry> 
        </property-map>  
        <property-map> 
          <entry key="TIME_ID">2005-04-01</entry>  
          <entry key="TIME_START_DESC">Apr 01 2005</entry> 
        </property-map>  
        <property-map> 
          <entry key="TIME_ID">2005-05-01</entry>  
          <entry key="TIME_START_DESC">May 01 2005</entry> 
        </property-map>  
        <property-map> 
          <entry key="TIME_ID">2005-06-01</entry>  
          <entry key="TIME_START_DESC">Jun 01 2005</entry> 
        </property-map>  
        <property-map> 
          <entry key="TIME_ID">2005-07-01</entry>  
          <entry key="TIME_START_DESC">Jul 01 2005</entry> 
        </property-map> 
      </default-value> 
    </time_start_list>  
    <output-type-list type="property-map-list"> 
      <sources> 
        <runtime>output-type-list</runtime> 
      </sources>  
      <default-value type="property-map-list"> 
        <property-map> 
          <entry key="report-output-desc">PDF</entry>  
          <entry key="report-output-type-id">pdf</entry> 
        </property-map>  
        <property-map> 
          <entry key="report-output-desc">Excel</entry>  
          <entry key="report-output-type-id">xls</entry> 
        </property-map>  
        <property-map> 
          <entry key="report-output-desc">Web Page</entry>  
          <entry key="report-output-type-id">html</entry> 
        </property-map> 
      </default-value> 
    </output-type-list> 
  </inputs>

  <outputs> 
    <!-- an output stream will be provided by default --> 
  </outputs>

  <resources> 
    <!-- use this section to identify any files that the component needs to execute the report -->  
    <report-definition> 
      <solution-file> 
        <location>Sales_by_Supplier.xml</location>  
        <mime-type>text/xml</mime-type> 
      </solution-file> 
    </report-definition> 
  </resources>
  
  <actions> 
    <action-definition> 
      <component-name>SecureFilterComponent</component-name>
      <action-type>Prompt for Start Time, Stop Time and Report Format</action-type>
      <action-inputs> 
        <time_start type="string"/>  
        <time_start_list type="property-map-list"/>  
        <time_stop type="string"/>  
        <time_stop_list type="property-map-list"/>  
        <output-type type="string"/>  
        <output-type-list type="property-map-list"/> 
      </action-inputs>
      <component-definition> 
        <selections> 
          <time_start style="select"> 
            <title>Start Date</title>  
            <filter value-col-name="TIME_ID" display-col-name="TIME_START_DESC">time_start_list</filter> 
          </time_start>  
          <time_stop style="select"> 
            <title>Stop Date</title>  
            <filter value-col-name="TIME_ID" display-col-name="TIME_STOP_DESC">time_stop_list</filter> 
          </time_stop>  
          <output-type style="radio"> 
            <title>Report Output</title>  
            <filter value-col-name="report-output-type-id" display-col-name="report-output-desc">output-type-list</filter> 
          </output-type> 
        </selections> 
      </component-definition> 
    </action-definition>
  
    <action-definition> 
      <component-name>SQLLookupRule</component-name>
      <action-type>Get Data</action-type>
      <action-inputs> 
        <time_stop type="string"/>  
        <time_start type="string"/> 
      </action-inputs>
      <action-outputs> 
        <query-result type="result-set" mapping="query_result"/> 
      </action-outputs>
      <component-definition> 
        <jndi>SampleData</jndi>  
        <live>true</live>  
        <query><![CDATA[SELECT PRODUCTS.PRODUCTVENDOR, ROUND(SUM(ORDERDETAILS.QUANTITYORDERED*ORDERDETAILS.PRICEEACH),0) AS "SOLD_PRICE" FROM ORDERS INNER JOIN ORDERDETAILS ON ORDERS.ORDERNUMBER = ORDERDETAILS.ORDERNUMBER INNER JOIN PRODUCTS ON ORDERDETAILS.PRODUCTCODE =PRODUCTS.PRODUCTCODE WHERE (ORDERS.ORDERDATE >= {PREPARE:time_start} AND ORDERS.ORDERDATE <= {PREPARE:time_stop}) GROUP BY PRODUCTS.PRODUCTVENDOR ORDER BY 2 DESC]]></query> 
      </component-definition> 
    </action-definition>
  
    <action-definition> 
      <component-name>JFreeReportComponent</component-name>
      <action-type>Run Report</action-type>
      <action-inputs> 
        <output-type type="string"/>  
        <data type="result-set" mapping="query_result"/>  
        <time_stop type="string"/>  
        <time_start type="string"/> 
      </action-inputs>
      <action-resources> 
        <report-definition type="resource"/> 
      </action-resources>
      <component-definition/> 
    </action-definition>
 
  </actions> 
</action-sequence>