Package com.sun.syndication.feed.rss

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


              System.out.println("[ERROR] Error obtaining geodata url: ["
                  + georssUrlStr + "]: Message: "+e.getMessage()+": skipping and continuing");
              continue;
            }

            Channel c = (Channel) feed;
            List<Item> items = (List<Item>) c.getItems();
            for (Item item : items) {
              GeoRSSModule geoRSSModule = (GeoRSSModule) item
                  .getModule(GeoRSSModule.GEORSS_GEORSS_URI);
              if (geoRSSModule == null)
                geoRSSModule = (GeoRSSModule) item
View Full Code Here


              System.out.println("[ERROR] Error obtaining geodata url: ["
                  + georssUrlStr + "]: Message: "+e.getMessage()+": skipping and continuing");
              continue;
            }

            Channel c = (Channel) feed;
            List<Item> items = (List<Item>) c.getItems();
            for (Item item : items) {
              GeoRSSModule geoRSSModule = (GeoRSSModule) item
                  .getModule(GeoRSSModule.GEORSS_GEORSS_URI);
              if (geoRSSModule == null)
                geoRSSModule = (GeoRSSModule) item
View Full Code Here

    }

    @Override
    protected WireFeed parseChannel(Element rssRoot)
    {
        Channel feed = (Channel)super.parseChannel(rssRoot);

        // Parse the pub date
        Element channel = rssRoot.getChild("channel", getRSSNamespace());
        String pubDate = channel.getChildText("pubDate", getRSSNamespace());
        if (StringUtils.isNotEmpty(pubDate))
        {
            Date date = DateParser.parseDate(pubDate);
            if (date != null) feed.setPubDate(date);
        }

        return feed;
    }
View Full Code Here

    return "Read " + channel.getTitle();
  }

  @RequestMapping(value="/rss", method=RequestMethod.GET)
  public @ResponseBody Channel writeChannel() {
    Channel channel = new Channel();
    channel.setFeedType("rss_2.0");
    channel.setTitle("My RSS feed");
    channel.setDescription("Description");
    channel.setLink("http://localhost:8080/mvc-showcase/rss");
    return channel;
  }
View Full Code Here

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

    public void copyInto(WireFeed feed,SyndFeed syndFeed) {
        Channel channel = (Channel) feed;
        super.copyInto(channel,syndFeed);
        syndFeed.setLanguage(channel.getLanguage());        //c
        syndFeed.setCopyright(channel.getCopyright());      //c
        Date pubDate = channel.getPubDate();
        if (pubDate!=null) {
            syndFeed.setPublishedDate(pubDate);     //c
        } else if (channel.getLastBuildDate() != null) {
            // TODO: @FID43 lastBuildDate does not populate publishedDate
            ROME.failed(Failure.ROME43);
           
        }

        String author = channel.getManagingEditor();
        if (author!=null) {   
            List creators = ((DCModule) syndFeed.getModule(DCModule.URI)).getCreators();
            if (!creators.contains(author)) {
                Set s = new HashSet(); // using a set to remove duplicates
                s.addAll(creators);    // DC creators
View Full Code Here

        }
        return syndEntry;
    }

    protected WireFeed createRealFeed(String type,SyndFeed syndFeed) {
        Channel channel = (Channel) super.createRealFeed(type,syndFeed);
        channel.setLanguage(syndFeed.getLanguage());        //c
        channel.setCopyright(syndFeed.getCopyright());      //c
        channel.setPubDate(syndFeed.getPublishedDate());    //c       
        if (syndFeed.getAuthors()!=null && syndFeed.getAuthors().size() > 0) {
            SyndPerson author = (SyndPerson)syndFeed.getAuthors().get(0);
            channel.setManagingEditor(author.getName())
        }       
        return channel;
    }
View Full Code Here

    public void copyInto(WireFeed feed,SyndFeed syndFeed) {
        syndFeed.setModules(ModuleUtils.cloneModules(feed.getModules()));

        syndFeed.setEncoding(feed.getEncoding());
        Channel channel = (Channel) feed;
        syndFeed.setTitle(channel.getTitle());
        syndFeed.setLink(channel.getLink());
        syndFeed.setDescription(channel.getDescription());

        Image image = channel.getImage();
        if (image!=null) {
            syndFeed.setImage(createSyndImage(image));
        }

        List items = channel.getItems();
        if (items!=null) {
            syndFeed.setEntries(createSyndEntries(items));
        }
    }
View Full Code Here

    public WireFeed createRealFeed(SyndFeed syndFeed) {
        return createRealFeed(getType(),syndFeed);
    }

    protected WireFeed createRealFeed(String type,SyndFeed syndFeed) {
        Channel channel = new Channel(type);
        channel.setModules(ModuleUtils.cloneModules(syndFeed.getModules()));

        channel.setEncoding(syndFeed.getEncoding());

        channel.setTitle(syndFeed.getTitle());
        channel.setLink(syndFeed.getLink());
        channel.setDescription(syndFeed.getDescription());
        SyndImage sImage = syndFeed.getImage();
        if (sImage!=null) {
            channel.setImage(createRSSImage(sImage));
        }

        List sEntries = syndFeed.getEntries();
        if (sEntries!=null) {
            channel.setItems(createRSSItems(sEntries));
        }
        return channel;
    }
View Full Code Here

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

    public void copyInto(WireFeed feed,SyndFeed syndFeed) {
        Channel channel = (Channel) feed;
        super.copyInto(channel,syndFeed);
        List cats = channel.getCategories();    //c
        if (cats!=null) {
            syndFeed.setCategories(this.createSyndCategories(cats));
        }
    }
View Full Code Here

        return syndEntry;
    }


    protected WireFeed createRealFeed(String type,SyndFeed syndFeed) {
        Channel channel = (Channel) super.createRealFeed(type,syndFeed);
        List cats = syndFeed.getCategories();    //c
        if (cats!=null) {
            channel.setCategories(createRSSCategories(cats));
        }
        return channel;
    }
View Full Code Here

TOP

Related Classes of com.sun.syndication.feed.rss.Channel

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.