KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > snipsnap > semanticweb > rss > BlogFeeder


1 /*
2  * This file is part of "SnipSnap Radeox Rendering Engine".
3  *
4  * Copyright (c) 2002 Stephan J. Schmidt, Matthias L. Jugel
5  * All Rights Reserved.
6  *
7  * Please visit http://radeox.org/ for updates and contact.
8  *
9  * --LICENSE NOTICE--
10  * This library is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU Lesser General Public
12  * License as published by the Free Software Foundation; either
13  * version 2.1 of the License, or (at your option) any later version.
14  *
15  * This library is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18  * Lesser General Public License for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public
21  * License along with this library; if not, write to the Free Software
22  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23  * --LICENSE NOTICE--
24  */

25
26 package org.snipsnap.semanticweb.rss;
27
28 import org.snipsnap.snip.Blog;
29 import org.snipsnap.snip.SnipSpaceFactory;
30 import org.snipsnap.snip.Snip;
31 import org.snipsnap.feeder.Feeder;
32
33 import java.util.List JavaDoc;
34
35 /*
36  * Generates a feed of snips from a blog which can then be
37  * serialized to RSS, RDF, Atom, ...
38  *
39  * @author stephan
40  * @team sonicteam
41  * @version $Id: BlogFeeder.java 1606 2004-05-17 10:56:18Z leo $
42  */

43
44 public class BlogFeeder implements Feeder {
45   private Blog blog;
46
47   public BlogFeeder() {
48     blog = SnipSpaceFactory.getInstance().getBlog();
49   }
50
51   public BlogFeeder(String JavaDoc blogName) {
52     blog = SnipSpaceFactory.getInstance().getBlog(blogName);
53   }
54
55   public String JavaDoc getName() {
56     return "blog";
57   }
58
59   public List JavaDoc getFeed() {
60       return blog.getFlatPosts();
61   };
62
63   public Snip getContextSnip() {
64     return blog.getSnip();
65   }
66 }
67
Popular Tags