requirejs.config({
  baseUrl: '../js/src',
  paths : {
    'lib': '../lib'
  }
});

var json = {
  "@type":"koral:docGroup",
  "operation":"operation:or",
  "operands":[
    {
      "@type":"koral:docGroup",
      "operation":"operation:and",
      "operands":[
        {
          "@type":"koral:doc",
          "key":"title",
          "value":"Der Birnbaum",
          "match":"match:eq"
        },
        {
          "@type":"koral:doc",
          "key":"pubPlace",
          "value":"Mannheim",
          "match":"match:eq"
        },
        {
          "@type":"koral:docGroup",
          "operation":"operation:or",
          "operands":[
            {
              "@type":"koral:doc",
              "key":"subTitle",
              "value":"Aufzucht und Pflege",
              "match":"match:eq"
            },
            {
              "@type":"koral:doc",
              "key":"subTitle",
              "value":"Gedichte",
              "match":"match:eq",
              "rewrites" : [
                {
                  "@type": "koral:rewrite",
                  "src" : "policy",
                  "operation" : "operation:injection",
                }
              ]
            }
          ]
        }
      ]
    },
    {
      "@type":"koral:doc",
      "key":"pubDate",
      "type":"type:date",
      "value":"2015-03-05",
      "match":"match:geq"
    }
  ]
};

require(['vc','lib/domReady'], function (vcClass, domReady) {

  var loc = KorAP.Locale;

  loc.AND = 'und';
  loc.OR  = 'oder';
  loc.VC_subTitle = 'Untertitel';
  loc.VC_title = 'Titel';
  loc.VC_pubDate = 'Veröffentlichungsdatum';
  loc.VC_pubPlace = 'Veröffentlichungsort';

  domReady(function() {

    // Create a new virtual collection by passing a based json object and
    // field menu information
    var vc = vcClass.create([
      ['title', 'string'],
      ['subTitle', 'string'],
      ['pubDate', 'date'],
      ['author', 'string']
    ]).fromJson(json);

    document.getElementById('vc').appendChild(vc.element());

    // show the current JSON serialization
    KorAP.showJSON = function () {
      document.getElementById("json").innerHTML = JSON.stringify(vc.root().toJson());
    };

    // show the current query serialization
    KorAP.showQuery = function () {
      document.getElementById("query").innerHTML = vc.root().toQuery();
    };

  });
});
