Revision 6a1ec853
Added by Andreas Kohlbecker over 7 years ago
app-import/src/main/java/eu/etaxonomy/cdm/app/iapt/IAPTActivator.java | ||
---|---|---|
46 | 46 |
public static final String DATA_SINGLE = "single.xls"; |
47 | 47 |
public static final String DATA_FILE = DATA_FILE_FULL; |
48 | 48 |
|
49 |
public static final Boolean algaeOnly = true; |
|
50 |
|
|
51 |
// ==================================================================================== |
|
52 |
|
|
49 | 53 |
//database validation status (create, update, validate ...) |
50 | 54 |
static DbSchemaValidation hbm2dll = DbSchemaValidation.CREATE; |
51 | 55 |
|
... | ... | |
99 | 103 |
config.setSourceReference(sourceRef); |
100 | 104 |
config.setSecReference(secRef); |
101 | 105 |
config.setProgressMonitor(DefaultProgressMonitor.NewInstance()); |
106 |
config.setDoAlgeaeOnly(algaeOnly); |
|
102 | 107 |
// config.setBatchSize(100); // causes Error during managed flush [Don't change the reference to a collection with delete-orphan enabled : eu.etaxonomy.cdm.model.taxon.TaxonNode.annotations] |
103 | 108 |
|
104 | 109 |
CdmDefaultImport<IAPTImportConfigurator> myImport = new CdmDefaultImport<>(); |
app-import/src/main/java/eu/etaxonomy/cdm/io/iapt/IAPTExcelImport.java | ||
---|---|---|
261 | 261 |
if(restoreOriginalReference){ |
262 | 262 |
taxonName.setNomenclaturalReference(bookVariedadesTradicionales); |
263 | 263 |
} |
264 |
if(pupDate != null) { |
|
265 |
taxonName.getNomenclaturalReference().setDatePublished(TimePeriod.NewInstance(pupDate)); |
|
266 |
} |
|
267 |
if(nomRefIssue != null) { |
|
268 |
((Reference)taxonName.getNomenclaturalReference()).setVolume(nomRefIssue); |
|
264 |
|
|
265 |
if(taxonName.getNomenclaturalReference() != null){ |
|
266 |
if(pupDate != null) { |
|
267 |
taxonName.getNomenclaturalReference().setDatePublished(TimePeriod.NewInstance(pupDate)); |
|
268 |
} |
|
269 |
if(nomRefIssue != null) { |
|
270 |
((Reference)taxonName.getNomenclaturalReference()).setVolume(nomRefIssue); |
|
271 |
} |
|
269 | 272 |
} |
270 | 273 |
|
271 | 274 |
|
... | ... | |
1085 | 1088 |
@Override |
1086 | 1089 |
protected void firstPass(SimpleExcelTaxonImportState<CONFIG> state) { |
1087 | 1090 |
|
1091 |
if(excludeFromImport(state)){ |
|
1092 |
return; |
|
1093 |
} |
|
1094 |
|
|
1088 | 1095 |
String lineNumber = "L#" + state.getCurrentLine() + ": "; |
1089 | 1096 |
logger.setLevel(Level.DEBUG); |
1090 | 1097 |
HashMap<String, String> record = state.getOriginalRecord(); |
... | ... | |
1131 | 1138 |
return; |
1132 | 1139 |
} |
1133 | 1140 |
|
1141 |
private boolean excludeFromImport(SimpleExcelTaxonImportState<CONFIG> state) { |
|
1142 |
if(state.getConfig().isDoAlgeaeOnly()){ |
|
1143 |
return !getValue(state.getOriginalRecord(), HIGHERTAXON, true).matches(".*?PHYCEAE\\s*$"); |
|
1144 |
} |
|
1145 |
|
|
1146 |
return false; |
|
1147 |
} |
|
1148 |
|
|
1134 | 1149 |
private ExtensionType getExtensionTypeIAPTRegData() { |
1135 | 1150 |
if(extensionTypeIAPTRegData == null){ |
1136 | 1151 |
extensionTypeIAPTRegData = ExtensionType.NewInstance("IAPTRegData.json", "IAPTRegData.json", ""); |
app-import/src/main/java/eu/etaxonomy/cdm/io/iapt/IAPTImportConfigurator.java | ||
---|---|---|
34 | 34 |
|
35 | 35 |
private Reference secReference; |
36 | 36 |
|
37 |
boolean doAlgeaeOnly; |
|
38 |
|
|
37 | 39 |
|
38 | 40 |
public static IAPTImportConfigurator NewInstance(URI source, ICdmDataSource destination) { |
39 | 41 |
return new IAPTImportConfigurator(source, destination); |
... | ... | |
75 | 77 |
this.secReference = secReference; |
76 | 78 |
} |
77 | 79 |
|
80 |
public void setDoAlgeaeOnly(boolean doAlgeaeOnly) { |
|
81 |
this.doAlgeaeOnly = doAlgeaeOnly; |
|
82 |
} |
|
83 |
|
|
84 |
public boolean isDoAlgeaeOnly() { |
|
85 |
return doAlgeaeOnly; |
|
86 |
} |
|
78 | 87 |
} |
79 | 88 |
|
Also available in: Unified diff
#6097 filter to include algae only