buildframework/helium/tools/common/templates/diamonds/faults_metadata_orm.ftl
changeset 628 7c4a911dc066
parent 588 c7c26511138f
child 645 b8d81fa19e7d
--- a/buildframework/helium/tools/common/templates/diamonds/faults_metadata_orm.ftl	Wed Jun 16 16:51:40 2010 +0300
+++ b/buildframework/helium/tools/common/templates/diamonds/faults_metadata_orm.ftl	Fri Aug 13 14:59:05 2010 +0300
@@ -31,27 +31,34 @@
     </build>
 
     <faults>
-        <total severity="error">${table_info['jpasingle']['select Count(m.id) from MetadataEntry m JOIN m.priority as p JOIN m.logFile as l where LOWER(l.path) like \'%\\_compile.log\' ESCAPE \'\\\' and LOWER(l.path) not like \'%\\_clean\\_%compile.log\' ESCAPE \'\\\' and p.priority = \'ERROR\''][0]
-        + table_info['jpasingle']['select Count(w.id) from WhatLogEntry w JOIN w.component as c JOIN c.logFile as l where LOWER(l.path) like \'%\\_compile.log\' ESCAPE \'\\\' and LOWER(l.path) not like \'%\\_clean\\_%compile.log\' ESCAPE \'\\\' and w.missing = \'true\''][0]}</total>
-        <total severity="warning">${table_info['jpasingle']['select Count(m.id) from MetadataEntry m JOIN m.priority as p JOIN m.logFile as l where LOWER(l.path) like \'%\\_compile.log\' ESCAPE \'\\\' and LOWER(l.path) not like \'%\\_clean\\_%compile.log\' ESCAPE \'\\\' and p.priority = \'WARNING\''][0]}</total>
-        <total severity="warning_rvct_other">${table_info['jpasingle']['select Count(m.id) from MetadataEntry m JOIN m.priority as p JOIN m.logFile as l where LOWER(l.path) like \'%\\_compile.log\' ESCAPE \'\\\' and LOWER(l.path) not like \'%\\_clean\\_%compile.log\' ESCAPE \'\\\' and UPPER(p.priority) = \'WARNING\''][0]}</total>
+        <total severity="error">${table_info['jpasingle']['select Count(m.id) from MetadataEntry m JOIN m.severity as p JOIN m.logFile as l where LOWER(l.path) like \'%\\_compile.log\' ESCAPE \'\\\' and LOWER(l.path) not like \'%\\_clean\\_%compile.log\' ESCAPE \'\\\' and p.severity=\'ERROR\''][0]}</total>
+        <total severity="warning">${table_info['jpasingle']['select Count(m.id) from MetadataEntry m JOIN m.severity as p JOIN m.logFile as l where LOWER(l.path) like \'%\\_compile.log\' ESCAPE \'\\\' and LOWER(l.path) not like \'%\\_clean\\_%compile.log\' ESCAPE \'\\\' and p.severity = \'WARNING\''][0]}</total>
+        <total severity="warning_rvct_other">${table_info['jpasingle']['select Count(m.id) from MetadataEntry m JOIN m.severity as p JOIN m.logFile as l where LOWER(l.path) like \'%\\_compile.log\' ESCAPE \'\\\' and LOWER(l.path) not like \'%\\_clean\\_%compile.log\' ESCAPE \'\\\' and p.severity = \'WARNING\''][0]}</total>
         <!-- todo update to calculate the correct value -->
-        <total severity="warning_rvct_bad">${table_info['jpasingle']['select Count(m.id) from MetadataEntry m JOIN m.priority as p JOIN m.logFile as l where LOWER(l.path) like \'%\\_compile.log\' ESCAPE \'\\\' and LOWER(l.path) not like \'%\\_clean\\_%compile.log\' ESCAPE \'\\\' and UPPER(p.priority) = \'REMARK\''][0]}</total>
-    <#list table_info['native:java.lang.String']['select DISTINCT component.component from component INNER JOIN logfile ON logfile.logpath_id=component.logpath_id where logfile.path like \'%_compile.log\' and logfile.path not like \'%\\_clean\\_%compile.log\''] as component>
+        <total severity="warning_rvct_bad">${table_info['jpasingle']['select Count(m.id) from MetadataEntry m JOIN m.severity as p JOIN m.logFile as l where LOWER(l.path) like \'%\\_compile.log\' ESCAPE \'\\\' and LOWER(l.path) not like \'%\\_clean\\_%compile.log\' ESCAPE \'\\\' and p.severity=\'CRITICAL\''][0]}</total>
+    <#list table_info['native:java.lang.String']['select DISTINCT component.component from component INNER JOIN logfile ON logfile.logfile_id=component.logfile_id where logfile.path like \'%_compile.log\' and logfile.path not like \'%\\_clean\\_%compile.log\''] as component>
         <component>
             <name>${component}</name>
