writer.writeEndElement();
}
private void writeResources(List<Resource> resourceTable) {
Resource resource;
if (resourceTable.size() == 0)
return;
for (int i=0; i<resourceTable.size(); i++) {
resource = resourceTable.get(i);
writer.writeStartElement("NoteResource");
createTextNode("Guid", resource.getGuid());
createTextNode("NoteGuid", resource.getNoteGuid());
createTextNode("UpdateSequenceNumber", new Integer(resource.getUpdateSequenceNum()).toString());
createTextNode("Mime", resource.getMime());
createTextNode("Duration", new Integer(resource.getDuration()).toString());
createTextNode("Height", new Integer(resource.getHeight()).toString());
createTextNode("Width", new Integer(resource.getWidth()).toString());
logger.log(logger.EXTREME, "Checking for data node");
if (resource.getData() != null)
writeDataNode("Data", resource.getData());
logger.log(logger.EXTREME, "Checking for alternate data node");
if (resource.getAlternateData() != null)
writeDataNode("AlternateData", resource.getAlternateData());
logger.log(logger.EXTREME, "Checking for recognition");
if (resource.getRecognition() != null)
writeRecognitionNode("Recognition", resource.getRecognition());
if (resource.isActive())
createTextNode("Active", "true");
else
createTextNode("Active", "false");
logger.log(logger.EXTREME, "Checking resource attributes");
if (resource.getAttributes() != null) {
writer.writeStartElement("NoteResourceAttribute");
createTextNode("CameraMake", resource.getAttributes().getCameraMake());
createTextNode("CameraModel", resource.getAttributes().getCameraModel());
createTextNode("FileName", resource.getAttributes().getFileName());
createTextNode("RecoType", resource.getAttributes().getRecoType());
createTextNode("SourceURL", resource.getAttributes().getSourceURL());
createTextNode("Altitude", new Double(resource.getAttributes().getAltitude()).toString());
createTextNode("Longitude", new Double(resource.getAttributes().getLongitude()).toString());
createTextNode("Latitude", new Double(resource.getAttributes().getLatitude()).toString());
createTextNode("Timestamp", new Long(resource.getAttributes().getTimestamp()).toString());
if (resource.getAttributes().isAttachment())
createTextNode("Attachment", "true");
else
createTextNode("Attachment", "false");
if (resource.getAttributes().isClientWillIndex())
createTextNode("ClientWillIndex", "true");
else
createTextNode("ClientWillIndex", "false");
writer.writeEndElement();
}