Revision 8e00239d
Added by Andreas Müller over 4 years ago
cdm-pesi/src/main/java/eu/etaxonomy/cdm/app/pesi/PesiExportActivatorIF.java | ||
---|---|---|
24 | 24 |
* @author a.mueller |
25 | 25 |
* @author e.-m.lee |
26 | 26 |
* @since 16.02.2010 |
27 |
* |
|
28 | 27 |
*/ |
29 | 28 |
public class PesiExportActivatorIF { |
30 | 29 |
@SuppressWarnings("unused") |
31 | 30 |
private static final Logger logger = Logger.getLogger(PesiExportActivatorIF.class); |
32 | 31 |
|
33 |
//database validation status (create, update, validate ...) |
|
34 |
static final Source pesiDestination = PesiDestinations.pesi_test_local_CDM_IF2PESI(); |
|
35 |
|
|
36 | 32 |
static final ICdmDataSource cdmSource = CdmDestinations.cdm_test_local_indexFungorum(); |
37 |
// static final ICdmDataSource cdmSource = CdmDestinations.cdm_test_local_mysql_test(); |
|
33 |
static final Source pesiDestination = PesiDestinations.pesi_test_local_CDM_IF2PESI(); |
|
34 |
// static final Source pesiDestination = PesiDestinations.pesi_test_local_CDM_IF2PESI_2(); |
|
38 | 35 |
|
39 |
static final int partitionSize = 2000; |
|
40 | 36 |
|
37 |
static final IdType idType = IdType.CDM_ID; |
|
41 | 38 |
//check - export |
42 | 39 |
static final CHECK check = CHECK.EXPORT_WITHOUT_CHECK; |
40 |
static final int partitionSize = 2000; |
|
43 | 41 |
|
44 |
static final boolean deleteAll = true;
|
|
42 |
// ****************** ALL *****************************************
|
|
45 | 43 |
|
46 |
static final IdType idType = IdType.CDM_ID; |
|
44 |
boolean deleteAll = true; |
|
45 |
DO_REFERENCES doReferences = DO_REFERENCES.ALL; |
|
46 |
boolean doTaxa = true; |
|
47 |
boolean doRelTaxa = true; |
|
48 |
boolean doDescriptions = true; |
|
47 | 49 |
|
48 |
// ****************** ALL ***************************************** |
|
50 |
boolean doTreeIndex = doTaxa; |
|
51 |
boolean doParentAndBiota = doTaxa; |
|
49 | 52 |
|
50 |
//references |
|
51 |
static final DO_REFERENCES doReferences = DO_REFERENCES.ALL; |
|
52 |
|
|
53 |
//taxa |
|
54 |
static final boolean doTaxa = true; |
|
55 |
static final boolean doRelTaxa = true; |
|
56 |
static final boolean doNotes = true; |
|
57 |
static final boolean doNoteSources = true; |
|
58 |
static final boolean doAdditionalTaxonSource = true; |
|
59 |
static final boolean doOccurrence = true; |
|
60 |
static final boolean doOccurrenceSource = true; |
|
61 |
static final boolean doImage = true; |
|
62 |
static final boolean doTreeIndex = true; |
|
63 |
static final boolean doRank = true; |
|
64 |
static final boolean doInferredSynonyms = false; |
|
65 |
static final boolean doPureNames = false; // !!! |
|
66 |
static final boolean doDescription = true; |
|
53 |
boolean doPureNames = false; //!! |
|
54 |
boolean doAdditionalTaxonSource = true; //existing?? |
|
55 |
boolean doInferredSynonyms = false; //no inferred synonyms in IF |
|
56 |
boolean doEcologyAndLink = false; //do not exist in IF |
|
67 | 57 |
|
68 | 58 |
|
69 | 59 |
// ************************ NONE **************************************** // |
70 | 60 |
|
71 |
// //references |
|
72 |
// static final DO_REFERENCES doReferences = DO_REFERENCES.NONE; |
|
61 |
// boolean deleteAll = false; |
|
62 |
// DO_REFERENCES doReferences = DO_REFERENCES.NONE; |
|
63 |
// boolean doTaxa = false; |
|
64 |
// boolean doRelTaxa = false; |
|
65 |
// boolean doDescriptions = false; |
|
73 | 66 |
// |
74 |
// //taxa |
|
75 |
// static final boolean doTaxa = false; |
|
76 |
// static final boolean doRelTaxa = false; |
|
77 |
// static final boolean doNotes = false; |
|
78 |
// static final boolean doNoteSources = false; |
|
79 |
// static final boolean doAdditionalTaxonSource = false; |
|
80 |
// static final boolean doOccurrence = false; |
|
81 |
// static final boolean doOccurrenceSource = false; |
|
82 |
// static final boolean doImage = false; |
|
83 |
// static final boolean doTreeIndex = true; |
|
84 |
// static final boolean doRank = true; |
|
85 |
// static final boolean doInferredSynonyms = true; |
|
86 |
// static final boolean doDescription = false; |
|
67 |
// boolean doTreeIndex = doTaxa; |
|
68 |
// boolean doParentAndBiota = doTaxa; |
|
69 |
// |
|
70 |
// boolean doPureNames = false; //!! |
|
71 |
// boolean doAdditionalTaxonSource = false; //existing?? |
|
72 |
// boolean doInferredSynonyms = false; //no inferred synonyms in IF |
|
73 |
// boolean doEcologyAndLink = false; //do not exist in IF |
|
87 | 74 |
|
88 | 75 |
|
89 | 76 |
public boolean doExport(ICdmDataSource source){ |
... | ... | |
95 | 82 |
|
96 | 83 |
PesiExportConfigurator config = PesiExportConfigurator.NewInstance(destination, source, transformer); |
97 | 84 |
|
85 |
config.setDoReferences(doReferences); |
|
98 | 86 |
config.setDoTaxa(doTaxa); |
99 | 87 |
config.setDoRelTaxa(doRelTaxa); |
100 |
config.setDoOccurrence(doOccurrence); |
|
101 |
config.setDoReferences(doReferences); |
|
102 |
config.setDoImages(doImage); |
|
103 |
config.setDoNotes(doNotes); |
|
104 |
config.setDoNoteSources(doNoteSources); |
|
105 |
config.setDoOccurrenceSource(doOccurrenceSource); |
|
88 |
config.setDoParentAndBiota(doParentAndBiota); |
|
106 | 89 |
config.setDoTreeIndex(doTreeIndex); |
107 | 90 |
config.setDoInferredSynonyms(doInferredSynonyms); |
108 | 91 |
config.setDoPureNames(doPureNames); |
109 |
config.setDoDescription(doDescription); |
|
92 |
config.setDoDescription(doDescriptions); |
|
93 |
config.setDoAdditionalTaxonSource(doAdditionalTaxonSource); |
|
94 |
config.setDoEcologyAndLink(doEcologyAndLink); |
|
110 | 95 |
|
111 | 96 |
config.setCheck(check); |
112 | 97 |
config.setLimitSave(partitionSize); |
... | ... | |
116 | 101 |
} |
117 | 102 |
|
118 | 103 |
// invoke export |
119 |
CdmDefaultExport<PesiExportConfigurator> pesiExport = new CdmDefaultExport<PesiExportConfigurator>();
|
|
104 |
CdmDefaultExport<PesiExportConfigurator> pesiExport = new CdmDefaultExport<>(); |
|
120 | 105 |
|
121 |
boolean result = pesiExport.invoke(config).isSuccess();
|
|
106 |
boolean result = pesiExport.invoke(config).isSuccess(); |
|
122 | 107 |
|
123 | 108 |
System.out.println("End export to PESI ("+ destination.getDatabase() + ")..." + (result? "(successful)":"(with errors)")); |
124 | 109 |
return result; |
Also available in: Unified diff
ref #8587 adapt IF exporter