<?xml version="1.0" encoding="UTF-8"?>
<action-sequence> 
  <name>secure-parameter-page-example.xaction</name>
  <title>Secure Parameter Page Portlet Example For Portlet</title>
  <version>1</version>
  <logging-level>debug</logging-level>
  <documentation> 
    <author>Doug Moran</author>  
    <description>This shows an example of a secure parameter page embedded as a portlet</description>  
    <help/>  
    <result-type/>  
    <icon>secure-parameter-page-example.png</icon> 
  </documentation>

  <inputs> 
    <REGION type="string"> 
      <default-value/>  
      <sources> 
        <request>REGION</request> 
      </sources> 
    </REGION>  
    <REGION_FILTER type="result-set"> 
      <sources> 
        <session>REGION_FILTER</session> 
      </sources>  
      <default-value/> 
    </REGION_FILTER>  
    <DEPARTMENT type="string"> 
      <default-value/>  
      <sources> 
        <request>DEPARTMENT</request> 
      </sources> 
    </DEPARTMENT>  
    <result type="string"> 
      <sources> 
        <request>result</request> 
      </sources>  
      <default-value><![CDATA[<HTML>No selections for REGION were found in your session. <p/>This means you are not logged in or you do not have permission to view this report.</HTML>]]></default-value> 
    </result>  
    <DEPARTMENT type="string"> 
      <sources> 
        <request>DEPARTMENT</request> 
      </sources>  
      <default-value/> 
    </DEPARTMENT>  
    <DEPARTMENT_FILTER type="result-set"> 
      <sources> 
        <global>DEPARTMENT_LIST</global> 
      </sources>  
      <default-value/> 
    </DEPARTMENT_FILTER> 
  </inputs>

  <outputs/>

  <resources> 
    <report-definition> 
      <solution-file> 
        <location>JFreeQuadForRegion.xml</location>  
        <mime-type>text/xml</mime-type> 
      </solution-file> 
    </report-definition> 
  </resources>
  
  <actions> 
    <actions> 
      <condition><![CDATA[REGION_FILTER]]></condition>  
      <action-definition> 
        <component-name>SecureFilterComponent</component-name>
        <action-type>Prompt For Region and Dept</action-type>
        <action-inputs> 
          <REGION type="string"/>  
          <REGION_FILTER type="result-set"/>  
          <DEPARTMENT type="string"/>  
          <!--sbarkdull -->  
          <DEPARTMENT_FILTER type="result-set"/> 
        </action-inputs>
        <action-resources/>
        <action-outputs/>
        <component-definition> 
          <selections> 
            <REGION style="select"> 
              <filter value-col-name="REGION" display-col-name="REGION">REGION_FILTER</filter>  
              <title>Select the Region</title> 
            </REGION>  
            <DEPARTMENT style="select"> 
              <filter value-col-name="DEPARTMENT" display-col-name="DEPARTMENT">DEPARTMENT_FILTER</filter>  
              <title>Select Department</title> 
            </DEPARTMENT> 
          </selections>  
          <xsl><![CDATA[CustomReportParameters.xsl]]></xsl>
          <target><![CDATA[Report_Window]]></target>
        </component-definition> 
      </action-definition>
  
      <action-definition> 
        <component-name>SQLLookupRule</component-name>
        <action-type>Relational</action-type>
        <action-inputs> 
          <REGION type="string"/>  
          <DEPARTMENT type="string"/> 
        </action-inputs>
        <action-outputs> 
          <query-result type="result-set" mapping="query_result"/> 
        </action-outputs>
        <component-definition> 
          <jndi><![CDATA[SampleData]]></jndi>  
          <live><![CDATA[true]]></live>  
          <query><![CDATA[select   QUADRANT_ACTUALS.REGION,   QUADRANT_ACTUALS.DEPARTMENT,   QUADRANT_ACTUALS.POSITIONTITLE,   QUADRANT_ACTUALS.ACTUAL,   QUADRANT_ACTUALS.BUDGET,   QUADRANT_ACTUALS.VARIANCE  from QUADRANT_ACTUALS where QUADRANT_ACTUALS.REGION={PREPARE:REGION}and QUADRANT_ACTUALS.DEPARTMENT={PREPARE:DEPARTMENT} order by QUADRANT_ACTUALS.REGION, QUADRANT_ACTUALS.DEPARTMENT]]></query> 
        </component-definition> 
      </action-definition>
  
      <action-definition> 
        <component-name>JFreeReportComponent</component-name>
        <action-type>Pentaho Report</action-type>
        <action-inputs> 
          <data type="result-set" mapping="query_result"/>  
          <REGION type="string"/>  
          <DEPARTMENT type="string"/> 
        </action-inputs>
        <action-resources> 
          <report-definition type="resource"/> 
        </action-resources>
        <action-outputs>
          <report-output type="content" mapping="reportOutput"/>
        </action-outputs>
        <component-definition> 
          <output-type>html</output-type> 
        </component-definition> 
      </action-definition>
 
    </actions>
 
  </actions> 
</action-sequence>