Project

General

Profile

Revision 3c8d638c

ID3c8d638c7da073ef991e0897f4995abfc8285202
Parent 310f2e0f
Child 652fec24

Added by Patrick Plitzner almost 5 years ago

Use title cache as fallback for specimen DTO for portal table

View differences:

cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/OccurrenceServiceImpl.java
67 67
import eu.etaxonomy.cdm.api.service.search.SearchResult;
68 68
import eu.etaxonomy.cdm.api.service.search.SearchResultBuilder;
69 69
import eu.etaxonomy.cdm.api.service.util.TaxonRelationshipEdge;
70
import eu.etaxonomy.cdm.common.CdmUtils;
70 71
import eu.etaxonomy.cdm.common.monitor.IProgressMonitor;
71 72
import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
72 73
import eu.etaxonomy.cdm.model.CdmBaseType;
......
516 517
        }
517 518
        PreservedSpecimenDTO preservedSpecimenDTO = new PreservedSpecimenDTO();
518 519

  
519
        // check identifiers in priority order accNo>barCode>catalogNumber
520
        if (derivedUnit.getAccessionNumber() != null && !derivedUnit.getAccessionNumber().isEmpty()) {
521
            preservedSpecimenDTO.setAccessionNumber(derivedUnit.getAccessionNumber());
522
        }
523
        else if(derivedUnit.getBarcode()!=null && !derivedUnit.getBarcode().isEmpty()){
524
            preservedSpecimenDTO.setAccessionNumber(derivedUnit.getBarcode());
520
        // check identifiers in priority order accNo>barCode>catalogNumber>collection
521
        String identifier = derivedUnit.getMostSignificantIdentifier();
522
        if(CdmUtils.isBlank(identifier) && derivedUnit.getCollection()!=null){
523
        	identifier = derivedUnit.getCollection().toString();
525 524
        }
526
        else if(derivedUnit.getCatalogNumber()!=null && !derivedUnit.getCatalogNumber().isEmpty()){
527
            preservedSpecimenDTO.setAccessionNumber(derivedUnit.getCatalogNumber());
525
        if(CdmUtils.isBlank(identifier)){
526
        	identifier = derivedUnit.getTitleCache();
528 527
        }
528
        preservedSpecimenDTO.setAccessionNumber(identifier);
529 529
        preservedSpecimenDTO.setUuid(derivedUnit.getUuid().toString());
530 530

  
531 531
        //preferred stable URI

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)