Revision 7c429b09
Added by Andreas Müller almost 7 years ago
cdm-pesi/src/main/java/eu/etaxonomy/cdm/io/pesi/out/PesiRelTaxonExport.java | ||
---|---|---|
29 | 29 |
import eu.etaxonomy.cdm.model.name.NameRelationship; |
30 | 30 |
import eu.etaxonomy.cdm.model.name.NomenclaturalCode; |
31 | 31 |
import eu.etaxonomy.cdm.model.name.Rank; |
32 |
import eu.etaxonomy.cdm.model.name.TaxonNameBase; |
|
33 | 32 |
import eu.etaxonomy.cdm.model.taxon.Classification; |
34 | 33 |
import eu.etaxonomy.cdm.model.taxon.Synonym; |
35 | 34 |
import eu.etaxonomy.cdm.model.taxon.Taxon; |
... | ... | |
46 | 45 |
*/ |
47 | 46 |
@Component |
48 | 47 |
public class PesiRelTaxonExport extends PesiExportBase { |
49 |
private static final Logger logger = Logger.getLogger(PesiRelTaxonExport.class); |
|
50 |
private static final Class<? extends CdmBase> standardMethodParameter = RelationshipBase.class; |
|
48 |
|
|
49 |
private static final long serialVersionUID = 67808745337549629L; |
|
50 |
private static final Logger logger = Logger.getLogger(PesiRelTaxonExport.class); |
|
51 |
|
|
52 |
private static final Class<? extends CdmBase> standardMethodParameter = RelationshipBase.class; |
|
51 | 53 |
|
52 | 54 |
private static int modCount = 1000; |
53 | 55 |
private static final String dbTableName = "RelTaxon"; |
... | ... | |
63 | 65 |
super(); |
64 | 66 |
} |
65 | 67 |
|
66 |
/* (non-Javadoc) |
|
67 |
* @see eu.etaxonomy.cdm.io.common.DbExportBase#getStandardMethodParameter() |
|
68 |
*/ |
|
69 | 68 |
@Override |
70 | 69 |
public Class<? extends CdmBase> getStandardMethodParameter() { |
71 | 70 |
return standardMethodParameter; |
72 | 71 |
} |
73 | 72 |
|
74 |
/* (non-Javadoc) |
|
75 |
* @see eu.etaxonomy.cdm.io.common.CdmIoBase#doCheck(eu.etaxonomy.cdm.io.common.IoStateBase) |
|
76 |
*/ |
|
77 | 73 |
@Override |
78 | 74 |
protected boolean doCheck(PesiExportState state) { |
79 | 75 |
boolean result = true; |
80 | 76 |
return result; |
81 | 77 |
} |
82 | 78 |
|
83 |
|
|
84 |
/* (non-Javadoc) |
|
85 |
* @see eu.etaxonomy.cdm.io.common.CdmIoBase#doInvoke(eu.etaxonomy.cdm.io.common.IoStateBase) |
|
86 |
*/ |
|
87 | 79 |
@Override |
88 | 80 |
protected void doInvoke(PesiExportState state) { |
89 | 81 |
try { |
... | ... | |
113 | 105 |
success &= doPhase02(state, mapping); |
114 | 106 |
|
115 | 107 |
if (! success){ |
116 |
state.setUnsuccessfull();
|
|
108 |
state.getResult().addError("An unknown error occurred in PesiRelTaxonExport");
|
|
117 | 109 |
} |
118 | 110 |
|
119 | 111 |
} catch (SQLException e) { |
120 | 112 |
e.printStackTrace(); |
121 | 113 |
logger.error(e.getMessage()); |
122 |
state.setUnsuccessfull();
|
|
114 |
state.getResult().addException(e);
|
|
123 | 115 |
return; |
124 | 116 |
} |
125 | 117 |
} |
... | ... | |
321 | 313 |
logger.warn("*** Finished Making " + pluralString + " ..." + getSuccessString(success)); |
322 | 314 |
|
323 | 315 |
if (!success){ |
324 |
state.setUnsuccessfull();
|
|
316 |
state.getResult().addError("An unknown error occurred in PesiRelTaxonExport");
|
|
325 | 317 |
} |
326 | 318 |
return; |
327 | 319 |
} catch (SQLException e) { |
328 | 320 |
e.printStackTrace(); |
329 | 321 |
logger.error(e.getMessage()); |
330 |
state.setUnsuccessfull();
|
|
322 |
state.getResult().addException(e);
|
|
331 | 323 |
return; |
332 | 324 |
} |
333 | 325 |
} |
... | ... | |
602 | 594 |
return true; |
603 | 595 |
} |
604 | 596 |
|
605 |
/* (non-Javadoc) |
|
606 |
* @see eu.etaxonomy.cdm.io.common.CdmIoBase#isIgnore(eu.etaxonomy.cdm.io.common.IoStateBase) |
|
607 |
*/ |
|
608 | 597 |
@Override |
609 | 598 |
protected boolean isIgnore(PesiExportState state) { |
610 | 599 |
return ! state.getConfig().isDoRelTaxa(); |
Also available in: Unified diff
ref #6541 adapt pesi to ImportResult