-            <total severity="error">${table_info['jpasingle']['select Count(m.id) from MetadataEntry m JOIN m.logFile as l JOIN m.priority as p JOIN m.component as c where UPPER(p.priority)=\'ERROR\' and c.component=\'${component}\' and LOWER(l.path) like \'%\\_compile.log\' ESCAPE \'\\\' and LOWER(l.path) not like \'%\\_clean\\_%compile.log\' ESCAPE \'\\\''][0]
-            + table_info['jpasingle']['select Count(w.id) from WhatLogEntry w JOIN w.component as c JOIN c.logFile as l where c.component=\'${component}\' and LOWER(l.path) like \'%\\_compile.log\' ESCAPE \'\\\' and LOWER(l.path) not like \'%\\_clean\\_%compile.log\' ESCAPE \'\\\' and w.missing = \'true\''][0]}</total>
-            <total severity="warning">${table_info['jpasingle']['select Count(m.id) from MetadataEntry m JOIN m.logFile as l JOIN m.priority as p JOIN m.component as c where UPPER(p.priority)=\'WARNING\' and c.component=\'${component}\' and LOWER(l.path) like \'%\\_compile.log\' ESCAPE \'\\\' and LOWER(l.path) not like \'%\\_clean\\_%compile.log\' ESCAPE \'\\\''][0]}</total>
-            <total severity="critical">${table_info['jpasingle']['select Count(m.id) from MetadataEntry m JOIN m.logFile as l JOIN m.priority as p JOIN m.component as c where UPPER(p.priority)=\'REMARK\' and c.component=\'${component}\' and LOWER(l.path) like \'%\\_compile.log\' ESCAPE \'\\\' and LOWER(l.path) not like \'%\\_clean\\_%compile.log\' ESCAPE \'\\\''][0]}</total>
+            <total severity="error">${table_info['jpasingle']['select Count(m.id) from MetadataEntry m JOIN m.logFile as l JOIN m.severity as p JOIN m.component as c where UPPER(p.severity)=\'ERROR\' and c.component=\'${component}\' and LOWER(l.path) like \'%\\_compile.log\' ESCAPE \'\\\' and LOWER(l.path) not like \'%\\_clean\\_%compile.log\' ESCAPE \'\\\''][0]}</total>
+            <total severity="warning">${table_info['jpasingle']['select Count(m.id) from MetadataEntry m JOIN m.logFile as l JOIN m.severity as p JOIN m.component as c where UPPER(p.severity)=\'WARNING\' and c.component=\'${component}\' and LOWER(l.path) like \'%\\_compile.log\' ESCAPE \'\\\' and LOWER(l.path) not like \'%\\_clean\\_%compile.log\' ESCAPE \'\\\''][0]}</total>
+            <total severity="critical">${table_info['jpasingle']['select Count(m.id) from MetadataEntry m JOIN m.logFile as l JOIN m.severity as p JOIN m.component as c where UPPER(p.severity)=\'REMARK\' and c.component=\'${component}\' and LOWER(l.path) like \'%\\_compile.log\' ESCAPE \'\\\' and LOWER(l.path) not like \'%\\_clean\\_%compile.log\' ESCAPE \'\\\''][0]}</total>
         </component>
     </#list>
     </faults>
 
     <!-- all components -->
     <components>
-    <#list table_info['native:java.lang.String']['select DISTINCT component.component from component INNER JOIN logfile ON logfile.logpath_id=component.logpath_id where logfile.path like \'%_compile.log\' and logfile.path not like \'%\\_clean\\_%compile.log\''] as component>
-        <component>${component}</component>
+    <#assign components = pp.newWritableSequence()>
+    <#list table_info['jpa']['select c from Component c JOIN c.logFile l WHERE l.path like \'%_compile.log\' and l.path not like \'%\\_clean\\_%compile.log\''] as component>
+        <#if (!components?seq_contains(component.component))>
+        <@pp.add seq=components value=component.component />
+        <component>
+            <name>${component.component}</name>
+            <#if component.sysdefUnit??>
+            <package>${component.sysdefUnit.sysdefComponent.sysdefCollection.sysdefPackage.packageId}</package>
+            </#if>
+        </component>
+        </#if>
     </#list>
     </components>
 <#include "diamonds_footer.ftl"> 
\ No newline at end of file