public void writeReport(OutputStream out,
VerifierReport result) throws IOException {
zout = new ZipOutputStream( out );
VerifierData data = result.getVerifierData();
// Base files
// index.htm
writeToFile( UrlFactory.SOURCE_FOLDER + File.separator + UrlFactory.HTML_FILE_INDEX,
formPage( UrlFactory.THIS_FOLDER,
ComponentsReportVisitor.visitObjectTypeCollection( UrlFactory.THIS_FOLDER,
data.<ObjectType> getAll( VerifierComponentType.OBJECT_TYPE ) ) ) );
// packages.htm
writeToFile( UrlFactory.SOURCE_FOLDER + File.separator + UrlFactory.HTML_FILE_PACKAGES,
formPage( UrlFactory.THIS_FOLDER,
ComponentsReportVisitor.visitRulePackageCollection( UrlFactory.THIS_FOLDER,
data.<RulePackage> getAll( VerifierComponentType.RULE_PACKAGE ) ) ) );
// Rules
String ruleFolder = UrlFactory.SOURCE_FOLDER + File.separator + UrlFactory.RULE_FOLDER;
for ( VerifierRule rule : data.<VerifierRule> getAll( VerifierComponentType.RULE ) ) {
writeToFile( ruleFolder + File.separator + rule.getPath() + ".htm",
formPage( UrlFactory.PREVIOUS_FOLDER,
ComponentsReportVisitor.visitRule( UrlFactory.PREVIOUS_FOLDER,
rule,
data ) ) );
}
// ObjectTypes
String objectTypeFolder = UrlFactory.SOURCE_FOLDER + File.separator + UrlFactory.OBJECT_TYPE_FOLDER;
for ( ObjectType objectType : data.<ObjectType> getAll( VerifierComponentType.OBJECT_TYPE ) ) {
writeToFile( objectTypeFolder + File.separator + objectType.getPath() + ".htm",
formPage( UrlFactory.PREVIOUS_FOLDER,
ComponentsReportVisitor.visitObjectType( UrlFactory.PREVIOUS_FOLDER,
objectType,
data ) ) );
}
// Fields
String fieldFolder = UrlFactory.SOURCE_FOLDER + File.separator + UrlFactory.FIELD_FOLDER;
for ( Field field : data.<Field> getAll( VerifierComponentType.FIELD ) ) {
writeToFile( fieldFolder + File.separator + field.getPath() + ".htm",
formPage( UrlFactory.PREVIOUS_FOLDER,
ComponentsReportVisitor.visitField( UrlFactory.PREVIOUS_FOLDER,
field,
result ) ) );