\r
public static final String OS_NAMESPACE_TAXON = "Taxon";\r
private static final Logger logger = Logger.getLogger(FaunaEuropaeaRelTaxonIncludeImport.class);\r
+ private static final String acceptedTaxonUUID = "A9C24E42-69F5-4681-9399-041E652CF338"; // any accepted taxon uuid, taken from original fauna europaea database\r
\r
+ private ReferenceBase<?> sourceRef;\r
private static String ALL_SYNONYM_FROM_CLAUSE = " FROM Taxon INNER JOIN Taxon AS Parent " +\r
" ON Taxon.TAX_TAX_IDPARENT = Parent.TAX_ID " +\r
" WHERE (Taxon.TAX_VALID = 0) " +\r
boolean success = true;\r
\r
Map<String, MapWrapper<? extends CdmBase>> stores = state.getStores();\r
- MapWrapper<TaxonBase> taxonStore = (MapWrapper<TaxonBase>)stores.get(ICdmIO.TAXON_STORE);\r
-// taxonStore.makeEmpty();\r
- taxonStore = null;\r
+\r
MapWrapper<TeamOrPersonBase> authorStore = (MapWrapper<TeamOrPersonBase>)stores.get(ICdmIO.TEAM_STORE);\r
authorStore.makeEmpty();\r
\r
\r
TransactionStatus txStatus = startTransaction();\r
\r
- TaxonBase taxon = getTaxonService().find(UUID.fromString("ac7b30dc-6207-4c71-9752-ee0fb838a271"));\r
- ReferenceBase<?> sourceRef = taxon.getSec();\r
+ // the uuid of an accepted taxon is needed here. any accepted taxon will do.\r
+ TaxonBase taxon = getTaxonService().find(UUID.fromString(acceptedTaxonUUID));\r
+ sourceRef = taxon.getSec();\r
\r
TaxonomicTree tree = getTaxonomicTreeFor(state, sourceRef);\r
commitTransaction(txStatus);\r
\r
- ProfilerController.memorySnapshot();\r
+ //ProfilerController.memorySnapshot();\r
if (state.getConfig().isDoTaxonomicallyIncluded()) {\r
success = processParentsChildren(state);\r
}\r
- ProfilerController.memorySnapshot();\r
+ //ProfilerController.memorySnapshot();\r
if (state.getConfig().isDoMisappliedNames()) {\r
success = processMisappliedNames(state);\r
}\r
- ProfilerController.memorySnapshot();\r
+ //ProfilerController.memorySnapshot();\r
if (state.getConfig().isDoHeterotypicSynonyms()) {\r
if(logger.isInfoEnabled()) { \r
logger.info("Start making heterotypic synonym relationships..."); \r
}\r
success = processHeterotypicSynonyms(state, ALL_SYNONYM_FROM_CLAUSE);\r
}\r
- ProfilerController.memorySnapshot();\r
+ //ProfilerController.memorySnapshot();\r
\r
logger.info("End making taxa...");\r
\r
}\r
return success; \r
}\r
-\r
\r
+\r
/** Retrieve misapplied name / accepted taxon uuid map from CDM DB */\r
private boolean processMisappliedNames(FaunaEuropaeaImportState state) {\r
\r
}\r
\r
\r
+\r
/** Retrieve synonyms from FauEuDB DB */\r
private boolean processHeterotypicSynonyms(FaunaEuropaeaImportState state, String fromClause) {\r
\r
}\r
return success; \r
}\r
+ \r
+ \r
\r
\r
private boolean storeSynonymRelationships(ResultSet rs, int count, FaunaEuropaeaImportState state) \r
}\r
\r
\r
+ \r
+ \r
+\r
/* Creates parent-child relationships.\r
* Parent-child pairs are retrieved in blocks via findByUUID(Set<UUID>) from CDM DB. \r
*/\r
private boolean createParentChildRelationships(FaunaEuropaeaImportState state, Map<UUID, UUID> childParentMap) {\r
-\r
- TaxonBase taxon = getTaxonService().find(UUID.fromString("ac7b30dc-6207-4c71-9752-ee0fb838a271"));\r
- ReferenceBase<?> sourceRef = taxon.getSec();\r
+ //gets the taxon "Hydroscaphidae"(family)\r
+ TaxonBase taxon = getTaxonService().find(UUID.fromString(acceptedTaxonUUID));\r
+ sourceRef = taxon.getSec();\r
boolean success = true;\r
int limit = state.getConfig().getLimitSave();\r
\r
*/\r
private boolean createMisappliedNameRelationships(FaunaEuropaeaImportState state, Map<UUID, UUID> fromToMap) {\r
\r
- TaxonBase taxon = getTaxonService().find(UUID.fromString("ac7b30dc-6207-4c71-9752-ee0fb838a271"));\r
- ReferenceBase<?> sourceRef = taxon.getSec();\r
+ //gets the taxon "Hydroscaphidae" (family)\r
+ \r
+ TaxonBase taxon = getTaxonService().find(UUID.fromString(acceptedTaxonUUID));\r
+ sourceRef = taxon.getSec();\r
boolean success = true;\r
int limit = state.getConfig().getLimitSave();\r
\r