summarybar.xslt 49 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820
  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. <!--
  9. ================================================================================
  10. do the summaryBar - render the HTML for it
  11. ===============================================================================================
  12. -->
  13. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xos="http://developer.cognos.com/schemas/xts/output/" xmlns:cp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/presentation/" xmlns:agsad="http://developer.cognos.com/schemas/xts/logicsheets/xslt/ags/agentDefinition/" xmlns:pf="http://developer.cognos.com/schemas/xts/pf" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:out="http://www.w3.org/1999/XSL/Transform" xmlns:cf="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/framework/" xmlns:xts="http://developer.cognos.com/schemas/xts/" xmlns:agsdlg="http://developer.cognos.com/schemas/xts/logicsheets/xslt/ags/dialog/" exclude-result-prefixes="xts xsl xos cp agsad pf xtsext out cf agsdlg">
  14. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no"/>
  15. <!-- add any theme variables -->
  16. <pf:variables/>
  17. <!-- template to get a suppression gif-->
  18. <agsad:taskSuppressionState/>
  19. <!-- start the output -->
  20. <xsl:template match="/root">
  21. <!-- define a couple of variables which are used in here -->
  22. <!-- the tabSelectedID and prevTabSelectedID - are either agent_items ids - or 'schedule' or 'condition' -->
  23. <input type="hidden" id="tabSelectedID" name="tabSelectedID" value="{/root/sb/param[@name='tabSelectedID']}"/>
  24. <!-- prev tab maintains where we were - tabSelectedID is changed when we are switching tabs - so that the destination -->
  25. <input type="hidden" id="prevTabID" name="prevTabID" value="{/root/sb/param[@name='tabSelectedID']}"/>
  26. <!-- the type of the task that we want to create - 'agent', 'job', 'report', 'message', 'sql', or 'web' -->
  27. <input type="hidden" id="newTaskType" name="newTaskType" value="{/root/sb/param[@name='newTaskType']}"/>
  28. <!-- a couple of ids which are used for dragging/dropping items on the summary bar -->
  29. <input type="hidden" id="itemSelected" name="itemSelected" value="{/root/sb/param[@name='itemSelected']}"/>
  30. <input type="hidden" id="itemNewLocation" name="itemNewLocation" value="{/root/sb/param[@name='itemNewLocation']}"/>
  31. <!-- what operation we are performing on agentDefinition - "shuffle", "move_up", "move_way_up", "move_down", "move_way_down", "remove" -->
  32. <input type="hidden" id="agentItemOp" name="agentItemOp" value="{/root/sb/param[@name='agentItemOp']}"/>
  33. <!-- this is maintained here too -->
  34. <input type="hidden" name="cafcontextid" id="cafcontextid" value="{/root/sb/param[@name='cafcontextid']}"/>
  35. <!-- Tell the portal that this is AGS. This is mainly when authentication expires and defautlHandler kicks in-->
  36. <input type="hidden" name="agsSave_m_app" id="agsSave_m_app" value="AS"/>
  37. <!-- Tell the portal that this is AGS. This is mainly when authentication expires and defautlHandler kicks in-->
  38. <input type="hidden" name="m_app" id="m_app" value="AS"/>
  39. <xsl:if test="not(/root/env/param[@name='controller_state']) or /root/env/param[@name='controller_state']='' or string(xtsext:substringAfterLast(string(/root/env/param[@name='controller_state']), '|'))='canceled' or string(xtsext:substringAfterLast(string(/root/env/param[@name='controller_state']), '|'))='finished' ">
  40. <xsl:call-template name="doSummaryBar"/>
  41. </xsl:if>
  42. </xsl:template>
  43. <xsl:template name="doSummaryBar">
  44. <table border="0" cellpadding="0" cellspacing="0" style="width:100%; height:100%; overflow:hidden" role="presentation">
  45. <tr>
  46. <td id="flyout_td" valign="bottom" align="left" width="12px" >
  47. <!-- menu button , column 1-->
  48. <table border="0" cellpadding="0" cellspacing="0" role="button">
  49. <tr>
  50. <td id="menu_button" class="flybutton" valign="middle" align="left" >
  51. <xsl:attribute name="role">button</xsl:attribute>
  52. <xsl:attribute name="onmouseover">this.className='flybutton_hover';window.status='';return true;</xsl:attribute>
  53. <xsl:attribute name="onmouseout">this.className='flybutton';window.status='';return true;</xsl:attribute>
  54. <xsl:attribute name="onmousedown">this.className='flybutton_pressed';window.status='';return true;</xsl:attribute>
  55. <xsl:variable name="dropDown" ><xts:string id="DROP_DOWN_TOOL_TIP"/></xsl:variable>
  56. <img title="{$dropDown}" role="button" alt="{$dropDown}" src="../ags/images/summary/summary_menu_button.gif" onmouseup="removeSummaryBarTasksMenuListener();showSummaryBarTasksMenu(event);summaryBar_cancelBub(event);"/>
  57. </td>
  58. <td>
  59. <img border="0" height="62" width="2" alt="" src="../ags/images/spacer.gif"/>
  60. </td>
  61. </tr>
  62. <tr>
  63. <td id="summaryDropdown" style="vertical-align:bottom;height:2px">
  64. <xsl:call-template name="makeContextMenu"/>
  65. </td>
  66. </tr>
  67. </table>
  68. </td>
  69. <td id="mainCell" align="left" style="width:100%; height:100%; overflow:hidden">
  70. <table border="0" cellpadding="0" cellspacing="0" role="presentation" style="width:100%; height:100%; overflow:visible">
  71. <tr>
  72. <td>
  73. <div class="summaryHeaderBoundary" id="SummaryBarScrollpane2" style="height:21px;">
  74. <table border="0" cellpadding="0" cellspacing="0" role="presentation" style="height:100%;">
  75. <tr>
  76. <!-- Left side of the button panel -->
  77. <td>
  78. <img border="0" height="2" width="10" alt="" src="../ags/images/spacer.gif"/>
  79. </td>
  80. <!-- make the condition button -->
  81. <xsl:call-template name="persistButtonHeader">
  82. <xsl:with-param name="name"><xts:string id="AGENT_CONDITION_LABEL"/></xsl:with-param>
  83. </xsl:call-template>
  84. <!-- build the agent items tabs -->
  85. <xsl:call-template name="agentItemHeaders">
  86. <xsl:with-param name="name"><xts:string id="AGENT_ACTIONS_LABEL"/></xsl:with-param>
  87. <xsl:with-param name="class"/>
  88. </xsl:call-template>
  89. <!-- extend this out -->
  90. <td width="100%" style="display: block; height: 1px;">
  91. <img border="0" height="1" width="12" alt="" src="../ags/images/spacer.gif"/>
  92. </td>
  93. </tr>
  94. </table>
  95. </div>
  96. </td>
  97. </tr>
  98. <tr>
  99. <td>
  100. <div class="summaryBoundary" id="SummaryBarScrollpane">
  101. <table border="0" cellpadding="1" cellspacing="0" role="menubar">
  102. <tr>
  103. <!-- Left side of the button panel -->
  104. <td class="item_not_selected">
  105. <img border="0" height="60" width="2" alt="" src="../ags/images/spacer.gif"/>
  106. </td>
  107. <!-- make the condition button -->
  108. <xsl:call-template name="persistButton">
  109. <xsl:with-param name="name">AgentTask-condition</xsl:with-param>
  110. <xsl:with-param name="type">condition</xsl:with-param>
  111. <xsl:with-param name="desc">
  112. <!-- set the value of condition default is none-->
  113. <xsl:value-of select="/root/agent_definition/condition"/>
  114. </xsl:with-param>
  115. </xsl:call-template>
  116. <!-- build the agent items tabs -->
  117. <xsl:choose>
  118. <xsl:when test="//agent_definition/items/item">
  119. <xsl:call-template name="agentItems"/>
  120. </xsl:when>
  121. <xsl:otherwise>
  122. <xsl:call-template name="agentItemHeaders">
  123. <xsl:with-param name="class">
  124. <xsl:text>item_not_selected</xsl:text>
  125. </xsl:with-param>
  126. </xsl:call-template>
  127. </xsl:otherwise>
  128. </xsl:choose>
  129. <!-- extend this out -->
  130. <td class="item_not_selected" width="100%">
  131. <img border="0" height="60" width="12" alt="" src="../ags/images/spacer.gif"/>
  132. </td>
  133. </tr>
  134. </table>
  135. </div>
  136. <!-- Add tooltip here ready to be used otherwise it might give flickers -->
  137. <div id="dragTip" style="display:hidden"/>
  138. </td>
  139. </tr>
  140. </table>
  141. </td>
  142. <td id="scroll_td" valign="bottom" align="center" width="24px">
  143. <!-- make the scroll buttons at right end-->
  144. <table border="0" role="presentation">
  145. <tr>
  146. <xsl:variable name="leftToolTip" ><xts:string id="SCROL_LEFT_TOOL_TIP"/></xsl:variable>
  147. <td id="scroll_left" class="button" title="{$leftToolTip}">
  148. <xsl:attribute name="role">button</xsl:attribute>
  149. <xsl:attribute name="onmouseover">this.className='button_hover';window.status='';return true;</xsl:attribute>
  150. <xsl:attribute name="onmouseout">this.className='button';window.status='';return true;</xsl:attribute>
  151. <xsl:attribute name="onmousedown">scrollLeftDown();</xsl:attribute>
  152. <xsl:attribute name="onmouseup">this.className='button_hover';window.status='';return true;</xsl:attribute>
  153. <xsl:attribute name="onclick">goLeft();</xsl:attribute>
  154. <img alt="{$leftToolTip}" role="button" src="../ags/images/summary/summary_scroll_left.gif"/>
  155. </td>
  156. <xsl:variable name="rightToolTip" ><xts:string id="SCROL_RIGHT_TOOL_TIP"/></xsl:variable>
  157. <td id="scroll_right" class="button" title="{$rightToolTip}">
  158. <xsl:attribute name="role">button</xsl:attribute>
  159. <xsl:attribute name="onmouseover">this.className='button_hover';window.status='';return true;</xsl:attribute>
  160. <xsl:attribute name="onmouseout">this.className='button';window.status='';return true;</xsl:attribute>
  161. <xsl:attribute name="onmousedown">scrollRightDown();</xsl:attribute>
  162. <xsl:attribute name="onmouseup">this.className='button_hover';window.status='';return true;</xsl:attribute>
  163. <xsl:attribute name="onclick">goRight();</xsl:attribute>
  164. <img alt="{$rightToolTip}" role="button" src="../ags/images/summary/summary_scroll_right.gif"/>
  165. </td>
  166. </tr>
  167. </table>
  168. </td>
  169. </tr>
  170. </table>
  171. <script language="Javascript">
  172. if (document.all) {
  173. var summaryBarDiv = document.getElementById("d1");
  174. summaryBarDiv.onresize = setBarSize;
  175. } else {
  176. window.onresize = setBarSize;
  177. }
  178. // A11Y check for keyboard support
  179. if (AccessibilityHandler.isEnabled()) {
  180. AccessibilityHandler.initSummaryBar();
  181. }
  182. //set the task count into the config object
  183. window.parent.getConfigFrame().cfgSet("TaskCount",&quot;<xsl:value-of select="count(/root/agent_definition/items/item)"/>&quot;);
  184. // we're displaying the summary bar - so we should be displaying the correct menu - this also
  185. // the set submission of tasks hide/show
  186. parent.changeTaskMenu('task2');
  187. </script>
  188. </xsl:template>
  189. <!-- This is the context menu which user can click to jump on any task
  190. it is dynamic menu which shows the tasks added into the agent -->
  191. <xsl:template name="makeContextMenu">
  192. <script language="Javascript">
  193. function doSelectTabCommand(id,type,removeListener) {
  194. var mgr = parent.getConfigFrame().getCommandStackManager();
  195. var cmdStack=null;
  196. cmdStack=mgr.createCommandStack("checkCAF()","getMessageIFrame().selectTab(\'"+id+"\',\'"+type+"\');");
  197. mgr.doCommandStack(cmdStack);
  198. if (removeListener==true) {
  199. removeSummaryBarTasksMenuListener();
  200. }
  201. }
  202. function initSummaryMenu() {
  203. var summaryMenuTD=document.getElementById('summaryDropdown');
  204. var menuItemStyle = new CUIStyle('menuItem_normal', 'menuItem_hover', '', '', 'task_active');
  205. var menuStyle = new CUIStyle('menuContainer', '', '', '', '');
  206. summaryBarMenu = new CMenu('summaryMenu',menuStyle);
  207. summaryBarMenu.setHTMLContainer(summaryMenuTD);
  208. // A11Y check for keyboard support
  209. if (AccessibilityHandler.isEnabled()) {
  210. AccessibilityHandler.initSummaryBar();
  211. }
  212. <xsl:variable name="conditionTooltip">
  213. <xsl:value-of select="/root/agent_definition/condition"/>
  214. </xsl:variable>
  215. <xsl:variable name="conditionName">
  216. <xsl:call-template name="reduceToMaxSize">
  217. <xsl:with-param name="anystring">
  218. <!-- doc: pick the condition description -->
  219. <xsl:call-template name="setText">
  220. <xsl:with-param name="theText">
  221. <xsl:value-of select="/root/agent_definition/condition"/>
  222. </xsl:with-param>
  223. </xsl:call-template>
  224. </xsl:with-param>
  225. <xsl:with-param name="maxsize">20</xsl:with-param>
  226. </xsl:call-template>
  227. </xsl:variable>
  228. var command = "doSelectTabCommand('AgentTask-condition','condition',true)";
  229. var conditionMenu = new CMenuItem(summaryBarMenu, &quot;<xsl:value-of select="xtsext:javascriptencode(string($conditionName))"/>&quot;, &quot;<xsl:value-of select="xtsext:javascriptencode(concat('task', position()))"/>&quot;,command,'',menuItemStyle,&quot;<xsl:value-of select="xtsext:javascriptencode(string($conditionName))"/>&quot;, &quot;<xsl:value-of select="xtsext:javascriptencode(string($conditionTooltip))"/>&quot;);
  230. <xsl:if test="/root/sb/param[@name='tabSelectedID'] ='AgentTask-condition'">
  231. conditionMenu.disable();
  232. </xsl:if>
  233. <out:apply-templates select="//agent_definition/items/item">
  234. <out:with-param name="parent">summaryBarMenu</out:with-param>
  235. </out:apply-templates>
  236. }
  237. </script>
  238. </xsl:template>
  239. <!-- task menu item template -->
  240. <xsl:template match="//agent_definition/items/item">
  241. <xsl:param name="parent"/>
  242. <xsl:variable name="taskTooltip">
  243. <xsl:value-of select="./name"/>
  244. </xsl:variable>
  245. <xsl:variable name="taskName">
  246. <xsl:call-template name="reduceToMaxSize">
  247. <xsl:with-param name="anystring">
  248. <xsl:call-template name="setText">
  249. <xsl:with-param name="theText">
  250. <xsl:value-of select="./name"/>
  251. </xsl:with-param>
  252. </xsl:call-template>
  253. </xsl:with-param>
  254. <xsl:with-param name="maxsize">20</xsl:with-param>
  255. </xsl:call-template>
  256. </xsl:variable>
  257. <xsl:variable name="command">doSelectTabCommand('<xsl:value-of select="./id"/>', '<xsl:value-of select="./type"/>',true);</xsl:variable>
  258. <xsl:variable name="menuName" select="concat('menu_',generate-id())"/>
  259. var <xsl:value-of select="$menuName"/> = new CMenuItem(<xsl:value-of select="$parent"/>, &quot;<xsl:value-of select="xtsext:javascriptencode(string($taskName))"/>&quot;, &quot;<xsl:value-of select="xtsext:javascriptencode(concat('taskItem', position()))"/>&quot;, &quot;<xsl:value-of select="xtsext:javascriptencode(string($command))"/>&quot;, '', menuItemStyle, &quot;<xsl:value-of select="xtsext:javascriptencode(string($taskName))"/>&quot;,&quot;<xsl:value-of select="xtsext:javascriptencode(string($taskTooltip))"/>&quot;);
  260. <xsl:if test="/root/sb/param[@name='tabSelectedID'] =./id">
  261. <xsl:value-of select="$menuName"/>.disable();
  262. </xsl:if>
  263. </xsl:template>
  264. <!-- match="//agent_definition/items/item"> -->
  265. <xsl:template name="agentItems">
  266. <xsl:for-each select="//agent_definition/items/item">
  267. <!--<xsl:if test="./handle='true'"> -->
  268. <!-- let us create drop zone -->
  269. <td class="item_not_selected">
  270. <table id="{./id}_external" role="presentation" class="external_div_hidden" cellpadding="0" border="0" cellspacing="0">
  271. <xsl:attribute name="onmouseover">dropZoneActive(event,'<xsl:value-of select="./id"/>')</xsl:attribute>
  272. <xsl:attribute name="onmouseout">dropZoneInactive(event,'<xsl:value-of select="./id"/>')</xsl:attribute>
  273. <xsl:attribute name="onmouseup">onDrop(event,'<xsl:value-of select="./id"/>')</xsl:attribute>
  274. <tr>
  275. <td align="center" valign="middle">
  276. <img id="{./id}_internal" role="separator" height="52" width="2" alt="" src="../ags/images/spacer.gif">
  277. <xsl:attribute name="onmouseover">dropZoneActive(event,'<xsl:value-of select="./id"/>')</xsl:attribute>
  278. <xsl:attribute name="onmouseout">dropZoneInactive(event,'<xsl:value-of select="./id"/>')</xsl:attribute>
  279. <xsl:attribute name="onmouseup">onDrop(event,'<xsl:value-of select="./id"/>')</xsl:attribute>
  280. </img>
  281. </td>
  282. </tr>
  283. </table>
  284. </td>
  285. <xsl:variable name="selTabName">
  286. <xsl:value-of select="/root/sb/param[@name='tabSelectedID']"/>
  287. </xsl:variable>
  288. <!--
  289. This variable is used to fixing ID unique issues.
  290. Every agent item should have an unique ID, not only item_selected or item_not_selected.
  291. -->
  292. <xsl:variable name="tdId">
  293. <xsl:choose>
  294. <xsl:when test="./id=$selTabName">
  295. <xsl:value-of select="./name"/>_selected
  296. </xsl:when>
  297. <xsl:otherwise>
  298. <xsl:value-of select="./name"/>_not_selected
  299. </xsl:otherwise>
  300. </xsl:choose>
  301. </xsl:variable>
  302. <xsl:variable name="tdclass">
  303. <xsl:choose>
  304. <xsl:when test="./id=$selTabName">item_selected</xsl:when>
  305. <xsl:otherwise>item_not_selected</xsl:otherwise>
  306. </xsl:choose>
  307. </xsl:variable>
  308. <xsl:variable name="TABSELECTED">
  309. <xsl:choose>
  310. <xsl:when test="./id=$selTabName">item_active</xsl:when>
  311. <xsl:otherwise>item</xsl:otherwise>
  312. </xsl:choose>
  313. </xsl:variable>
  314. <xsl:variable name="ITEMLABEL">
  315. <xsl:choose>
  316. <xsl:when test="./id=$selTabName">item_label_active</xsl:when>
  317. <xsl:otherwise>item_label</xsl:otherwise>
  318. </xsl:choose>
  319. </xsl:variable>
  320. <xsl:variable name="icon">
  321. <xsl:call-template name="toolTipImage">
  322. <xsl:with-param name="sourceType">
  323. <xsl:value-of select="concat(./type, ./addInfo)"/>
  324. </xsl:with-param>
  325. </xsl:call-template>
  326. </xsl:variable>
  327. <!-- todo: check consistancy of tab names id="{$name}tab" -->
  328. <!-- this id is used to set focus to selected tab -->
  329. <td id="{$tdId}" class="{$tdclass}" width="109" align="center">
  330. <table title="{./name}" cellpadding="0" cellspacing="0" border="0" role="presentation">
  331. <tr>
  332. <!-- handle button -->
  333. <td valign="top">
  334. <table role="presentation" onMousedown="initdragie(event,'{xtsext:javascriptencode(xtsext:xmldecode(string(./name)))}', '{$icon}', '{./id}', '{./following::item/id}')" cellpadding="0" cellspacing="0" border="0" style="height:24px;width:6px;background:url('../ags/images/summary/summary_item_handle.gif') no-repeat">
  335. <tr>
  336. <td>&#160;</td>
  337. </tr>
  338. </table>
  339. </td>
  340. <!-- item/action button
  341. This will generate items which are draggable and clickable like a tabbed pan
  342. -->
  343. <td class="" valign="middle">
  344. <div class="{$TABSELECTED}" role="menuitem" tabindex="-1">
  345. <xsl:choose>
  346. <xsl:when test="not(./id=$selTabName)">
  347. <xsl:attribute name="onmouseover">this.className='item_active';window.status='';return true;</xsl:attribute>
  348. <xsl:attribute name="onmouseout">this.className='item';window.status='';return true;</xsl:attribute>
  349. <xsl:attribute name="onclick">doSelectTabCommand('<xsl:value-of select="./id"/>', '<xsl:value-of select="./type"/>',false);</xsl:attribute>
  350. <xsl:attribute name="onfocus">this.className='item_active';window.status='';return true;</xsl:attribute>
  351. <xsl:attribute name="onblur">this.className='item';window.status='';return true;</xsl:attribute>
  352. </xsl:when>
  353. <xsl:otherwise>
  354. <xsl:attribute name="onclick">selectCurrentTab('<xsl:value-of select="./id"/>', '<xsl:value-of select="./type"/>')</xsl:attribute>
  355. <xsl:attribute name="onfocus">this.className='item_active';window.status='';return true;</xsl:attribute>
  356. <xsl:attribute name="onblur">this.className='item';window.status='';return true;</xsl:attribute>
  357. </xsl:otherwise>
  358. </xsl:choose>
  359. <table id="id_{./name}" role="menuitem" onMousedown="initdragie(event,'{xtsext:javascriptencode(xtsext:xmldecode(string(./name)))}', '{$icon}', '{./id}', '{./following::item/id}')" cellpadding="0" cellspacing="0" border="0" rules="none" width="90" height="60">
  360. <xsl:attribute name="style">cursor:hand; display:block;</xsl:attribute>
  361. <tr style="display:block;">
  362. <td colspan="3" style="height: 3px; display:block;">
  363. <img border="0" width="0" height="0" alt="" src="../ags/images/spacer.gif"/>
  364. </td>
  365. </tr>
  366. <tr height="27px" style="display:block;">
  367. <td>
  368. <table cellpadding="0" cellspacing="0" border="0" role="presentation">
  369. <tr>
  370. <td align="right" valign="top" width="30">&#160;
  371. <!--img border="0" width="24" src="../ags/images/spacer.gif"/-->
  372. </td>
  373. <td align="center" valign="top">
  374. <table cellpadding="0" cellspacing="0" border="0" width="30" height="24" role="presentation">
  375. <!-- Change background to img tag to fixing high contrast issue. -->
  376. <tr>
  377. <td width="30" height="24" valign="middle" align="center">
  378. <img alt="" border="0" style="margin-top:3px">
  379. <xsl:attribute name="src">
  380. <xsl:call-template name="putImage">
  381. <xsl:with-param name="sourceType">
  382. <xsl:value-of select="concat(./type, ./addInfo)"/>
  383. </xsl:with-param>
  384. </xsl:call-template>
  385. </xsl:attribute>
  386. </img>
  387. </td>
  388. </tr>
  389. </table>
  390. </td>
  391. <td align="left" valign="top">
  392. <table cellpadding="0" cellspacing="0" border="0" width="30" height="24" role="presentation">
  393. <!-- Change background into img tag to fix High Contrast issue. -->
  394. <tr>
  395. <td width="30" height="24" valign="middle" align="center">
  396. <img alt="" border="0" style="top no-repeat">
  397. <xsl:call-template name="getTaskSuppressionStateGif">
  398. <xsl:with-param name="suppression-node" select="./suppression"/>
  399. </xsl:call-template>
  400. </img>
  401. </td>
  402. </tr>
  403. </table>
  404. </td>
  405. </tr>
  406. </table>
  407. </td>
  408. </tr>
  409. <tr>
  410. <td height="30" colspan="3" align="center" valign="top" class="{$ITEMLABEL}">
  411. <xsl:call-template name="reduceToMaxSize">
  412. <xsl:with-param name="anystring">
  413. <xsl:call-template name="setText">
  414. <xsl:with-param name="theText">
  415. <xsl:value-of select="./name"/>
  416. </xsl:with-param>
  417. </xsl:call-template>
  418. </xsl:with-param>
  419. <xsl:with-param name="maxsize" select="20"/>
  420. </xsl:call-template>
  421. </td>
  422. </tr>
  423. </table>
  424. </div>
  425. </td>
  426. <!-- show the sequence image only if the tasks are selected to run in order -->
  427. <xsl:if test="/root/agent_definition/sequencing='sequential' and position() &lt; count(//agent_definition/items/item)">
  428. <td class="">
  429. <img alt="" src="../ags/images/summary/summary_sequence_arrow.gif"/>
  430. </td>
  431. </xsl:if>
  432. </tr>
  433. </table>
  434. </td>
  435. </xsl:for-each>
  436. </xsl:template>
  437. <xsl:template name="reduceToMaxSize">
  438. <xsl:param name="anystring">anystring</xsl:param>
  439. <xsl:param name="linebreakat">11</xsl:param>
  440. <xsl:param name="maxsize">20</xsl:param>
  441. <xsl:variable name="res">
  442. <xsl:choose>
  443. <xsl:when test="not(contains($anystring, ' ')) and string-length($anystring) &gt; $maxsize">
  444. <xsl:value-of select="substring(normalize-space($anystring),0,$linebreakat)"/><xsl:text>...</xsl:text>
  445. </xsl:when>
  446. <xsl:when test="not(contains(substring($anystring,0,$linebreakat), ' ')) and string-length($anystring) &gt; $linebreakat">
  447. <xsl:value-of select="substring(normalize-space($anystring),0,$linebreakat)"/><xsl:text>...</xsl:text>
  448. </xsl:when>
  449. <xsl:otherwise>
  450. <xsl:choose>
  451. <xsl:when test="string-length($anystring) &gt; $maxsize">
  452. <xsl:value-of select="substring(normalize-space($anystring),0,$maxsize)"/><xsl:text>...</xsl:text>
  453. </xsl:when>
  454. <xsl:otherwise>
  455. <xsl:value-of select="$anystring"/>
  456. </xsl:otherwise>
  457. </xsl:choose>
  458. </xsl:otherwise>
  459. </xsl:choose>
  460. </xsl:variable>
  461. <xsl:value-of select="$res"/>
  462. </xsl:template>
  463. <!-- static buttons -->
  464. <xsl:template name="persistButton">
  465. <xsl:param name="name">name</xsl:param>
  466. <xsl:param name="type"/>
  467. <xsl:param name="desc"/>
  468. <!-- create the button when :
  469. 1. No capabilities are present OR
  470. 2. The button name is 'Schedule' and the 'canUseScheduling' capability is present OR
  471. 3. The button name is 'Condition'
  472. -->
  473. <xsl:if test="$name='AgentTask-condition'">
  474. <xsl:variable name="selTabName">
  475. <xsl:value-of select="/root/sb/param[@name='tabSelectedID']"/>
  476. </xsl:variable>
  477. <xsl:variable name="tdclass">
  478. <xsl:choose>
  479. <xsl:when test="$selTabName=$name">item_selected</xsl:when>
  480. <xsl:otherwise>item_not_selected</xsl:otherwise>
  481. </xsl:choose>
  482. </xsl:variable>
  483. <xsl:variable name="TABSELECTED">
  484. <xsl:choose>
  485. <xsl:when test="$selTabName=$name">item_active</xsl:when>
  486. <xsl:otherwise>item</xsl:otherwise>
  487. </xsl:choose>
  488. </xsl:variable>
  489. <xsl:variable name="ITEMLABEL">
  490. <xsl:choose>
  491. <xsl:when test="$selTabName=$name">item_label_active</xsl:when>
  492. <xsl:otherwise>item_label</xsl:otherwise>
  493. </xsl:choose>
  494. </xsl:variable>
  495. <xsl:variable name="reducedDesc98">
  496. <xsl:call-template name="reduceToMaxSize">
  497. <xsl:with-param name="anystring" select="$desc"/>
  498. <xsl:with-param name="maxsize" select="98"/>
  499. </xsl:call-template>
  500. </xsl:variable>
  501. <xsl:variable name="reducedDesc24">
  502. <xsl:call-template name="reduceToMaxSize">
  503. <xsl:with-param name="anystring" select="$desc"/>
  504. <xsl:with-param name="maxsize" select="20"/>
  505. </xsl:call-template>
  506. </xsl:variable>
  507. <!-- this id is used to set focus to selected tab -->
  508. <td id="{$tdclass}" class="{$tdclass}" width="90" align="center">
  509. <div class="{$TABSELECTED}" role="menuitem" tabindex="-1">
  510. <xsl:if test="not($selTabName=$name)">
  511. <xsl:attribute name="onmouseover">this.className='item_active';window.status='';return true;</xsl:attribute>
  512. <xsl:attribute name="onmouseout">this.className='item';window.status='';return true;</xsl:attribute>
  513. <xsl:attribute name="onfocus">this.className='item_active';window.status='';return true;</xsl:attribute>
  514. <xsl:attribute name="onblur">this.className='item';window.status='';return true;</xsl:attribute>
  515. <xsl:attribute name="onclick">doSelectTabCommand('<xsl:value-of select="$name"/>', '<xsl:value-of select="$type"/>',false);</xsl:attribute>
  516. <xsl:attribute name="style">cursor:hand</xsl:attribute>
  517. </xsl:if>
  518. <table id="id_{$name}" role="menuitem" title="{$desc}" cellpadding="0" cellspacing="0" border="0" rules="none" width="90" height="60">
  519. <!-- Change background to img tag to fixing high contrast issue. -->
  520. <tr>
  521. <td align="center" valign="top">
  522. <img alt="" border="0" height="24" width="24" style="margin-top:3px" align="center">
  523. <xsl:attribute name="src">
  524. <xsl:call-template name="putImage"><xsl:with-param name="sourceType"><xsl:value-of select="$type"/></xsl:with-param></xsl:call-template>
  525. </xsl:attribute>
  526. </img>
  527. </td>
  528. </tr>
  529. <tr>
  530. <td align="center" valign="top" class="{$ITEMLABEL}" height="30">
  531. <xsl:choose>
  532. <xsl:when test="$desc=''">
  533. <xsl:call-template name="setText">
  534. <xsl:with-param name="theText">
  535. <xsl:value-of select="$desc"/>
  536. </xsl:with-param>
  537. </xsl:call-template>
  538. </xsl:when>
  539. <xsl:otherwise>
  540. <xsl:value-of select="$reducedDesc24"/>
  541. </xsl:otherwise>
  542. </xsl:choose>
  543. </td>
  544. </tr>
  545. </table>
  546. </div>
  547. </td>
  548. <td class="item_not_selected">
  549. <table cellpadding="0" cellspacing="0" role="separator">
  550. <tr>
  551. <td>
  552. <img border="0" alt="" src="../ags/images/summary/summary_separator.gif"/>
  553. </td>
  554. </tr>
  555. </table>
  556. </td>
  557. </xsl:if>
  558. </xsl:template>
  559. <xsl:template name="persistButtonHeader">
  560. <xsl:param name="name"/>
  561. <td style="display: block;">
  562. <table cellpadding="0" cellspacing="0" border="0" rules="none" width="90" role="tooltip" style="height:100%; display:block;">
  563. <tr style="display:block;">
  564. <td align="center" valign="top" style="display: block; height: 1px;">
  565. <img border="0" height="1" width="24" alt="" src="../ags/images/spacer.gif"/>
  566. </td>
  567. </tr>
  568. <tr valign="bottom" style="display:block;">
  569. <td class="group_label" valign="bottom">
  570. <xsl:value-of select="$name"/>
  571. </td>
  572. </tr>
  573. </table>
  574. </td>
  575. <td>
  576. <table role="separator">
  577. <tr style="display: block;">
  578. <td style="display: block; height: 1px;">
  579. <img border="0" height="1" width="4" alt="" src="../ags/images/spacer.gif"/>
  580. </td>
  581. </tr>
  582. </table>
  583. </td>
  584. </xsl:template>
  585. <!-- match="//agent_definition/items/item"> -->
  586. <xsl:template name="agentItemHeaders">
  587. <xsl:param name="name"/>
  588. <xsl:param name="class"/>
  589. <xsl:choose>
  590. <xsl:when test="//agent_definition/items/item">
  591. <!-- make header space for all of them -->
  592. <xsl:for-each select="//agent_definition/items/item">
  593. <xsl:call-template name="agentItemHeaderContent">
  594. <xsl:with-param name="name">
  595. <xsl:if test="position() = 1">
  596. <xsl:value-of select="$name"/>
  597. </xsl:if>
  598. </xsl:with-param>
  599. <xsl:with-param name="class">
  600. <xsl:value-of select="$class"/>
  601. </xsl:with-param>
  602. </xsl:call-template>
  603. </xsl:for-each>
  604. </xsl:when>
  605. <xsl:otherwise>
  606. <!-- do it just once -->
  607. <xsl:call-template name="agentItemHeaderContent">
  608. <xsl:with-param name="name">
  609. <xsl:value-of select="$name"/>
  610. </xsl:with-param>
  611. <xsl:with-param name="class">
  612. <xsl:value-of select="$class"/>
  613. </xsl:with-param>
  614. </xsl:call-template>
  615. </xsl:otherwise>
  616. </xsl:choose>
  617. </xsl:template>
  618. <xsl:template name="agentItemHeaderContent">
  619. <xsl:param name="name"/>
  620. <xsl:param name="class"/>
  621. <td class="{$class}">
  622. <table class="external_div_hidden" role="separator">
  623. <tr>
  624. <td align="center" valign="middle" style="display: block; height: 1px;">
  625. <img height="1" width="2" alt="" src="../ags/images/spacer.gif"/>
  626. </td>
  627. </tr>
  628. </table>
  629. </td>
  630. <!-- todo: check consistancy of tab names id="{$name}tab" -->
  631. <td class="{$class}" width="98" align="center">
  632. <table cellpadding="0" cellspacing="0" border="0" role="tooltip">
  633. <tr>
  634. <!-- handle button -->
  635. <td>
  636. <img border="0" height="1" width="12" alt="" src="../ags/images/spacer.gif"/>
  637. </td>
  638. <td valign="middle" style="display:block;">
  639. <table cellpadding="0" cellspacing="0" border="0" rules="none" role="tooltip" width="90px" style="display:block;">
  640. <tr style="display:block;">
  641. <td align="left" valign="top" style="display: block; height: 1px;">
  642. <img border="0" height="1" width="90" alt="" src="../ags/images/spacer.gif"/>
  643. </td>
  644. </tr>
  645. <tr style="display:block;">
  646. <td colspan="3" align="left" valign="top" class="group_label">
  647. <xsl:value-of select="$name"/>
  648. </td>
  649. </tr>
  650. </table>
  651. </td>
  652. <xsl:if test="/root/agent_definition/sequencing='sequential' and position() &lt; count(//agent_definition/items/item)">
  653. <td style="display: block; height: 1px;">
  654. <img height="1" width="13" alt="" src="../ags/images/spacer.gif"/>
  655. </td>
  656. </xsl:if>
  657. </tr>
  658. </table>
  659. </td>
  660. </xsl:template>
  661. <!-- generate the image for the middle element -->
  662. <xsl:template name="putImage">
  663. <xsl:param name="sourceType">agent</xsl:param>
  664. <xsl:choose>
  665. <xsl:when test="$sourceType = 'message'">
  666. <xsl:value-of select="'../ags/images/summary/icon_email_24.gif'"/>
  667. </xsl:when>
  668. <xsl:when test="$sourceType = 'messagehasAttachment'">
  669. <xsl:value-of select="'../ags/images/summary/icon_email_attachment_24.gif'"/>
  670. </xsl:when>
  671. <xsl:when test="$sourceType = 'report'">
  672. <xsl:value-of select="'../ags/images/summary/icon_report_24.gif'"/>
  673. </xsl:when>
  674. <xsl:when test="$sourceType = 'reporthasPrompts'">
  675. <xsl:value-of select="'../ags/images/summary/icon_report_prompt_24.gif'"/>
  676. </xsl:when>
  677. <xsl:when test="$sourceType = 'agent'">
  678. <xsl:value-of select="'../ags/images/summary/icon_agent_24.gif'"/>
  679. </xsl:when>
  680. <xsl:when test="$sourceType = 'job'">
  681. <xsl:value-of select="'../ags/images/summary/icon_job_24.gif'"/>
  682. </xsl:when>
  683. <xsl:when test="$sourceType = 'sql'">
  684. <xsl:value-of select="'../ags/images/summary/icon_SQL_writeback_24.gif'"/>
  685. </xsl:when>
  686. <xsl:when test="$sourceType = 'schedule'">
  687. <xsl:value-of select="'../ags/images/summary/icon_schedule_enabled_24.gif'"/>
  688. </xsl:when>
  689. <xsl:when test="$sourceType = 'condition'">
  690. <xsl:value-of select="'../ags/images/summary/icon_condition_24.gif'"/>
  691. </xsl:when>
  692. <xsl:when test="$sourceType = 'web'">
  693. <xsl:value-of select="'../ags/images/summary/icon_Web_service_24.gif'"/>
  694. </xsl:when>
  695. <xsl:when test="$sourceType = 'url'">
  696. <xsl:value-of select="'../ags/images/summary/icon_newsitem_24.gif'"/>
  697. </xsl:when>
  698. <xsl:when test="$sourceType = 'import'">
  699. <xsl:value-of select="'../ags/images/summary/icon_import_24.gif'"/>
  700. </xsl:when>
  701. <xsl:when test="$sourceType = 'export'">
  702. <xsl:value-of select="'../ags/images/summary/icon_export_24.gif'"/>
  703. </xsl:when>
  704. <xsl:when test="$sourceType = 'content'">
  705. <xsl:value-of select="'../ags/images/summary/icon_content_maintenance_24.gif'"/>
  706. </xsl:when>
  707. <xsl:when test="$sourceType = 'index'">
  708. <xsl:value-of select="'../ags/images/summary/icon_index_update_24.gif'"/>
  709. </xsl:when>
  710. <xsl:when test="$sourceType = 'metric'">
  711. <xsl:value-of select="'../ags/images/summary/icon_metrics_maintenance_24.gif'"/>
  712. </xsl:when>
  713. <xsl:when test="$sourceType = 'planningMacro'">
  714. <xsl:value-of select="'../ags/images/summary/icon_planning_macro_24.gif'"/>
  715. </xsl:when>
  716. <xsl:when test="$sourceType = 'migration'">
  717. <xsl:value-of select="'../ags/images/summary/icon_migration_24.gif'"/>
  718. </xsl:when>
  719. <xsl:when test="$sourceType = 'approval'">
  720. <xsl:value-of select="'../ags/images/summary/icon_approval_task_24x24.gif'"/>
  721. </xsl:when>
  722. <xsl:when test="$sourceType = 'notification'">
  723. <xsl:value-of select="'../ags/images/summary/icon_notification_24x24.gif'"/>
  724. </xsl:when>
  725. <xsl:otherwise>
  726. <xsl:value-of select="'../ps/portal/images/icon_unknown.gif'"/>
  727. </xsl:otherwise>
  728. </xsl:choose>
  729. </xsl:template>
  730. <!-- generate the image for the tool tip (small) -->
  731. <xsl:template name="toolTipImage">
  732. <xsl:param name="sourceType">import</xsl:param>
  733. <xsl:choose>
  734. <xsl:when test="$sourceType = 'import'">
  735. <xsl:value-of select="'../ags/images/tasks/action_new_import.gif'"/>
  736. </xsl:when>
  737. <xsl:when test="$sourceType = 'export'">
  738. <xsl:value-of select="'../ags/images/tasks/action_new_export.gif'"/>
  739. </xsl:when>
  740. <xsl:when test="$sourceType = 'content'">
  741. <xsl:value-of select="'../ags/images/tasks/action_new_content_maintenance.gif'"/>
  742. </xsl:when>
  743. <xsl:when test="$sourceType = 'web'">
  744. <xsl:value-of select="'../ags/images/tasks/action_new_web_service.gif'"/>
  745. </xsl:when>
  746. <xsl:when test="$sourceType = 'sql'">
  747. <xsl:value-of select="'../ags/images/tasks/action_new_SQL_writeback.gif'"/>
  748. </xsl:when>
  749. <xsl:when test="$sourceType = 'job'">
  750. <xsl:value-of select="'../ags/images/tasks/action_new_job.gif'"/>
  751. </xsl:when>
  752. <xsl:when test="$sourceType = 'message'">
  753. <xsl:value-of select="'../ags/images/tasks/action_new_email.gif'"/>
  754. </xsl:when>
  755. <xsl:when test="$sourceType = 'messagehasAttachment'">
  756. <xsl:value-of select="'../ags/images/tasks/action_new_email_attachment.gif'"/>
  757. </xsl:when>
  758. <xsl:when test="$sourceType = 'agent'">
  759. <xsl:value-of select="'../ags/images/tasks/action_new_agent.gif'"/>
  760. </xsl:when>
  761. <xsl:when test="$sourceType = 'report'">
  762. <xsl:value-of select="'../ags/images/tasks/action_new_report.gif'"/>
  763. </xsl:when>
  764. <xsl:when test="$sourceType = 'reporthasPrompts'">
  765. <xsl:value-of select="'../ags/images/tasks/action_new_report_prompt.gif'"/>
  766. </xsl:when>
  767. <xsl:when test="$sourceType = 'url'">
  768. <xsl:value-of select="'../ags/images/tasks/action_new_newsitem.gif'"/>
  769. </xsl:when>
  770. <xsl:when test="$sourceType = 'metric'">
  771. <xsl:value-of select="'../ags/images/menu/action_new_metrics_maintenance.gif'"/>
  772. </xsl:when>
  773. <xsl:when test="$sourceType = 'index'">
  774. <xsl:value-of select="'../ags/images/menu/action_new_index_update.gif'"/>
  775. </xsl:when>
  776. <xsl:when test="$sourceType = 'approval'">
  777. <xsl:value-of select="'../ags/images/menu/action_approval_task.gif'"/>
  778. </xsl:when>
  779. <xsl:when test="$sourceType = 'notification'">
  780. <xsl:value-of select="'../ags/images/menu/action_notification.gif'"/>
  781. </xsl:when>
  782. <xsl:otherwise>
  783. <xsl:call-template name="putImage">
  784. <xsl:with-param name="sourceType">
  785. <xsl:value-of select="$sourceType"/>
  786. </xsl:with-param>
  787. </xsl:call-template>
  788. </xsl:otherwise>
  789. </xsl:choose>
  790. </xsl:template>
  791. <xsl:template name="setText">
  792. <xsl:param name="theText"/>
  793. <xsl:choose>
  794. <xsl:when test="$theText=''"><xts:string id="AGENT_SUMMARY_NONE"/></xsl:when>
  795. <xsl:otherwise>
  796. <xsl:value-of select="$theText"/>
  797. </xsl:otherwise>
  798. </xsl:choose>
  799. </xsl:template>
  800. </xsl:stylesheet>