view.xslt 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!--
  3. Licensed Materials - Property of IBM
  4. IBM Cognos Products: cpscrn
  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. <!-- $Header: //cpscrn/main/templates/cps4/portlets/utility/portlet-impl/bookmarks/view.xslt#1 $ -->
  13. <!-- $DateTime: 2008/10/22 11:12:04 $ -->
  14. <!-- $Change: 25109 $ -->
  15. <xsl:stylesheet version="1.0"
  16. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  17. xmlns:ui="http://developer.cognos.com/schemas/cps/logic/ui/1/"
  18. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  19. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  20. exclude-result-prefixes="ui xts xtsext">
  21. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no"/>
  22. <xsl:attribute-set name="anchor">
  23. <xsl:attribute name="class">cognos-anchor</xsl:attribute>
  24. <xsl:attribute name="onmouseover">window.status='';return true;</xsl:attribute>
  25. <xsl:attribute name="onmouseout">window.status='';return true;</xsl:attribute>
  26. </xsl:attribute-set>
  27. <ui:property name="target-frame" select="'target'"/>
  28. <xsl:attribute-set name="target">
  29. <xsl:attribute name="target">
  30. <xsl:choose>
  31. <xsl:when test="$open-links = 'new'">_blank</xsl:when>
  32. <xsl:when test="$open-links = 'current' and not($ui-is-myportal)">_top</xsl:when>
  33. <xsl:when test="$open-links = 'target'"><xsl:value-of select="$target-frame"/></xsl:when>
  34. <xsl:when test="$open-links = 'channel'"></xsl:when>
  35. <xsl:otherwise>_blank</xsl:otherwise>
  36. </xsl:choose>
  37. </xsl:attribute>
  38. </xsl:attribute-set>
  39. <ui:property name="open-links" select="'open_links'"/>
  40. <ui:property name="channel" select="'channel'"/>
  41. <xsl:template match="/">
  42. <script language="javascript">
  43. function wsrp_rewrite_select(href,e) {
  44. <xsl:if test="$open-links = 'channel'">
  45. document.wsrp_rewrite_form.url.value = href;
  46. document.wsrp_rewrite_form.submit();
  47. if (e.srcElement) {
  48. e.returnValue = false;
  49. } else {
  50. e.preventDefault();
  51. }
  52. </xsl:if>
  53. }
  54. </script>
  55. <xsl:choose>
  56. <xsl:when test="$open-links = 'channel'">
  57. <form name="wsrp_rewrite_form" method="post" action="wsrp_rewrite?wsrp-urlType=blockingAction&amp;wsrp-interactionState=set:{ $channel }&amp;wsrp-windowState={ $ui-window-state }/wsrp_rewrite">
  58. <input type="hidden" name="url" value=""/>
  59. <xsl:call-template name="render-urls"/>
  60. </form>
  61. </xsl:when>
  62. <xsl:otherwise>
  63. <xsl:call-template name="render-urls"/>
  64. </xsl:otherwise>
  65. </xsl:choose>
  66. <ui:preview/>
  67. </xsl:template>
  68. <xsl:template name="render-urls">
  69. <table border="0" cellpadding="0" cellspacing="2">
  70. <xsl:for-each select="$ui-state-params[starts-with(@name, 'boo_url') and . != '']">
  71. <xsl:sort select="@name" order="ascending"/>
  72. <tr>
  73. <td class="portlet-font">
  74. <a xsl:use-attribute-sets="anchor target" href="{ . }" onclick="wsrp_rewrite_select('{xtsext:javascriptencode( string(.) ) }',event)">
  75. <xsl:variable name="boo-alias" select="concat('boo_alias', substring-after(@name, 'boo_url'))"/>
  76. <xsl:choose>
  77. <xsl:when test="$ui-state-params[@name = $boo-alias] != ''">
  78. <xsl:if test="$ui-portlet-isBidiEnabled='true'">
  79. <xsl:attribute name="dir">
  80. <xsl:value-of select="xtsext:getBTD($ui-state-params[@name = $boo-alias], $ui-portlet-baseTextDirection, $ui-portlet-product-locale)"/>
  81. </xsl:attribute>
  82. </xsl:if>
  83. <xsl:value-of select="$ui-state-params[@name = $boo-alias]"/>
  84. </xsl:when>
  85. <xsl:otherwise>
  86. <xsl:value-of select="."/>
  87. </xsl:otherwise>
  88. </xsl:choose>
  89. </a>
  90. </td>
  91. </tr>
  92. </xsl:for-each>
  93. </table>
  94. </xsl:template>
  95. </xsl:stylesheet>