Integrated lite controllers, services and tests in full version.

Change-Id: I14f9437d9cae6418b3b89bbfee810f95a0e74832
diff --git a/full/src/main/resources/db/lite-sqlite/V1__annotation_tables.sql b/full/src/main/resources/db/lite-sqlite/V1__annotation_tables.sql
new file mode 100644
index 0000000..b0299d1
--- /dev/null
+++ b/full/src/main/resources/db/lite-sqlite/V1__annotation_tables.sql
@@ -0,0 +1,53 @@
+CREATE TABLE IF NOT EXISTS annotation(
+	id INTEGER PRIMARY KEY AUTOINCREMENT,
+	code VARCHAR(20) NOT NULL,
+	type VARCHAR(20) NOT NULL,
+	text VARCHAR(20) NULL,
+	description VARCHAR(100) NOT NULL,
+	de_description VARCHAR(100)
+);
+
+CREATE UNIQUE INDEX annotation_index ON annotation (code, type);
+
+CREATE TABLE IF NOT EXISTS annotation_layer(
+	id INTEGER PRIMARY KEY AUTOINCREMENT,
+	foundry_id INTEGER NOT NULL,
+	layer_id INTEGER NOT NULL,
+	description VARCHAR(255) NOT NULL,
+	FOREIGN KEY (foundry_id)
+		REFERENCES annotation (id)
+		ON DELETE CASCADE,
+	FOREIGN KEY (layer_id)
+		REFERENCES annotation (id)
+		ON DELETE CASCADE
+);
+
+CREATE UNIQUE INDEX annotation_layer_index ON annotation_layer (foundry_id, layer_id);
+
+CREATE TABLE IF NOT EXISTS annotation_key(
+	id INTEGER PRIMARY KEY AUTOINCREMENT,
+	layer_id INTEGER NOT NULL,
+	key_id INTEGER NOT NULL,
+	FOREIGN KEY (layer_id)
+		REFERENCES annotation_layer (id)
+		ON DELETE CASCADE,
+	FOREIGN KEY (key_id)
+		REFERENCES annotation (id)
+		ON DELETE CASCADE
+);
+
+CREATE UNIQUE INDEX annotation_key_index ON annotation_key (layer_id, key_id);
+
+CREATE TABLE IF NOT EXISTS annotation_value(
+	id INTEGER PRIMARY KEY AUTOINCREMENT,
+	key_id INTEGER NOT NULL,
+	value_id INTEGER NOT NULL,
+	FOREIGN KEY (key_id)
+		REFERENCES annotation_key (id)
+		ON DELETE CASCADE,
+	FOREIGN KEY (key_id)
+		REFERENCES annotation (id)
+		ON DELETE CASCADE
+);
+
+CREATE UNIQUE INDEX annotation_value_index ON annotation_value (key_id, value_id);
diff --git a/full/src/main/resources/db/mysql/V0.1__userdatabase.sql b/full/src/main/resources/db/mysql/V0.1__userdatabase.sql
deleted file mode 100644
index c069b6e..0000000
--- a/full/src/main/resources/db/mysql/V0.1__userdatabase.sql
+++ /dev/null
@@ -1,76 +0,0 @@
-
--- rename all columns in new way!
-CREATE TABLE IF NOT EXISTS korap_users (
-    id INTEGER PRIMARY KEY AUTO_INCREMENT,
-    username VARCHAR(100) NOT NULL UNIQUE,
-    password VARCHAR(100) NOT NULL,
-    account_lock boolean NOT NULL,
-    account_creation BIGINT NOT NULL,
-    type INTEGER DEFAULT 0,
-    uri_fragment VARCHAR(100),
-    uri_expiration BIGINT,
-    loginSuccess INTEGER,
-    loginFailed INTEGER,
-    account_link VARCHAR(100)
-);
-
-CREATE TABLE IF NOT EXISTS admin_users (
-    id INTEGER PRIMARY KEY AUTO_INCREMENT,
-    user_id INTEGER NOT NULL,
-    foreign key (user_id)
-    references korap_users (id)
-);
-
-CREATE TABLE IF NOT EXISTS shib_users (
-    id INTEGER PRIMARY KEY AUTO_INCREMENT,
-    username VARCHAR(100) NOT NULL UNIQUE,
-    account_creation BIGINT NOT NULL,
-    type INTEGER DEFAULT 1,
-    loginSuccess INTEGER,
-    loginFailed INTEGER,
-    account_link VARCHAR(100)
-);
-
-
-CREATE TABLE IF NOT EXISTS user_details (
-id INTEGER PRIMARY KEY AUTO_INCREMENT,
-user_id INTEGER UNIQUE NOT NULL,
-data BLOB NOT NULL
-);
-
-CREATE TABLE IF NOT EXISTS user_settings (
-id INTEGER PRIMARY KEY AUTO_INCREMENT,
-user_id INTEGER UNIQUE NOT NULL,
-data BLOB NOT NULL
-);
-
--- deprecated
-CREATE OR REPLACE VIEW allusers AS
-    SELECT
-        id,
-        username,
-        password,
-        account_lock,
-        account_creation,
-        type,
-        uri_fragment,
-        uri_expiration,
-        loginSuccess,
-        loginFailed,
-        account_link
-    from
-        korap_users
-    UNION ALL SELECT
-        id,
-        username,
-        NULL as password,
-        NULL as account_lock,
-        account_creation,
-        type,
-        NULL as uri_fragment,
-        NULL as uri_expiration,
-        loginSuccess,
-        loginFailed,
-        account_link
-    from
-        shib_users;
diff --git a/full/src/main/resources/db/mysql/V0.2__resourcesdatabase.sql b/full/src/main/resources/db/mysql/V0.2__resourcesdatabase.sql
deleted file mode 100644
index cc2afa3..0000000
--- a/full/src/main/resources/db/mysql/V0.2__resourcesdatabase.sql
+++ /dev/null
@@ -1,61 +0,0 @@
--- why unsigned?
-CREATE TABLE IF NOT EXISTS resource_store (
-id INTEGER PRIMARY KEY AUTO_INCREMENT,
-persistent_id VARCHAR(100) NOT NULL UNIQUE,
-name VARCHAR(100),
-description VARCHAR(300),
-parent_id Integer unsigned null,
-created BIGINT null,
-data BLOB,
-type INTEGER NOT NULL,
-creator INTEGER NOT NULL
-);
-
-CREATE TABLE IF NOT EXISTS resource_tree (
-parent_id INTEGER,
-child_id INTEGER,
-depth INTEGER,
-name_path VARCHAR(250),
-PRIMARY KEY (parent_id , child_id),
-foreign key (parent_id)
-references resource_store (id)
-on delete cascade,
-foreign key (child_id)
-references resource_store (id)
-on delete cascade
-);
-
--- deprecated
-CREATE TABLE IF NOT EXISTS user_queries (
-    id INTEGER PRIMARY KEY,
-    queryLanguage VARCHAR(100),
-    name VARCHAR(100),
-    query VARCHAR(200),
-    description VARCHAR(150),
-    foreign key (id)
-    references resource_store(id)
-    on delete cascade
-);
-
-CREATE TABLE IF NOT EXISTS coll_store (
-    id INTEGER,
-    query VARCHAR(500),
-    user_id INTEGER,
-    created TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
-    -- is foreign key constraint valid after refactoring?
-    foreign key (id) references resource_store(id)
-    on delete cascade);
-
-
-CREATE TABLE IF NOT EXISTS matchInfo (
-    id INTEGER PRIMARY KEY AUTO_INCREMENT,
-    user_id BIGINT NOT NULL,
-    matchInfo VARCHAR(100)
-);
-
-CREATE TABLE IF NOT EXISTS doc_store (
-    id INTEGER PRIMARY KEY AUTO_INCREMENT,
-    persistent_id VARCHAR(100) UNIQUE,
-    created TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
-    disabled BOOLEAN default true
-);
\ No newline at end of file
diff --git a/full/src/main/resources/db/mysql/V0.3__securitydatabase.sql b/full/src/main/resources/db/mysql/V0.3__securitydatabase.sql
deleted file mode 100644
index 5406156..0000000
--- a/full/src/main/resources/db/mysql/V0.3__securitydatabase.sql
+++ /dev/null
@@ -1,114 +0,0 @@
--- last_modified timestamp ON UPDATE CURRENT_TIMESTAMP,
-CREATE TABLE IF NOT EXISTS policy_store (
-    id INTEGER PRIMARY KEY AUTO_INCREMENT,
-    target_id BIGINT NOT NULL,
-    created TIMESTAMP,
-    creator INTEGER NOT NULL,
-    posix SMALLINT NOT NULL,
-    expire BIGINT NULL,
-    enable BIGINT NULL,
-    iprange VARCHAR(200)
-);
-
-CREATE TABLE IF NOT EXISTS group_ref (
-    id INTEGER PRIMARY KEY AUTO_INCREMENT,
-    group_id VARCHAR(100) NOT NULL,
-    policy_id INTEGER NOT NULL
-);
-
-
-CREATE TABLE IF NOT EXISTS group_store (
-    name VARCHAR(100) PRIMARY KEY,
-    description VARCHAR(200),
-    sym_use INTEGER DEFAULT -1,
-    export VARCHAR(30) DEFAULT NULL,
-    query_only VARCHAR(30) DEFAULT NULL,
-    licence INTEGER DEFAULT -1,
-    -- basically every resource we have is an academic resource, thus a non-commercial use is infered!
-    commercial BOOLEAN DEFAULT FALSE
-);
-
-CREATE TABLE IF NOT EXISTS group_users (
-    id INTEGER PRIMARY KEY AUTO_INCREMENT,
-    user_id BIGINT NOT NULL,
-    -- make integer
-    group_id VARCHAR(100) NOT NULL,
-    admin BOOLEAN NOT NULL DEFAULT FALSE,
-    FOREIGN KEY (group_id)
-        REFERENCES group_store (name) on delete cascade
-);
-
-CREATE TABLE IF NOT EXISTS param_store (
-    id INTEGER PRIMARY KEY AUTO_INCREMENT,
-    p_key VARCHAR(100) NOT NULL,
-    p_value VARCHAR(150) NOT NULL,
-    resource INTEGER DEFAULT -1,
-    pid INTEGER DEFAULT -1,
-    FOREIGN KEY (resource)
-        REFERENCES resource_store(id)
-    on delete cascade,
-    FOREIGN KEY (pid)
-        REFERENCES policy_store(id)
-    on delete cascade
-);
-
-CREATE TABLE IF NOT EXISTS param_map (
-    id INTEGER PRIMARY KEY AUTO_INCREMENT,
-    policy_id INTEGER NOT NULL,
-    param_id INTEGER NOT NULL,
-    value VARCHAR(100) NOT NULL,
-    flag BOOLEAN NOT NULL DEFAULT FALSE,
-    FOREIGN KEY (param_id)
-        REFERENCES param_store (id),
-    FOREIGN KEY (policy_id)
-        REFERENCES policy_store (id)
-);
-
-create or replace view policy_view as
-select
-    po.id as pid,
-    po.target_id as id,
-    rs.persistent_id as persistent_id,
-    rs.name as name,
-    rs.type as type,
-    c.group_id as group_id,
-    po.posix as perm,
-    po.creator as creator,
-    po.expire as expire,
-    po.enable as enable,
-    po.iprange as iprange
-from
-policy_store as po
-inner join
-group_ref as c ON c.policy_id = po.id
-inner join
-resource_store as rs ON rs.id = po.target_id
-union all select
-              - 1 as pid,
-              rs.id as id,
-              rs.persistent_id as persistent_id,
-              rs.name as name,
-              type as type,
-              'self' as group_id,
-              127 as perm,
-              creator,
-              NULL as expire,
-              rs.created as enable,
-              null as iprange
-          from
-          resource_store as rs;
-
-
-CREATE TABLE IF NOT EXISTS audit_records (
-id INTEGER PRIMARY KEY AUTO_INCREMENT,
-aud_category VARCHAR(100),
-aud_target VARCHAR(100),
-aud_user VARCHAR(100),
-aud_location VARCHAR(100),
-aud_operation VARCHAR(100),
-aud_field_1 VARCHAR(400),
-aud_timestamp TIMESTAMP,
-aud_failure VARCHAR(100)
-);
-
--- foreign key constraints
diff --git a/full/src/main/resources/db/new-mysql/V1.1__create_virtual_corpus_tables.sql b/full/src/main/resources/db/mysql/V1.1__create_virtual_corpus_tables.sql
similarity index 100%
rename from full/src/main/resources/db/new-mysql/V1.1__create_virtual_corpus_tables.sql
rename to full/src/main/resources/db/mysql/V1.1__create_virtual_corpus_tables.sql
diff --git a/full/src/main/resources/db/new-mysql/V1.2__create_admin_table.sql b/full/src/main/resources/db/mysql/V1.2__create_admin_table.sql
similarity index 100%
rename from full/src/main/resources/db/new-mysql/V1.2__create_admin_table.sql
rename to full/src/main/resources/db/mysql/V1.2__create_admin_table.sql
diff --git a/full/src/main/resources/db/mysql/V1.2__oauth2_tables_mysql.sql b/full/src/main/resources/db/mysql/V1.2__oauth2_tables_mysql.sql
deleted file mode 100644
index fe75267..0000000
--- a/full/src/main/resources/db/mysql/V1.2__oauth2_tables_mysql.sql
+++ /dev/null
@@ -1,48 +0,0 @@
-
--- oauth2 db tables
-create table if not exists oauth2_client (
-client_id VARCHAR(100) UNIQUE PRIMARY KEY,
-client_secret VARCHAR(200),
-redirect_uri VARCHAR(250),
-client_type VARCHAR(200),
-is_confidential BOOLEAN DEFAULT FALSE,
-url VARCHAR(200) UNIQUE
-);
-
-
--- status 1 = valid, 0 = revoked, -1 = disabled
-create table if not exists oauth2_access_token (
-id INTEGER PRIMARY KEY AUTO_INCREMENT,
-access_token VARCHAR(300),
-auth_code VARCHAR(250),
-client_id VARCHAR(100),
-user_id INTEGER,
--- make boolean --
-status INTEGER DEFAULT 1,
--- in case of code authorization, should match auth code scopes!
--- use scopes for levelaccess descriptor level[rw],level[r]
-scopes VARCHAR(350),
-expiration TIMESTAMP,
-FOREIGN KEY (user_id)
-REFERENCES korap_users(id)
-ON DELETE CASCADE,
-FOREIGN KEY (client_id)
-REFERENCES oauth2_client(client_id)
-ON DELETE CASCADE
-);
-
-
--- also scopes?
-create table if not exists oauth2_refresh_token (
-id INTEGER PRIMARY KEY AUTO_INCREMENT,
-client_id VARCHAR(100),
-user_id INTEGER,
-expiration TIMESTAMP,
-scopes VARCHAR(350),
-FOREIGN KEY (user_id)
-REFERENCES korap_users(id)
-ON DELETE CASCADE,
-FOREIGN KEY (client_id)
-REFERENCES oauth2_client(client_id)
-ON DELETE CASCADE
-);
\ No newline at end of file
diff --git a/full/src/main/resources/db/mysql/V1.3__triggers.sql b/full/src/main/resources/db/mysql/V1.3__triggers.sql
index 687a10a..7bc25dd 100644
--- a/full/src/main/resources/db/mysql/V1.3__triggers.sql
+++ b/full/src/main/resources/db/mysql/V1.3__triggers.sql
@@ -1,15 +1,14 @@
--- indices
-DELIMITER $$
-create trigger delete_policy after delete on resource_store
-for each row begin
-    delete from policy_store where target_id=OLD.id;
-end; $$
+delimiter |
 
