use of eu.esdihumboldt.hale.common.headless.transform.DefaultTransformationSettings in project hale by halestudio.
the class TransformDataWizard method performFinish.
/**
* @see org.eclipse.jface.wizard.Wizard#performFinish()
*/
@Override
public boolean performFinish() {
InstanceCollection rawSources = new MultiInstanceCollection(sourceSelectionPage.getSourceInstances());
// Create a copy of the current alignment to be independent and run
// everything in a job.
AlignmentService alignmentService = PlatformUI.getWorkbench().getService(AlignmentService.class);
Alignment alignment = new DefaultAlignment(alignmentService.getAlignment());
// schema service for getting source schema
SchemaService ss = PlatformUI.getWorkbench().getService(SchemaService.class);
Transformation.transform(rawSources, targetSink, sourceSelectionPage.getExportJob(), sourceSelectionPage.getValidationJob(), alignment, ss.getSchemas(SchemaSpaceID.SOURCE), DefaultReportHandler.getInstance(), HaleUI.getServiceProvider(), null, new DefaultTransformationSettings());
return true;
}
use of eu.esdihumboldt.hale.common.headless.transform.DefaultTransformationSettings in project hale by halestudio.
the class ExecTransformation method transform.
private int transform() throws InterruptedException, ExecutionException {
status("Running hale transformation...");
TransformationSettings settings = new DefaultTransformationSettings();
// TODO make settings configurable?
// run transformation
ListenableFuture<Boolean> res = Transformation.transform(sources, target, env, reportHandler, id, validators, context.getFilters(), settings);
boolean orgSuccess = res.get();
// them to complete and file their report (otherwise error may get lost)
try {
Thread.sleep(3000);
} catch (Throwable e) {
// ignore
}
boolean success;
try {
success = evaluateSuccess(orgSuccess);
} catch (Throwable e) {
error("Success evaluation resulted in an error:\n" + e.getMessage());
if (context.isLogException()) {
e.printStackTrace();
}
return 2;
}
if (success) {
info("Transformation completed. Please check the reports for more details.");
} else {
if (orgSuccess) {
error("Transformation failed according to the success evaluation script.");
return 2;
} else {
error("Transformation failed, please check the reports for details.");
return 1;
}
}
// exit OK
return 0;
}
Aggregations