Revision 62117
Added by Michele Artini about 2 years ago
DataTransformerFactory.java | ||
---|---|---|
2 | 2 |
|
3 | 3 |
import javax.annotation.Resource; |
4 | 4 |
|
5 |
import org.springframework.beans.factory.annotation.Autowired; |
|
6 |
|
|
5 | 7 |
import eu.dnetlib.common.profile.ResourceDao; |
6 | 8 |
import eu.dnetlib.data.collective.transformation.VocabularyRegistry; |
7 | 9 |
import eu.dnetlib.data.collective.transformation.utils.TransformationRulesImportTool; |
10 |
import eu.dnetlib.enabling.datasources.common.Api; |
|
11 |
import eu.dnetlib.enabling.datasources.common.Datasource; |
|
12 |
import eu.dnetlib.enabling.datasources.common.LocalDatasourceManager; |
|
8 | 13 |
import eu.dnetlib.enabling.is.lookup.rmi.ISLookUpDocumentNotFoundException; |
9 | 14 |
import eu.dnetlib.enabling.is.lookup.rmi.ISLookUpException; |
10 | 15 |
|
... | ... | |
24 | 29 |
|
25 | 30 |
@Resource(name = "resourceDao") |
26 | 31 |
private ResourceDao resourceDao; |
27 |
|
|
32 |
|
|
28 | 33 |
@Resource(name = "blacklistApi") |
29 | 34 |
private org.springframework.core.io.Resource blacklistApi; |
30 | 35 |
|
36 |
@Autowired |
|
37 |
private LocalDatasourceManager<Datasource<?, ?, ?>, Api<?>> dsManager; |
|
38 |
|
|
31 | 39 |
public SimpleDataTransformer createTransformer(final String ruleid) throws ISLookUpDocumentNotFoundException, ISLookUpException { |
32 | 40 |
// String profile = lookupLocator.getService().getResourceProfile(ruleid); |
33 |
SimpleDataTransformer transformer = new SimpleDataTransformer(ruleid); |
|
41 |
final SimpleDataTransformer transformer = new SimpleDataTransformer(ruleid);
|
|
34 | 42 |
try { |
35 |
transformer.setupEngine(vocabularyRegistry, transformationTemplate, defaultSchema, transformationRuleProfileUtil, resourceDao, blacklistApi); |
|
36 |
} catch (Exception e) { |
|
43 |
transformer |
|
44 |
.setupEngine(vocabularyRegistry, transformationTemplate, defaultSchema, transformationRuleProfileUtil, resourceDao, blacklistApi, dsManager); |
|
45 |
} catch (final Exception e) { |
|
37 | 46 |
throw new IllegalStateException(e); |
38 | 47 |
} |
39 | 48 |
return transformer; |
Also available in: Unified diff
merge from eosc_services