Revision 99d34638
Added by Andreas Müller over 3 years ago
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/facade/DerivedUnitFacadeCacheStrategy.java | ||
---|---|---|
138 | 138 |
String code = ""; |
139 | 139 |
if(facade.getCollection() != null){ |
140 | 140 |
code = facade.getCollection().getCode(); |
141 |
if (StringUtils.isBlank(code)){ |
|
142 |
code = facade.getCollection().getName(); |
|
143 |
} |
|
141 | 144 |
if (StringUtils.isBlank(code)){ |
142 | 145 |
Institution institution = facade.getCollection().getInstitute(); |
143 | 146 |
if (institution != null){ |
cdmlib-services/src/test/java/eu/etaxonomy/cdm/api/facade/DerivedUnitFacadeCacheStrategyTest.java | ||
---|---|---|
167 | 167 |
specimenFacade.setPlantDescription(plantDescription); |
168 | 168 |
collection.setCode("B"); |
169 | 169 |
Assert.assertEquals(correctCache, specimenFacade.getTitleCache()); |
170 |
collection.setCode(null); |
|
171 |
collection.setName("Herbarium Berolinense"); |
|
172 |
Assert.assertEquals(correctCache.replace("B 8909756", "Herbarium Berolinense 8909756"), specimenFacade.getTitleCache()); |
|
170 | 173 |
} |
171 | 174 |
|
172 | 175 |
@Test |
cdmlib-services/src/test/java/eu/etaxonomy/cdm/api/service/TypeDesignationSetManagerTest.java | ||
---|---|---|
36 | 36 |
import eu.etaxonomy.cdm.model.name.TaxonNameFactory; |
37 | 37 |
import eu.etaxonomy.cdm.model.name.TypeDesignationBase; |
38 | 38 |
import eu.etaxonomy.cdm.model.name.TypeDesignationStatusBase; |
39 |
import eu.etaxonomy.cdm.model.occurrence.Collection; |
|
39 | 40 |
import eu.etaxonomy.cdm.model.occurrence.DerivationEvent; |
40 | 41 |
import eu.etaxonomy.cdm.model.occurrence.DerivationEventType; |
41 | 42 |
import eu.etaxonomy.cdm.model.occurrence.DerivedUnit; |
... | ... | |
244 | 245 |
"Prionus L.\u202F\u2013\u202FTypes: Testland, near Bughausen, A.Kohlbecker 81989, 2017 (holotype: OHA); Nametype: Prionus coriatius L." |
245 | 246 |
, typeDesignationManager.print(true, true, true) |
246 | 247 |
); |
248 |
|
|
249 |
DerivedUnit specimen = std_HT.getTypeSpecimen(); |
|
250 |
specimen.setProtectedTitleCache(false); |
|
251 |
Collection collection = Collection.NewInstance(); |
|
252 |
collection.setName("OHB"); |
|
253 |
specimen.setCollection(collection); |
|
254 |
|
|
255 |
assertEquals( |
|
256 |
"Prionus L.\u202F\u2013\u202FTypes: Testland, near Bughausen, A.Kohlbecker 81989, 2017 (holotype: OHA); Nametype: Prionus coriatius L." |
|
257 |
, typeDesignationManager.print(true, true, true) |
|
258 |
); |
|
259 |
|
|
247 | 260 |
} |
248 | 261 |
|
249 | 262 |
//see #9262 |
Also available in: Unified diff
fix #9366 add collection name to specimen titleCache if collection code does not exist