Package com.sun.syndication.feed.rss

Examples of com.sun.syndication.feed.rss.Item


    List<Item> entries = new ArrayList<Item>(tpBean.size());
    for (TweetPollBean content : tpBean) {
      String urlTweetPoll = FeedUtils.createUrlFeed(domain,
          "/tweetpoll/", content.getId(), content.getQuestionBean()
              .getSlugName());
      final Item item = convertBeanToRSSItem(content.getCreatedDateAt(),
          content.getQuestionBean().getQuestionName(),
          content.getUpdateDate(), urlTweetPoll);
      entries.add(item);
    }
    return entries;
View Full Code Here


      final List<PollBean> pollBean, final String domain) {
    List<Item> entries = new ArrayList<Item>(pollBean.size());
    for (PollBean content : pollBean) {
      String urlPoll = FeedUtils.createUrlFeed(domain, "/poll/",
          content.getId(), content.getQuestionBean().getSlugName());
      final Item item = convertBeanToRSSItem(content.getCreationDate(),
          content.getQuestionBean().getQuestionName(),
          content.getUpdatedDate(), urlPoll);
      entries.add(item);
    }
    return entries;
View Full Code Here

      final List<HomeBean> homeBean, final String domain) {
    List<Item> entries = new ArrayList<Item>(homeBean.size());
    for (HomeBean content : homeBean) {
      String urlPoll = FeedUtils.createUrlFeed(domain, "/"+content.getItemType()+"/",
          content.getId(), content.getQuestionBean().getSlugName());
      final Item item = convertBeanToRSSItem(
          content.getCreateDateComparable(), content
              .getQuestionBean().getQuestionName(),
          content.getCreateDateComparable(), urlPoll);
      entries.add(item);
    }
View Full Code Here

   * @param urlLink
   * @return
   */
  public static final Item convertBeanToRSSItem(final Date createdAt,
      final String questionName, final Date pubDate, final String url) {
    final Item item = new Item();
    final String formatDate = FeedUtils.formattedDate("yyyy-MM-dd",
        createdAt);
    item.setTitle(String.format("On %s, %s publish", formatDate,
        questionName));
    item.setPubDate(pubDate);
    item.setLink(url);
    return item;
  }
View Full Code Here

   * @param url
   * @return
   */
  public static final Item convertBeanToRSSItem(final String createdAt,
      final String questionName, final Date pubDate, final String url) {
    final Item item = new Item();
    item.setTitle(String.format("On %s, %s publish", createdAt,
        questionName));
    item.setPubDate(pubDate);
    item.setLink(url);
    return item;
  }
View Full Code Here

    @SuppressWarnings("unchecked")
    List<SampleContent> listContent = (List<SampleContent>) model.get("feedContent");
    List<Item> items = new ArrayList<Item>(listContent.size());
    for(SampleContent tempContent : listContent ){
      
      Item item = new Item();
      Content content = new Content();
      content.setValue(tempContent.getSummary());
      item.setContent(content);
      item.setTitle(tempContent.getTitle());
      item.setLink(tempContent.getUrl());
      item.setPubDate(tempContent.getCreatedDate());
      items.add(item);
    }
   
    return items;
View Full Code Here

    protected PlanetRSS091NParser(String type) {
        super(type);
    }

    protected Item parseItem(Element rssRoot,Element eItem) {
        Item item = super.parseItem(rssRoot, eItem);
        Element e = eItem.getChild("pubDate",getRSSNamespace());
        if (e!=null) {
            item.setPubDate(DateParser.parseRFC822(e.getText()));
        }
        return item;
    }
View Full Code Here

    protected PlanetRSS091UParser(String type) {
        super(type);
    }

    protected Item parseItem(Element rssRoot,Element eItem) {
        Item item = super.parseItem(rssRoot, eItem);
        Element e = eItem.getChild("pubDate",getRSSNamespace());
        if (e!=null) {
            item.setPubDate(DateParser.parseRFC822(e.getText()));
        }
        return item;
    }
View Full Code Here

        }
        return list;
    }

    protected Item createRSSItem(SyndEntry sEntry) {
        Item item = new Item();
        item.setModules(ModuleUtils.cloneModules(sEntry.getModules()));
        item.setTitle(sEntry.getTitle());
        item.setLink(sEntry.getLink());
        return item;
    }
View Full Code Here

        }
        return channel;
    }

    protected Item parseItem(Element rssRoot,Element eItem) {
        Item item = super.parseItem(rssRoot,eItem);

        Element e = eItem.getChild("source",getRSSNamespace());
        if (e!=null) {
            Source source = new Source();
            String url = e.getAttributeValue("url");//getRSSNamespace()); DONT KNOW WHY DOESN'T WORK
            source.setUrl(url);
            source.setValue(e.getText());
            item.setSource(source);
        }

        // 0.92 allows one enclosure occurrence, 0.93 multiple
        // just saving to write some code.
        List eEnclosures = eItem.getChildren("enclosure");//getRSSNamespace()); DONT KNOW WHY DOESN'T WORK
        if (eEnclosures.size()>0) {
            List enclosures = new ArrayList();
            for (int i=0;i<eEnclosures.size();i++) {
                e = (Element) eEnclosures.get(i);

                Enclosure enclosure = new Enclosure();
                String att = e.getAttributeValue("url");//getRSSNamespace()); DONT KNOW WHY DOESN'T WORK
                if (att!=null) {
                    enclosure.setUrl(att);
                }
                att = e.getAttributeValue("length");//getRSSNamespace()); DONT KNOW WHY DOESN'T WORK
                if (att!=null) {
                    enclosure.setLength(Integer.parseInt(att));
                }
                att = e.getAttributeValue("type");//getRSSNamespace()); DONT KNOW WHY DOESN'T WORK
                if (att!=null) {
                    enclosure.setUrl(att);
                }
                enclosures.add(enclosure);
            }
            item.setEnclosures(enclosures);
        }

        List eCats = eItem.getChildren("category");//getRSSNamespace()); DONT KNOW WHY DOESN'T WORK
        item.setCategories(parseCategories(eCats));

        return item;
    }
View Full Code Here

TOP

Related Classes of com.sun.syndication.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.