perform_action.xslt 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed Materials - Property of IBM
  4. IBM Cognos Products: ps
  5. (C) Copyright IBM Corp. 2005, 2011
  6. US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  7. -->
  8. <!--
  9. Copyright (C) 2008 Cognos ULC, an IBM Company. All rights reserved.
  10. Cognos (R) is a trademark of Cognos ULC, (formerly Cognos Incorporated).
  11. -->
  12. <xsl:stylesheet version="1.0"
  13. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  14. xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
  15. xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
  16. xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  17. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  18. <xsl:key name="env-param" match="/root/env/param" use="@name"/>
  19. <xsl:template match="/">
  20. <xts:sequence>
  21. <xsl:choose>
  22. <!-- clear the PDF options -->
  23. <xsl:when test="key('env-param','option_op') = 'clear_pdf_options'">
  24. <xts:delete select="/root/env/param[starts-with(@name,'m_pdf_') or @name = 'm_ro_outputPageDefinition' or @name = 'm_ro_outputPageOrientation' or @name='checkbox_password_open' or @name='checkbox_access_options' or starts-with(@name,'preserve_pdf')]"/>
  25. <xts:append select="/root/env">
  26. <param name="preserve_pdf_userPwd">false</param>
  27. <param name="preserve_pdf_ownerPwd">false</param>
  28. </xts:append>
  29. </xsl:when>
  30. <!-- clear the report cache -->
  31. <xsl:when test="key('env-param','option_op') = 'clear_report_cache'">
  32. <xts:append>
  33. <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
  34. <send:request provider="cm">
  35. <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
  36. <cm:delete xmlns:cm="http://developer.cognos.com/schemas/bibus/3/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  37. <objects xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="cm:baseClass[1]">
  38. <item xsi:type="cm:base">
  39. <searchPath xsi:type="cm:stringProp">
  40. <value xsi:type="xsd:string"><xsl:value-of select="concat(key('env-param','m_obj'),'/reportCache')"/></value>
  41. </searchPath>
  42. </item>
  43. </objects>
  44. <options xsi:type="cm:deleteOptions">
  45. <recursive xsi:type="xsd:boolean">true</recursive>
  46. <force xsi:type="xsd:boolean">true</force>
  47. </options>
  48. </cm:delete>
  49. </xts:transform>
  50. </send:request>
  51. </xts:transform>
  52. </xts:append>
  53. </xsl:when>
  54. </xsl:choose>
  55. </xts:sequence>
  56. </xsl:template>
  57. </xsl:stylesheet>