Search in sources :

Example 1 with HTMLReportExporter

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);
}
Also used : HTMLReportExporter(com.archimatetool.reports.html.HTMLReportExporter) IOException(java.io.IOException) File(java.io.File) IArchimateModel(com.archimatetool.model.IArchimateModel)

Aggregations

IArchimateModel (com.archimatetool.model.IArchimateModel)1 HTMLReportExporter (com.archimatetool.reports.html.HTMLReportExporter)1 File (java.io.File)1 IOException (java.io.IOException)1