tool_frame.xts 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  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, 2013
  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. <xts:morphlet xmlns:xts="http://developer.cognos.com/schemas/xts/" messageBase="messages/cogadminuimsgs.xml" >
  13. <xts:block id="decode" processor="XSLT" type="exec" mandatory="false" mode="interpret"
  14. condition=".[/root/env/param[@name = 'toolName']]"
  15. nodelist="env">
  16. <xsl:stylesheet version="1.0"
  17. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  18. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  19. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  20. exclude-result-prefixes="xts xtsext">
  21. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  22. <xsl:template match="/">
  23. <xts:sequence>
  24. <xts:replace select="/root/env/param[@name = 'toolName']">
  25. <param name="toolName">
  26. <xsl:value-of select="xtsext:base64decode(/root/env/param[@name = 'toolName'], true())" disable-output-escaping="yes"/>
  27. </param>
  28. </xts:replace>
  29. </xts:sequence>
  30. </xsl:template>
  31. </xsl:stylesheet>
  32. </xts:block>
  33. <xts:block id="response" dependency="decode" processor="XSLT" type="exec" mode="interpret"
  34. nodelist="http, env, header">
  35. <xsl:stylesheet version="1.0"
  36. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  37. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  38. xmlns:xos="http://developer.cognos.com/schemas/xts/output/"
  39. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  40. xmlns:exsl="http://exslt.org/common"
  41. extension-element-prefixes="exsl"
  42. exclude-result-prefixes="xts xos exsl xtsext">
  43. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  44. <xsl:key name="env-param" match="/root/env/param" use="@name"/>
  45. <xsl:key name="http-param" match="/root/http/param" use="@name"/>
  46. <xsl:variable name="base-url" select="concat(/root/configProps/param[@name = 'cps']/property[@name ='gateway']/., '?b_action=xts.run')"/>
  47. <xsl:variable name="tool-name" select="key('env-param', 'toolName')"/>
  48. <!-- parameters not to be passed into assembler call -->
  49. <xsl:variable name="params-excluded" select="' encoding m b_action '"/>
  50. <xsl:variable name="interaction-params" select="/root/env/param[not(contains($params-excluded, concat(' ', @name, ' ')))]"/>
  51. <xsl:template match="/">
  52. <xts:sequence>
  53. <xts:append select="/root/output">
  54. <xos:part>
  55. <xos:entityHeader>
  56. <xos:param name="Content-type">text/xml</xos:param>
  57. </xos:entityHeader>
  58. <xos:entityBody>
  59. <fragment>
  60. <info>
  61. <title>Need to hide this</title>
  62. </info>
  63. <meta>
  64. <customProperties name="toolName">
  65. <title xml:lang="en">Tool name</title>
  66. <hint xml:lang="en">This is the name of the legacy tool that should be displayed.</hint>
  67. <default>
  68. <value>administrativetasks</value>
  69. <enum value="administrativetasks"/>
  70. <enum value="usersgroupsandroles"/>
  71. <enum value="monitor"/>
  72. <enum value="dispatchersandservices"/>
  73. <enum value="portletimports"/>
  74. <enum value="datasourceconnections"/>
  75. <enum value="distributionlistandcontacts"/>
  76. <enum value="printers"/>
  77. </default>
  78. </customProperties>
  79. </meta>
  80. <markup>
  81. <mimeType>text/html</mimeType>
  82. <markupXml>
  83. <script>
  84. _THIS_.setOnloadHandler( function() {
  85. _THIS_.onresize = function() {
  86. var iFrameID = "_THIS_iFrame<xsl:value-of select="$tool-name"/>";
  87. if (($(iFrameID)) &amp;&amp; ($(_THIS_.parent)) &amp;&amp; ($(_THIS_.parent.parent)))
  88. {
  89. xHeight(iFrameID, xHeight($(_THIS_.parent.parent.div)) - ui_calcAvailableHeight($(iFrameID), $(_THIS_.parent.div), true));
  90. } else {
  91. xHeight(iFrameID,300);
  92. }
  93. return true;
  94. }
  95. _THIS_.onresize();
  96. _THIS_onRefresh = function(evt) {
  97. evt.preventDefault(); //cancel the fragment default: We don't want it to reload, we just want to refresh the iFrame contents.
  98. var f = document.getElementById('_THIS_iFrame<xsl:value-of select="$tool-name"/>');
  99. f.contentWindow.location.reload(true);
  100. }
  101. regFragEvent(_THIS_,"fragment.refresh",_THIS_onRefresh);
  102. });
  103. </script>
  104. <iFrame id="_THIS_iFrame{$tool-name}" frameborder="0" marginheight="0" width="100%" marginwidth="0" style="margin:0px">
  105. <xsl:choose>
  106. <xsl:when test="$tool-name = 'administrativetasks'">
  107. <xsl:attribute name="src">
  108. <xsl:value-of select="concat($base-url, '&amp;m=portal/legacy_tools/tools_cs_administration.xts')"/>
  109. </xsl:attribute>
  110. <xsl:attribute name="title"><xts:string id="IDS_TITLE_CONTENT_ADMINISTRATION"/></xsl:attribute>
  111. </xsl:when>
  112. <xsl:when test="$tool-name = 'usersgroupsandroles'">
  113. <xsl:attribute name="src">
  114. <xsl:value-of select="concat($base-url, '&amp;m=portal/legacy_tools/tools_directory.xts')"/>
  115. </xsl:attribute>
  116. <xsl:attribute name="title"><xts:string id="IDS_TITLE_USERS_GROUPS_ROLES"/></xsl:attribute>
  117. </xsl:when>
  118. <xsl:when test="$tool-name = 'capabilities'">
  119. <xsl:attribute name="src">
  120. <xsl:value-of select="concat($base-url, '&amp;m=portal/legacy_tools/tools_capabilities.xts')"/>
  121. </xsl:attribute>
  122. <xsl:attribute name="title"><xts:string id="IDS_TITLE_CAPABILITIES"/></xsl:attribute>
  123. </xsl:when>
  124. <xsl:when test="$tool-name = 'drillthroughdefinitions'">
  125. <xsl:attribute name="src">
  126. <xsl:value-of select="concat($base-url, '&amp;m=portal/legacy_tools/tools_drillthru.xts')"/>
  127. </xsl:attribute>
  128. <xsl:attribute name="title"><xts:string id="IDS_TITLE_DRILLTHROUGH_DEFINITIONS"/></xsl:attribute>
  129. </xsl:when>
  130. <xsl:when test="$tool-name = 'styles'">
  131. <xsl:attribute name="src">
  132. <xsl:value-of select="concat($base-url, '&amp;m=portal/legacy_tools/tools_skinadmin.xts')"/>
  133. </xsl:attribute>
  134. <xsl:attribute name="title"><xts:string id="IDS_TITLE_STYLES"/></xsl:attribute>
  135. </xsl:when>
  136. <xsl:when test="$tool-name = 'monitor'">
  137. <xsl:attribute name="src">
  138. <xsl:value-of select="concat($base-url, '&amp;m=portal/legacy_tools/tools_service_monitor.xts')"/>
  139. </xsl:attribute>
  140. <xsl:attribute name="title"><xts:string id="IDS_TITLE_SERVICE_MONITOR"/></xsl:attribute>
  141. </xsl:when>
  142. <xsl:when test="$tool-name = 'dispatchersandservices'">
  143. <xsl:attribute name="src">
  144. <xsl:value-of select="concat($base-url, '&amp;m=portal/legacy_tools/tools_service_config.xts')"/>
  145. </xsl:attribute>
  146. <xsl:attribute name="title"><xts:string id="IDS_TITLE_DISPATCHERS_AND_SERVICES"/></xsl:attribute>
  147. </xsl:when>
  148. <xsl:when test="$tool-name = 'portletimports'">
  149. <xsl:attribute name="src">
  150. <xsl:value-of select="concat($base-url, '&amp;m=portal/legacy_tools/tools_portaladmin.xts')"/>
  151. </xsl:attribute>
  152. <xsl:attribute name="title"><xts:string id="IDS_TITLE_PORTAL_ADMIN"/></xsl:attribute>
  153. </xsl:when>
  154. <xsl:when test="$tool-name = 'datasourceconnections'">
  155. <xsl:attribute name="src">
  156. <xsl:value-of select="concat($base-url, '&amp;m=portal/legacy_tools/tools_directory.xts&amp;tool_tab=d')"/>
  157. </xsl:attribute>
  158. <xsl:attribute name="title"><xts:string id="IDS_TITLE_DATASOURCES"/></xsl:attribute>
  159. </xsl:when>
  160. <xsl:when test="$tool-name = 'distributionlistandcontacts'">
  161. <xsl:attribute name="src">
  162. <xsl:value-of select="concat($base-url, '&amp;m=portal/legacy_tools/tools_directory.xts&amp;tool_tab=l')"/>
  163. </xsl:attribute>
  164. <xsl:attribute name="title"><xts:string id="IDS_TITLE_DISTRIBUTION_LISTS_AND_CONTACTS"/></xsl:attribute>
  165. </xsl:when>
  166. <xsl:when test="$tool-name = 'printers'">
  167. <xsl:attribute name="src">
  168. <xsl:value-of select="concat($base-url, '&amp;m=portal/legacy_tools/tools_directory.xts&amp;tool_tab=p')"/>
  169. </xsl:attribute>
  170. <xsl:attribute name="title"><xts:string id="IDS_TITLE_PRINTERS"/></xsl:attribute>
  171. </xsl:when>
  172. </xsl:choose>
  173. </iFrame>
  174. </markupXml>
  175. </markup>
  176. </fragment>
  177. </xos:entityBody>
  178. </xos:part>
  179. </xts:append>
  180. </xts:sequence>
  181. </xsl:template>
  182. </xsl:stylesheet>
  183. </xts:block>
  184. </xts:morphlet>