/* index on categorydocuments */
/* linked documents */
delete from ADDITIONALDOCUMENTFORMATS;
delete from USERREGISTEREDCATEGORIES;
delete from USERREGISTEREDKEYWORDS;
delete from CATEGORYKEYWORDS;
delete from USERGROUPS;
delete from GROUPS;
delete from GROUPACLS;
delete from DOCUMENTACLS;
delete from DOCUMENTKEYWORDS;
delete from ALLOWEDDOCUMENTTYPES;
delete from CATEGORYDOCUMENTS;
delete from DOCUMENTRELATIONS;
delete from DOCUMENTS;
delete from DOCUMENTSTATI;
delete from CATEGORYKEYWORDS;
delete from CATEGORIES where CATEGORYID = 1;
delete from CATEGORYACLS where ACLID = 1;

/* acl types */
delete from ACLTYPES;

insert into ACLTYPES
            (ACLTYPEID, NAME, RANK, DESCRIPTION)
     values (1, 'user', 0, 'acl type user');

insert into ACLTYPES
            (ACLTYPEID, NAME, RANK, DESCRIPTION)
     values (2, 'group', 1, 'acl type group');

insert into ACLTYPES
            (ACLTYPEID, NAME, RANK, DESCRIPTION)
     values (3, 'anyother', 2, 'acl type anyother');

insert into ACLTYPES
            (ACLTYPEID, NAME, RANK, DESCRIPTION)
     values (4, 'mask', 3, 'acl type mask');


/* documentflags */
delete from DOCUMENTFLAGS;

insert into DOCUMENTFLAGS
            (FLAG, DESCRIPTION)
     values (0, 'published');

insert into DOCUMENTFLAGS
            (FLAG, DESCRIPTION)
     values (1, 'expired');

insert into DOCUMENTFLAGS
            (FLAG, DESCRIPTION)
     values (2, 'deleted');

/* documentstati */
insert into DOCUMENTSTATI
            (STATUS, DESCRIPTION, REMARK)
     values (0, 'created', null);

insert into DOCUMENTSTATI
            (STATUS, DESCRIPTION, REMARK)
     values (1, 'created', null);

insert into DOCUMENTSTATI
            (STATUS, DESCRIPTION, REMARK)
     values (2, 'changed', null);

insert into DOCUMENTSTATI
            (STATUS, DESCRIPTION, REMARK)
     values (3, 'wait for response', null);

insert into DOCUMENTSTATI
            (STATUS, DESCRIPTION, REMARK)
     values (4, 'deleted', null);


/* documenttypes */
delete from DOCUMENTTYPES;

insert into DOCUMENTTYPES
            (DOCTYPEID, EXTENSION, DESCRIPTION, DESCRIPTION_SHORT, MIMETYPE)
     values (1, '?', 'undefined', 'undefined', '?');

insert into DOCUMENTTYPES
            (DOCTYPEID, EXTENSION, DESCRIPTION, DESCRIPTION_SHORT, MIMETYPE)
     values (2, 'TXT', 'Generic ASCII Text', 'ASCII document', 'text/plain');

insert into DOCUMENTTYPES
            (DOCTYPEID, EXTENSION, DESCRIPTION, DESCRIPTION_SHORT, MIMETYPE)
     values (3, 'PDF', 'Adobe Portable Document Format', 'PDF document', 'application/pdf');

insert into DOCUMENTTYPES
            (DOCTYPEID, EXTENSION, DESCRIPTION, DESCRIPTION_SHORT, MIMETYPE)
     values (4, 'DOC', 'Microsoft Winword Document', 'Winword document', 'application/msword');

insert into DOCUMENTTYPES
            (DOCTYPEID, EXTENSION, DESCRIPTION, DESCRIPTION_SHORT, MIMETYPE)
     values (5, 'HTML', 'Hypertext Markup Language Document', 'HTML document', 'text/html');

insert into DOCUMENTTYPES
            (DOCTYPEID, EXTENSION, DESCRIPTION, DESCRIPTION_SHORT, MIMETYPE)
     values (6, 'PS', 'Postscript Document', 'Postscript document', 'application/postscript');

insert into DOCUMENTTYPES
            (DOCTYPEID, EXTENSION, DESCRIPTION, DESCRIPTION_SHORT, MIMETYPE)
     values (7, 'PPT', 'Microsoft Powerpoint Document', 'PPT document', 'application/vnd.ms-powerpoint');

insert into DOCUMENTTYPES
            (DOCTYPEID, EXTENSION, DESCRIPTION, DESCRIPTION_SHORT, MIMETYPE)
     values (8, 'XLS', 'Microsoft Excel Document', 'Excel document', 'application/vnd.ms-excel');

insert into DOCUMENTTYPES
            (DOCTYPEID, EXTENSION, DESCRIPTION, DESCRIPTION_SHORT, MIMETYPE)
     values (9, 'RTF', 'Rich Text Format Document', 'RTF document', 'application/rtf');

