Package org.b3log.solo.sync

Examples of org.b3log.solo.sync.MetaWeblog


                    return ret;
                }

                final String postId = externalArticleSoloArticleRelation.
                        getString(BLOG_SYNC_EXTERNAL_ARTICLE_ID);
                final MetaWeblog metaWeblog =
                        BlogFactory.getMetaWeblog(externalBloggingSys);
                metaWeblog.setUserName(userName);
                metaWeblog.setUserPassword(userPwd);
                metaWeblog.editPost(postId, externalArticle);

                externalArticleSoloArticleRelation.put(
                        BLOG_SYNC_EXTERNAL_ARTICLE_ABSTRACT,
                        article.getString(Article.ARTICLE_ABSTRACT));
                externalArticleSoloArticleRelation.put(
View Full Code Here


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

            final String userPwd =
                    requestJSONObject.getString(
                    BLOG_SYNC_EXTERNAL_BLOGGING_SYS_USER_PASSWORD);
            final String archiveDate = requestJSONObject.getString(
                    BLOG_SYNC_EXTERNAL_ARCHIVE_DATE);
            final MetaWeblog metaWeblog = BlogFactory.getMetaWeblog(externalSys);
            metaWeblog.setUserName(userName);
            metaWeblog.setUserPassword(userPwd);
            final List<String> externalArticleIds =
                    metaWeblog.getArticleIdsByArchiveDate(archiveDate);
            LOGGER.log(Level.FINER,
                       "There are [{0}] articles of [{1}] user[userName={2}] in [{3}]",
                       new Object[]{externalArticleIds.size(),
                                    externalSys,
                                    userName,
                                    archiveDate});
            final JSONArray articles = new JSONArray();
            ret.put(BLOG_SYNC_EXTERNAL_ARTICLES, articles);
            int retrievalCnt = 0;
            for (final String externalArticleId : externalArticleIds) {
                final JSONObject soloArticle =
                        externalArticleSoloArticleRepository.getSoloArticle(
                        externalArticleId, externalSys);
                JSONObject article = null;
                boolean imported = false;
                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;
View Full Code Here

        try {
            final String externalSys = requestJSONObject.getString(
                    BLOG_SYNC_EXTERNAL_BLOGGING_SYS);
            final String userName = requestJSONObject.getString(
                    BLOG_SYNC_EXTERNAL_BLOGGING_SYS_USER_NAME);
            final MetaWeblog metaWeblog = BlogFactory.getMetaWeblog(externalSys);
            metaWeblog.setUserName(userName);
            metaWeblog.setUserPassword("ignored");
            final List<String> archiveDates = metaWeblog.getArchiveDates();

            ret.put(BLOG_SYNC_EXTERNAL_ARCHIVE_DATES, archiveDates);
        } catch (final JSONException e) {
            LOGGER.log(Level.SEVERE, e.getMessage(), e);
            throw new ActionException(e);
View Full Code Here

                }

                final String externalArticleId =
                        externalArticleSoloArticleRelation.getString(
                        BLOG_SYNC_EXTERNAL_ARTICLE_ID);
                final MetaWeblog metaWeblog = BlogFactory.getMetaWeblog(
                        externalBloggingSys);
                metaWeblog.setUserName(userName);
                metaWeblog.setUserPassword(userPwd);
                metaWeblog.deletePost(externalArticleId);

                final String relationId =
                        externalArticleSoloArticleRelation.getString(
                        Keys.OBJECT_ID);
                externalArticleSoloArticleRepository.remove(relationId);
View Full Code Here

TOP

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

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.