Class QacHtmlFileReader
- Namespace
- MES.MQC.DataSourceLibrary.Adapters.Files
- Assembly
- MES.MQC.DataSourceLibrary.dll
public class QacHtmlFileReader : FileReader
- Inheritance
-
QacHtmlFileReader
- Inherited Members
Properties
DataSource
The Data Source of the Adapter. If a report file contains data from multiple data sources, this property has to be to "Unknown" and the DataSource of each AdapterData object has to be defined.
public override string DataSource { get; }
Property Value
Description
Description of the Adapter that is visible in the Adapter Dialog as a popover. If the adapter is an API Connector, the description is also shown in the Add/Edit DataSource dialog, when the API Connector is selected. Absolute links get transformed into HTML Link Tags, line breaks (\n) get transformed into HTML line breaks (<br>), HTML tags are not allowed.
public override string Description { get; }
Property Value
FileExtensions
File Extensions of the Adapter. This property has to be defined and must have at least one file extension. The Adapter is only used for FilePaths with the defined file extensions. The IsValid method is not called unless the file extension matches.
public override List<string> FileExtensions { get; }
Property Value
Name
Unique Name of the Adapter. Defaults to the ClassName (without Adapter / FileReader / ApiConnector suffix), can be overridden with a user defined Name.
public override string Name { get; }
Property Value
Methods
IsValid(FileReaderContext)
Check if the file name contains 'RCR'
protected override bool IsValid(FileReaderContext context)
Parameters
contextFileReaderContextContext of file
Returns
- bool
true if file is a valid QAC XML report file
Read(FileReaderContext)
FINDINGS: Read each table form <body><div id='content'><div class='dpp'><div class='rgtable'><table ...> for each Rule Group as Findings for each file/Artifact. Read artifactPath and artifactName from first <td> ('Files') for each row from table. Read findingsFailed from last <td> ('Total Violations') for each row from table. Read measurementName from <body><div id='content'><div class='dpp'><div class='subsec'><h5 ...>. Concat Findings with measurement name to get measureName.
GUIDELINES: Read each table from <body><div id='content'><div class='worstrules'><div class='rgtable'><table ...> for each Rule Group as Guidlines for each file/Artifact. Read artifactPath and artifactName from first <td> ('Files') for each row from table. Count the columns with rules and use as guidelinesTotal. Read each row from column and count all <td> with violation to calculate guidelinesFailed. Calculate guidelinesPassed as guidelinesTotal - guidelinesFailed
protected override AdapterReadResult Read(FileReaderContext context)
Parameters
contextFileReaderContext
Returns
Examples
<body> ... <div id="content"> <div class="dpp"> ... <div class="subsec"><h5>M3CM</h5></div> <div class="rgtable"> <table ....> <tr><th>Files</th><th>Rule 0</th><th>Rule 1</th><th>Rule 2</th><th>Rule 3</th>...<td><b>Total Violations</b></td></tr> <tr><td align = "left" >< a href="xxx" title="xxx"> xxx </a></td><td> xxx </td><td>xxx</td>...<td><b>0</b></td></tr> ... </table> </div> </div> <div class='worstrules'> <div class="subsec"><h5>xxx</h5></div> <div class='rgtable'> <table ...> <tr><th>Files</th><th>Rule 1 </th><th>Rule 2 </th> ... <th>RuleZ</th></tr> <tr><td ... >< a href="xxx" title="xxx"> xxx </a></td><td> xxx </td><td> xxx </td> ... <td> xxx </td></tr> ... </table> </div> </div> </body>