insert into DOCUMENTTYPES
            (DOCTYPEID, EXTENSION, DESCRIPTION, DESCRIPTION_SHORT, MIMETYPE)
     values (10, 'WPD', 'Word Perfect Document', 'WPD document', 'application/wordperfect5.1');

insert into DOCUMENTTYPES
            (DOCTYPEID, EXTENSION, DESCRIPTION, DESCRIPTION_SHORT, MIMETYPE)
     values (11, 'TDF', 'Typography Description Format Document', 'TDF document', 'application/tdf');



/* permissions */
delete from PERMISSIONS;

insert into PERMISSIONS
            (PERMISSIONID, CONTEXT, TOKEN, NUMVALUE, PRINTSTRING, DESCRIPTION)
     values (1, 'category', 'c', '1', 'change ACL', 'Context CATEGORY: change ACL permission');

insert into PERMISSIONS
            (PERMISSIONID, CONTEXT, TOKEN, NUMVALUE, PRINTSTRING, DESCRIPTION)
     values (2, 'category', 'r', '2', 'read category', 'Context CATEGORY: Read category permission');

insert into PERMISSIONS
            (PERMISSIONID, CONTEXT, TOKEN, NUMVALUE, PRINTSTRING, DESCRIPTION)
     values (3, 'category', 'w', '4', 'write category', 'Context CATEGORY: write category permission');

insert into PERMISSIONS
            (PERMISSIONID, CONTEXT, TOKEN, NUMVALUE, PRINTSTRING, DESCRIPTION)
     values (4, 'category', 'D', '8', 'delete category', 'Context CATEGORY: delete category permission');

insert into PERMISSIONS
            (PERMISSIONID, CONTEXT, TOKEN, NUMVALUE, PRINTSTRING, DESCRIPTION)
     values (5, 'category', 'C', '16', 'create subcategory', 'Context CATEGORY: create subcategory permission');

insert into PERMISSIONS
            (PERMISSIONID, CONTEXT, TOKEN, NUMVALUE, PRINTSTRING, DESCRIPTION)
     values (6, 'category', 'L', '32', 'create link to category', 'Context CATEGORY: create link to category permission');

insert into PERMISSIONS
            (PERMISSIONID, CONTEXT, TOKEN, NUMVALUE, PRINTSTRING, DESCRIPTION)
     values (7, 'category', 'F', '64', 'follow link to category', 'Context CATEGORY: follow link to category permission');

insert into PERMISSIONS
            (PERMISSIONID, CONTEXT, TOKEN, NUMVALUE, PRINTSTRING, DESCRIPTION)
     values (8, 'category', 'l', '128', 'create link to document', 'Context CATEGORY: create link to document permission');

insert into PERMISSIONS
            (PERMISSIONID, CONTEXT, TOKEN, NUMVALUE, PRINTSTRING, DESCRIPTION)
     values (9, 'category', 'f', '256', 'follow link to document', 'Context CATEGORY: follow link to document permission');

insert into PERMISSIONS
            (PERMISSIONID, CONTEXT, TOKEN, NUMVALUE, PRINTSTRING, DESCRIPTION)
     values (10, 'document', 'c', '1', 'change ACL', 'Context DOCUMENT: change ACL permission');

insert into PERMISSIONS
            (PERMISSIONID, CONTEXT, TOKEN, NUMVALUE, PRINTSTRING, DESCRIPTION)
     values (11, 'document', 'r', '2', 'read document', 'Context DOCUMENT: read document permission');

insert into PERMISSIONS
            (PERMISSIONID, CONTEXT, TOKEN, NUMVALUE, PRINTSTRING, DESCRIPTION)
     values (12, 'document', 'w', '4', 'write document', 'Context DOCUMENT: write document permission');

insert into PERMISSIONS
            (PERMISSIONID, CONTEXT, TOKEN, NUMVALUE, PRINTSTRING, DESCRIPTION)
     values (13, 'document', 'M', '8', 'move document', 'Context DOCUMENT: move document permission');

insert into PERMISSIONS
            (PERMISSIONID, CONTEXT, TOKEN, NUMVALUE, PRINTSTRING, DESCRIPTION)
     values (14, 'document', 'D', '16', 'delete document', 'Context DOCUMENT: delete document permission');

insert into PERMISSIONS
            (PERMISSIONID, CONTEXT, TOKEN, NUMVALUE, PRINTSTRING, DESCRIPTION)
     values (15, 'group', 'c', '1', 'change ACL', 'Context GROUP: change ACL permission');

insert into PERMISSIONS
            (PERMISSIONID, CONTEXT, TOKEN, NUMVALUE, PRINTSTRING, DESCRIPTION)
     values (16, 'group', 'a', '2', 'add member', 'Context GROUP: add member permission');

