/*
 * The MIT License
 *
 * Copyright 2016 Pawel Marynowski.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
package pattypan;

import java.util.HashMap;
import java.util.Map;

public final class Settings {

  private Settings() {};
  
  public static final String NAME = "pattypan";
  public static final String VERSION = "0.0.0";
  public static final String USERAGENT = NAME + "/" + VERSION + " (https://github.com/yarl/pattypan)";
  
  public static int WINDOW_WIDTH = 600;
  public static int WINDOW_HEIGHT = 400;

  public static final Map<String, Template> TEMPLATES = new HashMap<>();

  static {
    TEMPLATES.put(
            "Artwork",
            new Template("Artwork",
                    new TemplateField[]{
                      new TemplateField("artist", "Artist"),
                      new TemplateField("author", "Author"),
                      new TemplateField("title", "Title"),
                      new TemplateField("description", "Description"),
                      new TemplateField("date", "Date"),
                      new TemplateField("medium", "Medium"),
                      new TemplateField("dimensions", "Dimensions"),
                      new TemplateField("institution", "Institution"),
                      new TemplateField("departament", "Departament"),
                      new TemplateField("place_of_discovery", "Place of discovery"),
                      new TemplateField("object_history", "Object history"),
                      new TemplateField("exhibition_history", "Exhibition history"),
                      new TemplateField("credit_line", "Credit line"),
                      new TemplateField("inscriptions", "Inscriptions"),
                      new TemplateField("notes", "Notes"),
                      new TemplateField("accession_number", "Accession number"),
                      new TemplateField("place_of_creation", "Place of creation"),
                      new TemplateField("source", "source"),
                      new TemplateField("permission", "Permission"),
                      new TemplateField("other_versions", "Other versions"),
                      new TemplateField("references", "References"),
                      new TemplateField("wikidata", "Wikidata"),
                      new TemplateField("license", "License"),
                    }, "=={{int:filedesc}}==\n{{Artwork\n"
                    + " |artist = ${artist}\n"
                    + " |author = ${author}\n"
                    + " |title = ${title}\n"
                    + " |description = ${description}\n"
                    + " |date = ${date}\n"
                    + " |medium = ${medium}\n"
                    + " |dimensions = ${dimensions}\n"
                    + " |institution = ${institution}\n"
                    + " |department = ${departament}\n"
                    + " |place of discovery = ${place_of_discovery}\n"
                    + " |object history = ${object_history}\n"
                    + " |exhibition history = ${exhibition_history}\n"
                    + " |credit line = ${credit_line}\n"
                    + " |inscriptions = ${inscriptions}\n"
                    + " |notes = ${notes}\n"
                    + " |accession number = ${accession_number}\n"
                    + " |place of creation = ${place_of_creation}\n"
                    + " |source = ${source}\n"
                    + " |permission = ${permission}\n"
                    + " |other_versions = ${other_versions}\n"
                    + " |references = ${references}\n"
                    + " |wikidata = ${wikidata}\n"
                    + "}}\n\n"
                    + "=={{int:license-header}}==\n${license}"
            ));
  }
}

@@ -1459,19 +1459,17 @@
 ypan)%22;%0A
-  
 %0A
+
   public
@@ -1616,16 +1616,16 @@
 p%3C%3E();%0A%0A
-
   static
@@ -1646,16 +1646,1092 @@
 ES.put(%0A
+            %22Information%22,%0A            new Template(%22Information%22,%0A                    new TemplateField%5B%5D%7B%0A                      new TemplateField(%22description%22, %22Description%22),%0A                      new TemplateField(%22date%22, %22Date%22),%0A                      new TemplateField(%22source%22, %22Source%22),%0A                      new TemplateField(%22author%22, %22Author%22),%0A                      new TemplateField(%22permission%22, %22Permission%22),%0A                      new TemplateField(%22other_versions%22, %22Other versions%22),%0A                      new TemplateField(%22license%22, %22License%22),%0A                    %7D, %22==%7B%7Bint:filedesc%7D%7D==%5Cn%7B%7BInformation%5Cn%22%0A                    + %22 %7Cdescription = $%7Bdescription%7D%5Cn%22%0A                    + %22 %7Cdate = $%7Bdate%7D%5Cn%22%0A                    + %22 %7Csource = $%7Bsource%7D%5Cn%22%0A                    + %22 %7Cauthor = $%7Bauthor%7D%5Cn%22%0A                    + %22 %7Cpermission = $%7Bpermission%7D%5Cn%22%0A                    + %22 %7Cother versions = $%7Bother_versions%7D%5Cn%22%0A                    + %22%7D%7D%5Cn%5Cn%22%0A                    + %22==%7B%7Bint:license-header%7D%7D==%5Cn$%7Blicense%7D%22%0A            )%0A    );%0A    TEMPLATES.put(%0A
         

add {{information}} template