217
|
1 |
<#--
|
|
2 |
============================================================================
|
|
3 |
Name : scan2_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 -->
|
587
|
39 |
<td align="center">${hours?string?left_pad(2, "0")}:${minutes?string?left_pad(2, "0")}:${seconds?string?left_pad(2, "0")}</td>
|
628
|
40 |
<#list color_list?keys as severity>
|
|
41 |
<#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] >
|
217
|
42 |
<#if count > 0>
|
628
|
43 |
<#assign color = color_list['${severity}']>
|
|
44 |
<td align="center" bgcolor="${color}"><a href="#section${severity}${href_c_id}">${count}</a></td>
|
217
|
45 |
<#else>
|
|
46 |
<td align="center">${count}</td>
|
|
47 |
</#if>
|
|
48 |
<#assign href_id = href_id + 1>
|
|
49 |
</#list>
|
|
50 |
</tr>
|
|
51 |
</#macro>
|
|
52 |
|
587
|
53 |
<#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>
|
|
54 |
|
628
|
55 |
<#macro print_list_text severity component href_id>
|
|
56 |
<#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] >
|
217
|
57 |
<#if count?? && count?number > 0>
|
|
58 |
<#if "${component.component}" != "general">
|
|
59 |
<h3><a name="section${href_id}">${component.component}(${count})</a></h3>
|
|
60 |
<#else>
|
|
61 |
<h3><a name="section${href_id}">Uncategorized(${count})</a></h3>
|
|
62 |
</#if>
|
628
|
63 |
<#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>
|
|
64 |
${logfile.path}:${entry.lineNumber}>${entry.text}<br />
|
217
|
65 |
</#list>
|
|
66 |
</#if>
|
|
67 |
</#macro>
|
|
68 |
|
|
69 |
<#macro component_check_error component count >
|
|
70 |
</#macro>
|
|
71 |
|
|
72 |
<#macro add_severity_count severity, color, count>
|
|
73 |
<#if count > 0>
|
|
74 |
<td width="12%%" align="center" bgcolor="${color}"><a href="#${severity}">${count}</a></td>
|
|
75 |
<#else>
|
|
76 |
<td align="center">${count}</td>
|
|
77 |
</#if>
|
|
78 |
</#macro>
|
|
79 |
|
|
80 |
<#-- end of macros code starts here -->
|
|
81 |
|
|
82 |
|
587
|
83 |
<#if (logfilename)??>
|
628
|
84 |
<#assign logfilename_cleaned = "${logfilename}"?replace("\\","/") >
|
217
|
85 |
<#assign table_info = pp.loadData('com.nokia.helium.metadata.ORMFMPPLoader',
|
|
86 |
"${dbPath}") >
|
|
87 |
<#-- overall summary -->
|
628
|
88 |
<#assign logfile = table_info['jpasingle']['select l from LogFile l where LOWER(l.path)=\'${logfilename_cleaned?lower_case}\''][0] >
|
|
89 |
<#assign time = table_info['jpasingle']['select et from ExecutionTime et where et.logFileId=${logfile.id}'][0] >
|
217
|
90 |
<html>
|
628
|
91 |
<head><title>${logfile.path}</title></head>
|
217
|
92 |
<body>
|
|
93 |
<h2>Overall</h2>
|
|
94 |
<table border="1" cellpadding="0" cellspacing="0" width="100%%">
|
|
95 |
<tr>
|
|
96 |
<th width="22%%"> </th>
|
|
97 |
<th width="11%%">Time</th>
|
|
98 |
<th width="11%%">Errors</th>
|
|
99 |
<th width="11%%">Warnings</th>
|
|
100 |
<th width="11%%">Critical</th>
|
|
101 |
<th width="23%%">Migration Notes</th>
|
|
102 |
<th width="11%%">Info</th>
|
|
103 |
</tr>
|
|
104 |
<tr>
|
587
|
105 |
<#-- need to create variables for the items to be displayed in the comment title Overall_Total
|
217
|
106 |
doing this the long winded way because I could not find a way to add items to a hash in a loop -->
|
|
107 |
<#assign color_list={'error': 'FF0000', 'warning': 'FFF000', 'critical': 'FF7000', 'remark': 'FFCCFF', 'info': 'FFFFFF'}>
|
628
|
108 |
<#assign severity_ids = color_list?keys>
|
217
|
109 |
<td width="22%%">Total</td>
|
587
|
110 |
<td width="12%%" align="center"><@converttime time=time.time /></td>
|
628
|
111 |
<#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]>
|
|
112 |
<#list severity_ids as severity>
|
|
113 |
<#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]>
|
|
114 |
<#if '${severity}' == 'error' && !logfile.path?contains('_clean_')>
|
|
115 |
<#assign count = count>
|
217
|
116 |
</#if>
|
628
|
117 |
<@add_severity_count severity='${severity}' color=color_list['${severity}']
|
217
|
118 |
count = count />
|
|
119 |
</#list>
|
|
120 |
</tr>
|
|
121 |
</table>
|
|
122 |
|
|
123 |
<#-- Summary for each component -->
|
|
124 |
|
628
|
125 |
<h1>${logfile.path}</h1>
|
217
|
126 |
<h2>By Component</h2>
|
|
127 |
<table border="1" cellpadding="0" cellspacing="0" width="100%%">
|
|
128 |
<tr>
|
|
129 |
<th width="50%%">Component</th>
|
|
130 |
<th width="9%%">Time</th>
|
|
131 |
<th width="9%%">Errors</th>
|
|
132 |
<th width="9%%">Warnings</th>
|
|
133 |
<th width="9%%">Criticals</th>
|
|
134 |
<th width="9%%">Notes</th>
|
|
135 |
<th width="9%%">Info</th>
|
|
136 |
</tr>
|
|
137 |
|
|
138 |
<#assign c_id = 0>
|
628
|
139 |
<#assign general_component_list = table_info['jpasingle']['select c from Component c where LOWER(c.component) like \'%general%\' and c.logFileId=${logfile.id}']>
|
217
|
140 |
<#if general_component_list[0]?? >
|
|
141 |
<#assign general_component = general_component_list[0] >
|
|
142 |
<@print_component_summary component=general_component href_c_id="${c_id}"/>
|
|
143 |
<#assign c_id = c_id + 1>
|
|
144 |
</#if>
|
628
|
145 |
<#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>
|
217
|
146 |
<@print_component_summary component=componentEntry href_c_id="${c_id}"/>
|
|
147 |
<#assign c_id = c_id + 1>
|
|
148 |
|
|
149 |
</#list>
|
|
150 |
</table>
|
|
151 |
|
|
152 |
<#-- Individual components status -->
|
628
|
153 |
<#list severity_ids as p_id>
|
|
154 |
<#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]>
|
217
|
155 |
<#if p_count > 0>
|
|
156 |
<h3><a>${p_id} Details By Component</a></h3>
|
|
157 |
</#if>
|
|
158 |
<#assign href_cid = 0>
|
|
159 |
<#if general_component??>
|
628
|
160 |
<@print_list_text severity="${p_id}" component=general_component href_id="${p_id}${href_cid}" />
|
217
|
161 |
<#assign href_cid = href_cid + 1>
|
|
162 |
</#if>
|
628
|
163 |
<#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>
|
|
164 |
<@print_list_text severity="${p_id}" component=componentEntry href_id="${p_id}${href_cid}" />
|
217
|
165 |
<#assign href_cid = href_cid + 1>
|
|
166 |
</#list>
|
|
167 |
</#list>
|
|
168 |
</table>
|
|
169 |
</body>
|
|
170 |
</html>
|
|
171 |
</#if> |