insert into PERMISSIONS
            (PERMISSIONID, CONTEXT, TOKEN, NUMVALUE, PRINTSTRING, DESCRIPTION)
     values (17, 'group', 'd', '4', 'delete member', 'Context GROUP: delete member permission');

insert into PERMISSIONS
            (PERMISSIONID, CONTEXT, TOKEN, NUMVALUE, PRINTSTRING, DESCRIPTION)
     values (18, 'group', 'D', '8', 'delete group', 'Context GROUP: delete group permission');

/* dynamic attributes */
delete from DYNATTRIBUTES;

insert into DYNATTRIBUTES
            (DAENTYRID, DYNATTRID, NAME, VALUESTRING)
     values (1, 1, 'UserDynAttr1', 'User Dynamical Attribute #1 for USER1');

insert into DYNATTRIBUTES
            (DAENTYRID, DYNATTRID, NAME, VALUESTRING)
     values (2, 1, 'UserDynAttr2', 'User Dynamical Attribute #2 for USER1');

insert into DYNATTRIBUTES
            (DAENTYRID, DYNATTRID, NAME, VALUESTRING)
     values (3, 1, 'UserDynAttr3', 'User Dynamical Attribute #3 for USER1');

insert into DYNATTRIBUTES
            (DAENTYRID, DYNATTRID, NAME, VALUESTRING)
     values (4, 2, 'UserDynAttr1', 'User Dynamical Attribute #1 for USER2');

insert into DYNATTRIBUTES
            (DAENTYRID, DYNATTRID, NAME, VALUESTRING)
     values (5, 2, 'UserDynAttr2', 'User Dynamical Attribute #2 for USER2');

insert into DYNATTRIBUTES
            (DAENTYRID, DYNATTRID, NAME, VALUESTRING)
     values (6, 2, 'UserDynAttr3', 'User Dynamical Attribute #3 for USER2');

insert into DYNATTRIBUTES
            (DAENTYRID, DYNATTRID, NAME, VALUESTRING)
     values (7, 3, 'CatDynAttr1', 'Category Dynamical Attribute #1 for CAT1');

insert into DYNATTRIBUTES
            (DAENTYRID, DYNATTRID, NAME, VALUESTRING)
     values (8, 3, 'CatDynAttr2', 'Category Dynamical Attribute #2 for CAT1');

insert into DYNATTRIBUTES
            (DAENTYRID, DYNATTRID, NAME, VALUESTRING)
     values (9, 3, 'CatDynAttr3', 'Category Dynamical Attribute #3 for CAT1');

insert into DYNATTRIBUTES
            (DAENTYRID, DYNATTRID, NAME, VALUESTRING)
     values (10, 4, 'CatDynAttr1', 'Category Dynamical Attribute #1 for CAT2');

insert into DYNATTRIBUTES
            (DAENTYRID, DYNATTRID, NAME, VALUESTRING)
     values (11, 4, 'CatDynAttr2', 'Category Dynamical Attribute #2 for CAT2');

insert into DYNATTRIBUTES
            (DAENTYRID, DYNATTRID, NAME, VALUESTRING)
     values (12, 4, 'CatDynAttr3', 'Category Dynamical Attribute #3 for CAT2');

insert into DYNATTRIBUTES
            (DAENTYRID, DYNATTRID, NAME, VALUESTRING)
     values (13, 5, 'DocDynAttr1', 'Document Dynamical Attribute #1 for DOC1');

insert into DYNATTRIBUTES
            (DAENTYRID, DYNATTRID, NAME, VALUESTRING)
     values (14, 5, 'DocDynAttr2', 'Document Dynamical Attribute #2 for DOC1');

insert into DYNATTRIBUTES
            (DAENTYRID, DYNATTRID, NAME, VALUESTRING)
     values (15, 5, 'DocDynAttr3', 'Document Dynamical Attribute #3 for DOC1');

insert into DYNATTRIBUTES
            (DAENTYRID, DYNATTRID, NAME, VALUESTRING)
     values (16, 6, 'DocDynAttr1', 'Document Dynamical Attribute #1 for DOC2');

insert into DYNATTRIBUTES
            (DAENTYRID, DYNATTRID, NAME, VALUESTRING)
     values (17, 6, 'DocDynAttr2', 'Document Dynamical Attribute #2 for DOC2');

insert into DYNATTRIBUTES
            (DAENTYRID, DYNATTRID, NAME, VALUESTRING)
     values (18, 6, 'DocDynAttr3', 'Document Dynamical Attribute #3 for DOC2');


/* users */
/* admin: hat implizit alle rechte */
delete from USERS;