-CREATE TRIGGER tree_entry_insert AFTER INSERT ON resource_store FOR EACH ROW BEGIN
-	INSERT INTO resource_tree (parent_id, child_id, depth, name_path)
-	VALUES (NEW.id, NEW.id, 0, NEW.name);
-	INSERT INTO resource_tree (parent_id, child_id, depth, name_path)
-	SELECT parent_id, NEW.id, depth + 1, concat(name_path,"/",NEW.name) FROM resource_tree WHERE child_id = NEW.parent_id;
-END; $$
-
-DELIMITER ;
\ No newline at end of file
+CREATE TRIGGER delete_member AFTER UPDATE ON user_group
+	FOR EACH ROW 
+	BEGIN
+		UPDATE user_group_member 
+		SET status = "DELETED"
+		WHERE NEW.status = "DELETED" 
+			AND  OLD.status != "DELETED" 
+			AND group_id = NEW.id;
+	END;
+|
+	
+delimiter ;
\ No newline at end of file
diff --git a/full/src/main/resources/db/mysql/V1.4__indices.sql b/full/src/main/resources/db/mysql/V1.4__indices.sql
deleted file mode 100644
index 32a0211..0000000
--- a/full/src/main/resources/db/mysql/V1.4__indices.sql
+++ /dev/null
@@ -1,5 +0,0 @@
--- todo: are this automatically adapted when refactoring?
-CREATE INDEX group_index ON group_users(user_id, group_id);
-CREATE INDEX policy_index ON group_ref(policy_id);
-CREATE UNIQUE INDEX resource_tree_index ON resource_tree (parent_id, depth, child_id);
-CREATE UNIQUE INDEX param_unique ON param_store (p_key, p_value);
diff --git a/full/src/main/resources/db/new-mysql/V1.4__oauth2_tables.sql b/full/src/main/resources/db/mysql/V1.4__oauth2_tables.sql
similarity index 100%
rename from full/src/main/resources/db/new-mysql/V1.4__oauth2_tables.sql
rename to full/src/main/resources/db/mysql/V1.4__oauth2_tables.sql
diff --git a/full/src/main/resources/db/new-mysql/V1__create_tables.sql b/full/src/main/resources/db/mysql/V1__create_tables.sql
similarity index 100%
rename from full/src/main/resources/db/new-mysql/V1__create_tables.sql
rename to full/src/main/resources/db/mysql/V1__create_tables.sql
diff --git a/full/src/main/resources/db/mysql/initial_version.sql b/full/src/main/resources/db/mysql/initial_version.sql
deleted file mode 100644
index 3bff5cc..0000000
--- a/full/src/main/resources/db/mysql/initial_version.sql
+++ /dev/null
@@ -1,326 +0,0 @@
---
----- rename all columns in new way!
---CREATE TABLE IF NOT EXISTS korapusers (
---    id INTEGER PRIMARY KEY AUTO_INCREMENT,
---    username VARCHAR(100) NOT NULL UNIQUE,
---    password VARCHAR(100) NOT NULL,
---    accountLock boolean NOT NULL,
---    accountCreation TIMESTAMP NOT NULL,
---    type INTEGER DEFAULT 0,
---    URI_PASS_Fragment VARCHAR(100),
---    URI_CONF_Fragment VARCHAR(100),
---    URI_Expiration TIMESTAMP,
---    loginSuccess INTEGER,
---    loginFailed INTEGER,
---    accountExpiration TIMESTAMP NOT NULL,
---    accountLink VARCHAR(100)
---);
---
---CREATE TABLE IF NOT EXISTS shibusers (
---    id INTEGER PRIMARY KEY AUTO_INCREMENT,
---    username VARCHAR(100) NOT NULL UNIQUE,
---    accountCreation TIMESTAMP NOT NULL,
---    type INTEGER DEFAULT 1,
---    loginSuccess INTEGER,
---    loginFailed INTEGER,
---    accountExpiration TIMESTAMP NOT NULL,
---    accountLink VARCHAR(100)
---);
---
---CREATE TABLE IF NOT EXISTS udetails (
---    Id INTEGER PRIMARY KEY AUTO_INCREMENT,
---    userID INTEGER NOT NULL UNIQUE,
---    firstName VARCHAR(100),
---    lastName VARCHAR(100),
---    gender VARCHAR(100),
---    phone VARCHAR(100),
---    institution VARCHAR(100),
---    email VARCHAR(100),
---    address VARCHAR(100),
---    country VARCHAR(100),
---    privateUsage BOOLEAN,
---    foreign key (userID)
---    references korapusers (id)
---    on delete cascade
---);
---
---CREATE TABLE IF NOT EXISTS usettings (
---    Id INTEGER PRIMARY KEY AUTO_INCREMENT,
---    userID INTEGER NOT NULL UNIQUE,
---    fileNameForExport VARCHAR(100),
---    itemForSimpleAnnotation INTEGER,
---    leftContextItemForExport VARCHAR(100),
---    leftContextSizeForExport INTEGER,
---    locale VARCHAR(100),
---    leftContextItem VARCHAR(100),
---    leftContextSize INTEGER,
---    rightContextItem VARCHAR(100),
---    rightContextItemForExport VARCHAR(100),
---    rightContextSize INTEGER,
---    rightContextSizeForExport INTEGER,
---    selectedCollection VARCHAR(100),
---    queryLanguage VARCHAR(100),
---    pageLength INTEGER,
---    metadataQueryExpertModus BOOLEAN,
---    searchSettingsTab INTEGER,
---    selectedGraphType INTEGER,
---    selectedSortType VARCHAR(100),
---    selectedViewForSearchResults VARCHAR(100),
---    POSFoundry VARCHAR(100),
---    lemmaFoundry VARCHAR(100),
---    constFoundry VARCHAR(100),
---    relFoundry VARCHAR(100),
---    collectData BOOLEAN,
---    foreign key (userID)
---    references korapusers (id)
---    on delete cascade
---);
---
---CREATE OR REPLACE VIEW allusers AS
---    SELECT
---        id,
---        username,
---        password,
---        accountLock,
---        accountCreation,
---        type,
---        URI_PASS_Fragment,
---        URI_CONF_Fragment,
---        URI_Expiration,
---        loginSuccess,
---        loginFailed,
---        accountExpiration,
---        accountLink
---    from
---        korapusers
---    UNION ALL SELECT
---        id,
---        username,
---        NULL as password,
---        NULL as accountLock,
---        accountCreation,
---        type,
---        NULL as URI_PASS_Fragment,
---        NULL as URI_CONF_Fragment,
---        NULL as URI_Expiration,
---        loginSuccess,
---        loginFailed,
---        accountExpiration,
---        accountLink
---    from
---        shibusers;
-
----- why unsigned?
---CREATE TABLE IF NOT EXISTS r_store (
---id INTEGER PRIMARY KEY AUTO_INCREMENT,
---persistent_id VARCHAR(100) NOT NULL UNIQUE,
---name VARCHAR(100),
---description VARCHAR(300),
---parent_id Integer unsigned null,
---created timestamp default current_timestamp,
---type INTEGER NOT NULL,
---creator INTEGER NOT NULL
---);
---
---CREATE TABLE IF NOT EXISTS uqueries (
---    id INTEGER PRIMARY KEY,
---    queryLanguage VARCHAR(100),
---    name VARCHAR(100),
---    query VARCHAR(200),
---    description VARCHAR(150),
---    foreign key (id)
---    references r_store(id)
---    on delete cascade
---);
-
-CREATE TABLE IF NOT EXISTS r_tree (
-parent_id INTEGER,
-child_id INTEGER,
-depth INTEGER,
-name_path VARCHAR(250),
-PRIMARY KEY (parent_id , child_id),
-foreign key (parent_id)
-references r_store (id)
-on delete cascade,
-foreign key (child_id)
-references r_store (id)
-on delete cascade
-);
-
-
-CREATE TABLE IF NOT EXISTS cstorage (
-    id INTEGER,
-    refCorpus VARCHAR(100),
-    query VARCHAR(500),
-    -- is foreign key constraint valid after refactoring?
-    foreign key (id) references r_store(id)
-    on delete cascade);
-
-
-CREATE TABLE IF NOT EXISTS matchInfo (id INTEGER PRIMARY KEY AUTO_INCREMENT, userid BIGINT NOT NULL,
-matchInfo VARCHAR(100));
-
-CREATE TABLE IF NOT EXISTS resourceRecords (
-    AUD_ID INTEGER PRIMARY KEY AUTO_INCREMENT,
-    AUD_RESOURCE VARCHAR(100),
-    AUD_USER VARCHAR(100),
-    AUD_LOC VARCHAR(100),
-    AUD_OP VARCHAR(100),
-    AUD_TIMESTAMP TIMESTAMP,
-    AUD_FAILURE VARCHAR(100)
-);
-
-CREATE TABLE IF NOT EXISTS databaseRecords (
-    AUD_ID INTEGER PRIMARY KEY AUTO_INCREMENT,
-    AUD_TARGET VARCHAR(100),
-    AUD_USER VARCHAR(100),
-    AUD_LOC VARCHAR(100),
-    AUD_OP VARCHAR(100),
-    AUD_TIMESTAMP TIMESTAMP,
-    AUD_FAILURE VARCHAR(100)
-);
-
-CREATE TABLE IF NOT EXISTS securityRecords (
-    AUD_ID INTEGER PRIMARY KEY AUTO_INCREMENT,
-    AUD_USER VARCHAR(100),
-    AUD_LOC VARCHAR(100),
-    AUD_OP VARCHAR(100),
-    AUD_TIMESTAMP TIMESTAMP,
-    AUD_FAILURE VARCHAR(100)
-);
-
-
---CREATE TABLE IF NOT EXISTS doc_store (
---    id INTEGER PRIMARY KEY AUTO_INCREMENT,
---    persistent_id VARCHAR(100) UNIQUE,
---    created TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
---    disabled BOOLEAN default true
---);
-
--- last_modified timestamp ON UPDATE CURRENT_TIMESTAMP,
-CREATE TABLE IF NOT EXISTS p_store (
-    id INTEGER PRIMARY KEY AUTO_INCREMENT,
-    target_id BIGINT NOT NULL,
-    created TIMESTAMP,
-    creator INTEGER NOT NULL,
-    posix SMALLINT NOT NULL,
-    expire TIMESTAMP NULL,
-    enable TIMESTAMP NULL,
-    iprange VARCHAR(200)
-);
-
-CREATE TABLE IF NOT EXISTS conditionDef (
-    id INTEGER PRIMARY KEY AUTO_INCREMENT,
-    groupRef VARCHAR(100) NOT NULL,
-    policyid INTEGER NOT NULL
-);
-
-
-CREATE TABLE IF NOT EXISTS groupStore (
-    name VARCHAR(100) PRIMARY KEY,
-    description VARCHAR(200),
-    sym_use INTEGER DEFAULT -1,
-    export VARCHAR(30) DEFAULT NULL,
-    query_only VARCHAR(30) DEFAULT NULL,
-    licence INTEGER DEFAULT -1,
-    -- basically every resource we have is an academic resource, thus a non-commercial use is infered!
-    commercial BOOLEAN DEFAULT FALSE
-);
-
-CREATE TABLE IF NOT EXISTS groupUsers (
-    id INTEGER PRIMARY KEY AUTO_INCREMENT,
-    userID BIGINT NOT NULL,
-    groupRef VARCHAR(100) NOT NULL,
-    admin BOOLEAN NOT NULL DEFAULT FALSE,
-    FOREIGN KEY (groupRef)
-        REFERENCES groupStore (name) on delete cascade
-);
-
-CREATE TABLE IF NOT EXISTS paramStore (
-    id INTEGER PRIMARY KEY AUTO_INCREMENT,
-    p_key VARCHAR(100) NOT NULL,
-    p_value VARCHAR(150) NOT NULL,
-    resource INTEGER DEFAULT -1,
-    pid INTEGER DEFAULT -1,
-    FOREIGN KEY (resource)
-        REFERENCES r_store(id)
-    on delete cascade,
-    FOREIGN KEY (pid)
-        REFERENCES p_store(id)
-    on delete cascade
-);
-
-CREATE TABLE IF NOT EXISTS paramMapping (
-    id INTEGER PRIMARY KEY AUTO_INCREMENT,
-    policyID INTEGER NOT NULL,
-    paramID INTEGER NOT NULL,
-    value VARCHAR(100) NOT NULL,
-    flag BOOLEAN NOT NULL DEFAULT FALSE,
-    FOREIGN KEY (paramID)
-        REFERENCES paramStore (id),
-    FOREIGN KEY (policyID)
-        REFERENCES p_store (id)
-);
-
-create or replace view p_view as
-select
-    po.id as pid,
-    po.target_id as id,
-    rs.persistent_id as persistent_id,
-    rs.name as name,
-    rs.type as type,
-    c.groupref as groupref,
-    po.posix as perm,
-    po.creator as creator,
-    po.expire as expire,
-    po.enable as enable,
-    po.iprange as iprange
-from
-p_store as po
-inner join
-conditionDef as c ON c.policyid = po.id
-inner join
-r_store as rs ON rs.id = po.target_id
-union all select
-              - 1 as pid,
-              rs.id as id,
-              rs.persistent_id as persistent_id,
-              rs.name as name,
-              type as type,
-              'self' as groupref,
-              127 as perm,
-              creator,
-              NULL as expire,
-              rs.created as enable,
-              null as iprange
-          from
-          r_store as rs;
-
-
--- indices
-create trigger delete_policy after delete on r_store
-for each row delete from p_store where target_id=OLD.id;
-
-DELIMITER //
-CREATE TRIGGER tree_entry_insert AFTER INSERT ON r_store FOR EACH ROW BEGIN
-	INSERT INTO r_tree (parent_id, child_id, depth, name_path)
-	VALUES (NEW.id, NEW.id, 0, NEW.name);
-	INSERT INTO r_tree (parent_id, child_id, depth, name_path)
-	SELECT parent_id, NEW.id, rt.depth + 1, concat(name_path,"/",NEW.name) FROM r_tree WHERE child_id = NEW.parent_id;
-END; //
-
-DELIMITER ;
-
--- todo: are this automatically adapted when refactoring?
-CREATE INDEX group_index ON groupUsers(userid);
-CREATE INDEX policy_index ON conditionDef(policyid);
-CREATE UNIQUE INDEX r_tree_index ON r_tree (parent_id, depth, child_id);
-CREATE UNIQUE INDEX para_unique ON paramStore (p_key, p_value);
-
--- foreign key constraints
-
-
-
-
-
-
diff --git a/full/src/main/resources/db/mysql/mysql_refactoring.sql b/full/src/main/resources/db/mysql/mysql_refactoring.sql
deleted file mode 100644
index 9b7cd6c..0000000
--- a/full/src/main/resources/db/mysql/mysql_refactoring.sql
+++ /dev/null
@@ -1,153 +0,0 @@
--- alter table korapusers TO korap_users;
-rename table usettings TO user_settings;
-alter table user_settings drop column itemForSimpleAnnotation;
-alter table user_settings drop column searchSettingsTab;
-alter table user_settings drop column selectedGraphType;
-alter table user_settings drop column selectedSortType;
-alter table user_settings drop column selectedViewForSearchResults;
-
-rename table udetails to user_details;
-rename table uqueries to user_queries;
-rename table korapusers to korap_users;
-rename table shibusers to shib_users;
-rename table matchInfo to match_info;
-
-alter table korap_users change column URI_PASS_Fragment uri_fragment VARCHAR(100);
-alter table korap_users change column URI_Expiration uri_expiration TIMESTAMP;
-alter table korap_users drop column URI_CONF_Fragment;
-alter table korap_users change column accountLock account_lock BOOLEAN not null default false;
-alter table korap_users change column accountCreation account_creation TIMESTAMP default CURRENT_TIMESTAMP not null;
-alter table korap_users change column accountExpiration account_expiration TIMESTAMP;
-alter table korap_users change column accountLink account_link VARCHAR(100);
-
-
-alter table shib_users change column accountCreation account_creation TIMESTAMP default CURRENT_TIMESTAMP not null;
-alter table shib_users change column accountExpiration account_expiration TIMESTAMP;
-alter table shib_users change column accountLink account_link VARCHAR(100);
-
-alter table user_details change column userID user_id INTEGER NOT NULL UNIQUE;
-
-drop view allusers;
-
-rename table r_store TO resource_store;
-rename table r_tree TO resource_tree;
-
-rename table groupStore TO group_store;
-rename table groupUsers TO group_users;
-rename table paramStore TO param_store;
-rename table paramMapping TO param_map;
-
--- todo: what about the moving of the entries?
--- rather rename than drop!
--- drop table cstorage;
--- todo: test
-rename table cstorage to coll_store;
-alter table coll_store add column (
-created TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
-user_id INTEGER);
-alter table coll_store drop column refCorpus;
-
-
--- do not recreate -- maintain data
---CREATE TABLE IF NOT EXISTS coll_store (
---id INTEGER PRIMARY KEY AUTO_INCREMENT,
---persistentID VARCHAR(150) UNIQUE,
---name VARCHAR(150),
---description VARCHAR(200),
---query VARCHAR(500),
---created TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
---userID INTEGER,
---foreign key(userID)
---references korap_users(id)
---on delete cascade
---);
-
-
---drop table doc_trace;
---
---CREATE TABLE IF NOT EXISTS doc_store (
---id VARCHAR(230) PRIMARY KEY,
---persistent_id VARCHAR(230) UNIQUE,
---created TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
---disabled BOOLEAN default true
---);
-
-
-
-rename table p_store to policy_store;
-rename table conditionDef to group_ref;
-alter table group_ref change groupRef group_id VARCHAR(100) NOT NULL;
-alter table group_ref change policyId policy_id INTEGER;
-
-drop view p_view;
-create or replace view policy_view as
-select
-    po.id as pid,
-    po.target_id as id,
-    rs.persistent_id as persistent_id,
-    rs.name as name,
-    rs.type as type,
-    c.group_id as group_id,
-    po.posix as perm,
-    po.creator as creator,
-    po.expire as expire,
-    po.enable as enable,
-    po.iprange as iprange
-from
-policy_store as po
-inner join
-group_ref as c ON c.policy_id = po.id
-inner join
-resource_store as rs ON rs.id = po.target_id
-union all select
-              - 1 as pid,
-              rs.id as id,
-              rs.persistent_id as persistent_id,
-              rs.name as name,
-              type as type,
-              'self' as groupId,
-              127 as perm,
-              creator,
-              NULL as expire,
-              rs.created as enable,
-              null as iprange
-          from
-          resource_store as rs;
-
-
-drop table resourceRecords;
-drop table databaseRecords;
-drop table securityRecords;
-
-CREATE TABLE IF NOT EXISTS audit_records (
-id INTEGER PRIMARY KEY AUTO_INCREMENT,
-aud_category VARCHAR(100),
-aud_target VARCHAR(100),
-aud_user VARCHAR(100),
-aud_location VARCHAR(100),
-aud_operation VARCHAR(100),
-aud_field_1 VARCHAR(400),
-aud_timestamp TIMESTAMP,
-aud_failure VARCHAR(100)
-);
-
-
-
-drop trigger tree_entry_insert;
-
-DELIMITER //
-CREATE TRIGGER tree_entry_insert AFTER INSERT ON resource_store FOR EACH ROW BEGIN
-	INSERT INTO resource_tree (parent_id, child_id, depth, name_path)
-	VALUES (NEW.id, NEW.id, 0, NEW.name);
-	INSERT INTO resource_tree (parent_id, child_id, depth, name_path)
-	SELECT parent_id, NEW.id, depth + 1, concat(name_path,"/",NEW.name)
-	FROM resource_tree WHERE child_id = NEW.parent_id;
-END; //
-
-DELIMITER ;
-
-
-drop trigger delete_policy;
-
-create trigger delete_policy after delete on resource_store
-for each row delete from policy_store where target_id=OLD.id;
\ No newline at end of file
diff --git a/full/src/main/resources/db/mysql/mysql_schema_comp.sql b/full/src/main/resources/db/mysql/mysql_schema_comp.sql
deleted file mode 100644
index 44ec4de..0000000
--- a/full/src/main/resources/db/mysql/mysql_schema_comp.sql
+++ /dev/null
@@ -1,321 +0,0 @@
-CREATE TABLE IF NOT EXISTS korap_users (
-    id INTEGER PRIMARY KEY AUTO_INCREMENT,
-    username VARCHAR(100) NOT NULL UNIQUE,
-    password VARCHAR(100) NOT NULL,
-    accountLock boolean NOT NULL,
-    accountCreation TIMESTAMP NOT NULL,
-    type INTEGER DEFAULT 0,
-    uriFragment VARCHAR(100),
-    uriExpiration TIMESTAMP,
-    accountLink VARCHAR(100)
-)$$
-
-
-CREATE TABLE IF NOT EXISTS shib_users (
-    id INTEGER PRIMARY KEY AUTO_INCREMENT,
-    username VARCHAR(100) NOT NULL UNIQUE,
-    accountCreation TIMESTAMP NOT NULL,
-    type INTEGER DEFAULT 1,
-    loginSuccess INTEGER,
-    loginFailed INTEGER,
-    accountExpiration TIMESTAMP NOT NULL,
-    accountLink VARCHAR(100)
-)$$
-
-CREATE TABLE IF NOT EXISTS admin_users (
-    id INTEGER PRIMARY KEY AUTO_INCREMENT,
-    user_id INTEGER NOT NULL,
-    foreign key (user_id)
-    references korap_users (id)
-)$$
-
-CREATE TABLE IF NOT EXISTS user_details (
-    Id INTEGER PRIMARY KEY AUTO_INCREMENT,
-    userID INTEGER NOT NULL UNIQUE,
-    firstName VARCHAR(100),
-    lastName VARCHAR(100),
-    gender VARCHAR(100),
-    phone VARCHAR(100),
-    institution VARCHAR(100),
-    email VARCHAR(100),
-    address VARCHAR(100),
-    country VARCHAR(100),
-    privateUsage BOOLEAN,
-    foreign key (userId)
-    references korap_users (id)
-    on delete cascade
-)$$
-
-CREATE TABLE IF NOT EXISTS user_settings (
-id INTEGER PRIMARY KEY AUTO_INCREMENT,
-userId INTEGER NOT NULL,
-fileNameForExport VARCHAR(100),
-leftContextItemForExport VARCHAR(100),
-leftContextSizeForExport INTEGER,
-locale VARCHAR(100),
-leftContextItem VARCHAR(100),
-leftContextSize INTEGER,
-rightContextItem VARCHAR(100),
-rightContextItemForExport VARCHAR(100),
-rightContextSize INTEGER,
-rightContextSizeForExport INTEGER,
-selectedCollection VARCHAR(100),
-queryLanguage VARCHAR(100),
-pageLength INTEGER,
-metadataQueryExpertModus BOOLEAN,
-POSFoundry VARCHAR(100),
-lemmaFoundry VARCHAR(100),
-constFoundry VARCHAR(100),
-relFoundry VARCHAR(100),
-collectData BOOLEAN DEFAULT TRUE,
-foreign key (userId)
-references korap_users (id)
-on delete cascade
-)$$
-
-CREATE TABLE IF NOT EXISTS user_queries (
-    id INTEGER PRIMARY KEY,
-    queryLanguage VARCHAR(100),
-    name VARCHAR(100),
-    query VARCHAR(200),
-    description VARCHAR(150),
-    foreign key (id)
-    references resource_store(id)
-    on delete cascade)$$
-
-
-CREATE TABLE IF NOT EXISTS resource_store (
-id INTEGER PRIMARY KEY AUTO_INCREMENT,
-persistentID VARCHAR(100) NOT NULL UNIQUE,
-name VARCHAR(100),
-description VARCHAR(300),
-parentID Integer unsigned null,
-created timestamp default current_timestamp,
-type INTEGER NOT NULL,
-creator INTEGER NOT NULL
-)$$
-
-
-CREATE TABLE IF NOT EXISTS resource_tree (
-parentID INTEGER,
-childID INTEGER,
-depth INTEGER,
-name_path VARCHAR(250),
-PRIMARY KEY (parentID , childID),
-foreign key (parentID)
-references resource_store (id)
-on delete cascade,
-foreign key (childID)
-references resource_store (id)
-on delete cascade
-)$$
-
-
-CREATE TABLE IF NOT EXISTS coll_store (
-id INTEGER PRIMARY KEY AUTO_INCREMENT,
-persistentID VARCHAR(150) UNIQUE,
-name VARCHAR(150),
-description VARCHAR(200),
-query VARCHAR(500),
-created TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
-userID INTEGER,
-foreign key(userID)
-references korap_users(id)
-on delete cascade
-)$$
-
-
-
-CREATE TABLE IF NOT EXISTS match_info (
-id INTEGER PRIMARY KEY AUTO_INCREMENT,
-userid BIGINT NOT NULL,
-match_info VARCHAR(100)
-)$$
-
-CREATE TABLE IF NOT EXISTS audit_records (
-id INTEGER PRIMARY KEY AUTO_INCREMENT,
-aud_category VARCHAR(100),
-aud_target VARCHAR(100),
-aud_user VARCHAR(100),
-aud_location VARCHAR(100),
-aud_operation VARCHAR(100),
-aud_field_1 VARCHAR(400),
-aud_timestamp TIMESTAMP,
-aud_failure VARCHAR(100)
-)$$
-
-CREATE TABLE IF NOT EXISTS doc_store (
-id VARCHAR(265) PRIMARY KEY,
-persistentID VARCHAR(265) UNIQUE,
-created TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
-disabled BOOLEAN default true
-)$$
-
--- last_modified timestamp ON UPDATE CURRENT_TIMESTAMP,
-CREATE TABLE IF NOT EXISTS policy_store (
-    id INTEGER PRIMARY KEY AUTO_INCREMENT,
-    targetID BIGINT NOT NULL,
-    created TIMESTAMP,
-    creator INTEGER NOT NULL,
-    posix SMALLINT NOT NULL,
-    expire timestamp null,
-    enable timestamp not null,
-    iprange VARCHAR(200)
-)$$
-
-CREATE TABLE IF NOT EXISTS group_ref (
-    id INTEGER PRIMARY KEY AUTO_INCREMENT,
-    groupId VARCHAR(100) NOT NULL,
-    policyid INTEGER NOT NULL
-)$$
-
-
-CREATE TABLE IF NOT EXISTS group_store (
-    name VARCHAR(100) PRIMARY KEY,
-    description VARCHAR(200),
-    sym_use INTEGER DEFAULT -1,
-    export VARCHAR(30) DEFAULT NULL,
-    query_only VARCHAR(30) DEFAULT NULL,
-    licence INTEGER DEFAULT -1,
-    -- basically every resource we have is an academic resource, thus a non-commercial use is infered!
-    commercial BOOLEAN DEFAULT FALSE
-)$$
-
-CREATE TABLE IF NOT EXISTS group_users (
-    id INTEGER PRIMARY KEY AUTO_INCREMENT,
-    userID BIGINT NOT NULL,
-    groupId VARCHAR(100) NOT NULL,
-    admin BOOLEAN NOT NULL DEFAULT FALSE,
-    FOREIGN KEY (groupId)
-        REFERENCES groupStore (name) on delete cascade
-)$$
-
-CREATE TABLE IF NOT EXISTS param_store (
-    id INTEGER PRIMARY KEY AUTO_INCREMENT,
-    p_key VARCHAR(100) NOT NULL,
-    p_value VARCHAR(150) NOT NULL,
-    resource INTEGER DEFAULT -1,
-    pid INTEGER DEFAULT -1,
-    FOREIGN KEY (resource)
-        REFERENCES resource_store(id)
-    on delete cascade,
-    FOREIGN KEY (pid)
-        REFERENCES policy_store(id)
-    on delete cascade
-)$$
-
-CREATE TABLE IF NOT EXISTS param_map (
-    id INTEGER PRIMARY KEY AUTO_INCREMENT,
-    policyID INTEGER NOT NULL,
-    paramID INTEGER NOT NULL,
-    value VARCHAR(100) NOT NULL,
-    flag BOOLEAN NOT NULL DEFAULT FALSE,
-    FOREIGN KEY (paramID)
-        REFERENCES param_store (id),
-    FOREIGN KEY (policyID)
-        REFERENCES policy_store (id)
-)$$
-
-create or replace view policy_view as
-select
-    po.id as pid,
-    po.targetID as id,
-    rs.persistentID as persistentID,
-    rs.name as name,
-    rs.type as type,
-    c.groupId as groupId,
-    po.posix as perm,
-    po.creator as creator,
-    po.expire as expire,
-    po.enable as enable,
-    po.iprange as iprange    
-from
-policy_store as po
-inner join
-group_ref as c ON c.policyid = po.id
-inner join
-resource_store as rs ON rs.id = po.targetid
-union all select
-              - 1 as pid,
-              rs.id as id,
-              rs.persistentID as persistentID,
-              rs.name as name,
-              type as type,
-              'self' as groupId,
-              127 as perm,
-              creator,              
-              NULL as expire,
-              rs.created as enable,
-              null as iprange
-          from
-          resource_store as rs$$
-
-
-
--- oauth2 db tables
-create table oauth2_client (
-id INTEGER PRIMARY KEY AUTO_INCREMENT,
-client_id VARCHAR(100),
-client_secret VARCHAR(200),
-redirect_uri VARCHAR(250),
-client_type VARCHAR(200),
-native BOOLEAN DEFAULT FALSE,
-url VARCHAR(200) UNIQUE
-)$$
-
-create table oauth2_auth_codes (
-id INTEGER PRIMARY KEY AUTO_INCREMENT,
-client_id VARCHAR(100),
-auth_code VARCHAR(250),
-status INTEGER DEFAULT 1,
-scopes VARCHAR (150),
-created TIMESTAMP DEFAULT CURRENT_TIMESTAMP
-)$$
-
-create table oauth2_client_authorization (
-id INTEGER PRIMARY KEY AUTO_INCREMENT,
-client_id INTEGER,
-user_id INTEGER,
--- define scopes?! --
-FOREIGN KEY (client_id) REFERENCES oauth2_client(client_id)
-)$$
-
--- status 1 = valid, 0 = revoked
-create table oauth2_access_token (
-id INTEGER PRIMARY KEY AUTO_INCREMENT,
-access_token VARCHAR(300),
-auth_code VARCHAR(250),
-userId INTEGER,
-status INTEGER DEFAULT 1,
-expiration TIMESTAMP,
-FOREIGN KEY (userId)
-REFERENCES korap_users(id)
-)$$
-
-
-
--- indices
-create trigger delete_policy after delete on resource_store
-for each row delete from policy_store where targetID=OLD.id$$
-
-CREATE TRIGGER insert_data AFTER INSERT ON resource_store FOR EACH ROW BEGIN
-	INSERT INTO resource_tree (parentID, childID, depth, name_path)
-	VALUES (NEW.id, NEW.id, 0, NEW.name);
-	INSERT INTO resource_tree (parentID, childID, depth, name_path)
-	SELECT parentID, NEW.id, depth + 1, concat(name_path,"/",NEW.name) FROM resource_tree WHERE childID = NEW.parentID;
-END$$
-
-CREATE INDEX group_index ON group_users(userid)$$
-CREATE INDEX policy_index ON group_ref(policyid)$$
-CREATE UNIQUE INDEX resource_tree_index on resource_tree (parentID, depth, childID)$$
-CREATE UNIQUE INDEX para_unique ON param_store (p_key, p_value)$$
-
-
-
-
-
-
-
-
-
-
diff --git a/full/src/main/resources/db/new-mysql/V1.3__triggers.sql b/full/src/main/resources/db/new-mysql/V1.3__triggers.sql
deleted file mode 100644
index 7bc25dd..0000000
--- a/full/src/main/resources/db/new-mysql/V1.3__triggers.sql
+++ /dev/null
@@ -1,14 +0,0 @@
-delimiter |
-
-CREATE TRIGGER delete_member AFTER UPDATE ON user_group
-	FOR EACH ROW 
-	BEGIN
-		UPDATE user_group_member 
-		SET status = "DELETED"
-		WHERE NEW.status = "DELETED" 
-			AND  OLD.status != "DELETED" 
-			AND group_id = NEW.id;
-	END;
-|
-	
-delimiter ;
\ No newline at end of file
diff --git a/full/src/main/resources/db/new-sqlite/V1.1__create_virtual_corpus_tables.sql b/full/src/main/resources/db/sqlite/V1.1__create_virtual_corpus_tables.sql
similarity index 100%
rename from full/src/main/resources/db/new-sqlite/V1.1__create_virtual_corpus_tables.sql
rename to full/src/main/resources/db/sqlite/V1.1__create_virtual_corpus_tables.sql
diff --git a/full/src/main/resources/db/new-sqlite/V1.2__triggers.sql b/full/src/main/resources/db/sqlite/V1.2__triggers.sql
similarity index 100%
rename from full/src/main/resources/db/new-sqlite/V1.2__triggers.sql
rename to full/src/main/resources/db/sqlite/V1.2__triggers.sql
diff --git a/full/src/main/resources/db/new-sqlite/V1.3__create_admin_table.sql b/full/src/main/resources/db/sqlite/V1.3__create_admin_table.sql
similarity index 100%
rename from full/src/main/resources/db/new-sqlite/V1.3__create_admin_table.sql
rename to full/src/main/resources/db/sqlite/V1.3__create_admin_table.sql
diff --git a/full/src/main/resources/db/new-sqlite/V1.4__oauth2_tables.sql b/full/src/main/resources/db/sqlite/V1.4__oauth2_tables.sql
similarity index 100%
rename from full/src/main/resources/db/new-sqlite/V1.4__oauth2_tables.sql
rename to full/src/main/resources/db/sqlite/V1.4__oauth2_tables.sql
diff --git a/full/src/main/resources/db/new-sqlite/V1.5__oauth2_triggers.sql b/full/src/main/resources/db/sqlite/V1.5__oauth2_triggers.sql
similarity index 100%
rename from full/src/main/resources/db/new-sqlite/V1.5__oauth2_triggers.sql
rename to full/src/main/resources/db/sqlite/V1.5__oauth2_triggers.sql
diff --git a/full/src/main/resources/db/sqlite/V1__Initial_version.sql b/full/src/main/resources/db/sqlite/V1__Initial_version.sql
deleted file mode 100644
index 943d3cd..0000000
--- a/full/src/main/resources/db/sqlite/V1__Initial_version.sql
+++ /dev/null
@@ -1,370 +0,0 @@
-CREATE TABLE IF NOT EXISTS korap_users (
-id INTEGER PRIMARY KEY AUTOINCREMENT,
-username VARCHAR(150) NOT NULL UNIQUE,
-password VARCHAR(100),
-account_lock boolean NOT NULL,
-account_creation BIGINT NOT NULL,
--- deprecate this
-type INTEGER DEFAULT 0,
-uri_fragment VARCHAR(100),
-uri_expiration BIGINT,
-account_link VARCHAR(100)
-);
-
-CREATE TABLE IF NOT EXISTS admin_users (
-id INTEGER PRIMARY KEY AUTOINCREMENT,
-user_id INTEGER NOT NULL,
-foreign key (user_id)
-references korap_users (id)
-);
-
-CREATE TABLE IF NOT EXISTS shib_users (
-id INTEGER PRIMARY KEY AUTOINCREMENT,
-username VARCHAR(150) NOT NULL UNIQUE,
-account_creation BIGINT,
-type INTEGER DEFAULT 1,
-loginSuccess INTEGER,
-loginFailed INTEGER,
-account_link VARCHAR(100)
-);
-
-CREATE TABLE IF NOT EXISTS user_details (
-id INTEGER PRIMARY KEY AUTOINCREMENT,
-user_id INTEGER UNIQUE NOT NULL,
-data BLOB NOT NULL,
-foreign key (user_id)
-references korap_users (id)
-on delete cascade
-);
-
-CREATE TABLE IF NOT EXISTS user_settings (
-id INTEGER PRIMARY KEY AUTOINCREMENT,
-user_id INTEGER UNIQUE NOT NULL,
-data BLOB NOT NULL,
-foreign key (user_id)
-references korap_users (id)
-on delete cascade
-);
-
-
-CREATE TABLE IF NOT EXISTS user_queries (
-id INTEGER PRIMARY KEY,
-queryLanguage VARCHAR(100),
-name VARCHAR(100),
-query VARCHAR(200),
-description VARCHAR(150),
-foreign key (id)
-references resource_store (id)
-on delete cascade
-);
-
-CREATE TABLE IF NOT EXISTS audit_records (
-aud_id INTEGER PRIMARY KEY AUTOINCREMENT,
-aud_category VARCHAR(100),
-aud_target VARCHAR(100),
-aud_user VARCHAR(100),
-aud_location VARCHAR(100),
-aud_field_1 VARCHAR(400),
-aud_args VARCHAR(400),
-aud_timestamp BIGINT,
-aud_status VARCHAR(100)
-);
-
--- deprecated
-CREATE TABLE IF NOT EXISTS match_info (
-id INTEGER PRIMARY KEY AUTOINCREMENT,
-userid BIGINT NOT NULL,
-matchInfo VARCHAR(100)
-);
-
-
-CREATE TABLE IF NOT EXISTS policy_store (
-id INTEGER PRIMARY KEY AUTOINCREMENT,
-target_id BIGINT NOT NULL,
-created BIGINT NOT NULL,
-creator INTEGER NOT NULL,
-posix SMALLINT NOT NULL,
-expire BIGINT,
-enable BIGINT NOT NULL,
-iprange varchar(200)
-);
-
--- send disabled documents per corpus to backend, so they can be excluded from searching!
-CREATE TABLE IF NOT EXISTS doc_store (
-id INTEGER PRIMARY KEY AUTOINCREMENT,
-persistent_id VARCHAR(100) UNIQUE,
-doc_sigle VARCHAR(100),
-created BIGINT NOT NULL DEFAULT CURRENT_TIMESTAMP,
-disabled BOOLEAN DEFAULT TRUE
-);
-
-CREATE TABLE IF NOT EXISTS group_ref (
-id INTEGER PRIMARY KEY AUTOINCREMENT,
-group_id VARCHAR(100) NOT NULL,
-policy_id INTEGER NOT NULL
-);
-
--- question: grouping of users or grouping of resources required?
-CREATE TABLE IF NOT EXISTS group_store (
-name VARCHAR(100) PRIMARY KEY,
-description VARCHAR(200),
-sym_use INTEGER DEFAULT -1,
-export VARCHAR(30) DEFAULT NULL,
-query_only VARCHAR(30) DEFAULT NULL,
-licence INTEGER DEFAULT -1,
--- basically every resource we have is an academic resource, thus a non-commercial use is infered!
-commercial BOOLEAN DEFAULT FALSE
-);
-
-CREATE TABLE IF NOT EXISTS group_users (
-id INTEGER PRIMARY KEY AUTOINCREMENT,
-user_id INTEGER NOT NULL,
-group_id VARCHAR(100) NOT NULL,
-admin BOOLEAN NOT NULL DEFAULT FALSE,
-FOREIGN KEY (user_id)
-REFERENCES korap_users(id)
-on delete cascade,
-FOREIGN KEY (group_id)
-REFERENCES group_store (name)
-on delete cascade
-);
-
-
-CREATE TABLE IF NOT EXISTS param_store (
-id INTEGER PRIMARY KEY AUTOINCREMENT,
-p_key VARCHAR(150) NOT NULL,
-p_value VARCHAR(200) NOT NULL,
-resource INTEGER NOT NULL DEFAULT -1,
-pid INTEGER NOT NULL DEFAULT -1,
-FOREIGN KEY (resource)
-REFERENCES resource_store(id)
-on delete cascade,
-FOREIGN KEY (pid)
-REFERENCES policy_store(id)
-on delete cascade
-);
-
-CREATE TABLE IF NOT EXISTS param_map (
-id INTEGER PRIMARY KEY AUTOINCREMENT,
-policyId INTEGER NOT NULL,
-paramId INTEGER NOT NULL,
-value VARCHAR(100) NOT NULL,
-flag BOOLEAN NOT NULL DEFAULT FALSE,
-FOREIGN KEY (paramId)
-   REFERENCES param_store (id),
-FOREIGN KEY (policyId)
-   REFERENCES policy_store (id)
-);
-
-CREATE TABLE IF NOT EXISTS resource_store (
-id INTEGER PRIMARY KEY AUTOINCREMENT,
-persistent_id VARCHAR(100) NOT NULL UNIQUE,
-name VARCHAR(100),
-description VARCHAR(300),
-parent_id INTEGER unsigned null,
-created BIGINT null,
-data BLOB,
-type INTEGER NOT NULL,
-creator INTEGER NOT NULL
-);
-
-
-CREATE TABLE IF NOT EXISTS resource_tree (
-parent_id INTEGER,
-child_id INTEGER,
-depth INTEGER,
-name_path VARCHAR(250),
-PRIMARY KEY (parent_id, child_id),
-foreign key (parent_id)
-references resource_store (id)
-on delete cascade,
-foreign key (child_id)
-references resource_store (id)
-on delete cascade
-);
-
-
--- todo: refactor native to confidential, add column application name
--- remove id and make client_id primary key
-create table IF NOT EXISTS oauth2_client (
-id INTEGER PRIMARY KEY AUTOINCREMENT,
-client_id VARCHAR(100) NOT NULL,
-client_secret VARCHAR(200) NOT NULL,
-redirect_uri VARCHAR(250) NOT NULL,
-client_type VARCHAR(200),
-is_confidential BOOLEAN DEFAULT FALSE,
-url VARCHAR(200) UNIQUE
-);
-
-
--- refresh token doesn't care about expiration.
--- also narrower scopes for new access token with the refresh token are not supported
--- otherwise i would require a comparison of all access_token to get the maximum scopes and compare to request
-
--- status 1 = valid, 0 = revoked, -1 = disabled
-create table IF NOT EXISTS oauth2_access_token (
-id INTEGER PRIMARY KEY AUTOINCREMENT,
-access_token VARCHAR(300),
-auth_code VARCHAR(250),
-refresh_token VARCHAR(250),
-client_id VARCHAR(100),
-user_id INTEGER,
--- make boolean --
-status INTEGER DEFAULT 1,
--- in case of code authorization, should match auth code scopes!
--- use scopes for levelaccess descriptor level[rw],level[r]
-scopes VARCHAR(350),
-expiration BIGINT NOT NULL,
-FOREIGN KEY (user_id)
-REFERENCES korap_users(id),
-FOREIGN KEY (client_id)
-REFERENCES oauth2_client(client_id)
-);
-
-
--- fixme: also scopes?
-create table oauth2_refresh_token (
-id INTEGER PRIMARY KEY AUTOINCREMENT,
-client_id VARCHAR(100),
-user_id INTEGER,
-expiration BIGINT NOT NULL,
-scopes VARCHAR(350),
-FOREIGN KEY (user_id)
-REFERENCES korap_users(id)
-ON DELETE CASCADE,
-FOREIGN KEY (client_id)
-REFERENCES oauth2_client(client_id)
-ON DELETE CASCADE
-);
-
-
-
--- a bit confusing. 1. creator is policy creator, 2. creator is resource creator --> different implications
--- insert resource data from resource_store alltogether, so i dont have to retrieve anything from there?!
-create view if not exists policy_view as
-select
-    po.id as pid,
-    po.target_id as id,
-    rs.persistent_id as persistent_id,
-    rs.name as name,
-    rs.type as type,
-    c.group_id as group_id,
-    po.posix as perm,
-    po.creator as creator,
-    po.expire as expire,
-    po.enable as enable,
-    po.iprange as iprange
-from policy_store as po
-inner join
-group_ref as c ON c.policy_id = po.id
-inner join
-resource_store as rs ON rs.id = po.target_id
-union all select
-              - 1 as pid,
-              rs.id as id,
-              rs.persistent_id as persistent_id,
-              rs.name as name,
-              type as type,
-              'self' as group_id,
-              127 as perm,
-              creator,
-              NULL as expire,
-              rs.created as enable,
-              null as iprange
-          from
-          resource_store as rs;
-
--- deletes a group if the group has no longer members!
-create trigger if not exists group_ref_del after delete on group_ref
-when (select count(*) from group_ref where group_id=OLD.group_id) = 0
-begin delete from group_store where name=OLD.group_id; end;
-
-    -- create trigger relCr after insert on resource_store
-    -- when (select count(*) from r_tree where parent_id==NEW.id and
-    -- child_id==NEW.id) == 0
-    -- BEGIN
-    -- insert into r_tree (parent_id, child_id, depth)
-    -- VALUES (NEW.id, NEW.id, 0);
-    -- END;
-
-    -- 1. CONCAT(NEW.name,"/")
-    -- 2. CONCAT(name_path, NEW.name, "/")
-
-CREATE TRIGGER IF NOT EXISTS insert_resource_tree_data
-AFTER INSERT ON resource_store
-FOR EACH ROW BEGIN
-INSERT INTO resource_tree (parent_id, child_id, depth, name_path)
-VALUES (NEW.id, NEW.id, 0, NEW.persistent_id);
-
-INSERT INTO resource_tree (parent_id, child_id, depth, name_path)
-SELECT parent_id, NEW.id, depth + 1, name_path || "/" ||  NEW.persistent_id FROM resource_tree
-WHERE child_id = NEW.parent_id;
-END;
-
-
-create trigger if not exists delete_policy after delete on resource_store
-begin delete from policy_store where target_id=OLD.id; end;
-
-    -- 1. requirement: delete hierarchical from resource_store and r_tree -- done!
-    -- 2. todo: subsequently delete from resourcedao extensions if child of deleted resource!
-create trigger if not exists del_tree after delete on resource_store
-begin delete from resource_store where id in (select rs.id from resource_store as rs
-inner join resource_tree as rt on rt.child_id=rs.id where rt.parent_id=OLD.id);
-delete from resource_tree where parent_id=OLD.id; end;
-
--- mysql on delete cascade todo: test
-create trigger if not exists del_user delete on korap_users
-begin
-    delete from user_settings where user_id=OLD.id;
-    delete from user_details where user_id=OLD.id;
-    delete from group_users where user_id=OLD.id;
-end;
-
--- indices
--- test unique index constraints
-create index group_index on group_users(user_id, group_id);
-create index policy_index on group_ref(policy_id);
-create index policy_target on policy_store(target_id);
-create unique index r_tree_index on resource_tree (parent_id, depth, child_id);
-create unique index para_unique on param_store (p_key, p_value);
-create unique index conditions on group_ref (policy_id, group_id);
-create unique index groups on group_users (user_id, group_id);
-
-
--- deprecated
--- flagr is a reference to the applicable conditions: export, licence
-create table if not exists policy_store2 (
-id integer primary key autoincrement,
-target_id bigint not null,
-creator bigint not null,
-perm integer default -1,
-enable boolean default true,
-master INTEGER UNIQUE default NULL,
-expire timestamp default null,
-iprange varchar(200),
-flagr integer,
-params integer,
-baseline boolean default false,
-FOREIGN KEY (master)
-    REFERENCES policy_store2(id),
-FOREIGN KEY (flagr)
-    REFERENCES flag_store (id),
-FOREIGN KEY (params)
-    REFERENCES param_store (id)
-);
-
--- grouping is matched with a view where the user and groups are listed together
-create table if not exists flag_store (
-id integer primary key autoincrement,
-export boolean default true,
-sym_use integer default -1,
-grouping varchar(150),
-FOREIGN KEY (grouping)
- REFERENCES groupings (grouping)
-);
-
--- todo: ??!
--- haveing the username as grouping only works with the unique identifier at username
-create view if not exists groupings_view
-as select id as user_id, username as grouping from korap_users
-union all select user_id, group_id as grouping from group_users;
diff --git a/full/src/main/resources/db/new-sqlite/V1__initial_version.sql b/full/src/main/resources/db/sqlite/V1__initial_version.sql
similarity index 100%
rename from full/src/main/resources/db/new-sqlite/V1__initial_version.sql
rename to full/src/main/resources/db/sqlite/V1__initial_version.sql
diff --git a/full/src/main/resources/default-config.xml b/full/src/main/resources/default-config.xml
index c653150..966eb66 100644
--- a/full/src/main/resources/default-config.xml
+++ b/full/src/main/resources/default-config.xml
@@ -171,16 +171,28 @@
 	</bean>
 
 	<!-- Data access objects -->
