Package com.evernote.edam.type

Examples of com.evernote.edam.type.ResourceAttributes


                            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());
                        }
View Full Code Here


       
        int fileNamePos = address.lastIndexOf(File.separator);
        if (fileNamePos == -1)
          fileNamePos = address.lastIndexOf("/");
         String fileName = address.substring(fileNamePos+1);
        ResourceAttributes a = new ResourceAttributes();
        a.setAltitude(0);
        a.setAltitudeIsSet(false);
        a.setLongitude(0);
        a.setLongitudeIsSet(false);
        a.setLatitude(0);
        a.setLatitudeIsSet(false);
        a.setCameraMake("");
        a.setCameraMakeIsSet(false);
        a.setCameraModel("");
        a.setCameraModelIsSet(false);
        a.setAttachment(false);
        a.setAttachmentIsSet(true);
        a.setClientWillIndex(false);
        a.setClientWillIndexIsSet(true);
        a.setRecoType("");
        a.setRecoTypeIsSet(false);
        a.setSourceURL(fileName);
        a.setSourceURLIsSet(true);
        a.setTimestamp(0);
        a.setTimestampIsSet(false);
        a.setFileName(fileName);
        a.setFileNameIsSet(true);
        r.setAttributes(a);
       
        //conn.getNoteTable().noteResourceTable.saveNoteResource(r, true);
        logger.log(logger.EXTREME, "Resource created");
       
View Full Code Here

    }
    return data;
  }

  private ResourceAttributes processResourceAttributes() {
    ResourceAttributes attributes = new ResourceAttributes();
    boolean atEnd = false;
    while(!atEnd) {
      if (reader.isStartElement()) {
        if (reader.name().equalsIgnoreCase("CameraMake"))
          attributes.setCameraMake(textValue());   
        if (reader.name().equalsIgnoreCase("CameraModel"))
          attributes.setCameraModel(textValue());   
        if (reader.name().equalsIgnoreCase("FileName"))
          attributes.setFileName(textValue());   
        if (reader.name().equalsIgnoreCase("RecoType"))
          attributes.setRecoType(textValue());   
        if (reader.name().equalsIgnoreCase("CameraModel"))
          attributes.setCameraMake(textValue());   
        if (reader.name().equalsIgnoreCase("SourceURL"))
          attributes.setSourceURL(textValue());   
        if (reader.name().equalsIgnoreCase("Altitude"))
          attributes.setAltitude(doubleValue());   
        if (reader.name().equalsIgnoreCase("Longitude"))
          attributes.setLongitude(doubleValue());   
        if (reader.name().equalsIgnoreCase("Latitude"))
          attributes.setLatitude(doubleValue());   
        if (reader.name().equalsIgnoreCase("Timestamp"))
          attributes.setTimestamp(longValue());   
        if (reader.name().equalsIgnoreCase("Attachment"))
          attributes.setAttachment(booleanValue());   
        if (reader.name().equalsIgnoreCase("ClientWillIndex"))
          attributes.setClientWillIndex(booleanValue());   
      }
      reader.readNext();
      if (reader.name().equalsIgnoreCase("noteresourceattribute") && reader.isEndElement())
        atEnd = true;
    }
View Full Code Here

      reader.readNext();
      if (reader.name().equalsIgnoreCase("resource") && reader.isEndElement())
        atEnd = true;
    }
    if (resource.getAttributes() == null)
      resource.setAttributes(new ResourceAttributes());
    conn.getNoteTable().noteResourceTable.updateNoteResource(resource, true);
    return resource;
  }
