3 * Copyright (C) 2009 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
7 * The contents of this file are subject to the Mozilla Public License Version 1.1
8 * See LICENSE.TXT at the top of this package for the full license terms.
10 package eu
.etaxonomy
.cdm
.io
.pesi
.out
;
12 import org
.apache
.log4j
.Logger
;
14 import eu
.etaxonomy
.cdm
.database
.ICdmDataSource
;
15 import eu
.etaxonomy
.cdm
.io
.common
.DbExportConfiguratorBase
;
16 import eu
.etaxonomy
.cdm
.io
.common
.IExportConfigurator
;
17 import eu
.etaxonomy
.cdm
.io
.common
.Source
;
18 import eu
.etaxonomy
.cdm
.model
.reference
.Reference
;
19 import eu
.etaxonomy
.cdm
.model
.reference
.ReferenceFactory
;
26 public class PesiExportConfigurator
extends DbExportConfiguratorBase
<PesiExportState
> implements IExportConfigurator
<PesiExportState
> {
27 @SuppressWarnings("unused")
28 private static Logger logger
= Logger
.getLogger(PesiExportConfigurator
.class);
29 private int limitSave
= 2000;
31 private Reference
<?
> auctReference
;
32 private boolean doOccurrence
= true;
33 private boolean doFacts
= true;
34 private boolean doNameFacts
= true;
35 private DO_REFERENCES doReferences
= DO_REFERENCES
.ALL
;
36 private boolean doTaxa
= true;
37 private boolean doRelTaxa
= true;
40 public static PesiExportConfigurator
NewInstance(Source pesiDestination
, ICdmDataSource source
) {
41 return new PesiExportConfigurator(pesiDestination
, source
);
44 @SuppressWarnings("unchecked")
45 protected void makeIoClassList() {
46 ioClassList
= new Class
[]{
47 PesiSourceExport
.class,
48 PesiTaxonExport
.class,
49 PesiRelTaxonExport
.class, // RelTaxonId's could be deleted from state hashmap
51 PesiNoteSourceExport
.class, // NoteId's could be deleted from state hashmap
52 PesiAdditionalTaxonSourceExport
.class,
53 PesiOccurrenceExport
.class,
54 PesiOccurrenceSourceExport
.class,
55 PesiImageExport
.class,
64 private PesiExportConfigurator(Source pesiSource
, ICdmDataSource cdmSource
) {
67 setDestination(pesiSource
);
71 * @see eu.etaxonomy.cdm.io.common.IExportConfigurator#getNewState()
73 public PesiExportState
getNewState() {
74 return new PesiExportState(this);
78 * @return the limitSave
80 public int getLimitSave() {
85 * @param limitSave the limitSave to set
87 public void setLimitSave(int limitSave
) {
88 this.limitSave
= limitSave
;
92 * Returns the Reference for a Misapplied Name.
93 * Copied from FaunaEuropaeaImportConfigurator.
96 public Reference
<?
> getAuctReference() {
97 if (auctReference
== null){
98 auctReference
= ReferenceFactory
.newGeneric();
100 auctReference
.setTitleCache("auct.", true);
102 return auctReference
;
105 public boolean isDoOccurrence() {
108 public void setDoOccurrence(boolean doOccurrence
) {
109 this.doOccurrence
= doOccurrence
;
113 public boolean isDoFacts() {
116 public void setDoFacts(boolean doFacts
) {
117 this.doFacts
= doFacts
;
120 public boolean isDoNameFacts() {
123 public void setDoNameFacts(boolean doNameFacts
) {
124 this.doNameFacts
= doNameFacts
;
129 public DO_REFERENCES
getDoReferences() {
132 public void setDoReferences(DO_REFERENCES doReferences
) {
133 this.doReferences
= doReferences
;
136 public boolean isDoTaxa() {
139 public void setDoTaxa(boolean doTaxa
) {
140 this.doTaxa
= doTaxa
;
143 public boolean isDoRelTaxa() {
146 public void setDoRelTaxa(boolean doRelTaxa
) {
147 this.doRelTaxa
= doRelTaxa
;