+	<bean id="adminDao" class="de.ids_mannheim.korap.dao.AdminDaoImpl" />
 	<bean id="resourceDao" class="de.ids_mannheim.korap.dao.ResourceDao" />
 	<bean id="accessScopeDao" class="de.ids_mannheim.korap.oauth2.dao.AccessScopeDao" />
-	<bean id="authorizationDao" class="de.ids_mannheim.korap.oauth2.dao.AuthorizationCacheDao" />
+	<bean id="authorizationDao" class="de.ids_mannheim.korap.oauth2.dao.CachedAuthorizationDaoImpl" />
 
+	<!-- Filters -->
+	<!-- <bean id="authenticationFilter" class="de.ids_mannheim.korap.web.filter.AuthenticationFilter" >
+		<property name="authenticationManager" ref="kustvakt_authenticationmanager"/>
+	</bean>
+	<bean id="piwikFilter" class="de.ids_mannheim.korap.web.filter.PiwikFilter" >
+		<property name="authenticationManager" ref="kustvakt_authenticationmanager"/>
+	</bean> -->
+	
+	<!-- Services -->
+	<bean id="scopeService" class="de.ids_mannheim.korap.oauth2.service.OAuth2ScopeServiceImpl" />
+	
 	<!-- props are injected from default-config.xml -->
 	<bean id="kustvakt_config" class="de.ids_mannheim.korap.config.FullConfiguration">
 		<constructor-arg name="properties" ref="props" />
 	</bean>
 
