extractCommonFacetData(facet, updateInfo);
facet.guid = resource.getGuid();
}
if (facet.USN==null||facet.USN<resource.getUpdateSequenceNum()) {
if (resource.isSetAlternateData()) {
Data alternateData = resource.getAlternateData();
if (alternateData.isSetBody()&&resource.isSetGuid())
saveDataBodyAsFile(updateInfo, resource.getGuid(), ALTERNATE_APPENDIX, alternateData.getBody(), resource.getMime());
if (alternateData.isSetBodyHash())
facet.alternateDataBodyHash = alternateData.getBodyHash();
if (alternateData.isSetSize())
facet.alternateDataSize = alternateData.getSize();
}
if (resource.isSetAttributes()) {
final ResourceAttributes resourceAttributes = resource.getAttributes();
if (resourceAttributes.isSetAltitude())
facet.altitude = resourceAttributes.getAltitude();
if (resourceAttributes.isSetAttachment())
facet.isAttachment = resourceAttributes.isAttachment();
if (resourceAttributes.isSetCameraMake())
facet.cameraMake = resourceAttributes.getCameraMake();
if (resourceAttributes.isSetCameraModel())
facet.cameraModel = resourceAttributes.getCameraModel();
if (resourceAttributes.isSetFileName())
facet.fileName = resourceAttributes.getFileName();
if (resourceAttributes.isSetLatitude())
facet.latitude = resourceAttributes.getLatitude();
if (resourceAttributes.isSetLongitude())
facet.longitude = resourceAttributes.getLongitude();
if (resourceAttributes.isSetRecoType())
facet.recoType = resourceAttributes.getRecoType();
if (resourceAttributes.isSetSourceURL())
facet.sourceURL = resourceAttributes.getSourceURL();
if (resourceAttributes.isSetTimestamp())
facet.timestamp = resourceAttributes.getTimestamp();
if (resourceAttributes.isSetTimestamp() &&
resourceAttributes.isSetLongitude() &&
resourceAttributes.isSetLatitude()&&
resource.isSetNoteGuid()){
// resource locations are associated with their parent note's guid
addGuestLocation(updateInfo, facet.latitude, facet.longitude, facet.altitude,
facet.timestamp, resource.getNoteGuid());
}
}
if (resource.isSetData()) {
Data data = resource.getData();
if (data.isSetBody()&&resource.isSetGuid())
saveDataBodyAsFile(updateInfo, resource.getGuid(), MAIN_APPENDIX, data.getBody(), resource.getMime());
if (data.isSetBodyHash())
facet.dataBodyHash = data.getBodyHash();
if (data.isSetSize())
facet.dataSize = data.getSize();
}
if (resource.isSetHeight())
facet.height = resource.getHeight();
if (resource.isSetMime())
facet.mime = resource.getMime();
if (resource.isSetNoteGuid())
facet.noteGuid = resource.getNoteGuid();
if (resource.isSetRecognition()) {
Data recognitionData = resource.getRecognition();
if (recognitionData.isSetBody()&&resource.isSetGuid())
saveDataBodyAsFile(updateInfo, resource.getGuid(), RECOGNITION_APPENDIX, recognitionData.getBody(), null);
if (recognitionData.isSetBodyHash())
facet.recognitionDataBodyHash = recognitionData.getBodyHash();
if (recognitionData.isSetSize())
facet.recognitionDataSize = recognitionData.getSize();
}
if (resource.isSetUpdateSequenceNum())
facet.USN = resource.getUpdateSequenceNum();
if (resource.isSetWidth())
facet.width = resource.getWidth();