Skip to content

Commit

Permalink
Temporary workaround for discontinuation of old BioPortal web services.
Browse files Browse the repository at this point in the history
  • Loading branch information
balhoff committed May 8, 2014
1 parent e7e7872 commit cd3b3f3
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/org/phenoscape/util/ProvisionalTermUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,18 @@ public static List<OBOClass> getProvisionalTerms(OBOSession session) throws Ille
final DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
final DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
final Document xmlDoc = new DOMBuilder().build(docBuilder.parse(response.getEntity().getContent()));
@SuppressWarnings("unchecked")
final List<Element> termElements = xmlDoc.getRootElement().getChild("data").getChild("page").getChild("contents").getChild("classBeanResultList").getChildren("classBean");
final List<OBOClass> terms = new ArrayList<OBOClass>();
for (Element element : termElements) {
terms.add(createClassForProvisionalTerm(element, session));
if (xmlDoc.getRootElement().getChild("data") != null) {
@SuppressWarnings("unchecked")
final List<Element> termElements = xmlDoc.getRootElement().getChild("data").getChild("page").getChild("contents").getChild("classBeanResultList").getChildren("classBean");
final List<OBOClass> terms = new ArrayList<OBOClass>();
for (Element element : termElements) {
terms.add(createClassForProvisionalTerm(element, session));
}
return terms;
} else {
return Collections.emptyList();
}
return terms;

}
}

Expand Down

0 comments on commit cd3b3f3

Please sign in to comment.