Project

General

Profile

« Previous | Next » 

Revision 26489b6c

Added by Patrick Plitzner about 10 years ago

  • completed implementation of querying for the original unit from a GBIF response

View differences:

cdmlib-ext/src/main/java/eu/etaxonomy/cdm/ext/occurrence/gbif/GbifJsonOccurrenceParser.java
118 118
                DerivedUnitFacade derivedUnitFacade = DerivedUnitFacade.NewInstance(SpecimenOrObservationType.PreservedSpecimen);
119 119
                JSONObject record = (JSONObject)o;
120 120

  
121
                if(record.has(DATASET_KEY)){
122
                    dataSetProtocol = GbifDataSetProtocol.parseProtocol(record.getString(DATASET_KEY));
123
                }
124 121
                if(record.has(DATASET_PROTOCOL)){
125
                    dataSetKey = record.getString(DATASET_PROTOCOL);
122
                    dataSetProtocol = GbifDataSetProtocol.parseProtocol(record.getString(DATASET_PROTOCOL));
123
                }
124
                if(record.has(DATASET_KEY)){
125
                    dataSetKey = record.getString(DATASET_KEY);
126 126
                }
127 127
                if(record.has(COUNTRY_CODE)){
128 128
                    String string = record.getString(COUNTRY_CODE);
......
243 243
        Object next = jsonArray.iterator().next();
244 244
        if(next instanceof JSONObject){
245 245
            JSONObject jsonObject = (JSONObject)next;
246
            if(jsonObject.has(KEY)){
247
                response.setKey(jsonObject.getString(KEY));
248
            }
249 246
            if(jsonObject.has(URL)){
250 247
                response.setEndpoint(URI.create(jsonObject.getString(URL)));
251 248
            }

Also available in: Unified diff