179
|
1 |
<#--
|
|
2 |
============================================================================
|
|
3 |
Name : bmd.macros.xml.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 |
<#if component_table?keys?seq_contains("${component}")>
|
|
25 |
<#if component_table["${component}"] != "general">
|
|
26 |
<tr><td>${component_table['${component}']}</td>
|
|
27 |
<#else>
|
|
28 |
<tr><td>UnCategorized</td>
|
|
29 |
</#if>
|
|
30 |
</#if>
|
|
31 |
<#assign href_id = 0>
|
|
32 |
<#assign time_tbl = table_info['select time from componenttime where cid = \'${component}\' ']>
|
|
33 |
|
|
34 |
<#if time_tbl?size > 0 && time_tbl[0]?keys?seq_contains("time") >
|
|
35 |
<#assign time = time_tbl[0]["time"]?number/>
|
|
36 |
<#else>
|
|
37 |
<#assign time = 0/>
|
|
38 |
</#if>
|
|
39 |
|
|
40 |
<#assign hours = (time /(60 * 60))?floor>
|
|
41 |
<#assign minutes_secs = (time % (60 * 60))?floor>
|
|
42 |
<#assign minutes = (minutes_secs / 60)?floor>
|
|
43 |
<#assign seconds = (minutes_secs % 60)?floor>
|
|
44 |
|
|
45 |
<td align="center">${hours?string("00")}:${minutes?string("00")}:${seconds?string("00")}</td>
|
|
46 |
<#list priority_ids as priority>
|
|
47 |
<#assign count = table_info['select count(data) as COUNT from metadata where priority_id in (select id from priority where priority like \'${priority}\') and logpath_id in (select id from logfiles where path like \'%${logfile}%\') and component_id = \'${component}\' '][0]['COUNT'] >
|
|
48 |
<#if count > 0>
|
|
49 |
<#assign color = color_list['${priority}']>
|
|
50 |
<td align="center" bgcolor="${color}"><a href="#section${href_c_id}${href_id}">${count}</a></td>
|
|
51 |
<#else>
|
|
52 |
<td align="center">${count}</td>
|
|
53 |
</#if>
|
|
54 |
<#assign href_id = href_id + 1>
|
|
55 |
</#list>
|
|
56 |
</tr>
|
|
57 |
</#macro>
|
|
58 |
|
|
59 |
<#macro print_list_text priority component href_id>
|
|
60 |
<#assign count = table_info['select count(data) as COUNT from metadata where component_id=\'${component}\' and priority_id in (select id from priority where priority like \'${priority}\') and logpath_id in (select id from logfiles where path like \'%${logfile}%\')'][0]['COUNT'] >
|
|
61 |
<#if count > 0>
|
|
62 |
<#if component_table?keys?seq_contains("${component}")>
|
|
63 |
<#if component_table["${component}"] != "general">
|
|
64 |
<h3><a name="section${href_id}">${component_table['${component}']}(${count})</a></h3>
|
|
65 |
<#else>
|
|
66 |
<h3><a name="section${href_id}">Uncategorized(${count})</a></h3>
|
|
67 |
</#if>
|
|
68 |
</#if>
|
|
69 |
<#list table_info['select * from metadata where component_id=\'${component}\' and priority_id in (select id from priority where priority like \'${priority}\')'] as recordentry >
|
|
70 |
${logfile}:${recordentry['line_number']}>${recordentry['data']}<br />
|
|
71 |
</#list>
|
|
72 |
</#if>
|
|
73 |
</#macro>
|
|
74 |
|
|
75 |
<#macro add_severity_count severity, color, count>
|
|
76 |
<#assign additional_count = count>
|
|
77 |
<#if severity == 'error'>
|
|
78 |
<#assign additional_count = count + 1>
|
|
79 |
</#if>
|
|
80 |
<#if additional_count > 0>
|
|
81 |
<#if severity == 'error'>
|
|
82 |
<td width="12%%" align="center" bgcolor="${color}">${additional_count}</td>
|
|
83 |
<#else>
|
|
84 |
<td align="center" bgcolor="${color}">${count}</td>
|
|
85 |
</#if>
|
|
86 |
<#else>
|
|
87 |
<td align="center">${count}</td>
|
|
88 |
</#if>
|
|
89 |
</#macro>
|
|
90 |
<#if (doc)??>
|
|
91 |
<#assign logfile = "${doc.sbsinfo.logfile.@name}" >
|
|
92 |
<#assign time = "${doc.sbsinfo.duration.@time}" >
|
|
93 |
|
|
94 |
<#assign table_info = pp.loadData('com.nokia.helium.metadata.SQLFMPPLoader',
|
|
95 |
"${dbPath}") >
|
|
96 |
<#-- overall summary -->
|
|
97 |
<#assign component_table = table_info['select id, component from component where logpath_id in (select id from logfiles where path like \'%${logfile}%\') ORDER BY component'] >
|
|
98 |
<#assign general_id = table_info['select id from component where logpath_id in (select id from logfiles where path like \'%${logfile}%\') and component like \'%general%\''] >
|
|
99 |
|
|
100 |
<html>
|
|
101 |
<head><title>${logfile}</title></head>
|
|
102 |
<body>
|
|
103 |
<h2 STYLE="background-color :#FF0000">Generated using Text Parser instead of XML Parser because of Invalid XML output from Raptor</h2>
|
|
104 |
<h2>Overall</h2>
|
|
105 |
<table border="1" cellpadding="0" cellspacing="0" width="100%%">
|
|
106 |
<tr>
|
|
107 |
<th width="22%%"> </th>
|
|
108 |
<th width="11%%">Time</th>
|
|
109 |
<th width="11%%">Errors</th>
|
|
110 |
<th width="11%%">Warnings</th>
|
|
111 |
<th width="11%%">Critical</th>
|
|
112 |
<th width="23%%">Migration Notes</th>
|
|
113 |
<th width="11%%">Info</th>
|
|
114 |
</tr>
|
|
115 |
<tr>
|
|
116 |
<td width="22%%">Total</td>
|
|
117 |
<td width="12%%" align="center">${time}</td>
|
|
118 |
<#assign color_list={'error': 'FF0000', 'warning': 'FFF000', 'critical': 'FF7000', 'remark': '0000FF', 'info': 'FFFFFF'}>
|
|
119 |
<#assign priority_ids = color_list?keys>
|
|
120 |
<#list priority_ids as priority>
|
|
121 |
<@add_severity_count severity='${priority}'
|
|
122 |
count = table_info['select count(data) as COUNT from metadata where priority_id in (select id from priority where priority like \'${priority}\') and logpath_id in (select id from logfiles where path like \'%${logfile}%\')'][0]['COUNT'] color=color_list['${priority}'] />
|
|
123 |
</#list>
|
|
124 |
</tr>
|
|
125 |
</table>
|
|
126 |
|
|
127 |
<#-- Summary for each component -->
|
|
128 |
|
|
129 |
|
|
130 |
<h1>${logfile}</h1>
|
|
131 |
<h2>By Component</h2>
|
|
132 |
<table border="1" cellpadding="0" cellspacing="0" width="100%%">
|
|
133 |
<tr>
|
|
134 |
<th width="50%%">Component</th>
|
|
135 |
<th width="9%%">Time</th>
|
|
136 |
<th width="9%%">Errors</th>
|
|
137 |
<th width="9%%">Warnings</th>
|
|
138 |
<th width="9%%">Criticals</th>
|
|
139 |
<th width="9%%">Notes</th>
|
|
140 |
<th width="9%%">Info</th>
|
|
141 |
</tr>
|
|
142 |
<#assign c_id = 0>
|
|
143 |
<#if general_id?size > 0>
|
|
144 |
<@print_component_summary component="${general_id[0][\"id\"]}" href_c_id="${c_id}"/>
|
|
145 |
</#if>
|
|
146 |
|
|
147 |
<#assign component_ids = component_table?keys>
|
|
148 |
<#list component_ids as component>
|
|
149 |
<#if component_table["${component}"] != "general">
|
|
150 |
<@print_component_summary component="${component}" href_c_id="${c_id}" />
|
|
151 |
</#if>
|
|
152 |
|
|
153 |
<#assign c_id = c_id + 1>
|
|
154 |
</#list>
|
|
155 |
</table>
|
|
156 |
|
|
157 |
<#-- Individual components status -->
|
|
158 |
|
|
159 |
<#assign href_pid = 0>
|
|
160 |
<#list priority_ids as p_id>
|
|
161 |
<#assign p_count = table_info['select count(data) as COUNT from metadata where priority_id in (select id from priority where priority like \'${p_id}\') and logpath_id in (select id from logfiles where path like \'%${logfile}%\')'][0]['COUNT'] >
|
|
162 |
<#if p_count > 0>
|
|
163 |
<h3><a>${p_id} Details By Component</a></h3>
|
|
164 |
</#if>
|
|
165 |
|
|
166 |
<#assign href_cid = 0>
|
|
167 |
<#if general_id?size > 0>
|
|
168 |
<@print_list_text priority="${p_id}" component="${general_id[0][\"id\"]}" href_id="${href_cid}${href_pid}" />
|
|
169 |
<#assign href_cid = href_cid + 1>
|
|
170 |
</#if>
|
|
171 |
<#list component_ids as component>
|
|
172 |
<#if component_table["${component}"] != "general">
|
|
173 |
<@print_list_text priority="${p_id}" component="${component}" href_id="${href_cid}${href_pid}" />
|
|
174 |
<#assign href_cid = href_cid + 1>
|
|
175 |
</#if>
|
|
176 |
</#list>
|
|
177 |
<#assign href_pid = href_pid + 1>
|
|
178 |
</#list>
|
|
179 |
</body>
|
|
180 |
</html>
|
|
181 |
</#if> |