Project

General

Profile

Revision 9d0c871e

ID9d0c871e0c8a9fc577ee0beaf7569a00d5f170a2
Parent 03bad932
Child 57b4a945

Added by Alexander Oppermann about 7 years ago

*added support for TextData fields
*trims the recieved string of line separators and additional spaces

View differences:

cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/csv/redlist/out/CsvTaxExportRedlist.java
20 20
import java.util.UUID;
21 21

  
22 22
import org.apache.log4j.Logger;
23
import org.springframework.beans.factory.annotation.Autowired;
24 23
import org.springframework.stereotype.Component;
25 24
import org.springframework.transaction.TransactionStatus;
26 25

  
27
import eu.etaxonomy.cdm.api.service.ITermService;
28 26
import eu.etaxonomy.cdm.model.common.CdmBase;
27
import eu.etaxonomy.cdm.model.common.Language;
29 28
import eu.etaxonomy.cdm.model.common.RelationshipTermBase;
30 29
import eu.etaxonomy.cdm.model.description.CategoricalData;
31 30
import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
......
33 32
import eu.etaxonomy.cdm.model.description.Feature;
34 33
import eu.etaxonomy.cdm.model.description.State;
35 34
import eu.etaxonomy.cdm.model.description.TaxonDescription;
35
import eu.etaxonomy.cdm.model.description.TextData;
36 36
import eu.etaxonomy.cdm.model.location.NamedArea;
37 37
import eu.etaxonomy.cdm.model.name.NonViralName;
38 38
import eu.etaxonomy.cdm.model.taxon.Classification;
......
384 384
							}
385 385
						}
386 386
					}
387
				}else if(el.isInstanceOf(TextData.class)){
388
					TextData textData = CdmBase.deproxy(el, TextData.class);
389
					Feature textFeature = textData.getFeature();
390
					// find matching feature and put data into according cell
391
					for(int i = 0; i < features.size(); i++) {
392
						if(features.get(i).equals(textFeature)){
393
							List<String> cell = featureCells.get(i);
394
							String text = textData.getText(Language.GERMAN());
395
							text = text.replaceAll(System.getProperty("line.separator"), "");
396
							text = text.replaceAll("                            ", " ");
397
							cell.add(text);
398
							
399
						}
400
					}
387 401
				}
388 402
			}
389 403
		}

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)