package page.com.jrsstray;

import org.wikiwebserver.core.WareHouse;
import org.wikiwebserver.handler.http.interfaces.*;

import page.config.SiteTemplatedPage;

import static org.wikiwebserver.html.HTMLHelper.*;

public class Download extends SiteTemplatedPage implements HTTPResponder {
    
    public void generate() {
        addResourceRoot("/templates/com/jrsstray/");
        addCSSLink("jrsstray.css");
        
        setTitle("Download - JRSSTray");
        
        append(h(1, "Download JRSSTray") +
               a("/JRSSTray.jnlp", image("icon.png", "Launch JRSSTray", "align='left' class='noborder'")) +    
               p("JRSSTray is a free Java Web Start application that monitors RSS feeds" +
               	 " and displays new items as messages in the system tray. It's extremely " +
               	 " lightweight at only 50KB and requires no complicated installation.") +
               p("JRSSTray can be launched directly from this web page and will run on Windows," +
                 " Linux, Mac and other operating systems supporting <b>Java 1.6 or higher</b>.") +
                 getGoogleAdsenseBlock("pub-7253309958196609", "4308232035", 728, 90) +
               h(1, "Install JRSSTray on your computer") +
               p("This option will configure a new program item in the programs menu on your" +
               	 " computer for launching JRSSTray. To automatically launch JRSSTray at startup," +
               	 " Windows users can drag this item into the startup folder.") +
               ul(new String[] {
                       a("/JRSSTray.jnlp", "Java Web Start Application") + " (JRSSTray.jnlp)",
                       a("/JRSSTray.jar", "Standalone Java Application") + " (JRSSTray.jar)",
                       a("/JRSSTray.pad.xml", "Portable Application Description") + " (JRSSTray.pad.xml)",
               }) +
               h(1, "Launch pre-configured with RSS feeds")

        );
        
        String bbcWorldNews = "http://newsrss.bbc.co.uk/rss/newsonline_uk_edition/world/rss.xml";
        bbcWorldNews = WareHouse.formDataEncode(bbcWorldNews);
        
        append(h(2, "BBC News") +
               p("Launch JRSSTray populated with feeds from BBC news.") +               
               ul(new String[] {
                       a("/JRSSTray.jnlp?url=" + bbcWorldNews, "BBC World News")
               })
        );

        append(h(1, "Development") +
               cleardiv()
        );
    }
}


