Package com.evernote.edam.type

Examples of com.evernote.edam.type.User


    if (user.getAccounting()!=null)
      saveUserAccounting(user.getAccounting());

    }
    public static User getUserInformation() {
      User user = new User();
      settings.beginGroup("User");
      try
        user.setId((Integer)settings.value("id", 0));       
      } catch  (java.lang.ClassCastException e) {
        user.setId(new Integer((String)settings.value("id", "0")));
      }
    String username = (String)settings.value("username", "");
    String email = (String)settings.value("email", "");
    String name = (String)settings.value("name", "");
    String timezone = (String)settings.value("timezone", "");
    Integer privilege = 0;
    try
      privilege = new Integer((String)settings.value("privilege", "0"));     
    } catch (java.lang.ClassCastException e) {
      privilege = (Integer)settings.value("privilege", 0);
    }

    try
      String date = (String)settings.value("created", "0");
      user.setCreated(new Long(date));
      date = (String)settings.value("updated", "0");
      user.setUpdated(new Long(date));
      date = (String)settings.value("deleted", "0");
      user.setDeleted(new Long(date));
    } catch (java.lang.ClassCastException e) {
      Long date = (Long)settings.value("created", 0);
      user.setCreated(date);
      date = (Long)settings.value("updated", 0);
      user.setUpdated(date);
      date = (Long)settings.value("deleted", 0);
      user.setDeleted(date);
    }

    String shard = (String)settings.value("shard", "");
      settings.endGroup();
     
      user.setUsername(username);
      user.setEmail(email);
      user.setName(name);
      user.setTimezone(timezone);
      PrivilegeLevel userLevel = PrivilegeLevel.findByValue(privilege);
      user.setPrivilege(userLevel);
      user.setShardId(shard);
      return user;
    }
View Full Code Here


        logger.log(logger.EXTREME, "Insert link canceled");
        return;
      }
    }

    User user = Global.getUserInformation();
       String dUrl = new String("evernote:///view/") + new String(user.getId() + "/" +user.getShardId() +"/"
           +dialog.getSelectedNote()+"/"+dialog.getSelectedNote() +"/ " +"style=\"color:#69aa35\"");
   
    String url = "<a title=\"" +dUrl
        +"\" href=" +dUrl
        +" >"+text +"</a>";
View Full Code Here

      status.message.emit(tr("Synchronizing with Evernote"));
     
      // Get user information
      try {
        logger.log(logger.EXTREME, "getting user from userstore");
        User user = userStore.getUser(authToken);
        logger.log(logger.EXTREME, "Saving user information");
        syncSignal.saveUserInformation.emit(user);
      } catch (EDAMUserException e1) {
        e1.printStackTrace();
        status.message.emit(tr("User exception getting user account information.  Aborting sync and disconnecting"));
View Full Code Here

        //authRefreshTime = authTimeRemaining / 2;
      //}
     
    // Get user information
    try {
      User user = userStore.getUser(authToken);
      syncSignal.saveUserInformation.emit(user);
    } catch (EDAMUserException e1) {
      e1.printStackTrace();
    } catch (EDAMSystemException e1) {
      e1.printStackTrace();
View Full Code Here

    String url;
    mime.setText(currentNoteGuid);
    List<QUrl> urls = new ArrayList<QUrl>();
   
    // Start building the URL
    User user = Global.getUserInformation();

    // Check that we have everything we need
       if ((user.getShardId().equals("") || user.getId() == 0) && !Global.bypassSynchronizationWarning()) {
         SynchronizationRequiredWarning warning = new SynchronizationRequiredWarning(this);
         warning.exec();
         if (!warning.neverSynchronize())
           return;
         else {
           Global.setBypassSynchronizationWarning(true);
           user.setShardId("s0");
           user.setId(0);
        
       }

   
    // Start building a list of URLs based upon the selected notes
      noteTableView.showColumn(Global.noteTableGuidPosition);
     
      List<QModelIndex> selections = noteTableView.selectionModel().selectedRows();
      if (!Global.isColumnVisible("guid"))
        noteTableView.hideColumn(Global.noteTableGuidPosition);

       // Check that the note is either synchronized, or in a local notebook
       for (int i=0; i<selections.size(); i++) {
         QModelIndex index;
         int row = selections.get(i).row();
        index = noteTableView.proxyModel.index(row, Global.noteTableGuidPosition);
        SortedMap<Integer, Object> ix = noteTableView.proxyModel.itemData(index);
           String selectedGuid = (String)ix.values().toArray()[0];
          
           Note n = conn.getNoteTable().getNote(selectedGuid, false, false, false, false, false);
           if (n.getUpdateSequenceNum() == 0 && !conn.getNotebookTable().isNotebookLocal(n.getNotebookGuid())) {
             QMessageBox.critical(this, tr("Please Synchronize") ,tr("Please either synchronize or move any " +
                 "new notes to a local notebook."));
             return;
           }
       }

       // Start building the URLs
      for (int i=0; i<selections.size(); i++) {
        QModelIndex index;
         int row = selections.get(i).row();
        index = noteTableView.proxyModel.index(row, Global.noteTableGuidPosition);
        SortedMap<Integer, Object> ix = noteTableView.proxyModel.itemData(index);
           String selectedGuid = (String)ix.values().toArray()[0];
           mime.setText(selectedGuid);
   
           String lid;
           String gid;
           Note selectedNote = conn.getNoteTable().getNote(selectedGuid, false, false, false, false, false);
           if (selectedNote.getUpdateSequenceNum() > 0) {
             gid = selectedGuid;
             lid = selectedGuid;
           } else {
             gid = "00000000-0000-0000-0000-000000000000";
             lid = selectedGuid;
           }
           url = new String("evernote://///view/") + new String(user.getId() + "/" +user.getShardId() +"/"
               +gid+"/"+lid +"/");
           urls.add(new QUrl(url));
      }
    mime.setUrls(urls);
    clipboard.setMimeData(mime);
View Full Code Here

      LinkedNotebook createdLinkedNotebook = new LinkedNotebook();
      stub(personalClient.createLinkedNotebook(isA(LinkedNotebook.class)))
          .toReturn(createdLinkedNotebook);

      User user = new User();
      user.setUsername("username");
      user.setShardId("shardId");
      AuthenticationResult authenticationResult = new AuthenticationResult();
      authenticationResult.setUser(user);

      client = new BusinessNoteStoreClient(personalClient, noteStoreClient,
          authenticationResult);
View Full Code Here

TOP

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

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.