decodeTaskOptions.xslt 4.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/" xmlns:xts="http://developer.cognos.com/schemas/xts/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:xtscm="http://developer.cognos.com/schemas/xts-cm/1/" xmlns:form="http://developer.cognos.com/schemas/xts/ags/iFrmCmd/1/" exclude-result-prefixes="send xtsext xtscm form">
  9. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  10. <xsl:template match="/">
  11. <xts:sequence>
  12. <xsl:for-each select="/root/agent_item">
  13. <xsl:variable name="position" select="position()"/>
  14. <xsl:choose>
  15. <!-- that's nice - this drops to something small and fluffy -->
  16. <xsl:when test="./@type='job' or ./@type='agent' ">
  17. <xts:append select="/root/agent_item[{$position}]">
  18. <xsl:value-of select="xtsext:web64decode( string(./param[@name = 'emailToRunOptions']), true() )" disable-output-escaping="yes"/>
  19. </xts:append>
  20. <xts:delete select="/root/agent_item[{$position}]/param[@name = 'emailToRunOptions']"/>
  21. </xsl:when>
  22. <xsl:when test="./@type='report' and ./param[@name='deliveryOptions']">
  23. <!-- we want to decode the message blob in here -->
  24. <xts:append select="/root/agent_item[{$position}]">
  25. <xts:transform name="XMLDecode">
  26. <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap',string(./param[@name='deliveryOptions'])), true())"/>
  27. </xts:transform>
  28. </xts:append>
  29. </xsl:when>
  30. <xsl:when test="./@type='report' and ./param[@name='mobileOptions']">
  31. <!-- we want to decode the message blob in here -->
  32. <xts:append select="/root/agent_item[{$position}]">
  33. <xts:transform name="XMLDecode">
  34. <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap',string(./param[@name='mobileOptions'])), true())"/>
  35. </xts:transform>
  36. </xts:append>
  37. </xsl:when>
  38. <!-- expand the information for an sql -->
  39. <xsl:when test="./@type='sql'">
  40. <!-- not sure that we have anything to do here - and some of the above are dodgy too -->
  41. </xsl:when>
  42. <xsl:when test="./@type='approval' or ./@type='notification' ">
  43. <!-- we want to decode the message blob in here -->
  44. <xts:append select="/root/agent_item[{$position}]">
  45. <xts:transform name="XMLDecode">
  46. <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap',string(./param[@name='taskOptions'])), true())"/>
  47. </xts:transform>
  48. </xts:append>
  49. </xsl:when>
  50. <xsl:when test="./@type='message'">
  51. <!-- we want to decode the message blob in here -->
  52. <xts:append select="/root/agent_item[{$position}]">
  53. <xts:transform name="XMLDecode">
  54. <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap',string(./param[@name='options'])), true())"/>
  55. </xts:transform>
  56. </xts:append>
  57. </xsl:when>
  58. </xsl:choose>
  59. </xsl:for-each>
  60. </xts:sequence>
  61. </xsl:template>
  62. </xsl:stylesheet>