Package com.sun.syndication.feed.rss

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


@Component(value="frontEndRssFeedView")
public class FrontEndRssFeedView extends AbstractBaseRssFeedView{

    @Override
    protected Channel newFeed() {
        final Channel channel = new Channel("rss_2.0");
        channel.setPubDate(new Date());
        channel.setDescription("RSS Description");
        channel.setTitle("FrontEnd Published");
        channel.setLink("link");
        channel.setCopyright("2011");
        channel.setPubDate(new Date());
        return  channel;
    }
View Full Code Here


@Component(value="projectRssFeedView")
public class ProjectRssFeedView extends AbstractBaseRssFeedView{

    @Override
    protected Channel newFeed() {
        final Channel channel = new Channel("rss_2.0");
        channel.setPubDate(new Date());
        channel.setDescription("RSS Description");
        channel.setTitle("Project published");
        channel.setLink("link");
        channel.setCopyright("2011");
        channel.setPubDate(new Date());
        return  channel;
    }
View Full Code Here

@Component(value="tweetPollRssFeedView")
public class TweetPollRssFeedView extends AbstractBaseRssFeedView{

    @Override
    protected Channel newFeed() {
        final Channel channel = new Channel("rss_2.0");
        channel.setPubDate(new Date());
        channel.setDescription("RSS Description");
        channel.setTitle("TweetPoll Published");
        channel.setLink("link");
        channel.setCopyright("2010");
        channel.setPubDate(new Date());
        return  channel;
    }
View Full Code Here

   * Create a new Channel instance to hold the entries.
   * <p>By default returns an RSS 2.0 channel, but the subclass can specify any channel.
   */
  @Override
  protected Channel newFeed() {
    return new Channel("rss_2.0");
  }
View Full Code Here

        syndFeed.setModules(ModuleUtils.cloneModules(feed.getModules()));
        if (((List)feed.getForeignMarkup()).size() > 0) {
            syndFeed.setForeignMarkup(feed.getForeignMarkup());
        }
        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 String getRSSVersion() {
            return "0.92";
    }

    protected AbstractFeed parseChannel(Element rssRoot)  {
        Channel channel = (Channel) super.parseChannel(rssRoot);

        Element eCloud = rssRoot.getChild("cloud",getRSSNamespace());
        if (eCloud!=null) {
            Cloud cloud = new Cloud();
            String att = eCloud.getAttributeValue("domain");//getRSSNamespace()); DONT KNOW WHY DOESN'T WORK
View Full Code Here

     * @return the parsed Channel bean.
     */
    protected WireFeed parseChannel(Element rssRoot) {
        Element eChannel = rssRoot.getChild("channel", getRSSNamespace());

        Channel channel = new Channel(getType());

        Element e = eChannel.getChild("title",getRSSNamespace());
        if (e!=null) {
            channel.setTitle(e.getText());
        }
        e = eChannel.getChild("link",getRSSNamespace());
        if (e!=null) {
            channel.setLink(e.getText());
        }
        e = eChannel.getChild("description",getRSSNamespace());
        if (e!=null) {
            channel.setDescription(e.getText());
        }

        channel.setImage(parseImage(rssRoot));

        channel.setTextInput(parseTextInput(rssRoot));

        // Unfortunately Microsoft's SSE extension has a special case of
        // effectively putting the sharing channel module inside the RSS tag
        // and not inside the channel itself. So we also need to look for
        // channel modules from the root RSS element.
        List allFeedModules = new ArrayList();
        List rootModules = parseFeedModules(rssRoot);
        List channelModules = parseFeedModules(eChannel);
        if (rootModules != null) {
            allFeedModules.addAll(rootModules);
        }
        if (channelModules != null) {
            allFeedModules.addAll(channelModules);
        }
        channel.setModules(allFeedModules);
        channel.setItems(parseItems(rssRoot));

        List foreignMarkup =
            extractForeignMarkup(eChannel, channel, getRSSNamespace());
        if (foreignMarkup.size() > 0) {
            channel.setForeignMarkup(foreignMarkup);
        }         
        return channel;
    }
View Full Code Here

        return item;
    }

    protected WireFeed parseChannel(Element rssRoot) {
        Channel channel = (Channel) super.parseChannel(rssRoot);

        Element eChannel = rssRoot.getChild("channel", getRSSNamespace());
        String uri = eChannel.getAttributeValue("about", getRDFNamespace());
        if (uri != null) {
            channel.setUri(uri);
        }

        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
        }

        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

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.