<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xslc="http://xslcomponents.org/TR/WD-xslc">
<xsl:import href="../xslc.xsl"/>
<xsl:import href="XMLCAdm_Tabs.xsl"/>
<xsl:template match="/">
<xsl:apply-templates select="document"/>
</xsl:template>
<xsl:template match="document">
<xsl:call-template name="xslc:Page">
<xsl:with-param name="Title" select="/document/Locales/XMLC_DashboardTitle"/>
<xsl:with-param name="PageTitle">
<img align="absmiddle" src="{$XMLC_PictosPath}button_Monitoring.gif"/>&#160;<xsl:value-of select="/document/Locales/XMLC_DashboardPageTitle"/>
</xsl:with-param>
<xsl:with-param name="ToolbarButtonsLeft">
<xsl:call-template name="AdmCommonToolbarButtonsLeft"/>
<ToolbarButton>
<xsl:call-template name="xslc:ToolbarButton">
<xsl:with-param name="Caption">
<img alt="{/document/Locales/NeedToInitializeAlt}" border="0" src="{$XMLC_PictosPath}Button_RefreshArrow.gif"/>
</xsl:with-param>
<xsl:with-param name="HRef">
<xsl:value-of select="/document/XMLC_Params/XMLC_ScriptName"/>
<xsl:choose>
<xsl:when test="/document/XMLC_Params/XMLC_UseXMLC_Action = '1'">?XMLC_Action=</xsl:when>
<xsl:otherwise>/</xsl:otherwise>
</xsl:choose>XMLC_SetNeedToInitialize</xsl:with-param>
</xsl:call-template>
</ToolbarButton>
<ToolbarButton>
<img border="0" src="{$XMLC_SkinPath}toolbar_separator.gif"/>
</ToolbarButton>
<ToolbarButton>
<table cellpadding="0" cellspacing="0">
<tr>
<td nowrap="">
<input id="CheckFileAge" type="checkbox">
<xsl:if test="/document/PARAMS/XMLC_CheckFileAge = '1'">
<xsl:attribute name="checked">1</xsl:attribute>
</xsl:if>
<xsl:attribute name="onClick"><xsl:choose><xsl:when test="/document/XMLC_Params/XMLC_UseXMLC_Action = '1'">location.href = '?XMLC_Action=XMLC_SetXMLC_CheckFileAge&amp;XMLC_CheckFileAge=</xsl:when><xsl:otherwise>location.href = 'XMLC_SetXMLC_CheckFileAge?XMLC_CheckFileAge=</xsl:otherwise></xsl:choose><xsl:choose><xsl:when test="/document/PARAMS/XMLC_CheckFileAge != '1'">1</xsl:when><xsl:otherwise>0</xsl:otherwise></xsl:choose>';</xsl:attribute>
</input>
<label for="CheckFileAge">
<xsl:value-of select="/document/Locales/CheckFileAgeCaption"/>
</label>
</td>
</tr>
</table>
</ToolbarButton>
<ToolbarButton>
<img border="0" src="{$XMLC_SkinPath}toolbar_separator.gif"/>
</ToolbarButton>
<ToolbarButton>
<table cellpadding="0" cellspacing="0">
<tr>
<td nowrap="">
<input id="XMLC_Stack" type="checkbox">
<xsl:if test="/document/PARAMS/XMLC_Stack = '1'">
<xsl:attribute name="checked">1</xsl:attribute>
</xsl:if>
<xsl:attribute name="onClick"><xsl:choose><xsl:when test="/document/XMLC_Params/XMLC_UseXMLC_Action = '1'">location.href = '?XMLC_Action=XMLC_SetXMLC_Stack&amp;XMLC_Stack=</xsl:when><xsl:otherwise>location.href = 'XMLC_SetXMLC_Stack?XMLC_Stack=</xsl:otherwise></xsl:choose><xsl:choose><xsl:when test="/document/PARAMS/XMLC_Stack != '1'">1</xsl:when><xsl:otherwise>0</xsl:otherwise></xsl:choose>';</xsl:attribute>
</input>
<label for="XMLC_Stack">
<xsl:value-of select="/document/Locales/CallStackHeader"/>
</label>
</td>
</tr>
</table>
</ToolbarButton>
<ToolbarButton>
<img border="0" src="{$XMLC_SkinPath}toolbar_separator.gif"/>
</ToolbarButton>
</xsl:with-param>
<xsl:with-param name="ToolbarButtonsRight">
<xsl:call-template name="AdmCommonToolbarButtonsRight"/>
</xsl:with-param>
<xsl:with-param name="Head">
				<script language="javascript"><![CDATA[function enabledModule(status, pool, index) {
  var lStatus;
  if (status == 'True')
    lStatus = '0'
  else
    lStatus = '1';]]><xsl:choose>
<xsl:when test="/document/XMLC_Params/XMLC_UseXMLC_Action = '1'">location.href = '?XMLC_Action=XMLC_SetEnabled&amp;URL=XMLC_Dashboard&amp;ModuleStatus='+lStatus+'&amp;XMLC_Pool='+pool+'&amp;ModuleIndex='+index;</xsl:when>
<xsl:otherwise>location.href = 'XMLC_SetEnabled?URL=XMLC_Dashboard&amp;ModuleStatus='+lStatus+'&amp;XMLC_Pool='+pool+'&amp;ModuleIndex='+index;</xsl:otherwise>
</xsl:choose><![CDATA[}]]></script>
</xsl:with-param>
<xsl:with-param name="ActivePageName">XMLC_Dashboard</xsl:with-param>
<xsl:with-param name="Tabs">
<xsl:call-template name="XMLCAdm_Tabs"/>
</xsl:with-param>
<xsl:with-param name="DisplayTabs">1</xsl:with-param>
<xsl:with-param name="Body">
<xsl:apply-templates select="Infos"/>
<xsl:apply-templates select="Pools/Pool"/>
<br/>
<xsl:apply-templates select="WAITINGS">
<xsl:with-param name="Title" select="/document/Locales/UserRequestCaption"/>
</xsl:apply-templates>
<br/>
<xsl:apply-templates select="ASYNCWAITINGS">
<xsl:with-param name="Title" select="/document/Locales/AsyncRequestCaption"/>
</xsl:apply-templates>
<br/>
<xsl:apply-templates select="Plugins"/>
</xsl:with-param>
</xsl:call-template>
</xsl:template>
<xsl:template match="Infos">
<table cellpadding="2" cellspacing="0">
<tr>
<td align="left" nowrap="">
<xsl:value-of select="/document/Locales/DLLDateCaption"/>
</td>
<td>
<xsl:value-of select="DLLDate"/>
</td>
</tr>
</table>
<br/>
</xsl:template>
<xsl:template match="Pool">
<table cellpadding="2" cellspacing="0" class="clFlatTable" width="100%">
<tr class="clRowHeader">
<td width="10%" align="left" nowrap="">
<xsl:value-of select="Name"/>&#160;<a>
<xsl:attribute name="href"><xsl:choose><xsl:when test="/document/XMLC_Params/XMLC_UseXMLC_Action = '1'">?XMLC_Action=XMLC_AddNewModule&amp;XMLC_Pool=</xsl:when><xsl:otherwise>XMLC_AddNewModule?XMLC_Pool=</xsl:otherwise></xsl:choose><xsl:value-of select="Name"/></xsl:attribute>
<img alt="{/document/Locales/AddNewThreadAlt}" border="0" src="{$XMLC_PictosPath}ico_xplus.gif"/>
</a>
</td>
<xsl:value-of select="/document/Locales/Header"/>
				<td title="{/document/Locales/AffinityAlt}" nowrap="">
					<xsl:value-of select="/document/Locales/AffinityHeader"/>
				</td>
