Revision 6cb0766e
Added by Andreas Müller over 4 years ago
cdm-pesi/src/main/java/eu/etaxonomy/cdm/app/pesi/PesiExportActivatorFE.java | ||
---|---|---|
26 | 26 |
* @since 16.02.2010 |
27 | 27 |
*/ |
28 | 28 |
public class PesiExportActivatorFE { |
29 |
@SuppressWarnings("unused") |
|
29 |
|
|
30 | 30 |
private static final Logger logger = Logger.getLogger(PesiExportActivatorFE.class); |
31 | 31 |
|
32 | 32 |
//database validation status (create, update, validate ...) |
33 |
static final Source pesiDestination = PesiDestinations.pesi_test_local_CDM_FE2PESI(); |
|
34 |
// static final Source pesiDestination = PesiDestinations.pesi_test_local_CDM_ERMS2PESI();
|
|
33 |
// static final Source pesiDestination = PesiDestinations.pesi_test_local_CDM_FE2PESI();
|
|
34 |
static final Source pesiDestination = PesiDestinations.pesi_test_local_CDM_FE2PESI_2();
|
|
35 | 35 |
|
36 | 36 |
// static final ICdmDataSource cdmSource = CdmDestinations.cdm_test_local_faunaEu_mysql(); |
37 | 37 |
static final ICdmDataSource cdmSource = CdmDestinations.cdm_test_local_pesi_leer(); |
... | ... | |
41 | 41 |
boolean deleteAll = true; |
42 | 42 |
DO_REFERENCES doReferences = DO_REFERENCES.ALL; |
43 | 43 |
boolean doTaxa = true; |
44 |
static boolean doPureNames = true; //TODO does FE have pure names? => there is an exception during nameRel import |
|
44 | 45 |
boolean doTreeIndex = true; |
45 | 46 |
boolean doInferredSynonyms = false; //xx takes long, unclear what it does |
46 | 47 |
boolean doRelTaxa = true; |
47 | 48 |
boolean doAdditionalTaxonSource = true; |
48 | 49 |
boolean doDescriptions = true; |
49 |
boolean doEcologyAndLink = true; |
|
50 | 50 |
|
51 | 51 |
// ************************ NONE **************************************** // |
52 | 52 |
|
53 | 53 |
// boolean deleteAll = false; |
54 | 54 |
// static DO_REFERENCES doReferences = DO_REFERENCES.NONE; |
55 | 55 |
// boolean doTaxa = false; |
56 |
// static boolean doPureNames = false; //TODO does FE have pure names? => there is an exception during nameRel import |
|
56 | 57 |
// boolean doTreeIndex = doTaxa; //only with doTaxa |
57 | 58 |
// boolean doInferredSynonyms = false; //only with doTaxa |
58 | 59 |
// boolean doRelTaxa = false; |
59 | 60 |
// boolean doAdditionalTaxonSource = false; |
60 |
// boolean doDescriptions = false; |
|
61 |
// boolean doEcologyAndLink = doDescriptions; |
|
61 |
// boolean doDescriptions = true; |
|
62 | 62 |
|
63 |
static boolean doPureNames = false; //FE has no pure names; TODO test if true
|
|
63 |
boolean doEcologyAndLink = false; //FE does not have ecology and link data
|
|
64 | 64 |
|
65 | 65 |
//check - export |
66 | 66 |
static final CHECK check = CHECK.EXPORT_WITHOUT_CHECK; |
... | ... | |
69 | 69 |
static final int nameIdStart = 10000000; |
70 | 70 |
static final IdType idType = IdType.CDM_ID_WITH_EXCEPTIONS; |
71 | 71 |
|
72 |
static final int partitionSize = 1000; |
|
72 |
static final int partitionSize = 2000; |
|
73 |
static final int partitionSizeDescription = 200; |
|
74 |
|
|
73 | 75 |
|
74 | 76 |
public boolean doExport(ICdmDataSource source, Source destination){ |
77 |
logger.trace("Bind logger to pesi module"); |
|
75 | 78 |
System.out.println("Start export from " + source.getDatabase() + " to PESI ("+ pesiDestination.getDatabase() + ") ..."); |
76 | 79 |
|
77 | 80 |
PesiTransformer transformer = new PesiTransformer(destination); |
... | ... | |
98 | 101 |
|
99 | 102 |
config.setCheck(check); |
100 | 103 |
config.setLimitSave(partitionSize); |
104 |
config.setLimitSaveDescription(partitionSizeDescription); |
|
101 | 105 |
config.setIdType(idType); |
102 | 106 |
config.setNameIdStart(nameIdStart); |
103 | 107 |
if (deleteAll){ |
... | ... | |
116 | 120 |
PesiExportActivatorFE ex = new PesiExportActivatorFE(); |
117 | 121 |
ICdmDataSource source = CdmDestinations.chooseDestination(args) != null ? CdmDestinations.chooseDestination(args) : cdmSource; |
118 | 122 |
ex.doExport(source, pesiDestination); |
123 |
System.exit(0); |
|
119 | 124 |
} |
120 | 125 |
} |
Also available in: Unified diff
ref #8643 multiple changes to adapt FauEuPesiExport to current situation