getParametersResponse.xts 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302
  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, 2008
  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. whip out the parameters that were saved off previously
  50. ===============================================================================================
  51. -->
  52. <xts:block id="decodeExistingParameters" path="/ags/parameters/decodeExistingParameters.xslt" dependency="moveContext" processor="XSLT" type="exec" mandatory="false">
  53. <xts:logicsheet path="logicsheets/portal.xsl"/>
  54. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  55. </xts:block>
  56. <!--
  57. ================================================================================
  58. If we have been through this dialog before we will have saved or unsaved parameter values to display, so whip them out
  59. from the parameter named taskParameters. this contains the previously saved param values retrieved in loadAgent and any unsaved updates
  60. from previous passes through this dialog
  61. ===============================================================================================
  62. -->
  63. <xts:block id="checkExistingParameters" path="/ags/parameters/checkExistingParameters.xslt" dependency="decodeExistingParameters" processor="XSLT" type="exec" mandatory="false">
  64. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  65. </xts:block>
  66. <!--
  67. ================================================================================
  68. We also may have just come back from a jauort server, so update this info with any new parameter values
  69. ===============================================================================================
  70. -->
  71. <xts:block id="mergeLiteralParameters" path="/ags/parameters/mergeLiteralParameters.xslt" dependency="checkExistingParameters" processor="XSLT" type="exec" mandatory="false">
  72. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  73. </xts:block>
  74. <!--
  75. ===============================================================================================
  76. ProcessResponse - Process the response of the call and transform it into a standard xml structure
  77. Remove the bus name space and keep the same structure.
  78. ===============================================================================================
  79. -->
  80. <xts:block id="processResponse" mode="interpret" dependency="mergeLiteralParameters" condition=".[/root/*[local-name()='Envelope']/*[local-name()='Body']]" mandatory="false" processor="XSLT" type="exec">
  81. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" exclude-result-prefixes="xsl bus xsi">
  82. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  83. <xsl:template match="/root">
  84. <xts:sequence>
  85. <xts:append>
  86. <parametersResponse>
  87. <parameter>
  88. <!-- have to get the parameter definitions + parameters which might be returned -->
  89. <xsl:for-each select="/root/*[local-name()='Envelope']/*[local-name()='Body']/*/bus:result/bus:details/item[@xsi:type='bus:asynchDetailParameters']/bus:parameters/item">
  90. <item>
  91. <xsl:apply-templates/>
  92. </item>
  93. </xsl:for-each>
  94. </parameter>
  95. </parametersResponse>
  96. </xts:append>
  97. </xts:sequence>
  98. </xsl:template>
  99. <xsl:template match="node()">
  100. <xsl:element name="{local-name(.)}">
  101. <xsl:apply-templates/>
  102. </xsl:element>
  103. </xsl:template>
  104. <xsl:template match="text()">
  105. <xsl:value-of select="."/>
  106. </xsl:template>
  107. </xsl:stylesheet>
  108. </xts:block>
  109. <!--
  110. ================================================================================
  111. Append the parameters.
  112. ================================================================================
  113. -->
  114. <xts:block id="generateExistingParameters" dependency="processResponse" processor="XSLT" type="exec" condition=".[not(/root/*[local-name()='Envelope']/*[local-name()='Body'])]" mandatory="false">
  115. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xts="http://developer.cognos.com/schemas/xts/" exclude-result-prefixes="xts xsl">
  116. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  117. <xsl:template match="/">
  118. <xts:sequence>
  119. <xts:append select="/root">
  120. <parametersResponse>
  121. <parameter>
  122. <xsl:apply-templates select="/root/agent_item//name"/>
  123. <xsl:apply-templates select="/root/agent_item//parameterName"/>
  124. <capabilities><item>optional</item></capabilities>
  125. </parameter>
  126. </parametersResponse>
  127. <displayedPage quote-string="'">report</displayedPage>
  128. </xts:append>
  129. </xts:sequence>
  130. </xsl:template>
  131. <xsl:template match="name">
  132. <xsl:element name="item">
  133. <xsl:element name="name"><xsl:value-of select="."/></xsl:element>
  134. <xsl:element name="capabilities">optional</xsl:element>
  135. </xsl:element>
  136. </xsl:template>
  137. <xsl:template match="parameterName">
  138. <xsl:element name="item">
  139. <xsl:element name="name"><xsl:value-of select="."/></xsl:element>
  140. <xsl:element name="capabilities">optional</xsl:element>
  141. </xsl:element>
  142. </xsl:template>
  143. </xsl:stylesheet>
  144. </xts:block>
  145. <!--
  146. ================================================================================
  147. check that we have all the parameters, even those without saved values
  148. and produce a block of xml to be used by the display that contains all the parameters and any parameter values that may have been
  149. saved or recently generated by this page via the rs or the model insert button
  150. remove any saved params that are no longer valid
  151. ===============================================================================================
  152. -->
  153. <xts:block id="mergeParameters" path="/ags/parameters/mergeParameters.xslt" dependency="generateExistingParameters" processor="XSLT" type="exec" mandatory="false">
  154. </xts:block>
  155. <!--
  156. ================================================================================
  157. decode the the model item parameters from the form fields and update the parameters block
  158. ===============================================================================================
  159. -->
  160. <xts:block id="mergeModelParameters" path="/ags/parameters/mergeModelParameters.xslt" processor="XSLT" type="exec" mode="interpret" dependency="mergeParameters" mandatory="false"/>
  161. <!--
  162. ================================================================================
  163. if We have just come back from a jaunt round the report server, update the agent task blob
  164. ===============================================================================================
  165. -->
  166. <xts:block id="createParametersBlob" path="/ags/parameters/createParametersBlob.xslt" dependency="mergeModelParameters" processor="XSLT" type="exec">
  167. <xts:logicsheet path="logicsheets/portal.xsl"/>
  168. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  169. </xts:block>
  170. <!--
  171. ===============================================================================================
  172. get connection parameter info for the display
  173. ===============================================================================================
  174. -->
  175. <xts:block id="expandCredentialInfomation" path="/ags/parameters/expandCredentialInformation.xslt" dependency="createParametersBlob" processor="XSLT" type="exec" mandatory="false" condition=".[/root/agent_item/parameterData/*[local-name()='parameterValues']]">
  176. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  177. </xts:block>
  178. <!--
  179. ===============================================================================================
  180. retrieve datasource connection information for the display
  181. ===============================================================================================
  182. -->
  183. <xts:block id="getCredentialInformation" path="/ags/parameters/getCredentialInformation.xslt" dependency="expandCredentialInfomation" processor="XSLT" type="exec" mandatory="false" condition=".[/root/credentialParameters/credentialParameter]">
  184. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  185. </xts:block>
  186. <!--
  187. ================================================================================
  188. Append the report path to the agent path.
  189. ===============================================================================================
  190. -->
  191. <xts:block id="appendDisplayedPageType" dependency="getCredentialInformation" processor="XSLT" type="exec" mandatory="false">
  192. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xts="http://developer.cognos.com/schemas/xts/" exclude-result-prefixes="xts xsl">
  193. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  194. <xsl:template match="/">
  195. <xts:sequence>
  196. <xts:append select="/root">
  197. <xsl:choose>
  198. <xsl:when test="/root/env/param[@name='displayedPage'] = 'sql'">
  199. <displayedPage quote-string="">sql</displayedPage>
  200. </xsl:when>
  201. <xsl:otherwise>
  202. <displayedPage quote-string="'">report</displayedPage>
  203. </xsl:otherwise>
  204. </xsl:choose>
  205. </xts:append>
  206. </xts:sequence>
  207. </xsl:template>
  208. </xsl:stylesheet>
  209. </xts:block>
  210. <!--
  211. ================================================================================
  212. create a data structure for the display to work on....
  213. take the report server parameters as the basis and include the default literal summary and model values
  214. format:
  215. <parametersDisplay>
  216. <parameter name="... identifier" caption="localised dislpay name" multivalued="true/false" required="true/false" type="" literalValue="" modelValue=""/>
  217. </parametersDisplay>
  218. ===============================================================================================
  219. -->
  220. <xts:block id="createDisplayData" path="/ags/parameters/createDisplayData.xslt" dependency="appendDisplayedPageType" processor="XSLT" type="exec" mandatory="false">
  221. <xts:logicsheet path="logicsheets/portal.xsl"/>
  222. <xts:logicsheet path="ags/logicsheets/dialogs.xsl"/>
  223. </xts:block>
  224. <!--
  225. ===============================================================================================
  226. genMarkup -
  227. ===============================================================================================
  228. -->
  229. <xts:block id="genMarkup" type="exec" processor="XSLT" dependency="createDisplayData" condition=".[/root/displayedPage/text() != 'sql']" mandatory="false">
  230. <!-- logicsheets -->
  231. <xts:logicsheet path="ags/logicsheets/promptValues.xslt"/>
  232. <xts:logicsheet path="ags/logicsheets/run_options.xslt"/>
  233. <!-- portal specific information -->
  234. <xts:logicsheet path="logicsheets/portal.xsl"/>
  235. <xts:logicsheet path="ags/logicsheets/dialogs.xsl"/>
  236. <xts:logicsheet path="ags/logicsheets/condition-ui-templates.xslt"/>
  237. <!-- Dialog specific logicsheets -->
  238. <xts:logicsheet path="logicsheets/presentation/dialog/ui-templates.xsl"/>
  239. <xts:logicsheet path="logicsheets/presentation/dialog/framework.xsl"/>
  240. <xts:logicsheet path="logicsheets/presentation/layout.xsl"/>
  241. <xts:logicsheet path="logicsheets/presentation/dialog/presentation.xsl"/>
  242. <!-- Generic logicsheets -->
  243. <xts:logicsheet path="logicsheets/presentation/controls/framework.xsl"/>
  244. <xts:logicsheet path="logicsheets/presentation/controls/presentation.xsl"/>
  245. <!-- apply the form logic -->
  246. <xts:logicsheet path="logicsheets/formlogic.xslt"/>
  247. <!-- Prevent the href from appearing in the status bar. -->
  248. <xts:logicsheet path="logicsheets/presentation/touch_up.xslt"/>
  249. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:out="http://www.w3.org/1999/XSL/Transform" xmlns:agspmt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/ags/promptValues/" xmlns:agsdlg="http://developer.cognos.com/schemas/xts/logicsheets/xslt/ags/dialog/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/" 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: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:ut="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/ui-templates/" xmlns:agsro="http://developer.cognos.com/schemas/xts/agsro" exclude-result-prefixes="xsl out agspmt agsdlg xsi cm pf xtsext lyt dp df cf cp xos utml ut agsro">
  250. <xsl:output method="xml" encoding="utf-8" indent="no"/>
  251. <xsl:key name="request-param" match="/root/*[local-name()='requestParams']/*[local-name()='param']" use="@name"/>
  252. <pf:variables/>
  253. <xsl:variable name="ags_image_root">../ags/images/summary/</xsl:variable>
  254. <xsl:variable name="jobDefinition" select="false()"/>
  255. <xsl:variable name="spacer">
  256. <img height="10" width="10">
  257. <xsl:attribute name="src"><xsl:value-of select="$webcontent"/>/images/space.gif</xsl:attribute>
  258. </img>
  259. </xsl:variable>
  260. <!-- declared a variable to determine if a report has been selected, used for validation purposes-->
  261. <!-- determine which dialog to show when the set... options link is clicked-->
  262. <xsl:template match="/">
  263. <xts:sequence>
  264. <xts:append select="/root/output">
  265. <xos:part>
  266. <xos:entityHeader>
  267. <xos:param name="Content-Type">text/xml; charset=utf-8</xos:param>
  268. </xos:entityHeader>
  269. <xos:entityBody>
  270. <asyncReply>
  271. <xts:transform name="XMLEncode">
  272. <getParametersResponse>
  273. <markup>
  274. <xts:transform name="XMLEncode">
  275. <xsl:call-template name="promptValues"/>
  276. </xts:transform>
  277. </markup>
  278. <!-- take a copy of the parameter display element - which is very nicely formatted -->
  279. <xsl:copy-of select="/root/parametersDisplay"/>
  280. </getParametersResponse>
  281. </xts:transform>
  282. </asyncReply>
  283. </xos:entityBody>
  284. </xos:part>
  285. </xts:append>
  286. </xts:sequence>
  287. </xsl:template>
  288. <agspmt:promptValues/>
  289. </xsl:stylesheet>
  290. </xts:block>
  291. </xts:morphlet>