Search in sources :

Example 1 with AlignmentWriter

use of eu.esdihumboldt.hale.common.align.io.AlignmentWriter in project hale by halestudio.

the class GenerateDefaults method writeAlignment.

private void writeAlignment() throws Exception {
    System.out.println("Writing alignment to " + context.getOut().getAbsolutePath());
    // create alignment writer
    IContentType contentType = HalePlatform.getContentTypeManager().getContentType(ALIGNMENT_CONTENT_TYPE);
    IOProviderDescriptor factory = HaleIO.findIOProviderFactory(AlignmentWriter.class, contentType, null);
    AlignmentWriter writer = (AlignmentWriter) factory.createExtensionObject();
    // configure alignment writer
    writer.setTargetSchema(new ResourceSchemaSpace().addSchema(resourceId, schema));
    writer.setTarget(new FileIOSupplier(context.getOut()));
    writer.setAlignment(alignment);
    IOReport report = writer.execute(new NullProgressIndicator());
    if (!report.isSuccess() || !report.getErrors().isEmpty()) {
        throw new IllegalStateException("Errors while writing the alignment.");
    } else {
        System.out.println("Completed successfully.");
    }
}
Also used : IOProviderDescriptor(eu.esdihumboldt.hale.common.core.io.extension.IOProviderDescriptor) ResourceSchemaSpace(eu.esdihumboldt.hale.common.schema.model.impl.ResourceSchemaSpace) IOReport(eu.esdihumboldt.hale.common.core.io.report.IOReport) NullProgressIndicator(eu.esdihumboldt.hale.common.core.io.impl.NullProgressIndicator) IContentType(org.eclipse.core.runtime.content.IContentType) FileIOSupplier(eu.esdihumboldt.hale.common.core.io.supplier.FileIOSupplier) AlignmentWriter(eu.esdihumboldt.hale.common.align.io.AlignmentWriter)

Example 2 with AlignmentWriter

use of eu.esdihumboldt.hale.common.align.io.AlignmentWriter in project hale by halestudio.

the class GenerateDuplicates method writeAlignment.

private void writeAlignment() throws Exception {
    System.out.println("Writing alignment to " + context.getOut().getAbsolutePath());
    // create alignment writer
    IContentType contentType = HalePlatform.getContentTypeManager().getContentType(ALIGNMENT_CONTENT_TYPE);
    IOProviderDescriptor factory = HaleIO.findIOProviderFactory(AlignmentWriter.class, contentType, null);
    AlignmentWriter writer = (AlignmentWriter) factory.createExtensionObject();
    // configure alignment writer
    writer.setSourceSchema(sourceSchema);
    writer.setTargetSchema(targetSchema);
    writer.setTarget(new FileIOSupplier(context.getOut()));
    writer.setAlignment(alignment);
    IOReport report = writer.execute(new NullProgressIndicator());
    if (!report.isSuccess() || !report.getErrors().isEmpty()) {
        throw new IllegalStateException("Errors while writing the alignment.");
    } else {
        System.out.println("Completed successfully.");
    }
}
Also used : IOProviderDescriptor(eu.esdihumboldt.hale.common.core.io.extension.IOProviderDescriptor) IOReport(eu.esdihumboldt.hale.common.core.io.report.IOReport) NullProgressIndicator(eu.esdihumboldt.hale.common.core.io.impl.NullProgressIndicator) IContentType(org.eclipse.core.runtime.content.IContentType) FileIOSupplier(eu.esdihumboldt.hale.common.core.io.supplier.FileIOSupplier) AlignmentWriter(eu.esdihumboldt.hale.common.align.io.AlignmentWriter)

Example 3 with AlignmentWriter

use of eu.esdihumboldt.hale.common.align.io.AlignmentWriter in project hale by halestudio.

the class CityGMLPropagate method writeAlignment.

private void writeAlignment() throws Exception {
    System.out.println("Writing alignment to " + context.getOut().getAbsolutePath());
    // create alignment writer
    IContentType contentType = HalePlatform.getContentTypeManager().getContentType(ALIGNMENT_CONTENT_TYPE);
    IOProviderDescriptor factory = HaleIO.findIOProviderFactory(AlignmentWriter.class, contentType, null);
    AlignmentWriter writer = (AlignmentWriter) factory.createExtensionObject();
    // configure alignment writer
    writer.setSourceSchema(sourceSchema);
    writer.setTargetSchema(targetSchema);
    writer.setTarget(new FileIOSupplier(context.getOut()));
    writer.setAlignment(alignment);
    IOReport report = writer.execute(new NullProgressIndicator());
    if (!report.isSuccess() || !report.getErrors().isEmpty()) {
        throw new IllegalStateException("Errors while writing the alignment.");
    } else {
        System.out.println("Completed successfully.");
    }
}
Also used : IOProviderDescriptor(eu.esdihumboldt.hale.common.core.io.extension.IOProviderDescriptor) IOReport(eu.esdihumboldt.hale.common.core.io.report.IOReport) NullProgressIndicator(eu.esdihumboldt.hale.common.core.io.impl.NullProgressIndicator) IContentType(org.eclipse.core.runtime.content.IContentType) FileIOSupplier(eu.esdihumboldt.hale.common.core.io.supplier.FileIOSupplier) AlignmentWriter(eu.esdihumboldt.hale.common.align.io.AlignmentWriter)

Aggregations

AlignmentWriter (eu.esdihumboldt.hale.common.align.io.AlignmentWriter)3 IOProviderDescriptor (eu.esdihumboldt.hale.common.core.io.extension.IOProviderDescriptor)3 NullProgressIndicator (eu.esdihumboldt.hale.common.core.io.impl.NullProgressIndicator)3 IOReport (eu.esdihumboldt.hale.common.core.io.report.IOReport)3 FileIOSupplier (eu.esdihumboldt.hale.common.core.io.supplier.FileIOSupplier)3 IContentType (org.eclipse.core.runtime.content.IContentType)3 ResourceSchemaSpace (eu.esdihumboldt.hale.common.schema.model.impl.ResourceSchemaSpace)1