-	<bean id="initializator" class="de.ids_mannheim.korap.config.Initializator"
+	<bean id="initializator" class="de.ids_mannheim.de.init.InitializatorImpl"
 		init-method="initAnnotation">
 	</bean>
 
@@ -201,8 +213,8 @@
 		<constructor-arg value="http,https" />
 	</bean>
 	
-
-	<bean id="kustvakt_rewrite" class="de.ids_mannheim.korap.rewrite.FullRewriteHandler">
+	<!-- Rewrite -->
+	<bean id="rewriteHandler" class="de.ids_mannheim.korap.rewrite.FullRewriteHandler">
 		<constructor-arg ref="kustvakt_config" />
 	</bean>
 
@@ -297,7 +309,7 @@
 	</util:list>
 
 	<!-- specify type for constructor argument -->
-	<bean id="kustvakt_authenticationmanager"
+	<bean id="authenticationManager"
 		class="de.ids_mannheim.korap.authentication.KustvaktAuthenticationManager">
 		<constructor-arg type="de.ids_mannheim.korap.interfaces.EntityHandlerIface"
 			ref="kustvakt_userdb" />
@@ -310,7 +322,7 @@
 		<!-- inject authentication providers to use -->
 		<property name="providers" ref="kustvakt_authproviders" />
 	</bean>