<td>
<xsl:value-of select="/document/Locales/AverageTimeHeader"/>
</td>
<td>
<xsl:value-of select="/document/Locales/RequestsCountHeader"/>
</td>
<td>
<xsl:value-of select="/document/Locales/LastCPUHeader"/>
</td>
<td>
<xsl:value-of select="/document/Locales/AverageWaitTimeHeader"/>
</td>
<td width="30%">
<xsl:value-of select="/document/Locales/RequestHeader"/>
</td>
<td width="70%">
<xsl:value-of select="/document/Locales/CallStackHeader"/>
</td>
</tr>
<xsl:apply-templates select="XMLCollection"/>
</table>
<xsl:apply-templates select="WAITINGS"/>
<br/>
</xsl:template>
<xsl:template match="XMLCollection">
<xsl:variable name="clValue">
<xsl:choose>
<xsl:when test="(position() mod 2)=0">clRowDark</xsl:when>
<xsl:otherwise>clRowLight</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<tr class="{$clValue}">
<td valign="top">
<span>
<xsl:choose>
<xsl:when test="INUSE = '1'">
<img alt="{/document/Locales/ThreadRunningAlt}" border="0" src="{$XMLC_Portal}Monitoring/Working.gif"/>
</xsl:when>
<xsl:otherwise>
<img alt="{/document/Locales/ThreadReadyAlt}" border="0" src="{$XMLC_Portal}Monitoring/Available.gif"/>
</xsl:otherwise>
</xsl:choose>
<xsl:if test="KILL = 'False'">
<input type="checkbox">
							<xsl:attribute name="onClick">enabledModule('<xsl:value-of select="ENABLED"/>', '<xsl:value-of select="../Name"/>', '<xsl:value-of select="Index"/>');</xsl:attribute>
