XMLUtils.addNode(doc, channel, "category", "data transfer");
XMLUtils.addNode(doc, channel, "generator", "CAS File Manager");
XMLUtils.addNode(doc, channel, "lastBuildDate", buildPubDate);
for (Iterator i = currentTransfers.iterator(); i.hasNext();) {
FileTransferStatus status = (FileTransferStatus) i.next();
Element item = XMLUtils.addNode(doc, channel, "item");
XMLUtils.addNode(doc, item, "title", status
.getParentProduct().getProductName());
XMLUtils.addNode(doc, item, "description", status
.getParentProduct().getProductType().getName());
XMLUtils.addNode(doc, item, "link", base
+ "/viewTransfer?ref="
+ status.getFileRef().getOrigReference() + "&size="
+ status.getFileRef().getFileSize());
Metadata m = null;
try {
m = fClient.getMetadata(status.getParentProduct());
String productReceivedTime = m
.getMetadata("CAS.ProductReceivedTime");
Date receivedTime = null;
try {
receivedTime = DateConvert
.isoParse(productReceivedTime);
} catch (ParseException ignore) {
}
if (receivedTime != null) {
XMLUtils.addNode(doc, item, "pubDate",
dateFormatter.format(receivedTime));
}
} catch (CatalogException ignore) {
}
XMLUtils.addNode(doc, item, "source",
"file manager transfers");
XMLUtils.addNode(doc, item, "cas:source",
"file manager transfers");
XMLUtils.addNode(doc, item, "cas:bytesTransferred", ""
+ status.getBytesTransferred());
XMLUtils.addNode(doc, item, "cas:totalBytes", ""
+ status.getFileRef().getFileSize());
XMLUtils.addNode(doc, item, "cas:percentComplete", ""
+ status.computePctTransferred());
}
DOMSource source = new DOMSource(doc);
TransformerFactory transFactory = TransformerFactory