Project

General

Profile

Download (3.8 KB) Statistics
| Branch: | Revision:
1 ede5c502 Andreas Müller
/**
2
* Copyright (C) 2007 EDIT
3
* European Distributed Institute of Taxonomy
4
* http://www.e-taxonomy.eu
5
*
6
* The contents of this file are subject to the Mozilla Public License Version 1.1
7
* See LICENSE.TXT at the top of this package for the full license terms.
8
*/
9
10
package eu.etaxonomy.cdm.io.cuba;
11
12 26790e9b Andreas Müller
import eu.etaxonomy.cdm.common.URI;
13 ede5c502 Andreas Müller
14
import org.apache.log4j.Logger;
15
16
import eu.etaxonomy.cdm.database.ICdmDataSource;
17
import eu.etaxonomy.cdm.io.common.ImportStateBase;
18
import eu.etaxonomy.cdm.io.common.mapping.IInputTransformer;
19
import eu.etaxonomy.cdm.io.excel.common.ExcelImportConfiguratorBase;
20
import eu.etaxonomy.cdm.model.name.NomenclaturalCode;
21
import eu.etaxonomy.cdm.model.reference.Reference;
22
import eu.etaxonomy.cdm.model.reference.ReferenceFactory;
23
24
25
/**
26
 * @author a.mueller
27 a13538c8 Andreas Müller
 * @since 20.03.2008
28 ede5c502 Andreas Müller
 */
29
public class CubaImportConfigurator extends ExcelImportConfiguratorBase {
30
31
    private static final long serialVersionUID = 5590553979984931651L;
32
33
    @SuppressWarnings("unused")
34
	private static Logger logger = Logger.getLogger(CubaImportConfigurator.class);
35
36
    private String cubaReferenceTitle;
37
38
	private boolean isDoTaxa;
39
40 f6f52f73 Andreas Müller
	private boolean doAltFlorasSanchez2017;
41
    private boolean doAltFlorasFRC;
42
    private boolean doAltFlorasFC;
43
    private boolean doAltFlorasAS;
44
45
46 fb3dec85 Andreas Müller
    private boolean doVocabularies;
47
    public void setDoVocabularies(boolean doVocabularies) {this.doVocabularies = doVocabularies;}
48
    public boolean isDoVocabularies() {return doVocabularies;}
49
50
    private static IInputTransformer defaultTransformer = new CubaTransformer();
51 ede5c502 Andreas Müller
52
	public static CubaImportConfigurator NewInstance(URI source, ICdmDataSource destination){
53
		return new CubaImportConfigurator(source, destination);
54
	}
55
56
	@Override
57
    protected void makeIoClassList(){
58
		ioClassList = new Class[]{
59
		        CubaVocabularyImport.class,
60
				CubaExcelImport.class
61
		};
62
	}
63
64
	@Override
65
    public ImportStateBase getNewState() {
66
		return new CubaImportState(this);
67
	}
68
69
70
71
	private CubaImportConfigurator(URI source, ICdmDataSource destination) {
72
	   super(source, destination, defaultTransformer);
73
	   setNomenclaturalCode(NomenclaturalCode.ICNAFP);
74
	   setSource(source);
75
	   setDestination(destination);
76
	}
77
78
79
	@Override
80
    public URI getSource() {
81
		return super.getSource();
82
	}
83
	@Override
84
    public void setSource(URI source) {
85
		super.setSource(source);
86
	}
87
88
	@Override
89 8422c0cd Andreas Müller
    public Reference getSourceReference() {
90 ede5c502 Andreas Müller
		if (sourceReference == null){
91
			sourceReference =  ReferenceFactory.newDatabase();
92
			if (getSource() != null){
93
				sourceReference.setTitleCache(getCubaReferenceTitle(), true);
94
			}
95
		}
96
		return sourceReference;
97
	}
98
99
	@Override
100
    public String getSourceNameString() {
101
		return getSource().toString();
102
	}
103
104
105
	public void setCubaReferenceTitle(String cyprusReferenceTitle) {
106
		this.cubaReferenceTitle = cyprusReferenceTitle;
107
	}
108
109
110
	public String getCubaReferenceTitle() {
111
		return cubaReferenceTitle;
112
	}
113
114
	public void setDoTaxa(boolean isDoTaxa) {
115
		this.isDoTaxa = isDoTaxa;
116
	}
117
118
	public boolean isDoTaxa() {
119
		return isDoTaxa;
120
	}
121
122
123 f6f52f73 Andreas Müller
	//************* ALT FLORAS ********************/
124
125
	public boolean isDoAltFlorasSanchez2017() {
126
        return doAltFlorasSanchez2017;
127
    }
128
    public void setDoAltFlorasSanchez2017(boolean doAltFlorasSanchez2017) {
129
        this.doAltFlorasSanchez2017 = doAltFlorasSanchez2017;
130
    }
131
    public boolean isDoAltFlorasFRC() {
132
        return doAltFlorasFRC;
133
    }
134
    public void setDoAltFlorasFRC(boolean doAltFlorasFRC) {
135
        this.doAltFlorasFRC = doAltFlorasFRC;
136
    }
137
    public boolean isDoAltFlorasFC() {
138
        return doAltFlorasFC;
139
    }
140
    public void setDoAltFlorasFC(boolean doAltFlorasFC) {
141
        this.doAltFlorasFC = doAltFlorasFC;
142
    }
143
    public boolean isDoAltFlorasAS() {
144
        return doAltFlorasAS;
145
    }
146
    public void setDoAltFlorasAS(boolean doAltFlorasAS) {
147
        this.doAltFlorasAS = doAltFlorasAS;
148
    }
149
150
151 ede5c502 Andreas Müller
152
}