Project

General

Profile

Revision 733faa22

ID733faa22d00562db5b2cb520a6ff20fd6da5b0bd
Parent fcfd1e30
Child 885af082

Added by Patrick Plitzner over 2 years ago

Initialise sample designation to format keys for IdentifiableEntity

View differences:

cdmlib-model/src/main/java/eu/etaxonomy/cdm/format/occurrences/IdentifiableEntityFormatter.java
8 8
*/
9 9
package eu.etaxonomy.cdm.format.occurrences;
10 10

  
11
import java.util.List;
12
import java.util.UUID;
13

  
14
import eu.etaxonomy.cdm.model.common.IdentifiableEntity;
15
import eu.etaxonomy.cdm.model.common.Identifier;
16

  
11 17

  
12 18
/**
13 19
 * @author pplitzner
......
23 29
    @Override
24 30
    protected void initFormatKeys(Object object) {
25 31
        super.initFormatKeys(object);
26
//        IdentifiableEntity identifiableEntity = (IdentifiableEntity)object;
27
//        List<Identifier> identifiers = identifiableEntity.getIdentifiers();
28
//        String identifierString = null;
29
//        for (Identifier identifier : identifiers) {
30
//            if(identifier.getType()!=null && identifier.getType().equals(DerivateLabelProvider.getSampleDesignationTerm())){
31
//                //first sample designation is the current
32
//                identifierString = identifier.toString();
33
//            }
34
//        }
35
//        if(identifierString!=null){
36
//            formatKeyMap.put(FormatKey.FIELD_NUMBER, identifierString);
37
//        }
32
        IdentifiableEntity identifiableEntity = (IdentifiableEntity)object;
33
        List<Identifier> identifiers = identifiableEntity.getIdentifiers();
34
        String identifierString = null;
35
        for (Identifier identifier : identifiers) {
36
            if(identifier.getType()!=null && identifier.getType().getUuid().equals(UUID.fromString("fadeba12-1be3-4bc7-9ff5-361b088d86fc"))){
37
                identifierString = identifier.getIdentifier();
38
                break;
39
            }
40
        }
41
        if(identifierString!=null){
42
            formatKeyMap.put(FormatKey.SAMPLE_DESIGNATION, identifierString);
43
        }
38 44
    }
39 45

  
40 46
}

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)