<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- XSLT for HostMonitor user operatiosn log -->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<head>
 <title>HostMonitor operator actions</title>
 <STYLE TYPE="text/css">
  .hdrstyle1   { vertical-align: top; text-align: left; padding: 5px; margin-top: 1em; margin-bottom: 0em; background-color: #d5e0FF; border: dotted thin silver }
  .hdrstyle2   { vertical-align: top; text-align: left; padding: 5px; margin-top: 1em; margin-bottom: 0em; background-color: #d5e0FF; border-top: dotted thin silver; border-bottom: dotted thin silver; border-left: dotted thin silver; }
  .cellstyle0  { vertical-align: top; text-align: left; padding: 3px; white-space: nowrap;                            border-bottom: dotted thin silver; border-right: dotted thin silver; }
  .cellstyle1  { vertical-align: top; text-align: left; padding: 3px; white-space: nowrap; background-color: #E0F0FF; border-bottom: dotted thin silver; border-right: dotted thin silver; }
  .cellwarn    { vertical-align: top; text-align: left; padding: 3px; white-space: nowrap; background-color: #E0F0FF; color: #FF0000; border-bottom: dotted thin silver; border-right: dotted thin silver; }
  .cellerr     { vertical-align: top; text-align: left; padding: 3px; white-space: nowrap; background-color: #FFFF99; color: #FF0000; border-bottom: dotted thin silver; border-right: dotted thin silver; }
  .cell_end    { vertical-align: top; text-align: left; padding: 3px; white-space: nowrap;                            border-bottom: dotted thin silver; }
  .cell_endOk  { vertical-align: top; text-align: left; padding: 3px; white-space: nowrap; color: #0000FF;            border-bottom: dotted thin silver; }
  .cell_endWarn{ vertical-align: top; text-align: left; padding: 3px; white-space: nowrap; color: #FF0000;            border-bottom: dotted thin silver; }
 </STYLE>
</head>
 
<body style="font-family:Arial; background-color:#fEfEfE">
 <table border="0" style="border-bottom: solid medium silver; border-right: solid medium silver">
   <xsl:variable name="var_header">
    <tr>
     <td class="hdrstyle1">Operation time</td>
     <td class="hdrstyle1">Operator type</td>
     <td class="hdrstyle1">Operator ID:name</td>
     <td class="hdrstyle1">Operation ID:name</td>
     <td class="hdrstyle1">Item ID:name</td>
     <td class="hdrstyle1">Result</td>
     <td class="hdrstyle2">Description</td>
    </tr>
   </xsl:variable>

   <xsl:copy-of select="$var_header" />

   <xsl:for-each select="userlog/logrec">
     <tr>
       <td class="cellstyle0"><xsl:value-of select="time"/></td>
       <td class="cellstyle1"><xsl:value-of select="usertype"/></td>
       <td class="cellstyle0"><xsl:value-of select="userid"/>:<xsl:value-of select="username"/></td>
       <td class="cellstyle1" style="white-space: nowrap">
        <xsl:value-of select="operationid"/>:
        <xsl:choose>
         <xsl:when test="operationid = '0'">HostMonitor started</xsl:when>
         <xsl:when test="operationid = '1'">Monitoring started</xsl:when>
         <xsl:when test="operationid = '2'">Monitoring stopped</xsl:when>
         <xsl:when test="operationid = '3'">Alerts enabled</xsl:when>
         <xsl:when test="operationid = '4'">Alerts disabled</xsl:when>
         <xsl:when test="operationid = '5'"/>
         <xsl:when test="operationid = '6'">HostMonitor will be terminated</xsl:when>
         <xsl:when test="operationid = '7'">HostMonitor will be reloaded</xsl:when>
         <xsl:when test="operationid = '8'">HostMonitor settings reloaded</xsl:when>
         <xsl:when test="operationid = '9'">New test list created</xsl:when>
         <xsl:when test="operationid = '10'">Test list loaded</xsl:when>
         <xsl:when test="operationid = '11'">New settings applied</xsl:when>
         <xsl:when test="operationid = '12'">Import from text file</xsl:when>
         <xsl:when test="operationid = '13'">Merged HML file</xsl:when>
         <xsl:when test="operationid = '14'">HM Script started</xsl:when>
         <xsl:when test="operationid = '15'">HM Script finished</xsl:when>
         <xsl:when test="operationid = '16'">HML properties changed</xsl:when>
         <xsl:when test="operationid = '17'">Network Map clone</xsl:when>
         <xsl:when test="operationid = '20'">New test item</xsl:when>
         <xsl:when test="operationid = '21'">New test link</xsl:when>
         <xsl:when test="operationid = '22'">Test modified</xsl:when>
         <xsl:when test="operationid = '23'">Test modified</xsl:when>
         <xsl:when test="operationid = '24'">Test param changed</xsl:when>
         <xsl:when test="operationid = '25'">Test moved</xsl:when>
         <xsl:when test="operationid = '26'">Test deleted</xsl:when>
         <xsl:when test="operationid = '27'">Test link deleted</xsl:when>

         <xsl:when test="operationid = '28'">Test paused</xsl:when>
         <xsl:when test="operationid = '29'">Test resumed</xsl:when>
         <xsl:when test="operationid = '30'">Test scheduled to be paused</xsl:when>
         <xsl:when test="operationid = '31'">Test pause repealed</xsl:when>
         <xsl:when test="operationid = '32'">Test refreshed</xsl:when>
         <xsl:when test="operationid = '33'">Test statistics resetted</xsl:when>
         <xsl:when test="operationid = '34'">Test disabled</xsl:when>
         <xsl:when test="operationid = '35'">Test enabled</xsl:when>
         <xsl:when test="operationid = '36'">Test status acknowledged</xsl:when>
         <xsl:when test="operationid = '37'">Status ack, alerts stopped</xsl:when>
         <xsl:when test="operationid = '38'">Acknowledgement recalled</xsl:when>
         <xsl:when test="operationid = '39'">Test quick log cleared</xsl:when>
         <xsl:when test="operationid = '50'">Entire folder refreshed</xsl:when>
         <xsl:when test="operationid = '51'">Entire folder resetted</xsl:when>
         <xsl:when test="operationid = '52'">Entire folder disabled</xsl:when>
         <xsl:when test="operationid = '53'">Entire folder enabled</xsl:when>
         <xsl:when test="operationid = '54'"/>
         <xsl:when test="operationid = '60'">Folder created</xsl:when>
         <xsl:when test="operationid = '61'">Folder edited</xsl:when>
         <xsl:when test="operationid = '62'">Folder renamed</xsl:when>
         <xsl:when test="operationid = '63'">Folder deleted</xsl:when>
         <xsl:when test="operationid = '64'">Folder moved</xsl:when>
         <xsl:when test="operationid = '65'">Folders resorted</xsl:when>
         <xsl:when test="operationid = '66'">Folder agent changed</xsl:when>
         <xsl:when test="operationid = '67'">Folder variables changed</xsl:when>
         <xsl:when test="operationid = '68'"/>
         <xsl:when test="operationid = '69'"/>
         <xsl:when test="operationid = '70'">View created</xsl:when>
         <xsl:when test="operationid = '71'">View edited</xsl:when>
         <xsl:when test="operationid = '72'">View renamed</xsl:when>
         <xsl:when test="operationid = '73'">View deleted</xsl:when>
         <xsl:when test="operationid = '74'">View moved</xsl:when>
         <xsl:when test="operationid = '75'">Views resorted</xsl:when>
         <xsl:when test="operationid = '76'"/>
         <xsl:when test="operationid = '80'">Denomination</xsl:when>
         <xsl:when test="operationid = '81'">User defined variables modified</xsl:when>
        </xsl:choose>
       </td>

       <!-- select all objects (tests) -->
       <td class="cellstyle0">
        <xsl:for-each select="objectslist/object">
         <xsl:value-of select="@id"/>:<xsl:value-of select="@name"/><br />
        </xsl:for-each>
       </td>

       <!-- choose for result cell ad descr -->
       <xsl:choose>
        <xsl:when test="res = 'Rejected'">
         <td class="cellwarn"><xsl:value-of select="res"/></td>
         <td class="cell_endWarn"><xsl:value-of select="description"/></td>
        </xsl:when>
        <xsl:when test="res = 'Failed'">
         <td class="cellerr"><xsl:value-of select="res"/></td>
         <td class="cell_endWarn"><xsl:value-of select="description"/></td>
        </xsl:when>
        <xsl:otherwise>
         <td class="cellstyle1"><xsl:value-of select="res"/></td>
         <!-- choose style for descr cell when result="Done" -->
         <xsl:choose>
          <xsl:when test="operationid = '2'">
           <td class="cell_endWarn"><xsl:value-of select="description"/>&#160;</td>
          </xsl:when>
          <xsl:when test="operationid = '1'">
           <td class="cell_endOk"><xsl:value-of select="description"/>&#160;</td>
          </xsl:when>
          <xsl:otherwise>
           <td class="cell_end"><xsl:value-of select="description"/>&#160;</td>
          </xsl:otherwise>
         </xsl:choose>
        </xsl:otherwise>
       </xsl:choose>

     </tr>
     <!-- line when monitoring stopped -->
     <xsl:choose>
      <xsl:when test="operationid = '2'">
        <!-- <tr><td colspan="7"><hr/></td></tr> -->
        <xsl:copy-of select="$var_header" />
      </xsl:when>
     </xsl:choose>

   </xsl:for-each>

   <!--<xsl:copy-of select="$var_header" />-->
 </table>
</body>
</html>

</xsl:template>
</xsl:stylesheet>
