Revision 9e5bde9c
Added by Andreas Müller almost 2 years ago
cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/cdmLight/CdmLightClassificationExport.java | ||
---|---|---|
339 | 339 |
csvLine[table.getIndex(CdmLightExportTable.NAME_FK)] = getId(state, name); |
340 | 340 |
Taxon parent = (taxonNode.getParent() == null) ? null : taxonNode.getParent().getTaxon(); |
341 | 341 |
csvLine[table.getIndex(CdmLightExportTable.PARENT_FK)] = getId(state, parent); |
342 |
|
|
343 |
//secundum reference |
|
342 | 344 |
csvLine[table.getIndex(CdmLightExportTable.SEC_REFERENCE_FK)] = getId(state, taxon.getSec()); |
343 | 345 |
if (taxon.getSec() != null && taxon.getSec().getDatePublished() != null |
344 | 346 |
&& taxon.getSec().getDatePublished().getFreeText() != null) { |
... | ... | |
1125 | 1127 |
NomenclaturalSource nomenclaturalSource = name.getNomenclaturalSource(); |
1126 | 1128 |
if (nomenclaturalSource != null &&nomenclaturalSource.getNameUsedInSource() != null){ |
1127 | 1129 |
handleName(state, nomenclaturalSource.getNameUsedInSource(), null); |
1128 |
csvLine[table.getIndex(CdmLightExportTable.NAME_USED_IN_SOURCE)] = getId(state, nomenclaturalSource.getNameUsedInSource()); |
|
1130 |
csvLine[table.getIndex(CdmLightExportTable.NAME_USED_IN_SOURCE_FK)] = getId(state, nomenclaturalSource.getNameUsedInSource());
|
|
1129 | 1131 |
} |
1130 | 1132 |
|
1131 | 1133 |
if (nomRef != null) { |
... | ... | |
1265 | 1267 |
TypeDesignationSetManager manager = new TypeDesignationSetManager(specimenTypeDesignations, name); |
1266 | 1268 |
HTMLTagRules rules = new HTMLTagRules(); |
1267 | 1269 |
rules.addRule(TagEnum.name, "i"); |
1268 |
String test = manager.print(false, false, false, rules);; |
|
1269 | 1270 |
csvLine[table.getIndex(CdmLightExportTable.TYPE_SPECIMEN)] = manager.print(false, false, false, rules); |
1270 | 1271 |
|
1271 | 1272 |
StringBuilder stringbuilder = new StringBuilder(); |
cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/cdmLight/CdmLightExportTable.java | ||
---|---|---|
114 | 114 |
protected static final String COMB_EX_AUTHORTEAM_FK = "PublishingExAuthorTeam_Fk"; |
115 | 115 |
protected static final String COMB_AUTHORTEAM_FK = "PublishingAuthorTeam_Fk"; |
116 | 116 |
protected static final String AUTHOR_TEAM_STRING = "AuthorTeamString"; |
117 |
protected static final String NAME_USED_IN_SOURCE = "NameUsedInSource_Fk"; |
|
117 |
protected static final String NAME_USED_IN_SOURCE_FK = "NameUsedInSource_Fk";
|
|
118 | 118 |
// protected static final String REFERENCE_FK = "Reference_Fk" |
119 | 119 |
protected static final String PUBLICATION_TYPE = "PublicationType"; |
120 | 120 |
protected static final String ABBREV_TITLE = "AbbreviatedTitle"; |
... | ... | |
337 | 337 |
ABBREV_REF_AUTHOR, FULL_REF_AUTHOR, COLLATION, VOLUME_ISSUE, |
338 | 338 |
DETAIL, DATE_PUBLISHED, YEAR_PUBLISHED, VERBATIM_DATE, PROTOLOGUE_URI, |
339 | 339 |
NOM_STATUS, NOM_STATUS_ABBREV, HOMOTYPIC_GROUP_FK, |
340 |
HOMOTYPIC_GROUP_SEQ, PROTOLOGUE_TYPE_STATEMENT, TYPE_SPECIMEN, TYPE_STATEMENT, FULL_NAME_WITH_REF, NAME_USED_IN_SOURCE, APPENDED_PHRASE |
|
340 |
HOMOTYPIC_GROUP_SEQ, PROTOLOGUE_TYPE_STATEMENT, TYPE_SPECIMEN, TYPE_STATEMENT, FULL_NAME_WITH_REF, NAME_USED_IN_SOURCE_FK, APPENDED_PHRASE
|
|
341 | 341 |
}; |
342 | 342 |
} |
343 | 343 |
|
cdmlib-io/src/test/java/eu/etaxonomy/cdm/io/cdmLight/out/CdmLightExportTest.java | ||
---|---|---|
110 | 110 |
byte[] taxonByte = data.get(CdmLightExportTable.TAXON.getTableName()); |
111 | 111 |
Assert.assertNotNull("Taxon table must not be null", taxonByte); |
112 | 112 |
String taxonStr = new String(taxonByte); |
113 |
String notExpected = "\"9182e136-f2e2-4f9a-9010-3f35908fb5e0\"";
|
|
113 |
String notExpected = "\"9182e136-f2e2-4f9a-9010-3f35908fb5e0\""; |
|
114 | 114 |
Assert.assertFalse("Result must not contain root taxon", taxonStr.startsWith(notExpected)); |
115 | 115 |
String expected = "\"b2c86698-500e-4efb-b9ae-6bb6e701d4bc\",\"4096df99-7274-421e-8843-211b603d832e\",\"CdmLightExportTest Classification\",\"3483cc5e-4c77-4c80-8cb0-73d43df31ee3\",\"9182e136-f2e2-4f9a-9010-3f35908fb5e0\",\"4b6acca1-959b-4790-b76e-e474a0882990\",\"My sec ref\""; |
116 | 116 |
Assert.assertTrue(taxonStr.contains(expected)); |
... | ... | |
205 | 205 |
byte[] taxonByte = data.get(CdmLightExportTable.TAXON.getTableName()); |
206 | 206 |
Assert.assertNotNull("Taxon table must not be null", taxonByte); |
207 | 207 |
String taxonStr = new String(taxonByte); |
208 |
String notExpected = "\"9182e136-f2e2-4f9a-9010-3f35908fb5e0\"";
|
|
208 |
String notExpected = "\"9182e136-f2e2-4f9a-9010-3f35908fb5e0\""; |
|
209 | 209 |
Assert.assertFalse("Result must not contain root taxon", taxonStr.startsWith(notExpected)); |
210 | 210 |
String expected = "\"b2c86698-500e-4efb-b9ae-6bb6e701d4bc\",\"4096df99-7274-421e-8843-211b603d832e\",\"CdmLightExportTest Classification\",\"3483cc5e-4c77-4c80-8cb0-73d43df31ee3\",\"9182e136-f2e2-4f9a-9010-3f35908fb5e0\",\"4b6acca1-959b-4790-b76e-e474a0882990\",\"My sec ref\""; |
211 | 211 |
Assert.assertTrue(taxonStr.contains(expected)); |
Also available in: Unified diff
cleanup