insert into USERS
            (USERID, USERNAME, FIRSTNAME, LASTNAME, TITLE, PASSWD, PASSWDCHANGED, EMAIL, SHOWEMAIL, ENABLEMESSAGING, MESSAGINGTIMEPERIOD, COMPANY, DEPARTMENT, ZIP, CITY, STREET, PHONE, FAX, MOBILE, HOMEPAGEURL, CONTACTURL, ADMINPRIVILEGES, CREATEGROUPS, LANGUAGEID, VALIDFROM, VALIDUNTIL, CREATED, CREATORID, LASTCHANGED, LASTCHANGERID, DYNATTRSID)
     values (1, 'Admin', 'Administrator', 'VKC-Administrator', '...', 'f89SqyHAVp5mPUirW+wHzA==', 0, 'admin@abc.de', 0, 1, 1, 'Company1', 'Department1', '00000', 'City1', 'Street1', '00000/00001', '00000/00001', '00000/00001', 'http://www.homepage1.de', 'http://www.contacturl1.de', 1, 1, 1, null, null, null, null, null, null, null);

insert into USERS
            (USERID, USERNAME, FIRSTNAME, LASTNAME, TITLE, PASSWD, PASSWDCHANGED, EMAIL, SHOWEMAIL, ENABLEMESSAGING, MESSAGINGTIMEPERIOD, COMPANY, DEPARTMENT, ZIP, CITY, STREET, PHONE, FAX, MOBILE, HOMEPAGEURL, CONTACTURL, ADMINPRIVILEGES, CREATEGROUPS, LANGUAGEID, VALIDFROM, VALIDUNTIL, CREATED, CREATORID, LASTCHANGED, LASTCHANGERID, DYNATTRSID)
     values (2, 'User1', 'UserFirst1', 'UserLast1', '...', 'Hq71JZ3BVxwfnntzEowTbA==', 0, 'xyz1@abc.de', 1, 1, 1, 'Company1', 'Department1', '00001', 'City1', 'Street1', '00000/00001', '00000/00001', '00000/00001', 'http://www.homepage1.de', 'http://www.contacturl1.de', 0, 0, 2, null, null, CURRENT_TIMESTAMP, 1, null, null, 1);

insert into USERS
            (USERID, USERNAME, FIRSTNAME, LASTNAME, TITLE, PASSWD, PASSWDCHANGED, EMAIL, SHOWEMAIL, ENABLEMESSAGING, MESSAGINGTIMEPERIOD, COMPANY, DEPARTMENT, ZIP, CITY, STREET, PHONE, FAX, MOBILE, HOMEPAGEURL, CONTACTURL, ADMINPRIVILEGES, CREATEGROUPS, LANGUAGEID, VALIDFROM, VALIDUNTIL, CREATED, CREATORID, LASTCHANGED, LASTCHANGERID, DYNATTRSID)
     values (3, 'User2', 'UserFirst2', 'UserLast2', '...', 'xEkXaUAbeu0Q5bxhFEV63Q==', 0, 'xyz2@abc.de', 1, 1, 1, 'Company2', 'Department2', '00002', 'City2', 'Street2', '00000/00002', '00000/00002', '00000/00002', 'http://www.homepage2.de', 'http://www.contacturl2.de', 0, 0, 1, null, null, CURRENT_TIMESTAMP, 1, null, null, 2);

insert into USERS
            (USERID, USERNAME, FIRSTNAME, LASTNAME, TITLE, PASSWD, PASSWDCHANGED, EMAIL, SHOWEMAIL, ENABLEMESSAGING, MESSAGINGTIMEPERIOD, COMPANY, DEPARTMENT, ZIP, CITY, STREET, PHONE, FAX, MOBILE, HOMEPAGEURL, CONTACTURL, ADMINPRIVILEGES, CREATEGROUPS, LANGUAGEID, VALIDFROM, VALIDUNTIL, CREATED, CREATORID, LASTCHANGED, LASTCHANGERID, DYNATTRSID)
     values (4, 'User3', 'UserFirst3', 'UserLast3', '...', 'cu4ZlIBJfAr5APlUxVbm/A==', 0, 'xyz3@abc.de', 1, 1, 1, 'Company3', 'Department3', '00003', 'City3', 'Street3', '00000/00003', '00000/00003', '00000/00003', 'http://www.homepage3.de', 'http://www.contacturl3.de', 0, 0, 1, null, null, CURRENT_TIMESTAMP, 1, null, null, null);

insert into USERS
            (USERID, USERNAME, FIRSTNAME, LASTNAME, TITLE, PASSWD, PASSWDCHANGED, EMAIL, SHOWEMAIL, ENABLEMESSAGING, MESSAGINGTIMEPERIOD, COMPANY, DEPARTMENT, ZIP, CITY, STREET, PHONE, FAX, MOBILE, HOMEPAGEURL, CONTACTURL, ADMINPRIVILEGES, CREATEGROUPS, LANGUAGEID, VALIDFROM, VALIDUNTIL, CREATED, CREATORID, LASTCHANGED, LASTCHANGERID, DYNATTRSID)
     values (5, 'User4', 'UserFirst4', 'UserLast4', '...', 'Q7k/BMkiSunc5DtXfClicw==', 0, 'xyz4@abc.de', 1, 1, 1, 'Company4', 'Department4', '00004', 'City4', 'Street4', '00000/00004', '00000/00004', '00000/00004', 'http://www.homepage4.de', 'http://www.contacturl4.de', 0, 0, 1, null, null, CURRENT_TIMESTAMP, 1, null, null, null);

