callResultTemplate.xslt 3.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed Materials - Property of IBM
  4. IBM Cognos Products: AGS
  5. (C) Copyright IBM Corp. 2005, 2009
  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:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  9. xmlns:pf="http://developer.cognos.com/schemas/xts/pf" xmlns:req-params="http://developer.cognos.com/schemas/request/params"
  10. xmlns:xts="http://developer.cognos.com/schemas/xts/" exclude-result-prefixes="xtsext pf req-params xts">
  11. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  12. <pf:variables/>
  13. <pf:serialize-xml/>
  14. <xsl:template match="/">
  15. <xsl:variable name="prevTabID" select="/root/env/param[@name='prevTabID']"/>
  16. <!-- get the type of the selected tab - either the condition/summary/ or one of the agent/report/job etc types
  17. tabSelectedID actually can hold either a type - or a task id. Have to handle both -->
  18. <xsl:variable name="selTabType">
  19. <xsl:choose>
  20. <!-- we have a reference to a task -->
  21. <xsl:when test="/root/agent_definition/items/item[./id = $prevTabID]">
  22. <xsl:value-of select="/root/agent_definition/items/item[./id = $prevTabID]/type"/>
  23. </xsl:when>
  24. <!-- we have a type - so use that -->
  25. <xsl:otherwise>
  26. <xsl:value-of select="/root/env/param[@name='prevTabID']"/>
  27. </xsl:otherwise>
  28. </xsl:choose>
  29. </xsl:variable>
  30. <xsl:variable name="target">
  31. <xsl:value-of select="/root/navigator/page[@name=$selTabType]/link"/>
  32. </xsl:variable>
  33. <xts:sequence>
  34. <!-- Call the morphlet -->
  35. <xts:append select="/root">
  36. <xts:request name="BUS" target="bus://xts2{$target}" option="xml" outputHeader="true">
  37. <req-params:requestParams>
  38. <req-params:param name="requestState">
  39. <xsl:value-of select="'finished'"/>
  40. </req-params:param>
  41. <req-params:param name="resultNode">
  42. <xsl:text>morphletResponse</xsl:text>
  43. </req-params:param>
  44. <req-params:param name="inWizard">
  45. <xsl:text>false</xsl:text>
  46. </req-params:param>
  47. <req-params:param name="agentStudio">
  48. <xsl:text>true</xsl:text>
  49. </req-params:param>
  50. <req-params:param name="taskName">
  51. <xsl:value-of select="/root/agent_definition/items/item[./id = $prevTabID]/name"/>
  52. </req-params:param>
  53. <req-params:param name="taskType">
  54. <xsl:value-of select="/root/env/param[@name='taskType']"/>
  55. </req-params:param>
  56. </req-params:requestParams>
  57. <!-- env -->
  58. <xsl:copy-of select="/root/env"/>
  59. <!-- system -->
  60. <xsl:copy-of select="/root/system"/>
  61. <!-- user -->
  62. <xsl:copy-of select="/root/user"/>
  63. <!-- http -->
  64. <xsl:copy-of select="/root/http"/>
  65. <!-- session -->
  66. <xsl:copy-of select="/root/session"/>
  67. <!-- header-->
  68. <xsl:copy-of select="/root/header"/>
  69. <!-- credential -->
  70. <xsl:copy-of select="/root/credential"/>
  71. <!-- cookies-->
  72. <xsl:copy-of select="/root/cookies"/>
  73. </xts:request>
  74. </xts:append>
  75. </xts:sequence>
  76. </xsl:template>
  77. </xsl:stylesheet>