Revision c483dd7e
Added by Katja Luther over 9 years ago
cdm-pesi/src/main/java/eu/etaxonomy/cdm/app/pesi/FaunaEuropaeaActivator.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 |
*/ |
... | ... | |
39 | 39 |
|
40 | 40 |
static final Source faunaEuropaeaSource = PesiSources.mfn_faunEu_pesi3(); |
41 | 41 |
static final ICdmDataSource cdmDestination = CdmDestinations.cdm_test_local_faunaEu_mysql(); |
42 |
//static final ICdmDataSource cdmDestination = CdmDestinations.cdm_pesi_fauna_europaea(); |
|
43 |
|
|
42 | 44 |
|
43 |
|
|
44 | 45 |
static final int limitSave = 5000; |
45 | 46 |
|
46 | 47 |
// static final CHECK check = CHECK.CHECK_AND_IMPORT; |
... | ... | |
51 | 52 |
static final NomenclaturalCode nomenclaturalCode = NomenclaturalCode.ICZN; |
52 | 53 |
|
53 | 54 |
// ****************** ALL ***************************************** |
54 |
|
|
55 |
|
|
55 | 56 |
// Fauna Europaea to CDM import |
56 | 57 |
static final boolean doAuthors = true; |
57 | 58 |
static final boolean doTaxa = true; |
... | ... | |
64 | 65 |
static final boolean makeFeatureTree = true; |
65 | 66 |
// CDM to CDM import |
66 | 67 |
static final boolean doHeterotypicSynonymsForBasionyms = true; |
67 |
|
|
68 |
|
|
68 | 69 |
// ************************ NONE **************************************** // |
69 |
|
|
70 |
|
|
70 | 71 |
// Fauna Europaea to CDM import |
71 | 72 |
// static final boolean doAuthors = false; |
72 | 73 |
// static final boolean doTaxa = false; |
... | ... | |
79 | 80 |
// static final boolean makeFeatureTree = false; |
80 | 81 |
// // CDM to CDM import |
81 | 82 |
// static final boolean doHeterotypicSynonymsForBasionyms = false; |
82 |
|
|
83 |
|
|
83 |
|
|
84 |
|
|
84 | 85 |
/** |
85 | 86 |
* @param args |
86 | 87 |
*/ |
87 | 88 |
public static void main(String[] args) { |
88 |
|
|
89 |
|
|
89 | 90 |
ICdmDataSource destination = cdmDestination; |
90 | 91 |
System.out.println("Starting import from Fauna Europaea (" + faunaEuropaeaSource.getDatabase() + ") to CDM (" + destination.getDatabase() + ")..."); |
91 | 92 |
|
92 | 93 |
// invoke Fauna Europaea to CDM import |
93 |
|
|
94 |
FaunaEuropaeaImportConfigurator fauEuImportConfigurator =
|
|
94 |
|
|
95 |
FaunaEuropaeaImportConfigurator fauEuImportConfigurator = |
|
95 | 96 |
FaunaEuropaeaImportConfigurator.NewInstance(faunaEuropaeaSource, destination); |
96 |
|
|
97 |
|
|
97 | 98 |
fauEuImportConfigurator.setDbSchemaValidation(dbSchemaValidation); |
98 | 99 |
fauEuImportConfigurator.setNomenclaturalCode(nomenclaturalCode); |
99 | 100 |
fauEuImportConfigurator.setCheck(check); |
... | ... | |
108 | 109 |
fauEuImportConfigurator.setDoHeterotypicSynonyms(doHeterotypicSynonyms); |
109 | 110 |
fauEuImportConfigurator.setDoHeterotypicSynonymsForBasionyms(doHeterotypicSynonymsForBasionyms); |
110 | 111 |
fauEuImportConfigurator.setSourceRefUuid(PesiTransformer.uuidSourceRefFaunaEuropaea); |
111 |
|
|
112 |
CdmDefaultImport<FaunaEuropaeaImportConfigurator> fauEuImport =
|
|
112 |
|
|
113 |
CdmDefaultImport<FaunaEuropaeaImportConfigurator> fauEuImport = |
|
113 | 114 |
new CdmDefaultImport<FaunaEuropaeaImportConfigurator>(); |
114 | 115 |
try { |
115 | 116 |
fauEuImport.invoke(fauEuImportConfigurator); |
... | ... | |
119 | 120 |
} |
120 | 121 |
|
121 | 122 |
// invoke CDM to CDM import |
122 |
|
|
123 |
|
|
123 | 124 |
// System.out.println("Starting import from CDM to CDM (" + destination.getDatabase() + ")..."); |
124 |
//
|
|
125 |
// CdmImportConfigurator cdmImportConfigurator =
|
|
125 |
// |
|
126 |
// CdmImportConfigurator cdmImportConfigurator = |
|
126 | 127 |
// CdmImportConfigurator.NewInstance(destination, destination); |
127 |
//
|
|
128 |
// |
|
128 | 129 |
// cdmImportConfigurator.setDbSchemaValidation(DbSchemaValidation.VALIDATE); |
129 | 130 |
// cdmImportConfigurator.setNomenclaturalCode(nomenclaturalCode); |
130 | 131 |
// cdmImportConfigurator.setCheck(check); |
... | ... | |
136 | 137 |
// cdmImportConfigurator.setDoOccurrence(false); |
137 | 138 |
// cdmImportConfigurator.setLimitSave(limitSave); |
138 | 139 |
// |
139 |
// CdmDefaultImport<CdmImportConfigurator> cdmImport =
|
|
140 |
// CdmDefaultImport<CdmImportConfigurator> cdmImport = |
|
140 | 141 |
// new CdmDefaultImport<CdmImportConfigurator>(); |
141 | 142 |
// try { |
142 | 143 |
// cdmImport.invoke(cdmImportConfigurator); |
... | ... | |
144 | 145 |
// System.out.println("ERROR in CDM to CDM import"); |
145 | 146 |
// e.printStackTrace(); |
146 | 147 |
// } |
147 |
|
|
148 |
|
|
148 | 149 |
//make feature tree |
149 |
|
|
150 |
if (makeFeatureTree == true) {
|
|
150 |
|
|
151 |
if (makeFeatureTree) { |
|
151 | 152 |
FeatureTree featureTree = FeatureTree.NewInstance(UUID.fromString("ff59b9ad-1fb8-4aa4-a8ba-79d62123d0fb")); |
152 | 153 |
FeatureNode root = featureTree.getRoot(); |
153 | 154 |
|
... | ... | |
161 | 162 |
|
162 | 163 |
app.getFeatureTreeService().saveOrUpdate(featureTree); |
163 | 164 |
} |
164 |
|
|
165 |
|
|
165 | 166 |
System.out.println("End importing Fauna Europaea data"); |
166 | 167 |
} |
167 | 168 |
|
Also available in: Unified diff