<!--
 * awProgramDemo.jsp
 *
 * Copyright  1994-2004, Oracle. All rights reserved. Oracle grants
 * you ("Licensee") a non-exclusive, royalty-free, worldwide license to use,
 * modify and redistribute this software in source and binary code form, provided
 * that (i) this copyright notice and license appear on all copies of the
 * software; (ii) Licensee does not utilize the software in a manner disparaging
 * to Oracle; and (iii) Licensee does not utilize the software in a manner that
 * violates the terms of any Licensee agreement with Oracle.
 -->

<%@ taglib uri="http://xmlns.oracle.com/bibeans/jsp" prefix="orabi" %>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<%@ page errorPage="cabo/bi/jsp/error.jsp" %>
<%@ page contentType="text/html;charset=windows-1252"%>

<!-- Start synchronization of the BI tags -->
<% synchronized(session){ %>
<orabi:BIThinSession id="bisession1"  configuration="/BIJSPTagGuideOLAPConfig1.xml" >
  <!--  Business Intelligence definition tags here -->
  <orabi:PageList id="pageList1"/>
  <orabi:Presentation imageHeight="400" pagingControlVisible="False" location="Reports/What If Graph" imageWidth="650" id="BIWhatIfAnalysis_pres1"/>
  <orabi:DimensionMemberList members="1812;1851;1885;1921;1961;1998;2033;2074;2111;2149;2187;2223" hierarchy="MDM!D_CS_OLAP.SHAWT_TIME.CALENDAR" multiSelect="True" dimension="MDM!D_CS_OLAP.SHAWT_TIME" id="BIWhatIfAnalysis_dimMemList1"/>
  <orabi:DimensionMemberList hierarchy="MDM!D_CS_OLAP.SHAWPROMOTIONS.PROMOTIONS" levels="MDM!D_CS_OLAP.SHAWPROMOTIONS.PROMOTIONS.L.CATEGORY" dimension="MDM!D_CS_OLAP.SHAWPROMOTIONS" id="BIWhatIfAnalysis_dimMemList2"/>
  <orabi:AWCommands id="BIWhatIfAnalysis_awComm1" executeWhen="onInit">aw attach utils</orabi:AWCommands>
  <orabi:AWProgram id="BIWhatIfAnalysis_awMethod1" awProgramName="RUN_MODEL_CONTEXT" awDimensionListContextName="dimContext" additionalDimensionListIds="BIWhatIfAnalysis_dimMemList1;BIWhatIfAnalysis_dimMemList2" partialTargets="BIWhatIfAnalysis_pres1" sourcePresentationId="BIWhatIfAnalysis_pres1" awPresentationContextName="presContext">
    <orabi:AWReturnAction value="(any)" refreshTargetIds="BIWhatIfAnalysis_pres1"/>
  </orabi:AWProgram>
  <orabi:DimensionMemberList targetPresentationIds="BIWhatIfAnalysis_pres1" members="201;202;203;204;205" hierarchy="MDM!D_CS_OLAP.SHAWPRODUCTS.PRODUCTS" dimension="MDM!D_CS_OLAP.SHAWPRODUCTS" id="BIWhatIfAnalysis_dimMemList3"/>
  <orabi:AWProgram id="BIWhatIfAnalysis_awMethod2" awProgramName="CLEAR_DATA" partialTargets="BIWhatIfAnalysis_pres1">
    <orabi:AWReturnAction value="(any)" refreshTargetIds="BIWhatIfAnalysis_pres1"/>
  </orabi:AWProgram>
</orabi:BIThinSession>

<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <title>
      BI Beans AWProgram Tag Demo
    </title>
  </head>

  <orabi:BIBody>
    <form name="BIForm" method="POST"  action="awProgramDemo.jsp" >
      <orabi:InitBITags parentForm="BIForm"/>
      <table cellspacing="2" cellpadding="3" border="0" width="100%">
        <tr>
          <td colspan="2" bgcolor="#cccccc">
            <STRONG><FONT face="Arial" size="4">AWProgram Tag Demo</FONT> </STRONG>
          </td>
        </tr>
        <tr>
          <td vAlign="middle" colspan="2" height="3">
            <hr width="100%" noshade="noshade"/>
          </td>
        </tr>
        <tr>
          <td vAlign="top" colspan="2" class="OraInstructionText" height="20">
            <ul>
              <li>The AWProgram tag allows you to call programs defined in the Analytic Workspace</li>
              <li>On this page, the program takes as input the state of the Graph, and two DimensionMemberLists for Time and Promotion</li>
              <li>The DimensionMemberList on the left is used to apply Product category to the Graph, and is rendered as images
              <li>Select Time periods and the promotion type and then click on the "Run Model" button to run the model program in the Analytic Workspace. Click on the "Reset" button to run the program that resets the state of the Graph.</li>
             </ul>
          </td>
        </tr>
        <tr>
          <td vAlign="middle" colspan="2" height="3">
            <hr width="100%" noshade="noshade"/>
          </td>
        </tr>
      </table>
      <!-- Insert your Business Intelligence tags here -->
      <table cellspacing="3" cellpadding="2" border="0">
        <tr>
          <td vAlign="top" rowSpan="2">
            <table>
              <!--BI_TAGS_METADATA llt;;2;;dtn;;DimensionMemberList;;dti;;BIWhatIfAnalysis_dimMemList3;;lgfdv;;2;;llissbc;;_EMP_VAL_;;ldlib;;false;;lscm;;1;;lhvs;;&lt;none&gt;;;llp;;1;;lscil;;_EMP_VAL_;;llv;;_EMP_VAL_;;llibc;;_EMP_VAL_;;lti;;NONE;;lrt;;7;;lgfd;;1;;lsct;;_L_T_D_;;llilp;;1;;-->
              <tr>
                <td>
                  <table width="100%">
                    <tr>
                      <td>
                        <div>
                          <orabi:ListItem biList="${BIWhatIfAnalysis_dimMemList3_data}" itemIndex="0" selectedStateImageSource="images/electronics1.gif" imageSource="images/electronics.gif" renderAs="image"/>
                        </div>
                      </td>
                    </tr>
                    <tr>
                      <td>
                        <div>
                           <orabi:ListItem biList="${BIWhatIfAnalysis_dimMemList3_data}" itemIndex="1" selectedStateImageSource="images/hardware1.gif" imageSource="images/hardware.gif" renderAs="image"/>
                        </div>
                      </td>
                    </tr>
                    <tr>
                      <td>
                        <div>
                          <orabi:ListItem biList="${BIWhatIfAnalysis_dimMemList3_data}" itemIndex="2" selectedStateImageSource="images/peripherals1.gif" imageSource="images/peripherals.gif" renderAs="image"/>
                        </div>
                      </td>
                    </tr>
                    <tr>
                      <td>
                        <div>
                          <orabi:ListItem biList="${BIWhatIfAnalysis_dimMemList3_data}" itemIndex="3" selectedStateImageSource="images/photo1.gif" imageSource="images/photo.gif" renderAs="image"/>
                        </div>
                      </td>
                    </tr>
                    <tr>
                      <td>
                        <div>
                          <orabi:ListItem biList="${BIWhatIfAnalysis_dimMemList3_data}" itemIndex="4" selectedStateImageSource="images/software1.gif" imageSource="images/software.gif" renderAs="image"/>
                        </div>
                      </td>
                    </tr>
                  </table>
                </td>
              </tr>
            </table>
           </td>
          <td colspan="3">
            <table>
              <tr>
               <td colspan="2">
                 <table id="<c:out value="${BIWhatIfAnalysis_dimMemList1_data.listName}"/>">
                   <!--BI_TAGS_METADATA llt;;4;;dtn;;DimensionMemberList;;dti;;BIWhatIfAnalysis_dimMemList1;;lgfdv;;1;;llissbc;;_EMP_VAL_;;ldlib;;false;;lscm;;2;;lhvs;;_EMP_VAL_;;llp;;2;;lscil;;_EMP_VAL_;;llv;;Model Promotions;;llibc;;_EMP_VAL_;;lti;;DEFAULT;;lrt;;8;;lgfd;;1;;lsct;;_L_T_D_;;llilp;;3;;-->
                   <tr>
                     <td class="OraBIListDefaultHeader">Model Promotions</td>
                   </tr>
                   <tr>
                     <td class="OraBIListDefaultContent">
                       <orabi:GridListIterator numRows="1" biList="${BIWhatIfAnalysis_dimMemList1_data}">
                         <orabi:ListItem renderAs="checkBox" autoSubmit="true" styleClass="OraBIListDefaultItems"/>
                       </orabi:GridListIterator>
                     </td>
                   </tr>
                 </table>
               </td>
              </tr>
              <tr>
               <td>
                 <table>
                   <!--BI_TAGS_METADATA llt;;1;;dtn;;DimensionMemberList;;dti;;BIWhatIfAnalysis_dimMemList2;;lgfdv;;2;;llissbc;;_EMP_VAL_;;ldlib;;false;;lscm;;2;;lhvs;;_EMP_VAL_;;llp;;2;;lscil;;_EMP_VAL_;;llv;;_L_T_D_;;llibc;;_EMP_VAL_;;lti;;DEFAULT;;lrt;;1;;lgfd;;1;;lsct;;_L_T_D_;;llilp;;3;;-->
                   <tr>
                     <td class="OraBIListDefaultHeader">
                       <c:out value="${BIWhatIfAnalysis_dimMemList2_data.listLabel}"/>
                     </td>
                   </tr>
                   <tr>
                     <td class="OraBIListDefaultContent">
                       <orabi:ListCombo autoSubmit="true" biList="${BIWhatIfAnalysis_dimMemList2_data}" styleClass="OraBIListDefaultItems" renderAs="combo"/>
                     </td>
                   </tr>
                 </table>
               </td>
                <td align="right" valign="bottom">
                  <orabi:Button onClick="${BIWhatIfAnalysis_awMethod1_data.execute}" text="Run Model"/>
                  <orabi:Button onClick="${BIWhatIfAnalysis_awMethod2_data.execute}" text="Reset"/>
               </td>
               </tr>
            </table>
          </td>
        </tr>
        <tr>
          <td colspan="3">
            <orabi:Render targetId="BIWhatIfAnalysis_pres1" parentForm="BIForm"/>
          </td>
        </tr>
      </table>
      <p>&nbsp;
      </p>
      <p/>

      <!-- The InsertHiddenFields tag adds state fields to the parent form tag -->
      <orabi:InsertHiddenFields parentForm="BIForm"  biThinSessionId="bisession1" />
    </form>

  </orabi:BIBody>
</html>
<% } %>
<!-- End synchronization of the BI tags -->
