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
.ExportStateBase
;
17 import eu
.etaxonomy
.cdm
.io
.common
.IExportConfigurator
;
18 import eu
.etaxonomy
.cdm
.io
.common
.Source
;
19 import eu
.etaxonomy
.cdm
.io
.common
.IExportConfigurator
.DO_REFERENCES
;
20 import eu
.etaxonomy
.cdm
.model
.reference
.Reference
;
21 import eu
.etaxonomy
.cdm
.model
.reference
.ReferenceFactory
;
28 public class PesiExportConfigurator
extends DbExportConfiguratorBase
implements IExportConfigurator
{
29 @SuppressWarnings("unused")
30 private static Logger logger
= Logger
.getLogger(PesiExportConfigurator
.class);
31 private int limitSave
= 1000;
33 private Reference
<?
> auctReference
;
34 private boolean doOccurrence
= true;
35 private boolean doFacts
= true;
36 private boolean doNameFacts
= true;
37 private DO_REFERENCES doReferences
= DO_REFERENCES
.ALL
;
38 private boolean doTaxa
= true;
39 private boolean doRelTaxa
= true;
42 public static PesiExportConfigurator
NewInstance(Source pesiDestination
, ICdmDataSource source
) {
43 return new PesiExportConfigurator(pesiDestination
, source
);
46 @SuppressWarnings("unchecked")
47 protected void makeIoClassList() {
48 ioClassList
= new Class
[]{
49 PesiSourceExport
.class,
50 PesiTaxonExport
.class,
51 PesiRelTaxonExport
.class, // RelTaxonId's could be deleted from state hashmap
53 PesiNoteSourceExport
.class, // NoteId's could be deleted from state hashmap
54 PesiAdditionalTaxonSourceExport
.class,
55 PesiOccurrenceExport
.class,
56 PesiOccurrenceSourceExport
.class,
57 PesiImageExport
.class,
66 private PesiExportConfigurator(Source pesiSource
, ICdmDataSource cdmSource
) {
69 setDestination(pesiSource
);
73 * @see eu.etaxonomy.cdm.io.common.IExportConfigurator#getNewState()
75 @SuppressWarnings("unchecked")
76 public ExportStateBase
getNewState() {
77 return new PesiExportState(this);
81 * @return the limitSave
83 public int getLimitSave() {
88 * @param limitSave the limitSave to set
90 public void setLimitSave(int limitSave
) {
91 this.limitSave
= limitSave
;
95 * Returns the Reference for a Misapplied Name.
96 * Copied from FaunaEuropaeaImportConfigurator.
99 public Reference
<?
> getAuctReference() {
100 if (auctReference
== null){
101 auctReference
= ReferenceFactory
.newGeneric();
103 auctReference
.setTitleCache("auct.", true);
105 return auctReference
;
108 public boolean isDoOccurrence() {
111 public void setDoOccurrence(boolean doOccurrence
) {
112 this.doOccurrence
= doOccurrence
;
116 public boolean isDoFacts() {
119 public void setDoFacts(boolean doFacts
) {
120 this.doFacts
= doFacts
;
123 public boolean isDoNameFacts() {
126 public void setDoNameFacts(boolean doNameFacts
) {
127 this.doNameFacts
= doNameFacts
;
132 public DO_REFERENCES
getDoReferences() {
135 public void setDoReferences(DO_REFERENCES doReferences
) {
136 this.doReferences
= doReferences
;
139 public boolean isDoTaxa() {
142 public void setDoTaxa(boolean doTaxa
) {
143 this.doTaxa
= doTaxa
;
146 public boolean isDoRelTaxa() {
149 public void setDoRelTaxa(boolean doRelTaxa
) {
150 this.doRelTaxa
= doRelTaxa
;