fragment_init.xslt 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed Materials - Property of IBM
  4. IBM Cognos Products: cogadmin
  5. (C) Copyright IBM Corp. 2005, 2012
  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. <!--
  13. Contains all the logic to initialize the input DOM for the fragment
  14. -->
  15. <xsl:stylesheet version="1.0"
  16. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  17. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  18. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  19. exclude-result-prefixes="xts xtsext">
  20. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  21. <xsl:template match="/">
  22. <xts:sequence>
  23. <!-- if we have state information, then unpack it -->
  24. <xsl:if test="/root/env/param[@name='frag-state'] != ''">
  25. <xts:append select="/root/env">
  26. <xts:transform src="/cogadmin/transforms/merge_state_and_env.xslt" processor="XSLT">
  27. <root>
  28. <xts:queryNode select="/root/env"/>
  29. <state>
  30. <xsl:value-of select="xtsext:base64decode(string(/root/env/param[@name = 'frag-state']), true())" disable-output-escaping="yes"/>
  31. </state>
  32. </root>
  33. </xts:transform>
  34. </xts:append>
  35. </xsl:if>
  36. <!-- If this request is not carrying a caf contextid and caf_extendedContextId is true then make sure it does from now on. -->
  37. <xsl:variable name="passport" select="string(/root/credential/param[@name='CAM']/*[local-name()='CAM']/*[local-name()='CAMPassport']/*[local-name()='id'])"/>
  38. <xsl:if test="not(/root/env/param[@name='ui.cafcontextid']) and $passport != '' and xtsext:cafaction('get_extendedcontextid', '') = 'true'">
  39. <xts:append select="/root/env">
  40. <param name="ui.cafcontextid"><xsl:value-of select="xtsext:cafaction(concat('get_contextid_settemplatename_fragmentinitxslt_setcomponent_ps_setpassportid_', $passport), '')"/></param>
  41. </xts:append>
  42. </xsl:if>
  43. </xts:sequence>
  44. </xsl:template>
  45. </xsl:stylesheet>