use of com.archimatetool.reports.html.HTMLReportExporter in project archi by archimatetool.
the class HTMLReportProvider method run.
@Override
public void run(CommandLine commandLine) throws Exception {
if (!hasCorrectOptions(commandLine)) {
return;
}
String sOutput = commandLine.getOptionValue(OPTION_CREATE_HTML_REPORT);
if (!StringUtils.isSet(sOutput)) {
logError(Messages.HTMLReportProvider_1);
return;
}
File folderOutput = new File(sOutput);
folderOutput.mkdirs();
if (!folderOutput.exists()) {
logError(NLS.bind(Messages.HTMLReportProvider_2, sOutput));
return;
}
IArchimateModel model = CommandLineState.getModel();
if (model == null) {
throw new IOException(Messages.HTMLReportProvider_3);
}
logMessage(NLS.bind(Messages.HTMLReportProvider_4, model.getName(), sOutput));
HTMLReportExporter ex = new HTMLReportExporter(model);
// $NON-NLS-1$
ex.createReport(folderOutput, "index.html");
logMessage(Messages.HTMLReportProvider_5);
}
Aggregations