Search in sources :

Example 16 with SchemaService

use of eu.esdihumboldt.hale.ui.service.schema.SchemaService in project hale by halestudio.

the class BaseAlignmentImportAdvisor method prepareProvider.

/**
 * @see eu.esdihumboldt.hale.common.core.io.impl.DefaultIOAdvisor#prepareProvider(eu.esdihumboldt.hale.common.core.io.IOProvider)
 */
@Override
public void prepareProvider(BaseAlignmentReader provider) {
    super.prepareProvider(provider);
    // XXX reader still needs MutableAlignment!
    SchemaService ss = getService(SchemaService.class);
    provider.setSourceSchema(ss.getSchemas(SchemaSpaceID.SOURCE));
    provider.setTargetSchema(ss.getSchemas(SchemaSpaceID.TARGET));
    ProjectService ps = getService(ProjectService.class);
    provider.setProjectLocation(ps.getLoadLocation());
}
Also used : SchemaService(eu.esdihumboldt.hale.ui.service.schema.SchemaService) ProjectService(eu.esdihumboldt.hale.ui.service.project.ProjectService)

Example 17 with SchemaService

use of eu.esdihumboldt.hale.ui.service.schema.SchemaService in project hale by halestudio.

the class InstanceExportAdvisor method prepareProvider.

/**
 * @see IOAdvisor#prepareProvider(IOProvider)
 */
@Override
public void prepareProvider(InstanceWriter provider) {
    super.prepareProvider(provider);
    // set target schema
    SchemaService ss = getService(SchemaService.class);
    provider.setTargetSchema(ss.getSchemas(SchemaSpaceID.TARGET));
    // set instances to export
    InstanceService is = getService(InstanceService.class);
    provider.setInstances(is.getInstances(DataSet.TRANSFORMED));
}
Also used : SchemaService(eu.esdihumboldt.hale.ui.service.schema.SchemaService) InstanceService(eu.esdihumboldt.hale.ui.service.instance.InstanceService)

Example 18 with SchemaService

use of eu.esdihumboldt.hale.ui.service.schema.SchemaService in project hale by halestudio.

the class InstanceImportAdvisor method prepareProvider.

/**
 * @see IOAdvisor#prepareProvider(IOProvider)
 */
@Override
public void prepareProvider(InstanceReader provider) {
    super.prepareProvider(provider);
    SchemaService ss = getService(SchemaService.class);
    provider.setSourceSchema(ss.getSchemas(SchemaSpaceID.SOURCE));
}
Also used : SchemaService(eu.esdihumboldt.hale.ui.service.schema.SchemaService)

Example 19 with SchemaService

use of eu.esdihumboldt.hale.ui.service.schema.SchemaService in project hale by halestudio.

the class SchemaImportAdvisor method handleResults.

/**
 * @see IOAdvisor#handleResults(IOProvider)
 */
@Override
public void handleResults(SchemaReader provider) {
    // add loaded schema to schema space
    Schema schema = provider.getSchema();
    SchemaService ss = getService(SchemaService.class);
    ss.addSchema(schema, spaceID);
    if (ss.getSchemas(spaceID).getMappingRelevantTypes().isEmpty()) {
        // if no types are present after loading, open editor for mapping
        // relevant types
        ss.editMappableTypes(spaceID);
    }
    super.handleResults(provider);
}
Also used : SchemaService(eu.esdihumboldt.hale.ui.service.schema.SchemaService) Schema(eu.esdihumboldt.hale.common.schema.model.Schema)

Example 20 with SchemaService

use of eu.esdihumboldt.hale.ui.service.schema.SchemaService in project hale by halestudio.

the class SchemaImportAdvisor method prepareProvider.

/**
 * @see IOAdvisor#prepareProvider(IOProvider)
 */
@Override
public void prepareProvider(SchemaReader provider) {
    super.prepareProvider(provider);
    provider.setSchemaSpace(spaceID);
    // set shared types XXX this is not fixed yet
    SchemaService ss = getService(SchemaService.class);
    provider.setSharedTypes(ss.getSchemas(spaceID));
}
Also used : SchemaService(eu.esdihumboldt.hale.ui.service.schema.SchemaService)

Aggregations

SchemaService (eu.esdihumboldt.hale.ui.service.schema.SchemaService)29 TypeDefinition (eu.esdihumboldt.hale.common.schema.model.TypeDefinition)8 TypeEntityDefinition (eu.esdihumboldt.hale.common.align.model.impl.TypeEntityDefinition)4 SchemaSpace (eu.esdihumboldt.hale.common.schema.model.SchemaSpace)3 ProjectService (eu.esdihumboldt.hale.ui.service.project.ProjectService)3 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)3 EntityDefinition (eu.esdihumboldt.hale.common.align.model.EntityDefinition)2 XmlElement (eu.esdihumboldt.hale.io.xsd.model.XmlElement)2 StyledDefinitionLabelProvider (eu.esdihumboldt.hale.ui.common.definition.viewer.StyledDefinitionLabelProvider)2 AlignmentService (eu.esdihumboldt.hale.ui.service.align.AlignmentService)2 EntityDefinitionService (eu.esdihumboldt.hale.ui.service.entity.EntityDefinitionService)2 EntityTypeIndexContentProvider (eu.esdihumboldt.hale.ui.service.entity.util.EntityTypeIndexContentProvider)2 EntityTypeIndexHierarchy (eu.esdihumboldt.hale.ui.service.entity.util.EntityTypeIndexHierarchy)2 TreePathProviderAdapter (eu.esdihumboldt.hale.ui.util.viewer.tree.TreePathProviderAdapter)2 QName (javax.xml.namespace.QName)2 StructuredSelection (org.eclipse.jface.viewers.StructuredSelection)2 GridData (org.eclipse.swt.layout.GridData)2 Label (org.eclipse.swt.widgets.Label)2 EntityAccessor (eu.esdihumboldt.hale.common.align.groovy.accessor.EntityAccessor)1 Alignment (eu.esdihumboldt.hale.common.align.model.Alignment)1