Revision 3ef6d2b0
Added by Andreas Müller over 11 years ago
cdm-eflora/src/main/java/eu/etaxonomy/cdm/io/eflora/centralAfrica/checklist/CentralAfricaChecklistImportConfigurator.java | ||
---|---|---|
15 | 15 |
import org.apache.log4j.Logger; |
16 | 16 |
|
17 | 17 |
import eu.etaxonomy.cdm.database.ICdmDataSource; |
18 |
import eu.etaxonomy.cdm.io.common.DbImportConfiguratorBase; |
|
18 | 19 |
import eu.etaxonomy.cdm.io.common.IImportConfigurator; |
19 |
import eu.etaxonomy.cdm.io.common.ImportConfiguratorBase; |
|
20 |
import eu.etaxonomy.cdm.io.common.ImportStateBase; |
|
21 | 20 |
import eu.etaxonomy.cdm.io.common.Source; |
22 | 21 |
import eu.etaxonomy.cdm.io.common.mapping.IInputTransformer; |
23 | 22 |
import eu.etaxonomy.cdm.model.name.NomenclaturalCode; |
24 |
import eu.etaxonomy.cdm.model.reference.Reference; |
|
25 |
import eu.etaxonomy.cdm.model.reference.ReferenceFactory; |
|
26 | 23 |
|
27 | 24 |
|
28 | 25 |
/** |
... | ... | |
30 | 27 |
* @created 20.03.2008 |
31 | 28 |
* @version 1.0 |
32 | 29 |
*/ |
33 |
public class CentralAfricaChecklistImportConfigurator extends ImportConfiguratorBase<CentralAfricaChecklistImportState, Source> implements IImportConfigurator{
|
|
30 |
public class CentralAfricaChecklistImportConfigurator extends DbImportConfiguratorBase<CentralAfricaChecklistImportState> implements IImportConfigurator{
|
|
34 | 31 |
@SuppressWarnings("unused") |
35 | 32 |
private static Logger logger = Logger.getLogger(CentralAfricaChecklistImportConfigurator.class); |
36 | 33 |
|
... | ... | |
42 | 39 |
return new CentralAfricaChecklistImportConfigurator(ermsSource, destination); |
43 | 40 |
} |
44 | 41 |
|
45 |
/* Max number of records to be saved with one service call */ |
|
46 |
private int recordsPerTransaction = 1000; //defaultValue |
|
47 |
|
|
48 |
//TODO needed ?? |
|
49 |
private Method userTransformationMethod; |
|
50 |
|
|
51 | 42 |
private boolean doVernaculars = true; |
52 | 43 |
private boolean doLinks = true; |
53 | 44 |
private boolean doNotes = true; |
... | ... | |
71 | 62 |
/* (non-Javadoc) |
72 | 63 |
* @see eu.etaxonomy.cdm.io.common.IImportConfigurator#getNewState() |
73 | 64 |
*/ |
74 |
public ImportStateBase getNewState() {
|
|
65 |
public CentralAfricaChecklistImportState getNewState() {
|
|
75 | 66 |
return new CentralAfricaChecklistImportState(this); |
76 | 67 |
} |
77 | 68 |
|
78 | 69 |
|
79 | 70 |
|
80 | 71 |
private CentralAfricaChecklistImportConfigurator(Source source, ICdmDataSource destination) { |
81 |
super(defaultTransformer); |
|
82 |
setNomenclaturalCode(NomenclaturalCode.ICZN); //default for ERMS |
|
83 |
setSource(source); |
|
84 |
setDestination(destination); |
|
72 |
super(source, destination,NomenclaturalCode.ICBN, defaultTransformer); //default for FdAC |
|
85 | 73 |
} |
86 | 74 |
|
87 | 75 |
|
... | ... | |
92 | 80 |
super.setSource(berlinModelSource); |
93 | 81 |
} |
94 | 82 |
|
95 |
/* (non-Javadoc) |
|
96 |
* @see eu.etaxonomy.cdm.io.tcsrdf.IImportConfigurator#getSourceReference() |
|
97 |
*/ |
|
98 |
public Reference getSourceReference() { |
|
99 |
if (sourceReference == null){ |
|
100 |
sourceReference = ReferenceFactory.newDatabase(); |
|
101 |
if (getSource() != null){ |
|
102 |
sourceReference.setTitleCache(getSource().getDatabase(), true); |
|
103 |
} |
|
104 |
} |
|
105 |
return sourceReference; |
|
106 |
} |
|
107 |
|
|
108 |
/* (non-Javadoc) |
|
109 |
* @see eu.etaxonomy.cdm.io.common.IImportConfigurator#getSourceNameString() |
|
110 |
*/ |
|
111 |
public String getSourceNameString() { |
|
112 |
if (this.getSource() == null){ |
|
113 |
return null; |
|
114 |
}else{ |
|
115 |
return this.getSource().getDatabase(); |
|
116 |
} |
|
117 |
} |
|
118 |
|
|
119 |
/** |
|
120 |
* @return the userTransformationMethod |
|
121 |
*/ |
|
122 |
public Method getUserTransformationMethod() { |
|
123 |
return userTransformationMethod; |
|
124 |
} |
|
125 |
|
|
126 |
/** |
|
127 |
* @param userTransformationMethod the userTransformationMethod to set |
|
128 |
*/ |
|
129 |
public void setUserTransformationMethod(Method userTransformationMethod) { |
|
130 |
this.userTransformationMethod = userTransformationMethod; |
|
131 |
} |
|
132 |
|
|
133 |
|
|
134 |
/** |
|
135 |
* @return the limitSave |
|
136 |
*/ |
|
137 |
public int getRecordsPerTransaction() { |
|
138 |
return recordsPerTransaction; |
|
139 |
} |
|
140 |
|
|
141 |
/** |
|
142 |
* @param limitSave the limitSave to set |
|
143 |
*/ |
|
144 |
public void setRecordsPerTransaction(int recordsPerTransaction) { |
|
145 |
this.recordsPerTransaction = recordsPerTransaction; |
|
146 |
} |
|
147 |
|
|
148 | 83 |
/** |
149 | 84 |
* @param doVernaculars the doVernaculars to set |
150 | 85 |
*/ |
cdm-eflora/src/main/java/eu/etaxonomy/cdm/io/eflora/centralAfrica/ferns/CentralAfricaFernsImportConfigurator.java | ||
---|---|---|
9 | 9 |
|
10 | 10 |
package eu.etaxonomy.cdm.io.eflora.centralAfrica.ferns; |
11 | 11 |
|
12 |
import java.lang.reflect.Method; |
|
13 |
|
|
14 | 12 |
import org.apache.log4j.Logger; |
15 | 13 |
|
16 | 14 |
import eu.etaxonomy.cdm.database.ICdmDataSource; |
15 |
import eu.etaxonomy.cdm.io.common.DbImportConfiguratorBase; |
|
17 | 16 |
import eu.etaxonomy.cdm.io.common.IImportConfigurator; |
18 |
import eu.etaxonomy.cdm.io.common.ImportConfiguratorBase; |
|
19 | 17 |
import eu.etaxonomy.cdm.io.common.ImportStateBase; |
20 | 18 |
import eu.etaxonomy.cdm.io.common.Source; |
21 |
import eu.etaxonomy.cdm.io.common.IImportConfigurator.DO_REFERENCES; |
|
22 | 19 |
import eu.etaxonomy.cdm.io.common.mapping.IInputTransformer; |
23 | 20 |
import eu.etaxonomy.cdm.model.name.NomenclaturalCode; |
24 |
import eu.etaxonomy.cdm.model.reference.Reference; |
|
25 |
import eu.etaxonomy.cdm.model.reference.ReferenceFactory; |
|
26 | 21 |
|
27 | 22 |
|
28 | 23 |
/** |
... | ... | |
30 | 25 |
* @created 20.03.2008 |
31 | 26 |
* @version 1.0 |
32 | 27 |
*/ |
33 |
public class CentralAfricaFernsImportConfigurator extends ImportConfiguratorBase<CentralAfricaFernsImportState, Source> implements IImportConfigurator{
|
|
28 |
public class CentralAfricaFernsImportConfigurator extends DbImportConfiguratorBase<CentralAfricaFernsImportState> implements IImportConfigurator{
|
|
34 | 29 |
@SuppressWarnings("unused") |
35 | 30 |
private static Logger logger = Logger.getLogger(CentralAfricaFernsImportConfigurator.class); |
36 | 31 |
|
... | ... | |
38 | 33 |
return new CentralAfricaFernsImportConfigurator(ermsSource, destination); |
39 | 34 |
} |
40 | 35 |
|
41 |
/* Max number of records to be saved with one service call */ |
|
42 |
private int recordsPerTransaction = 1000; //defaultValue |
|
43 |
|
|
44 |
//TODO needed ?? |
|
45 |
private Method userTransformationMethod; |
|
46 |
|
|
47 | 36 |
private boolean doVernaculars = true; |
48 | 37 |
private boolean doLinks = true; |
49 | 38 |
private boolean doNotes = true; |
... | ... | |
75 | 64 |
|
76 | 65 |
|
77 | 66 |
private CentralAfricaFernsImportConfigurator(Source source, ICdmDataSource destination) { |
78 |
super(defaultTransformer); |
|
79 |
setNomenclaturalCode(NomenclaturalCode.ICZN); //default for ERMS |
|
80 |
setSource(source); |
|
81 |
setDestination(destination); |
|
67 |
super(source, destination,NomenclaturalCode.ICBN, defaultTransformer);//default for FdAC |
|
82 | 68 |
} |
83 | 69 |
|
84 |
/* (non-Javadoc) |
|
85 |
* @see eu.etaxonomy.cdm.io.tcsrdf.IImportConfigurator#getSourceReference() |
|
86 |
*/ |
|
87 |
public Reference getSourceReference() { |
|
88 |
if (sourceReference == null){ |
|
89 |
sourceReference = ReferenceFactory.newDatabase(); |
|
90 |
if (getSource() != null){ |
|
91 |
sourceReference.setTitleCache(getSource().getDatabase(), true); |
|
92 |
} |
|
93 |
} |
|
94 |
return sourceReference; |
|
95 |
} |
|
96 |
|
|
97 |
|
|
98 |
/* (non-Javadoc) |
|
99 |
* @see eu.etaxonomy.cdm.io.common.IImportConfigurator#getSourceNameString() |
|
100 |
*/ |
|
101 |
public String getSourceNameString() { |
|
102 |
if (this.getSource() == null){ |
|
103 |
return null; |
|
104 |
}else{ |
|
105 |
return this.getSource().getDatabase(); |
|
106 |
} |
|
107 |
} |
|
108 |
|
|
109 |
/** |
|
110 |
* @return the userTransformationMethod |
|
111 |
*/ |
|
112 |
public Method getUserTransformationMethod() { |
|
113 |
return userTransformationMethod; |
|
114 |
} |
|
115 |
|
|
116 |
/** |
|
117 |
* @param userTransformationMethod the userTransformationMethod to set |
|
118 |
*/ |
|
119 |
public void setUserTransformationMethod(Method userTransformationMethod) { |
|
120 |
this.userTransformationMethod = userTransformationMethod; |
|
121 |
} |
|
122 |
|
|
123 |
|
|
124 |
/** |
|
125 |
* @return the limitSave |
|
126 |
*/ |
|
127 |
public int getRecordsPerTransaction() { |
|
128 |
return recordsPerTransaction; |
|
129 |
} |
|
130 |
/** |
|
131 |
* @param limitSave the limitSave to set |
|
132 |
*/ |
|
133 |
public void setRecordsPerTransaction(int recordsPerTransaction) { |
|
134 |
this.recordsPerTransaction = recordsPerTransaction; |
|
135 |
} |
|
136 | 70 |
|
137 | 71 |
/** |
138 | 72 |
* @param doVernaculars the doVernaculars to set |
Also available in: Unified diff
new DbImportBase and DbImportConfigurator