Revision 307c8d15
Added by Andreas Müller about 4 years ago
cdm-pesi/src/main/java/eu/etaxonomy/cdm/app/pesi/merging/FaunaEuErmsFindIdenticalNamesActivator.java | ||
---|---|---|
9 | 9 |
|
10 | 10 |
import eu.etaxonomy.cdm.api.application.CdmApplicationController; |
11 | 11 |
import eu.etaxonomy.cdm.app.common.CdmDestinations; |
12 |
import eu.etaxonomy.cdm.app.common.TestDatabase; |
|
13 | 12 |
import eu.etaxonomy.cdm.database.DbSchemaValidation; |
14 | 13 |
import eu.etaxonomy.cdm.database.ICdmDataSource; |
15 | 14 |
import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper; |
cdm-pesi/src/main/java/eu/etaxonomy/cdm/io/pesi/erms/ErmsImportBase.java | ||
---|---|---|
410 | 410 |
if ((count % recordsPerLog ) == 0 && count!= 0 ){ logger.info(pluralString + " handled: " + (count));} |
411 | 411 |
} |
412 | 412 |
|
413 |
|
|
414 |
|
|
415 |
|
|
416 | 413 |
} |
cdm-pesi/src/main/java/eu/etaxonomy/cdm/io/pesi/erms/ErmsImportState.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 |
*/ |
... | ... | |
24 | 24 |
/** |
25 | 25 |
* @author a.mueller |
26 | 26 |
* @since 11.05.2009 |
27 |
* @version 1.0 |
|
28 | 27 |
*/ |
29 | 28 |
public class ErmsImportState extends DbImportStateBase<ErmsImportConfigurator, ErmsImportState>{ |
30 | 29 |
@SuppressWarnings("unused") |
31 | 30 |
private static final Logger logger = Logger.getLogger(ErmsImportState.class); |
32 | 31 |
|
33 |
private Map<String, DefinedTermBase> dbCdmDefTermMap = new HashMap<String, DefinedTermBase>();
|
|
34 |
|
|
35 |
private Map<String, User> usernameMap = new HashMap<String, User>();
|
|
36 |
|
|
32 |
private Map<String, DefinedTermBase> dbCdmDefTermMap = new HashMap<>(); |
|
33 |
|
|
34 |
private Map<String, User> usernameMap = new HashMap<>(); |
|
35 |
|
|
37 | 36 |
private Map<Integer, Map<Integer,Rank>> rankMap; |
38 |
|
|
37 |
|
|
39 | 38 |
private Set<Integer> acceptedTaxaKeys; |
40 |
|
|
41 |
/* (non-Javadoc) |
|
42 |
* @see eu.etaxonomy.cdm.io.common.IoStateBase#initialize(eu.etaxonomy.cdm.io.common.IoConfiguratorBase) |
|
43 |
*/ |
|
39 |
|
|
44 | 40 |
@Override |
45 | 41 |
public void initialize(ErmsImportConfigurator config) { |
46 | 42 |
// super(config); |
... | ... | |
56 | 52 |
public Map<String, DefinedTermBase> getDbCdmDefinedTermMap(){ |
57 | 53 |
return this.dbCdmDefTermMap; |
58 | 54 |
} |
59 |
|
|
55 |
|
|
60 | 56 |
public void putDefinedTermToMap(String tableName, String id, DefinedTermBase term){ |
61 | 57 |
this.dbCdmDefTermMap.put(tableName + "_" + id, term); |
62 | 58 |
} |
63 |
|
|
59 |
|
|
64 | 60 |
public void putDefinedTermToMap(String tableName, int id, DefinedTermBase term){ |
65 | 61 |
putDefinedTermToMap(tableName, String.valueOf(id), term); |
66 | 62 |
} |
67 |
|
|
68 |
public User getUser(String username){ |
|
63 |
|
|
64 |
@Override |
|
65 |
public User getUser(String username){ |
|
69 | 66 |
return usernameMap.get(username); |
70 | 67 |
} |
71 | 68 |
|
72 |
public void putUser(String username, User user){ |
|
69 |
@Override |
|
70 |
public void putUser(String username, User user){ |
|
73 | 71 |
usernameMap.put(username, user); |
74 | 72 |
} |
75 | 73 |
|
... | ... | |
80 | 78 |
this.rankMap = rankMap; |
81 | 79 |
} |
82 | 80 |
|
83 |
// /** |
|
84 |
// * @return the rankMap |
|
85 |
// */ |
|
86 |
// public Map<Integer, Map<Integer,Rank>> getRankMap() { |
|
87 |
// return rankMap; |
|
88 |
// } |
|
89 |
|
|
90 |
|
|
81 |
|
|
91 | 82 |
/** |
92 | 83 |
* Returns the CDM rank depending on the ERMS rankId and the ERMS kingdomId. Returns <code> |
93 | 84 |
* null</code> if the rank does not exist. |
... | ... | |
121 | 112 |
this.acceptedTaxaKeys = acceptedTaxaKeys; |
122 | 113 |
} |
123 | 114 |
|
124 |
|
|
115 |
|
|
125 | 116 |
} |
cdm-pesi/src/main/java/eu/etaxonomy/cdm/io/pesi/erms/ErmsTaxonRelationImport.java | ||
---|---|---|
58 | 58 |
@Override |
59 | 59 |
protected DbImportMapping<ErmsImportState, ErmsImportConfigurator> getMapping() { |
60 | 60 |
if (mapping == null){ |
61 |
mapping = new DbImportMapping<ErmsImportState, ErmsImportConfigurator>();
|
|
61 |
mapping = new DbImportMapping<>(); |
|
62 | 62 |
|
63 | 63 |
mapping.addMapper(DbImportTaxIncludedInMapper.NewInstance("id", TAXON_NAMESPACE, "parentId", TAXON_NAMESPACE, "accParentId", TAXON_NAMESPACE, null));//there is only one tree |
64 | 64 |
|
cdm-pesi/src/main/java/eu/etaxonomy/cdm/io/pesi/erms/ErmsTransformer.java | ||
---|---|---|
110 | 110 |
public static final UUID uuidIsraeliExclusiveEconomicZoneMediterranean = UUID.fromString("d947e1c1-6d7b-47e1-ad91-703d15c5c55b"); |
111 | 111 |
public static final UUID uuidPolishExclusiveEconomicZone = UUID.fromString("dc7f8339-528b-49ec-a8d9-c2be0441e933"); |
112 | 112 |
|
113 |
|
|
114 |
|
|
115 | 113 |
//feature uuids |
116 | 114 |
public static final UUID uuidRemark = UUID.fromString("648eab77-8469-4139-bbf4-3fb26ec15864"); |
117 | 115 |
public static final UUID uuidAdditionalinformation = UUID.fromString("ef00c304-ce33-45ef-9543-0b9336a2b6eb"); |
... | ... | |
202 | 200 |
|
203 | 201 |
} |
204 | 202 |
|
205 |
|
|
206 |
|
|
207 |
|
|
208 |
/* (non-Javadoc) |
|
209 |
* @see eu.etaxonomy.cdm.io.common.mapping.InputTransformerBase#getNameTypeDesignationStatusByKey(java.lang.String) |
|
210 |
*/ |
|
211 | 203 |
@Override |
212 | 204 |
public NameTypeDesignationStatus getNameTypeDesignationStatusByKey(String key) throws UndefinedTransformerMethodException { |
213 | 205 |
if (key == null){ |
... | ... | |
225 | 217 |
} |
226 | 218 |
} |
227 | 219 |
|
228 |
|
|
229 |
|
|
230 |
|
|
231 |
/* (non-Javadoc) |
|
232 |
* @see eu.etaxonomy.cdm.io.common.mapping.InputTransformerBase#getNameTypeDesignationStatusUuid(java.lang.String) |
|
233 |
*/ |
|
234 | 220 |
@Override |
235 | 221 |
public UUID getNameTypeDesignationStatusUuid(String key) throws UndefinedTransformerMethodException { |
236 | 222 |
//nott needed |
237 | 223 |
return super.getNameTypeDesignationStatusUuid(key); |
238 | 224 |
} |
239 | 225 |
|
240 |
|
|
241 | 226 |
@Override |
242 | 227 |
public Language getLanguageByKey(String ermsAbbrev) throws IllegalArgumentException { |
243 |
Set<String> unhandledLanguages = new HashSet<String>();
|
|
228 |
Set<String> unhandledLanguages = new HashSet<>(); |
|
244 | 229 |
if (StringUtils.isBlank(ermsAbbrev)){return null; |
245 | 230 |
}else if (ermsAbbrev.equals("ab")){return Language.ALBANIAN(); |
246 | 231 |
}else if (ermsAbbrev.equals("af")){return Language.AFRIKAANS(); |
... | ... | |
394 | 379 |
} |
395 | 380 |
} |
396 | 381 |
|
397 |
/* (non-Javadoc) |
|
398 |
* @see eu.etaxonomy.cdm.io.common.mapping.InputTransformerBase#getLanguageUuid(java.lang.String) |
|
399 |
*/ |
|
400 | 382 |
@Override |
401 | 383 |
public UUID getLanguageUuid(String key) throws UndefinedTransformerMethodException { |
402 | 384 |
if (key == null){ |
... | ... | |
423 | 405 |
return super.getLanguageUuid(key); |
424 | 406 |
} |
425 | 407 |
|
426 |
|
|
427 |
|
|
428 |
/* (non-Javadoc) |
|
429 |
* @see eu.etaxonomy.cdm.io.common.mapping.InputTransformerBase#getExtensionTypeByKey(java.lang.String) |
|
430 |
*/ |
|
431 | 408 |
@Override |
432 | 409 |
public ExtensionType getExtensionTypeByKey(String key) throws UndefinedTransformerMethodException { |
433 | 410 |
if (key == null){return null; |
... | ... | |
435 | 412 |
return null; |
436 | 413 |
} |
437 | 414 |
|
438 |
/* (non-Javadoc) |
|
439 |
* @see eu.etaxonomy.cdm.io.common.mapping.InputTransformerBase#getExtensionTypeUuid(java.lang.String) |
|
440 |
*/ |
|
441 | 415 |
@Override |
442 | 416 |
public UUID getExtensionTypeUuid(String key) |
443 | 417 |
throws UndefinedTransformerMethodException { |
... | ... | |
517 | 491 |
} |
518 | 492 |
} |
519 | 493 |
|
520 |
|
|
521 | 494 |
public static UUID uuidFromGuId(Integer guId){ |
522 | 495 |
if (guId == null){return null; |
523 | 496 |
}else if (guId == 7788){ return uuidEuropeanMarineWaters; |
... | ... | |
575 | 548 |
}else{ |
576 | 549 |
throw new IllegalArgumentException("Unknown area id " + guId); |
577 | 550 |
} |
578 |
|
|
579 | 551 |
} |
580 | 552 |
|
581 | 553 |
public static Feature noteType2Feature(String type){ |
Also available in: Unified diff
cleanup some ERMS imports