Project

General

Profile

« Previous | Next » 

Revision df9fa40d

Added by Patrick Plitzner almost 6 years ago

ref #7362 Ask for detail loading when importing term

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/webimport/termimport/parser/ParserUtil.java
12 12
import org.json.JSONException;
13 13
import org.json.JSONObject;
14 14

  
15
import eu.etaxonomy.taxeditor.view.webimport.termimport.requests.RequestTerm;
16
import eu.etaxonomy.taxeditor.view.webimport.termimport.wrapper.OntologyTermWrapper;
17

  
15 18
/**
16 19
 * @author pplitzner
17 20
 * @since May 31, 2018
......
42 45
    public static String parseTerminology(JSONObject jsonObject) throws JSONException {
43 46
        return jsonObject.getString("sourceTerminology");
44 47
    }
48

  
49
    /**
50
     * Loads and sets detail information for the given wrapper
51
     * @param wrapper the wrapper for which the detailed information will be loaded and set
52
     */
53
    public static void loadDetails(OntologyTermWrapper wrapper) {
54
        String request = new RequestTerm(wrapper.getUri(), wrapper.getSourceTerminology()).request();
55
        OntologyTermWrapper detailTerm = TermParser.parseSingleTerm(request);
56
        wrapper.setDescription(detailTerm.getDescription());
57
    }
45 58
}

Also available in: Unified diff