123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: AGS
- (C) Copyright IBM Corp. 2005, 2014
- US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- -->
- <!--
- ================================================================================
- do the summaryBar - render the HTML for it
- ===============================================================================================
- -->
- <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">
- <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no"/>
- <!-- add any theme variables -->
- <pf:variables/>
- <!-- template to get a suppression gif-->
- <agsad:taskSuppressionState/>
- <!-- start the output -->
- <xsl:template match="/root">
- <!-- define a couple of variables which are used in here -->
- <!-- the tabSelectedID and prevTabSelectedID - are either agent_items ids - or 'schedule' or 'condition' -->
- <input type="hidden" id="tabSelectedID" name="tabSelectedID" value="{/root/sb/param[@name='tabSelectedID']}"/>
- <!-- prev tab maintains where we were - tabSelectedID is changed when we are switching tabs - so that the destination -->
- <input type="hidden" id="prevTabID" name="prevTabID" value="{/root/sb/param[@name='tabSelectedID']}"/>
- <!-- the type of the task that we want to create - 'agent', 'job', 'report', 'message', 'sql', or 'web' -->
- <input type="hidden" id="newTaskType" name="newTaskType" value="{/root/sb/param[@name='newTaskType']}"/>
- <!-- a couple of ids which are used for dragging/dropping items on the summary bar -->
- <input type="hidden" id="itemSelected" name="itemSelected" value="{/root/sb/param[@name='itemSelected']}"/>
- <input type="hidden" id="itemNewLocation" name="itemNewLocation" value="{/root/sb/param[@name='itemNewLocation']}"/>
- <!-- what operation we are performing on agentDefinition - "shuffle", "move_up", "move_way_up", "move_down", "move_way_down", "remove" -->
- <input type="hidden" id="agentItemOp" name="agentItemOp" value="{/root/sb/param[@name='agentItemOp']}"/>
- <!-- this is maintained here too -->
- <input type="hidden" name="cafcontextid" id="cafcontextid" value="{/root/sb/param[@name='cafcontextid']}"/>
- <!-- Tell the portal that this is AGS. This is mainly when authentication expires and defautlHandler kicks in-->
- <input type="hidden" name="agsSave_m_app" id="agsSave_m_app" value="AS"/>
- <!-- Tell the portal that this is AGS. This is mainly when authentication expires and defautlHandler kicks in-->
- <input type="hidden" name="m_app" id="m_app" value="AS"/>
- <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' ">
- <xsl:call-template name="doSummaryBar"/>
- </xsl:if>
- </xsl:template>
-
- <xsl:template name="doSummaryBar">
- <table border="0" cellpadding="0" cellspacing="0" style="width:100%; height:100%; overflow:hidden" role="presentation">
- <tr>
- <td id="flyout_td" valign="bottom" align="left" width="12px" >
- <!-- menu button , column 1-->
- <table border="0" cellpadding="0" cellspacing="0" role="button">
- <tr>
- <td id="menu_button" class="flybutton" valign="middle" align="left" >
- <xsl:attribute name="role">button</xsl:attribute>
- <xsl:attribute name="onmouseover">this.className='flybutton_hover';window.status='';return true;</xsl:attribute>
- <xsl:attribute name="onmouseout">this.className='flybutton';window.status='';return true;</xsl:attribute>
- <xsl:attribute name="onmousedown">this.className='flybutton_pressed';window.status='';return true;</xsl:attribute>
- <xsl:variable name="dropDown" ><xts:string id="DROP_DOWN_TOOL_TIP"/></xsl:variable>
- <img title="{$dropDown}" role="button" alt="{$dropDown}" src="../ags/images/summary/summary_menu_button.gif" onmouseup="removeSummaryBarTasksMenuListener();showSummaryBarTasksMenu(event);summaryBar_cancelBub(event);"/>
- </td>
- <td>
- <img border="0" height="62" width="2" alt="" src="../ags/images/spacer.gif"/>
- </td>
- </tr>
- <tr>
- <td id="summaryDropdown" style="vertical-align:bottom;height:2px">
- <xsl:call-template name="makeContextMenu"/>
- </td>
- </tr>
- </table>
- </td>
- <td id="mainCell" align="left" style="width:100%; height:100%; overflow:hidden">
- <table border="0" cellpadding="0" cellspacing="0" role="presentation" style="width:100%; height:100%; overflow:visible">
- <tr>
- <td>
- <div class="summaryHeaderBoundary" id="SummaryBarScrollpane2" style="height:21px;">
- <table border="0" cellpadding="0" cellspacing="0" role="presentation" style="height:100%;">
- <tr>
- <!-- Left side of the button panel -->
- <td>
- <img border="0" height="2" width="10" alt="" src="../ags/images/spacer.gif"/>
- </td>
- <!-- make the condition button -->
- <xsl:call-template name="persistButtonHeader">
- <xsl:with-param name="name"><xts:string id="AGENT_CONDITION_LABEL"/></xsl:with-param>
- </xsl:call-template>
-
- <!-- build the agent items tabs -->
- <xsl:call-template name="agentItemHeaders">
- <xsl:with-param name="name"><xts:string id="AGENT_ACTIONS_LABEL"/></xsl:with-param>
- <xsl:with-param name="class"/>
- </xsl:call-template>
- <!-- extend this out -->
- <td width="100%" style="display: block; height: 1px;">
- <img border="0" height="1" width="12" alt="" src="../ags/images/spacer.gif"/>
- </td>
- </tr>
- </table>
- </div>
- </td>
- </tr>
- <tr>
- <td>
- <div class="summaryBoundary" id="SummaryBarScrollpane">
- <table border="0" cellpadding="1" cellspacing="0" role="menubar">
- <tr>
- <!-- Left side of the button panel -->
- <td class="item_not_selected">
- <img border="0" height="60" width="2" alt="" src="../ags/images/spacer.gif"/>
- </td>
- <!-- make the condition button -->
- <xsl:call-template name="persistButton">
- <xsl:with-param name="name">AgentTask-condition</xsl:with-param>
- <xsl:with-param name="type">condition</xsl:with-param>
- <xsl:with-param name="desc">
- <!-- set the value of condition default is none-->
- <xsl:value-of select="/root/agent_definition/condition"/>
- </xsl:with-param>
- </xsl:call-template>
-
- <!-- build the agent items tabs -->
- <xsl:choose>
- <xsl:when test="//agent_definition/items/item">
- <xsl:call-template name="agentItems"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="agentItemHeaders">
- <xsl:with-param name="class">
- <xsl:text>item_not_selected</xsl:text>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- <!-- extend this out -->
- <td class="item_not_selected" width="100%">
- <img border="0" height="60" width="12" alt="" src="../ags/images/spacer.gif"/>
- </td>
- </tr>
- </table>
- </div>
- <!-- Add tooltip here ready to be used otherwise it might give flickers -->
- <div id="dragTip" style="display:hidden"/>
- </td>
- </tr>
- </table>
- </td>
- <td id="scroll_td" valign="bottom" align="center" width="24px">
- <!-- make the scroll buttons at right end-->
- <table border="0" role="presentation">
- <tr>
- <xsl:variable name="leftToolTip" ><xts:string id="SCROL_LEFT_TOOL_TIP"/></xsl:variable>
- <td id="scroll_left" class="button" title="{$leftToolTip}">
- <xsl:attribute name="role">button</xsl:attribute>
- <xsl:attribute name="onmouseover">this.className='button_hover';window.status='';return true;</xsl:attribute>
- <xsl:attribute name="onmouseout">this.className='button';window.status='';return true;</xsl:attribute>
- <xsl:attribute name="onmousedown">scrollLeftDown();</xsl:attribute>
- <xsl:attribute name="onmouseup">this.className='button_hover';window.status='';return true;</xsl:attribute>
- <xsl:attribute name="onclick">goLeft();</xsl:attribute>
- <img alt="{$leftToolTip}" role="button" src="../ags/images/summary/summary_scroll_left.gif"/>
- </td>
- <xsl:variable name="rightToolTip" ><xts:string id="SCROL_RIGHT_TOOL_TIP"/></xsl:variable>
- <td id="scroll_right" class="button" title="{$rightToolTip}">
- <xsl:attribute name="role">button</xsl:attribute>
- <xsl:attribute name="onmouseover">this.className='button_hover';window.status='';return true;</xsl:attribute>
- <xsl:attribute name="onmouseout">this.className='button';window.status='';return true;</xsl:attribute>
- <xsl:attribute name="onmousedown">scrollRightDown();</xsl:attribute>
- <xsl:attribute name="onmouseup">this.className='button_hover';window.status='';return true;</xsl:attribute>
- <xsl:attribute name="onclick">goRight();</xsl:attribute>
- <img alt="{$rightToolTip}" role="button" src="../ags/images/summary/summary_scroll_right.gif"/>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- <script language="Javascript">
- if (document.all) {
- var summaryBarDiv = document.getElementById("d1");
- summaryBarDiv.onresize = setBarSize;
- } else {
- window.onresize = setBarSize;
- }
-
- // A11Y check for keyboard support
- if (AccessibilityHandler.isEnabled()) {
- AccessibilityHandler.initSummaryBar();
- }
- //set the task count into the config object
- window.parent.getConfigFrame().cfgSet("TaskCount","<xsl:value-of select="count(/root/agent_definition/items/item)"/>");
- // we're displaying the summary bar - so we should be displaying the correct menu - this also
- // the set submission of tasks hide/show
- parent.changeTaskMenu('task2');
- </script>
- </xsl:template>
- <!-- This is the context menu which user can click to jump on any task
- it is dynamic menu which shows the tasks added into the agent -->
- <xsl:template name="makeContextMenu">
- <script language="Javascript">
-
- function doSelectTabCommand(id,type,removeListener) {
- var mgr = parent.getConfigFrame().getCommandStackManager();
- var cmdStack=null;
- cmdStack=mgr.createCommandStack("checkCAF()","getMessageIFrame().selectTab(\'"+id+"\',\'"+type+"\');");
- mgr.doCommandStack(cmdStack);
-
- if (removeListener==true) {
- removeSummaryBarTasksMenuListener();
- }
- }
-
- function initSummaryMenu() {
- var summaryMenuTD=document.getElementById('summaryDropdown');
- var menuItemStyle = new CUIStyle('menuItem_normal', 'menuItem_hover', '', '', 'task_active');
- var menuStyle = new CUIStyle('menuContainer', '', '', '', '');
- summaryBarMenu = new CMenu('summaryMenu',menuStyle);
- summaryBarMenu.setHTMLContainer(summaryMenuTD);
-
- // A11Y check for keyboard support
- if (AccessibilityHandler.isEnabled()) {
- AccessibilityHandler.initSummaryBar();
- }
- <xsl:variable name="conditionTooltip">
- <xsl:value-of select="/root/agent_definition/condition"/>
- </xsl:variable>
- <xsl:variable name="conditionName">
- <xsl:call-template name="reduceToMaxSize">
- <xsl:with-param name="anystring">
- <!-- doc: pick the condition description -->
- <xsl:call-template name="setText">
- <xsl:with-param name="theText">
- <xsl:value-of select="/root/agent_definition/condition"/>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:with-param>
- <xsl:with-param name="maxsize">20</xsl:with-param>
- </xsl:call-template>
- </xsl:variable>
- var command = "doSelectTabCommand('AgentTask-condition','condition',true)";
- var conditionMenu = new CMenuItem(summaryBarMenu, "<xsl:value-of select="xtsext:javascriptencode(string($conditionName))"/>", "<xsl:value-of select="xtsext:javascriptencode(concat('task', position()))"/>",command,'',menuItemStyle,"<xsl:value-of select="xtsext:javascriptencode(string($conditionName))"/>", "<xsl:value-of select="xtsext:javascriptencode(string($conditionTooltip))"/>");
- <xsl:if test="/root/sb/param[@name='tabSelectedID'] ='AgentTask-condition'">
- conditionMenu.disable();
- </xsl:if>
-
- <out:apply-templates select="//agent_definition/items/item">
- <out:with-param name="parent">summaryBarMenu</out:with-param>
- </out:apply-templates>
- }
- </script>
- </xsl:template>
- <!-- task menu item template -->
- <xsl:template match="//agent_definition/items/item">
- <xsl:param name="parent"/>
- <xsl:variable name="taskTooltip">
- <xsl:value-of select="./name"/>
- </xsl:variable>
- <xsl:variable name="taskName">
- <xsl:call-template name="reduceToMaxSize">
- <xsl:with-param name="anystring">
- <xsl:call-template name="setText">
- <xsl:with-param name="theText">
- <xsl:value-of select="./name"/>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:with-param>
- <xsl:with-param name="maxsize">20</xsl:with-param>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="command">doSelectTabCommand('<xsl:value-of select="./id"/>', '<xsl:value-of select="./type"/>',true);</xsl:variable>
- <xsl:variable name="menuName" select="concat('menu_',generate-id())"/>
- var <xsl:value-of select="$menuName"/> = new CMenuItem(<xsl:value-of select="$parent"/>, "<xsl:value-of select="xtsext:javascriptencode(string($taskName))"/>", "<xsl:value-of select="xtsext:javascriptencode(concat('taskItem', position()))"/>", "<xsl:value-of select="xtsext:javascriptencode(string($command))"/>", '', menuItemStyle, "<xsl:value-of select="xtsext:javascriptencode(string($taskName))"/>","<xsl:value-of select="xtsext:javascriptencode(string($taskTooltip))"/>");
- <xsl:if test="/root/sb/param[@name='tabSelectedID'] =./id">
- <xsl:value-of select="$menuName"/>.disable();
- </xsl:if>
- </xsl:template>
- <!-- match="//agent_definition/items/item"> -->
- <xsl:template name="agentItems">
- <xsl:for-each select="//agent_definition/items/item">
- <!--<xsl:if test="./handle='true'"> -->
- <!-- let us create drop zone -->
- <td class="item_not_selected">
- <table id="{./id}_external" role="presentation" class="external_div_hidden" cellpadding="0" border="0" cellspacing="0">
- <xsl:attribute name="onmouseover">dropZoneActive(event,'<xsl:value-of select="./id"/>')</xsl:attribute>
- <xsl:attribute name="onmouseout">dropZoneInactive(event,'<xsl:value-of select="./id"/>')</xsl:attribute>
- <xsl:attribute name="onmouseup">onDrop(event,'<xsl:value-of select="./id"/>')</xsl:attribute>
- <tr>
- <td align="center" valign="middle">
- <img id="{./id}_internal" role="separator" height="52" width="2" alt="" src="../ags/images/spacer.gif">
- <xsl:attribute name="onmouseover">dropZoneActive(event,'<xsl:value-of select="./id"/>')</xsl:attribute>
- <xsl:attribute name="onmouseout">dropZoneInactive(event,'<xsl:value-of select="./id"/>')</xsl:attribute>
- <xsl:attribute name="onmouseup">onDrop(event,'<xsl:value-of select="./id"/>')</xsl:attribute>
- </img>
- </td>
- </tr>
- </table>
- </td>
- <xsl:variable name="selTabName">
- <xsl:value-of select="/root/sb/param[@name='tabSelectedID']"/>
- </xsl:variable>
- <!--
- This variable is used to fixing ID unique issues.
- Every agent item should have an unique ID, not only item_selected or item_not_selected.
- -->
- <xsl:variable name="tdId">
- <xsl:choose>
- <xsl:when test="./id=$selTabName">
- <xsl:value-of select="./name"/>_selected
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="./name"/>_not_selected
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="tdclass">
- <xsl:choose>
- <xsl:when test="./id=$selTabName">item_selected</xsl:when>
- <xsl:otherwise>item_not_selected</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="TABSELECTED">
- <xsl:choose>
- <xsl:when test="./id=$selTabName">item_active</xsl:when>
- <xsl:otherwise>item</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="ITEMLABEL">
- <xsl:choose>
- <xsl:when test="./id=$selTabName">item_label_active</xsl:when>
- <xsl:otherwise>item_label</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="icon">
- <xsl:call-template name="toolTipImage">
- <xsl:with-param name="sourceType">
- <xsl:value-of select="concat(./type, ./addInfo)"/>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:variable>
- <!-- todo: check consistancy of tab names id="{$name}tab" -->
- <!-- this id is used to set focus to selected tab -->
- <td id="{$tdId}" class="{$tdclass}" width="109" align="center">
- <table title="{./name}" cellpadding="0" cellspacing="0" border="0" role="presentation">
- <tr>
- <!-- handle button -->
- <td valign="top">
- <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">
- <tr>
- <td> </td>
- </tr>
- </table>
- </td>
- <!-- item/action button
- This will generate items which are draggable and clickable like a tabbed pan
- -->
- <td class="" valign="middle">
- <div class="{$TABSELECTED}" role="menuitem" tabindex="-1">
- <xsl:choose>
- <xsl:when test="not(./id=$selTabName)">
- <xsl:attribute name="onmouseover">this.className='item_active';window.status='';return true;</xsl:attribute>
- <xsl:attribute name="onmouseout">this.className='item';window.status='';return true;</xsl:attribute>
- <xsl:attribute name="onclick">doSelectTabCommand('<xsl:value-of select="./id"/>', '<xsl:value-of select="./type"/>',false);</xsl:attribute>
- <xsl:attribute name="onfocus">this.className='item_active';window.status='';return true;</xsl:attribute>
- <xsl:attribute name="onblur">this.className='item';window.status='';return true;</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="onclick">selectCurrentTab('<xsl:value-of select="./id"/>', '<xsl:value-of select="./type"/>')</xsl:attribute>
- <xsl:attribute name="onfocus">this.className='item_active';window.status='';return true;</xsl:attribute>
- <xsl:attribute name="onblur">this.className='item';window.status='';return true;</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- <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">
- <xsl:attribute name="style">cursor:hand; display:block;</xsl:attribute>
- <tr style="display:block;">
- <td colspan="3" style="height: 3px; display:block;">
- <img border="0" width="0" height="0" alt="" src="../ags/images/spacer.gif"/>
- </td>
- </tr>
- <tr height="27px" style="display:block;">
- <td>
- <table cellpadding="0" cellspacing="0" border="0" role="presentation">
- <tr>
- <td align="right" valign="top" width="30"> 
- <!--img border="0" width="24" src="../ags/images/spacer.gif"/-->
- </td>
- <td align="center" valign="top">
- <table cellpadding="0" cellspacing="0" border="0" width="30" height="24" role="presentation">
- <!-- Change background to img tag to fixing high contrast issue. -->
- <tr>
- <td width="30" height="24" valign="middle" align="center">
- <img alt="" border="0" style="margin-top:3px">
- <xsl:attribute name="src">
- <xsl:call-template name="putImage">
- <xsl:with-param name="sourceType">
- <xsl:value-of select="concat(./type, ./addInfo)"/>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:attribute>
- </img>
- </td>
- </tr>
- </table>
- </td>
- <td align="left" valign="top">
- <table cellpadding="0" cellspacing="0" border="0" width="30" height="24" role="presentation">
- <!-- Change background into img tag to fix High Contrast issue. -->
- <tr>
- <td width="30" height="24" valign="middle" align="center">
- <img alt="" border="0" style="top no-repeat">
- <xsl:call-template name="getTaskSuppressionStateGif">
- <xsl:with-param name="suppression-node" select="./suppression"/>
- </xsl:call-template>
- </img>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- <tr>
- <td height="30" colspan="3" align="center" valign="top" class="{$ITEMLABEL}">
- <xsl:call-template name="reduceToMaxSize">
- <xsl:with-param name="anystring">
- <xsl:call-template name="setText">
- <xsl:with-param name="theText">
- <xsl:value-of select="./name"/>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:with-param>
- <xsl:with-param name="maxsize" select="20"/>
- </xsl:call-template>
- </td>
- </tr>
- </table>
- </div>
- </td>
- <!-- show the sequence image only if the tasks are selected to run in order -->
- <xsl:if test="/root/agent_definition/sequencing='sequential' and position() < count(//agent_definition/items/item)">
- <td class="">
- <img alt="" src="../ags/images/summary/summary_sequence_arrow.gif"/>
- </td>
- </xsl:if>
- </tr>
- </table>
- </td>
- </xsl:for-each>
- </xsl:template>
- <xsl:template name="reduceToMaxSize">
- <xsl:param name="anystring">anystring</xsl:param>
- <xsl:param name="linebreakat">11</xsl:param>
- <xsl:param name="maxsize">20</xsl:param>
- <xsl:variable name="res">
- <xsl:choose>
- <xsl:when test="not(contains($anystring, ' ')) and string-length($anystring) > $maxsize">
- <xsl:value-of select="substring(normalize-space($anystring),0,$linebreakat)"/><xsl:text>...</xsl:text>
- </xsl:when>
- <xsl:when test="not(contains(substring($anystring,0,$linebreakat), ' ')) and string-length($anystring) > $linebreakat">
- <xsl:value-of select="substring(normalize-space($anystring),0,$linebreakat)"/><xsl:text>...</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="string-length($anystring) > $maxsize">
- <xsl:value-of select="substring(normalize-space($anystring),0,$maxsize)"/><xsl:text>...</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$anystring"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:value-of select="$res"/>
- </xsl:template>
- <!-- static buttons -->
- <xsl:template name="persistButton">
- <xsl:param name="name">name</xsl:param>
- <xsl:param name="type"/>
- <xsl:param name="desc"/>
-
- <!-- create the button when :
- 1. No capabilities are present OR
- 2. The button name is 'Schedule' and the 'canUseScheduling' capability is present OR
- 3. The button name is 'Condition'
- -->
- <xsl:if test="$name='AgentTask-condition'">
- <xsl:variable name="selTabName">
- <xsl:value-of select="/root/sb/param[@name='tabSelectedID']"/>
- </xsl:variable>
- <xsl:variable name="tdclass">
- <xsl:choose>
- <xsl:when test="$selTabName=$name">item_selected</xsl:when>
- <xsl:otherwise>item_not_selected</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="TABSELECTED">
- <xsl:choose>
- <xsl:when test="$selTabName=$name">item_active</xsl:when>
- <xsl:otherwise>item</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="ITEMLABEL">
- <xsl:choose>
- <xsl:when test="$selTabName=$name">item_label_active</xsl:when>
- <xsl:otherwise>item_label</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="reducedDesc98">
- <xsl:call-template name="reduceToMaxSize">
- <xsl:with-param name="anystring" select="$desc"/>
- <xsl:with-param name="maxsize" select="98"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="reducedDesc24">
- <xsl:call-template name="reduceToMaxSize">
- <xsl:with-param name="anystring" select="$desc"/>
- <xsl:with-param name="maxsize" select="20"/>
- </xsl:call-template>
- </xsl:variable>
- <!-- this id is used to set focus to selected tab -->
- <td id="{$tdclass}" class="{$tdclass}" width="90" align="center">
- <div class="{$TABSELECTED}" role="menuitem" tabindex="-1">
- <xsl:if test="not($selTabName=$name)">
- <xsl:attribute name="onmouseover">this.className='item_active';window.status='';return true;</xsl:attribute>
- <xsl:attribute name="onmouseout">this.className='item';window.status='';return true;</xsl:attribute>
- <xsl:attribute name="onfocus">this.className='item_active';window.status='';return true;</xsl:attribute>
- <xsl:attribute name="onblur">this.className='item';window.status='';return true;</xsl:attribute>
- <xsl:attribute name="onclick">doSelectTabCommand('<xsl:value-of select="$name"/>', '<xsl:value-of select="$type"/>',false);</xsl:attribute>
- <xsl:attribute name="style">cursor:hand</xsl:attribute>
- </xsl:if>
- <table id="id_{$name}" role="menuitem" title="{$desc}" cellpadding="0" cellspacing="0" border="0" rules="none" width="90" height="60">
- <!-- Change background to img tag to fixing high contrast issue. -->
- <tr>
- <td align="center" valign="top">
- <img alt="" border="0" height="24" width="24" style="margin-top:3px" align="center">
- <xsl:attribute name="src">
- <xsl:call-template name="putImage"><xsl:with-param name="sourceType"><xsl:value-of select="$type"/></xsl:with-param></xsl:call-template>
- </xsl:attribute>
- </img>
- </td>
- </tr>
- <tr>
- <td align="center" valign="top" class="{$ITEMLABEL}" height="30">
- <xsl:choose>
- <xsl:when test="$desc=''">
- <xsl:call-template name="setText">
- <xsl:with-param name="theText">
- <xsl:value-of select="$desc"/>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$reducedDesc24"/>
- </xsl:otherwise>
- </xsl:choose>
- </td>
- </tr>
- </table>
- </div>
- </td>
- <td class="item_not_selected">
- <table cellpadding="0" cellspacing="0" role="separator">
- <tr>
- <td>
- <img border="0" alt="" src="../ags/images/summary/summary_separator.gif"/>
- </td>
- </tr>
- </table>
- </td>
- </xsl:if>
- </xsl:template>
- <xsl:template name="persistButtonHeader">
- <xsl:param name="name"/>
- <td style="display: block;">
- <table cellpadding="0" cellspacing="0" border="0" rules="none" width="90" role="tooltip" style="height:100%; display:block;">
- <tr style="display:block;">
- <td align="center" valign="top" style="display: block; height: 1px;">
- <img border="0" height="1" width="24" alt="" src="../ags/images/spacer.gif"/>
- </td>
- </tr>
- <tr valign="bottom" style="display:block;">
- <td class="group_label" valign="bottom">
- <xsl:value-of select="$name"/>
- </td>
- </tr>
- </table>
- </td>
- <td>
- <table role="separator">
- <tr style="display: block;">
- <td style="display: block; height: 1px;">
- <img border="0" height="1" width="4" alt="" src="../ags/images/spacer.gif"/>
- </td>
- </tr>
- </table>
- </td>
- </xsl:template>
- <!-- match="//agent_definition/items/item"> -->
- <xsl:template name="agentItemHeaders">
- <xsl:param name="name"/>
- <xsl:param name="class"/>
- <xsl:choose>
- <xsl:when test="//agent_definition/items/item">
- <!-- make header space for all of them -->
- <xsl:for-each select="//agent_definition/items/item">
- <xsl:call-template name="agentItemHeaderContent">
- <xsl:with-param name="name">
- <xsl:if test="position() = 1">
- <xsl:value-of select="$name"/>
- </xsl:if>
- </xsl:with-param>
- <xsl:with-param name="class">
- <xsl:value-of select="$class"/>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:for-each>
- </xsl:when>
- <xsl:otherwise>
- <!-- do it just once -->
- <xsl:call-template name="agentItemHeaderContent">
- <xsl:with-param name="name">
- <xsl:value-of select="$name"/>
- </xsl:with-param>
- <xsl:with-param name="class">
- <xsl:value-of select="$class"/>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="agentItemHeaderContent">
- <xsl:param name="name"/>
- <xsl:param name="class"/>
- <td class="{$class}">
- <table class="external_div_hidden" role="separator">
- <tr>
- <td align="center" valign="middle" style="display: block; height: 1px;">
- <img height="1" width="2" alt="" src="../ags/images/spacer.gif"/>
- </td>
- </tr>
- </table>
- </td>
- <!-- todo: check consistancy of tab names id="{$name}tab" -->
- <td class="{$class}" width="98" align="center">
- <table cellpadding="0" cellspacing="0" border="0" role="tooltip">
- <tr>
- <!-- handle button -->
- <td>
- <img border="0" height="1" width="12" alt="" src="../ags/images/spacer.gif"/>
- </td>
- <td valign="middle" style="display:block;">
- <table cellpadding="0" cellspacing="0" border="0" rules="none" role="tooltip" width="90px" style="display:block;">
- <tr style="display:block;">
- <td align="left" valign="top" style="display: block; height: 1px;">
- <img border="0" height="1" width="90" alt="" src="../ags/images/spacer.gif"/>
- </td>
- </tr>
- <tr style="display:block;">
- <td colspan="3" align="left" valign="top" class="group_label">
- <xsl:value-of select="$name"/>
- </td>
- </tr>
- </table>
- </td>
- <xsl:if test="/root/agent_definition/sequencing='sequential' and position() < count(//agent_definition/items/item)">
- <td style="display: block; height: 1px;">
- <img height="1" width="13" alt="" src="../ags/images/spacer.gif"/>
- </td>
- </xsl:if>
- </tr>
- </table>
- </td>
- </xsl:template>
- <!-- generate the image for the middle element -->
- <xsl:template name="putImage">
- <xsl:param name="sourceType">agent</xsl:param>
- <xsl:choose>
- <xsl:when test="$sourceType = 'message'">
- <xsl:value-of select="'../ags/images/summary/icon_email_24.gif'"/>
- </xsl:when>
- <xsl:when test="$sourceType = 'messagehasAttachment'">
- <xsl:value-of select="'../ags/images/summary/icon_email_attachment_24.gif'"/>
- </xsl:when>
- <xsl:when test="$sourceType = 'report'">
- <xsl:value-of select="'../ags/images/summary/icon_report_24.gif'"/>
- </xsl:when>
- <xsl:when test="$sourceType = 'reporthasPrompts'">
- <xsl:value-of select="'../ags/images/summary/icon_report_prompt_24.gif'"/>
- </xsl:when>
- <xsl:when test="$sourceType = 'agent'">
- <xsl:value-of select="'../ags/images/summary/icon_agent_24.gif'"/>
- </xsl:when>
- <xsl:when test="$sourceType = 'job'">
- <xsl:value-of select="'../ags/images/summary/icon_job_24.gif'"/>
- </xsl:when>
- <xsl:when test="$sourceType = 'sql'">
- <xsl:value-of select="'../ags/images/summary/icon_SQL_writeback_24.gif'"/>
- </xsl:when>
- <xsl:when test="$sourceType = 'schedule'">
- <xsl:value-of select="'../ags/images/summary/icon_schedule_enabled_24.gif'"/>
- </xsl:when>
- <xsl:when test="$sourceType = 'condition'">
- <xsl:value-of select="'../ags/images/summary/icon_condition_24.gif'"/>
- </xsl:when>
- <xsl:when test="$sourceType = 'web'">
- <xsl:value-of select="'../ags/images/summary/icon_Web_service_24.gif'"/>
- </xsl:when>
- <xsl:when test="$sourceType = 'url'">
- <xsl:value-of select="'../ags/images/summary/icon_newsitem_24.gif'"/>
- </xsl:when>
- <xsl:when test="$sourceType = 'import'">
- <xsl:value-of select="'../ags/images/summary/icon_import_24.gif'"/>
- </xsl:when>
- <xsl:when test="$sourceType = 'export'">
- <xsl:value-of select="'../ags/images/summary/icon_export_24.gif'"/>
- </xsl:when>
- <xsl:when test="$sourceType = 'content'">
- <xsl:value-of select="'../ags/images/summary/icon_content_maintenance_24.gif'"/>
- </xsl:when>
- <xsl:when test="$sourceType = 'index'">
- <xsl:value-of select="'../ags/images/summary/icon_index_update_24.gif'"/>
- </xsl:when>
- <xsl:when test="$sourceType = 'metric'">
- <xsl:value-of select="'../ags/images/summary/icon_metrics_maintenance_24.gif'"/>
- </xsl:when>
- <xsl:when test="$sourceType = 'planningMacro'">
- <xsl:value-of select="'../ags/images/summary/icon_planning_macro_24.gif'"/>
- </xsl:when>
- <xsl:when test="$sourceType = 'migration'">
- <xsl:value-of select="'../ags/images/summary/icon_migration_24.gif'"/>
- </xsl:when>
- <xsl:when test="$sourceType = 'approval'">
- <xsl:value-of select="'../ags/images/summary/icon_approval_task_24x24.gif'"/>
- </xsl:when>
- <xsl:when test="$sourceType = 'notification'">
- <xsl:value-of select="'../ags/images/summary/icon_notification_24x24.gif'"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="'../ps/portal/images/icon_unknown.gif'"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- generate the image for the tool tip (small) -->
- <xsl:template name="toolTipImage">
- <xsl:param name="sourceType">import</xsl:param>
- <xsl:choose>
- <xsl:when test="$sourceType = 'import'">
- <xsl:value-of select="'../ags/images/tasks/action_new_import.gif'"/>
- </xsl:when>
- <xsl:when test="$sourceType = 'export'">
- <xsl:value-of select="'../ags/images/tasks/action_new_export.gif'"/>
- </xsl:when>
- <xsl:when test="$sourceType = 'content'">
- <xsl:value-of select="'../ags/images/tasks/action_new_content_maintenance.gif'"/>
- </xsl:when>
- <xsl:when test="$sourceType = 'web'">
- <xsl:value-of select="'../ags/images/tasks/action_new_web_service.gif'"/>
- </xsl:when>
- <xsl:when test="$sourceType = 'sql'">
- <xsl:value-of select="'../ags/images/tasks/action_new_SQL_writeback.gif'"/>
- </xsl:when>
- <xsl:when test="$sourceType = 'job'">
- <xsl:value-of select="'../ags/images/tasks/action_new_job.gif'"/>
- </xsl:when>
- <xsl:when test="$sourceType = 'message'">
- <xsl:value-of select="'../ags/images/tasks/action_new_email.gif'"/>
- </xsl:when>
- <xsl:when test="$sourceType = 'messagehasAttachment'">
- <xsl:value-of select="'../ags/images/tasks/action_new_email_attachment.gif'"/>
- </xsl:when>
- <xsl:when test="$sourceType = 'agent'">
- <xsl:value-of select="'../ags/images/tasks/action_new_agent.gif'"/>
- </xsl:when>
- <xsl:when test="$sourceType = 'report'">
- <xsl:value-of select="'../ags/images/tasks/action_new_report.gif'"/>
- </xsl:when>
- <xsl:when test="$sourceType = 'reporthasPrompts'">
- <xsl:value-of select="'../ags/images/tasks/action_new_report_prompt.gif'"/>
- </xsl:when>
- <xsl:when test="$sourceType = 'url'">
- <xsl:value-of select="'../ags/images/tasks/action_new_newsitem.gif'"/>
- </xsl:when>
- <xsl:when test="$sourceType = 'metric'">
- <xsl:value-of select="'../ags/images/menu/action_new_metrics_maintenance.gif'"/>
- </xsl:when>
- <xsl:when test="$sourceType = 'index'">
- <xsl:value-of select="'../ags/images/menu/action_new_index_update.gif'"/>
- </xsl:when>
- <xsl:when test="$sourceType = 'approval'">
- <xsl:value-of select="'../ags/images/menu/action_approval_task.gif'"/>
- </xsl:when>
- <xsl:when test="$sourceType = 'notification'">
- <xsl:value-of select="'../ags/images/menu/action_notification.gif'"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="putImage">
- <xsl:with-param name="sourceType">
- <xsl:value-of select="$sourceType"/>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="setText">
- <xsl:param name="theText"/>
- <xsl:choose>
- <xsl:when test="$theText=''"><xts:string id="AGENT_SUMMARY_NONE"/></xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$theText"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- </xsl:stylesheet>
|