Package com.evernote.edam.type

Examples of com.evernote.edam.type.Note


      String sid = tokens.nextToken();
      String lid = tokens.nextToken();
     
      if (!sid.equals(currentNote.getGuid()) && !lid.equals(currentNote.getGuid())) {
       
        Note note = conn.getNoteTable().getNote(sid, false, false, false, false, false);
        if (note == null)
          note = conn.getNoteTable().getNote(lid, false, false, false, false, false);
   
        if (note == null)
          return;

        // If we've gotten this far, we have a bunch of values.  We need to build the link.
        StringBuffer url = new StringBuffer(100);
        String script_start = new String(
          "document.execCommand('insertHtml', false, '");
        String script_end = new String("');");
 
        url.append("<a href=\""+mime.urls().get(i).toString() +"\" style=\"color:#69aa35\">");
        url.append(note.getTitle());
        url.append("</a>");
        if (mime.urls().size() > 1)
          url.append("&nbsp;");
        browser.page().mainFrame().evaluateJavaScript(
            script_start + url + script_end);
View Full Code Here


      String notebookGuid = db.getTagTable().getNotebookGuid(parent.text(2));
      QByteArray d = data.data("application/x-nevernote-note");
      String s = d.toString();
      String noteGuidArray[] = s.split(" ");
      for (String element : noteGuidArray) {
        Note n = db.getNoteTable().getNote(element.trim(), false, false, false, false, false);
       
        // Check that...
        // 1.) Check that tag isn't already assigned to that note
        // 2.) Check that that tag is valid for that notebook or the tag isn't notebook specific
        // 3.) Check that the notebook isn't read only.
        if (!db.getNoteTable().noteTagsTable.checkNoteNoteTags(element.trim(), parent.text(2)) &&
            (notebookGuid == null || n.getNotebookGuid().equalsIgnoreCase(notebookGuid) || notebookGuid.equals("")) &&
            !db.getNotebookTable().isReadOnly(n.getNotebookGuid())) {
          db.getNoteTable().noteTagsTable.saveNoteTag(element.trim(), parent.text(2), true);
          noteSignal.tagsAdded.emit(element.trim(), parent.text(2));
        }
      }
      //tagSignal.listChanged.emit();
View Full Code Here

     
//      if (authRefreshNeeded)
//        if (!refreshConnection())
//          return;
     
      Note enNote = notes.get(i);
      try {
        if (enNote.getUpdateSequenceNum() > 0 && (enNote.isActive() == false || enNote.getDeleted() > 0)) {
          // Check that the note is valid. 
          if (enNote.isActive() == true || enNote.getDeleted() == 0) {
            conn.getNoteTable().deleteNote(enNote.getGuid());
            enNote = conn.getNoteTable().getNote(enNote.getGuid(), false, false, false, false, false);
          }
          if (syncDeletedContent) {
            logger.log(logger.EXTREME, "Deleted note found & synch content selected");
            Note delNote = conn.getNoteTable().getNote(enNote.getGuid(), true, true, true, true, true);
            delNote = getNoteContent(delNote);
            delNote = noteStore.updateNote(authToken, delNote);
            enNote.setUpdateSequenceNum(delNote.getUpdateSequenceNum());
            conn.getNoteTable().updateNoteSequence(enNote.getGuid(), enNote.getUpdateSequenceNum());
          } else {
            logger.log(logger.EXTREME, "Deleted note found & sync content not selected");
            int usn = noteStore.deleteNote(authToken, enNote.getGuid());
            enNote.setUpdateSequenceNum(usn);
View Full Code Here

    logger.log(logger.EXTREME, "Doing local deletes");
    List<String> guid = chunk.getExpungedNotes();
    if (guid != null) {
      for (int i=0; i<guid.size() && keepRunning; i++) {
        String notebookGuid = "";
        Note localNote = conn.getNoteTable().getNote(guid.get(i), false, false, false, false, false);
        if (localNote != null) {
          conn.getNoteTable().updateNoteSequence(guid.get(i), 0);
          notebookGuid = localNote.getNotebookGuid();
        }
        // If the note is in a local notebook (which means we moved it) or if the
        // note returned is null (which means it is already deleted or flagged expunged)
        // we delete it.
        if (!conn.getNotebookTable().isNotebookLocal(notebookGuid) || localNote == null) {
View Full Code Here

    // 1.) If the resource is not in the local database, we add it.
    // 2.) If a copy of the resource is in the local database and the note isn't dirty, we update the local copy
    // 3.) If a copy of the resource is in the local databbase and it is dirty and the hash doesn't match, we ignore it because there
    //     is a conflict.  The note conflict should get a copy of the resource at that time.
   
    Note n = conn.getNoteTable().getNote(resource.getNoteGuid(), false, false, false, false, false);
    if (n!=null) {
      logger.log(logger.HIGH, "Resource for note " +n.getGuid() +" : " +n.getTitle());
    }
    boolean saveNeeded = false;
    /* #1 */    Resource r = getEvernoteResource(noteStore, resource.getGuid(), true,true,true, authToken);
            Resource l = conn.getNoteTable().noteResourceTable.getNoteResource(r.getGuid(), false);
            if (l == null) {
View Full Code Here

        logger.log(logger.LOW, i +" : " +note.get(i).getGuid() + " : " +note.get(i).getTitle() );
      }
      logger.log(logger.LOW, "---");
     
      for (int i=0; i<note.size() && keepRunning; i++) {
        Note n = getEvernoteNote(noteStore, note.get(i).getGuid(), true, fullSync, true,true, token);
        syncRemoteNote(n, fullSync, token);
      }
    }
    logger.log(logger.EXTREME, "Leaving SyncRunner.syncRemoteNotes");
  }
View Full Code Here

        }
      }
    }
  }
  private Note getEvernoteNote(Client noteStore, String guid, boolean withContent, boolean withResourceData, boolean withResourceRecognition, boolean withResourceAlternateData, String token) {
    Note n = null;
    try {
      logger.log(logger.EXTREME, "Retrieving note " +guid);
      n = noteStore.getNote(token, guid, withContent, withResourceData, withResourceRecognition, withResourceAlternateData);
      logger.log(logger.EXTREME, "Note " +guid +" has been retrieved.");
    } catch (EDAMUserException e) {
View Full Code Here

  }

 
  private boolean checkForConflict(Note n) {
    logger.log(logger.EXTREME, "Checking note sequence number  " +n.getGuid());
    Note oldNote = conn.getNoteTable().getNote(n.getGuid(), false, false, false, false, false);
    logger.log(logger.EXTREME, "Local/Remote sequence numbers: " +oldNote.getUpdateSequenceNum()+"/"+n.getUpdateSequenceNum());
    logger.log(logger.LOW, "Remote Note Title:" +n.getTitle());
    logger.log(logger.LOW, "Local Note Title:" +oldNote.getTitle());
    if (oldNote.getUpdateSequenceNum() == n.getUpdateSequenceNum()) {
      return false;
    }
    boolean oldIsDirty = conn.getNoteTable().isNoteDirty(n.getGuid());
    if (!oldIsDirty)
      return false;
View Full Code Here

    trayIcon.activated.connect(this, "trayActivated(com.trolltech.qt.gui.QSystemTrayIcon$ActivationReason)");

    currentNoteGuid="";
    currentNoteGuid = Global.getLastViewedNoteGuid();
    if (currentNoteGuid.equals(""))
      currentNote = new Note();
      historyGuids = new ArrayList<String>();
      historyPosition = 0;
      fromHistory = false;
    noteDirty = false;
    if (!currentNoteGuid.trim().equals("")) {
View Full Code Here

   
    for (int i=0; i<listManager.getMasterNoteIndex().size(); i++) {
      if (listManager.getMasterNoteIndex().get(i).getGuid().equals(noteGuid)) {
        List<String> tagNames = new ArrayList<String>();
        tagNames.add(new String(tagName));
        Note n = listManager.getMasterNoteIndex().get(i);
        for (int j=0; j<n.getTagNames().size(); j++) {
          tagNames.add(new String(n.getTagNames().get(j)));
        }
        listManager.getNoteTableModel().updateNoteTags(noteGuid, n.getTagGuids(), tagNames);
        if (n.getGuid().equals(currentNoteGuid)) {
          Collections.sort(tagNames);
          String display = "";
          for (int j=0; j<tagNames.size(); j++) {
            display = display+tagNames.get(j);
            if (j+2<tagNames.size())
View Full Code Here

TOP

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

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.