]> SALOME platform Git repositories - tools/sat.git/commitdiff
Salome HOME
Rename table to board for jobs publishing
authorSerge Rehbinder <serge.rehbinder@cea.fr>
Tue, 28 Jun 2016 12:22:31 +0000 (14:22 +0200)
committerSerge Rehbinder <serge.rehbinder@cea.fr>
Tue, 28 Jun 2016 12:22:31 +0000 (14:22 +0200)
commands/jobs.py
src/internal_config/distrib.pyconf
src/xsl/jobs_board_report.xsl [new file with mode: 0644]
src/xsl/jobs_global_report.xsl
src/xsl/jobs_table_report.xsl [deleted file]

index edbdffc265a83e10abafc8867f81714b9ab32834..0433d7edbc3a308bec77877ff7625e21b2dd770a 100644 (file)
@@ -24,7 +24,7 @@ import paramiko
 import src
 
 STYLESHEET_GLOBAL = "jobs_global_report.xsl"
-STYLESHEET_TABLE = "jobs_table_report.xsl"
+STYLESHEET_BOARD = "jobs_board_report.xsl"
 
 parser = src.options.Options()
 
@@ -226,7 +226,7 @@ class Machine(object):
 class Job(object):
     '''Class to manage one job
     '''
-    def __init__(self, name, machine, application, table
+    def __init__(self, name, machine, application, board
                  commands, timeout, config, logger, job_file, after=None):
 
         self.name = name
@@ -234,7 +234,7 @@ class Job(object):
         self.after = after
         self.timeout = timeout
         self.application = application
-        self.table = table
+        self.board = board
         self.config = config
         self.logger = logger
         # The list of log files to download from the remote machine 
@@ -624,14 +624,14 @@ class Jobs(object):
         application = None
         if 'application' in job_def:
             application = job_def.application
-        table = None
-        if 'table' in job_def:
-            table = job_def.table
+        board = None
+        if 'board' in job_def:
+            board = job_def.board
             
         return Job(name,
                    machine,
                    application,
-                   table,
+                   board,
                    cmmnds,
                    timeout,
                    self.runner.cfg,
@@ -840,7 +840,7 @@ class Jobs(object):
             if job.after is None:
                 continue
             father_job = self.find_job_that_has_name(job.after)
-            if father_job.has_failed():
+            if father_job is not None and father_job.has_failed():
                 job.cancel()
     
     def find_job_that_has_name(self, name):
@@ -854,8 +854,7 @@ class Jobs(object):
             if jb.name == name:
                 return jb
         # the following is executed only if the job was not found
-        msg = _('The job "%s" seems to be nonexistent') % name
-        raise src.SatException(msg)
+        return None
     
     def str_of_length(self, text, length):
         '''Takes a string text of any length and returns 
@@ -949,7 +948,13 @@ class Jobs(object):
                         new_job_start = True
                         break
                     else:
-                        jb_before = self.find_job_that_has_name(jb.after) 
+                        jb_before = self.find_job_that_has_name(jb.after)
+                        if jb_before is None:
+                            jb.cancel()
+                            msg = _("This job was not launched because its father is not in the jobs list.")
+                            jb.out = msg
+                            jb.err = msg
+                            break
                         if jb_before.has_finished():
                             jb.run()
                             l_jobs_not_started.remove(jb)
@@ -1005,9 +1010,9 @@ class Gui(object):
         xml_global_path = os.path.join(self.xml_dir_path, "global_report.xml")
         self.xml_global_file = src.xmlManager.XmlLogFile(xml_global_path,
                                                          "JobsReport")
-        # The xml files that corresponds to the tables.
-        # {name_table : xml_object}}
-        self.d_xml_table_files = {}
+        # The xml files that corresponds to the boards.
+        # {name_board : xml_object}}
+        self.d_xml_board_files = {}
         # Create the lines and columns
         self.initialize_arrays(l_jobs, l_jobs_not_today)
         # Write the xml file
@@ -1019,27 +1024,27 @@ class Gui(object):
         :param l_jobs List: the list of jobs that run today
         :param l_jobs_not_today List: the list of jobs that do not run today
         '''
-        # Get the tables to fill and put it in a dictionary
-        # {table_name : xml instance corresponding to the table}
+        # Get the boards to fill and put it in a dictionary
+        # {board_name : xml instance corresponding to the board}
         for job in l_jobs + l_jobs_not_today:
-            table = job.table
-            if (table is not None and 
-                    table not in self.d_xml_table_files.keys()):
-                xml_table_path = os.path.join(self.xml_dir_path, table + ".xml")
-                self.d_xml_table_files[table] =  src.xmlManager.XmlLogFile(
-                                                            xml_table_path,
+            board = job.board
+            if (board is not None and 
+                    board not in self.d_xml_board_files.keys()):
+                xml_board_path = os.path.join(self.xml_dir_path, board + ".xml")
+                self.d_xml_board_files[board] =  src.xmlManager.XmlLogFile(
+                                                            xml_board_path,
                                                             "JobsReport")
-                self.d_xml_table_files[table].add_simple_node("distributions")
-                self.d_xml_table_files[table].add_simple_node("applications")
-                self.d_xml_table_files[table].add_simple_node("table", text=table)
+                self.d_xml_board_files[board].add_simple_node("distributions")
+                self.d_xml_board_files[board].add_simple_node("applications")
+                self.d_xml_board_files[board].add_simple_node("board", text=board)
         
         # Loop over all jobs in order to get the lines and columns for each 
         # xml file
         d_dist = {}
         d_application = {}
-        for table in self.d_xml_table_files:
-            d_dist[table] = []
-            d_application[table] = []
+        for board in self.d_xml_board_files:
+            d_dist[board] = []
+            d_application[board] = []
             
         l_hosts_ports = []
             
@@ -1051,24 +1056,24 @@ class Gui(object):
             distrib = job.machine.distribution
             application = job.application
             
-            table_job = job.table
-            if table is None:
+            board_job = job.board
+            if board is None:
                 continue
-            for table in self.d_xml_table_files:
-                if table_job == table:
-                    if distrib is not None and distrib not in d_dist[table]:
-                        d_dist[table].append(distrib)
+            for board in self.d_xml_board_files:
+                if board_job == board:
+                    if distrib is not None and distrib not in d_dist[board]:
+                        d_dist[board].append(distrib)
                         src.xmlManager.add_simple_node(
-                            self.d_xml_table_files[table].xmlroot.find('distributions'),
+                            self.d_xml_board_files[board].xmlroot.find('distributions'),
                                                    "dist",
                                                    attrib={"name" : distrib})
                     
-                if table_job == table:
+                if board_job == board:
                     if (application is not None and 
-                                    application not in d_application[table]):
-                        d_application[table].append(application)
+                                    application not in d_application[board]):
+                        d_application[board].append(application)
                         src.xmlManager.add_simple_node(
-                            self.d_xml_table_files[table].xmlroot.find('applications'),
+                            self.d_xml_board_files[board].xmlroot.find('applications'),
                                                    "application",
                                                    attrib={"name" : application})
 
@@ -1081,7 +1086,7 @@ class Gui(object):
                                            attrib={"name" : host_port})
         
         # Initialize the jobs node in all files
-        for xml_file in [self.xml_global_file] + list(self.d_xml_table_files.values()):
+        for xml_file in [self.xml_global_file] + list(self.d_xml_board_files.values()):
             xml_jobs = xml_file.add_simple_node("jobs")      
             # Get the jobs present in the config file but 
             # that will not be launched today
@@ -1107,7 +1112,7 @@ class Gui(object):
             src.xmlManager.add_simple_node(xmlj,
                                            "distribution",
                                            job.machine.distribution)
-            src.xmlManager.add_simple_node(xmlj, "table", job.table)
+            src.xmlManager.add_simple_node(xmlj, "board", job.board)
             src.xmlManager.add_simple_node(xmlj,
                                        "commands", " ; ".join(job.commands))
             src.xmlManager.add_simple_node(xmlj, "state", "Not today")
@@ -1123,7 +1128,7 @@ class Gui(object):
 
         :param l_jobs List: the list of jobs that run today
         '''
-        for xml_file in [self.xml_global_file] + list(self.d_xml_table_files.values()):
+        for xml_file in [self.xml_global_file] + list(self.d_xml_board_files.values()):
             self.update_xml_file(l_jobs, xml_file)
             
         # Write the file
@@ -1167,7 +1172,7 @@ class Gui(object):
             src.xmlManager.add_simple_node(xmlj, "application", job.application)
             src.xmlManager.add_simple_node(xmlj, "distribution",
                                            job.machine.distribution)
-            src.xmlManager.add_simple_node(xmlj, "table", job.table)
+            src.xmlManager.add_simple_node(xmlj, "board", job.board)
             src.xmlManager.add_simple_node(xmlj, "timeout", str(job.timeout))
             src.xmlManager.add_simple_node(xmlj, "commands",
                                            " ; ".join(job.commands))
@@ -1195,13 +1200,9 @@ class Gui(object):
                 for jb in l_jobs:
                     if jb.name == job.after:
                         job_father = jb
-                if job_father is None:
-                    msg = _("The job %(father_name)s that is parent of "
-                            "%(son_name)s is not in the job list." %
-                            {"father_name" : job.after , "son_name" : job.name})
-                    raise src.SatException(msg)
                 
-                if len(job_father.remote_log_files) > 0:
+                if (job_father is not None and 
+                        len(job_father.remote_log_files) > 0):
                     link = job_father.remote_log_files[0]
                 else:
                     link = "nothing"
@@ -1222,7 +1223,7 @@ class Gui(object):
         :param l_jobs List: the list of jobs that run today
         :param xml_file xmlManager.XmlLogFile: the xml instance to update
         '''
-        for xml_file in [self.xml_global_file] + list(self.d_xml_table_files.values()):
+        for xml_file in [self.xml_global_file] + list(self.d_xml_board_files.values()):
             xml_node_infos = xml_file.xmlroot.find('infos')
             src.xmlManager.append_node_attrib(xml_node_infos,
                         attrib={"JobsCommandStatus" : finish_status})
@@ -1233,8 +1234,8 @@ class Gui(object):
         ''' Write the xml files   
         '''
         self.xml_global_file.write_tree(STYLESHEET_GLOBAL)
-        for xml_file in self.d_xml_table_files.values():
-            xml_file.write_tree(STYLESHEET_TABLE)
+        for xml_file in self.d_xml_board_files.values():
+            xml_file.write_tree(STYLESHEET_BOARD)
         
 ##
 # Describes the command
@@ -1247,11 +1248,11 @@ def description():
 def run(args, runner, logger):
        
     (options, args) = parser.parse_args(args)
-       
+    
     jobs_cfg_files_dir = runner.cfg.SITE.jobs.config_path
     
-    l_cfg_dir = [jobs_cfg_files_dir,
-                 os.path.join(runner.cfg.VARS.datadir, "jobs")]
+    l_cfg_dir = [os.path.join(runner.cfg.VARS.datadir, "jobs"),
+                 jobs_cfg_files_dir]
     
     # Make sure the path to the jobs config files directory exists 
     src.ensure_path_exists(jobs_cfg_files_dir)   
@@ -1310,7 +1311,7 @@ def run(args, runner, logger):
                 l_jb.append(jb,
                 "Adding a job that was given in only_jobs option parameters")
         config_jobs.jobs = l_jb
-              
+     
     # Initialization
     today_jobs = Jobs(runner,
                       logger,
@@ -1338,8 +1339,12 @@ def run(args, runner, logger):
         interruped = True
         logger.write("\n\n%s\n\n" % 
                 (src.printcolors.printcWarning(_("Forced interruption"))), 1)
-        
     finally:
+        if interruped:
+            msg = _("Killing the running jobs and trying"
+                    " to get the corresponding logs\n")
+            logger.write(src.printcolors.printcWarning(msg))
+            
         # find the potential not finished jobs and kill them
         for jb in today_jobs.ljobs:
             if not jb.has_finished():
index b1cdae358528f9aec56640b1fd746b0b60a5d14d..12d5067bc4ada738a0e495d18a4d0476017f151d 100644 (file)
@@ -54,6 +54,6 @@ VERSIONS :
     "CO":
     {
         "7.1.1503": "7.1"
-        "CO7.2.1511": "7.2"
+        "7.2.1511": "7.2"
     }
 }
diff --git a/src/xsl/jobs_board_report.xsl b/src/xsl/jobs_board_report.xsl
new file mode 100644 (file)
index 0000000..aaaf688
--- /dev/null
@@ -0,0 +1,295 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+<xsl:template match="/">
+<html>
+<head>
+<title>Jobs <xsl:value-of select="//JobsReport/board/."/> report</title>
+<style type="text/css">
+    <!-- styles for commands results -->
+    .OKday        { background-color:#20FF20; }
+    .OKweek       { background-color:#90EE90; font-size: 11px; }
+    .OKmonth      { background-color:#90EE90; font-size: 10px; }
+    .OKold        { background-color:#90EE90; font-size: 9px; }
+
+    .KOday        { background-color:#F20000; }
+    .KOweek       { background-color:#FFC0CB; font-size: 11px; }
+    .KOmonth      { background-color:#FFC0CB; font-size: 10px; }
+    .KOold        { background-color:#FFC0CB; font-size: 9px; }
+
+    .KFday        { background-color:#FFA500; }
+    .KFweek       { background-color:#FAC86D; font-size: 11px; }
+    .KFmonth      { background-color:#FAC86D; font-size: 10px; }
+    .KFold        { background-color:#FAC86D; font-size: 9px; }
+
+    .NAday        { background-color:#BBBBBB; }
+    .NAweek       { background-color:#BFBFBF; font-size: 11px; }
+    .NAmonth      { background-color:#CACACA; font-size: 10px; }
+    .NAold        { background-color:#CFCFCF; font-size: 9px; }
+
+    .label        { font-weight: bold; }
+
+    <!-- styles for links in matrix -->
+    .OK2          { color:#00AA00; }
+    .KO2          { color:#FF0000; }
+    .KF2          { color:#FF8000; }
+    .NA2          { color:#BBBBBB; }
+    .TO2          { color:GoldenRod; }
+    .RUNNING2     { color:LightSeaGreen; font-weight: bold; }
+    .OK2day       { color:#00AA00; font-weight: bold; }
+    .KO2day       { color:#FF0000; font-weight: bold; }
+    .KF2day       { color:#FF8000; font-weight: bold; }
+    .NA2day       { color:#BBBBBB; font-weight: bold; }
+    .TO2day       { color:GoldenRod; font-weight: bold; }
+
+    .new          { background-color:#FF5500; }
+    .day          { background-color:#F0E25A; font-size: small; }
+    .week         { background-color:#E0E0E0; font-size: small; }
+    .month        { background-color:#C0C0C0; font-size: small; }
+    .old          { background-color:#A0A0A0; font-size: small; }
+    .lnk          { font-size: 12px; }
+    .lnk a        { text-decoration: none; }
+    .note         { text-align : right; font-style: italic; font-size: small; }
+    table.legend  { margin:0px;
+                    padding:5px;
+                    border-collapse:collapse;
+                    empty-cells : show;
+                    border : solid 1px;
+                    font-size: xx-small;
+                  }
+    table.summary { width : 100%;
+                    margin:0px;
+                    padding:0px;
+                    border-collapse:collapse;
+                    empty-cells : show;
+                    border : solid 1px;
+                  }
+    td.summary    { border : solid 0px; font-size: medium; }
+    td            { border : solid 1px; }
+    td.small      { border : solid 1px; font-size: small; }
+    th            { font-size: small; border: solid 1px;  }
+    h2            { text-align : center; }
+    h3            { text-align : left; font-size: small; font-weight: normal; }
+    h4            { text-align : left; font-size: small; font-weight: bold; display: inline; }
+    h_err         { text-align : left; font-size: small; font-weight: normal; display: inline;         color: red; }
+    .legend       { text-align : center; } 
+    .def        { font-family: Arial, Verdana, "Times New Roman", Times, serif;}
+   
+</style>
+
+<xsl:if test="//JobsReport/infos/@JobsCommandStatus='running'">
+  <meta http-equiv="refresh" content="1"></meta>
+</xsl:if>
+
+<script language="JavaScript"><![CDATA[
+      function Toggle(id) {
+        collapseall();
+        var element = document.getElementById(id);
+
+         if ( element.style.display == "none" )
+            element.style.display = "block";
+         else 
+            element.style.display = "none";
+      }
+
+      function collapseall() {
+        var x=document.getElementsByTagName("div");
+        for (i=0;i<x.length;i++)
+        {
+            if ( x[i].id != "matrix" )
+                x[i].style.display = "none";
+        }
+      }
+    ]]>
+</script>
+
+</head>
+
+<body class="def">
+    <table width="100%">
+       <tr>
+           <td class="summary">
+               <h2>Compilation report <xsl:value-of select="//JobsReport/board/."/></h2>
+           </td>
+           <td class="summary" align="right" valign="bottom" width="300">
+               <span class="note"><xsl:value-of select="//JobsReport/infos/@name" />: <xsl:value-of select="//JobsReport/infos/@value" /></span>
+           </td>
+       </tr>
+    </table>
+
+    Legend :
+    <table class="legend">
+       <tr><td>job</td><td>result</td></tr>
+       <tr><td> <xsl:attribute name="class">OK2day</xsl:attribute>success today</td><td> <xsl:attribute name="class">OK2day</xsl:attribute>success today</td></tr>
+       <tr><td> <xsl:attribute name="class">OK2</xsl:attribute>success not today</td><td> <xsl:attribute name="class">OK2</xsl:attribute>success not today</td></tr>
+       <tr><td> <xsl:attribute name="class">KO2day</xsl:attribute>fail today</td><td> <xsl:attribute name="class">KO2day</xsl:attribute>fail today</td></tr>
+       <tr><td> <xsl:attribute name="class">KO2</xsl:attribute>fail not today</td><td> <xsl:attribute name="class">KO2</xsl:attribute>fail not today</td></tr>
+       <tr><td> <xsl:attribute name="class">TO2day</xsl:attribute>timeout today</td><td> <xsl:attribute name="class">KF2day</xsl:attribute>known failure today</td></tr>
+       <tr><td> <xsl:attribute name="class">RUNNING2</xsl:attribute>running</td><td> <xsl:attribute name="class">KF2</xsl:attribute>known failure not today</td></tr>
+       <tr><td> <xsl:attribute name="class">NA2day</xsl:attribute>To be launched</td></tr>
+       <tr><td> <xsl:attribute name="class">NA2</xsl:attribute>Not today</td></tr>
+    </table>
+    
+    <br/>
+
+    <div id="matrix">
+    <table class="summary">
+      <!-- header -->
+      <tr bgcolor="#9acd32">
+      <th></th>
+      <xsl:for-each select="//JobsReport/applications/application">
+        <xsl:sort select="@name" />
+       <th><xsl:value-of select="@name" /></th>
+      </xsl:for-each>
+      </tr>
+      
+      <!-- for all hosts -->
+      <xsl:for-each select="//JobsReport/distributions/dist">
+        <xsl:sort select="@name" />
+       <xsl:variable name="curr_distname" select="@name" />
+       <tr>
+       <td align="center"><xsl:value-of select="$curr_distname" /></td>
+       <!-- for all jobs -->
+       <xsl:for-each select="//JobsReport/applications/application">
+         <xsl:sort select="@name" />
+         <xsl:variable name="curr_appli" select="@name" />
+         <td align="center" class="small">
+             <!-- get the job for current host and current appli -->
+             <xsl:for-each select="//JobsReport/jobs/job">
+                 <xsl:sort select="@name" />
+                 <xsl:if test="application/.=$curr_appli and distribution/.=$curr_distname and board/.=//JobsReport/board/.">
+                     <xsl:choose>
+                           <xsl:when test="state/.='SSH connection KO' or state/.='Cancelled'">
+                             <a href="#">
+                                   <xsl:attribute name="onclick">javascript:Toggle('<xsl:value-of select="@name"/>')</xsl:attribute>
+                                   <xsl:attribute name="title"><xsl:value-of select="state/."/></xsl:attribute>
+                                   <xsl:attribute name="class">KO2day</xsl:attribute>
+                                   <xsl:value-of select="@name"/>
+                             </a>
+                           </xsl:when>
+                           <xsl:when test="contains(state/., 'Not launched')">
+                             <a href="#">
+                                   <xsl:attribute name="onclick">javascript:Toggle('<xsl:value-of select="@name"/>')</xsl:attribute>
+                                   <xsl:attribute name="title"><xsl:value-of select="state/."/></xsl:attribute>
+                                   <xsl:attribute name="class">NA2day</xsl:attribute>
+                                   <xsl:value-of select="@name"/>
+                             </a>
+                           </xsl:when>
+                           <xsl:when test="contains(state/., 'running')">
+                             <a href="#">
+                                   <xsl:attribute name="onclick">javascript:Toggle('<xsl:value-of select="@name"/>')</xsl:attribute>
+                                   <xsl:attribute name="title"><xsl:value-of select="state/."/></xsl:attribute>
+                                   <xsl:attribute name="class">RUNNING2</xsl:attribute>
+                                   <xsl:value-of select="@name"/>
+                             </a>
+                           </xsl:when>
+                           <xsl:when test="contains(state/., 'Finished')">
+                             <a href="#">
+                                   <xsl:attribute name="onclick">javascript:Toggle('<xsl:value-of select="@name"/>')</xsl:attribute>
+                                   <xsl:attribute name="title"><xsl:value-of select="state/."/></xsl:attribute>
+                                   <xsl:attribute name="class">OK2day</xsl:attribute>
+                                   <xsl:value-of select="@name"/>
+                             </a>
+                           </xsl:when>
+                           <xsl:when test="contains(state/., 'Timeout')">
+                             <a href="#">
+                                   <xsl:attribute name="onclick">javascript:Toggle('<xsl:value-of select="@name"/>')</xsl:attribute>
+                                   <xsl:attribute name="title"><xsl:value-of select="state/."/></xsl:attribute>
+                                   <xsl:attribute name="class">TO2day</xsl:attribute>
+                                   <xsl:value-of select="@name"/>
+                             </a>
+                           </xsl:when>
+                           <xsl:when test="state/.='Not today'">
+                             <a href="#">
+                                   <xsl:attribute name="onclick">javascript:Toggle('<xsl:value-of select="@name"/>')</xsl:attribute>
+                                   <xsl:attribute name="title"><xsl:value-of select="state/."/></xsl:attribute>
+                                   <xsl:attribute name="class">NA2</xsl:attribute>
+                                   <xsl:value-of select="@name"/>
+                             </a>
+                           </xsl:when>
+                     </xsl:choose>
+                     <!--<xsl:value-of select="state/." />-->
+                     <xsl:if test="not(remote_log_file_path/.='nothing') and state/.!='Not today'">
+                            : 
+                           <a>
+                               <xsl:attribute name="title">remote log</xsl:attribute>
+                               <xsl:attribute name="href"><xsl:value-of select="remote_log_file_path/."/></xsl:attribute>
+                               <xsl:if test="res/.='0'">
+                                  <xsl:attribute name="class">OK2day</xsl:attribute>
+                               </xsl:if>
+                               <xsl:if test="res/.='1'">
+                                  <xsl:attribute name="class">KO2day</xsl:attribute>
+                               </xsl:if>
+                               <xsl:value-of select="host/."/>/<xsl:value-of select="port/."/>
+                           </a>
+                     </xsl:if> 
+                     <br/>
+                 </xsl:if> 
+                 
+             </xsl:for-each>
+         </td>
+       </xsl:for-each>
+       </tr>
+      </xsl:for-each>
+    </table>
+    
+    <h3>
+    <xsl:choose>
+       <xsl:when test="//JobsReport/infos/@JobsCommandStatus='running'">
+           Command status : running <img src="running.gif"></img>
+       </xsl:when>
+       
+       <xsl:otherwise>
+           Command status : <xsl:value-of select="//JobsReport/infos/@JobsCommandStatus/."/>
+       </xsl:otherwise>
+    </xsl:choose>
+    </h3>
+    </div>
+
+    
+    <!-- Loop over the jobs in order to find what job was called in the link "onclick". Display information about that job -->
+    <xsl:for-each select="//JobsReport/jobs/job">
+      <xsl:variable name="curr_job_name" select="@name" />
+      <div style="display:none"><xsl:attribute name="id"><xsl:value-of select="@name"/></xsl:attribute>
+         <!-- Display job name -->
+         <h4>Name : </h4><xsl:value-of select="//JobsReport/jobs/job[@name=$curr_job_name]/@name"/>
+         <br/>
+         <xsl:if test="//JobsReport/jobs/job[@name=$curr_job_name]/state!='Not today'">
+                 <!-- Display the job attributes -->
+                 <h4>Hostname/port : </h4><xsl:value-of select="//JobsReport/jobs/job[@name=$curr_job_name]/host"/>/<xsl:value-of select="//JobsReport/jobs/job[@name=$curr_job_name]/port"/>
+                 <br/>
+                 <h4>User : </h4><xsl:value-of select="//JobsReport/jobs/job[@name=$curr_job_name]/user"/>
+                 <br/>
+                 <h4>salomeTools path : </h4><xsl:value-of select="//JobsReport/jobs/job[@name=$curr_job_name]/sat_path"/>
+                 <br/>
+                 <h4>After : </h4>
+                 <a href="#">
+                       <xsl:attribute name="onclick">javascript:Toggle('<xsl:value-of select="//JobsReport/jobs/job[@name=$curr_job_name]/after"/>')</xsl:attribute>
+                       <xsl:attribute name="title">Click to get job information</xsl:attribute>
+                       <xsl:attribute name="class">OK2</xsl:attribute>
+                       <xsl:value-of select="//JobsReport/jobs/job[@name=$curr_job_name]/after"/>
+                 </a>
+                 <br/>
+                 <h4>Timeout : </h4><xsl:value-of select="//JobsReport/jobs/job[@name=$curr_job_name]/timeout"/>
+                 <br/>
+                 <h4>Begin : </h4><xsl:value-of select="//JobsReport/jobs/job[@name=$curr_job_name]/begin"/>
+                 <br/>
+                 <h4>End : </h4><xsl:value-of select="//JobsReport/jobs/job[@name=$curr_job_name]/end"/>
+                 <br/>
+                 <h4>Out : </h4><PRE><xsl:value-of select="//JobsReport/jobs/job[@name=$curr_job_name]/out"/></PRE>
+                 <br/>
+                 <h4>Err : </h4><h_err><PRE><xsl:value-of select="//JobsReport/jobs/job[@name=$curr_job_name]/err"/></PRE></h_err>
+          </xsl:if>
+         <h4>Status : </h4><xsl:value-of select="//JobsReport/jobs/job[@name=$curr_job_name]/state"/>
+         <br/>
+         <h4>Commands : </h4><xsl:value-of select="//JobsReport/jobs/job[@name=$curr_job_name]/commands"/>
+         <br/>
+      </div>
+    </xsl:for-each>
+
+</body>
+
+</html>
+</xsl:template>
+</xsl:stylesheet>
index 14364f0924847b7961129b04605656af046f9531..8be24dad5f7fd101ec6c70c1577cbd9e8b7555f9 100644 (file)
@@ -33,7 +33,7 @@
     <!-- styles for links in matrix -->
     .OK2          { color:#00AA00; }
     .KO2          { color:#FF0000; }
-    .KF2          { color:#509050; }
+    .KF2          { color:#FF8000; }
     .NA2          { color:#BBBBBB; }
     .TO2          { color:GoldenRod; }
     .RUNNING2     { color:LightSeaGreen; font-weight: bold; }
@@ -56,6 +56,7 @@
                     border-collapse:collapse;
                     empty-cells : show;
                     border : solid 1px;
+                    font-size: xx-small;
                   }
     table.summary { width : 100%;
                     margin:0px;
                <h2>Jobs global report</h2>
            </td>
            <td class="summary" align="right" valign="bottom" width="300">
-               <xsl:for-each select="//JobsReport/infos">
-                 <span class="note"><xsl:value-of select="@name" />: <xsl:value-of select="@value" /></span>
-               </xsl:for-each>
+               <span class="note"><xsl:value-of select="//JobsReport/infos/@name" />: <xsl:value-of select="//JobsReport/infos/@value" /></span>
            </td>
        </tr>
     </table>
-       
+    Legend :
+    <table class="legend">
+       <tr><td>job</td><td>result</td></tr>
+       <tr><td> <xsl:attribute name="class">OK2day</xsl:attribute>success today</td><td> <xsl:attribute name="class">OK2day</xsl:attribute>success today</td></tr>
+       <tr><td> <xsl:attribute name="class">OK2</xsl:attribute>success not today</td><td> <xsl:attribute name="class">OK2</xsl:attribute>success not today</td></tr>
+       <tr><td> <xsl:attribute name="class">KO2day</xsl:attribute>fail today</td><td> <xsl:attribute name="class">KO2day</xsl:attribute>fail today</td></tr>
+       <tr><td> <xsl:attribute name="class">KO2</xsl:attribute>fail not today</td><td> <xsl:attribute name="class">KO2</xsl:attribute>fail not today</td></tr>
+       <tr><td> <xsl:attribute name="class">TO2day</xsl:attribute>timeout today</td><td> <xsl:attribute name="class">KF2day</xsl:attribute>known failure today</td></tr>
+       <tr><td> <xsl:attribute name="class">RUNNING2</xsl:attribute>running</td><td> <xsl:attribute name="class">KF2</xsl:attribute>known failure not today</td></tr>
+       <tr><td> <xsl:attribute name="class">NA2day</xsl:attribute>To be launched</td></tr>
+       <tr><td> <xsl:attribute name="class">NA2</xsl:attribute>Not today</td></tr>
+    </table>
+    
+    <br/>
+    
     <div id="matrix">
     <table class="summary">
      
diff --git a/src/xsl/jobs_table_report.xsl b/src/xsl/jobs_table_report.xsl
deleted file mode 100644 (file)
index 7a0a58b..0000000
+++ /dev/null
@@ -1,281 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
-
-<xsl:template match="/">
-<html>
-<head>
-<title>Jobs <xsl:value-of select="//JobsReport/table/."/> report</title>
-<style type="text/css">
-    <!-- styles for commands results -->
-    .OKday        { background-color:#20FF20; }
-    .OKweek       { background-color:#90EE90; font-size: 11px; }
-    .OKmonth      { background-color:#90EE90; font-size: 10px; }
-    .OKold        { background-color:#90EE90; font-size: 9px; }
-
-    .KOday        { background-color:#F20000; }
-    .KOweek       { background-color:#FFC0CB; font-size: 11px; }
-    .KOmonth      { background-color:#FFC0CB; font-size: 10px; }
-    .KOold        { background-color:#FFC0CB; font-size: 9px; }
-
-    .KFday        { background-color:#FFA500; }
-    .KFweek       { background-color:#FAC86D; font-size: 11px; }
-    .KFmonth      { background-color:#FAC86D; font-size: 10px; }
-    .KFold        { background-color:#FAC86D; font-size: 9px; }
-
-    .NAday        { background-color:#BBBBBB; }
-    .NAweek       { background-color:#BFBFBF; font-size: 11px; }
-    .NAmonth      { background-color:#CACACA; font-size: 10px; }
-    .NAold        { background-color:#CFCFCF; font-size: 9px; }
-
-    .label        { font-weight: bold; }
-
-    <!-- styles for links in matrix -->
-    .OK2          { color:#00AA00; }
-    .KO2          { color:#FF0000; }
-    .KF2          { color:#509050; }
-    .NA2          { color:#BBBBBB; }
-    .TO2          { color:GoldenRod; }
-    .RUNNING2     { color:LightSeaGreen; font-weight: bold; }
-    .OK2day       { color:#00AA00; font-weight: bold; }
-    .KO2day       { color:#FF0000; font-weight: bold; }
-    .KF2day       { color:#FF8000; font-weight: bold; }
-    .NA2day       { color:#BBBBBB; font-weight: bold; }
-    .TO2day       { color:GoldenRod; font-weight: bold; }
-
-    .new          { background-color:#FF5500; }
-    .day          { background-color:#F0E25A; font-size: small; }
-    .week         { background-color:#E0E0E0; font-size: small; }
-    .month        { background-color:#C0C0C0; font-size: small; }
-    .old          { background-color:#A0A0A0; font-size: small; }
-    .lnk          { font-size: 12px; }
-    .lnk a        { text-decoration: none; }
-    .note         { text-align : right; font-style: italic; font-size: small; }
-    table.legend  { margin:0px;
-                    padding:5px;
-                    border-collapse:collapse;
-                    empty-cells : show;
-                    border : solid 1px;
-                  }
-    table.summary { width : 100%;
-                    margin:0px;
-                    padding:0px;
-                    border-collapse:collapse;
-                    empty-cells : show;
-                    border : solid 1px;
-                  }
-    td.summary    { border : solid 0px; font-size: medium; }
-    td            { border : solid 1px; }
-    td.small      { border : solid 1px; font-size: small; }
-    th            { font-size: small; border: solid 1px;  }
-    h2            { text-align : center; }
-    h3            { text-align : left; font-size: small; font-weight: normal; }
-    h4            { text-align : left; font-size: small; font-weight: bold; display: inline; }
-    h_err         { text-align : left; font-size: small; font-weight: normal; display: inline;         color: red; }
-    .legend       { text-align : center; } 
-    .def        { font-family: Arial, Verdana, "Times New Roman", Times, serif;}
-   
-</style>
-
-<xsl:if test="//JobsReport/infos/@JobsCommandStatus='running'">
-  <meta http-equiv="refresh" content="1"></meta>
-</xsl:if>
-
-<script language="JavaScript"><![CDATA[
-      function Toggle(id) {
-        collapseall();
-        var element = document.getElementById(id);
-
-         if ( element.style.display == "none" )
-            element.style.display = "block";
-         else 
-            element.style.display = "none";
-      }
-
-      function collapseall() {
-        var x=document.getElementsByTagName("div");
-        for (i=0;i<x.length;i++)
-        {
-            if ( x[i].id != "matrix" )
-                x[i].style.display = "none";
-        }
-      }
-    ]]>
-</script>
-
-</head>
-
-<body class="def">
-    <table width="100%">
-       <tr>
-           <td class="summary">
-               <h2>Compilation report <xsl:value-of select="//JobsReport/table/."/></h2>
-           </td>
-           <td class="summary" align="right" valign="bottom" width="300">
-               <xsl:for-each select="//JobsReport/infos">
-                 <span class="note"><xsl:value-of select="@name" />: <xsl:value-of select="@value" /></span>
-               </xsl:for-each>
-           </td>
-       </tr>
-    </table>
-       
-    <div id="matrix">
-    <table class="summary">
-      <!-- header -->
-      <tr bgcolor="#9acd32">
-      <th></th>
-      <xsl:for-each select="//JobsReport/applications/application">
-        <xsl:sort select="@name" />
-       <th><xsl:value-of select="@name" /></th>
-      </xsl:for-each>
-      </tr>
-      
-      <!-- for all hosts -->
-      <xsl:for-each select="//JobsReport/distributions/dist">
-        <xsl:sort select="@name" />
-       <xsl:variable name="curr_distname" select="@name" />
-       <tr>
-       <td align="center"><xsl:value-of select="$curr_distname" /></td>
-       <!-- for all jobs -->
-       <xsl:for-each select="//JobsReport/applications/application">
-         <xsl:sort select="@name" />
-         <xsl:variable name="curr_appli" select="@name" />
-         <td align="center" class="small">
-             <!-- get the job for current host and current appli -->
-             <xsl:for-each select="//JobsReport/jobs/job">
-                 <xsl:sort select="@name" />
-                 <xsl:if test="application/.=$curr_appli and distribution/.=$curr_distname and table/.=//JobsReport/table/.">
-                     <xsl:choose>
-                           <xsl:when test="state/.='SSH connection KO' or state/.='Cancelled'">
-                             <a href="#">
-                                   <xsl:attribute name="onclick">javascript:Toggle('<xsl:value-of select="@name"/>')</xsl:attribute>
-                                   <xsl:attribute name="title"><xsl:value-of select="state/."/></xsl:attribute>
-                                   <xsl:attribute name="class">KO2day</xsl:attribute>
-                                   <xsl:value-of select="@name"/>
-                             </a>
-                           </xsl:when>
-                           <xsl:when test="contains(state/., 'Not launched')">
-                             <a href="#">
-                                   <xsl:attribute name="onclick">javascript:Toggle('<xsl:value-of select="@name"/>')</xsl:attribute>
-                                   <xsl:attribute name="title"><xsl:value-of select="state/."/></xsl:attribute>
-                                   <xsl:attribute name="class">NA2day</xsl:attribute>
-                                   <xsl:value-of select="@name"/>
-                             </a>
-                           </xsl:when>
-                           <xsl:when test="contains(state/., 'running')">
-                             <a href="#">
-                                   <xsl:attribute name="onclick">javascript:Toggle('<xsl:value-of select="@name"/>')</xsl:attribute>
-                                   <xsl:attribute name="title"><xsl:value-of select="state/."/></xsl:attribute>
-                                   <xsl:attribute name="class">RUNNING2</xsl:attribute>
-                                   <xsl:value-of select="@name"/>
-                             </a>
-                           </xsl:when>
-                           <xsl:when test="contains(state/., 'Finished')">
-                             <a href="#">
-                                   <xsl:attribute name="onclick">javascript:Toggle('<xsl:value-of select="@name"/>')</xsl:attribute>
-                                   <xsl:attribute name="title"><xsl:value-of select="state/."/></xsl:attribute>
-                                   <xsl:attribute name="class">OK2day</xsl:attribute>
-                                   <xsl:value-of select="@name"/>
-                             </a>
-                           </xsl:when>
-                           <xsl:when test="contains(state/., 'Timeout')">
-                             <a href="#">
-                                   <xsl:attribute name="onclick">javascript:Toggle('<xsl:value-of select="@name"/>')</xsl:attribute>
-                                   <xsl:attribute name="title"><xsl:value-of select="state/."/></xsl:attribute>
-                                   <xsl:attribute name="class">TO2day</xsl:attribute>
-                                   <xsl:value-of select="@name"/>
-                             </a>
-                           </xsl:when>
-                           <xsl:when test="state/.='Not today'">
-                             <a href="#">
-                                   <xsl:attribute name="onclick">javascript:Toggle('<xsl:value-of select="@name"/>')</xsl:attribute>
-                                   <xsl:attribute name="title"><xsl:value-of select="state/."/></xsl:attribute>
-                                   <xsl:attribute name="class">NA2</xsl:attribute>
-                                   <xsl:value-of select="@name"/>
-                             </a>
-                           </xsl:when>
-                     </xsl:choose>
-                     <!--<xsl:value-of select="state/." />-->
-                     <xsl:if test="not(remote_log_file_path/.='nothing') and state/.!='Not today'">
-                            : 
-                           <a>
-                               <xsl:attribute name="title">remote log</xsl:attribute>
-                               <xsl:attribute name="href"><xsl:value-of select="remote_log_file_path/."/></xsl:attribute>
-                               <xsl:if test="res/.='0'">
-                                  <xsl:attribute name="class">OK2day</xsl:attribute>
-                               </xsl:if>
-                               <xsl:if test="res/.='1'">
-                                  <xsl:attribute name="class">KO2day</xsl:attribute>
-                               </xsl:if>
-                               <xsl:value-of select="host/."/>/<xsl:value-of select="port/."/>
-                           </a>
-                     </xsl:if> 
-                     <br/>
-                 </xsl:if> 
-                 
-             </xsl:for-each>
-         </td>
-       </xsl:for-each>
-       </tr>
-      </xsl:for-each>
-    </table>
-    
-    <h3>
-    <xsl:choose>
-       <xsl:when test="//JobsReport/infos/@JobsCommandStatus='running'">
-           Command status : running <img src="running.gif"></img>
-       </xsl:when>
-       
-       <xsl:otherwise>
-           Command status : <xsl:value-of select="//JobsReport/infos/@JobsCommandStatus/."/>
-       </xsl:otherwise>
-    </xsl:choose>
-    </h3>
-    </div>
-
-    
-    <!-- Loop over the jobs in order to find what job was called in the link "onclick". Display information about that job -->
-    <xsl:for-each select="//JobsReport/jobs/job">
-      <xsl:variable name="curr_job_name" select="@name" />
-      <div style="display:none"><xsl:attribute name="id"><xsl:value-of select="@name"/></xsl:attribute>
-         <!-- Display job name -->
-         <h4>Name : </h4><xsl:value-of select="//JobsReport/jobs/job[@name=$curr_job_name]/@name"/>
-         <br/>
-         <xsl:if test="//JobsReport/jobs/job[@name=$curr_job_name]/state!='Not today'">
-                 <!-- Display the job attributes -->
-                 <h4>Hostname/port : </h4><xsl:value-of select="//JobsReport/jobs/job[@name=$curr_job_name]/host"/>/<xsl:value-of select="//JobsReport/jobs/job[@name=$curr_job_name]/port"/>
-                 <br/>
-                 <h4>User : </h4><xsl:value-of select="//JobsReport/jobs/job[@name=$curr_job_name]/user"/>
-                 <br/>
-                 <h4>salomeTools path : </h4><xsl:value-of select="//JobsReport/jobs/job[@name=$curr_job_name]/sat_path"/>
-                 <br/>
-                 <h4>After : </h4>
-                 <a href="#">
-                       <xsl:attribute name="onclick">javascript:Toggle('<xsl:value-of select="//JobsReport/jobs/job[@name=$curr_job_name]/after"/>')</xsl:attribute>
-                       <xsl:attribute name="title">Click to get job information</xsl:attribute>
-                       <xsl:attribute name="class">OK2</xsl:attribute>
-                       <xsl:value-of select="//JobsReport/jobs/job[@name=$curr_job_name]/after"/>
-                 </a>
-                 <br/>
-                 <h4>Timeout : </h4><xsl:value-of select="//JobsReport/jobs/job[@name=$curr_job_name]/timeout"/>
-                 <br/>
-                 <h4>Begin : </h4><xsl:value-of select="//JobsReport/jobs/job[@name=$curr_job_name]/begin"/>
-                 <br/>
-                 <h4>End : </h4><xsl:value-of select="//JobsReport/jobs/job[@name=$curr_job_name]/end"/>
-                 <br/>
-                 <h4>Out : </h4><PRE><xsl:value-of select="//JobsReport/jobs/job[@name=$curr_job_name]/out"/></PRE>
-                 <br/>
-                 <h4>Err : </h4><h_err><PRE><xsl:value-of select="//JobsReport/jobs/job[@name=$curr_job_name]/err"/></PRE></h_err>
-          </xsl:if>
-         <h4>Status : </h4><xsl:value-of select="//JobsReport/jobs/job[@name=$curr_job_name]/state"/>
-         <br/>
-         <h4>Commands : </h4><xsl:value-of select="//JobsReport/jobs/job[@name=$curr_job_name]/commands"/>
-         <br/>
-      </div>
-    </xsl:for-each>
-
-</body>
-
-</html>
-</xsl:template>
-</xsl:stylesheet>