buildframework/helium/tools/common/templates/log/scan2_text_orm.html.ftl
changeset 217 0f5e3a7fb6af
child 628 7c4a911dc066
equal deleted inserted replaced
181:59bb7c4d6172 217:0f5e3a7fb6af
       
     1 <#--
       
     2 ============================================================================ 
       
     3 Name        : scan2_text_orm.html.ftl 
       
     4 Part of     : Helium 
       
     5 
       
     6 Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     7 All rights reserved.
       
     8 This component and the accompanying materials are made available
       
     9 under the terms of the License "Eclipse Public License v1.0"
       
    10 which accompanies this distribution, and is available
       
    11 at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
    12 
       
    13 Initial Contributors:
       
    14 Nokia Corporation - initial contribution.
       
    15 
       
    16 Contributors:
       
    17 
       
    18 Description:
       
    19 
       
    20 ============================================================================
       
    21     -->
       
    22 
       
    23 <#macro print_component_summary component href_c_id >
       
    24 <#assign href_id = 0>
       
    25 <#assign component_time_list = table_info['jpasingle']['select t.componentTime from ComponentTime t where  t.componentId =${component.id}']>
       
    26 
       
    27 <#if component_time_list[0]?? >
       
    28     <#assign time = component_time_list[0]?number>
       
    29 <#else>
       
    30     <#assign time = 0>
       
    31 </#if>
       
    32 <tr>
       
    33 <#assign hours = (time /(60 * 60))?floor>
       
    34 <#assign minutes_secs = (time % (60 * 60))?floor>
       
    35 <#assign minutes = (minutes_secs / 60)?floor>
       
    36 <#assign seconds = (minutes_secs % 60)?floor>
       
    37     <td>${component.component}</td>
       
    38 <#--write each of the component tables information -->
       
    39 <td align="center">${hours?string("00")}:${minutes?string("00")}:${seconds?string("00")}</td>
       
    40 <#list color_list?keys as priority>
       
    41     <#assign count =  table_info['jpasingle']['select count(m.id) from MetadataEntry as m JOIN  m.priority as p JOIN m.component as c where UPPER(p.priority) like \'%${priority?upper_case}%\' and c.id=${component.id}'][0] >
       
    42     <#if count &gt; 0>
       
    43         <#assign color = color_list['${priority}']>
       
    44         <td align="center" bgcolor="${color}"><a href="#section${priority}${href_c_id}">${count}</a></td>
       
    45     <#else>
       
    46         <td align="center">${count}</td>
       
    47     </#if>
       
    48     <#assign href_id = href_id + 1>
       
    49 </#list>
       
    50 </tr>
       
    51 </#macro>
       
    52 
       
    53 <#macro print_list_text priority component href_id>
       
    54 <#assign count =  table_info['jpasingle']['select count(m.id) from MetadataEntry as m JOIN m.priority as p JOIN m.component as c where  UPPER(p.priority) like \'%${priority?upper_case}%\' and c.id=${component.id}'][0] >
       
    55 <#if count?? && count?number &gt; 0>
       
    56 <#if "${component.component}" != "general">
       
    57         <h3><a name="section${href_id}">${component.component}(${count})</a></h3>
       
    58     <#else>
       
    59         <h3><a name="section${href_id}">Uncategorized(${count})</a></h3>
       
    60     </#if>
       
    61 </#if>
       
    62 <#list table_info['native:com.nokia.helium.jpa.entity.metadata.MetadataEntry']['select * from metadataentry INNER JOIN component ON component.component_id=metadataentry.component_id INNER JOIN priority ON priority.priority_id=metadataentry.priority_id where component.component_id=${component.id} and UPPER(priority.priority) like \'%${priority?upper_case}%\''] as entry >
       
    63 ${logfile}:${entry.lineNumber}>${entry.text}<br />
       
    64 </#list>
       
    65 </#macro>
       
    66 
       
    67 <#macro add_severity_count severity, color, count>
       
    68 <#assign additional_count = count>
       
    69 <#if severity == 'error'>
       
    70     <#assign additional_count = count + 1>
       
    71 </#if>
       
    72     <#if additional_count &gt; 0>
       
    73         <#if severity == 'error'>
       
    74 <td width="12%%" align="center" bgcolor="${color}">${additional_count}</td>
       
    75         <#else>
       
    76 <td align="center" bgcolor="${color}">${count}</td>
       
    77         </#if>
       
    78     <#else>
       
    79     <td align="center">${count}</td>
       
    80     </#if>
       
    81 </#macro>
       
    82 
       
    83 <#-- end of macros code starts here -->
       
    84 
       
    85 
       
    86 <#if (doc)??>
       
    87     <#assign logfile = "${doc.sbsinfo.logfile.@name}"?replace("\\","/") >
       
    88     <#assign time = "${doc.sbsinfo.duration.@time}" >
       
    89 
       
    90     <#assign table_info = pp.loadData('com.nokia.helium.metadata.ORMFMPPLoader',
       
    91         "${dbPath}") >
       
    92 <#-- overall summary -->
       
    93 <#assign logpath = table_info['jpasingle']['select l from LogFile l where LOWER(l.path) like \'%${logfile?lower_case}\''][0] >
       
    94 <html>
       
    95 <head><title>${logfile}</title></head>
       
    96 <body>
       
    97 <h2 STYLE="background-color :#FF0000">Generated using Text Parser instead of XML Parser because of Invalid XML output from Raptor</h2>
       
    98 <h2>Overall</h2>
       
    99 <table border="1" cellpadding="0" cellspacing="0" width="100%%">
       
   100 <tr>
       
   101     <th width="22%%">&nbsp;</th>
       
   102     <th width="11%%">Time</th>
       
   103     <th width="11%%">Errors</th>
       
   104     <th width="11%%">Warnings</th>
       
   105     <th width="11%%">Critical</th>
       
   106     <th width="23%%">Migration Notes</th>
       
   107     <th width="11%%">Info</th>
       
   108 </tr>
       
   109 <tr>
       
   110 <#-- need to create variables for the items tobe displayed in the comment title Overall_Total
       
   111 doing this the long winded way because I could not find a way to add items to a hash in a loop -->
       
   112 <#assign color_list={'error': 'FF0000', 'warning': 'FFF000', 'critical': 'FF7000', 'remark': 'FFCCFF', 'info': 'FFFFFF'}>
       
   113 <#assign priority_ids = color_list?keys>
       
   114 <td width="22%%">Total</td>
       
   115 <td width="12%%" align="center">${time}</td>
       
   116 <#list priority_ids as priority>
       
   117     <@add_severity_count severity='${priority}' color=color_list['${priority}'] 
       
   118         count = table_info['jpasingle']['select Count(m.id) from MetadataEntry m JOIN m.priority p where m.logPathId=${logpath.id} and UPPER(p.priority) like \'%${priority?upper_case}%\''][0] />
       
   119 </#list>
       
   120 </tr>
       
   121 </table>
       
   122 
       
   123 <#-- Summary for each component -->
       
   124 
       
   125 
       
   126 <h1>${logfile}</h1>
       
   127 <h2>By Component</h2>
       
   128     <table border="1" cellpadding="0" cellspacing="0" width="100%%">
       
   129         <tr>
       
   130             <th width="50%%">Component</th>
       
   131             <th width="9%%">Time</th>
       
   132             <th width="9%%">Errors</th>
       
   133             <th width="9%%">Warnings</th>
       
   134             <th width="9%%">Criticals</th>
       
   135             <th width="9%%">Notes</th>
       
   136             <th width="9%%">Info</th>
       
   137         </tr>
       
   138 
       
   139 <#assign c_id = 0>
       
   140 <#assign general_component_list = table_info['jpasingle']['select c from Component c where LOWER(c.component) like \'%general%\' and c.logPathID=${logpath.id}']>
       
   141 <#if general_component_list[0]?? >
       
   142 <#assign general_component = general_component_list[0] >
       
   143 <@print_component_summary component=general_component  href_c_id="${c_id}"/>
       
   144 <#assign c_id = c_id + 1>
       
   145 </#if>
       
   146 <#list table_info['jpa']['select c from Component c where c.logPathID=${logpath.id} and LOWER(c.component) not like \'%general%\' ORDER BY c.component'] as componentEntry>
       
   147 <@print_component_summary component=componentEntry href_c_id="${c_id}"/>
       
   148 <#assign c_id = c_id + 1>
       
   149 </#list>
       
   150 </table>
       
   151 
       
   152 <#-- Individual components status -->
       
   153 <#list priority_ids as p_id>
       
   154 <#assign p_count = table_info['jpasingle']['select Count(m.id) from MetadataEntry m JOIN m.priority as p where m.logPathId=${logpath.id} and UPPER(p.priority) like \'%${p_id?upper_case}%\''][0]>
       
   155 <#if p_count &gt; 0>
       
   156     <h3><a>${p_id} Details By Component</a></h3>
       
   157 </#if>
       
   158 <#assign href_cid = 0>
       
   159 <#if general_component??>
       
   160     <@print_list_text priority="${p_id}" component=general_component href_id="${p_id}${href_cid}" /> 
       
   161     <#assign href_cid = href_cid + 1>
       
   162 </#if>
       
   163 <#list table_info['jpa']['select c from Component c where c.logPathID=${logpath.id} and LOWER(c.component) not like \'%general%\' ORDER BY c.component'] as componentEntry>
       
   164     <@print_list_text priority="${p_id}" component=componentEntry href_id="${p_id}${href_cid}" />
       
   165     <#assign href_cid = href_cid + 1>
       
   166 </#list>
       
   167 </#list>
       
   168 </body>
       
   169 </html>
       
   170 </#if>