-
+	
 	<!-- todo: if db interfaces not loaded via spring, does transaction even 
 		work then? -->
 	<!-- the transactional advice (i.e. what 'happens'; see the <aop:advisor/> 
diff --git a/full/src/main/resources/kustvakt-lite.conf b/full/src/main/resources/kustvakt-lite.conf
new file mode 100644
index 0000000..f0dd6b3
--- /dev/null
+++ b/full/src/main/resources/kustvakt-lite.conf
@@ -0,0 +1,27 @@
+# index dir
+krill.indexDir= ../sample-index
+
+krill.index.commit.count = 134217000
+krill.index.commit.log = log/krill.commit.log
+krill.index.commit.auto = 500
+krill.index.relations.max = 100
+
+krill.namedVC=vc
+
+
+# Kustvakt
+
+current.api.version = v1.0
+# multiple versions separated by space
+supported.api.version = v1.0
+
+kustvakt.base.url=/api/*
+kustvakt.default.pos = tt
+kustvakt.default.lemma = tt
+kustvakt.default.token = opennlp
+kustvakt.default.dep = mate
+kustvakt.default.const = mate
+
+# server
+server.port=8089
+server.host=localhost
diff --git a/full/src/main/resources/lite-config.xml b/full/src/main/resources/lite-config.xml
new file mode 100644
index 0000000..b342c59
--- /dev/null
+++ b/full/src/main/resources/lite-config.xml
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:util="http://www.springframework.org/schema/util"
+	xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx"
+	xsi:schemaLocation="http://www.springframework.org/schema/beans
+           http://www.springframework.org/schema/beans/spring-beans.xsd
+           http://www.springframework.org/schema/tx
+           http://www.springframework.org/schema/tx/spring-tx.xsd
+           http://www.springframework.org/schema/context
+           http://www.springframework.org/schema/context/spring-context.xsd
+           http://www.springframework.org/schema/util
+           http://www.springframework.org/schema/util/spring-util.xsd">
+
+
+	<context:component-scan
+		base-package="de.ids_mannheim.korap.web.filter, de.ids_mannheim.korap.web.utils,
+		de.ids_mannheim.korap.authentication.http" />
+	<context:annotation-config />
+
+	<bean id="placeholders"
+		class="org.springframework.context.support.PropertySourcesPlaceholderConfigurer">
+		<property name="ignoreResourceNotFound" value="true" />
+		<property name="locations">
+			<array>
+				<value>classpath:properties/lite-jdbc.properties</value>
+				<value>file:./lite-jdbc.properties</value>
+				<value>classpath:properties/hibernate.properties</value>
+				<value>classpath:kustvakt-lite.conf</value>
+				<value>file:./kustvakt-lite.conf</value>
+			</array>
+		</property>
+	</bean>
+
+	<bean id="properties"
+		class="org.springframework.beans.factory.config.PropertiesFactoryBean">
+		<property name="ignoreResourceNotFound" value="true" />
+		<property name="locations">
+			<array>
+				<value>classpath:kustvakt-lite.conf</value>
+				<value>file:./kustvakt-lite.conf</value>
+			</array>
+		</property>
+	</bean>
+
+	<bean id="config" class="de.ids_mannheim.korap.config.KustvaktConfiguration">
+		<constructor-arg index="0" name="properties" ref="properties" />
+	</bean>
+
+	<!-- Database -->
+
+	<bean id="sqliteDataSource"
+		class="org.springframework.jdbc.datasource.SingleConnectionDataSource"
+		lazy-init="true">
+		<property name="driverClassName" value="${jdbc.driverClassName}" />
+		<property name="url" value="${jdbc.url}" />
+		<property name="username" value="${jdbc.username}" />
+		<property name="password" value="${jdbc.password}" />
+		<property name="connectionProperties">
+			<props>
+				<prop key="date_string_format">yyyy-MM-dd HH:mm:ss</prop>
+			</props>
+		</property>
+
+		<!-- relevant for single connection datasource and sqlite -->
+		<property name="suppressClose">
+			<value>true</value>
+		</property>
+		<!--<property name="initialSize" value="2"/> -->
+		<!--<property name="poolPreparedStatements" value="true"/> -->
+	</bean>
+
+	<bean id="flyway" class="org.flywaydb.core.Flyway" init-method="migrate">
+		<property name="baselineOnMigrate" value="true" />
+		<!-- <property name="validateOnMigrate" value="false" /> -->
+		<!-- <property name="cleanOnValidationError" value="true" /> -->
+		<property name="locations" value="${jdbc.schemaPath}" />
+		<property name="dataSource" ref="sqliteDataSource" />
+	</bean>
+
+	<bean id="entityManagerFactory"
+		class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
+		<property name="dataSource" ref="sqliteDataSource" />
+
+		<property name="packagesToScan">
+			<array>
+				<value>de.ids_mannheim.korap.entity</value>
+				<value>de.ids_mannheim.korap.oauth2.entity</value>
+			</array>
+		</property>
+		<property name="jpaVendorAdapter">
+			<bean id="jpaVendorAdapter"
+				class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
+				<property name="databasePlatform" value="${hibernate.dialect}" />
+			</bean>
+		</property>
+		<property name="jpaProperties">
+			<props>
+				<prop key="hibernate.dialect">${hibernate.dialect}</prop>
+				<prop key="hibernate.hbm2ddl.auto">${hibernate.hbm2ddl.auto}</prop>
+				<prop key="hibernate.show_sql">${hibernate.show_sql}</prop>
+				<prop key="hibernate.cache.use_query_cache">${hibernate.cache.use_query_cache}</prop>
+				<prop key="hibernate.cache.use_second_level_cache">${hibernate.cache.use_second_level_cache}
+				</prop>
+				<prop key="hibernate.cache.provider_class">${hibernate.cache.provider}</prop>
+				<prop key="hibernate.cache.region.factory_class">${hibernate.cache.region.factory}</prop>
+				<prop key="hibernate.jdbc.time_zone">${hibernate.jdbc.time_zone}</prop>
+			</props>
+		</property>
+	</bean>
+	<tx:annotation-driven proxy-target-class="true"
+		transaction-manager="transactionManager" />
+
+	<bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
+		<property name="entityManagerFactory" ref="entityManagerFactory" />
+	</bean>
+
+	<bean id="transactionTemplate"
+		class="org.springframework.transaction.support.TransactionTemplate">
+		<constructor-arg ref="transactionManager" />
+	</bean>
+	<bean id="txManager"
+		class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
+		<property name="dataSource" ref="sqliteDataSource" />
+	</bean>
+
+	<!-- Initialization -->
+	<bean id="initializator" class="de.ids_mannheim.de.init.LiteInitializatorImpl"
+		init-method="init">
+	</bean>
+	<bean id="annotationParser" class="de.ids_mannheim.korap.annotation.AnnotationParser"
+		scope="singleton" />
+
+	<!-- Krill -->
+	<bean id="search_krill" class="de.ids_mannheim.korap.web.SearchKrill">
+		<constructor-arg value="${krill.indexDir}" />
+	</bean>
+
+	<!-- Filters -->
+	<bean id="APIVersionFilter" class="de.ids_mannheim.korap.web.APIVersionFilter"
+		scope="singleton" />
+
+	<!-- Authentication -->
+	<bean id="authenticationManager"
+		class="de.ids_mannheim.korap.authentication.DummyAuthenticationManager" />
+
+	<!-- Response handler -->
+	<bean id="kustvaktResponseHandler" class="de.ids_mannheim.korap.web.KustvaktResponseHandler">
+		<constructor-arg index="0" name="iface" ref="kustvakt_auditing" />
+	</bean>
+
+	<!-- Controllers -->
+	<bean id="annotationController"
+		class="de.ids_mannheim.korap.web.controller.AnnotationController" />
+	<bean id="searchController" class="de.ids_mannheim.korap.web.controller.SearchController" />
+	<bean id="statisticController"
+		class="de.ids_mannheim.korap.web.controller.StatisticController" />
+
+	<!-- Services -->
+	<bean id="annotationService" class="de.ids_mannheim.korap.service.AnnotationService"></bean>
+	<bean id="scopeService"
+		class="de.ids_mannheim.korap.oauth2.service.DummyOAuth2ScopeServiceImpl" />
+	<bean id="searchService" class="de.ids_mannheim.korap.service.SearchService"></bean>
+
+	<!-- DAO -->
+	<bean id="adminDao" class="de.ids_mannheim.korap.dao.DummyAdminDaoImpl" />
+	<bean id="annotationDao" class="de.ids_mannheim.korap.dao.AnnotationDao" />
+
+	<!-- DTO Converter -->
+	<bean id="annotationConverter" class="de.ids_mannheim.korap.dto.converter.AnnotationConverter" />
+
+	<!-- Rewrite -->
+	<bean id="rewriteHandler" class="de.ids_mannheim.korap.resource.rewrite.RewriteHandler">
+		<constructor-arg ref="config" />
+	</bean>
+
+
+
+	<bean id="kustvakt_auditing"
+		class="de.ids_mannheim.korap.interfaces.defaults.DefaultAuditing">
+	</bean>
+
+</beans>
\ No newline at end of file
diff --git a/full/src/main/resources/properties/jdbc.properties b/full/src/main/resources/properties/jdbc.properties
index aea7ab9..7025240 100644
--- a/full/src/main/resources/properties/jdbc.properties
+++ b/full/src/main/resources/properties/jdbc.properties
@@ -9,7 +9,7 @@
 #jdbc.password=password
 
 # db.insert contains test data, omit it in production setting
-#jdbc.schemaPath=db.new-mysql, db.predefined
+#jdbc.schemaPath=db.mysql, db.predefined
 
 
 #-------------------------------------------------------------------------------
@@ -22,4 +22,4 @@
 jdbc.username=pc
 jdbc.password=pc
 # db.insert contains test data, omit it in production setting
-jdbc.schemaPath=db.new-sqlite, db.predefined
+jdbc.schemaPath=db.sqlite, db.predefined
diff --git a/full/src/main/resources/properties/lite-jdbc.properties b/full/src/main/resources/properties/lite-jdbc.properties
new file mode 100644
index 0000000..5aa9ca8
--- /dev/null
+++ b/full/src/main/resources/properties/lite-jdbc.properties
@@ -0,0 +1,9 @@
+#-------------------------------------------------------------------------------
+# Sqlite Settings
+
+jdbc.database=sqlite
+jdbc.driverClassName=org.sqlite.JDBC
+jdbc.url=jdbc:sqlite:liteDB.sqlite
+jdbc.username=pc
+jdbc.password=pc
+jdbc.schemaPath=db.lite-sqlite
\ No newline at end of file