Package com.sun.syndication.feed.rss

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


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

    public void copyInto(WireFeed feed,SyndFeed syndFeed) {
        Channel channel = (Channel) feed;
        super.copyInto(channel,syndFeed);
    }
View Full Code Here


        }
        return syndEntry;
    }

    protected WireFeed createRealFeed(String type,SyndFeed syndFeed) {
        Channel channel = (Channel) super.createRealFeed(type,syndFeed);
        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
        syndFeed.setPublishedDate(channel.getPubDate());    //c
        syndFeed.setAuthor(channel.getManagingEditor());    //c
    }
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
        channel.setManagingEditor(syndFeed.getAuthor());    //c
        return channel;
    }
View Full Code Here

      WireFeedInput input = new WireFeedInput(true);
      WireFeed wf = input.build(new XmlReader(new URL(url)));

      if (wf.getFeedType() != null && wf.getFeedType().startsWith("rss")) {
        Channel rssFeed = (Channel)wf;
        feed.setTitle(rssFeed.getTitle());
        feed.setLink(rssFeed.getLink());

        for (Item item : (List<Item>)rssFeed.getItems()) {
          NewsFeedEntry fe = new NewsFeedEntry(
              item.getLink(),
              item.getTitle(),
              item.getDescription() != null ? item.getDescription().getValue() : "",
              item.getAuthor(),
View Full Code Here

    protected String getRSSVersion() {
            return "0.94";
    }

    protected WireFeed parseChannel(Element rssRoot)  {
        Channel channel = (Channel) super.parseChannel(rssRoot);
        Element eChannel = rssRoot.getChild("channel",getRSSNamespace());

        List eCats = eChannel.getChildren("category",getRSSNamespace());
        channel.setCategories(parseCategories(eCats));

        Element eTtl = eChannel.getChild("ttl",getRSSNamespace());
        if (eTtl!=null && eTtl.getText() != null ) {
            Integer ttlValue = null;       
            try{
                 ttlValue = new Integer(eTtl.getText());
            } catch(NumberFormatException nfe ){
                ; //let it go by
            }
            if (ttlValue != null) {
                channel.setTtl(ttlValue.intValue());
            }
        }

        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

        request = new MockHttpServletRequest();
        response = new MockHttpServletResponse();
        rssViewer = new RssViewer();
        rssViewer.setContentType("application/rss+xml;charset=UTF-8");
        rssViewerMock = mock(RssViewer.class);
        channel = new Channel();
        model = new HashMap<String, Object>();
        List<Topic> topics = new ArrayList<Topic>();
        JCUser user = new JCUser("username", "email", "password");
        user.setSignature("Signature");
        Post post = new Post(user, "sagjalighjh eghjwhjslhjsdfhdfhljdfh");
View Full Code Here

        component.setName(name);
        component.setDescription(description);
        model.put("forumComponent", component);

        rssViewer.buildFeedMetadata(model, channel, request);
        assertFalse(channel.equals(new Channel()));
        assertEquals(channel.getTitle(), name);
        assertEquals(channel.getDescription(), description);
    }
View Full Code Here

    }

    @Test
    public void buildFeedMetadataShouldUseDefaultValuesWhenThereIsNoBranchInModel() {
        Map<String, Object> model = new HashMap<>();
        Channel channel = new Channel();

        postListRssViewer.buildFeedMetadata(model, channel, getMockRequest());

        assertEquals(channel.getTitle(), PostListRssViewer.DEFAULT_FEED_TITLE);
        assertEquals(channel.getDescription(), PostListRssViewer.DEFAULT_FEED_DESCRIPTION);
        assertEquals(channel.getLink(), "http://localhost:8080/jcommune");
    }
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.