use of eu.esdihumboldt.hale.common.core.report.ReportHandler in project hale by halestudio.
the class GenerateDuplicates method loadProject.
private boolean loadProject() throws IOException {
final AtomicBoolean success = new AtomicBoolean(true);
LocatableInputSupplier<? extends InputStream> projectIn = new DefaultInputSupplier(context.getProject());
ProjectTransformationEnvironment env = new ProjectTransformationEnvironment("sample", projectIn, new ReportHandler() {
@Override
public void publishReport(Report<?> report) {
if (report.isSuccess() && report.getErrors().isEmpty()) {
System.out.println(report.getSummary());
} else {
System.err.println("Error loading project: " + report.getSummary());
success.set(false);
}
}
});
if (success.get()) {
this.sourceSchema = env.getSourceSchema();
this.targetSchema = env.getTargetSchema();
this.examples = env.getAlignment();
return true;
}
return false;
}
use of eu.esdihumboldt.hale.common.core.report.ReportHandler in project hale by halestudio.
the class CityGMLPropagate method loadProject.
private boolean loadProject() throws IOException {
final AtomicBoolean success = new AtomicBoolean(true);
LocatableInputSupplier<? extends InputStream> projectIn = new DefaultInputSupplier(context.getProject());
ProjectTransformationEnvironment env = new ProjectTransformationEnvironment("sample", projectIn, new ReportHandler() {
@Override
public void publishReport(Report<?> report) {
if (report.isSuccess() && report.getErrors().isEmpty()) {
System.out.println(report.getSummary());
} else {
System.err.println("Error loading project: " + report.getSummary());
success.set(false);
}
}
});
if (success.get()) {
this.sourceSchema = env.getSourceSchema();
this.targetSchema = env.getTargetSchema();
this.examples = env.getAlignment();
return true;
}
return false;
}
use of eu.esdihumboldt.hale.common.core.report.ReportHandler in project hale by halestudio.
the class ExecTransformation method setupReportHandler.
private void setupReportHandler() {
final ReportHandler delegateTo;
if (context.getReportsOut() != null) {
delegateTo = new ReportFile(context.getReportsOut());
} else {
delegateTo = null;
}
/*
* The report handler writes a summary to std out
*/
reportHandler = new ReportHandler() {
@Override
public void publishReport(Report<?> report) {
ExecUtil.printSummary(report);
if (delegateTo != null) {
delegateTo.publishReport(report);
}
}
};
}
Aggregations