Package com.evernote.clients

Examples of com.evernote.clients.NoteStoreClient


        } catch (Exception e) {
            return redirect("/account/setting");
        }


        NoteStoreClient noteStoreClient = new ClientFactory(evernoteAuth).createNoteStoreClient();

        // アクセストークンが期限切れで再設定する場合、NoteBookは既に作成されている可能性があるため
        // 作成する前に既存のNotebookが存在するかをチェック
        Notebook notebook = null;
        if(loginUserModel.getEvernoteNotebookId() == null) {
            notebook = createNotebook(noteStoreClient);

        }else {
            try {
                notebook = noteStoreClient.getNotebook(loginUserModel.getEvernoteNotebookId());

            } catch (Exception e) {
                // ユーザーに削除された場合再作成する もしく アカウント変更した場合
                notebook = createNotebook(noteStoreClient);
            }
View Full Code Here


            if(activityModel.getVerb().getCategory().equals(Constants.GOOGLE_ACTIVITY_VERB_TYPE_SHARE)) {
                return null;
            }

            // Evernote オブジェクトの取得
            NoteStoreClient noteStoreClient = getNoteStoreClient(userModel);
            Note note = new Note();
            note.setTitle(getNoteTitle(activityModel));

            // ノートBody
            String nBody = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
            nBody += "<!DOCTYPE en-note SYSTEM \"http://xml.evernote.com/pub/enml2.dtd\">";
            nBody += "<en-note>";

            nBody += "<div style=\"font-family: 'Helvetica Neue', Helvetica, Arial, 'Liberation Sans', FreeSans, sans-serif; color: rgb(88, 89, 87); font-size: 14px; line-height: 1.5; overflow-y: hidden; background: rgb(230, 230, 230);margin: -20px;\">";
            nBody += "<div style=\"height: 40px;\">&nbsp;</div>";
            nBody += "<div style=\"max-width: 600px;padding: 25px 0px 0px 0px;background-color: #fff;margin: 0 auto;box-shadow: 0 0px 5px rgba(0, 0, 0, 0.2);\">";

            nBody += Utils.removeLinkTags(getNoteContents(activityModel));
            nBody += getNoteAttachmentsContents(activityModel);

            // 下部メニュー
            nBody += "<div style=\"background: #f5f5f5;min-height: 16px;padding: 1px 30px;text-align: center;border-top: 1px solid #ebebeb;margin-top: 20px;\">";
            nBody += "<p style=\"color: #747474;line-height: 1.5em;\">";
            nBody += "<a href=\"" + activityModel.getUrlString() + "\" style=\"text-decoration: none;color: #747474;\" target=\"_blank\">Google+で見る</a>";
            nBody += "</p>";
            nBody += "</div>";

            nBody += "</div>";
            nBody += "<div style=\"height: 40px;\">&nbsp;</div>";
            nBody += "</div>";
            nBody += "</en-note>";

            note.setContent(nBody);
            if(userModel.getEvernoteNotebookId() != null) {
                note.setNotebookGuid(userModel.getEvernoteNotebookId());
            }

            noteStoreClient.createNote(note);


        }catch(Exception e) {
            logger.severe(e.toString());
        }
View Full Code Here

        System.setProperty("javax.xml.stream.XMLEventFactory", "com.ctc.wstx.stax.WstxEventFactory");
    }

    @Override
    protected void updateConnectorDataHistory(final UpdateInfo updateInfo) throws Exception {
        final NoteStoreClient noteStore = getNoteStoreClient(updateInfo);
        performSync(updateInfo, noteStore, true);
    }
View Full Code Here

        setChannelMapping(apiKey, connectorSettings.notebooks);
    }

    @Override
    protected void updateConnectorData(final UpdateInfo updateInfo) throws Exception {
        final NoteStoreClient noteStore = getNoteStoreClient(updateInfo);
        final SyncState syncState = noteStore.getSyncState();
        final String lastSyncTimeAtt = guestService.getApiKeyAttribute(updateInfo.apiKey, LAST_SYNC_TIME);
        long lastSyncTime = Long.valueOf(lastSyncTimeAtt);
        final String lastUpdateCountAtt = guestService.getApiKeyAttribute(updateInfo.apiKey, LAST_UPDATE_COUNT);
        long lastUpdateCount = Long.valueOf(lastUpdateCountAtt);
        if (syncState.getFullSyncBefore()>lastSyncTime) {
View Full Code Here

TOP

Related Classes of com.evernote.clients.NoteStoreClient

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.