diff -r c7c26511138f -r 7c4a911dc066 buildframework/helium/tools/common/templates/log/scan2_orm.html.ftl
--- a/buildframework/helium/tools/common/templates/log/scan2_orm.html.ftl Wed Jun 16 16:51:40 2010 +0300
+++ b/buildframework/helium/tools/common/templates/log/scan2_orm.html.ftl Fri Aug 13 14:59:05 2010 +0300
@@ -37,15 +37,11 @@
${component.component} |
<#--write each of the component tables information -->
${hours?string?left_pad(2, "0")}:${minutes?string?left_pad(2, "0")}:${seconds?string?left_pad(2, "0")} |
-<#list color_list?keys as priority>
- <#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] >
- <#if priority == 'error' && !logfile?contains('_clean_')>
- <#assign count_check_missing_files = table_info['jpasingle']['select Count(w.id) from WhatLogEntry w, Component c where c.component=\'${component.component}\' and c.logPathID=${logpath.id} and w.componentID=c.id and w.missing=1'][0]>
- <#assign count = count + count_check_missing_files>
- #if>
+<#list color_list?keys as severity>
+ <#assign count = table_info['jpasingle']['select count(m.id) from MetadataEntry as m JOIN m.severity as p JOIN m.component as c where p.severity=\'${severity?upper_case}\' and c.id=${component.id}'][0] >
<#if count > 0>
- <#assign color = color_list['${priority}']>
- ${count} |
+ <#assign color = color_list['${severity}']>
+ ${count} |
<#else>
${count} |
#if>
@@ -56,33 +52,21 @@
<#macro converttime time>${((time/3660)%60)?string?left_pad(2, "0")}:${((time/60)%60)?string?left_pad(2, "0")}:${(time%60)?string?left_pad(2, "0")}#macro>
-<#macro print_list_text priority component href_id>
-<#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] >
-<#if priority == 'error' && !logfile?contains('_clean_')>
- <#assign count_check_missing_files = table_info['jpasingle']['select Count(w.id) from WhatLogEntry w, Component c where c.component=\'${component.component}\' and c.logPathID=${logpath.id} and w.componentID=c.id and w.missing=1'][0]>
- <#assign count = count + count_check_missing_files>
-#if>
+<#macro print_list_text severity component href_id>
+<#assign count = table_info['jpasingle']['select count(m.id) from MetadataEntry as m JOIN m.severity as p JOIN m.component as c where p.severity=\'${severity?upper_case}\' and c.id=${component.id}'][0] >
<#if count?? && count?number > 0>
<#if "${component.component}" != "general">
<#else>
#if>
-<#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 >
-${logfile}:${entry.lineNumber}>${entry.text}
-#list>
-<#list table_info['jpa']['select distinct w FROM Component c, WhatLogEntry w, LogFile l WHERE c.logPathID = l.id and LOWER(l.path) not like \'%_clean_%\' and c.component=\'${component.component}\' AND c.logPathID=${logpath.id} AND c.id=w.componentID AND w.missing=1'] as entry>
-${logfile}: MISSING: ${entry.member}
+<#list table_info['jpa']['select e from MetadataEntry e JOIN e.severity s where e.componentId=${component.id} and s.severity=\'${severity?upper_case}\''] as entry>
+${logfile.path}:${entry.lineNumber}>${entry.text}
#list>
#if>
#macro>
<#macro component_check_error component count >
-<#if count > 0>
-<#list table_info['native:com.nokia.helium.jpa.entity.metadata.WhatLogEntry']['select * from whatlogentry where COMPONENT_ID=${component.id} and missing=1'] as whatlogentry>
-${logpath.id}:${whatlogentry.member}
-#list>
-#if>
#macro>
<#macro add_severity_count severity, color, count>
@@ -97,14 +81,14 @@
<#if (logfilename)??>
- <#assign logfile = "${logfilename}"?replace("\\","/") >
+ <#assign logfilename_cleaned = "${logfilename}"?replace("\\","/") >
<#assign table_info = pp.loadData('com.nokia.helium.metadata.ORMFMPPLoader',
"${dbPath}") >
<#-- overall summary -->
-<#assign logpath = table_info['jpasingle']['select l from LogFile l where LOWER(l.path) like \'%${logfile?lower_case}\''][0] >
-<#assign time = table_info['jpasingle']['select et from ExecutionTime et where et.logPathID=${logpath.id}'][0] >
+<#assign logfile = table_info['jpasingle']['select l from LogFile l where LOWER(l.path)=\'${logfilename_cleaned?lower_case}\''][0] >
+<#assign time = table_info['jpasingle']['select et from ExecutionTime et where et.logFileId=${logfile.id}'][0] >
-${logfile}
+${logfile.path}
Overall
@@ -121,16 +105,16 @@
<#-- need to create variables for the items to be displayed in the comment title Overall_Total
doing this the long winded way because I could not find a way to add items to a hash in a loop -->
<#assign color_list={'error': 'FF0000', 'warning': 'FFF000', 'critical': 'FF7000', 'remark': 'FFCCFF', 'info': 'FFFFFF'}>
-<#assign priority_ids = color_list?keys>
+<#assign severity_ids = color_list?keys>
Total |
<@converttime time=time.time /> |
-<#assign count_check_errors = table_info['jpasingle']['select Count(w.id) from WhatLogEntry w JOIN w.component c where c.logPathID=${logpath.id} and w.missing=\'true\''][0]>
-<#list priority_ids as priority>
- <#assign 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]>
- <#if '${priority}' == 'error' && !logfile?contains('_clean_')>
- <#assign count = count + count_check_errors>
+<#assign count_check_errors = table_info['jpasingle']['select Count(w.id) from WhatLogEntry w JOIN w.component c where c.logFileId=${logfile.id} and w.missing=\'true\''][0]>
+<#list severity_ids as severity>
+ <#assign count = table_info['jpasingle']['select Count(m.id) from MetadataEntry m JOIN m.severity p where m.logFileId=${logfile.id} and p.severity=\'${severity?upper_case}\''][0]>
+ <#if '${severity}' == 'error' && !logfile.path?contains('_clean_')>
+ <#assign count = count>
#if>
- <@add_severity_count severity='${priority}' color=color_list['${priority}']
+ <@add_severity_count severity='${severity}' color=color_list['${severity}']
count = count />
#list>
@@ -138,7 +122,7 @@
<#-- Summary for each component -->
-${logfile}
+${logfile.path}
By Component
@@ -152,13 +136,13 @@
<#assign c_id = 0>
-<#assign general_component_list = table_info['jpasingle']['select c from Component c where LOWER(c.component) like \'%general%\' and c.logPathID=${logpath.id}']>
+<#assign general_component_list = table_info['jpasingle']['select c from Component c where LOWER(c.component) like \'%general%\' and c.logFileId=${logfile.id}']>
<#if general_component_list[0]?? >
<#assign general_component = general_component_list[0] >
<@print_component_summary component=general_component href_c_id="${c_id}"/>
<#assign c_id = c_id + 1>
#if>
-<#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>
+<#list table_info['jpa']['select c from Component c where c.logFileId=${logfile.id} and LOWER(c.component) not like \'%general%\' ORDER BY c.component'] as componentEntry>
<@print_component_summary component=componentEntry href_c_id="${c_id}"/>
<#assign c_id = c_id + 1>
@@ -166,18 +150,18 @@
<#-- Individual components status -->
-<#list priority_ids as p_id>
-<#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]>
+<#list severity_ids as p_id>
+<#assign p_count = table_info['jpasingle']['select Count(m.id) from MetadataEntry m JOIN m.severity as p where m.logFileId=${logfile.id} and p.severity=\'${p_id?upper_case}\''][0]>
<#if p_count > 0>
#if>
<#assign href_cid = 0>
<#if general_component??>
- <@print_list_text priority="${p_id}" component=general_component href_id="${p_id}${href_cid}" />
+ <@print_list_text severity="${p_id}" component=general_component href_id="${p_id}${href_cid}" />
<#assign href_cid = href_cid + 1>
#if>
-<#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>
- <@print_list_text priority="${p_id}" component=componentEntry href_id="${p_id}${href_cid}" />
+<#list table_info['jpa']['select c from Component c where c.logFileId=${logfile.id} and LOWER(c.component) not like \'%general%\' ORDER BY c.component'] as componentEntry>
+ <@print_list_text severity="${p_id}" component=componentEntry href_id="${p_id}${href_cid}" />
<#assign href_cid = href_cid + 1>
#list>
#list>