buildframework/helium/tools/common/templates/log/scan2_text_orm.html.ftl
changeset 628 7c4a911dc066
parent 217 0f5e3a7fb6af
equal deleted inserted replaced
588:c7c26511138f 628:7c4a911dc066
    35 <#assign minutes = (minutes_secs / 60)?floor>
    35 <#assign minutes = (minutes_secs / 60)?floor>
    36 <#assign seconds = (minutes_secs % 60)?floor>
    36 <#assign seconds = (minutes_secs % 60)?floor>
    37     <td>${component.component}</td>
    37     <td>${component.component}</td>
    38 <#--write each of the component tables information -->
    38 <#--write each of the component tables information -->
    39 <td align="center">${hours?string("00")}:${minutes?string("00")}:${seconds?string("00")}</td>
    39 <td align="center">${hours?string("00")}:${minutes?string("00")}:${seconds?string("00")}</td>
    40 <#list color_list?keys as priority>
    40 <#list color_list?keys as severity>
    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] >
    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] >
    42     <#if count &gt; 0>
    42     <#if count &gt; 0>
    43         <#assign color = color_list['${priority}']>
    43         <#assign color = color_list['${severity}']>
    44         <td align="center" bgcolor="${color}"><a href="#section${priority}${href_c_id}">${count}</a></td>
    44         <td align="center" bgcolor="${color}"><a href="#section${severity}${href_c_id}">${count}</a></td>
    45     <#else>
    45     <#else>
    46         <td align="center">${count}</td>
    46         <td align="center">${count}</td>
    47     </#if>
    47     </#if>
    48     <#assign href_id = href_id + 1>
    48     <#assign href_id = href_id + 1>
    49 </#list>
    49 </#list>
    50 </tr>
    50 </tr>
    51 </#macro>
    51 </#macro>
    52 
    52 
    53 <#macro print_list_text priority component href_id>
    53 <#macro print_list_text severity 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] >
    54 <#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] >
    55 <#if count?? && count?number &gt; 0>
    55 <#if count?? && count?number &gt; 0>
    56 <#if "${component.component}" != "general">
    56 <#if "${component.component}" != "general">
    57         <h3><a name="section${href_id}">${component.component}(${count})</a></h3>
    57         <h3><a name="section${href_id}">${component.component}(${count})</a></h3>
    58     <#else>
    58     <#else>
    59         <h3><a name="section${href_id}">Uncategorized(${count})</a></h3>
    59         <h3><a name="section${href_id}">Uncategorized(${count})</a></h3>
    60     </#if>
    60     </#if>
    61 </#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 >
    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 severity ON severity.severity_id=metadataentry.severity_id where component.component_id=${component.id} and severity.severity=\'${severity?upper_case}\''] as entry >
    63 ${logfile}:${entry.lineNumber}>${entry.text}<br />
    63 ${logfile}:${entry.lineNumber}>${entry.text}<br />
    64 </#list>
    64 </#list>
    65 </#macro>
    65 </#macro>
    66 
    66 
    67 <#macro add_severity_count severity, color, count>
    67 <#macro add_severity_count severity, color, count>
    88     <#assign time = "${doc.sbsinfo.duration.@time}" >
    88     <#assign time = "${doc.sbsinfo.duration.@time}" >
    89 
    89 
    90     <#assign table_info = pp.loadData('com.nokia.helium.metadata.ORMFMPPLoader',
    90     <#assign table_info = pp.loadData('com.nokia.helium.metadata.ORMFMPPLoader',
    91         "${dbPath}") >
    91         "${dbPath}") >
    92 <#-- overall summary -->
    92 <#-- overall summary -->
    93 <#assign logpath = table_info['jpasingle']['select l from LogFile l where LOWER(l.path) like \'%${logfile?lower_case}\''][0] >
    93 <#assign logfile = table_info['jpasingle']['select l from LogFile l where LOWER(l.path) like \'${logfile?lower_case}\''][0] >
    94 <html>
    94 <html>
    95 <head><title>${logfile}</title></head>
    95 <head><title>${logfile}</title></head>
    96 <body>
    96 <body>
    97 <h2 STYLE="background-color :#FF0000">Generated using Text Parser instead of XML Parser because of Invalid XML output from Raptor</h2>
    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>
    98 <h2>Overall</h2>
   108 </tr>
   108 </tr>
   109 <tr>
   109 <tr>
   110 <#-- need to create variables for the items tobe displayed in the comment title Overall_Total
   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 -->
   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'}>
   112 <#assign color_list={'error': 'FF0000', 'warning': 'FFF000', 'critical': 'FF7000', 'remark': 'FFCCFF', 'info': 'FFFFFF'}>
   113 <#assign priority_ids = color_list?keys>
   113 <#assign severity_ids = color_list?keys>
   114 <td width="22%%">Total</td>
   114 <td width="22%%">Total</td>
   115 <td width="12%%" align="center">${time}</td>
   115 <td width="12%%" align="center">${time}</td>
   116 <#list priority_ids as priority>
   116 <#list severity_ids as severity>
   117     <@add_severity_count severity='${priority}' color=color_list['${priority}'] 
   117     <@add_severity_count severity='${severity}' color=color_list['${severity}'] 
   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] />
   118         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] />
   119 </#list>
   119 </#list>
   120 </tr>
   120 </tr>
   121 </table>
   121 </table>
   122 
   122 
   123 <#-- Summary for each component -->
   123 <#-- Summary for each component -->
   135             <th width="9%%">Notes</th>
   135             <th width="9%%">Notes</th>
   136             <th width="9%%">Info</th>
   136             <th width="9%%">Info</th>
   137         </tr>
   137         </tr>
   138 
   138 
   139 <#assign c_id = 0>
   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}']>
   140 <#assign general_component_list = table_info['jpasingle']['select c from Component c where LOWER(c.component) like \'%general%\' and c.logFileId=${logfile.id}']>
   141 <#if general_component_list[0]?? >
   141 <#if general_component_list[0]?? >
   142 <#assign general_component = general_component_list[0] >
   142 <#assign general_component = general_component_list[0] >
   143 <@print_component_summary component=general_component  href_c_id="${c_id}"/>
   143 <@print_component_summary component=general_component  href_c_id="${c_id}"/>
   144 <#assign c_id = c_id + 1>
   144 <#assign c_id = c_id + 1>
   145 </#if>
   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>
   146 <#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>
   147 <@print_component_summary component=componentEntry href_c_id="${c_id}"/>
   147 <@print_component_summary component=componentEntry href_c_id="${c_id}"/>
   148 <#assign c_id = c_id + 1>
   148 <#assign c_id = c_id + 1>
   149 </#list>
   149 </#list>
   150 </table>
   150 </table>
   151 
   151 
   152 <#-- Individual components status -->
   152 <#-- Individual components status -->
   153 <#list priority_ids as p_id>
   153 <#list severity_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]>
   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]>
   155 <#if p_count &gt; 0>
   155 <#if p_count &gt; 0>
   156     <h3><a>${p_id} Details By Component</a></h3>
   156     <h3><a>${p_id} Details By Component</a></h3>
   157 </#if>
   157 </#if>
   158 <#assign href_cid = 0>
   158 <#assign href_cid = 0>
   159 <#if general_component??>
   159 <#if general_component??>
   160     <@print_list_text priority="${p_id}" component=general_component href_id="${p_id}${href_cid}" /> 
   160     <@print_list_text severity="${p_id}" component=general_component href_id="${p_id}${href_cid}" /> 
   161     <#assign href_cid = href_cid + 1>
   161     <#assign href_cid = href_cid + 1>
   162 </#if>
   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>
   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 priority="${p_id}" component=componentEntry href_id="${p_id}${href_cid}" />
   164     <@print_list_text severity="${p_id}" component=componentEntry href_id="${p_id}${href_cid}" />
   165     <#assign href_cid = href_cid + 1>
   165     <#assign href_cid = href_cid + 1>
   166 </#list>
   166 </#list>
   167 </#list>
   167 </#list>
   168 </body>
   168 </body>
   169 </html>
   169 </html>