getSpDetailsResponse.xts 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed Materials - Property of IBM
  4. IBM Cognos Products: AGS
  5. (C) Copyright IBM Corp. 2005, 2009
  6. US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  7. -->
  8. <xts:morphlet xmlns:xts="http://developer.cognos.com/schemas/xts/" messageBase="messages/AGS.xml,messages/portal.xml, messages/portalRL.xml" resolverBase="prompting" includeConfig="true" requiredCapability="canUseEventStudio">
  9. <!--
  10. ================================================================================
  11. decode the parameter context
  12. ===============================================================================================
  13. -->
  14. <xts:block id="decodeContext" processor="XSLT" type="exec">
  15. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xts="http://developer.cognos.com/schemas/xts/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" exclude-result-prefixes="xsl xtsext xts">
  16. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  17. <xsl:template match="/">
  18. <xts:sequence>
  19. <!-- decode the agent items -->
  20. <xts:append select="/root">
  21. <xsl:value-of select="xtsext:web64decode( xtsext:cafaction('sign_unwrap_settemplatename_decodeagentdefinition_settemplateid_dialogadapter001', string( /root/env/param[@name = 'context'])), true() )" disable-output-escaping="yes"/>
  22. </xts:append>
  23. <!-- get rid of the blob for the time being -->
  24. <xts:delete select="/root/env/param[@name = 'context']"/>
  25. </xts:sequence>
  26. </xsl:template>
  27. </xsl:stylesheet>
  28. </xts:block>
  29. <!--
  30. ================================================================================
  31. decode the agent items
  32. ===============================================================================================
  33. -->
  34. <xts:block id="moveContext" processor="XSLT" type="exec" dependency="decodeContext">
  35. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xts="http://developer.cognos.com/schemas/xts/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" exclude-result-prefixes="xsl xtsext xts">
  36. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  37. <xsl:template match="/">
  38. <xts:sequence>
  39. <!-- decode the agent items -->
  40. <xts:append select="/root/env">
  41. <xsl:copy-of select="/root/context/env/*"/>
  42. </xts:append>
  43. </xts:sequence>
  44. </xsl:template>
  45. </xsl:stylesheet>
  46. </xts:block>
  47. <!--
  48. ===============================================================================================
  49. appendMetadataToDocument - add the results of the requests into the right place
  50. ===============================================================================================
  51. -->
  52. <xts:block id="appendMetadataToDocument" mode="interpret" processor="XSLT" type="exec" dependency="moveContext" mandatory="false">
  53. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  54. <xts:logicsheet path="logicsheets/portal.xsl"/>
  55. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:pf="http://developer.cognos.com/schemas/xts/pf" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/" xmlns:cml="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/cml/1/">
  56. <xsl:output method="xml" version="1.0" encoding="UTF-8"/>
  57. <xsl:template match="/root">
  58. <xts:sequence>
  59. <xts:append select="/root">
  60. <procedureDetails>
  61. <xsl:if test="/root/SOAP-ENV:Envelope/SOAP-ENV:Body/*/bus:result/bus:details/item/bus:metadata">
  62. <xts:transform xmlns:xts="http://developer.cognos.com/schemas/xts/" name="XMLDecode">
  63. <xsl:value-of select="/root/SOAP-ENV:Envelope/SOAP-ENV:Body/*/bus:result/bus:details/item/bus:metadata"/>
  64. </xts:transform>
  65. </xsl:if>
  66. </procedureDetails>
  67. </xts:append>
  68. </xts:sequence>
  69. </xsl:template>
  70. <pf:serialize-xml/>
  71. </xsl:stylesheet>
  72. </xts:block>
  73. <!--
  74. ===============================================================================================
  75. make a default selection the first time we come to the page
  76. ===============================================================================================
  77. -->
  78. <xts:block id="doDefaultSelection" mode="interpret" dependency="appendMetadataToDocument" mandatory="false" processor="XSLT" type="exec">
  79. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  80. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  81. <xsl:template match="/root">
  82. <xsl:variable name="selected_subject" select="/root/env/param[@name='sql_procedure_name']"/>
  83. <xts:sequence>
  84. <!-- when there is something in the update spec....-->
  85. <xsl:choose>
  86. <xsl:when test="/root/*[local-name()='procedureDetails']/*[local-name()='ResponseRoot']/*[local-name()='folder']/descendant::updateSubject[1]/@_ref">
  87. <xsl:choose>
  88. <!-- if there is already a param there then update it else add it -->
  89. <xsl:when test="$selected_subject!=''">
  90. <!-- we have an update subject... check its relevence if there is already a param there then update it else add it -->
  91. <xsl:if test="not(/root/*[local-name()='procedureDetails']/*[local-name()='ResponseRoot']/*[local-name()='folder']/descendant::updateSubject[@_ref = $selected_subject])">
  92. <xts:replace select="/root/env/param[@name='sql_procedure_name']">
  93. <param name="sql_procedure_name">
  94. <xsl:value-of select="/root/*[local-name()='procedureDetails']/*[local-name()='ResponseRoot']/*[local-name()='folder']/descendant::updateSubject[1]/@_ref"/>
  95. </param>
  96. </xts:replace>
  97. </xsl:if>
  98. </xsl:when>
  99. <xsl:otherwise>
  100. <xts:append select="/root/env">
  101. <param name="sql_procedure_name">
  102. <xsl:value-of select="/root/*[local-name()='procedureDetails']/*[local-name()='ResponseRoot']/*[local-name()='folder']/descendant::updateSubject[1]/@_ref"/>
  103. </param>
  104. </xts:append>
  105. </xsl:otherwise>
  106. </xsl:choose>
  107. </xsl:when>
  108. <xsl:otherwise>
  109. <xts:delete select="/root/env/param[@name='sql_procedure_name']"/>
  110. </xsl:otherwise>
  111. </xsl:choose>
  112. </xts:sequence>
  113. </xsl:template>
  114. </xsl:stylesheet>
  115. </xts:block>
  116. <!--
  117. ================================================================================
  118. encode the agent items again
  119. ================================================================================
  120. -->
  121. <xts:block id="buildContext" dependency="doDefaultSelection" processor="XSLT" type="exec" mandatory="false">
  122. <xts:logicsheet path="logicsheets/portal.xsl"/>
  123. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:pf="http://developer.cognos.com/schemas/xts/pf" xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/" xmlns:xts="http://developer.cognos.com/schemas/xts/" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" exclude-result-prefixes="xsl pf cm xts xtsext">
  124. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  125. <pf:serialize-xml/>
  126. <pf:variables/>
  127. <xsl:template match="/">
  128. <xts:sequence>
  129. <xsl:variable name="markup">
  130. <xsl:call-template name="serialize-xml">
  131. <xsl:with-param name="node-set">
  132. <xsl:call-template name="buildContext"/>
  133. </xsl:with-param>
  134. </xsl:call-template>
  135. </xsl:variable>
  136. <xts:append select="/root/env">
  137. <param name="context">
  138. <xsl:value-of select="xtsext:cafaction( concat('sign_wrap_setpassportid_', $passport, '_settemplatename_buildcontext_settemplateid_dialogadapter003'), xtsext:web64encode( string( $markup ), true()))"/>
  139. </param>
  140. </xts:append>
  141. </xts:sequence>
  142. </xsl:template>
  143. <!-- build the context -->
  144. <xsl:template name="buildContext">
  145. <context>
  146. <env>
  147. <!-- the actual path to the report - which is needed in the call to getParameters -->
  148. <xsl:copy-of select="/root/env/param[@name='sql_procedure_name']"/>
  149. <param name="procedureDetails">
  150. <xsl:call-template name="serialize-xml">
  151. <xsl:with-param name="node-set">
  152. <xsl:copy-of select="/root/procedureDetails"/>
  153. </xsl:with-param>
  154. </xsl:call-template>
  155. </param>
  156. <xsl:if test="/root/env/param[@name='sql_procedure_name'] != ''">
  157. <xsl:copy-of select="/root/env/param[@name='taskParameters']"/>
  158. <!-- the pv_ items - which is all the settings for parameters in the UI/drop down/input box -->
  159. <xsl:copy-of select="/root/env/param[starts-with(@name, 'pv_')]"/>
  160. </xsl:if>
  161. </env>
  162. </context>
  163. </xsl:template>
  164. </xsl:stylesheet>
  165. </xts:block>
  166. <!--
  167. ===============================================================================================
  168. genMarkup -
  169. ===============================================================================================
  170. -->
  171. <xts:block id="genMarkup" type="exec" processor="XSLT" dependency="buildContext" mandatory="false">
  172. <!-- logicsheets -->
  173. <xts:logicsheet path="logicsheets/portal.xsl"/>
  174. <!-- agent studio logicsheets -->
  175. <xts:logicsheet path="ags/logicsheets/arguments.xslt"/>
  176. <xts:logicsheet path="ags/logicsheets/dialogs.xsl"/>
  177. <!-- Dialog specific logicsheets -->
  178. <xts:logicsheet path="logicsheets/presentation/dialog/ui-templates.xsl"/>
  179. <xts:logicsheet path="logicsheets/presentation/dialog/framework.xsl"/>
  180. <xts:logicsheet path="logicsheets/presentation/layout.xsl"/>
  181. <xts:logicsheet path="logicsheets/presentation/dialog/presentation.xsl"/>
  182. <!-- Generic logicsheets -->
  183. <xts:logicsheet path="logicsheets/presentation/controls/framework.xsl"/>
  184. <xts:logicsheet path="logicsheets/presentation/controls/presentation.xsl"/>
  185. <!-- apply the form logic -->
  186. <xts:logicsheet path="logicsheets/formlogic.xslt"/>
  187. <!-- Prevent the href from appearing in the status bar. -->
  188. <xts:logicsheet path="logicsheets/presentation/touch_up.xslt"/>
  189. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:agsarg="http://developer.cognos.com/schemas/xts/logicsheets/xslt/ags/arguments/" xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/" xmlns:out="http://www.w3.org/1999/XSL/Transform" xmlns:pf="http://developer.cognos.com/schemas/xts/pf" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:lyt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/layout/" xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/" xmlns:df="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/framework/" xmlns:cf="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/framework/" xmlns:req-params="http://developer.cognos.com/schemas/request/params" xmlns:cp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/presentation/" xmlns:xos="http://developer.cognos.com/schemas/xts/output/" xmlns:utml="http://developer.cognos.com/schemas/xts/logicsheet/xslt/formlogic/" xmlns:agsdlg="http://developer.cognos.com/schemas/xts/logicsheets/xslt/ags/dialog/" xmlns:xts="http://developer.cognos.com/schemas/xts/" xmlns:x="x" exclude-result-prefixes="agsarg xts xsl cm pf xtsext lyt dp df cf cp xos utml agsdlg x">
  190. <xsl:output method="xml" encoding="utf-8" indent="no"/>
  191. <pf:variables/>
  192. <!-- declared a variable to determine if a report has been selected, used for validation purposes-->
  193. <!-- determine which dialog to show when the set... options link is clicked-->
  194. <xsl:template match="/">
  195. <xts:sequence>
  196. <xts:append select="/root/output">
  197. <xos:part>
  198. <xos:entityHeader>
  199. <xos:param name="Content-Type">text/xml; charset=utf-8</xos:param>
  200. </xos:entityHeader>
  201. <xos:entityBody>
  202. <asyncReply>
  203. <xts:transform name="XMLEncode">
  204. <getSpDetailsResponse>
  205. <getSpPackage>
  206. <xsl:value-of select="/root/env/param[@name='sql_package']"/>
  207. </getSpPackage>
  208. <getSpDetails_context>
  209. <xsl:value-of select="/root/env/param[@name='context']"/>
  210. </getSpDetails_context>
  211. <getSpDetails_sp_name>
  212. <xsl:value-of select="/root/env/param[@name='sql_procedure_name']"/>
  213. </getSpDetails_sp_name>
  214. <xsl:if test="not(/root/env/param[@name='sql_procedure_name']) or /root/soapFault">
  215. <markup>
  216. <xts:transform name="XMLEncode">
  217. <dp:list width="100%">
  218. <dp:section>
  219. <dp:label>
  220. <xts:string id="DIALOG_SQL_STOREDPROC"/>
  221. </dp:label>
  222. </dp:section>
  223. <dp:section>
  224. <xsl:choose>
  225. <xsl:when test="/root/soapFault">
  226. <xsl:text>
  227. <xts:string id="DIALOG_MESSAGE_NOT_AVAILABLE"/>
  228. </xsl:text>
  229. </xsl:when>
  230. <xsl:otherwise>
  231. <xsl:text>
  232. <xts:string id="DIALOG_MESSAGE_NONE"/>
  233. </xsl:text>
  234. </xsl:otherwise>
  235. </xsl:choose>
  236. </dp:section>
  237. </dp:list>
  238. </xts:transform>
  239. </markup>
  240. </xsl:if>
  241. </getSpDetailsResponse>
  242. </xts:transform>
  243. </asyncReply>
  244. </xos:entityBody>
  245. </xos:part>
  246. </xts:append>
  247. </xts:sequence>
  248. </xsl:template>
  249. </xsl:stylesheet>
  250. </xts:block>
  251. </xts:morphlet>