Package com.rsslibj.elements

Examples of com.rsslibj.elements.Channel


public class RssView implements View {

  @SuppressWarnings("unchecked")
  public void render(HttpServletRequest req, HttpServletResponse resp,
      Object obj) throws Throwable {
    Channel channel = new Channel();
    channel.setCopyright("Ngqa copy right");
        channel.setLink(req.getRequestURL().toString());
        channel.setTitle("Ngqa questions");
       
        if (obj instanceof Pager) {
          Pager<Question> pager = (Pager<Question>) obj;
          for (Question question : pager.getData()) {
        channel.addItem(Helpers.makeQuestionURL(question), question.getTitle(), question.getContent());
      }
        } else if (obj instanceof Question) {
          Question question = (Question) obj;
          channel.addItem(Helpers.makeQuestionURL(question), question.getTitle(), question.getContent());
        }
        resp.getWriter().write(channel.getFeed("rss"));
  }
View Full Code Here

TOP

Related Classes of com.rsslibj.elements.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.