View Full Code Here

    }
    return reco;
  }
 
  private ResourceAttributes processResourceAttributes() {
    ResourceAttributes attributes = new ResourceAttributes();
    boolean atEnd = false;
    while(!atEnd) {
      if (reader.isStartElement()) {
        if (reader.name().equalsIgnoreCase("camera-model"))
          attributes.setCameraModel(textValue());   
        if (reader.name().equalsIgnoreCase("file-name"))
          attributes.setFileName(textValue());   
        if (reader.name().equalsIgnoreCase("reco-type"))
          attributes.setRecoType(textValue());   
        if (reader.name().equalsIgnoreCase("camera-make"))
          attributes.setCameraMake(textValue());   
        if (reader.name().equalsIgnoreCase("source-url"))
          attributes.setSourceURL(textValue());   
        if (reader.name().equalsIgnoreCase("Altitude"))
          attributes.setAltitude(doubleValue());   
        if (reader.name().equalsIgnoreCase("Longitude"))
          attributes.setLongitude(doubleValue());   
        if (reader.name().equalsIgnoreCase("Latitude"))
          attributes.setLatitude(doubleValue());   
        if (reader.name().equalsIgnoreCase("Timestamp"))
          attributes.setTimestamp(longValue());   
        if (reader.name().equalsIgnoreCase("Attachment"))
          attributes.setAttachment(booleanValue());   
        if (reader.name().equalsIgnoreCase("ClientWillIndex"))
          attributes.setClientWillIndex(booleanValue());   
      }
      reader.readNext();
      if (reader.name().equalsIgnoreCase("resource-attributes") && reader.isEndElement())
        atEnd = true;
    }
View Full Code Here

       
        int fileNamePos = url.lastIndexOf(File.separator);
        if (fileNamePos == -1)
          fileNamePos = url.lastIndexOf("/");
         String fileName = url.substring(fileNamePos+1);
        ResourceAttributes a = new ResourceAttributes();
        a.setAltitude(0);
        a.setAltitudeIsSet(false);
        a.setLongitude(0);
        a.setLongitudeIsSet(false);
        a.setLatitude(0);
        a.setLatitudeIsSet(false);
        a.setCameraMake("");
        a.setCameraMakeIsSet(false);
        a.setCameraModel("");
        a.setCameraModelIsSet(false);
        a.setAttachment(attachment);
        a.setAttachmentIsSet(true);
        a.setClientWillIndex(false);
        a.setClientWillIndexIsSet(true);
        a.setRecoType("");
        a.setRecoTypeIsSet(false);
        a.setSourceURL(url);
        a.setSourceURLIsSet(true);
        a.setTimestamp(0);
        a.setTimestampIsSet(false);
        a.setFileName(fileName);
        a.setFileNameIsSet(true);
        r.setAttributes(a);
       
        conn.getNoteTable().noteResourceTable.saveNoteResource(r, true);
        logger.log(logger.EXTREME, "Resource created");
        return r;
View Full Code Here

        d.setBodyHash(hash);
        d.setBodyHashIsSet(true);
        r.setData(d);
        d.setSize(fileData.length);
       
        ResourceAttributes a = new ResourceAttributes();
        a.setAltitude(0);
        a.setAltitudeIsSet(false);
        a.setLongitude(0);
        a.setLongitudeIsSet(false);
        a.setLatitude(0);
        a.setLatitudeIsSet(false);
        a.setCameraMake("");
        a.setCameraMakeIsSet(false);
        a.setCameraModel("");
        a.setCameraModelIsSet(false);
        a.setAttachment(attachment);
        a.setAttachmentIsSet(true);
        a.setClientWillIndex(false);
        a.setClientWillIndexIsSet(true);
        a.setRecoType("");
        a.setRecoTypeIsSet(false);
        a.setSourceURLIsSet(false);
        a.setTimestamp(0);
        a.setTimestampIsSet(false);
        a.setFileName(fileInfo.fileName());
        a.setFileNameIsSet(true);
        r.setAttributes(a);
       
        conn.getNoteTable().noteResourceTable.saveNoteResource(r, true);
        return r;
      } catch (NoSuchAlgorithmException e1) {
View Full Code Here

        rec.setSize(new Integer(query.valueString(11)));
      else
        rec.setSize(0);
      r.setRecognition(rec);

      ResourceAttributes a = new ResourceAttributes();
      if (!query.valueString(12).equals(""))              // Latitude
        a.setLatitude(new Float(query.valueString(12)));
      if (!query.valueString(13).equals(""))              // Longitude
        a.setLongitude(new Float(query.valueString(13)));
      if (!query.valueString(14).equals(""))              // Altitude
        a.setAltitude(new Float(query.valueString(14)));
      a.setCameraMake(stringValue(query.valueString(15)));              // Camera Make
      a.setCameraModel(stringValue(query.valueString(16)));
      a.setClientWillIndex(booleanValue(query.valueString(17).toString(),false))// Camera Model
      a.setRecoType(stringValue(query.valueString(18)));                 // Recognition Type
      a.setFileName(stringValue(query.valueString(19)));                  // File Name
      a.setAttachment(booleanValue(query.valueString(20).toString(),false));
      a.setSourceURL(query.valueString(21));
      r.setAttributes(a);
   
      if (withBinary) {
         
        query.prepare("Select dataBinary from NoteResources where guid=:guid");
View Full Code Here

    // It can also
    // include attributes such as filename and location.
    Resource resource = new Resource();
    resource.setData(readFileAsData(fileName));
    resource.setMime(mimeType);
    ResourceAttributes attributes = new ResourceAttributes();
    attributes.setFileName(fileName);
    resource.setAttributes(attributes);

    // Now, add the new Resource to the note's list of resources
    note.addToResources(resource);
View Full Code Here

TOP

Related Classes of com.evernote.edam.type.ResourceAttributes

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.