insert into USERS
            (USERID, USERNAME, FIRSTNAME, LASTNAME, TITLE, PASSWD, PASSWDCHANGED, EMAIL, SHOWEMAIL, ENABLEMESSAGING, MESSAGINGTIMEPERIOD, COMPANY, DEPARTMENT, ZIP, CITY, STREET, PHONE, FAX, MOBILE, HOMEPAGEURL, CONTACTURL, ADMINPRIVILEGES, CREATEGROUPS, LANGUAGEID, VALIDFROM, VALIDUNTIL, CREATED, CREATORID, LASTCHANGED, LASTCHANGERID, DYNATTRSID)
     values (6, 'User5', 'UserFirst5', 'UserLast5', '...', 'rBA2cNMwt6c6U4ZAjCUMLA==', 0, 'xyz5@abc.de', 1, 1, 1, 'Company5', 'Department5', '00005', 'City5', 'Street5', '00000/00005', '00000/00005', '00000/00005', 'http://www.homepage5.de', 'http://www.contacturl5.de', 0, 0, 1, null, null, CURRENT_TIMESTAMP, 1, null, null, null);

insert into USERS
            (USERID, USERNAME, FIRSTNAME, LASTNAME, TITLE, PASSWD, PASSWDCHANGED, EMAIL, SHOWEMAIL, ENABLEMESSAGING, MESSAGINGTIMEPERIOD, COMPANY, DEPARTMENT, ZIP, CITY, STREET, PHONE, FAX, MOBILE, HOMEPAGEURL, CONTACTURL, ADMINPRIVILEGES, CREATEGROUPS, LANGUAGEID, VALIDFROM, VALIDUNTIL, CREATED, CREATORID, LASTCHANGED, LASTCHANGERID, DYNATTRSID)
     values (7, 'User6', 'UserFirst6', 'UserLast6', '...', 'dlz5FaNA3zMUhymI239fMA==', 0, 'xyz6@abc.de', 1, 1, 1, 'Company6', 'Department6', '00006', 'City6', 'Street6', '00000/00006', '00000/00006', '00000/00006', 'http://www.homepage6.de', 'http://www.contacturl6.de', 0, 0, 1, null, null, CURRENT_TIMESTAMP, 1, null, null, null);

insert into USERS
            (USERID, USERNAME, FIRSTNAME, LASTNAME, TITLE, PASSWD, PASSWDCHANGED, EMAIL, SHOWEMAIL, ENABLEMESSAGING, MESSAGINGTIMEPERIOD, COMPANY, DEPARTMENT, ZIP, CITY, STREET, PHONE, FAX, MOBILE, HOMEPAGEURL, CONTACTURL, ADMINPRIVILEGES, CREATEGROUPS, LANGUAGEID, VALIDFROM, VALIDUNTIL, CREATED, CREATORID, LASTCHANGED, LASTCHANGERID, DYNATTRSID)
     values (8, 'User7', 'UserFirst7', 'UserLast7', '...', '/7pLkGy4JFi16Vs9vkff2A==', 0, 'xyz7@abc.de', 1, 1, 1, 'Company7', 'Department7', '00006', 'City6', 'Street6', '00000/00007', '00000/00007', '00000/00007', 'http://www.homepage7.de', 'http://www.contacturl7.de', 0, 0, 1, null, null, CURRENT_TIMESTAMP, 1, null, null, null);

insert into USERS
            (USERID, USERNAME, FIRSTNAME, LASTNAME, TITLE, PASSWD, PASSWDCHANGED, EMAIL, SHOWEMAIL, ENABLEMESSAGING, MESSAGINGTIMEPERIOD, COMPANY, DEPARTMENT, ZIP, CITY, STREET, PHONE, FAX, MOBILE, HOMEPAGEURL, CONTACTURL, ADMINPRIVILEGES, CREATEGROUPS, LANGUAGEID, VALIDFROM, VALIDUNTIL, CREATED, CREATORID, LASTCHANGED, LASTCHANGERID, DYNATTRSID)
     values (9, 'User8', 'UserFirst8', 'UserLast8', '...', 'UHdhKVIg8ZQizd4b1E8cYQ==', 0, 'xyz8@abc.de', 1, 1, 1, 'Company8', 'Department8', '00008', 'City8', 'Street8', '00000/00008', '00000/00008', '00000/00008', 'http://www.homepage8.de', 'http://www.contacturl8.de', 0, 0, 1, null, null, CURRENT_TIMESTAMP, 1, null, null, null);


