Project

General

Profile

Revision a651a0c4

IDa651a0c4d17ab27916db35f9ca1315d0efd2fd13
Parent cb5cbca9
Child 8b3c844e

Added by Katja Luther 7 months ago

cdm light fix export of areas without level

View differences:

cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/cdmLight/CdmLightClassificationExport.java
1265 1265
                        csvLine[table.getIndex(CdmLightExportTable.IDENTIFIER_TYPE)] = IPNI_NAME_IDENTIFIER;
1266 1266
                        csvLine[table.getIndex(CdmLightExportTable.EXTERNAL_NAME_IDENTIFIER)] = extractIdentifier(
1267 1267
                                IPNIidentifiers);
1268
                        state.getProcessor().put(table, name, csvLine);
1268
                        state.getProcessor().put(table, name.getUuid() + ", " + IPNI_NAME_IDENTIFIER, csvLine);
1269 1269
                    }
1270 1270
                    if (!tropicosIdentifiers.isEmpty()) {
1271 1271
                        csvLine = new String[table.getSize()];
1272 1272
                        csvLine[table.getIndex(CdmLightExportTable.FK)] = getId(state, name);
1273 1273
                        csvLine[table.getIndex(CdmLightExportTable.REF_TABLE)] = "ScientificName";
1274
                        csvLine[table.getIndex(CdmLightExportTable.IDENTIFIER_TYPE)] = TROPICOS_NAME_IDENTIFIER;
1274
                        csvLine[table.getIndex(CdmLightExportTable.IDENTIFIER_TYPE)] = name.getUuid() + ", " + IPNI_NAME_IDENTIFIER;
1275 1275
                        csvLine[table.getIndex(CdmLightExportTable.EXTERNAL_NAME_IDENTIFIER)] = extractIdentifier(
1276 1276
                                tropicosIdentifiers);
1277
                        state.getProcessor().put(table, name, csvLine);
1277
                        state.getProcessor().put(table, name.getUuid() + ", " + IPNI_NAME_IDENTIFIER, csvLine);
1278 1278
                    }
1279 1279
                    if (!WFOIdentifiers.isEmpty()) {
1280 1280
                        csvLine = new String[table.getSize()];
......
1283 1283
                        csvLine[table.getIndex(CdmLightExportTable.IDENTIFIER_TYPE)] = WFO_NAME_IDENTIFIER;
1284 1284
                        csvLine[table.getIndex(CdmLightExportTable.EXTERNAL_NAME_IDENTIFIER)] = extractIdentifier(
1285 1285
                                WFOIdentifiers);
1286
                        state.getProcessor().put(table, name, csvLine);
1286
                        state.getProcessor().put(table, name.getUuid() + ", " + WFO_NAME_IDENTIFIER, csvLine);
1287 1287
                    }
1288 1288
                }catch(Exception e){
1289 1289
                    state.getResult().addWarning("Please check the identifiers for "
......
1322 1322
                            csvLine[table.getIndex(CdmLightExportTable.REF_TABLE)] = tableName;
1323 1323
                            csvLine[table.getIndex(CdmLightExportTable.IDENTIFIER_TYPE)] = identifier.getType() != null? identifier.getType().getLabel():null;
1324 1324
                            csvLine[table.getIndex(CdmLightExportTable.EXTERNAL_NAME_IDENTIFIER)] = identifier.getIdentifier();
1325
                            state.getProcessor().put(table, cdmBase, csvLine);
1325
                            state.getProcessor().put(table, cdmBase.getUuid() + (identifier.getType() != null? identifier.getType().getLabel():null), csvLine);
1326 1326
                        }
1327 1327
                    }
1328 1328
                    if (cdmBase instanceof Reference ){
......
1333 1333
                            csvLine[table.getIndex(CdmLightExportTable.REF_TABLE)] = tableName;
1334 1334
                            csvLine[table.getIndex(CdmLightExportTable.IDENTIFIER_TYPE)] = "DOI";
1335 1335
                            csvLine[table.getIndex(CdmLightExportTable.EXTERNAL_NAME_IDENTIFIER)] = ref.getDoiString();
1336
                            state.getProcessor().put(table, cdmBase, csvLine);
1336
                            state.getProcessor().put(table, cdmBase.getUuid() + "DOI", csvLine);
1337 1337
                        }
1338 1338
                    }
1339 1339

  
......
1345 1345
                            csvLine[table.getIndex(CdmLightExportTable.REF_TABLE)] = tableName;
1346 1346
                            csvLine[table.getIndex(CdmLightExportTable.IDENTIFIER_TYPE)] = "ORCID";
1347 1347
                            csvLine[table.getIndex(CdmLightExportTable.EXTERNAL_NAME_IDENTIFIER)]=  ((Person)person).getOrcid().asURI();
1348
                            state.getProcessor().put(table, cdmBase, csvLine);
1348
                            state.getProcessor().put(table, cdmBase.getUuid() + "ORCID", csvLine);
1349 1349
                        }
1350 1350
                    }
1351 1351
                }
......
1984 1984
                                    csvLine[table.getIndex(CdmLightExportTable.FURTHER_AREAS)] = "0";
1985 1985
                                    for (NamedArea area : gathering.getCollectingAreas()) {
1986 1986
                                        if (index == 0) {
1987
                                            csvLine[table.getIndex(CdmLightExportTable.AREA_CATEGORY1)] = area
1988
                                                    .getLevel().getLabel();
1987
                                            csvLine[table.getIndex(CdmLightExportTable.AREA_CATEGORY1)] = area.getLevel() != null?area
1988
                                                    .getLevel().getLabel():"";
1989 1989
                                            csvLine[table.getIndex(CdmLightExportTable.AREA_NAME1)] = area.getLabel();
1990 1990
                                        }
1991 1991
                                        if (index == 1) {

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)