Revision 3540
Added by barteau about 17 years ago
src/edu/ucsb/nceas/metacat/clientview/ClientFgdcHelper.java | ||
---|---|---|
176 | 176 |
if (docType != null) { |
177 | 177 |
sysId = docType.getSystemId(); |
178 | 178 |
if (sysId != null) |
179 |
result = sysId.contains(FGDC_SYSTEM_ID);
|
|
179 |
result = (sysId.indexOf(FGDC_SYSTEM_ID) > -1);
|
|
180 | 180 |
} |
181 | 181 |
} |
182 | 182 |
//*** It might not have a doc type line, so try another method. |
... | ... | |
258 | 258 |
try { |
259 | 259 |
//*** Set the Contact Person. |
260 | 260 |
node = (Node) xpath.evaluate("/distinfo/distrib/cntinfo/cntperp/cntper", result, XPathConstants.NODE); |
261 |
node.setTextContent(contactName); |
|
261 |
ClientViewHelper.setTextContent(xpath, node, contactName); |
|
262 |
//node.setTextContent(contactName); Not in java 1.4 |
|
263 |
|
|
262 | 264 |
//*** Set the metadata Doc Id. |
263 | 265 |
node = (Node) xpath.evaluate("/distinfo/resdesc", result, XPathConstants.NODE); |
264 |
node.setTextContent(resourceDescription); |
|
266 |
ClientViewHelper.setTextContent(xpath, node, resourceDescription); |
|
267 |
//node.setTextContent(resourceDescription); Not in java 1.4 |
|
268 |
|
|
265 | 269 |
//*** Set the metadata filename. |
266 | 270 |
node = (Node) xpath.evaluate("/distinfo/custom", result, XPathConstants.NODE); |
267 |
node.setTextContent(metaFNm); |
|
271 |
ClientViewHelper.setTextContent(xpath, node, metaFNm); |
|
272 |
//node.setTextContent(metaFNm); Not in java 1.4 |
|
268 | 273 |
|
269 | 274 |
//*** Loop thru the files, setting their format and Doc Id. |
270 | 275 |
stdorder = (Node) xpath.evaluate("/distinfo/stdorder", result, XPathConstants.NODE); |
... | ... | |
274 | 279 |
//*** Save the data file Doc ID (required). |
275 | 280 |
key = (String) iterIt.next(); |
276 | 281 |
node = (Node) xpath.evaluate("digtopt/onlinopt/computer/networka/networkr", digformBranch, XPathConstants.NODE); |
277 |
node.setTextContent(key); |
|
282 |
ClientViewHelper.setTextContent(xpath, node, key); |
|
283 |
//node.setTextContent(key); |
|
278 | 284 |
|
279 | 285 |
fileInfo = (String[]) dataDocIDs.get(key); |
280 | 286 |
if (fileInfo != null) { |
281 | 287 |
//*** Save the data file format (optional). |
282 | 288 |
formname = (Node) xpath.evaluate("digtinfo/formname", digformBranch, XPathConstants.NODE); |
283 | 289 |
if ((value = fileInfo[ClientView.FORMAT_TYPE]) != null && !value.equals("")) { |
284 |
formname.setTextContent(value); |
|
290 |
ClientViewHelper.setTextContent(xpath, formname, value); |
|
291 |
//formname.setTextContent(value); |
|
285 | 292 |
} else { |
286 | 293 |
//*** We did a deep clone of the branch, so clear prior contents. |
287 |
formname.setTextContent(""); |
|
294 |
ClientViewHelper.setTextContent(xpath, formname, ""); |
|
295 |
//formname.setTextContent(""); |
|
288 | 296 |
} |
289 | 297 |
//*** Save the data file name. |
290 | 298 |
formcont = (Node) xpath.evaluate("digtinfo/formcont", digformBranch, XPathConstants.NODE); |
291 | 299 |
if ((value = fileInfo[ClientView.FILE_NAME]) != null && !value.equals("")) { |
292 |
formcont.setTextContent(value); |
|
300 |
ClientViewHelper.setTextContent(xpath, formcont, value); |
|
301 |
//formcont.setTextContent(value); |
|
293 | 302 |
} else { |
294 | 303 |
//*** We did a deep clone of the branch, so clear prior contents. |
295 |
formcont.setTextContent(""); |
|
304 |
ClientViewHelper.setTextContent(xpath, formcont, ""); |
|
305 |
//formcont.setTextContent(""); |
|
296 | 306 |
} |
297 | 307 |
} |
298 | 308 |
//*** Clone branch for next file. |
Also available in: Unified diff
Converted some java 1.5 code to java 1.4 code. Removed usages of "String.contains()", "Node.getTextContent()" and "Node.setTextContent.