Search in sources :

Example 1 with WorkspaceConfiguration

use of eu.esdihumboldt.hale.io.appschema.model.WorkspaceConfiguration in project hale by halestudio.

the class AbstractAppSchemaConfigurator method generateMapping.

/**
 * Uses a fresh {@link AppSchemaMappingGenerator} instance to generates the
 * mapping configuration based on the current provider's configuration
 * parameters.
 *
 * @param reporter the status reporter
 * @throws IOProviderConfigurationException if something is wrong with the
 *             provider configuration
 * @throws IOException if an error occurs loading the mapping template file
 */
public void generateMapping(IOReporter reporter) throws IOProviderConfigurationException, IOException {
    if (getAlignment() == null) {
        throw new IOProviderConfigurationException("No alignment was provided.");
    }
    if (getTargetSchema() == null) {
        throw new IOProviderConfigurationException("No target schema was provided.");
    }
    if (getTarget() == null) {
        throw new IOProviderConfigurationException("No target was provided.");
    }
    DataStore dataStoreParam = getDataStoreParameter();
    FeatureChaining featureChainingParam = getFeatureChainingParameter();
    // resolve property entity definitions here, could't do it on project
    // loading
    resolvePropertyTypes(featureChainingParam, getTargetSchema(), SchemaSpaceID.TARGET);
    WorkspaceConfiguration workspaceConfParam = getWorkspaceConfigurationParameter();
    generator = new AppSchemaMappingGenerator(getAlignment(), getTargetSchema(), dataStoreParam, featureChainingParam, workspaceConfParam);
    generator.generateMapping(reporter);
}
Also used : IOProviderConfigurationException(eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException) FeatureChaining(eu.esdihumboldt.hale.io.appschema.model.FeatureChaining) DataStore(eu.esdihumboldt.hale.io.appschema.impl.internal.generated.app_schema.SourceDataStoresPropertyType.DataStore) WorkspaceConfiguration(eu.esdihumboldt.hale.io.appschema.model.WorkspaceConfiguration)

Example 2 with WorkspaceConfiguration

use of eu.esdihumboldt.hale.io.appschema.model.WorkspaceConfiguration in project hale by halestudio.

the class AppSchemaIsolatedWorkspacesMappingTest method loadWorkspaceConf.

private WorkspaceConfiguration loadWorkspaceConf(String confResource) throws Exception {
    Element root = loadXmlResource(confResource);
    // read value object from XML
    WorkspaceConfiguration workspaceConf = HaleIO.getComplexValue(root, WorkspaceConfiguration.class, null);
    assertNotNull(workspaceConf);
    return workspaceConf;
}
Also used : Element(org.w3c.dom.Element) WorkspaceConfiguration(eu.esdihumboldt.hale.io.appschema.model.WorkspaceConfiguration)

Aggregations

WorkspaceConfiguration (eu.esdihumboldt.hale.io.appschema.model.WorkspaceConfiguration)2 IOProviderConfigurationException (eu.esdihumboldt.hale.common.core.io.IOProviderConfigurationException)1 DataStore (eu.esdihumboldt.hale.io.appschema.impl.internal.generated.app_schema.SourceDataStoresPropertyType.DataStore)1 FeatureChaining (eu.esdihumboldt.hale.io.appschema.model.FeatureChaining)1 Element (org.w3c.dom.Element)1