Revision 7205d591
Added by Andreas Müller over 1 year ago
cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/jaxb/JaxbImport.java | ||
---|---|---|
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 |
*/ |
9 |
|
|
10 | 9 |
package eu.etaxonomy.cdm.io.jaxb; |
11 | 10 |
|
12 | 11 |
import java.io.File; |
... | ... | |
14 | 13 |
import java.util.Collection; |
15 | 14 |
import java.util.List; |
16 | 15 |
|
17 |
import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger; |
|
16 |
import org.apache.logging.log4j.LogManager; |
|
17 |
import org.apache.logging.log4j.Logger; |
|
18 | 18 |
import org.springframework.stereotype.Component; |
19 | 19 |
import org.springframework.transaction.TransactionStatus; |
20 | 20 |
|
... | ... | |
51 | 51 |
implements ICdmIO<JaxbImportState> { |
52 | 52 |
|
53 | 53 |
private static final long serialVersionUID = -96388140688227297L; |
54 |
private static final Logger logger = LogManager.getLogger(JaxbImport.class);
|
|
54 |
private static final Logger logger = LogManager.getLogger(); |
|
55 | 55 |
|
56 | 56 |
private CdmDocumentBuilder cdmDocumentBuilder = null; |
57 | 57 |
|
58 |
|
|
59 | 58 |
/** Reads data from an XML file and stores them into a CDM DB. |
60 |
* |
|
61 |
* @param config |
|
62 |
* @param stores (not used) |
|
63 | 59 |
*/ |
64 |
|
|
65 | 60 |
@Override |
66 | 61 |
protected void doInvoke(JaxbImportState state) { |
67 | 62 |
|
... | ... | |
102 | 97 |
return; |
103 | 98 |
} |
104 | 99 |
|
105 |
|
|
106 | 100 |
/** Saves data in DB */ |
107 | 101 |
private void saveData (JaxbImportState state, DataSet dataSet) { |
108 | 102 |
JaxbImportConfigurator jaxbImpConfig = state.getConfig(); |
... | ... | |
238 | 232 |
} |
239 | 233 |
//commitTransaction(txStatus); |
240 | 234 |
|
241 |
|
|
242 | 235 |
//txStatus = startTransaction(); |
243 | 236 |
try { |
244 | 237 |
if (jaxbImpConfig.isDoHomotypicalGroups() == true) { |
... | ... | |
360 | 353 |
} |
361 | 354 |
|
362 | 355 |
return; |
363 |
|
|
364 | 356 |
} |
365 | 357 |
|
366 |
|
|
367 | 358 |
private boolean saveTermVocabularies( |
368 | 359 |
List<TermVocabulary<DefinedTermBase>> termVocabularies) { |
369 | 360 |
|
... | ... | |
392 | 383 |
return success; |
393 | 384 |
} |
394 | 385 |
|
395 |
|
|
396 | 386 |
@Override |
397 | 387 |
protected boolean doCheck(JaxbImportState state) { |
398 | 388 |
boolean result = true; |
... | ... | |
400 | 390 |
return result; |
401 | 391 |
} |
402 | 392 |
|
403 |
|
|
404 | 393 |
@Override |
405 | 394 |
protected boolean isIgnore(JaxbImportState state) { |
406 | 395 |
return false; |
407 | 396 |
} |
408 |
} |
|
397 |
} |
Also available in: Unified diff
cleanup