view_prompts.xts 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed Materials - Property of IBM
  4. IBM Cognos Products: ps
  5. (C) Copyright IBM Corp. 2005, 2011
  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/portal.xml, messages/portalRL.xml">
  13. <!--
  14. ===============================================================================================
  15. formlogic_init - standard form logic initialization
  16. ===============================================================================================
  17. -->
  18. <xts:block id="formlogic_init" type="exec" mode="interpret" processor="XSLT" path="/logicsheets/formlogic_init.xslt" nodelist="env,credential,system,http"/>
  19. <!--
  20. ===============================================================================================
  21. getContent -
  22. ===============================================================================================
  23. -->
  24. <xts:block id="getContent" processor="XSLT" type="exec" dependency="formlogic_init">
  25. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  26. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  27. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  28. xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
  29. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt">
  30. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  31. <xsl:key name="env-param" match="/root/env/param" use="@name"/>
  32. <xsl:template match="/">
  33. <xts:sequence>
  34. <xsl:choose>
  35. <xsl:when test="key('env-param','m_rp_parameters')!=''">
  36. <xts:append>
  37. <xts:transform src="transforms/portal/parameters/group-parameters.xslt" processor="XSLT">
  38. <xsl:value-of select="xtsext:web64decode(string(key('env-param','m_rp_parameters')), true())" disable-output-escaping="yes"/>
  39. </xts:transform>
  40. </xts:append>
  41. </xsl:when>
  42. <xsl:when test="key('env-param','defaultParameters')!=''">
  43. <xts:append>
  44. <xts:transform src="transforms/portal/parameters/group-parameters.xslt" processor="XSLT">
  45. <xsl:value-of select="xtsext:web64decode(string(key('env-param','defaultParameters')), true())" disable-output-escaping="yes"/>
  46. </xts:transform>
  47. </xts:append>
  48. </xsl:when>
  49. <xsl:otherwise>
  50. <xts:append>
  51. <xts:transform src="transforms/portal/parameters/group-parameters.xslt" processor="XSLT">
  52. <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
  53. <send:request provider="cm">
  54. <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
  55. <cm:query>
  56. <cm:search>
  57. <xsl:value-of select="key('env-param','m_obj')"/>
  58. <xsl:choose>
  59. <xsl:when test="key('env-param','m_class')='agentDefinition'">/report</xsl:when>
  60. <xsl:when test="key('env-param','m_class')='agentDefinitionView'">/reportView</xsl:when>
  61. </xsl:choose>
  62. </cm:search>
  63. <cm:properties>
  64. <cm:property name="parameters"/>
  65. </cm:properties>
  66. </cm:query>
  67. </xts:transform>
  68. </send:request>
  69. </xts:transform>
  70. </xts:transform>
  71. </xts:append>
  72. </xsl:otherwise>
  73. </xsl:choose>
  74. </xts:sequence>
  75. </xsl:template>
  76. </xsl:stylesheet>
  77. </xts:block>
  78. <!--
  79. ===============================================================================================
  80. queryDataSourcePrompts - Get the parameter data source connection/signon information from CM
  81. ===============================================================================================
  82. -->
  83. <xts:block id="queryDataSourcePrompts"
  84. nodeList="credentialParameters,runnableParameters"
  85. path="/portal/iPrompting/logicsheets/query-datasource.xslt"
  86. processor="XSLT"
  87. type="exec"
  88. dependency="getContent"
  89. condition=".[/root/credentialParameters or /root/runnableParameters/credentialParameters]"
  90. mandatory="false">
  91. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  92. </xts:block>
  93. <!--
  94. ===============================================================================================
  95. format_message -
  96. ===============================================================================================
  97. -->
  98. <xts:block id="format_prompts" dependency="getContent queryDataSourcePrompts" mode="output" processor="XSLT" type="exec" mimeType="text/html">
  99. <xts:logicsheet path="logicsheets/portal.xsl"/>
  100. <xts:logicsheet path="logicsheets/presentation/dialog/framework.xsl"/>
  101. <xts:logicsheet path="logicsheets/presentation/layout.xsl"/>
  102. <xts:logicsheet path="logicsheets/presentation/dialog/presentation.xsl"/>
  103. <xts:logicsheet path="logicsheets/presentation/controls/framework.xsl"/>
  104. <xts:logicsheet path="logicsheets/presentation/controls/presentation.xsl"/>
  105. <xts:logicsheet path="logicsheets/formlogic.xslt"/>
  106. <xts:logicsheet path="logicsheets/validation.xslt"/> <xts:logicsheet path="logicsheets/presentation/touch_up.xslt"/>
  107. <xsl:stylesheet version="1.0"
  108. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  109. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  110. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  111. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  112. xmlns:lyt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/layout/"
  113. xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/"
  114. xmlns:df="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/framework/"
  115. xmlns:cf="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/framework/"
  116. xmlns:cp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/presentation/"
  117. xmlns:utml="http://developer.cognos.com/schemas/xts/logicsheet/xslt/formlogic/"
  118. exclude-result-prefixes="xsl cm pf xtsext lyt dp df cf cp utml">
  119. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
  120. <xsl:variable name="mname" select="'view_prompts.xts'"/>
  121. <pf:variables/>
  122. <!-- global application variables -->
  123. <xsl:variable name="object-name">
  124. <xsl:choose>
  125. <xsl:when test=" key('env-param', 'm_new_class') != '' ">
  126. <xts:string id="IDS_ADDENTRIES_TITLE_NEW_JOB"/>
  127. </xsl:when>
  128. <xsl:otherwise>
  129. <xsl:value-of select="key('env-param', 'm_name')"/>
  130. </xsl:otherwise>
  131. </xsl:choose>
  132. </xsl:variable>
  133. <xsl:variable name="pageTitle">
  134. <xsl:choose>
  135. <!-- if we're viewing saved prompts and the class is a jobDefinition, we must be viewing the prompts from a step -->
  136. <xsl:when test="key('env-param', 'm_class') = 'jobDefinition'">
  137. <xts:string id="IDS_OTHERRUN_VIEW_PROMPTS_TITLE_STEPS">
  138. <xts:param name="objectName"><xsl:value-of select="$object-name"/></xts:param>
  139. <xts:param name="stepName">
  140. <xsl:value-of select="key('env-param', 'report_name')"/>
  141. </xts:param>
  142. </xts:string>
  143. </xsl:when>
  144. <xsl:otherwise>
  145. <xts:string id="IDS_OTHERRUN_VIEW_PROMPTS_TITLE">
  146. <xts:param name="objectName">
  147. <xsl:value-of select="/root/env/param[@name = 'm_name']"/>
  148. </xts:param>
  149. </xts:string>
  150. </xsl:otherwise>
  151. </xsl:choose>
  152. </xsl:variable>
  153. <xsl:template match="/root">
  154. <xsl:variable name="parameters" select="./parameters"/>
  155. <xsl:variable name="credentials" select="./credentialParameters"/>
  156. <xsl:text disable-output-escaping='yes'>&lt;!DOCTYPE html></xsl:text><dp:page longTitle="$product_name">
  157. <dp:meta>
  158. <pf:meta/>
  159. <!-- Standard meta tags -->
  160. </dp:meta>
  161. <dp:script>
  162. <pf:help context=""/>
  163. <!-- Help system -->
  164. </dp:script>
  165. <utml:form name="pform" method="post" action="{$gateway}">
  166. <!-- dialog header -->
  167. <dp:header>
  168. <!-- header titles-->
  169. <dp:title>
  170. <xsl:value-of select="$pageTitle"/>
  171. </dp:title>
  172. <dp:description>
  173. <xts:string id="IDS_OTHERRUN_VIEW_PROMPTS_DESCRIPTION"/>
  174. </dp:description>
  175. </dp:header>
  176. <xsl:if test="$parameters">
  177. <lyt:layout style="1">
  178. <lyt:section>
  179. <dp:list>
  180. <xsl:for-each select="$parameters/*[local-name()='parameterValue']">
  181. <dp:section>
  182. <dp:input>
  183. <dp:section1>
  184. <xsl:value-of select="*[local-name()='name']"/>
  185. <xsl:text><xts:string id="IDS_LIST_START"/></xsl:text>
  186. </dp:section1>
  187. <dp:section2>
  188. <xsl:apply-templates mode="render-values"/>
  189. </dp:section2>
  190. </dp:input>
  191. </dp:section>
  192. </xsl:for-each>
  193. </dp:list>
  194. </lyt:section>
  195. </lyt:layout>
  196. </xsl:if>
  197. <xsl:if test="$credentials">
  198. <lyt:layout title="IDS_VIEW_PROMPTS_DATASOURCES" style="1" border="yes">
  199. <lyt:section>
  200. <dp:list>
  201. <xsl:for-each select="$credentials/credential">
  202. <xsl:call-template name="render-credential">
  203. <xsl:with-param name="credential" select="."/>
  204. <xsl:with-param name="pos" select="position()"/>
  205. </xsl:call-template>
  206. </xsl:for-each>
  207. </dp:list>
  208. </lyt:section>
  209. </lyt:layout>
  210. </xsl:if>
  211. <!-- =================== F o o t e r ===================== -->
  212. <dp:footer>
  213. <xsl:choose>
  214. <xsl:when test="key('env-param', 'ps_nav_stack') and not(key('env-param', 'ps_nav_stack') = '') ">
  215. <df:button df:id="IDS_CLOSE" df:style="stack-down"/>
  216. </xsl:when>
  217. <xsl:otherwise>
  218. <df:button df:id="IDS_CLOSE" df:style="back-url"/>
  219. </xsl:otherwise>
  220. </xsl:choose>
  221. </dp:footer>
  222. </utml:form>
  223. </dp:page>
  224. </xsl:template>
  225. <xsl:template name="render-credential">
  226. <xsl:param name="credential" select="."/>
  227. <xsl:param name="pos"/>
  228. <xsl:variable name="dsConnections" select="/root/dataSources/cm:queryResponse/cm:queryReply/cm:dataSourceConnection"/>
  229. <dp:section>
  230. <dp:input>
  231. <dp:section1>
  232. <xts:string id="IDS_VIEW_PROMPTS_DATASOURCE"/>
  233. </dp:section1>
  234. <dp:section2>
  235. <xts:string id="IDS_VIEW_PROMPTS_CONNECTION">
  236. <xts:param name="datasource_name"><xsl:value-of select="$dsConnections[$pos]/cm:parent/cm:dataSource/cm:defaultName"/></xts:param>
  237. <xts:param name="connection_name"><xsl:value-of select="$dsConnections[$pos]/cm:defaultName"/></xts:param>
  238. </xts:string>
  239. <xsl:choose>
  240. <xsl:when test="$credential/dataSourceSignon != ''">
  241. <xts:string id="IDS_VIEW_PROMPTS_SIGNON">
  242. <xts:param name="signon_name"><xsl:value-of select="$dsConnections[$pos]/../following-sibling::*[1]/cm:dataSourceSignon/cm:defaultName"/></xts:param>
  243. </xts:string>
  244. </xsl:when>
  245. <xsl:when test="$credential/username != '' and $credential/password != ''">
  246. <xsl:variable name="signon_name">
  247. <xts:string id="IDS_VIEW_PROMPTS_USERID_PASSWORD"/>
  248. </xsl:variable>
  249. <xts:string id="IDS_VIEW_PROMPTS_SIGNON">
  250. <xts:param name="signon_name"><xsl:value-of select="$signon_name"/></xts:param>
  251. </xts:string>
  252. </xsl:when>
  253. <xsl:when test="$credential/username != ''">
  254. <xsl:variable name="signon_name">
  255. <xts:string id="IDS_VIEW_PROMPTS_USERID_ONLY"/>
  256. </xsl:variable>
  257. <xts:string id="IDS_VIEW_PROMPTS_SIGNON">
  258. <xts:param name="signon_name"><xsl:value-of select="$signon_name"/></xts:param>
  259. </xts:string>
  260. </xsl:when>
  261. <xsl:when test="$credential/password != ''">
  262. <xsl:variable name="signon_name">
  263. <xts:string id="IDS_VIEW_PROMPTS_PASSWORD_ONLY"/>
  264. </xsl:variable>
  265. <xts:string id="IDS_VIEW_PROMPTS_SIGNON">
  266. <xts:param name="signon_name"><xsl:value-of select="$signon_name"/></xts:param>
  267. </xts:string>
  268. </xsl:when>
  269. </xsl:choose>
  270. </dp:section2>
  271. </dp:input>
  272. </dp:section>
  273. </xsl:template>
  274. <xsl:template match="*[local-name()='simpleParmValueItem']" mode="render-values">
  275. <xsl:choose>
  276. <xsl:when test="*[local-name()='display'] != ''">
  277. &#160;&apos;<xsl:value-of select="*[local-name()='display']"/>&apos;,
  278. </xsl:when>
  279. <xsl:when test="*[local-name()='use'] != ''">
  280. &#160;&apos;<xsl:value-of select="*[local-name()='use']"/>&apos;,
  281. </xsl:when>
  282. <xsl:otherwise>
  283. &#160;<xts:string id="IDS_VIEW_PROMPTS_NO_VALUE"/>,
  284. </xsl:otherwise>
  285. </xsl:choose>
  286. </xsl:template>
  287. <xsl:template match="*[local-name()='simpleParmValueItem'][last()]" mode="render-values">
  288. <xsl:choose>
  289. <xsl:when test="*[local-name()='display'] != ''">
  290. &#160;&apos;<xsl:value-of select="*[local-name()='display']"/>&apos;<xsl:text/>
  291. </xsl:when>
  292. <xsl:when test="*[local-name()='use'] != ''">
  293. &#160;&apos;<xsl:value-of select="*[local-name()='use']"/>&apos;<xsl:text/>
  294. </xsl:when>
  295. <xsl:otherwise>
  296. &#160;<xts:string id="IDS_VIEW_PROMPTS_NO_VALUE"/><xsl:text/>
  297. </xsl:otherwise>
  298. </xsl:choose>
  299. <xsl:if test="not(position() = last())"><xts:string id="IDS_LIST_SEPARATOR"/></xsl:if>
  300. </xsl:template>
  301. <xsl:template match="*[local-name()='boundRangeParmValueItem' or local-name()='unboundedEndRangeParmValueItem' or local-name()='unboundedStartRangeParmValueItem']" mode="render-values">
  302. <xsl:variable name="startDisplay">
  303. <xsl:choose>
  304. <xsl:when test="*[local-name()='start']/*[local-name()='display']!=''">
  305. <xsl:value-of select="*[local-name()='start']/*[local-name()='display']"/>
  306. </xsl:when>
  307. <xsl:otherwise>
  308. <xsl:value-of select="*[local-name()='start']/*[local-name()='use']"/>
  309. </xsl:otherwise>
  310. </xsl:choose>
  311. </xsl:variable>
  312. <xsl:variable name="endDisplay">
  313. <xsl:choose>
  314. <xsl:when test="*[local-name()='end']/*[local-name()='display']!=''">
  315. <xsl:value-of select="*[local-name()='end']/*[local-name()='display']"/>
  316. </xsl:when>
  317. <xsl:otherwise>
  318. <xsl:value-of select="*[local-name()='end']/*[local-name()='use']"/>
  319. </xsl:otherwise>
  320. </xsl:choose>
  321. </xsl:variable>
  322. <xsl:choose>
  323. <xsl:when test="$startDisplay != '' and $endDisplay != ''">
  324. <xsl:choose>
  325. <xsl:when test="$startDisplay != $endDisplay">
  326. &#160;&apos;<xts:string id="IDS_OTHERRUN_BOUNDED_RANGE_VALUE">
  327. <xts:param name="startValue"><xsl:value-of select="$startDisplay"/></xts:param>
  328. <xts:param name="endValue"><xsl:value-of select="$endDisplay"/></xts:param>
  329. </xts:string>&apos;<xsl:text/>
  330. </xsl:when>
  331. <xsl:otherwise>
  332. &#160;&apos;<xsl:value-of select="$endDisplay"/>&apos;<xsl:text/>
  333. </xsl:otherwise>
  334. </xsl:choose>
  335. </xsl:when>
  336. <xsl:when test="$startDisplay != ''">
  337. &#160;&apos;<xts:string id="IDS_OTHERRUN_RANGED_START_PARAM_VALUE">
  338. <xts:param name="startValue"><xsl:value-of select="$startDisplay"/></xts:param>
  339. </xts:string>&apos;<xsl:text/>
  340. </xsl:when>
  341. <xsl:when test="$endDisplay != ''">
  342. &#160;&apos;<xts:string id="IDS_OTHERRUN_RANGED_END_PARAM_VALUE">
  343. <xts:param name="endValue"><xsl:value-of select="$endDisplay"/></xts:param>
  344. </xts:string>&apos;<xsl:text/>
  345. </xsl:when>
  346. <xsl:otherwise>
  347. &#160;<xts:string id="IDS_VIEW_PROMPTS_NO_VALUE"/>
  348. </xsl:otherwise>
  349. </xsl:choose>
  350. <xsl:if test="not(position() = last())"><xts:string id="IDS_LIST_SEPARATOR"/></xsl:if>
  351. </xsl:template>
  352. <xsl:template match="*[local-name()='hierarchicalParmValueItem']" mode="render-values">
  353. <xsl:param name="ancestorText">
  354. <xsl:choose>
  355. <xsl:when test="./*[local-name()='value']/*[local-name()='display'] != ''">
  356. <xsl:value-of select="./*[local-name()='value']/*[local-name()='display']"/>
  357. </xsl:when>
  358. <xsl:otherwise>
  359. <xsl:value-of select="./*[local-name()='value']/*[local-name()='use']"/>
  360. </xsl:otherwise>
  361. </xsl:choose>
  362. </xsl:param>
  363. <xsl:param name="position" select="'first'"/>
  364. <xsl:choose>
  365. <xsl:when test="*[local-name()='hierarchicalParmValueItem']">
  366. <xsl:for-each select="./*[local-name()='hierarchicalParmValueItem']">
  367. <xsl:variable name="pos">
  368. <xsl:choose>
  369. <xsl:when test="$position = 'first' and position() = '1'">first</xsl:when>
  370. <xsl:otherwise>not_first</xsl:otherwise>
  371. </xsl:choose>
  372. </xsl:variable>
  373. <xsl:variable name="displayText">
  374. <xsl:choose>
  375. <xsl:when test="*[local-name()='value']/*[local-name()='display'] != ''">
  376. <xsl:value-of select="concat($ancestorText, ' &gt; ' ,*[local-name()='value']/*[local-name()='display'])"/>
  377. </xsl:when>
  378. <xsl:otherwise>
  379. <xsl:value-of select="concat($ancestorText, ' &gt; ' ,*[local-name()='value']/*[local-name()='use'])"/>
  380. </xsl:otherwise>
  381. </xsl:choose>
  382. </xsl:variable>
  383. <xsl:apply-templates select="." mode="render-values">
  384. <xsl:with-param name="ancestorText" select="concat($ancestorText, ' &gt; ' ,$displayText)"/>
  385. <xsl:with-param name="position" select="$pos"/>
  386. </xsl:apply-templates>
  387. </xsl:for-each>
  388. </xsl:when>
  389. <xsl:otherwise>
  390. <xsl:if test="$position='not_first'">
  391. <br/>
  392. </xsl:if>
  393. <xsl:text>'</xsl:text>
  394. <xsl:value-of select="$ancestorText"/>
  395. <xsl:text>'</xsl:text>
  396. </xsl:otherwise>
  397. </xsl:choose>
  398. </xsl:template>
  399. <xsl:template match="text()" mode="render-values"/>
  400. </xsl:stylesheet>
  401. </xts:block>
  402. <!--
  403. ===============================================================================================
  404. debug - display debug information
  405. ===============================================================================================
  406. -->
  407. <xts:block id="debug" dependency="format_prompts" condition=".[/root/session/param[@name='debug']='1']" type="exec" mode="output" processor="XSLT" mandatory="false" mimeType="text/html">
  408. <!-- get the debug logic sheet -->
  409. <xts:logicsheet path="logicsheets/debuglogic.xslt"/>
  410. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:dbg="http://developer.cognos.com/schemas/xts/logicsheets/xslt/debug/" exclude-result-prefixes="dbg">
  411. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
  412. <xsl:template match="/">
  413. <dbg:dumpxml select="/root"/>
  414. </xsl:template>
  415. </xsl:stylesheet>
  416. </xts:block>
  417. </xts:morphlet>