Search in sources :

Example 1 with Description

use of com.rometools.rome.feed.rss.Description in project wombat by PLOS.

the class ArticleFeedView method buildRssDescription.

private Description buildRssDescription(Map<String, ?> article) {
    Description description = new Description();
    description.setValue(getContentText(article));
    return description;
}
Also used : Description(com.rometools.rome.feed.rss.Description)

Example 2 with Description

use of com.rometools.rome.feed.rss.Description in project tutorials by eugenp.

the class ArticleFeedView method buildFeedItems.

@Override
protected List<Item> buildFeedItems(Map<String, Object> map, HttpServletRequest httpStRequest, HttpServletResponse httpStResponse) throws Exception {
    List list = new ArrayList<Item>();
    Item item1 = new Item();
    item1.setLink("http://www.baeldung.com/netty-exception-handling");
    item1.setTitle("Exceptions in Netty");
    Description description1 = new Description();
    description1.setValue("In this quick article, we’ll be looking at exception handling in Netty.");
    item1.setDescription(description1);
    item1.setPubDate(new Date());
    item1.setAuthor("Carlos");
    Item item2 = new Item();
    item2.setLink("http://www.baeldung.com/cockroachdb-java");
    item2.setTitle("Guide to CockroachDB in Java");
    Description description2 = new Description();
    description2.setValue("This tutorial is an introductory guide to using CockroachDB with Java.");
    item2.setDescription(description2);
    item2.setPubDate(new Date());
    item2.setAuthor("Baeldung");
    list.add(item1);
    list.add(item2);
    return list;
}
Also used : Item(com.rometools.rome.feed.rss.Item) Description(com.rometools.rome.feed.rss.Description) ArrayList(java.util.ArrayList) List(java.util.List) ArrayList(java.util.ArrayList) Date(java.util.Date)

Example 3 with Description

use of com.rometools.rome.feed.rss.Description in project tutorials by eugenp.

the class ArticleRssController method buildChannel.

private Channel buildChannel(List<Article> articles) {
    Channel channel = new Channel("rss_2.0");
    channel.setLink("http://localhost:8080/spring-mvc-simple/rss");
    channel.setTitle("Article Feed");
    channel.setDescription("Article Feed Description");
    channel.setPubDate(new Date());
    List<Item> items = new ArrayList<>();
    for (Article article : articles) {
        Item item = new Item();
        item.setLink(article.getLink());
        item.setTitle(article.getTitle());
        Description description1 = new Description();
        description1.setValue(article.getDescription());
        item.setDescription(description1);
        item.setPubDate(article.getPublishedDate());
        item.setAuthor(article.getAuthor());
        items.add(item);
    }
    channel.setItems(items);
    return channel;
}
Also used : Item(com.rometools.rome.feed.rss.Item) Description(com.rometools.rome.feed.rss.Description) Channel(com.rometools.rome.feed.rss.Channel) ArrayList(java.util.ArrayList) Date(java.util.Date)

Example 4 with Description

use of com.rometools.rome.feed.rss.Description in project nixmash-blog by mintster.

the class RssPostFeedView method createDescription.

private Description createDescription(Post post) {
    Long postId = post.getPostId();
    if (post.isMultiPhotoPost())
        post.setPostImages(postService.getPostImages(postId));
    if (post.isSinglePhotoPost())
        post.setSingleImage(postService.getPostImages(postId).get(0));
    Description description = new Description();
    description.setType(Content.HTML);
    description.setValue(fmService.createRssPostContent(post));
    return description;
}
Also used : Description(com.rometools.rome.feed.rss.Description)

Example 5 with Description

use of com.rometools.rome.feed.rss.Description in project tutorials by eugenp.

the class ArticleFeedView method buildFeedItems.

@Override
protected List<Item> buildFeedItems(Map<String, Object> map, HttpServletRequest httpStRequest, HttpServletResponse httpStResponse) throws Exception {
    List list = new ArrayList<Item>();
    Item item1 = new Item();
    item1.setLink("http://www.baeldung.com/netty-exception-handling");
    item1.setTitle("Exceptions in Netty");
    Description description1 = new Description();
    description1.setValue("In this quick article, we’ll be looking at exception handling in Netty.");
    item1.setDescription(description1);
    item1.setPubDate(new Date());
    item1.setAuthor("Carlos");
    Item item2 = new Item();
    item2.setLink("http://www.baeldung.com/cockroachdb-java");
    item2.setTitle("Guide to CockroachDB in Java");
    Description description2 = new Description();
    description2.setValue("This tutorial is an introductory guide to using CockroachDB with Java.");
    item2.setDescription(description2);
    item2.setPubDate(new Date());
    item2.setAuthor("Baeldung");
    list.add(item1);
    list.add(item2);
    return list;
}
Also used : Item(com.rometools.rome.feed.rss.Item) Description(com.rometools.rome.feed.rss.Description) ArrayList(java.util.ArrayList) List(java.util.List) ArrayList(java.util.ArrayList) Date(java.util.Date)

Aggregations

Description (com.rometools.rome.feed.rss.Description)5 Item (com.rometools.rome.feed.rss.Item)3 ArrayList (java.util.ArrayList)3 Date (java.util.Date)3 List (java.util.List)2 Channel (com.rometools.rome.feed.rss.Channel)1