Package org.b3log.solo.model.feed.atom

Examples of org.b3log.solo.model.feed.atom.Entry


            final boolean isFullContent = "fullContent".equals(preference.getString(Preference.FEED_OUTPUT_MODE));

            for (int i = 0; i < articles.length(); i++) {
                final JSONObject article = articles.getJSONObject(i);
                final Entry entry = new Entry();
                feed.addEntry(entry);
                final String title = StringEscapeUtils.escapeXml(article.getString(Article.ARTICLE_TITLE));
                entry.setTitle(title);
                final String summary = isFullContent ? StringEscapeUtils.escapeXml(article.getString(Article.ARTICLE_CONTENT))
                                       : StringEscapeUtils.escapeXml(article.optString(Article.ARTICLE_ABSTRACT));
                entry.setSummary(summary);
                final Date updated = (Date) article.get(Article.ARTICLE_UPDATE_DATE);
                entry.setUpdated(updated);

                final String link = "http://" + blogHost + article.getString(Article.ARTICLE_PERMALINK);
                entry.setLink(link);
                entry.setId(link);

                if (hasMultipleUsers) {
                    authorName = StringEscapeUtils.escapeXml(articleUtils.getAuthor(article).getString(User.USER_NAME));
                }
                entry.setAuthor(authorName);

                final String tagsString = article.getString(Article.ARTICLE_TAGS_REF);
                final String[] tagStrings = tagsString.split(",");
                for (int j = 0; j < tagStrings.length; j++) {
                    final Category catetory = new Category();
                    entry.addCatetory(catetory);
                    final String tag = tagStrings[j];
                    catetory.setTerm(tag);
                }
            }
View Full Code Here


            final boolean isFullContent = "fullContent".equals(preference.getString(Preference.FEED_OUTPUT_MODE));

            for (int i = 0; i < articles.size(); i++) {
                final JSONObject article = articles.get(i);
                final Entry entry = new Entry();
                feed.addEntry(entry);
                final String title = StringEscapeUtils.escapeXml(article.getString(Article.ARTICLE_TITLE));
                entry.setTitle(title);
                final String summary = isFullContent ? StringEscapeUtils.escapeXml(article.getString(Article.ARTICLE_CONTENT))
                                       : StringEscapeUtils.escapeXml(article.optString(Article.ARTICLE_ABSTRACT));
                entry.setSummary(summary);
                final Date updated = (Date) article.get(Article.ARTICLE_UPDATE_DATE);
                entry.setUpdated(updated);
                final String link = "http://" + blogHost + article.getString(Article.ARTICLE_PERMALINK);
                entry.setLink(link);
                entry.setId(link);

                if (hasMultipleUsers) {
                    authorName = StringEscapeUtils.escapeXml(articleUtils.getAuthor(article).getString(User.USER_NAME));
                }

                entry.setAuthor(authorName);

                final String tagsString = article.getString(Article.ARTICLE_TAGS_REF);
                final String[] tagStrings = tagsString.split(",");
                for (int j = 0; j < tagStrings.length; j++) {
                    final Category catetory = new Category();
                    entry.addCatetory(catetory);
                    final String tag = tagStrings[j];
                    catetory.setTerm(tag);
                }
            }
View Full Code Here

            final boolean isFullContent = "fullContent".equals(preference.getString(Preference.FEED_OUTPUT_MODE));

            for (int i = 0; i < articles.length(); i++) {
                final JSONObject article = articles.getJSONObject(i);
                final Entry entry = new Entry();

                feed.addEntry(entry);
                final String title = StringEscapeUtils.escapeXml(article.getString(Article.ARTICLE_TITLE));

                entry.setTitle(title);
                final String summary = isFullContent
                    ? StringEscapeUtils.escapeXml(article.getString(Article.ARTICLE_CONTENT))
                    : StringEscapeUtils.escapeXml(article.optString(Article.ARTICLE_ABSTRACT));

                entry.setSummary(summary);
                final Date updated = (Date) article.get(Article.ARTICLE_UPDATE_DATE);

                entry.setUpdated(updated);

                final String link = Latkes.getServePath() + article.getString(Article.ARTICLE_PERMALINK);

                entry.setLink(link);
                entry.setId(link);

                if (hasMultipleUsers) {
                    authorName = StringEscapeUtils.escapeXml(articleQueryService.getAuthor(article).getString(User.USER_NAME));
                }
                entry.setAuthor(authorName);

                final String tagsString = article.getString(Article.ARTICLE_TAGS_REF);
                final String[] tagStrings = tagsString.split(",");

                for (int j = 0; j < tagStrings.length; j++) {
                    final Category catetory = new Category();

                    entry.addCatetory(catetory);
                    final String tag = tagStrings[j];

                    catetory.setTerm(tag);
                }
            }
View Full Code Here

            final boolean isFullContent = "fullContent".equals(preference.getString(Preference.FEED_OUTPUT_MODE));

            for (int i = 0; i < articles.size(); i++) {
                final JSONObject article = articles.get(i);
                final Entry entry = new Entry();

                feed.addEntry(entry);
                final String title = StringEscapeUtils.escapeXml(article.getString(Article.ARTICLE_TITLE));

                entry.setTitle(title);
                final String summary = isFullContent
                    ? StringEscapeUtils.escapeXml(article.getString(Article.ARTICLE_CONTENT))
                    : StringEscapeUtils.escapeXml(article.optString(Article.ARTICLE_ABSTRACT));

                entry.setSummary(summary);
                final Date updated = (Date) article.get(Article.ARTICLE_UPDATE_DATE);

                entry.setUpdated(updated);
                final String link = Latkes.getServePath() + article.getString(Article.ARTICLE_PERMALINK);

                entry.setLink(link);
                entry.setId(link);

                if (hasMultipleUsers) {
                    authorName = StringEscapeUtils.escapeXml(articleQueryService.getAuthor(article).getString(User.USER_NAME));
                }

                entry.setAuthor(authorName);

                final String tagsString = article.getString(Article.ARTICLE_TAGS_REF);
                final String[] tagStrings = tagsString.split(",");

                for (int j = 0; j < tagStrings.length; j++) {
                    final Category catetory = new Category();

                    entry.addCatetory(catetory);
                    catetory.setTerm(tagStrings[j]);
                }
            }

            renderer.setContent(feed.toString());
View Full Code Here

TOP

Related Classes of org.b3log.solo.model.feed.atom.Entry

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.