Package org.b3log.solo.model.feed.rss

Examples of org.b3log.solo.model.feed.rss.Item


            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 Item item = new Item();
                channel.addItem(item);
                final String title = StringEscapeUtils.escapeXml(article.getString(Article.ARTICLE_TITLE));
                item.setTitle(title);
                final String description = isFullContent ? StringEscapeUtils.escapeXml(article.getString(Article.ARTICLE_CONTENT))
                                           : StringEscapeUtils.escapeXml(article.optString(Article.ARTICLE_ABSTRACT));
                item.setDescription(description);
                final Date pubDate = (Date) article.get(Article.ARTICLE_UPDATE_DATE);
                item.setPubDate(pubDate);
                final String link = "http://" + blogHost + article.getString(Article.ARTICLE_PERMALINK);
                item.setLink(link);
                item.setGUID(link);

                final String authorEmail = article.getString(Article.ARTICLE_AUTHOR_EMAIL);
                if (hasMultipleUsers) {
                    authorName = StringEscapeUtils.escapeXml(articleUtils.getAuthor(article).getString(User.USER_NAME));
                }

                item.setAuthor(authorEmail + "(" + authorName + ")");

                final String tagsString = article.getString(Article.ARTICLE_TAGS_REF);
                final String[] tagStrings = tagsString.split(",");
                for (int j = 0; j < tagStrings.length; j++) {
                    final org.b3log.solo.model.feed.rss.Category catetory = new org.b3log.solo.model.feed.rss.Category();
                    item.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 Item item = new Item();
                channel.addItem(item);
                final String title = StringEscapeUtils.escapeXml(article.getString(Article.ARTICLE_TITLE));
                item.setTitle(title);
                final String description = isFullContent ? StringEscapeUtils.escapeXml(article.getString(Article.ARTICLE_CONTENT))
                                           : StringEscapeUtils.escapeXml(article.optString(Article.ARTICLE_ABSTRACT));
                item.setDescription(description);
                final Date pubDate = (Date) article.get(Article.ARTICLE_UPDATE_DATE);
                item.setPubDate(pubDate);
                final String link = "http://" + blogHost + article.getString(Article.ARTICLE_PERMALINK);
                item.setLink(link);
                item.setGUID(link);

                final String authorEmail = article.getString(Article.ARTICLE_AUTHOR_EMAIL);
                if (hasMultipleUsers) {
                    authorName = StringEscapeUtils.escapeXml(articleUtils.getAuthor(article).getString(User.USER_NAME));
                }

                item.setAuthor(authorEmail + "(" + authorName + ")");

                final String tagsString = article.getString(Article.ARTICLE_TAGS_REF);
                final String[] tagStrings = tagsString.split(",");
                for (int j = 0; j < tagStrings.length; j++) {
                    final org.b3log.solo.model.feed.rss.Category catetory = new org.b3log.solo.model.feed.rss.Category();
                    item.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 Item item = new Item();

                channel.addItem(item);
                final String title = StringEscapeUtils.escapeXml(article.getString(Article.ARTICLE_TITLE));

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

                item.setDescription(description);
                final Date pubDate = (Date) article.get(Article.ARTICLE_UPDATE_DATE);

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

                item.setLink(link);
                item.setGUID(link);

                final String authorEmail = article.getString(Article.ARTICLE_AUTHOR_EMAIL);

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

                item.setAuthor(authorEmail + "(" + authorName + ")");

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

                for (int j = 0; j < tagStrings.length; j++) {
                    final org.b3log.solo.model.feed.rss.Category catetory = new org.b3log.solo.model.feed.rss.Category();

                    item.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 Item item = new Item();

                channel.addItem(item);
                final String title = StringEscapeUtils.escapeXml(article.getString(Article.ARTICLE_TITLE));

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

                item.setDescription(description);
                final Date pubDate = (Date) article.get(Article.ARTICLE_UPDATE_DATE);

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

                item.setLink(link);
                item.setGUID(link);

                final String authorEmail = article.getString(Article.ARTICLE_AUTHOR_EMAIL);

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

                item.setAuthor(authorEmail + "(" + authorName + ")");

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

                for (int j = 0; j < tagStrings.length; j++) {
                    final org.b3log.solo.model.feed.rss.Category catetory = new org.b3log.solo.model.feed.rss.Category();

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

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

TOP

Related Classes of org.b3log.solo.model.feed.rss.Item

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.