package page.uk.co.mydisk;

import org.wikiwebserver.core.WareHouse;
import org.wikiwebserver.handler.http.HTTPException;
import org.wikiwebserver.handler.http.interfaces.HTTPResponder;

import page.config.SiteTemplatedPage;

import static org.wikiwebserver.html.HTMLHelper.*;

public class FAQ extends SiteTemplatedPage implements HTTPResponder {

    public void generate() throws HTTPException {
        
        this.addCSSLink("/templates/uk/co/mydisk/mydisk.css");
        
        setTitle("MyDisk.co.uk - Frequently Asked Questions");
        
        append(h(1, "Frequently Asked Questions"));
        append(p("This page contains useful information about the MyDisk.co.uk file sharing service."));
        
        append(getGoogleAdsenseBlock("4069100720", 728, 90));
        
        append(h(2, "What is required to share online?"));        
        append(p("Any computer with Java support and an Internet connection can share files online." +
        		 " This includes any computer running Microsoft Windows, Mac OS X or Linux. For files" +
        		 " to be accessible, the computer must remain turned on and connected to the Internet."));      
        
        append(h(2, "What is required to access shared files online?"));        
        append(p("Any device with a web browser and an Internet connection can access shared files." +
                 " This includes all modern computers, PDAs and mobile phones."));          
        
        append(h(2, "What can I share online?"));        
        append(p("Any file that is stored on your computer can be shared online. You can specify a" +
                 " folder or even a complete disk drive to share.  Unlike most file sharing solutions" +
                 " MyDisk does not upload all your files to a server online, they remain on your computer." +
                 " This means you can share thousands of files and only the ones requested will be " +
                 " transferred."));     
        
        append(h(2, "What is a " + strong("node") + "?"));        
        append(p("A node is a computer with the MyDiskNode sharing application installed." +
                 " The MyDiskNode application makes it possible to obtain data stored on your computer" +
                 " from any computer on the Internet. You have complete control of what you share online" +
                 " and access to your node can be password protected."));          
        
        append(h(2, "How do I stop sharing files online?"));        
        append(p("To stop sharing files online, simply close the MyDiskNode application. No more requests" +
        		" for files will be routed to your computer. Please be aware that content not protected by" +
        		" a password may be cached by WikiWebServer or web browsers to enhance performance." +
        		" This content may remain accessible for up to 48 hours."));     
        
        append(h(2, "How much bandwidth does this service consume?"));        
        append(p("The total bandwidth consumption is listed with the node details. When idle, MyDiskNode" +
        		" periodically makes connections to the MyDisk service. This typically consumes less than" +
        		" 50 KBytes per hour."));          
          
        append(h(2, "I am on a restricted network, can I use MyDisk?"));        
        append(p(strong("Yes") + ", MyDiskNode only makes outbound connections and does not require" +
                 " any complicated firewall rules or port forwarding.  Even if you are behind a " +
                 " proxy server, MyDiskNode can still route Internet traffic to your computer" +
                 " (providing Java is configured to use the proxy server)."));  
        
        
        append(h(2, "Why is it slower accessing password protected content?"));        
        append(p("When password protection is enabled, data is not cached. This leads to a reduction" +
        		" in performance of the service.  If you want multiple users to access content, it is" +
        		" recommended you disable password protection."));           
        
        append(h(2, "Does MyDiskNode contain spyware?"));        
        append(p(strong("No") + ", MyDiskNode does not contain spyware, adware or malware." +
                 " I actively encourage users to install custom Java security policies to verify that" +
                 " MyDiskNode does not perform any malicious actions. Details can be found " +
                 a(WareHouse.getUrlPathForClass(Options.class) + "#policy", "here") + ".") +
               p(" Obviously great care and attention must be given to sharing files online." +
                 " Make sure you only share files online you are happy to give others access to." +
                 " If you are worried about security, enable password protection."));          
       
        append("<a name='#oldMyDisk'></a>");
        append(h(2, "Where is the old MyDisk sharing hub?"));  
        append(p("The old MyDisk sharing hub can be found at " + a("http://mydisk.hostyourself.net") + 
                 ". Unlike the old sharing solution, MyDisk does not require an open network port." +
                 " This means you no longer need to open up your firewall and add port forwarding" +
                 " rules to share files online."));                
    }
}
