Feature #5013 » ReportGenerator.patch
ReportGenerator.java (working copy) | ||
---|---|---|
import com.unitesk.requality.eclipse.Activator;
|
||
import com.unitesk.requality.nodetypes.Requirement;
|
||
import com.unitesk.requality.nodetypes.Document;
|
||
import com.unitesk.requality.tests.CoverageFromFile;
|
||
import com.unitesk.requality.tests.CoverageStorage;
|
||
import com.unitesk.requality.tools.RequalityCLI;
|
||
import com.unitesk.requality.tools.DeepFirstTreeWalker;
|
||
import freemarker.template.Configuration;
|
||
import freemarker.template.DefaultObjectWrapper;
|
||
... | ... | |
Configuration cfg = new Configuration();
|
||
cfg.setObjectWrapper(new DefaultObjectWrapper());
|
||
cfg.setDirectoryForTemplateLoading(new File(templ.getReportPath()));
|
||
Map<String, Object> documents = new HashMap<String, Object>();
|
||
for (TreeNode node : new DeepFirstTreeWalker(rootReq.getTreeDB().getNode(Document.getTypeRootQId())))
|
||
{
|
||
if (!node.getType().equals(Document.TYPE_NAME)) {
|
||
continue;
|
||
}
|
||
Document doc = (Document) node;
|
||
documents.put(doc.getResourceName(),
|
||
freemarker.ext.dom.NodeModel.parse(new File(doc.getHTMLPath())));
|
||
}
|
||
|
||
for (TemplateFile t : templ.getTemplates()) {
|
||
File outFile = new File(saveTo + File.separator
|
||
+ t.getOutputFileName());
|
||
... | ... | |
data.put("reportLocation", saveTo);
|
||
data.put("rootReq", rootReq);
|
||
data.put("root", rootReq.getTreeDB().getRootNode());
|
||
data.put("documents", documents);
|
||
CoverageStorage cs;
|
||
if(data.containsKey("coverageStorageType")){
|
||
String type = (String) data.get("coverageStorageType"), setts = (String) data.get("coverageStorageSettings");
|