Revision c59ecc4a
Added by Andreas Müller almost 13 years ago
app-import/src/main/java/eu/etaxonomy/cdm/io/wp6/CichorieaeImageImport.java | ||
---|---|---|
24 | 24 |
|
25 | 25 |
import eu.etaxonomy.cdm.app.images.AbstractImageImporter; |
26 | 26 |
import eu.etaxonomy.cdm.app.images.ImageImportConfigurator; |
27 |
import eu.etaxonomy.cdm.app.images.ImageImportState; |
|
27 | 28 |
import eu.etaxonomy.cdm.common.CdmUtils; |
28 | 29 |
import eu.etaxonomy.cdm.common.media.ImageInfo; |
29 | 30 |
import eu.etaxonomy.cdm.model.agent.AgentBase; |
... | ... | |
51 | 52 |
/** |
52 | 53 |
* Imports images from a directory. |
53 | 54 |
*/ |
54 |
protected boolean invokeImageImport (ImageImportConfigurator config){
|
|
55 |
File source = new File(config.getSource());
|
|
56 |
UUID treeUuid = config.getClassificationUuid();
|
|
55 |
protected void invokeImageImport (ImageImportState state){
|
|
56 |
File source = new File(state.getConfig().getSource());
|
|
57 |
UUID treeUuid = state.getConfig().getClassificationUuid();
|
|
57 | 58 |
Classification tree = classificationService.find(treeUuid); |
58 |
Reference<?> sourceRef = config.getSourceReference();
|
|
59 |
Reference<?> sourceRef = state.getConfig().getSourceReference();
|
|
59 | 60 |
|
60 | 61 |
if (source.isDirectory()){ |
61 | 62 |
for (File file : source.listFiles() ){ |
... | ... | |
65 | 66 |
if (taxonName == null){ |
66 | 67 |
continue; |
67 | 68 |
} |
68 |
List<TaxonBase> taxa = taxonService.searchTaxaByName(taxonName, config.getSourceReference());
|
|
69 |
List<TaxonBase> taxa = taxonService.searchTaxaByName(taxonName, state.getConfig().getSourceReference());
|
|
69 | 70 |
if(taxa.size() == 0){ |
70 | 71 |
logger.warn("no taxon with this name found: " + taxonName); |
71 | 72 |
} else { |
... | ... | |
79 | 80 |
logger.warn("Source is not a directory!" + source.toString()); |
80 | 81 |
} |
81 | 82 |
|
82 |
return true;
|
|
83 |
return; |
|
83 | 84 |
|
84 | 85 |
} |
85 | 86 |
|
Also available in: Unified diff
last updates for Taxon Excel Import and moving all success variables to state