Project

General

Profile

« Previous | Next » 

Revision f98b108b

Added by Andreas Müller about 12 years ago

Latest changes for PESI export and introduce transformers in export mappings

View differences:

cdm-pesi/src/main/java/eu/etaxonomy/cdm/io/pesi/out/PesiExportBase.java
20 20
import eu.etaxonomy.cdm.model.common.CdmBase;
21 21
import eu.etaxonomy.cdm.model.common.Marker;
22 22
import eu.etaxonomy.cdm.model.common.MarkerType;
23
import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
23 24
import eu.etaxonomy.cdm.model.name.NameRelationship;
24 25
import eu.etaxonomy.cdm.model.name.NonViralName;
25 26
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
......
39 40
	}
40 41
	
41 42

  
42
	protected List<TaxonBase> getNextTaxonPartition(Class<? extends TaxonBase> clazz,int limit, int partitionCount) {
43
		List<TaxonBase> list = getTaxonService().list(clazz, limit, partitionCount * limit, null, null);
43
	protected <CLASS extends TaxonBase<?>> List<CLASS> getNextTaxonPartition(Class<CLASS> clazz,int limit, int partitionCount, List<String> propertyPath) {
44
		List<CLASS> list = (List<CLASS>)getTaxonService().list(clazz, limit, partitionCount * limit, null, propertyPath);
44 45
		
45
		Iterator<TaxonBase> it = list.iterator();
46
		Iterator<CLASS> it = list.iterator();
46 47
		while (it.hasNext()){
47 48
			TaxonBase<?> taxonBase = it.next();
48 49
			if (! isPesiTaxon(taxonBase)){
......
74 75
		}
75 76
		return list;
76 77
	}
78

  
79
//	protected List<TaxonBase> getNextDescriptionPartition(Class<? extends DescriptionElementBase> clazz,int limit, int partitionCount) {
80
//		List<DescriptionElementBase> list = getDescriptionService().listDescriptionElements(null, null, pageSize, pageNumber, propPath);
81
//		
82
//		Iterator<TaxonBase> it = list.iterator();
83
//		while (it.hasNext()){
84
//			TaxonBase<?> taxonBase = it.next();
85
//			if (! isPesiTaxon(taxonBase)){
86
//				it.remove();
87
//			}
88
//		}
89
//		return list;
90
//	}
91

  
77 92
	
78 93
	protected boolean isPurePesiName(TaxonNameBase<?,?> taxonName){
79 94
		if (hasPesiTaxon(taxonName)){
......
111 126
	}
112 127

  
113 128

  
129
	/**
130
	 * Checks if this taxon is taxon that is to be exported to PESI. This is generally the case
131
	 * except for those taxa marked as "DON't PUBLISH".
132
	 * The list of conditions may change in future.
133
	 * @param taxonBase
134
	 * @return
135
	 */
114 136
	protected static boolean isPesiTaxon(TaxonBase taxonBase) {
115 137
		for (Marker marker : taxonBase.getMarkers()){
116 138
			if (marker.getValue() == false && marker.getMarkerType().equals(MarkerType.PUBLISH())){

Also available in: Unified diff