dialogs.xsl 44 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886
  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, 2014
  6. US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  7. -->
  8. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:pf="http://developer.cognos.com/schemas/xts/pf" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" xmlns:xts="http://developer.cognos.com/schemas/xts/" xmlns:qsdlg="http://developer.cognos.com/schemas/xts/logicsheets/xslt/qs/dialog/" xmlns:agsdlg="http://developer.cognos.com/schemas/xts/logicsheets/xslt/ags/dialog/" xmlns:cf="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/framework/" xmlns:doc="http://developer.cognos.com/schemas/xts/logicsheets/xslt/ags/doc/" xmlns:utml="http://developer.cognos.com/schemas/xts/logicsheet/xslt/formlogic/" xmlns:lyt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/layxsl/" xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/" xmlns:cp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/presentation/" xmlns:df="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/framework/" xmlns:out="dummy-uri" xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" exclude-result-prefixes="xsl pf xts qsdlg agsdlg cf doc utml lyt dp cp df cm xtsext">
  9. <xsl:output method="xml" encoding="UTF-8" indent="no"/>
  10. <xsl:namespace-alias stylesheet-prefix="out" result-prefix="xsl"/>
  11. <xsl:key name="env-param" match="/root/env/param" use="@name"/>
  12. <doc:group prefix="agsdlg">
  13. <doc:location>
  14. <doc:namespace>http://developer.cognos.com/schemas/xts/logicsheets/xslt/ags/dialog/</doc:namespace>
  15. <doc:ref>ps/ags/logicsheets/dialogs.xsl</doc:ref>
  16. </doc:location>
  17. </doc:group>
  18. <!-- Render a text area that has the functionality to remove selected text-->
  19. <doc:template type="control">
  20. <doc:name>removableText</doc:name>
  21. <doc:desc>renders a text area that has a "remove" action that can take out selected text</doc:desc>
  22. <doc:attr>
  23. <doc:attr-name>rows</doc:attr-name>
  24. <doc:attr-desc>The number of rows in the text area</doc:attr-desc>
  25. <doc:attr-name>cols</doc:attr-name>
  26. <doc:attr-desc>The maximum number of columns</doc:attr-desc>
  27. <doc:attr-name>name</doc:attr-name>
  28. <doc:attr-desc>The text area name</doc:attr-desc>
  29. <doc:attr-name>type</doc:attr-name>
  30. <doc:attr-desc>Can be 'action' or 'event'</doc:attr-desc>
  31. <doc:attr-name>listener</doc:attr-name>
  32. <doc:attr-desc>A call back function that is notified when text has been removed</doc:attr-desc>
  33. </doc:attr>
  34. </doc:template>
  35. <xsl:template match="agsdlg:removableText">
  36. <xsl:variable name="rows" select="@rows"/>
  37. <xsl:variable name="cols" select="@cols"/>
  38. <xsl:variable name="name" select="@name"/>
  39. <xsl:variable name="type" select="@type"/>
  40. <xsl:variable name="listener" select="@delete-listener"/>
  41. <table border="0" cellspacing="0" cellpadding="0" role="presentation">
  42. <!-- render the text area onkeyup="handleKeyPress();"-->
  43. <tr>
  44. <td class="dialogButton" align="left" valign="middle">
  45. <utml:textarea rows="{$rows}" name="{$name}" cols="{$cols}" id="{$name}" onkeydown="return false;"/>
  46. </td>
  47. </tr>
  48. <tr>
  49. <td class="formText" align="right" valign="middle">
  50. <a href="#" onclick="deleteSelectedText();">
  51. <xts:string id="IDS_REMOVE"/>
  52. </a>
  53. </td>
  54. </tr>
  55. </table>
  56. <script language="JavaScript">
  57. function isDelete(evt){
  58. evt = (evt) ? evt : (window.event) ? event : null;
  59. if (evt) {
  60. var charCode = (evt.charCode) ? evt.charCode :
  61. ((evt.keyCode) ? evt.keyCode :
  62. ((evt.which) ? evt.which : 0));
  63. }
  64. return charCode == 46 ;
  65. }
  66. /*function handleKeyPress(evt){
  67. //stop the event by returning false if we are not a delete
  68. return isDelete();
  69. }
  70. function handleKeyPress(evt){
  71. if(isDelete(evt)){
  72. //notify the agent items listener
  73. <xsl:if test="$name">
  74. parent.getAgentItemsListener().updateField('<xsl:value-of select="$name"/>', document.pform.<xsl:value-of select="$name"/>.value);
  75. </xsl:if>
  76. }
  77. }*/
  78. function deleteSelectedText(){
  79. var txt;
  80. if (document.getSelection){
  81. txt = document.getSelection();
  82. }
  83. else if (document.selection){
  84. if (window.clipboardData) {
  85. txt = document.selection.createRange().text;
  86. }else{
  87. txt = document.selection.createRange().textContent;
  88. }
  89. }
  90. else return;
  91. textArea = document.getElementById('<xsl:value-of select="$name"/>');
  92. index = -1;
  93. if(index = textArea.value.indexOf(txt) == -1){
  94. //this is not ours
  95. txt = "";
  96. }else{
  97. if("<xsl:value-of select="$type"/>" == "action"){
  98. //call a method on the nondupe js to process this text box to delete the selected text
  99. txt = getSelectedAction().nonDuplication.processDeleteQueryItem(txt);
  100. }else if("<xsl:value-of select="$type"/>" == "event"){
  101. txt = parent.getAgentDefinition().summaryEventKey.processDeleteQueryItem(txt);
  102. }else{
  103. //do a literal removal
  104. index = textArea.value.indexOf(txt);
  105. if(index != -1){
  106. textArea.value = textArea.value.substring(0, index) + textArea.value.substring(index + txt.length, textArea.value.length);
  107. }
  108. }
  109. cf.setIndicator(txt);
  110. <xsl:if test="$listener">
  111. //call the listener
  112. <xsl:value-of select="$listener"/>;
  113. </xsl:if>
  114. }
  115. }
  116. </script>
  117. </xsl:template>
  118. <!-- Render a button that will insert a selected tree object into the control nested in this tag-->
  119. <doc:template type="control">
  120. <doc:name>insertButton</doc:name>
  121. <doc:desc>Renders an insert button. This enables query items to be inserted from the model tree, when the browser does not support drag and drop.</doc:desc>
  122. <doc:example>xml/examples/agsdlg_insertButton_ex.xml</doc:example>
  123. <doc:notes>The tag must contain a child input control that has a name attribute. This is used to define the target for the insert operation.</doc:notes>
  124. </doc:template>
  125. <xsl:template match="agsdlg:insertButton">
  126. <!-- the id of the component to receive the selected tree object-->
  127. <xsl:variable name="targetId">
  128. <xsl:choose>
  129. <xsl:when test="@targetId">
  130. <xsl:value-of select="@targetId"/>
  131. </xsl:when>
  132. <xsl:otherwise>
  133. <xsl:value-of select="child::*[1]/@name"/>
  134. </xsl:otherwise>
  135. </xsl:choose>
  136. </xsl:variable>
  137. <table border="0" cellspacing="0" cellpadding="0" align="left" width="100%" role="presentation">
  138. <tr>
  139. <td valign="top" nowrap="nowrap">
  140. <!-- CellPadding of 1 insures correct horizontal alignment with textareas and inputs.-->
  141. <table border="0" cellspacing="1" cellpadding="0" role="button">
  142. <tr>
  143. <dp:columnButton>
  144. <!-- Not sure that all those attributes are needed -->
  145. <out:attribute name="valign">top</out:attribute>
  146. <out:attribute name="height">18</out:attribute>
  147. <out:attribute name="width">18</out:attribute>
  148. <out:attribute name="nowrap">nowrap</out:attribute>
  149. <img align="middle" height="18" width="18" role="button" id="id_{$targetId}" onclick="javascript:parent.dropFrame=window.name;parent.insertStartMC('{$targetId}');" ondragstart="return false;">
  150. <!-- set the attributes not in the stylesheet pass but in the final XSL pass - have to be out: attributes instead -->
  151. <out:attribute name="src">../ags/images/tree/insert.gif</out:attribute>
  152. <out:attribute name="alt">
  153. <xts:string id="TREEBAR_INSERT"/>
  154. </out:attribute>
  155. </img>
  156. </dp:columnButton>
  157. </tr>
  158. </table>
  159. </td>
  160. <td nowrap="nowrap">
  161. <img width="3" src="../ags/images/spacer.gif" alt=""/>
  162. </td>
  163. <td nowrap="nowrap" width="100%" align="left">
  164. <xsl:apply-templates/>
  165. </td>
  166. </tr>
  167. </table>
  168. </xsl:template>
  169. <doc:template type="control">
  170. <doc:name>togglebutton</doc:name>
  171. <doc:desc>Renders an on/off or toggle button. It must be defined in a &lt;utml:form> tag.</doc:desc>
  172. <doc:attr>
  173. <doc:attr-name>name</doc:attr-name>
  174. <doc:attr-desc>The name of the toggle button</doc:attr-desc>
  175. <doc:attr-name>state</doc:attr-name>
  176. <doc:attr-desc>active or inactive</doc:attr-desc>
  177. <doc:attr-name>selected</doc:attr-name>
  178. <doc:attr-desc>when true the toggle button is rendered as &quot;pressed&quot;</doc:attr-desc>
  179. </doc:attr>
  180. <doc:example>xml/examples/agsdlg_togglebutton_ex.xml</doc:example>
  181. <doc:notes>Have a look at ags/selectRecipients.xts for more information</doc:notes>
  182. </doc:template>
  183. <xsl:template match="agsdlg:togglebutton">
  184. <td class="commandButtonBorder">
  185. <xsl:if test="not(@state='inactive')">
  186. <xsl:attribute name="onmousedown">this.className = 'commandButtonDownBorder'</xsl:attribute>
  187. <xsl:attribute name="onmouseout">this.className = 'commandButtonBorder'</xsl:attribute>
  188. <xsl:attribute name="onmouseup">this.className = 'commandButtonBorder'</xsl:attribute>
  189. <xsl:attribute name="onmouseover">this.className = 'commandButtonBorder'</xsl:attribute>
  190. <xsl:attribute name="onkeydown">this.className = 'commandButtonDownBorder'</xsl:attribute>
  191. <xsl:attribute name="onkeyup">this.className = 'commandButtonBorder'</xsl:attribute>
  192. </xsl:if>
  193. <table border="0" cellpadding="0" cellspacing="0" role="presentation">
  194. <out:choose>
  195. <out:when test="$browser = 'ns4'">
  196. <!-- Specify explicit height and width for antiquated browsers like NS 4.76 -->
  197. <out:attribute name="width">70</out:attribute>
  198. <out:attribute name="height">22</out:attribute>
  199. </out:when>
  200. <out:otherwise>
  201. <!-- Use a cascading stylsheet for more "advanced" browsers -->
  202. <out:attribute name="id">noUnderLine</out:attribute>
  203. </out:otherwise>
  204. </out:choose>
  205. <tr>
  206. <td valign="middle" align="center" nowrap="nowrap" class="commandButton">
  207. <xsl:if test="not(@state='inactive')">
  208. <xsl:attribute name="onmouseover">this.className = 'commandButtonOver'</xsl:attribute>
  209. <xsl:attribute name="onmouseout">this.className = 'commandButton'</xsl:attribute>
  210. </xsl:if>
  211. <!--
  212. <xsl:if test="@selected='true'">
  213. <xsl:attribute name="style">background-color: #cccce3</xsl:attribute>
  214. </xsl:if>-->
  215. <xsl:if test="key('env-param', 'op_showUserGroups')='true'">
  216. <xsl:attribute name="style">background-color: #cccce3</xsl:attribute>
  217. </xsl:if>
  218. <img height="1" width="40" src="{'{$webcontent}'}/images/space.gif"/>
  219. <br/>
  220. <!-- minimum button width as specified by STAN -->
  221. <!-- Insert the button content text/images -->
  222. <xsl:apply-templates/>
  223. </td>
  224. </tr>
  225. </table>
  226. </td>
  227. <td width="5">
  228. <img height="1" width="8">
  229. <xsl:attribute name="src">
  230. <xsl:value-of select="'{$webcontent}'"/>/images/space.gif</xsl:attribute>
  231. </img>
  232. </td>
  233. </xsl:template>
  234. <!--
  235. produce a list of textual forms of a parameter
  236. -->
  237. <xsl:template match="agsdlg:parametersSummary">
  238. <!-- template that calls an untrimmed version via the trimmer template -->
  239. <out:template name="parametersSummary">
  240. <out:param name="parameters"/>
  241. <out:param name="parametersSummarySize"/>
  242. <out:param name="parameterAssignments">
  243. <parameterAssignments/>
  244. </out:param>
  245. <out:call-template name="trimText">
  246. <out:with-param name="trimSize" select="$parametersSummarySize"/>
  247. <out:with-param name="text">
  248. <out:call-template name="parametersSummaryUnTrimmed">
  249. <out:with-param name="parameters">
  250. <out:copy-of select="$parameters"/>
  251. </out:with-param>
  252. <out:with-param name="parameterAssignments" select="$parameterAssignments"/>
  253. </out:call-template>
  254. </out:with-param>
  255. </out:call-template>
  256. </out:template>
  257. <!--make sure we have the conditionDisplayLogic template -->
  258. <agscnd:conditionFormat xmlns:agscnd="http://developer.cognos.com/schemas/xts/logicsheets/xslt/ags/condition/"/>
  259. <!-- produces an unknown length summary of params -->
  260. <out:template name="parametersSummaryUnTrimmed">
  261. <out:param name="parameters"/>
  262. <out:param name="parameterAssignments"/>
  263. <out:value-of select="' '"/>
  264. <!-- first we must get a list of the param names -->
  265. <out:variable name="paramNames">
  266. <out:call-template name="buildParamNames">
  267. <out:with-param name="names">
  268. <out:for-each select="$parameterAssignments/parameterAssignments/parameterAssignment/parameterName">
  269. <parameterName>
  270. <out:value-of select="text()"/>
  271. </parameterName>
  272. </out:for-each>
  273. <out:for-each select="$parameters/parameterValues/item">
  274. <parameterName>
  275. <out:value-of select="./*[local-name()='name']/text()"/>
  276. </parameterName>
  277. </out:for-each>
  278. </out:with-param>
  279. <out:with-param name="position">
  280. <out:value-of select="number('1')"/>
  281. </out:with-param>
  282. </out:call-template>
  283. </out:variable>
  284. <!-- for each parameter retrieve its description-->
  285. <out:for-each select="$paramNames/parameterName">
  286. <out:sort select="."/>
  287. <out:value-of select="."/>
  288. <xts:string id="IDS_LIST_START"/>
  289. <out:value-of select="' '"/>
  290. <out:variable name="name" select="."/>
  291. <!-- only output literal if there is no model value-->
  292. <out:choose>
  293. <out:when test="$parameterAssignments/parameterAssignments/parameterAssignment[./parameterName = $name]">
  294. <out:call-template name="conditionFormatPortal">
  295. <out:with-param name="condition">
  296. <out:value-of select="$parameterAssignments/parameterAssignments/parameterAssignment[./parameterName = $name]/dataItemName"/>
  297. </out:with-param>
  298. </out:call-template>
  299. </out:when>
  300. <out:otherwise>
  301. <out:call-template name="parameterTextUnTrimmed">
  302. <out:with-param name="parameter">
  303. <out:copy-of select="$parameters/parameterValues/item[./*[local-name() = 'name'] = $name]"/>
  304. </out:with-param>
  305. </out:call-template>
  306. </out:otherwise>
  307. </out:choose>
  308. <xts:string id="IDS_LIST_END"/>
  309. <out:value-of select="' '"/>
  310. </out:for-each>
  311. </out:template>
  312. <out:template name="buildParamNames">
  313. <out:param name="list" select="''"/>
  314. <out:param name="names"/>
  315. <out:param name="position"/>
  316. <out:variable name="name" select="$names/parameterName[$position]"/>
  317. <out:variable name="nameText" select="concat($name/text(), ':')"/>
  318. <out:if test="not($position > count($names/parameterName)) and not(contains($list, $name))">
  319. <!-- we have names left to process and we dont have the current one -->
  320. <out:copy-of select="$name"/>
  321. <out:call-template name="buildParamNames">
  322. <out:with-param name="list">
  323. <out:value-of select="concat($list, $nameText)"/>
  324. </out:with-param>
  325. <out:with-param name="names">
  326. <out:copy-of select="$names"/>
  327. </out:with-param>
  328. <out:with-param name="position">
  329. <out:value-of select="number(number($position) + 1)"/>
  330. </out:with-param>
  331. </out:call-template>
  332. </out:if>
  333. </out:template>
  334. </xsl:template>
  335. <!--
  336. produce a textual form of a single parameter
  337. including the ags useModelItem params
  338. -->
  339. <xsl:template match="agsdlg:parameterText">
  340. <out:variable name="quote-string" select="{@quote-string}"/>
  341. <!-- creates a trimmable version of an individual parameters description -->
  342. <out:template name="parameterText">
  343. <out:param name="parameter"/>
  344. <out:param name="parameterTextSize" select="60"/>
  345. <out:call-template name="trimText">
  346. <out:with-param name="trimSize" select="$parameterTextSize"/>
  347. <out:with-param name="text">
  348. <out:call-template name="parameterTextUnTrimmed">
  349. <out:with-param name="parameter">
  350. <out:copy-of select="$parameter"/>
  351. </out:with-param>
  352. </out:call-template>
  353. </out:with-param>
  354. </out:call-template>
  355. </out:template>
  356. <!--tem,plate to trim whatever is passed to length -->
  357. <out:template name="trimText">
  358. <out:param name="trimSize"/>
  359. <out:param name="text"/>
  360. <!--trims the descriptions to length -->
  361. <out:variable name="ellipsis">
  362. <xts:string id="IDS_LIST_ELLIPSIS"/>
  363. </out:variable>
  364. <out:choose>
  365. <out:when test="string-length($text) > number($trimSize)">
  366. <out:value-of select="concat(substring($text,1, number($trimSize) - 3),$ellipsis)"/>
  367. </out:when>
  368. <out:otherwise>
  369. <out:value-of select="$text"/>
  370. </out:otherwise>
  371. </out:choose>
  372. </out:template>
  373. <!--produce a text description of a parameter of unknown length -->
  374. <out:template name="parameterTextUnTrimmed">
  375. <out:param name="parameter"/>
  376. <!-- get the name of the parameter - for credential matchup -->
  377. <out:variable name="paramName" select="$parameter/item/name"/>
  378. <!-- Check that this parameter is of type crednetials -->
  379. <out:variable name="type">
  380. <out:value-of select="boolean(/root/parametersResponse/parameter/item[./type='credential' and ./name=$paramName])"/>
  381. </out:variable>
  382. <!--check were called with the right single element -->
  383. <out:choose>
  384. <out:when test="$type='true'">
  385. <!-- We have a credentials. Strip em out-->
  386. <out:call-template name="credentials">
  387. <out:with-param name="credentialParam">
  388. <out:copy-of select="/root/credentialParameters/credentialParameter[@name=$paramName]"/>
  389. </out:with-param>
  390. </out:call-template>
  391. </out:when>
  392. <out:when test="$parameter/item[contains(@xsi:type, 'parameterValue')] and count($parameter) = 1">
  393. <out:apply-templates select="$parameter/item/value/item" mode="render-values"/>
  394. </out:when>
  395. </out:choose>
  396. </out:template>
  397. <out:template match="item[contains(@xsi:type, 'simpleParmValueItem')]" mode="render-values">
  398. <out:choose>
  399. <out:when test="*[local-name()='display'] != ''">
  400. <out:value-of select="$quote-string"/>
  401. <out:value-of select="*[local-name()='display']"/>
  402. <out:value-of select="$quote-string"/>
  403. <out:if test="position() != last()">
  404. <xts:string id="IDS_LIST_SEPARATOR"/>
  405. </out:if>
  406. </out:when>
  407. </out:choose>
  408. </out:template>
  409. <out:template match="item[contains(@xsi:type, 'boundRangeParmValueItem') or contains(@xsi:type, 'unboundedEndRangeParmValueItem') or contains(@xsi:type, 'unboundedStartRangeParmValueItem')]" mode="render-values">
  410. <out:variable name="startDisplay" select="*[local-name()='start']/*[local-name()='display']"/>
  411. <out:variable name="endDisplay" select="*[local-name()='end']/*[local-name()='display']"/>
  412. <out:choose>
  413. <out:when test="$startDisplay != '' and $endDisplay != ''">
  414. <out:choose>
  415. <out:when test="$startDisplay != $endDisplay">
  416. <out:value-of select="$quote-string"/>
  417. <xts:string id="IDS_OTHERRUN_BOUNDED_RANGE_VALUE">
  418. <xts:param name="startValue">
  419. <out:value-of select="$startDisplay"/>
  420. </xts:param>
  421. <xts:param name="endValue">
  422. <out:value-of select="$endDisplay"/>
  423. </xts:param>
  424. </xts:string>
  425. <out:value-of select="$quote-string"/>
  426. </out:when>
  427. <out:otherwise>
  428. <out:value-of select="$quote-string"/>
  429. <out:value-of select="$endDisplay"/>
  430. <out:value-of select="$quote-string"/>
  431. </out:otherwise>
  432. </out:choose>
  433. </out:when>
  434. <out:when test="$startDisplay != ''">
  435. <out:value-of select="$quote-string"/>
  436. <xts:string id="IDS_OTHERRUN_RANGED_START_PARAM_VALUE">
  437. <xts:param name="startValue">
  438. <out:value-of select="$startDisplay"/>
  439. </xts:param>
  440. </xts:string>
  441. <out:value-of select="$quote-string"/>
  442. </out:when>
  443. <out:when test="$endDisplay != ''">
  444. <out:value-of select="$quote-string"/>
  445. <xts:string id="IDS_OTHERRUN_RANGED_END_PARAM_VALUE">
  446. <xts:param name="endValue">
  447. <out:value-of select="$endDisplay"/>
  448. </xts:param>
  449. </xts:string>
  450. <out:value-of select="$quote-string"/>
  451. </out:when>
  452. </out:choose>
  453. <out:if test="not(position() = last())">
  454. <xts:string id="IDS_LIST_SEPARATOR"/>
  455. </out:if>
  456. </out:template>
  457. <out:template match="item[contains(@xsi:type, 'hierarchicalParmValueItem')]" mode="render-values">
  458. <out:param name="ancestorText" select="./*[local-name()='value']/*[local-name()='display']"/>
  459. <out:param name="position" select="'first'"/>
  460. <out:choose>
  461. <out:when test="./subNodes/item[contains(@xsi:type, 'hierarchicalParmValueItem')]">
  462. <out:for-each select="./subNodes/item[contains(@xsi:type, 'hierarchicalParmValueItem')]">
  463. <out:variable name="pos">
  464. <out:choose>
  465. <out:when test="$position = 'first' and position() = '1'">first</out:when>
  466. <out:otherwise>not_first</out:otherwise>
  467. </out:choose>
  468. </out:variable>
  469. <out:apply-templates select="." mode="render-values">
  470. <out:with-param name="ancestorText" select="concat($ancestorText, ' &gt; ' ,*[local-name()='value']/*[local-name()='display'])"/>
  471. <out:with-param name="position" select="$pos"/>
  472. </out:apply-templates>
  473. </out:for-each>
  474. </out:when>
  475. <out:otherwise>
  476. <out:if test="$position='not_first'">
  477. <br/>
  478. </out:if>
  479. <out:value-of select="$quote-string"/>
  480. <out:value-of select="$ancestorText"/>
  481. <out:value-of select="$quote-string"/>
  482. </out:otherwise>
  483. </out:choose>
  484. </out:template>
  485. <out:template name='credentials' >
  486. <out:param name="credentialParam"/>
  487. <out:if test="$credentialParam//dataSource">
  488. <out:choose>
  489. <out:when test="$credentialParam//dataSource//*[local-name()='dataSourceSignon']">
  490. <xts:string id="DIALOG_PROMPT_CONNECTION_SIGNON">
  491. <xts:param name="connection_name">
  492. <out:value-of select="$credentialParam//*[local-name()='dataSourceConnection']/*[local-name()='defaultName']"/>
  493. </xts:param>
  494. <xts:param name="signon_name">
  495. <out:value-of select="$credentialParam//*[local-name()='dataSourceSignon']/*[local-name()='defaultName']"/>
  496. </xts:param>
  497. </xts:string>
  498. </out:when>
  499. <out:otherwise>
  500. <xts:string id="DIALOG_PROMPT_CONNECTION_NO_SIGNON">
  501. <xts:param name="connection_name">
  502. <out:value-of select="$credentialParam//*[local-name()='dataSourceConnection']/*[local-name()='defaultName']"/>
  503. </xts:param>
  504. </xts:string>
  505. </out:otherwise>
  506. </out:choose>
  507. </out:if>
  508. </out:template>
  509. <!-- match anything -->
  510. <out:template match="*">
  511. <out:copy>
  512. <out:copy-of select="@*"/>
  513. <out:apply-templates/>
  514. </out:copy>
  515. </out:template>
  516. </xsl:template>
  517. <!--
  518. dp:box - provides side by side compartments with spacing between them.
  519. -->
  520. <xsl:template match="agsdlg:box">
  521. <table border="0" cellspacing="0" cellpadding="1" role="presentation">
  522. <xsl:if test="@width">
  523. <xsl:attribute name="width">
  524. <xsl:value-of select="@width"/>
  525. </xsl:attribute>
  526. </xsl:if>
  527. <xsl:if test="@title">
  528. <tr>
  529. <td nowrap="nowrap" colspan="{2 * count(descendant::dp:section) - 1}" class="formLabel">
  530. <xts:string id="{@title}"/>
  531. </td>
  532. </tr>
  533. </xsl:if>
  534. <tr>
  535. <xsl:if test="@valign">
  536. <xsl:attribute name="valign">
  537. <xsl:value-of select="@valign"/>
  538. </xsl:attribute>
  539. </xsl:if>
  540. <xsl:apply-templates/>
  541. </tr>
  542. <xsl:if test="not(@noSpace) or @noSpace = 'false'">
  543. <tr>
  544. <td nowrap="nowrap">
  545. <img height="5" width="1">
  546. <xsl:attribute name="src">
  547. <xsl:value-of select="'{$webcontent}'"/>/images/space.gif</xsl:attribute>
  548. </img>
  549. </td>
  550. </tr>
  551. </xsl:if>
  552. </table>
  553. </xsl:template>
  554. <!--
  555. dp:boxSection - containers in a box.
  556. -->
  557. <xsl:template match="agsdlg:boxSection">
  558. <td nowrap="nowrap">
  559. <xsl:if test="@width">
  560. <xsl:attribute name="width">
  561. <xsl:value-of select="@width"/>
  562. </xsl:attribute>
  563. </xsl:if>
  564. <xsl:if test="@height">
  565. <xsl:attribute name="height">
  566. <xsl:value-of select="@height"/>
  567. </xsl:attribute>
  568. </xsl:if>
  569. <xsl:if test="@align">
  570. <xsl:attribute name="align">
  571. <xsl:value-of select="@align"/>
  572. </xsl:attribute>
  573. </xsl:if>
  574. <xsl:if test="@valign">
  575. <xsl:attribute name="valign">
  576. <xsl:value-of select="@valign"/>
  577. </xsl:attribute>
  578. </xsl:if>
  579. <xsl:attribute name="class">
  580. <xsl:choose>
  581. <xsl:when test="@type='label'">formLabel</xsl:when>
  582. <xsl:otherwise>formText</xsl:otherwise>
  583. </xsl:choose>
  584. </xsl:attribute>
  585. <xsl:apply-templates select="child::node()"/>
  586. </td>
  587. <xsl:if test="@hgap">
  588. <td nowrap="nowrap">
  589. <img height="5" width="{@hgap}">
  590. <xsl:attribute name="src">
  591. <xsl:value-of select="'{$webcontent}'"/>/images/space.gif</xsl:attribute>
  592. </img>
  593. </td>
  594. </xsl:if>
  595. </xsl:template>
  596. <xsl:template match="agsdlg:header">
  597. <script language="javascript">
  598. var sParamDelimiter = "<out:value-of select="xtsext:javascriptencode(string(key('system-param', 'delimiters')/@d1))"/>";
  599. var sNameValueDelimiter = "<out:value-of select="xtsext:javascriptencode(string(key('system-param', 'delimiters')/@d2))"/>";
  600. var sCookiePath = "<out:value-of select="xtsext:javascriptencode(string($cookie_path))"/>";
  601. var sCookieDomain = "<out:value-of select="xtsext:javascriptencode(string($cookie_domain))"/>";
  602. var fHideFlyout = null;
  603. var sActiveFlyout = "";
  604. function dponclick(event)
  605. {
  606. if (fHideFlyout)
  607. {
  608. fHideFlyout();
  609. fHideFlyout = null;
  610. }
  611. return true;
  612. }
  613. function dponresize()
  614. {
  615. if (fHideFlyout)
  616. {
  617. fHideFlyout();
  618. fHideFlyout = null;
  619. }
  620. return true;
  621. }
  622. //window.onresize = dponresize;
  623. //document.onclick = dponclick;
  624. </script>
  625. <script language="javascript">
  626. <out:attribute name="src">
  627. <out:value-of select="$webcontent"/>/<out:value-of select="$app"/>/js/cookie_jar.js<out:text/>
  628. </out:attribute>
  629. </script>
  630. <script language="javascript">
  631. function debug()
  632. {
  633. if (window.event.altKey)
  634. {
  635. if (getSessionValue("debug") != "1")
  636. setStateValue("debug", "1");
  637. else
  638. setStateValue("debug", "0");
  639. location.reload();
  640. }
  641. }
  642. </script>
  643. <table role="presentation" border="0" cellpadding="0" cellspacing="0" width="100%">
  644. <tr style="display:block;">
  645. <td height="5px" style="display:block;">
  646. <img border="0" alt="" src="../ags/images/spacer.gif" height="5"/>
  647. </td>
  648. </tr>
  649. <tr style="display:block;">
  650. <td>
  651. <table role="presentation" border="0" cellpadding="0" cellspacing="0" width="100%">
  652. <tr>
  653. <td width="24px" height="24px" valign="middle" align="center">
  654. <!-- copy the contents of the dp image -->
  655. <xsl:copy-of select="./dp:image/*"/>
  656. </td>
  657. <td width="5px">
  658. <img border="0" alt="" src="../ags/images/spacer.gif" width="5px"/>
  659. </td>
  660. <td class="page_label">
  661. <!-- copy the contents of the dp:title -->
  662. <span role="presentation" onclick="debug()">
  663. <xsl:copy-of select="dp:title/child::node()"/>
  664. </span>
  665. </td>
  666. </tr>
  667. </table>
  668. </td>
  669. </tr>
  670. <tr style="display:block;">
  671. <td height="5px" style="display:block;">
  672. <img border="0" alt="" src="../ags/images/spacer.gif" height="5"/>
  673. </td>
  674. </tr>
  675. <tr>
  676. <td>
  677. <table role="presentation" border="0" cellpadding="0" cellspacing="0" width="97%">
  678. <tr>
  679. <td width="10px">
  680. <img border="0" alt="" src="../ags/images/spacer.gif" width="10px"/>
  681. </td>
  682. <td class="text2">
  683. <!-- copy the contents of the dp:description -->
  684. <xsl:copy-of select="./dp:description/*"/>
  685. </td>
  686. </tr>
  687. </table>
  688. </td>
  689. </tr>
  690. </table>
  691. </xsl:template>
  692. <!--
  693. dynamic div to show the default report options section.
  694. /root/agent_definition/agentOptions
  695. -->
  696. <xsl:template match="agsdlg:defaultReportOptionsDiv">
  697. <out:variable name="useReportOptionsForDefault" select="/root/agent_definition/agentOptions/*[local-name()='options']/*[local-name()='value']/*[local-name()='item']/*[local-name()='name']='outputFormat'"/>
  698. <out:variable name="reportOptions" select="/root/agent_definition/agentOptions/*[local-name()='options']/*[local-name()='value']/*[local-name()='item']"/>
  699. <out:variable name="agentOptionBurstSet" select="$reportOptions[./*[local-name()='name']='burst']/*[local-name()='value'] = 'true' "/>
  700. <out:variable name="reportIsBurstable" select="/root/*[local-name()='queryResponse']/*[local-name()='queryReply'][2]/*[local-name()='report']/*[local-name()='canBurst']='true'"/>
  701. <!-- only show the bursting section if :
  702. agent defaults burst option is set(/root/agent_definition/agentOptions/options/value/item/value)
  703. report is setup for burting(/root/queryResponse/queryReply/report/canBurst)
  704. -->
  705. <out:variable name="showBursting" select="$agentOptionBurstSet and $reportIsBurstable"/>
  706. <!-- read only default options -->
  707. <cf:dynamicDiv name="defaultOptions">
  708. <dp:input>
  709. <dp:section1>
  710. <xts:string id="IDS_OTHERRUN_FORMAT"/>
  711. </dp:section1>
  712. <dp:section2>
  713. <out:choose>
  714. <out:when test="$useReportOptionsForDefault">
  715. <out:choose>
  716. <out:when test="/root/env/param[@name='formatSummary'] !=''">
  717. <out:value-of select="/root/env/param[@name='formatSummary']"/>
  718. </out:when>
  719. <out:otherwise>
  720. <out:value-of select="/root/agent_definition/agentOptions/UIHelpers/formatSummary"/>
  721. </out:otherwise>
  722. </out:choose>
  723. </out:when>
  724. <out:otherwise>
  725. <xts:string id="IDS_OTHERRUN_DEFAULT"/>
  726. </out:otherwise>
  727. </out:choose>
  728. </dp:section2>
  729. </dp:input>
  730. <dp:input>
  731. <dp:section1>
  732. <xts:string id="IDS_OTHERRUN_LANGUAGE"/>
  733. </dp:section1>
  734. <dp:section2>
  735. <out:choose>
  736. <out:when test="$useReportOptionsForDefault">
  737. <out:for-each select="$reportOptions[./*[local-name()='name']='outputLocale']/*[local-name()='value']/*[local-name()='item']">
  738. <out:sort select="."/>
  739. <out:variable name="locale" select="."/>
  740. <out:value-of select="/root/config/param[@name='locale']/locale[@type='contentLocale' and id=$locale]/displayName"/>
  741. <out:if test="position() != last()">
  742. <out:text>, </out:text>
  743. </out:if>
  744. </out:for-each>
  745. </out:when>
  746. <out:otherwise>
  747. <xts:string id="IDS_OTHERRUN_DEFAULT"/>
  748. </out:otherwise>
  749. </out:choose>
  750. </dp:section2>
  751. </dp:input>
  752. <xsl:if test="@deliverySection != 'false'">
  753. <dp:input>
  754. <dp:section1>
  755. <xts:string id="IDS_OTHERRUN_DELIVERY"/>
  756. </dp:section1>
  757. <dp:section2>
  758. <out:choose>
  759. <out:when test="$useReportOptionsForDefault">
  760. <out:variable name="saveSummary">
  761. <out:if test="$reportOptions[./*[local-name()='name']='saveOutput']/*[local-name()='value'] = 'true'">
  762. <xts:string id="IDS_OTHERRUN_SAVE_REPORTS"/>
  763. </out:if>
  764. </out:variable>
  765. <out:variable name="printSummary">
  766. <out:choose>
  767. <out:when test="/root/env/param[@name='printerSummary'] != ''">
  768. <xts:string id="IDS_CONFIRMATION_PRINT_REPORTS"/>
  769. <out:value-of select="concat(' ', /root/env/param[@name='printerSummary'])"/>
  770. </out:when>
  771. <out:when test="/root/agent_definition/agentOptions/UIHelpers/printerSummary != ''">
  772. <xts:string id="IDS_CONFIRMATION_PRINT_REPORTS"/>
  773. <out:value-of select="concat(' ', /root/agent_definition/agentOptions/UIHelpers/printerSummary)"/>
  774. </out:when>
  775. </out:choose>
  776. </out:variable>
  777. <out:variable name="emailSummary">
  778. <out:if test="$reportOptions[./*[local-name()='name']='email']/*[local-name()='value'] = 'true'">
  779. <out:choose>
  780. <out:when test="/root/env/param[@name='emailSummary'] != ''">
  781. <out:value-of select="/root/env/param[@name='emailSummary']"/>
  782. </out:when>
  783. <out:otherwise>
  784. <out:value-of select="/root/agent_definition/agentOptions/UIHelpers/emailSummary"/>
  785. </out:otherwise>
  786. </out:choose>
  787. <!-- if bursting is false then show the email recipients -->
  788. <out:if test="$showBursting=false">
  789. <xsl:value-of select="': '"/>
  790. <out:choose>
  791. <out:when test="/root/env/param[@name='emailDescription'] != ''">
  792. <out:value-of select="/root/env/param[@name='emailDescription']"/>
  793. </out:when>
  794. <out:otherwise>
  795. <out:choose>
  796. <out:when test="/root/reportOptions/UIHelpers/emailRecipients != ''">
  797. <out:value-of select="/root/agent_definition/agentOptions/UIHelpers/emailRecipients"/>
  798. </out:when>
  799. <out:when test="/root/agent_definition/agentOptions/UIHelpers/emailRecipientsCount = '1'">
  800. <xts:string id="IDS_OTHERRUN_EMAIL_ONE_RECIPIENT"/>
  801. </out:when>
  802. <out:otherwise>
  803. <xts:string id="IDS_OTHERRUN_EMAIL_RECIPIENT_COUNT">
  804. <xts:param name="numPeople">
  805. <out:value-of select="/root/agent_definition/agentOptions/UIHelpers/emailRecipientsCount"/>
  806. </xts:param>
  807. </xts:string>
  808. </out:otherwise>
  809. </out:choose>
  810. </out:otherwise>
  811. </out:choose>
  812. </out:if>
  813. </out:if>
  814. </out:variable>
  815. <out:if test="$saveSummary != ''">
  816. <out:value-of select="$saveSummary"/>
  817. <out:if test="$printSummary!='' or $emailSummary!=''">
  818. <xsl:value-of select="', '"/>
  819. </out:if>
  820. </out:if>
  821. <out:if test="$printSummary != ''">
  822. <out:value-of select="$printSummary"/>
  823. <out:if test="$emailSummary != ''">
  824. <xsl:value-of select="', '"/>
  825. </out:if>
  826. </out:if>
  827. <out:if test="$emailSummary != ''">
  828. <out:value-of select="$emailSummary"/>
  829. </out:if>
  830. </out:when>
  831. <out:otherwise>
  832. <xts:string id="IDS_OTHERRUN_SAVE_REPORT"/>
  833. </out:otherwise>
  834. </out:choose>
  835. </dp:section2>
  836. </dp:input>
  837. <!-- bursting -->
  838. <out:if test="$showBursting">
  839. <dp:input>
  840. <dp:section1>
  841. <xts:string id="IDS_OTHERRUN_BURST_TITLE"/>
  842. </dp:section1>
  843. <dp:section2>
  844. <xts:string id="IDS_OTHERRUN_BURST_MULTIPLE_REPORTS"/>
  845. </dp:section2>
  846. </dp:input>
  847. </out:if>
  848. </xsl:if>
  849. </cf:dynamicDiv>
  850. </xsl:template>
  851. <!--
  852. * - This next template is required to copy all other elements into the result.
  853. -->
  854. <xsl:template match="*">
  855. <xsl:copy>
  856. <xsl:copy-of select="@*"/>
  857. <xsl:apply-templates/>
  858. </xsl:copy>
  859. </xsl:template>
  860. </xsl:stylesheet>