}\r
\r
\r
+ /**\r
+ * @param line\r
+ * @param parameterMap\r
+ * @param appConfig\r
+ * @param config\r
+ * @return\r
+ */\r
private ReferenceBase getPublicationFromLine(String line, Map<Integer, String> parameterMap, ICdmApplicationConfiguration appConfig, IpniServicePublicationConfigurator config) {\r
//fill value map\r
String[] splits = line.split("%");\r
ref.setPlacePublished(valueMap.get(PLACE));\r
\r
String author = valueMap.get(PUBLICATION_AUTHOR_TEAM);\r
- Team team = Team.NewTitledInstance(author, author);\r
- ref.setAuthorTeam(team);\r
+ if (StringUtils.isNotBlank(author)){\r
+ Team team = Team.NewTitledInstance(author, author);\r
+ ref.setAuthorTeam(team);\r
+ }\r
\r
//remarks\r
String remarks = valueMap.get(REMARKS);\r
Annotation annotation = Annotation.NewInstance(remarks, AnnotationType.EDITORIAL(), Language.ENGLISH());\r
ref.addAnnotation(annotation);\r
\r
+\r
+ String tl2AuthorString = valueMap.get(TL2_AUTHOR);\r
+ if (ref.getAuthorTeam() == null){\r
+ Team tl2Author = Team.NewTitledInstance(tl2AuthorString, null);\r
+ ref.setAuthorTeam(tl2Author);\r
+ }else{\r
+ //TODO parse name, \r
+ ref.getAuthorTeam().setTitleCache(tl2AuthorString, true);\r
+ ref.addAnnotation(Annotation.NewInstance(tl2AuthorString, AnnotationType.EDITORIAL(), Language.ENGLISH()));\r
+ }\r
+\r
+ \r
//dates\r
TimePeriod date = TimePeriod.parseString(valueMap.get(DATE));\r
ref.setDatePublished(date);\r
\r
+\r
//source\r
ReferenceBase citation = getIpniCitation(appConfig);\r
ref.addSource(valueMap.get(ID), "Publication", citation, valueMap.get(VERSION));\r
\r
\r
+ \r
/* TODO\r
BPH number\r
Authors role\r
In publication facade\r
LC number\r
Preceded by\r
- TL2 author\r
TL2 number\r
TDWG abbreviation\r
*/\r
//20009158-1%1.2%Pinaceae%%N%Abies%%N%alba%apennina%subsp.%Brullo, Scelsi & Spamp.%%Brullo, Scelsi & Spamp.%Abies alba subsp. apennina%Vegetaz. Aspromonte%41 (2001)%2001%%%%%%Italy%tax. nov.\r
\r
Assert.assertEquals("There should be exactly 1 result for 'Species Plantarum, Edition 3'", 1, refList.size());\r
- ReferenceBase name = refList.get(0);\r
+ ReferenceBase ref = refList.get(0);\r
//title cache\r
- Assert.assertEquals("Title Cache for Abies albertiana should be 'Species Plantarum, Edition 3'", "Species Plantarum, Edition 3. 1764", name.getTitleCache());\r
+ //the author title may be improved in future\r
+ Assert.assertEquals("Title Cache should be 'Linnaeus, Carl, Species Plantarum, Edition 3'", "Linnaeus, Carl, Species Plantarum, Edition 3. 1764", ref.getTitleCache());\r
\r
+ \r
+ refList = service1.getPublications("Flora of Macar", null, services, config);\r
+ Assert.assertNotNull("Empty resultset should not throw exception and should not be null", refList);\r
+ \r
+ refList = service1.getPublications("Flora Europaea [ed. 2]", null, services, config);\r
+ Assert.assertEquals("There should be exactly 1 result for 'Flora Europaea [ed. 2]'", 1, refList.size());\r
+ ref = refList.get(0);\r
+ Assert.assertEquals("", "Tutin, Thomas Gaskell", ref.getAuthorTeam().getTitleCache());\r
+ \r
+ \r
// for (ReferenceBase ref : refList){\r
// System.out.println(ref.getTitleCache());\r
// }\r