// Path: src/test/java/com/bitplan/mediawiki/japi/ExampleWiki.java
// public class ExamplePage extends Page {
// 	String contentPart;
// 	boolean forEdit=false;
// 
// 	/**
// 	 * construct an example Page with the given title and the given part of the
// 	 * content
// 	 * 
// 	 * @param title
// 	 * @param contentPart
// 	 * @param forEdit
// 	 */
// 	public ExamplePage(String title, String contentPart,boolean forEdit) {
// 		this.title = title;
// 		this.contentPart = contentPart;
// 		this.forEdit=forEdit;
// 	}
// 		
// 	public ExamplePage(String title, String contentPart) {
// 		this(title,contentPart,false);
// 	}
// 
// 	public String getContentPart() {
// 		return contentPart;
// 	}
// 
// }


import java.util.HashMap;
import java.util.Map;
import java.util.StringTokenizer;
import com.bitplan.mediawiki.japi.ExampleWiki.ExamplePage;
import com.google.inject.AbstractModule;
import com.google.inject.Guice;
import com.google.inject.Injector;
    String csv = Mediawiki.getStringFromUrl(urlString);
    String[] csvlines = csv.split("\n");
    int lineIndex = 0;
    for (String csvLine : csvlines) {
      if (lineIndex++ > 0) {
        this.add(this.getExampleWikiFromCSV(csvLine, this.defaultWiki));
      }
    }
  }

  /**
   * get the given Example wiki
   * 
   * @param wikiId
   * @return - the example wiki for the given wikiId
   * @throws Exception
   */
  public ExampleWiki get(String wikiId) throws Exception {
    // this code should be (partly?) replaced by csv-access
    if (getExampleWikis().size() == 0) {
      // String urlString = "http://mediawiki-japi.bitplan.com/mediawiki-japi/index.php/Special:Ask/-5B-5BCategory:ExampleWiki-5D-5D-20-5B-5Bsiteurl::%2B-5D-5D/-3FSiteurl/-3FWikiid/-3FMwversion/-3FMwMinExpectedPages/format%3Dcsv/sep%3D;/offset%3D0";
      // FIXME uncomment to activate
      // readCSV(urlString);
      // Mediawiki site
      ExampleWiki wiki = add("wikipedia_org_test2",
          //"http://www.mediawiki.org",
          "https://test2.wikipedia.org",
          Mediawiki.DEFAULT_SCRIPTPATH);
      wiki.setExpectedPages(30000);
      wiki.setLogo("//test2.wikipedia.org/static/images/project-logos/test2wiki.png");
// Path: src/test/java/com/bitplan/mediawiki/japi/ExampleWiki.java
// public class ExamplePage extends Page {
// 	String contentPart;
// 	boolean forEdit=false;
// 
// 	/**
// 	 * construct an example Page with the given title and the given part of the
// 	 * content
// 	 * 
// 	 * @param title
// 	 * @param contentPart
// 	 * @param forEdit
// 	 */
// 	public ExamplePage(String title, String contentPart,boolean forEdit) {
// 		this.title = title;
// 		this.contentPart = contentPart;
// 		this.forEdit=forEdit;
// 	}
// 		
// 	public ExamplePage(String title, String contentPart) {
// 		this(title,contentPart,false);
// 	}
// 
// 	public String getContentPart() {
// 		return contentPart;
// 	}
// 
// }


// Path: src/test/java/com/bitplan/mediawiki/japi/ExampleWikiManager.java
import java.util.HashMap;
import java.util.Map;
import java.util.StringTokenizer;
import com.bitplan.mediawiki.japi.ExampleWiki.ExamplePage;
import com.google.inject.AbstractModule;
import com.google.inject.Guice;
import com.google.inject.Injector;

    String csv = Mediawiki.getStringFromUrl(urlString);
    String[] csvlines = csv.split("\n");
    int lineIndex = 0;
    for (String csvLine : csvlines) {
      if (lineIndex++ > 0) {
        this.add(this.getExampleWikiFromCSV(csvLine, this.defaultWiki));
      }
    }
  }

  /**
   * get the given Example wiki
   * 
   * @param wikiId
   * @return - the example wiki for the given wikiId
   * @throws Exception
   */
  public ExampleWiki get(String wikiId) throws Exception {
    // this code should be (partly?) replaced by csv-access
    if (getExampleWikis().size() == 0) {
      // String urlString = "http://mediawiki-japi.bitplan.com/mediawiki-japi/index.php/Special:Ask/-5B-5BCategory:ExampleWiki-5D-5D-20-5B-5Bsiteurl::%2B-5D-5D/-3FSiteurl/-3FWikiid/-3FMwversion/-3FMwMinExpectedPages/format%3Dcsv/sep%3D;/offset%3D0";
      // FIXME uncomment to activate
      // readCSV(urlString);
      // Mediawiki site
      ExampleWiki wiki = add("wikipedia_org_test2",
          //"http://www.mediawiki.org",
          "https://test2.wikipedia.org",
          Mediawiki.DEFAULT_SCRIPTPATH);
      wiki.setExpectedPages(30000);
      wiki.setLogo("//test2.wikipedia.org/static/images/project-logos/test2wiki.png");
      ExamplePage testPage1 = wiki.new ExamplePage("Asteroid",