Project

General

Profile

« Previous | Next » 

Revision 401fe405

Added by Andreas Müller over 13 years ago

merge cdmlib-app-3.0.2 to trunk (app-import)

View differences:

app-import/src/main/java/eu/etaxonomy/cdm/io/CichorieaeImageImport.java
33 33
import eu.etaxonomy.cdm.model.description.TextData;
34 34
import eu.etaxonomy.cdm.model.media.ImageFile;
35 35
import eu.etaxonomy.cdm.model.media.Media;
36
import eu.etaxonomy.cdm.model.reference.ReferenceBase;
36
import eu.etaxonomy.cdm.model.reference.Reference;
37 37
import eu.etaxonomy.cdm.model.taxon.Taxon;
38 38
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
39
import eu.etaxonomy.cdm.model.taxon.TaxonomicTree;
39
import eu.etaxonomy.cdm.model.taxon.Classification;
40 40

  
41 41
/**
42 42
 * @author n.hoffmann
......
53 53
	 */
54 54
	protected boolean invokeImageImport (ImageImportConfigurator config){
55 55
		File source = new File(config.getSource());
56
		UUID treeUuid = config.getTaxonomicTreeUuid();
57
		TaxonomicTree tree = taxonTreeService.getTaxonomicTreeByUuid(treeUuid);
58
		ReferenceBase sourceRef = config.getSourceReference();
56
		UUID treeUuid = config.getClassificationUuid();
57
		Classification tree = classificationService.getClassificationByUuid(treeUuid);
58
		Reference sourceRef = config.getSourceReference();
59 59
		
60 60
		if (source.isDirectory()){
61 61
			for (File file : source.listFiles() ){
......
133 133
	 * @param taxa
134 134
	 * @param taxon
135 135
	 */
136
	private void handleTaxa(TaxonomicTree tree, ReferenceBase sourceRef, String fileName, String taxonName, List<TaxonBase> taxa) {
136
	private void handleTaxa(Classification tree, Reference sourceRef, String fileName, String taxonName, List<TaxonBase> taxa) {
137 137
		
138 138
		Taxon taxon = getTaxon(tree, taxonName, taxa);
139 139
		TaxonDescription imageGallery = taxon.getOrCreateImageGallery(sourceRef == null ? null :sourceRef.getTitleCache());
......
180 180
		DateTime mediaCreated = null;
181 181
		AgentBase artist = null;
182 182
		
183
		 
184
		ImageFile image = ImageFile.NewInstance(uriString, size, height, width);
185
		Media media = ImageFile.NewMediaInstance(mediaCreated, artist, uriString, mimeType, suffix, size, height, width);
183
//		ImageFile image = ImageFile.NewInstance(uri, size, height, width);
184
		Media media = ImageFile.NewMediaInstance(mediaCreated, artist, uri, mimeType, suffix, size, height, width);
186 185
		media.addTitle(LanguageString.NewInstance(taxonName, Language.LATIN()));
187 186
		
188 187
		return media;
......
194 193
	 * @param taxa
195 194
	 * @return
196 195
	 */
197
	private Taxon getTaxon(TaxonomicTree tree, String taxonName,
196
	private Taxon getTaxon(Classification tree, String taxonName,
198 197
			List<TaxonBase> taxa) {
199 198
		Taxon taxon = null;
200 199
		if(taxa.size() > 1) {

Also available in: Unified diff