Revision 495cebda
Added by Andreas Müller about 11 years ago
app-import/src/main/java/eu/etaxonomy/cdm/io/globis/GlobisImportBase.java | ||
---|---|---|
37 | 37 |
import eu.etaxonomy.cdm.model.common.IdentifiableEntity; |
38 | 38 |
import eu.etaxonomy.cdm.model.common.Language; |
39 | 39 |
import eu.etaxonomy.cdm.model.common.User; |
40 |
import eu.etaxonomy.cdm.model.location.NamedArea; |
|
40 | 41 |
import eu.etaxonomy.cdm.model.location.WaterbodyOrCountry; |
41 | 42 |
import eu.etaxonomy.cdm.model.name.ZoologicalName; |
42 | 43 |
import eu.etaxonomy.cdm.strategy.exceptions.StringNotParsableException; |
... | ... | |
58 | 59 |
protected static final String REFERENCE_NAMESPACE = "Literatur"; |
59 | 60 |
protected static final String TAXON_NAMESPACE = "current_species"; |
60 | 61 |
protected static final String COLLECTION_NAMESPACE = "Collection"; |
62 |
protected static final String IMAGE_NAMESPACE = "Einzelbilder"; |
|
63 |
protected static final String SPEC_TAX_NAMESPACE = "specTax"; |
|
64 |
protected static final String TYPE_NAMESPACE = "specTax.SpecTypeDepository"; |
|
61 | 65 |
|
62 | 66 |
private String pluralString; |
63 | 67 |
private String dbTableName; |
... | ... | |
87 | 91 |
|
88 | 92 |
int recordsPerTransaction = config.getRecordsPerTransaction(); |
89 | 93 |
try{ |
90 |
ResultSetPartitioner partitioner = ResultSetPartitioner.NewInstance(source, strIdQuery, strRecordQuery, recordsPerTransaction); |
|
94 |
ResultSetPartitioner<GlobisImportState> partitioner = ResultSetPartitioner.NewInstance(source, strIdQuery, strRecordQuery, recordsPerTransaction);
|
|
91 | 95 |
while (partitioner.nextPartition()){ |
92 | 96 |
partitioner.doPartition(this, state); |
93 | 97 |
} |
... | ... | |
104 | 108 |
* @param authorAndYear |
105 | 109 |
* @param zooName |
106 | 110 |
*/ |
107 |
protected void handleAuthorAndYear(String authorAndYear, ZoologicalName zooName) { |
|
111 |
protected void handleAuthorAndYear(String authorAndYear, ZoologicalName zooName, Integer id) {
|
|
108 | 112 |
if (isBlank(authorAndYear)){ |
109 | 113 |
return; |
110 | 114 |
} |
... | ... | |
117 | 121 |
if (authorAndYear.contains("?")){ |
118 | 122 |
authorAndYear = authorAndYear.replace("H?bner", "H\u00fcbner"); |
119 | 123 |
authorAndYear = authorAndYear.replace("Oberth?r", "Oberth\u00fcr"); |
124 |
authorAndYear = authorAndYear.replace("M?n?tri?s","M\u00E9n\u00E9tri\u00E9s"); |
|
125 |
authorAndYear = authorAndYear.replace("Schifferm?ller","Schifferm\u00fcller"); |
|
126 |
|
|
120 | 127 |
//TODO remove |
121 | 128 |
authorAndYear = authorAndYear.replace("?", ""); |
122 | 129 |
|
... | ... | |
128 | 135 |
} |
129 | 136 |
|
130 | 137 |
} catch (StringNotParsableException e) { |
131 |
logger.warn("Author could not be parsed: " + authorAndYear); |
|
138 |
logger.warn("Author could not be parsed: " + authorAndYear + " for id " +id);
|
|
132 | 139 |
zooName.setAuthorshipCache(authorAndYear, true); |
133 | 140 |
} |
134 | 141 |
} |
... | ... | |
139 | 146 |
* @param countryStr |
140 | 147 |
* @return |
141 | 148 |
*/ |
142 |
protected WaterbodyOrCountry getCountry(GlobisImportState state, String countryStr) {
|
|
143 |
WaterbodyOrCountry country = WaterbodyOrCountry.getWaterbodyOrCountryByLabel(countryStr);
|
|
149 |
protected NamedArea getCountry(GlobisImportState state, String countryStr) {
|
|
150 |
NamedArea country = WaterbodyOrCountry.getWaterbodyOrCountryByLabel(countryStr);
|
|
144 | 151 |
if (country == null){ |
145 | 152 |
try { |
146 |
country = (WaterbodyOrCountry)state.getTransformer().getNamedAreaByKey(countryStr);
|
|
153 |
country = (NamedArea)state.getTransformer().getNamedAreaByKey(countryStr);
|
|
147 | 154 |
} catch (UndefinedTransformerMethodException e) { |
148 | 155 |
e.printStackTrace(); |
149 | 156 |
} |
Also available in: Unified diff
updates to globis import