/* groups */
delete from GROUPS;

insert into GROUPS
            (GROUPID, ACLID, NAME, DESCRIPTION, ADMINPRIVILEGES, VALIDFROM, VALIDUNTIL, CREATED, CREATORID, LASTCHANGED, LASTCHANGERID)
     values (1, null, 'AdminGroup', 'AdminGroup1', 1, null, null, null, null, null, null);

insert into GROUPACLS
            (ACLENTRYID, ACLID, ACLTYPEID, ACCESSORID, PERMISSIONID, CREATED, CREATORID)
     values (1, 1, 1, 2, 15, CURRENT_TIMESTAMP, 2);

insert into GROUPACLS
            (ACLENTRYID, ACLID, ACLTYPEID, ACCESSORID, PERMISSIONID, CREATED, CREATORID)
     values (2, 1, 1, 2, 16, CURRENT_TIMESTAMP, 2);

insert into GROUPACLS
            (ACLENTRYID, ACLID, ACLTYPEID, ACCESSORID, PERMISSIONID, CREATED, CREATORID)
     values (3, 1, 1, 2, 17, CURRENT_TIMESTAMP, 2);

insert into GROUPACLS
            (ACLENTRYID, ACLID, ACLTYPEID, ACCESSORID, PERMISSIONID, CREATED, CREATORID)
     values (4, 1, 1, 2, 18, CURRENT_TIMESTAMP, 2);

insert into GROUPS
            (GROUPID, ACLID, NAME, DESCRIPTION, ADMINPRIVILEGES, VALIDFROM, VALIDUNTIL, CREATED, CREATORID, LASTCHANGED, LASTCHANGERID)
     values (2, 1, 'Group1', 'Group1', 0, null, null, CURRENT_TIMESTAMP, 2, null, null);

insert into GROUPACLS
            (ACLENTRYID, ACLID, ACLTYPEID, ACCESSORID, PERMISSIONID, CREATED, CREATORID)
     values (5, 2, 1, 3, 15, CURRENT_TIMESTAMP, 3);

insert into GROUPACLS
            (ACLENTRYID, ACLID, ACLTYPEID, ACCESSORID, PERMISSIONID, CREATED, CREATORID)
     values (6, 2, 1, 3, 16, CURRENT_TIMESTAMP, 3);

insert into GROUPACLS
            (ACLENTRYID, ACLID, ACLTYPEID, ACCESSORID, PERMISSIONID, CREATED, CREATORID)
     values (7, 2, 1, 3, 17, CURRENT_TIMESTAMP, 3);

insert into GROUPACLS
            (ACLENTRYID, ACLID, ACLTYPEID, ACCESSORID, PERMISSIONID, CREATED, CREATORID)
     values (8, 2, 1, 3, 18, CURRENT_TIMESTAMP, 3);

insert into GROUPS
            (GROUPID, ACLID, NAME, DESCRIPTION, ADMINPRIVILEGES, VALIDFROM, VALIDUNTIL, CREATED, CREATORID, LASTCHANGED, LASTCHANGERID)
     values (3, 2, 'Group2', 'Group2', 0, null, null, CURRENT_TIMESTAMP, 3, null, null);

insert into GROUPACLS
            (ACLENTRYID, ACLID, ACLTYPEID, ACCESSORID, PERMISSIONID, CREATED, CREATORID)
     values (9, 3, 1, 4, 15, CURRENT_TIMESTAMP, 4);

insert into GROUPACLS
            (ACLENTRYID, ACLID, ACLTYPEID, ACCESSORID, PERMISSIONID, CREATED, CREATORID)
     values (10, 3, 1, 4, 16, CURRENT_TIMESTAMP, 4);

insert into GROUPACLS
            (ACLENTRYID, ACLID, ACLTYPEID, ACCESSORID, PERMISSIONID, CREATED, CREATORID)
     values (11, 3, 1, 4, 17, CURRENT_TIMESTAMP, 4);

insert into GROUPACLS
            (ACLENTRYID, ACLID, ACLTYPEID, ACCESSORID, PERMISSIONID, CREATED, CREATORID)
     values (12, 3, 1, 4, 18, CURRENT_TIMESTAMP, 4);

insert into GROUPS
            (GROUPID, ACLID, NAME, DESCRIPTION, ADMINPRIVILEGES, VALIDFROM, VALIDUNTIL, CREATED, CREATORID, LASTCHANGED, LASTCHANGERID)
     values (4, 3, 'public', 'Default group', 0, null, null, CURRENT_TIMESTAMP, 4, null, null);


/* keywords */
delete from KEYWORDS;

