Revision f3715fb4
Added by Patricia Kelbert about 10 years ago
app-import/src/main/java/eu/etaxonomy/cdm/app/synthesysImport/SynthesysSpecimenTestActivator.java | ||
---|---|---|
1 | 1 |
/** |
2 | 2 |
* Copyright (C) 2007 EDIT |
3 |
* European Distributed Institute of Taxonomy
|
|
3 |
* European Distributed Institute of Taxonomy |
|
4 | 4 |
* http://www.e-taxonomy.eu |
5 |
*
|
|
5 |
* |
|
6 | 6 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
7 | 7 |
* See LICENSE.TXT at the top of this package for the full license terms. |
8 | 8 |
*/ |
... | ... | |
16 | 16 |
|
17 | 17 |
import eu.etaxonomy.cdm.app.common.CdmDestinations; |
18 | 18 |
import eu.etaxonomy.cdm.app.common.CdmImportSources; |
19 |
import eu.etaxonomy.cdm.app.tcs.TcsSources; |
|
20 | 19 |
import eu.etaxonomy.cdm.database.DbSchemaValidation; |
21 | 20 |
import eu.etaxonomy.cdm.database.ICdmDataSource; |
22 | 21 |
import eu.etaxonomy.cdm.io.common.CdmDefaultImport; |
23 | 22 |
import eu.etaxonomy.cdm.io.common.IImportConfigurator.CHECK; |
24 | 23 |
import eu.etaxonomy.cdm.io.common.IImportConfigurator.DO_REFERENCES; |
25 |
import eu.etaxonomy.cdm.io.excel.taxa.NormalExplicitImportConfigurator; |
|
26 | 24 |
import eu.etaxonomy.cdm.io.specimen.excel.in.SpecimenSynthesysExcelImportConfigurator; |
27 |
import eu.etaxonomy.cdm.model.name.NomenclaturalCode; |
|
28 | 25 |
|
29 | 26 |
/** |
30 | 27 |
* @author a.mueller |
... | ... | |
33 | 30 |
*/ |
34 | 31 |
public class SynthesysSpecimenTestActivator { |
35 | 32 |
private static final Logger logger = Logger.getLogger(SynthesysSpecimenTestActivator.class); |
36 |
|
|
33 |
|
|
37 | 34 |
//database validation status (create, update, validate ...) |
38 | 35 |
static DbSchemaValidation hbm2dll = DbSchemaValidation.CREATE; |
39 | 36 |
// static final String mySources = TcsSources.taxonX_local(); |
... | ... | |
44 | 41 |
|
45 | 42 |
static final UUID treeUuid = UUID.fromString("190d9456-12e8-47a4-a235-bab36adb247c"); |
46 | 43 |
static final String sourceSecId = "TestSynthesysSpecimen"; |
47 |
|
|
44 |
|
|
48 | 45 |
//check - import |
49 | 46 |
static final CHECK check = CHECK.CHECK_AND_IMPORT; |
50 |
|
|
47 |
|
|
51 | 48 |
static final boolean doMatchTaxa = true; |
52 |
|
|
49 |
|
|
53 | 50 |
//references |
54 | 51 |
static final DO_REFERENCES doReferences = DO_REFERENCES.ALL; |
55 | 52 |
//names |
56 | 53 |
static final boolean doTaxonNames = true; |
57 | 54 |
static final boolean doRelNames = true; |
58 |
|
|
55 |
|
|
59 | 56 |
//taxa |
60 | 57 |
static final boolean doTaxa = true; |
61 | 58 |
static final boolean doRelTaxa = true; |
62 | 59 |
|
63 |
|
|
60 |
|
|
64 | 61 |
public void doImport(ICdmDataSource destination, DbSchemaValidation hbm2dll){ |
65 | 62 |
System.out.println("Start import from Tcs("+ mySource.toString() + ") ..."); |
66 |
|
|
67 |
SpecimenSynthesysExcelImportConfigurator config = SpecimenSynthesysExcelImportConfigurator.NewInstance(mySource, destination); |
|
68 |
|
|
63 |
|
|
64 |
SpecimenSynthesysExcelImportConfigurator config = SpecimenSynthesysExcelImportConfigurator.NewInstance(mySource, destination,false);
|
|
65 |
config.setInteractWithUser(false); |
|
69 | 66 |
config.setClassificationUuid(treeUuid); |
70 | 67 |
config.setSourceSecId(sourceSecId); |
71 |
|
|
68 |
|
|
72 | 69 |
// config.setDoReferences(doReferences); |
73 | 70 |
// config.setDoTaxonNames(doTaxonNames); |
74 |
//
|
|
71 |
// |
|
75 | 72 |
// config.setDoMatchTaxa(doMatchTaxa); |
76 | 73 |
// config.setDoTaxa(doTaxa); |
77 | 74 |
// config.setDoRelTaxa(doRelTaxa); |
78 |
|
|
75 |
|
|
79 | 76 |
config.setCheck(check); |
80 | 77 |
config.setDbSchemaValidation(hbm2dll); |
81 | 78 |
|
... | ... | |
83 | 80 |
CdmDefaultImport<SpecimenSynthesysExcelImportConfigurator> myImport = new CdmDefaultImport<SpecimenSynthesysExcelImportConfigurator>(); |
84 | 81 |
//new Test().invoke(tcsImportConfigurator); |
85 | 82 |
myImport.invoke(config); |
86 |
|
|
87 |
|
|
83 |
|
|
84 |
|
|
88 | 85 |
logger.info("End"); |
89 | 86 |
System.out.println("End import from Normal Explicit ("+ mySource.toString() + ")..."); |
90 |
|
|
87 |
|
|
91 | 88 |
} |
92 | 89 |
|
93 | 90 |
/** |
... | ... | |
97 | 94 |
SynthesysSpecimenTestActivator me = new SynthesysSpecimenTestActivator(); |
98 | 95 |
me.doImport(cdmDestination, hbm2dll); |
99 | 96 |
} |
100 |
|
|
97 |
|
|
101 | 98 |
} |
Also available in: Unified diff
reintegrate cdmlib-apps patricia into trunk