Project

General

Profile

Revision 82e89bf1

ID82e89bf1fa44953ae1f9f162948b49cb0f385150
Parent 92657983
Child c3d73ea5

Added by Katja Luther 11 months ago

fix #8264: add excluded, unplaced and published to taxon table of cdm light export

View differences:

cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/cdmLight/CdmLightClassificationExport.java
262 262
                csvLine[table.getIndex(CdmLightExportTable.CLASSIFICATION_ID)] = getId(state, taxonNode.getClassification());
263 263
                csvLine[table.getIndex(CdmLightExportTable.CLASSIFICATION_TITLE)] = taxonNode.getClassification().getTitleCache();
264 264

  
265
                csvLine[table.getIndex(CdmLightExportTable.PUBLISHED)] = taxon.isPublish()?"1":"0";
266
                csvLine[table.getIndex(CdmLightExportTable.EXCLUDED)] = taxonNode.isExcluded()?"1":"0";
267
                Map<Language, LanguageString> notesMap = taxonNode.getExcludedNote();
268
                String excludedNotes = "";
269
                if (!notesMap.isEmpty() && notesMap.size() == 1){
270
                    excludedNotes = notesMap.values().iterator().next().getText();
271
                }else if (!notesMap.isEmpty()){
272
                    excludedNotes = notesMap.get(Language.getDefaultLanguage())!= null ? notesMap.get(Language.getDefaultLanguage()).getText(): null;
273
                    if (excludedNotes == null){
274
                        excludedNotes = notesMap.values().iterator().next().getText();
275
                    }
276
                }
277
                csvLine[table.getIndex(CdmLightExportTable.EXCLUDED_NOTES)] = excludedNotes;
278

  
279
                csvLine[table.getIndex(CdmLightExportTable.UNPLACED)] = taxonNode.isUnplaced()?"1":"0";
265 280
                state.getProcessor().put(table, taxon, csvLine);
266 281
                handleDescriptions(state, taxon);
267 282
             }catch(Exception e){
cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/cdmLight/CdmLightExportTable.java
48 48
    protected static final String SEC_REFERENCE_FK = "SecReference_FK";
49 49
    protected static final String SEC_REFERENCE = "SecReference";
50 50
    protected static final String SORT_INDEX = "SortIndex";
51
    protected static final String UNPLACED = "Unplaced";
52
    protected static final String EXCLUDED = "Excluded";
53
    protected static final String PUBLISHED = "Published";
54
    protected static final String EXCLUDED_NOTES = "Excluded_Notes";
55

  
51 56
    //pro parte / misapplied
52 57
    protected static final String SYN_SEC_REFERENCE_FK = "SynSecReference_FK";
53 58
    protected static final String SYN_SEC_REFERENCE = "SynSecReference";
......
286 291
        };
287 292
    }
288 293
    final static String[] taxonColumns(){
289
        return new String[]{TAXON_ID, CLASSIFICATION_ID, CLASSIFICATION_TITLE, NAME_FK, PARENT_FK, SEC_REFERENCE_FK, SEC_REFERENCE, SORT_INDEX};
294
        return new String[]{TAXON_ID, CLASSIFICATION_ID, CLASSIFICATION_TITLE, NAME_FK, PARENT_FK, SEC_REFERENCE_FK, SEC_REFERENCE, SORT_INDEX, EXCLUDED, EXCLUDED_NOTES, PUBLISHED, UNPLACED};
290 295
    }
291 296
    final static String[] synonymColumns(){
292 297
        return new String[]{SYNONYM_ID, TAXON_FK, NAME_FK, SYN_SEC_REFERENCE_FK, SYN_SEC_REFERENCE, SEC_REFERENCE_FK, SEC_REFERENCE,

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)