insert into KEYWORDS
            (KEYWORDID, TERM, TERMDESCRIPTION)
     values (1, 'Keyword1', 'KeywordClass1');

insert into KEYWORDS
            (KEYWORDID, TERM, TERMDESCRIPTION)
     values (2, 'Keyword2', 'KeywordClass2');

insert into KEYWORDS
            (KEYWORDID, TERM, TERMDESCRIPTION)
     values (3, 'Keyword3', 'KeywordClass3');

insert into KEYWORDS
            (KEYWORDID, TERM, TERMDESCRIPTION)
     values (4, 'Keyword4', 'KeywordClass4');

insert into KEYWORDS
            (KEYWORDID, TERM, TERMDESCRIPTION)
     values (5, 'Keyword5', 'KeywordClass5');

insert into KEYWORDS
            (KEYWORDID, TERM, TERMDESCRIPTION)
     values (6, 'Keyword6', 'KeywordClass6');

insert into KEYWORDS
            (KEYWORDID, TERM, TERMDESCRIPTION)
     values (7, 'Keyword7', 'KeywordClass7');

insert into KEYWORDS
            (KEYWORDID, TERM, TERMDESCRIPTION)
     values (8, 'Keyword8', 'KeywordClass8');

insert into KEYWORDS
            (KEYWORDID, TERM, TERMDESCRIPTION)
     values (9, 'Keyword9', 'KeywordClass9');

insert into KEYWORDS
            (KEYWORDID, TERM, TERMDESCRIPTION)
     values (10, 'Keyword10', 'KeywordClass10');

/* keywords from categories */
insert into KEYWORDS
            (KEYWORDID, TERM, TERMDESCRIPTION)
     values (11, 'CategoryKeyword1', 'KeywordClass11');

insert into KEYWORDS
            (KEYWORDID, TERM, TERMDESCRIPTION)
     values (12, 'CategoryKeyword2', 'KeywordClass12');

insert into KEYWORDS
            (KEYWORDID, TERM, TERMDESCRIPTION)
     values (13, 'CategoryKeyword3', 'KeywordClass13');

insert into KEYWORDS
            (KEYWORDID, TERM, TERMDESCRIPTION)
     values (14, 'CategoryKeyword4', 'KeywordClass14');

insert into KEYWORDS
            (KEYWORDID, TERM, TERMDESCRIPTION)
     values (15, 'CategoryKeyword5', 'KeywordClass15');

insert into KEYWORDS
            (KEYWORDID, TERM, TERMDESCRIPTION)
     values (16, 'CategoryKeyword6', 'KeywordClass16');

insert into KEYWORDS
            (KEYWORDID, TERM, TERMDESCRIPTION)
     values (17, 'CategoryKeyword7', 'KeywordClass17');

insert into KEYWORDS
            (KEYWORDID, TERM, TERMDESCRIPTION)
     values (18, 'CategoryKeyword8', 'KeywordClass18');

insert into KEYWORDS
            (KEYWORDID, TERM, TERMDESCRIPTION)
     values (19, 'CategoryKeyword9', 'KeywordClass19');

insert into KEYWORDS
            (KEYWORDID, TERM, TERMDESCRIPTION)
     values (20, 'CategoryKeyword10', 'KeywordClass20');


/* registered keywords */
/* user1 registered to keyword10, keyword9, keyword8 */
insert into USERREGISTEREDKEYWORDS
            (USERID, KEYWORDID)
     values (2, 10);

insert into USERREGISTEREDKEYWORDS
            (USERID, KEYWORDID)
     values (2, 9);

insert into USERREGISTEREDKEYWORDS
            (USERID, KEYWORDID)
     values (2, 8);

/* user2 registered to keyword7, keyword6, keyword5 */
insert into USERREGISTEREDKEYWORDS
            (USERID, KEYWORDID)
     values (3, 7);

insert into USERREGISTEREDKEYWORDS
            (USERID, KEYWORDID)
     values (3, 6);

insert into USERREGISTEREDKEYWORDS
            (USERID, KEYWORDID)
     values (3, 5);

/* user3 registered to keyword4, keyword3, keyword2 */
insert into USERREGISTEREDKEYWORDS
            (USERID, KEYWORDID)
     values (4, 4);

insert into USERREGISTEREDKEYWORDS
            (USERID, KEYWORDID)
     values (4, 3);

insert into USERREGISTEREDKEYWORDS
            (USERID, KEYWORDID)
     values (4, 2);


/* usergroups */
/* group1 (admingroup): user2, user3 */
/* group2             : user4, user5 */
/* group3             : user6, user7 */
/* group4             : user8, user9 */
insert into USERGROUPS
            (GROUPID, USERID, CREATED, CREATORID)
     values (1, 2, CURRENT_TIMESTAMP, 1);

insert into USERGROUPS
            (GROUPID, USERID, CREATED, CREATORID)
     values (1, 3, CURRENT_TIMESTAMP, 1);