<xsl:choose>
<xsl:when test="ENABLED = 'True'">
<xsl:attribute name="checked"/>
<xsl:attribute name="title"><xsl:value-of select="/document/Locales/SuspendThreadAlt"/></xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="title"><xsl:value-of select="/document/Locales/ResumeThreadAlt"/></xsl:attribute>
</xsl:otherwise>
</xsl:choose>
</input>
<a>
<xsl:attribute name="href"><xsl:choose><xsl:when test="/document/XMLC_Params/XMLC_UseXMLC_Action = '1'">?XMLC_Action=XMLC_KillModule&amp;XMLC_Pool=</xsl:when><xsl:otherwise>XMLC_KillModule?XMLC_Pool=</xsl:otherwise></xsl:choose><xsl:value-of select="../Name"/>&amp;MODULE_INDEX=<xsl:value-of select="Index"/></xsl:attribute>
							<img alt="{/document/Locales/KillThreadAlt}" border="0" src="{$XMLC_Portal}Monitoring/Kill.gif"/>
						</a>
<xsl:if test="INUSE = '1'">
<xsl:choose>
<xsl:when test="SUSPENDED = 'True'">
<a>
<xsl:attribute name="href"><xsl:choose><xsl:when test="/document/XMLC_Params/XMLC_UseXMLC_Action = '1'">?XMLC_Action=XMLC_ResumeModule&amp;XMLC_Pool=</xsl:when><xsl:otherwise>XMLC_ResumeModule?XMLC_Pool=</xsl:otherwise></xsl:choose><xsl:value-of select="../Name"/>&amp;MODULE_INDEX=<xsl:value-of select="Index"/>&amp;THREADID=<xsl:value-of select="THREADID"/></xsl:attribute>
										<img alt="{/document/Locales/ResumeRequestAlt}" border="0" src="{$XMLC_Portal}Monitoring/Resume.gif"/>
									</a>
</xsl:when>
<xsl:otherwise>
<a>
<xsl:attribute name="href"><xsl:choose><xsl:when test="/document/XMLC_Params/XMLC_UseXMLC_Action = '1'">?XMLC_Action=XMLC_SuspendModule&amp;XMLC_Pool=</xsl:when><xsl:otherwise>XMLC_SuspendModule?XMLC_Pool=</xsl:otherwise></xsl:choose><xsl:value-of select="../Name"/>&amp;MODULE_INDEX=<xsl:value-of select="Index"/>&amp;THREADID=<xsl:value-of select="THREADID"/></xsl:attribute>
										<img alt="{/document/Locales/SuspendRequestAlt}" border="0" src="{$XMLC_Portal}Monitoring/Suspended.gif"/>
									</a>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:if>
</span>
</td>
			<td align="left" valign="top">
				<xsl:value-of select="ThreadAffinityMask"/>
			</td>
<td align="right" valign="top">
<xsl:value-of select="AverageTime"/>
</td>
<td align="right" valign="top">
<xsl:value-of select="RequestCount"/>
</td>
<td align="right" valign="top">
<xsl:value-of select="LastCPUTime"/>
</td>
<td align="right" valign="top">
<xsl:value-of select="WaitAvg"/>
</td>
<td valign="top">
<xsl:if test="INUSE = '1'">
<xsl:choose>
<xsl:when test="CLIENT_NAME = 'None'">
<xsl:value-of select="/document/Locales/NoneCaption"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="CLIENT_NAME"/>&#160;<a>
<xsl:attribute name="href"><xsl:choose><xsl:when test="/document/XMLC_Params/XMLC_UseXMLC_Action = '1'">?XMLC_Action=XMLC_KillRequest&amp;XMLC_Pool=</xsl:when><xsl:otherwise>XMLC_KillRequest?XMLC_Pool=</xsl:otherwise></xsl:choose><xsl:value-of select="../Name"/>&amp;MODULE_INDEX=<xsl:value-of select="Index"/></xsl:attribute>
<img alt="{/document/Locales/KillRequestAlt}" border="0" src="{$XMLC_PictosPath}ico_xminus.gif"/>
</a>
</xsl:otherwise>
</xsl:choose>
<span>
<xsl:value-of select="CLIENT_KILLED"/>
</span>
<br/>
<xsl:choose>
<xsl:when test="PATH = 'None'">
<xsl:value-of select="/document/Locales/NoneCaption"/>
</xsl:when>
<xsl:otherwise>
<a>
<xsl:attribute name="href"><xsl:choose><xsl:when test="/document/XMLC_Params/XMLC_UseXMLC_Action = '1'">?XMLC_Action=XMLC_DumpRequest&amp;XMLCollectionNo=</xsl:when><xsl:otherwise>XMLC_DumpRequest?XMLCollectionNo=</xsl:otherwise></xsl:choose><xsl:value-of select="Index"/></xsl:attribute>
<xsl:value-of select="PATH"/>
</a>
</xsl:otherwise>
</xsl:choose>
<br/>
<xsl:value-of select="ELAPSEDTIME"/>
					<xsl:if test="Current != ''">
						<br/>
						<xsl:value-of select="Current"/>/<xsl:value-of select="Max"/>
					</xsl:if>
