render-task-wizard.xslt 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed Materials - Property of IBM
  4. IBM Cognos Products: HTS
  5. (C) Copyright IBM Corp. 2005, 2010
  6. US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  7. -->
  8. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xts="http://developer.cognos.com/schemas/xts/">
  9. <xsl:include href="taskWizardPage0.xslt"/>
  10. <xsl:include href="taskWizardPage1.xslt"/>
  11. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/>
  12. <!-- global vars -->
  13. <xsl:variable name="stateParams" select="/root/state/param"/>
  14. <xsl:variable name="nextPage" select="/root/state/param[@name='currentPage']"/>
  15. <xsl:variable name="enableBackButton" select="/root/state/param[@name='enableBackButton']"/>
  16. <xsl:variable name="enableNextButton" select="/root/state/param[@name='enableNextButton']"/>
  17. <xsl:variable name="enableFinishButton" select="/root/state/param[@name='enableFinishButton']"/>
  18. <xsl:template match="/">
  19. <script language="javascript">
  20. // enable logging?
  21. _F_config.enableLog = false;
  22. var currentForm = '_THIS_form0';//this needs to be changed by the server. We really need this as the form id, so that we can submit the correct form.
  23. function _THIS_update() {
  24. //examples:
  25. // _THIS_.retrieve("update=owner&amp;value="+searchPath);
  26. // _THIS_.retrieve("update="+inputVar+"&amp;value="+input);
  27. }
  28. function _THIS_handleButton(buttonName)
  29. {
  30. document.getElementById('_THIS_form0').navAction.value = buttonName;
  31. document.getElementById('_THIS_form0').submit();
  32. }
  33. function _THIS_processNextButton()
  34. {
  35. //TODO remove this
  36. }
  37. </script>
  38. <div id="_THIS_div0" class="scrollFrame">
  39. <form name="_THIS_form0" id="_THIS_form0" action="_THIS?/THIS_">
  40. <input type="hidden" name="navAction" value="next"/><!-- each page will need one of these at the mo.. -->
  41. <!-- test stuff
  42. <div> test <xsl:value-of select="/root/state/param[@name='navAction']" />
  43. <xsl:for-each select="$stateParams">
  44. <br/>
  45. <xsl:value-of select="@name"/>
  46. =<xsl:value-of select="."/>
  47. </xsl:for-each>
  48. </div>
  49. -->
  50. <table class="taskView" cellpadding="0" width="100%" cellspacing="0">
  51. <!-- in here, I want to display the pages -->
  52. <tr>
  53. <td valign="top">
  54. <!-- do the page change logic here at the mo... -->
  55. <xsl:choose>
  56. <xsl:when test="/root/state/param[@name='currentPage']='page0'">
  57. <xsl:call-template name="page0"/>
  58. </xsl:when>
  59. <xsl:when test="/root/state/param[@name='currentPage']='page1'">
  60. <xsl:call-template name="page1"/>
  61. </xsl:when>
  62. <xsl:otherwise>
  63. <xsl:call-template name="page0"/>
  64. </xsl:otherwise>
  65. </xsl:choose>
  66. </td>
  67. </tr>
  68. <!-- nav buttons -->
  69. <tr>
  70. <table border="0" cellpadding="1" cellspacing="0" class="dialogButtonBar">
  71. <tr>
  72. <td width="3" valign="middle">
  73. <img width="3" src="/cognos8/ps/images/space.gif"/>
  74. </td>
  75. <td valign="middle">
  76. <table border="0" cellpadding="0" cellspacing="0">
  77. <tr>
  78. <td>
  79. <xsl:call-template name="displayNavButton">
  80. <xsl:with-param name="buttonName"><xts:string id="IDS_FRAG_CANCEL_BUTTON_NAME"/></xsl:with-param>
  81. <xsl:with-param name="isEnabled">true</xsl:with-param>
  82. </xsl:call-template>
  83. </td>
  84. <td>
  85. <img height="1" width="10" src="/cognos8/ps/images/space.gif"/>
  86. </td>
  87. <td>
  88. <xsl:call-template name="displayNavButton">
  89. <xsl:with-param name="buttonName"><xts:string id="IDS_FRAG_BACK_BUTTON_NAME"/></xsl:with-param>
  90. <xsl:with-param name="isEnabled"><xsl:value-of select="$enableBackButton" /></xsl:with-param>
  91. </xsl:call-template>
  92. </td>
  93. <td>
  94. <img height="1" width="10" src="/cognos8/ps/images/space.gif"/>
  95. </td>
  96. <td>
  97. <xsl:call-template name="displayNavButton">
  98. <xsl:with-param name="buttonName"><xts:string id="IDS_FRAG_NEXT_BUTTON_NAME"/></xsl:with-param>
  99. <xsl:with-param name="isEnabled"><xsl:value-of select="$enableNextButton" /></xsl:with-param>
  100. </xsl:call-template>
  101. </td>
  102. <td>
  103. <img height="1" width="10" src="/cognos8/ps/images/space.gif"/>
  104. </td>
  105. <td>
  106. <xsl:call-template name="displayNavButton">
  107. <xsl:with-param name="buttonName"><xts:string id="IDS_FRAG_FINISH_BUTTON_NAME"/></xsl:with-param>
  108. <xsl:with-param name="isEnabled">false</xsl:with-param>
  109. </xsl:call-template>
  110. </td>
  111. </tr>
  112. </table>
  113. </td>
  114. </tr>
  115. </table>
  116. </tr>
  117. </table>
  118. </form>
  119. </div>
  120. </xsl:template>
  121. <xsl:template name="displayNavButton">
  122. <xsl:param name="buttonName"/>
  123. <xsl:param name="isEnabled"/>
  124. <xsl:choose>
  125. <xsl:when test="$isEnabled = 'true'">
  126. <table cellpadding="0" cellspacing="0" onmouseover="this.className = 'commandButtonOver'" onmouseout="this.className = 'commandButton'" onmousedown="this.className = 'commandButtonDown'" class="commandButton">
  127. <tr>
  128. <td valign="middle" align="center" nowrap="nowrap" id="btnAnchorIE">
  129. <img height="1" border="0" width="70" src="/cognos8/ps/images/space.gif"/>
  130. <br/>
  131. <a onClick="javascript:_THIS_processNextButton();" onmouseover="window.status='';return true;" onmouseout="window.status='';return true;" href="javascript:_THIS_handleButton('{$buttonName}')"><xsl:value-of select="$buttonName" /></a>
  132. <!--
  133. <xsl:element name="a">
  134. <xsl:attribute name="href">javascript:handleButton('<xsl:value-of select="$buttonName" />')</xsl:attribute>
  135. <xsl:attribute name="onmouseout">window.status='';return true;</xsl:attribute>
  136. <xsl:attribute name="onmouseover">window.status='';return true;</xsl:attribute>
  137. <xsl:attribute name="onclick">javascript:processNextButton();</xsl:attribute>
  138. <xsl:value-of select="$buttonName" />
  139. </xsl:element>
  140. -->
  141. </td>
  142. </tr>
  143. </table>
  144. </xsl:when>
  145. <xsl:otherwise>
  146. <table cellpadding="0" cellspacing="0" class="commandButtonInactive" style="padding-right:10px; padding-left:10px; padding-top:2px; padding-bottom:3px;">
  147. <tr>
  148. <td valign="middle" align="center" nowrap="nowrap" id="btnAnchorIE">
  149. <img height="1" border="0" width="50" src="/cognos8/ps/images/space.gif"/>
  150. <br/><xsl:value-of select="$buttonName" /></td>
  151. </tr>
  152. </table>
  153. </xsl:otherwise>
  154. </xsl:choose>
  155. </xsl:template>
  156. </xsl:stylesheet>