package org.injac.indexing.rss;

import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.GenericServlet;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;

public class GenericRSSServlet extends GenericServlet {
	protected PrintWriter writer; 
	
	
	protected void startRSS(){
		writer.println("<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>");
		writer.println("<rss version=\"2.0\">");
	}
	protected void endRSS(){
		writer.println("</rss>");
	}
	protected void startChannel(String title, String link, String description){
		
		writer.println("<channel>");
		writer.println("<title>"+title+"</title>");
		writer.println("<link>"+link+"</link>");
		writer.println("<description>"+description+"</description>");
	}
	protected void endChannel(){
		writer.println("</channel>");
	}
	protected void startItem(String title, String link, String description){
		
		writer.println("<item>");
		writer.println("<title>"+title+"</title>");
		writer.println("<link>"+link+"</link>");
		writer.println("<description>"+description+"</description>");
	}
	protected void endItem(){
		writer.println("</item>");
	}
	
	public void service(ServletRequest req, ServletResponse res) throws ServletException, IOException {
		
		
	}
	
	
}