</xsl:if>
</td>
<td valign="top">
<xsl:apply-templates select="CALLSTACK"/>
</td>
</tr>
</xsl:template>
<xsl:template match="WAITINGS">
<xsl:if test="@RowCount != '0'">
<table border="0" cellpadding="2" cellspacing="0" class="clFlatTable" width="100%">
<tr class="clRowHeader">
<td width="200">
<xsl:value-of select="/document/Locales/WaitingsCaption"/>&#160;<xsl:value-of select="@RowCount"/>
<xsl:if test="@RowCount != '0'">&#160;<a>
<xsl:attribute name="href"><xsl:choose><xsl:when test="/document/XMLC_Params/XMLC_UseXMLC_Action = '1'">XMLC_KillWaitingRequest?KillAll=True&amp;XMLC_Pool=</xsl:when><xsl:otherwise>XMLC_KillWaitingRequest?KillAll=True&amp;XMLC_Pool=</xsl:otherwise></xsl:choose><xsl:value-of select="../Name"/></xsl:attribute>
<img alt="{/document/Locales/KillAllWaitingRequestsCaption}" border="0" src="{$XMLC_PictosPath}ico_xminus.gif"/>
</a>
</xsl:if>
</td>
<td width="150">
<xsl:value-of select="/document/Locales/ActionCaption"/>
</td>
<td width="180">
<xsl:value-of select="/document/Locales/WaitingTimeCaption"/>
</td>
</tr>
<xsl:apply-templates select="WAITING"/>
</table>
</xsl:if>
</xsl:template>
<xsl:template match="WAITING">
<xsl:variable name="clValue">
<xsl:choose>
<xsl:when test="(position() mod 2)=0">clRowDark</xsl:when>
<xsl:otherwise>clRowLight</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<tr class="{$clValue}">
<td>
<a href="">
<xsl:attribute name="href"><xsl:choose><xsl:when test="/document/XMLC_Params/XMLC_UseXMLC_Action = '1'">?XMLC_Action=XMLC_KillWaitingRequest&amp;WAITING_INDEX=</xsl:when><xsl:otherwise>XMLC_KillWaitingRequest?WAITING_INDEX=</xsl:otherwise></xsl:choose><xsl:value-of select="WAITING_INDEX"/>&amp;XMLC_Pool=<xsl:value-of select="../../Name"/></xsl:attribute>
<img alt="{/document/Locales/KillAllWaitingRequestsCaption}" border="0" src="{$XMLC_PictosPath}ico_xminus.gif"/>
</a>&#160;<xsl:value-of select="CLIENT_NAME"/>
<br/>
<xsl:value-of select="CLIENT_KILLED"/>
</td>
<td>
<xsl:value-of select="PATH"/>
</td>
<td>
<xsl:value-of select="CUR_WAITING"/> -> <xsl:value-of select="MAX_WAITING"/>
</td>
</tr>
</xsl:template>
<xsl:template match="Plugins">
<table cellpadding="2" cellspacing="0" class="clFlatTable" width="100%">
<tr class="clRowHeader">
<td>
<xsl:value-of select="/document/Locales/LoadedPluginsHeader"/>
</td>
<td>
<xsl:value-of select="/document/Locales/PluginDate"/>
</td>
</tr>
<xsl:apply-templates select="Plugin"/>
</table>
</xsl:template>
<xsl:template match="Plugin">
<xsl:variable name="clValue">
<xsl:choose>
<xsl:when test="(position() mod 2)=0">clRowDark</xsl:when>
<xsl:otherwise>clRowLight</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<tr class="{$clValue}">
<td>
<xsl:value-of select="Name"/>
</td>
<td>
<xsl:value-of select="PluginDate"/>
</td>
</tr>
</xsl:template>
</xsl:stylesheet>
