getPrompt.xts 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. +=========================================================================================+
  4. | Licensed Materials - Property of IBM
  5. | BI and PM: prmt
  6. | (C) Copyright IBM Corp. 2002, 2013
  7. |
  8. | US Government Users Restricted Rights - Use, duplication or
  9. | disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  10. |
  11. =========================================================================================+
  12. -->
  13. <xts:morphlet resolverBase="prompting" xmlns:xts="http://developer.cognos.com/schemas/xts/">
  14. <xts:block id="parseURL" path="rv/logicsheets/parseURL.xslt" type="exec" processor="XSLT" mandatory="false"/>
  15. <xts:block id="parseFault" dependency="parseURL" type="exec" mode="interpret" mimeType="text/xml" condition=".[/root/env/param[@name = 'fault']]" processor="XSLT" mandatory="false">
  16. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" exclude-result-prefixes="xsl xtsext">
  17. <xsl:output method="xml" version="1.0" encoding="UTF-8"/>
  18. <xsl:template match="/root">
  19. <xts:sequence>
  20. <xts:append select="/root">
  21. <faultSpec>
  22. <xsl:value-of select="/root/env/param[@name='fault']" disable-output-escaping="yes"/>
  23. </faultSpec>
  24. </xts:append>
  25. </xts:sequence>
  26. </xsl:template>
  27. </xsl:stylesheet>
  28. </xts:block>
  29. <xts:block id="init" dependency="parseURL parseFault" type="exec" mode="interpret" mimeType="text/html" processor="XSLT" mandatory="false">
  30. <xts:logicsheet path="logicsheets/portal.xsl"/>
  31. <xsl:stylesheet version="1.0"
  32. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  33. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" exclude-result-prefixes="xsl xtsext">
  34. <xsl:template match="/">
  35. <xts:sequence>
  36. <xts:append select="/root">
  37. <promptSpec>
  38. <xsl:for-each select="/root/faultSpec">
  39. <xsl:apply-templates/>
  40. </xsl:for-each>
  41. <xsl:value-of select="/root/env/param[@name='specification']" disable-output-escaping="yes"/>
  42. <PAGE layoutClass="page" name="Prompt Page4" class="pp" >
  43. <OTR layoutClass="tableRow">
  44. <OTD layoutClass="pageFooter" defaultPromptFooter="true" promptRunOption="true" cid="0" uid="12" type="summary" class="fp"/>
  45. </OTR>
  46. </PAGE>
  47. </promptSpec>
  48. </xts:append>
  49. </xts:sequence>
  50. </xsl:template>
  51. <xsl:template match="faultcode | faultstring | faultSubcode | faultSubstring | */name[@value] | */searchPath[@value]">
  52. <xsl:variable name="att_name" select="name()"/>
  53. <xsl:attribute name="{$att_name}">
  54. <xsl:choose>
  55. <xsl:when test="@value">
  56. <xsl:value-of select="@value"/>
  57. </xsl:when>
  58. <xsl:otherwise>
  59. <xsl:value-of select="."/>
  60. </xsl:otherwise>
  61. </xsl:choose>
  62. </xsl:attribute>
  63. </xsl:template>
  64. <!-- creates attributes dataSourcName, faultConnectionName and faultConnectionSearchPath -->
  65. <xsl:template match="dataSource/name | faultConnection/name | faultConnection/searchPath">
  66. <xsl:variable name="n" select="name()"/>
  67. <xsl:variable name="att_name" select="concat( name(..), translate(substring($n,1,1),'ns','NS'), substring($n,2) )"/>
  68. <xsl:attribute name="{$att_name}"><xsl:value-of select="@value"/></xsl:attribute>
  69. </xsl:template>
  70. <xsl:template match="dataSource/connection | connection/signon">
  71. <xsl:variable name="n" select="name()"/>
  72. <xsl:element name="{$n}">
  73. <xsl:if test="name/@value = ../name/@value">
  74. <xsl:attribute name="selected">true</xsl:attribute>
  75. </xsl:if>
  76. <xsl:apply-templates/>
  77. </xsl:element>
  78. </xsl:template>
  79. <xsl:template match="Fault|SOAP-ENV:Fault" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
  80. <selectDataSourceSignon>
  81. <xsl:attribute name="parameter"><xsl:value-of select="generate-id()"/></xsl:attribute>
  82. <xsl:if test="/root/session/param[@name='capabilities']/canUsePersonalDataSourceCredentials">
  83. <xsl:attribute name="persistPrompt">true</xsl:attribute>
  84. </xsl:if>
  85. <xsl:apply-templates/>
  86. </selectDataSourceSignon>
  87. </xsl:template>
  88. </xsl:stylesheet>
  89. </xts:block>
  90. <xts:block id="render" dependency="init" type="exec" mode="output" mimeType="text/html" processor="XSLT" mandatory="false">
  91. <xts:logicsheet path="logicsheets/portal.xsl"/>
  92. <xts:logicsheet path="rv/logicsheets/rvlogic.xsl"/>
  93. <xsl:stylesheet version="1.0"
  94. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  95. xmlns:xos="http://developer.cognos.com/schemas/xts/output/"
  96. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  97. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  98. xmlns:mt="http://developer.cognos.com/schemas/xts/logicsheets/presentation/main/mt"
  99. xmlns:mf="http://developer.cognos.com/schemas/xts/logicsheets/presentation/main/mf"
  100. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  101. xmlns:cf="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/framework/"
  102. xmlns:cp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/presentation/"
  103. xmlns:rvl="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/rv/rvlogic/"
  104. xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
  105. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  106. xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/"
  107. xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
  108. xmlns:xhtml="http://www.w3.org/1999/xhtml"
  109. exclude-result-prefixes="xos pf mt mf xtsext cf cp bus xts dp SOAP-ENV xhtml rvl">
  110. <xsl:import href="p_include.xsl"/>
  111. <xsl:output method="html" encoding="utf-8" indent="no"/>
  112. <pf:variables/>
  113. <!-- current file name -->
  114. <xsl:variable name="skin" select="'corporate'"/>
  115. <xsl:variable name="promptLocale" select="$contentLocale"/>
  116. <xsl:variable name="promptFormName" select="'formWarpRequest'"/>
  117. <xsl:variable name="mname" select="'getPrompt.xts'"/>
  118. <xsl:template match="/root">
  119. <html>
  120. <head>
  121. <link rel="stylesheet" type="text/css" href="{$webRoot}/reportstyles/GlobalReportStyles.css"/>
  122. <xsl:call-template name="getPromptCommonIncludes"/>
  123. <script type="text/javascript" charset="utf-8" src="{$webRoot}/prompting/pds.js"></script>
  124. <script type="text/javascript" charset="utf-8">
  125. function promptButtonOK()
  126. {
  127. var s = "";
  128. var r = cognos.Report.getReport("_THIS_");
  129. var a = getPreProcessControlArray();
  130. var paramValues = [];
  131. for (var i = 0; i &lt; a.length; i++) {
  132. var o = ( (typeof a[i]) == "string" ? window[a[i]] : a[i]);
  133. if (o &amp;&amp; o.sGetValue) {
  134. paramValues.push( o.sGetValue() );
  135. }
  136. else if (o &amp;&amp; o.preProcess) {
  137. paramValues.push( o.preProcess() );
  138. }
  139. }
  140. F_pdsCallback(
  141. {
  142. "parameters": paramValues,
  143. "state": "OK"
  144. },
  145. "<xsl:value-of select="xtsext:javascriptencode(string(key('env-param', 'ccs_invoke')))"/>"
  146. );
  147. }
  148. function promptButtonFinish() { promptButtonOK(); }
  149. function promptButtonNext() { promptButtonOK(); }
  150. function promptButtonCancel()
  151. {
  152. F_pdsCallback(
  153. {"state":"Cancel"},
  154. "<xsl:value-of select="xtsext:javascriptencode(string(key('env-param', 'ccs_invoke')))"/>"
  155. );
  156. }
  157. </script>
  158. </head>
  159. <body>
  160. <form name="formWarpRequest" method="get">
  161. <xsl:for-each select="/root/promptSpec/*">
  162. <xsl:apply-templates select="." /><br/><br/>
  163. </xsl:for-each>
  164. </form>
  165. </body>
  166. </html>
  167. </xsl:template>
  168. <!--pf:serialize-xml/-->
  169. </xsl:stylesheet>
  170. </xts:block>
  171. </xts:morphlet>