Project

General

Profile

« Previous | Next » 

Revision 6e8ebcb6

Added by Andreas Müller over 2 years ago

ref #5952, ref #5951 add identityCache formatting to SpecimenOrObservationBase cache strategies

View differences:

cdmlib-model/src/main/java/eu/etaxonomy/cdm/strategy/cache/occurrence/DnaSampleDefaultCacheStrategy.java
86 86

  
87 87
		return result;
88 88
	}
89

  
90
	//NOTE: this is a first implementation, it may be adapted in future
91
    @Override
92
    protected String doGetIdentityCache(DnaSample dnaSample) {
93
        String result = getCollectionAndAccession(dnaSample);
94
        //sample designation
95
        if (isBlank(result)){
96
            result = dnaSample.getIdentifierString(DefinedTerm.uuidSampleDesignation);
97
        }
98
        //any other identifier
99
        if (isBlank(result)){
100
            if (!dnaSample.getIdentifiers().isEmpty()){
101
                result = dnaSample.getIdentifiers().get(0).getIdentifier();
102
            }
103
        }
104
        if (isBlank(result)){
105
            return doGetTitleCache(dnaSample);
106
        }else{
107
            return result;
108
        }
109
    }
89 110
}

Also available in: Unified diff