Package org.b3log.solo.sync

Examples of org.b3log.solo.sync.Post


     * Tests {@linkplain CnBlogsBlog#getPost(java.lang.String)} method.
     * @throws SyncException sync exception
     */
    //@org.testng.annotations.Test
    public void getPost() throws SyncException {
        final Post article = cnBlogsBlog.getPost("1818114");
        assertNotNull(article);
        assertEquals(article.getTitle(), "For Solo 同步测试");
    }
View Full Code Here


     * Tests {@linkplain CSDNBlog#getPost(java.lang.String)} method.
     * @throws SyncException sync exception
     */
    //@Test
    public void getPost() throws SyncException {
        final Post article = csdnBlog.getPost("5817062");
        assertNotNull(article);
        assertEquals(article.getTitle(), "HTTP/1.1 Status Code Definitions");
    }
View Full Code Here

            } else {
                final String userName = blogSyncMgmt.getString(
                        BLOG_SYNC_EXTERNAL_BLOGGING_SYS_USER_NAME);
                final String userPwd = blogSyncMgmt.getString(
                        BLOG_SYNC_EXTERNAL_BLOGGING_SYS_USER_PASSWORD);
                final Post externalArticle = new MetaWeblogPost(article);
                final String articleId = article.getString(Keys.OBJECT_ID);
                LOGGER.log(Level.FINEST,
                           "Getting External article-Solo article relation....");
                final JSONObject externalArticleSoloArticleRelation =
                        externalArticleSoloArticleRepository.getBySoloArticleId(
View Full Code Here

                final String userName = blogSyncMgmt.getString(
                        BLOG_SYNC_EXTERNAL_BLOGGING_SYS_USER_NAME);
                final String userPwd = blogSyncMgmt.getString(
                        BLOG_SYNC_EXTERNAL_BLOGGING_SYS_USER_PASSWORD);

                final Post post = new MetaWeblogPost(article);
                final MetaWeblog metaWeblog =
                        BlogFactory.getMetaWeblog(externalBloggingSys);
                metaWeblog.setUserName(userName);
                metaWeblog.setUserPassword(userPwd);
                postId = metaWeblog.newPost(post);
                post.setId(postId);

                final JSONObject externalArticleSoloArticleRelation =
                        new JSONObject();
                externalArticleSoloArticleRelation.put(
                        BLOG_SYNC_EXTERNAL_ARTICLE_IMPORTED, true);
View Full Code Here

                if (null != soloArticle) {
                    article = soloArticle;
                    imported = soloArticle.getBoolean(
                            BLOG_SYNC_EXTERNAL_ARTICLE_IMPORTED);
                } else { // Not retrieved yet, get the article from External blogging system
                    final Post externalPost =
                            metaWeblog.getPost(externalArticleId);
                    if (null == externalPost) {
                        LOGGER.log(Level.WARNING,
                                   "Retrieve article[postId={0}] from external blogging system[{1}] is null",
                                   new String[]{externalArticleId, externalSys});
                        continue;
                    }

                    article = externalPost.toJSONObject();
                    final JSONObject externalArticleSoloArticleRelation =
                            new JSONObject();
                    externalArticleSoloArticleRelation.put(
                            BLOG_SYNC_EXTERNAL_ARTICLE_IMPORTED, false);
                    externalArticleSoloArticleRelation.put(
View Full Code Here

TOP

Related Classes of org.b3log.solo.sync.Post

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.