comparison src/de/mpiwg/anteater/xml/impl/AnalysisXMLManager.java @ 4:dcc35f89dce3

include linneaus findings
author jdamerow
date Thu, 25 Oct 2012 15:25:08 -0700
parents ae96e4bc7fb2
children 50aeb96a8ee9
comparison
equal deleted inserted replaced
3:ae96e4bc7fb2 4:dcc35f89dce3
130 } 130 }
131 131
132 public void addSupplInfCommonNamesResult(String result) { 132 public void addSupplInfCommonNamesResult(String result) {
133 addElementToDoc(result, "/analysis/commonNames/supplementary_information"); 133 addElementToDoc(result, "/analysis/commonNames/supplementary_information");
134 } 134 }
135
136 public void ensureCommonNamesStrucuture() {
137 List<Element> nodes = executeXPath("/analysis/commonNames", null);
138 List<Element> analysis = executeXPath("/analysis", null);
139
140 if ((analysis != null && analysis.size() > 0) && (nodes == null || nodes.size() == 0)) {
141 IXMLParser parser = new JDOMParser("\t<commonNames>\n" +
142 "\t\t<summaries>\n" +
143 "\t\t</summaries>\n" +
144 "\t\t<supplementary_information>\n" +
145 "\t\t</supplementary_information>\n" +
146 "\t</commonNames>", false);
147 Element root = parser.getRoot();
148
149 analysis.get(0).addContent(root.clone());
150 save(analysisFilepath, true);
151 }
152 }
135 153
136 private void addElementToDoc(String result, String xpath) { 154 private void addElementToDoc(String result, String xpath) {
137 IXMLParser parser = new JDOMParser(result, false); 155 IXMLParser parser = new JDOMParser(result, false);
138 Element root = parser.getRoot(); 156 Element root = parser.getRoot();
139 157