insert into USERGROUPS
            (GROUPID, USERID, CREATED, CREATORID)
     values (2, 4, CURRENT_TIMESTAMP, 1);

insert into USERGROUPS
            (GROUPID, USERID, CREATED, CREATORID)
     values (2, 5, CURRENT_TIMESTAMP, 1);

insert into USERGROUPS
            (GROUPID, USERID, CREATED, CREATORID)
     values (3, 6, CURRENT_TIMESTAMP, 1);

insert into USERGROUPS
            (GROUPID, USERID, CREATED, CREATORID)
     values (3, 7, CURRENT_TIMESTAMP, 1);

insert into USERGROUPS
            (GROUPID, USERID, CREATED, CREATORID)
     values (4, 8, CURRENT_TIMESTAMP, 1);

insert into USERGROUPS
            (GROUPID, USERID, CREATED, CREATORID)
     values (4, 9, CURRENT_TIMESTAMP, 1);


/* root cat            */
/* anyother: -rw-C---- */
/* doc1                */
/* doc2                */
insert into CATEGORYACLS
            (ACLENTRYID, ACLID, ACLTYPEID, ACCESSORID, PERMISSIONID, CREATED, CREATORID)
     values (1, 1, 3, 0, 2, CURRENT_TIMESTAMP, 1);

insert into CATEGORYACLS
            (ACLENTRYID, ACLID, ACLTYPEID, ACCESSORID, PERMISSIONID, CREATED, CREATORID)
     values (2, 1, 3, 0, 3, CURRENT_TIMESTAMP, 1);

insert into CATEGORYACLS
            (ACLENTRYID, ACLID, ACLTYPEID, ACCESSORID, PERMISSIONID, CREATED, CREATORID)
     values (3, 1, 3, 0, 5, CURRENT_TIMESTAMP, 1);

insert into CATEGORIES
            (CATEGORYID, PARENTCATEGORYID, ACLID, DYNATTRSID, INITIALCATEGORY, NAME, TITLE, DESCRIPTION, SHOWDESCRIPTION, ASSIGNEDTEMPLATE, CREATED, CREATORID, LASTCHANGED, LASTCHANGERID, LASTACCESSED, LASTACCESSORID, ACCESSCOUNTER)
     values (1, null, 1, null, 1, 'VKC:/', 'vkc-root', 'Root-Category', 1, 'CategoryTemplate1', null, null, null, null, null, null, null);

/* searchengines */
delete from SEARCHENGINES;

insert into SEARCHENGINES
            (SEARCHENGINEID, NAME, URL, PARAMETERS, DESCRIPTION)
     values (1, 'Google', 'http://www.google.de', '', 'Google Search Engine');

insert into SEARCHENGINES
            (SEARCHENGINEID, NAME, URL, PARAMETERS, DESCRIPTION)
     values (2, 'Lycos', 'http://www.lycos.de', '', 'Lycos Search Engine');

insert into SEARCHENGINES
            (SEARCHENGINEID, NAME, URL, PARAMETERS, DESCRIPTION)
     values (3, 'Altavista', 'http://www.altavista.de', '', 'Altavista Search Engine');


/* sysparameters */
delete from SYSPARAMETERS;

insert into SYSPARAMETERS
            (SYSPARAMETERID, NAME, VALUESTRING, DESCRIPTION)
     values (1, 'DBName', 'VKC-DB', 'Name of the VKC database');

insert into SYSPARAMETERS
            (SYSPARAMETERID, NAME, VALUESTRING, DESCRIPTION)
     values (2, 'DBMS', 'Interbase', 'VKC database management system');

insert into SYSPARAMETERS
            (SYSPARAMETERID, NAME, VALUESTRING, DESCRIPTION)
     values (3, 'DBCopyright', 'C-LAB', 'Owner of the db schema');

insert into SYSPARAMETERS
            (SYSPARAMETERID, NAME, VALUESTRING, DESCRIPTION)
     values (4, 'DBVersionHigh', '1', 'Database Version High Number');

insert into SYSPARAMETERS
            (SYSPARAMETERID, NAME, VALUESTRING, DESCRIPTION)
     values (5, 'DBVersionLow', '0', 'Database Version Low Number');

insert into SYSPARAMETERS
            (SYSPARAMETERID, NAME, VALUESTRING, DESCRIPTION)
     values (6, 'DBCreationDate', 'tt.mm.yyyy', 'Database Creation Date');

/* languages */
delete from LANGUAGES;

insert into LANGUAGES
            (LANGUAGEID, NAME, SHORTNAME, ISOCODE)
     values (1, 'Deutsch', 'de', 'ISO8859-1');

insert into LANGUAGES
            (LANGUAGEID, NAME, SHORTNAME, ISOCODE)
     values (2, 'English', 'en', 'ISO8859-1');