CREATE TABLE VKC_AVAILS (
VKC404ID			INTEGER 						not null,
UPTIME			 DATE 						not null,
UPTIME_DESCR		VARCHAR2(50),
DOWNTIME		 DATE,
DOWNTIME_DESCR		VARCHAR2(50),
CONSTRAINT PK_VKC404ID PRIMARY KEY (VKC404ID)
)
/

create table ACLTYPES (
ACLTYPEID            INTEGER                        not null,
NAME                 VARCHAR2(20)                    not null,
NAME_KEY             VARCHAR2(50),
RANK                 INTEGER                        not null,
DESCRIPTION          VARCHAR2(50),
DESCR_KEY            VARCHAR2(50),
DEFACLONLY           INTEGER,
IDREQUIRED           INTEGER,
constraint PK_ACLTYPES primary key (ACLTYPEID)
)
/

create unique index INDEX_16 on ACLTYPES(
NAME asc,
RANK asc
)
/

create table ADDCATATTRS (
CATATTRID            INTEGER                        not null,
NAME                 VARCHAR2(255)                   not null,
NAME_KEY             VARCHAR2(50),
DESCRIPTION          VARCHAR2(255),
DESCR_KEY            VARCHAR2(50),
ALLOWNULL            INTEGER,
DEFAULTVALUE         VARCHAR2(255),
constraint PK_ADDCATATTRS primary key (CATATTRID)
)
/

create table ADDCATATTRVALUES (
CATEGORYID           INTEGER                        not null,
CATATTRID            INTEGER                        not null,
VALUESTRING          VARCHAR2(255),
constraint PK_ADDCATATTRVALUES primary key (CATEGORYID, CATATTRID)
)
/

create table ADDDOCATTRS (
DOCATTRID            INTEGER                        not null,
NAME                 VARCHAR2(255)                   not null,
NAME_KEY             VARCHAR2(50),
DESCRIPTION          VARCHAR2(50),
DESCR_KEY            VARCHAR2(255),
ALLOWNULL            INTEGER,
DEFAULTVALUE         VARCHAR2(255),
constraint PK_ADDDOCATTRS primary key (DOCATTRID)
)
/

create table ADDDOCATTRVALUES (
DOCUMENTID           INTEGER                        not null,
DOCATTRID            INTEGER                        not null,
VALUESTRING          VARCHAR2(255),
constraint PK_ADDDOCATTRVALUES primary key (DOCUMENTID, DOCATTRID)
)
/

create table ADDGROUPATTRS (
GROUPATTRID          INTEGER                        not null,
NAME                 VARCHAR2(255)                   not null,
NAME_KEY             VARCHAR2(50),
DESCRIPTION          VARCHAR2(255),
DESCR_KEY            VARCHAR2(50),
ALLOWNULL            INTEGER,
DEFAULTVALUE         VARCHAR2(255),
constraint PK_ADDGROUPATTRS primary key (GROUPATTRID)
)
/

create table ADDGROUPATTRVALUES (
GROUPID              INTEGER                        not null,
GROUPATTRID          INTEGER                        not null,
VALUESTRING          VARCHAR2(255),
constraint PK_ADDGROUPATTRVALUES primary key (GROUPID, GROUPATTRID)
)
/

create table ADDITIONALDOCUMENTFORMATS (
ADDDOCFORMATID       INTEGER                        not null,
DOCUMENTID           INTEGER                        not null,
DOCTYPEID            INTEGER                        not null,
ARCHIVEID            VARCHAR2(36)                    not null,
ZIPPED               INTEGER,
DOCSIZE              INTEGER,
INTERNALDOCFORMAT    INTEGER,
constraint PK_ADDITIONALDOCUMENTFORMATS primary key (ADDDOCFORMATID)
)
/

create unique index INDEX_19 on ADDITIONALDOCUMENTFORMATS(
DOCUMENTID asc,
DOCTYPEID asc
)
/

create table ADDUSERATTRS (
USERATTRID           INTEGER                        not null,
NAME                 VARCHAR2(255)                   not null,
NAME_KEY             VARCHAR2(50),
DESCRIPTION          VARCHAR2(255),
DESCR_KEY            VARCHAR2(50),
ALLOWNULL            INTEGER,
DEFAULTVALUE         VARCHAR2(255),
constraint PK_ADDUSERATTRS primary key (USERATTRID)
)
/

create table ADDUSERATTRVALUES (
USERID               INTEGER                        not null,
USERATTRID           INTEGER                        not null,
VALUESTRING          VARCHAR2(255),
constraint PK_ADDUSERATTRVALUES primary key (USERID, USERATTRID)
)
/

create table ALLOWEDDOCUMENTTYPES (
CATEGORYID           INTEGER                        not null,
DOCTYPEID            INTEGER                        not null
)
/

create table CATEGORIES (
CATEGORYID           INTEGER                        not null,
PARENTCATEGORYID     INTEGER,
ACLID                INTEGER                        not null,
DYNATTRSID           INTEGER,
INITIALCATEGORY      INTEGER,
NAME                 VARCHAR2(255)                   not null,
DESCRIPTION          VARCHAR2(4000),
SHOWDESCRIPTION      INTEGER,
TEMPLATEID           INTEGER,
STATUS               INTEGER,
FLAG                 INTEGER,
CREATED              DATE,
CREATORID            INTEGER,
LASTCHANGED          DATE,
LASTCHANGERID        INTEGER,
LASTACCESSED         DATE,
LASTACCESSORID       INTEGER,
ACCESSCOUNTER        INTEGER,
CATEGORYTYPE         INTEGER,
constraint PK_CATEGORIES primary key (CATEGORYID)
)
/

create table PROJECTS (
CATEGORYID           INTEGER                        not null,
EXTERNALCONTACTS     VARCHAR2(1024),
constraint PK_PROJECTS primary key (CATEGORYID),
constraint FK_PROJECTS foreign key (CATEGORYID) references CATEGORIES (CATEGORYID) ON DELETE CASCADE
)
/

create table PROJECTSUBFOLDERS (
CATEGORYID           INTEGER not null,
PROJECTID            INTEGER not null,
constraint PK_PROJECTSUBFOLDERS primary key (CATEGORYID),
constraint FK_PROJECTSUBFOLDERS foreign key (CATEGORYID) references CATEGORIES (CATEGORYID) ON DELETE CASCADE
)
/

create table PROJECTMESSAGES (
MessageId            INTEGER                        not null,
ProjectId            INTEGER                        not null,
RecepientId          INTEGER                        not null,
MessageText          VARCHAR2(2048)                  not null,
Link                 VARCHAR2(1024),
LinkKey              VARCHAR2(256),
Created              DATE                      not null,
CreatorId            INTEGER,
constraint PK_PROJECTMESSAGES primary key (MessageId),
constraint FK_PROJECTMESSAGES foreign key (ProjectId) references PROJECTS (CATEGORYID) ON DELETE CASCADE
)
/

create index index1_PROJECTMESSAGES on PROJECTMESSAGES(
ProjectId asc
)
/

create index index2_PROJECTMESSAGES on PROJECTMESSAGES(
RecepientId asc
)
/

create table CATEGORYSTATI (
STATUS               INTEGER                        not null,
DESCRIPTION          VARCHAR2(50)                    not null,
DESC_KEY             VARCHAR2(50),
REMARK               VARCHAR2(50),
constraint PK_CATEGORYSTATI primary key (STATUS)
)
/

create table CATEGORYACLS (
ACLENTRYID           INTEGER                        not null,
ACLID                INTEGER                        not null,
ACLTYPEID            INTEGER                        not null,
ACCESSORID           INTEGER                        not null,
PERMISSIONID         INTEGER                        not null,
CREATED              DATE,
CREATORID            INTEGER,
constraint PK_CATEGORYACLS primary key (ACLENTRYID)
)
/

create unique index INDEX_14 on CATEGORYACLS(
ACLID asc,
ACLTYPEID asc,
ACCESSORID asc,
PERMISSIONID asc
)
/

create table CATEGORYDOCUMENTLINKS (
CATDOCLINKID         INTEGER                        not null,
CATID                INTEGER                        not null,
LINKSTODOCID         INTEGER                        not null,
NAME                 VARCHAR2(50)                    not null,
FOLLOWVERSIONS       INTEGER                        not null,
DESCRIPTION          VARCHAR2(100),
constraint PK_CATDOCLINKS primary key (CATDOCLINKID)
)
/

create table CATEGORYDOCUMENTS (
CATDOCID             INTEGER                        not null,
CATEGORYID           INTEGER                        not null,
DOCUMENTID           INTEGER                        not null,
INITIALCATEGORY      INTEGER,
CREATED              DATE,
CREATORID            INTEGER,
constraint PK_CATEGORYDOCUMENTS primary key (CATDOCID)
)
/

create unique index INDEX_20 on CATEGORYDOCUMENTS(
CATEGORYID asc,
DOCUMENTID asc
)
/

create table CATEGORYKEYWORDS (
CATEGORYID           INTEGER                        not null,
TERM                 VARCHAR2(255),
TERMDESCRIPTOR       VARCHAR2(255)                   not null,
WEIGHT               DOUBLE PRECISION,
INTERNAL             INTEGER
)
/

create index index_catkeywords on CATEGORYKEYWORDS(
CATEGORYID asc
)
/

create table CATEGORYLINKS (
CATLINKID            INTEGER                        not null,
CATID                INTEGER                        not null,
LINKSTOCATID         INTEGER                        not null,
NAME                 VARCHAR2(50)                    not null,
DESCRIPTION          VARCHAR2(100),
constraint PK_CATEGORYLINKS primary key (CATLINKID)
)
/

create unique index INDEX_33 on CATEGORYLINKS(
CATID asc,
LINKSTOCATID asc
)
/

create table CATPROJECTSTEPS (
CATPROJSTEPID        INTEGER                        not null,
CATEGORYID           INTEGER                        not null,
STEP                 INTEGER                        not null,
ENABLED              INTEGER                        not null,
ACTIVITY             VARCHAR2(255)                   not null,
STARTDATE            DATE                      not null,
ENDDATE              DATE                      not null,
PROCESSORID          INTEGER,
PROCESSEDTS          DATE,
CHECKERID            INTEGER,
CHECKEDTS            DATE,
constraint PK_CATPROJECTSTEPS primary key (CATPROJSTEPID)
)
/

create unique index INDEX_28 on CATPROJECTSTEPS(
CATEGORYID asc,
STEP asc
)
/

create table DEFAULTCATACLS (
ACLENTRYID           INTEGER                        not null,
STARTCATID           INTEGER                        not null,
ACLTYPEID            INTEGER                        not null,
ACCESSORID           INTEGER                        not null,
PERMISSIONID         INTEGER                        not null,
CREATED              DATE,
CREATORID            INTEGER,
constraint PK_DEFAULTCATACLS primary key (ACLENTRYID)
)
/

create unique index INDEX_26 on DEFAULTCATACLS(
STARTCATID asc,
ACLTYPEID asc,
ACCESSORID asc,
PERMISSIONID asc
)
/

create table DEFAULTDOCACLS (
ACLENTRYID           INTEGER                        not null,
STARTCATID           INTEGER                        not null,
ACLTYPEID            INTEGER                        not null,
ACCESSORID           INTEGER                        not null,
PERMISSIONID         INTEGER                        not null,
CREATED              DATE,
CREATORID            INTEGER,
constraint PK_DEFAULTDOCACLS primary key (ACLENTRYID)
)
/

create unique index INDEX_27 on DEFAULTDOCACLS(
STARTCATID asc,
ACLTYPEID asc,
ACCESSORID asc,
PERMISSIONID asc
)
/

create table DOCUMENTACLS (
ACLENTRYID           INTEGER                        not null,
ACLID                INTEGER                        not null,
ACLTYPEID            INTEGER                        not null,
ACCESSORID           INTEGER                        not null,
PERMISSIONID         INTEGER                        not null,
CREATED              DATE,
CREATORID            INTEGER,
constraint PK_DOCUMENTACLS primary key (ACLENTRYID)
)
/

create unique index INDEX_11 on DOCUMENTACLS(
ACLID asc,
ACLTYPEID asc,
ACCESSORID asc,
PERMISSIONID asc
)
/

create table DOCUMENTCLASSES (
DOCCLASSID           INTEGER                        not null,
NAME_KEY             VARCHAR2(50)                    not null, 
DESCR_KEY            VARCHAR2(100),
FLAG                 INTEGER,
constraint PK_DOCUMENTCLASSES primary key (DOCCLASSID)
)
/

create table DOCUMENTFLAGS (
FLAG                 INTEGER                        not null,
DESCRIPTION          VARCHAR2(20),
constraint PK_DOCUMENTFLAGS primary key (FLAG)
)
/

create table DOCUMENTKEYWORDS (
DOCUMENTID           INTEGER                        not null,
TERM                 VARCHAR2(255),
TERMDESCRIPTOR       VARCHAR2(255)                   not null,
WEIGHT               DOUBLE PRECISION,
INTERNAL             INTEGER
)
/

create index index_dockeywords on DOCUMENTKEYWORDS(
DOCUMENTID asc
)
/

create table DOCUMENTS (
DOCUMENTID           INTEGER                        not null,
PREDOCID             INTEGER,
NAME                 VARCHAR2(255)                   not null,
TITLE                VARCHAR2(255),
DESCRIPTION          VARCHAR2(4000),
AUTHORNAME           VARCHAR2(128),
TYPEID               INTEGER                        not null,
DOCCLASSID           INTEGER                        not null,
ARCHIVEID            VARCHAR2(36)                    not null,
VERSION_NO           INTEGER                        not null,
VERSION_HIGH         INTEGER                        not null,
VERSION_LOW          INTEGER                        not null,
VERSION_DESCR        VARCHAR2(255),
SUMMARY              VARCHAR2(255),
STATUS               INTEGER                        not null,
FLAG                 INTEGER                        not null,
ACLID                INTEGER,
CREATIONDATE         DATE,
EXPIRES              DATE,
PUBLISHED            DATE                      not null,
PUBLISHERID          INTEGER                        not null,
LASTCHANGED          DATE,
LASTCHANGERID        INTEGER,
LASTACCESSED         DATE,
LASTACCESSORID       INTEGER,
ACCESSCOUNTER        INTEGER,
DYNATTRSID           INTEGER,
DOCSIZE              INTEGER,
ZIPPED               INTEGER,
LANGPACKID           INTEGER,
LOCKUSERID           INTEGER,
constraint PK_DOCUMENTS primary key (DOCUMENTID)
)
/

create table DOCUMENTSTATI (
STATUS               INTEGER                        not null,
DESC_KEY             VARCHAR2(50)                    not null,
REMARK               VARCHAR2(50),
constraint PK_DOCUMENTSTATI primary key (STATUS)
)
/

create table DOCUMENTTYPES (
DOCTYPEID            INTEGER                        not null,
EXTENSION            VARCHAR2(10)                    not null,
EXTENSION_KEY        VARCHAR2(50),
DESCRIPTION          VARCHAR2(50),
DESCRIPTION_SHORT    VARCHAR2(20),
DESCR_KEY            VARCHAR2(50),
IMGPATH			     VARCHAR2(128),
ICON_EXTENSION       VARCHAR2(10),
MIMETYPE             VARCHAR2(50),
INTERNAL             INTEGER,
CONVERTIBLE 		 INTEGER,
EDITABLE			 INTEGER,
constraint PK_DOCUMENTTYPES primary key (DOCTYPEID)
)
/

create unique index INDEX_18 on DOCUMENTTYPES(
EXTENSION asc
)
/

create table DYNATTRIBUTES (
DAENTYRID            INTEGER                        not null,
DYNATTRID            INTEGER                        not null,
NAME                 VARCHAR2(50)                    not null,
NAME_KEY             VARCHAR2(50),
VALUESTRING          VARCHAR2(4000),
constraint PK_DYNATTRIBUTES primary key (DAENTYRID)
)
/

create table GROUPS (
GROUPID              INTEGER                        not null,
NAME                 VARCHAR2(62)                    not null,
NAME_KEY             VARCHAR2(199),
DESCRIPTION          VARCHAR2(199),
DESCR_KEY            VARCHAR2(199),
ACCOUNTVALID         INTEGER,
ADMINPRIVILEGES      INTEGER,
VALIDFROM            DATE,
VALIDUNTIL           DATE,
CREATED              DATE,
CREATORID            INTEGER,
LASTCHANGED          DATE,
LASTCHANGERID        INTEGER,
constraint PK_GROUPS primary key (GROUPID)
)
/

create unique index INDEX_12 on GROUPS(
NAME asc
)
/

create table LANGUAGEPACKS (
LANGPACKID           INTEGER                        not null,
COUNTRYCODE          VARCHAR2(2)                     not null,
NAME                 VARCHAR2(50)                    not null,
NAME_KEY             VARCHAR2(50),
DESCRIPTION          VARCHAR2(50),
DESCR_KEY            VARCHAR2(50),
CLASSNAME            VARCHAR2(50)                    not null,
CLASSPATH            VARCHAR2(255)                   not null,
ENABLED              integer,
constraint PK_LANGUAGEPACKS primary key (LANGPACKID)
)
/

create table LANGUAGES (
LANGUAGEID           INTEGER                        not null,
NAME                 VARCHAR2(50)                    not null,
NAME_KEY             VARCHAR2(50),
SHORTNAME            VARCHAR2(2),
ISOCODE              VARCHAR2(10),
DEFAULTLANGUAGE      INTEGER,
constraint PK_LANGUAGES primary key (LANGUAGEID)
)
/

create table MSGTIMEPERIODS (
PERIODID             INTEGER                        not null,
PERIOD               FLOAT                          not null,
DESCRIPTION          VARCHAR2(255),
constraint PK_PERIODID primary key (PERIODID)
)
/

create table NEWS (
NEWSID               INTEGER                        not null,
HEADLINE             VARCHAR2(255)                   not null,
NEWSTEXT             VARCHAR2(4000)                  not null,
INFOURL              VARCHAR2(255),
CREATED              DATE                      not null,
CREATORID            INTEGER                        not null,
VALIDFROM            DATE,
VALIDUNTIL           DATE,
constraint PK_NEWS primary key (NEWSID)
)
/

create table PERMISSIONS (
PERMISSIONID         INTEGER                        not null,
CONTEXT              VARCHAR2(20)                    not null,
TOKEN                VARCHAR2(1)                     not null,
NUMVALUE             INTEGER                        not null,
PRINTSTRING          VARCHAR2(50),
PRINTSTRING_KEY      VARCHAR2(50),
DESCRIPTION          VARCHAR2(100),
DESCR_KEY            VARCHAR2(100),
ENABLED              INTEGER,
constraint PK_PERMISSIONS primary key (PERMISSIONID)
)
/

create unique index INDEX_15 on PERMISSIONS(
CONTEXT asc,
TOKEN asc,
NUMVALUE asc
)
/

create table PROXYUSERS (
PROXYID              INTEGER                        not null,
USERID               INTEGER                        not null,
PROXYUSERID          INTEGER                        not null,
DESCRIPTION          VARCHAR2(100),
VALIDFROM            DATE,
VALIDUNTIL           DATE,
CREATED              DATE                      not null,
CREATORID            INTEGER                        not null,
constraint PK_PROXYUSERS primary key (PROXYID)
)
/

create unique index INDEX_34 on PROXYUSERS(
USERID asc,
PROXYUSERID asc
)
/

create table SYSPARAMETERS (
SYSPARAMETERID       INTEGER                        not null,
CONTEXT              VARCHAR2(50)                    not null,
CONTEXT_KEY          VARCHAR2(128),
NAME                 VARCHAR2(50)                    not null,
NAME_KEY             VARCHAR2(128),
VALUESTRING          VARCHAR2(1024),
DESCRIPTION          VARCHAR2(100),
DESCR_KEY            VARCHAR2(128),
ALLOWNULL            INTEGER                        not null,
READONLY             INTEGER                        not null,
HIDE                 INTEGER                        not null,
DATATYPE             INTEGER                        not null,
constraint PK_SYSPARAMETERS primary key (SYSPARAMETERID)
)
/

create unique index INDEX_13 on SYSPARAMETERS(
CONTEXT asc,
NAME asc
)
/

create table TEMPLATES (
TEMPLATEID           INTEGER                        not null,
NAME                 VARCHAR2(50)                    not null,
PATH                 VARCHAR2(255)                   not null,
DESCRIPTION          VARCHAR2(255),
PREVIEWPIC           VARCHAR2(255),
ENABLED              INTEGER,
constraint PK_TEMPLATES primary key (TEMPLATEID)
)
/

create table USERDOCMAILS (
UDMID                INTEGER                        not null,
USERID               INTEGER                        not null,
DOCUMENTID           INTEGER                        not null,
RELDOCID             INTEGER,
QUERYID              INTEGER,
SENDON               DATE                      not null,
PROCESSED            INTEGER,
WASSENDAT            DATE,
constraint PK_USERDOCMAILS primary key (UDMID)
)
/

create unique index INDEX_22 on USERDOCMAILS(
USERID asc,
DOCUMENTID asc
)
/

create table USERGROUPS (
GROUPID              INTEGER                        not null,
USERID               INTEGER                        not null,
CREATED              DATE,
CREATORID            INTEGER,
STANDARDGROUP        INTEGER,
constraint PK_USERGROUPS primary key (GROUPID, USERID)
)
/

create table USERREGISTEREDCATEGORIES (
USERID               INTEGER                        not null,
CATEGORYID           INTEGER                        not null,
INCLSUBDIRS          INTEGER,
constraint PK_USERREGISTEREDCATEGORIES primary key (USERID, CATEGORYID)
)
/

create table USERREGISTEREDDOCUMENTS (
USERID               INTEGER                        not null,
DOCUMENTID           INTEGER                        not null,
THRESHOLD            INTEGER,
constraint PK_USERREGISTEREDDOCUMENTS primary key (USERID, DOCUMENTID)
)
/

create table USERS (
USERID               INTEGER                        not null,
USERNAME             VARCHAR2(62)                    not null,
FIRSTNAME            VARCHAR2(199),
LASTNAME             VARCHAR2(199),
TITLE                VARCHAR2(50),
PASSWD               VARCHAR2(255)                   not null,
PASSWDCHANGED        INTEGER,
PASSWDCHANGEDTS      DATE,
PWDMISMATCHCOUNT     INTEGER,
EMAIL                VARCHAR2(50),
SHOWEMAIL            INTEGER,
ENABLEMESSAGING      INTEGER,
MESSAGINGTIMEPERIOD  INTEGER,
COMPANY              VARCHAR2(50),
DEPARTMENT           VARCHAR2(50),
ZIP                  VARCHAR2(10),
CITY                 VARCHAR2(50),
STREET               VARCHAR2(50),
PHONE                VARCHAR2(20),
FAX                  VARCHAR2(20),
MOBILE               VARCHAR2(20),
HOMEPAGEURL          VARCHAR2(100),
CONTACTURL           VARCHAR2(100),
ADMINPRIVILEGES      INTEGER,
SESSIONTIMEOUT       INTEGER,
QUOTA                INTEGER,
MANAGEOWNUSERS       INTEGER,
MANAGEOWNUSERS_S_V   INTEGER,
MANAGEOWNGROUPS      INTEGER,
MANAGEOWNPROXIES     INTEGER,
MANAGEVIRTUALDOC_Q   INTEGER,
LANGUAGEID           INTEGER,
ACCOUNTVALID         INTEGER,
VALIDFROM            DATE,
VALIDUNTIL           DATE,
CREATED              DATE,
CREATORID            INTEGER,
LASTCHANGED          DATE,
LASTCHANGERID        INTEGER,
DYNATTRSID           INTEGER,
TEMPLATEID           INTEGER,
STARTCATEGORYID      INTEGER,
MOSTRECENTLOGIN      DATE,
MOSTRECENTLOGOUT     DATE,
MOSTRECENTNEWS       DATE,
EXTERNALSERVERID     INTEGER,
EXTERNALSERVERTYPE   VARCHAR2(20),
EXTERNALUSERID       VARCHAR2(20),
S_DOCSORTMODE 		 INTEGER,
B_DOCSORTMODE 		 INTEGER,
L_DOCSORTMODE 		 INTEGER,
C_DOCSORTMODE 		 INTEGER,
ALLOWMANAGE_S_V_T    INTEGER,
SYSTEMVIEWTYPEID 	 INTEGER,
constraint PK_USERS primary key (USERID)
)
/

create unique index INDEX_9 on USERS(
USERNAME asc,
EXTERNALSERVERID asc
)
/

create table CONVERTERTIMING (
ID 						INTEGER not null,
POLLING_PERIOD_MINUTES 	INTEGER default 30 not null,
TIME_FRAME_START 		VARCHAR2(5),
TIME_FRAME_END 			VARCHAR2(5),	
constraint PK_CONVERTERTIMING primary key (ID)
)
/

create table CONVERSIONSTATI (
DOCUMENTID			INTEGER not null,
STATUS 				VARCHAR2(11) DEFAULT 'outstanding' not null,
STARTED 		 DATE,
FINISHED 		 DATE,
REITERATIONS 		INTEGER default 0 not null,
SENDMAIL 			INTEGER,
REMARK				VARCHAR2(255),
constraint PK_CONVERSIONSTATI primary key (DOCUMENTID)
)
/

create table CONVERTER (
ID 					INTEGER not null,
MAX_REITERATIONS 	INTEGER default 3 not null,
DOCUMENTTYPES 		VARCHAR2(255),
LOADFACTOR 			INTEGER default 1 not null,
HOSTNAME 			VARCHAR2(30) not null,
PORT 				INTEGER not null,
STATUS 				VARCHAR2(4) not null,
JOBS_IN_EXECUTION 	INTEGER default 0 not null,
TIMINGID 			INTEGER default 1 not null,
constraint PK_CONVERTER primary key (ID)
)
/

create table VKCSERVER (
ID 					INTEGER not null,
LOADFACTOR 			INTEGER default 1 not null,
HOSTNAME 			VARCHAR2(30) not null,
PORT 				INTEGER not null,
JOBS_REQUESTED 		INTEGER default 0 not null,
STATUS 				VARCHAR2(4) not null,
constraint PK_VKCSERVER primary key (ID)
)
/

create table SEARCHQUERIES (
QUERYID              INTEGER                        not null,
CATEGORYID           INTEGER                        not null,
QUERYFIELD           VARCHAR2(512),
constraint PK_SEARCHQUERIES primary key ( QUERYID, CATEGORYID )
)
/

create table USERREGSEARCHQUERIES (
URSQID	             INTEGER                        not null,
QUERYID              INTEGER                        not null,
USERID               INTEGER                        not null,
QUERYFIELD           VARCHAR2(512),
constraint PK_USERREGSEARCHQUERIES primary key ( URSQID )
)
/

create table USERCATFAVORITES (
USERID               INTEGER                        not null,
CATEGORYID           INTEGER                        not null,
CREATED              DATE,
constraint PK_USERCATFAVORITES primary key (USERID, CATEGORYID)
)
/

create table USERDOCFAVORITES (
USERID               INTEGER                        not null,
DOCUMENTID           INTEGER                        not null,
CREATED              DATE,
constraint PK_USERDOCFAVORITES primary key (USERID, DOCUMENTID)
)
/

create table DOCUMENTVIEWFIELDS (
FIELDID              INTEGER                        not null,
NAME            	 VARCHAR2(256)                   not null,
NAMEKEY              VARCHAR2(256)					not null,
DEFAULTFIELD         INTEGER						not null,
constraint PK_DOCUMENTVIEWFIELDS primary key (FIELDID)
)
/

create table USERDOCVIEWFIELDS (
ENTRYID              INTEGER                        not null,
FIELDID            	 INTEGER                        not null,
USERID               INTEGER					    not null,
constraint PK_USERDOCVIEWFIELDS primary key ( ENTRYID)
)
/

create unique index INDEX_30 on USERDOCVIEWFIELDS(
USERID asc,
FIELDID asc
)
/

alter table USERDOCVIEWFIELDS
    add constraint FK_USERDOVIEWFIELDS foreign key (USERID)
        references USERS(USERID)
/

alter table USERDOCVIEWFIELDS
    add constraint FK_USERDOVIEWFIELDS2 foreign key (FIELDID)
        references DOCUMENTVIEWFIELDS(FIELDID)
/

create table USERDOCHISTORIES (
USERID               INTEGER                        not null,
DOCUMENTID           INTEGER                        not null,
LASTACCESSED         DATE                      not null,
constraint PK_USERDOCHISTORIES primary key (USERID, DOCUMENTID)
)
/

create table LDAPUSERS (
ldapUserId        INTEGER                       not null,
ldapServerId      INTEGER                       not null,
ldapUserRDN       VARCHAR2(512)					not null,
constraint PK_LDAPUSERS primary key (ldapUserId)
)
/

create table LDAPGROUPS (
ldapGroupId      INTEGER                       not null,
ldapServerId     INTEGER                       not null,
ldapGroupRDN     VARCHAR2(512)				   not null,
constraint PK_LDAPGROUPS primary key (ldapGroupId)
)
/

create table LDAPSERVERS (
ldapServerId		INTEGER						not null,
ldapServerURL	    VARCHAR2(128)				not null,
description         VARCHAR2(64)					not null,
authMethod			VARCHAR2(20)					not null,
baseDN              VARCHAR2(128)                not null,
usersBaseRDN        VARCHAR2(128)                not null,
groupsBaseRDN       VARCHAR2(128)                not null,
mapping_loginattr   VARCHAR2(32)                 not null, 
mapping_email       VARCHAR2(32),                 
mapping_userid      VARCHAR2(32)                 not null, 
mapping_fullname    VARCHAR2(32)                 not null,
mapping_language    VARCHAR2(32),
created 		 DATE,
creatorId           INTEGER,
lastChanged         DATE,
lastChangerId       INTEGER,
enabled             INTEGER                     not null,
constraint PK_LDAPSERVERS primary key (ldapServerId)
)
/

CREATE TABLE "USERRATINGS"
(
  "USERRATINGID"    INTEGER NOT NULL,
  "MINPUBDOCSCOUNT" INTEGER NOT NULL,
  "DESCRIPTION"	    VARCHAR2(20),
  "DESCR_KEY"       VARCHAR2(50) NOT NULL,
  "ICON"            VARCHAR2(50),
CONSTRAINT "PK_USERRATINGS" PRIMARY KEY ("USERRATINGID")
)
/

create table TABVIEWS (
TABVIEWID            INTEGER                        not null,
UNIQUENAME           VARCHAR2(128)                   not null,
FLAG                 INTEGER,
STATUS               INTEGER,
VIEWTYPEID           INTEGER,
ENABLED              INTEGER,
HIDE                 INTEGER,
constraint PK_TABVIEWS primary key (TABVIEWID)
)
/

alter table USERDOCHISTORIES
   add constraint FK_USERDOCHISTORIES1 foreign key (DOCUMENTID)
      references DOCUMENTS (DOCUMENTID)
/

alter table USERDOCHISTORIES
   add constraint FK_USERDOCHISTORIES2 foreign key (USERID)
      references USERS (USERID)
/

alter table USERCATFAVORITES
   add constraint FK_USERCATFAVORITES1 foreign key (CATEGORYID)
      references CATEGORIES (CATEGORYID)
/

alter table USERCATFAVORITES
   add constraint FK_USERCATFAVORITES2 foreign key (USERID)
      references USERS (USERID)
/

alter table USERDOCFAVORITES
   add constraint FK_USERDOCFAVORITES1 foreign key (DOCUMENTID)
      references DOCUMENTS (DOCUMENTID)
/

alter table USERDOCFAVORITES
   add constraint FK_USERDOCFAVORITES2 foreign key (USERID)
      references USERS (USERID)
/

alter table ADDITIONALDOCUMENTFORMATS
   add constraint FK_DOCTYPES2 foreign key (DOCTYPEID)
      references DOCUMENTTYPES (DOCTYPEID)
/

alter table ADDITIONALDOCUMENTFORMATS
   add constraint FK_DOCUMENTS5 foreign key (DOCUMENTID)
      references DOCUMENTS (DOCUMENTID)
/

alter table ALLOWEDDOCUMENTTYPES
   add constraint FK_CATEGORIES4 foreign key (CATEGORYID)
      references CATEGORIES (CATEGORYID)
/

alter table ALLOWEDDOCUMENTTYPES
   add constraint FK_DOCTYPES foreign key (DOCTYPEID)
      references DOCUMENTTYPES (DOCTYPEID)
/

alter table CATEGORIES
   add constraint FK_CATEGORIES6 foreign key (PARENTCATEGORYID)
      references CATEGORIES (CATEGORYID)
/

alter table CATEGORYDOCUMENTS
   add constraint FK_CATEGORIES foreign key (CATEGORYID)
      references CATEGORIES (CATEGORYID)
/

alter table CATEGORYKEYWORDS
   add constraint FK_CATEGORIES3 foreign key (CATEGORYID)
      references CATEGORIES (CATEGORYID)
/

alter table DOCUMENTACLS
   add constraint FK_ACLTYPES foreign key (ACLTYPEID)
      references ACLTYPES (ACLTYPEID)
/

alter table DOCUMENTACLS
   add constraint FK_PERMISSIONS foreign key (PERMISSIONID)
      references PERMISSIONS (PERMISSIONID)
/

alter table DOCUMENTS
   add constraint FK_DOCUMENTCLASSES foreign key (DOCCLASSID)
      references DOCUMENTCLASSES (DOCCLASSID)
/

alter table DOCUMENTS
   add constraint FK_DOCUMENTFLAGS foreign key (FLAG)
      references DOCUMENTFLAGS (FLAG)
/

alter table DOCUMENTS
   add constraint FK_DOCUMENTSTATI foreign key (STATUS)
      references DOCUMENTSTATI (STATUS)
/

alter table CONVERTER
   add constraint FK_CONVERTERTIMING foreign key (TIMINGID)
      references CONVERTERTIMING (ID)
/

alter table USERGROUPS
   add constraint FK_GROUPS foreign key (GROUPID)
      references GROUPS (GROUPID)
/

alter table USERGROUPS
   add constraint FK_USERS foreign key (USERID)
      references USERS (USERID)
/

alter table USERREGISTEREDCATEGORIES
   add constraint FK_CATEGORIES2 foreign key (CATEGORYID)
      references CATEGORIES (CATEGORYID)
/

alter table USERREGISTEREDCATEGORIES
   add constraint FK_USERS3 foreign key (USERID)
      references USERS (USERID)
/

alter table USERREGSEARCHQUERIES
   add constraint FK_USERS4 foreign key (USERID)
      references USERS (USERID)
/

alter table ldapUsers
   add constraint FK_LDAPSERVERS foreign key (ldapServerId)
      references ldapServers (ldapServerId)
/

alter table ldapGroups
   add constraint FK_LDAPSERVERS2 foreign key (ldapServerId)
      references ldapServers (ldapServerId)
/

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

insert into ACLTYPES
            (ACLTYPEID, NAME, RANK, DESCRIPTION, DEFACLONLY, IDREQUIRED)
     values (2, 'group', 2, 'acl type group', 0, 1)
/

insert into ACLTYPES
            (ACLTYPEID, NAME, RANK, DESCRIPTION, DEFACLONLY, IDREQUIRED)
     values (3, 'anyother', 3, 'acl type anyother', 0, 0)
/

insert into ACLTYPES
            (ACLTYPEID, NAME, RANK, DESCRIPTION, DEFACLONLY, IDREQUIRED)
     values (4, 'mask', 4, 'acl type mask', 0, 0)
/

insert into ACLTYPES
            (ACLTYPEID, NAME, RANK, DESCRIPTION, DEFACLONLY, IDREQUIRED)
     values (5, 'owner', 0, 'acl type owner', 1, 0)
/

insert into ACLTYPES
            (ACLTYPEID, NAME, RANK, DESCRIPTION, DEFACLONLY, IDREQUIRED)
     values (6, 'ldap-user', 5, 'acl type ldap-user', 0, 1)
/

insert into ACLTYPES
            (ACLTYPEID, NAME, RANK, DESCRIPTION, DEFACLONLY, IDREQUIRED)
     values (7, 'ldap-group', 6, 'acl type ldap-group', 0, 1)
/

insert into ACLTYPES
            (ACLTYPEID, NAME, RANK, DESCRIPTION, DEFACLONLY, IDREQUIRED)
     values (8, 'unauthenticated', 7, 'acl type unauthenticated', 0, 0)
/

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

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

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

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

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

insert into PERMISSIONS
            (PERMISSIONID, CONTEXT, TOKEN, NUMVALUE, PRINTSTRING, DESCRIPTION, ENABLED)
     values (4, 'category', 'd', '8', 'delete documents', 'Context Category: delete documents permission', 1)
/

insert into PERMISSIONS
            (PERMISSIONID, CONTEXT, TOKEN, NUMVALUE, PRINTSTRING, DESCRIPTION, ENABLED)
     values (5, 'category', 'D', '16', 'delete category', 'Context CATEGORY: delete category permission', 1)
/

insert into PERMISSIONS
            (PERMISSIONID, CONTEXT, TOKEN, NUMVALUE, PRINTSTRING, DESCRIPTION, ENABLED)
     values (6, 'category', 'C', '32', 'create subcategory', 'Context CATEGORY: create subcategory permission', 1)
/

insert into PERMISSIONS
            (PERMISSIONID, CONTEXT, TOKEN, NUMVALUE, PRINTSTRING, DESCRIPTION, ENABLED)
     values (7, 'category', 'L', '64', 'create link to category', 'Context CATEGORY: create link to category permission', 0)
/

insert into PERMISSIONS
            (PERMISSIONID, CONTEXT, TOKEN, NUMVALUE, PRINTSTRING, DESCRIPTION, ENABLED)
     values (8, 'category', 'F', '128', 'follow link to category', 'Context CATEGORY: follow link to category permission', 0)
/

insert into PERMISSIONS
            (PERMISSIONID, CONTEXT, TOKEN, NUMVALUE, PRINTSTRING, DESCRIPTION, ENABLED)
     values (9, 'category', 'l', '256', 'create link to document', 'Context CATEGORY: create link to document permission', 0)
/

insert into PERMISSIONS
            (PERMISSIONID, CONTEXT, TOKEN, NUMVALUE, PRINTSTRING, DESCRIPTION, ENABLED)
     values (10, 'category', 'f', '512', 'follow link to document', 'Context CATEGORY: follow link to document permission', 0)
/

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

insert into PERMISSIONS
            (PERMISSIONID, CONTEXT, TOKEN, NUMVALUE, PRINTSTRING, DESCRIPTION, ENABLED)
     values (12, 'document', 'r', '2', 'read document', 'Context DOCUMENT: read document permission', 1)
/

insert into PERMISSIONS
            (PERMISSIONID, CONTEXT, TOKEN, NUMVALUE, PRINTSTRING, DESCRIPTION, ENABLED)
     values (13, 'document', 'w', '4', 'write document', 'Context DOCUMENT: write document permission', 1)
/

insert into PERMISSIONS
            (PERMISSIONID, CONTEXT, TOKEN, NUMVALUE, PRINTSTRING, DESCRIPTION, ENABLED)
     values (14, 'document', 'M', '8', 'move document', 'Context DOCUMENT: move document permission', 1)
/

insert into PERMISSIONS
            (PERMISSIONID, CONTEXT, TOKEN, NUMVALUE, PRINTSTRING, DESCRIPTION, ENABLED)
     values (15, 'document', 'D', '16', 'delete document', 'Context DOCUMENT: delete document permission', 1)
/

insert into PERMISSIONS
            (PERMISSIONID, CONTEXT, TOKEN, NUMVALUE, PRINTSTRING, DESCRIPTION, ENABLED)
     values (16, 'category', 'i', '1024', 'insert document', 'Context CATEGORY: insert document permission', 0)
/

insert into DEFAULTCATACLS
            (ACLENTRYID, STARTCATID, ACLTYPEID, ACCESSORID, PERMISSIONID, CREATED, CREATORID)
     values (1, 1, 5, 0, 1, SYSDATE, 1)
/

insert into DEFAULTCATACLS
            (ACLENTRYID, STARTCATID, ACLTYPEID, ACCESSORID, PERMISSIONID, CREATED, CREATORID)
     values (2, 1, 5, 0, 2, SYSDATE, 1)
/

insert into DEFAULTCATACLS
            (ACLENTRYID, STARTCATID, ACLTYPEID, ACCESSORID, PERMISSIONID, CREATED, CREATORID)
     values (3, 1, 5, 0, 3, SYSDATE, 1)
/

insert into DEFAULTCATACLS
            (ACLENTRYID, STARTCATID, ACLTYPEID, ACCESSORID, PERMISSIONID, CREATED, CREATORID)
     values (4, 1, 5, 0, 19, SYSDATE, 1)
/

insert into DEFAULTCATACLS
            (ACLENTRYID, STARTCATID, ACLTYPEID, ACCESSORID, PERMISSIONID, CREATED, CREATORID)
     values (5, 1, 5, 0, 4, SYSDATE, 1)
/

insert into DEFAULTCATACLS
            (ACLENTRYID, STARTCATID, ACLTYPEID, ACCESSORID, PERMISSIONID, CREATED, CREATORID)
     values (6, 1, 5, 0, 5, SYSDATE, 1)
/

insert into DEFAULTCATACLS
            (ACLENTRYID, STARTCATID, ACLTYPEID, ACCESSORID, PERMISSIONID, CREATED, CREATORID)
     values (7, 1, 5, 0, 6, SYSDATE, 1)
/

insert into DEFAULTCATACLS
            (ACLENTRYID, STARTCATID, ACLTYPEID, ACCESSORID, PERMISSIONID, CREATED, CREATORID)
     values (8, 1, 5, 0, 7, SYSDATE, 1)
/

insert into DEFAULTCATACLS
            (ACLENTRYID, STARTCATID, ACLTYPEID, ACCESSORID, PERMISSIONID, CREATED, CREATORID)
     values (9, 1, 5, 0, 8, SYSDATE, 1)
/

insert into DEFAULTCATACLS
            (ACLENTRYID, STARTCATID, ACLTYPEID, ACCESSORID, PERMISSIONID, CREATED, CREATORID)
     values (10, 1, 5, 0, 9, SYSDATE, 1)
/

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

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

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

insert into DOCUMENTFLAGS
            (FLAG, DESCRIPTION)
     values (3, 'to be published')
/

insert into DOCUMENTSTATI
            (STATUS, DESC_KEY, REMARK)
     values (0, 'vkc.documentstati.none', null)
/

insert into DOCUMENTSTATI
            (STATUS, DESC_KEY, REMARK)
     values (1, 'vkc.documentstati.draft', null)
/

insert into DOCUMENTSTATI
            (STATUS, DESC_KEY, REMARK)
     values (2, 'vkc.documentstati.released', null)
/

insert into DOCUMENTSTATI
            (STATUS, DESC_KEY, REMARK)
     values (3, 'vkc.documentstati.confidential', null)
/

insert into DOCUMENTSTATI
            (STATUS, DESC_KEY, REMARK)
     values (4, 'vkc.documentstati.final', null)
/

insert into DOCUMENTTYPES
            (DOCTYPEID, EXTENSION, DESCRIPTION, DESCRIPTION_SHORT, INTERNAL, MIMETYPE, IMGPATH, ICON_EXTENSION, CONVERTIBLE, EDITABLE)
     values (0, '?', 'undefined', 'undefined', 1, '?', '/gfx/documenttype/document', 'gif', 0, 0)
/

insert into DOCUMENTTYPES
            (DOCTYPEID, EXTENSION, DESCRIPTION, DESCRIPTION_SHORT, INTERNAL, MIMETYPE, IMGPATH, ICON_EXTENSION, CONVERTIBLE, EDITABLE)
     values (1, 'TXT', 'Generic ASCII Text', 'ASCII document', 0, 'text/plain', '/gfx/documenttype/txt', 'gif', 1, 0)
/

insert into DOCUMENTTYPES
            (DOCTYPEID, EXTENSION, DESCRIPTION, DESCRIPTION_SHORT, INTERNAL, MIMETYPE, IMGPATH, ICON_EXTENSION, CONVERTIBLE, EDITABLE)
     values (2, 'PDF', 'Adobe Portable Document Format', 'PDF document', 0, 'application/pdf', '/gfx/documenttype/pdf', 'gif', 1, 0)
/

insert into DOCUMENTTYPES
            (DOCTYPEID, EXTENSION, DESCRIPTION, DESCRIPTION_SHORT, INTERNAL, MIMETYPE, IMGPATH, ICON_EXTENSION, CONVERTIBLE, EDITABLE)
     values (3, 'DOC', 'Microsoft Winword Document', 'Winword document', 0, 'application/msword', '/gfx/documenttype/doc', 'gif', 1, 1)
/

insert into DOCUMENTTYPES
            (DOCTYPEID, EXTENSION, DESCRIPTION, DESCRIPTION_SHORT, INTERNAL, MIMETYPE, IMGPATH, ICON_EXTENSION, CONVERTIBLE, EDITABLE)
     values (4, 'HTML', 'Hypertext Markup Language Document', 'HTML document', 0, 'text/html', '/gfx/documenttype/html', 'gif', 1, 0)
/

insert into DOCUMENTTYPES
            (DOCTYPEID, EXTENSION, DESCRIPTION, DESCRIPTION_SHORT, INTERNAL, MIMETYPE, IMGPATH, ICON_EXTENSION, CONVERTIBLE, EDITABLE)
     values (5, 'PS', 'Postscript Document', 'Postscript document', 0, 'application/postscript', '/gfx/documenttype/ps', 'gif', 1, 0)
/

insert into DOCUMENTTYPES
            (DOCTYPEID, EXTENSION, DESCRIPTION, DESCRIPTION_SHORT, INTERNAL, MIMETYPE, IMGPATH, ICON_EXTENSION, CONVERTIBLE, EDITABLE)
     values (6, 'PPT', 'Microsoft Powerpoint Document', 'PPT document', 0, 'application/vnd.ms-powerpoint', '/gfx/documenttype/ppt', 'gif', 1, 1)
/

insert into DOCUMENTTYPES
            (DOCTYPEID, EXTENSION, DESCRIPTION, DESCRIPTION_SHORT, INTERNAL, MIMETYPE, IMGPATH, ICON_EXTENSION, CONVERTIBLE, EDITABLE)
     values (7, 'XLS', 'Microsoft Excel Document', 'Excel document', 0, 'application/vnd.ms-excel', '/gfx/documenttype/xls', 'gif', 1, 1)
/

insert into DOCUMENTTYPES
            (DOCTYPEID, EXTENSION, DESCRIPTION, DESCRIPTION_SHORT, INTERNAL, MIMETYPE, IMGPATH, ICON_EXTENSION, CONVERTIBLE, EDITABLE)
     values (8, 'RTF', 'Rich Text Format Document', 'RTF document', 0, 'application/rtf', '/gfx/documenttype/rtf', 'gif', 1, 1)
/

insert into DOCUMENTTYPES
            (DOCTYPEID, EXTENSION, DESCRIPTION, DESCRIPTION_SHORT, INTERNAL, MIMETYPE, IMGPATH, ICON_EXTENSION, CONVERTIBLE, EDITABLE)
     values (9, 'WPD', 'Word Perfect Document', 'WPD document', 0, 'application/wordperfect5.1', '/gfx/documenttype/wpd', 'gif', 1, 0)
/

insert into DOCUMENTTYPES
            (DOCTYPEID, EXTENSION, DESCRIPTION, DESCRIPTION_SHORT, INTERNAL, MIMETYPE, IMGPATH, ICON_EXTENSION, CONVERTIBLE, EDITABLE)
     values (10, 'TDF', 'Typography Description Format Document', 'TDF document', 1, 'application/tdf', '/gfx/documenttype/tdf', 'gif', 0, 0)
/

insert into DOCUMENTTYPES
            (DOCTYPEID, EXTENSION, DESCRIPTION, DESCRIPTION_SHORT, INTERNAL, MIMETYPE, IMGPATH, ICON_EXTENSION, CONVERTIBLE, EDITABLE)
     values (11, 'NOTE', 'Note', 'Note', 0, null, '/gfx/documenttype/note', 'gif', 0, 0)
/

insert into DOCUMENTTYPES
            (DOCTYPEID, EXTENSION, DESCRIPTION, DESCRIPTION_SHORT, INTERNAL, MIMETYPE, IMGPATH, ICON_EXTENSION, CONVERTIBLE, EDITABLE)
     values (12, 'LINK', 'Link', 'Link', 0, null, '/gfx/documenttype/link', 'gif', 1, 0)
/

insert into DOCUMENTTYPES
            (DOCTYPEID, EXTENSION, DESCRIPTION, DESCRIPTION_SHORT, INTERNAL, MIMETYPE, IMGPATH, ICON_EXTENSION, CONVERTIBLE, EDITABLE)
     values (13, 'GIF', 'Graphics Interchange Format', 'GIF graphic', 0, 'image/gif', '/gfx/documenttype/gif', 'gif', 0, 0)
/

insert into DOCUMENTTYPES
            (DOCTYPEID, EXTENSION, DESCRIPTION, DESCRIPTION_SHORT, INTERNAL, MIMETYPE, IMGPATH, ICON_EXTENSION, CONVERTIBLE, EDITABLE)
     values (14, 'JPG', 'Joint Photographic Experts Group Graphic', 'JPG graphic', 0, 'image/jpeg', '/gfx/documenttype/jpg', 'gif', 0, 0)
/

insert into DOCUMENTTYPES
            (DOCTYPEID, EXTENSION, DESCRIPTION, DESCRIPTION_SHORT, INTERNAL, MIMETYPE, IMGPATH, ICON_EXTENSION, CONVERTIBLE, EDITABLE)
     values (15, 'BMP', 'Bit Map Picture', 'BMP graphic', 0, 'image/bmp', '/gfx/documenttype/bmp', 'gif', 0, 0)
/

insert into DOCUMENTTYPES
            (DOCTYPEID, EXTENSION, DESCRIPTION, DESCRIPTION_SHORT, INTERNAL, MIMETYPE, IMGPATH, ICON_EXTENSION, CONVERTIBLE, EDITABLE)
     values (16, 'PNG', 'Portable Network Graphics', 'PNG graphic', 0, 'image/png', '/gfx/documenttype/png', 'gif', 0, 0)
/

insert into DOCUMENTTYPES
            (DOCTYPEID, EXTENSION, DESCRIPTION, DESCRIPTION_SHORT, INTERNAL, MIMETYPE, IMGPATH, ICON_EXTENSION, CONVERTIBLE, EDITABLE)
     values (17, 'EXE', 'Executable', 'EXE file', 0, 'application/octet-stream', '/gfx/documenttype/exe', 'gif', 0, 0)
/

insert into DOCUMENTTYPES
            (DOCTYPEID, EXTENSION, DESCRIPTION, DESCRIPTION_SHORT, INTERNAL, MIMETYPE, IMGPATH, ICON_EXTENSION, CONVERTIBLE, EDITABLE)
     values (18, 'ZIP', 'ZIP File', 'ZIP file', 0, 'application/zip', '/gfx/documenttype/zip', 'gif', 0, 0)
/

insert into DOCUMENTTYPES
            (DOCTYPEID, EXTENSION, DESCRIPTION, DESCRIPTION_SHORT, INTERNAL, MIMETYPE, IMGPATH, ICON_EXTENSION, CONVERTIBLE, EDITABLE)
     values (19, 'XML', 'Extensible Markup Language File', 'XML file', 0, 'text/xml', '/gfx/documenttype/xml', 'gif', 0, 0)
/

insert into DOCUMENTTYPES
            (DOCTYPEID, EXTENSION, DESCRIPTION, DESCRIPTION_SHORT, INTERNAL, MIMETYPE, IMGPATH, ICON_EXTENSION, CONVERTIBLE, EDITABLE)
     values (20, 'EML', 'Email File', 'EML file', 0, 'message/rfc822', '/gfx/documenttype/eml', 'gif', 1, 0)
/

insert into DOCUMENTTYPES
            (DOCTYPEID, EXTENSION, DESCRIPTION, DESCRIPTION_SHORT, INTERNAL, MIMETYPE, IMGPATH, ICON_EXTENSION, CONVERTIBLE, EDITABLE)
     values (21, 'MSG', 'Outlook Email File', 'MSG file', 0, 'application/vnd.ms-outlook', '/gfx/documenttype/msg', 'gif', 1, 0)
/

insert into DOCUMENTTYPES
            (DOCTYPEID, EXTENSION, DESCRIPTION, DESCRIPTION_SHORT, INTERNAL, MIMETYPE, IMGPATH, ICON_EXTENSION, CONVERTIBLE, EDITABLE)
     values (22, 'HTM', 'Hypertext Markup Language Document', 'HTM document', 0, 'text/html', '/gfx/documenttype/htm', 'gif', 1, 0)
/

insert into DOCUMENTTYPES
            (DOCTYPEID, EXTENSION, DESCRIPTION, DESCRIPTION_SHORT, INTERNAL, MIMETYPE, IMGPATH, ICON_EXTENSION, CONVERTIBLE, EDITABLE)
     values (23, 'TEX', 'TeX Document', 'TeX document', 0, 'application/x-tex', '/gfx/documenttype/tex', 'gif', 1, 0)
/

insert into DOCUMENTTYPES
            (DOCTYPEID, EXTENSION, DESCRIPTION, DESCRIPTION_SHORT, INTERNAL, MIMETYPE, IMGPATH, ICON_EXTENSION, CONVERTIBLE, EDITABLE)
     values (24, 'SXI', 'StarOffice Presentation', 'SXI Document', 0, 'application/sxi', '/gfx/documenttype/sxi', 'gif', 0, 0)
/

insert into DOCUMENTTYPES
            (DOCTYPEID, EXTENSION, DESCRIPTION, DESCRIPTION_SHORT, INTERNAL, MIMETYPE, IMGPATH, ICON_EXTENSION, CONVERTIBLE, EDITABLE)
     values (25, 'SXW', 'StarOffice Write Document', 'SXW document', 0, 'application/sxw', '/gfx/documenttype/sxw', 'gif', 0, 0)
/

insert into DOCUMENTTYPES
            (DOCTYPEID, EXTENSION, DESCRIPTION, DESCRIPTION_SHORT, INTERNAL, MIMETYPE, IMGPATH, ICON_EXTENSION, CONVERTIBLE, EDITABLE)
     values (26, 'SXC', 'StarOffice Tabel Calculation Document', 'SXC document', 0, 'application/sxc', '/gfx/documenttype/sxc', 'gif', 0, 0)
/

insert into DOCUMENTTYPES
            (DOCTYPEID, EXTENSION, DESCRIPTION, DESCRIPTION_SHORT, INTERNAL, MIMETYPE, IMGPATH, ICON_EXTENSION, CONVERTIBLE, EDITABLE)
     values (27, 'FH8', 'Bildformat für "Free Hand"', 'FH8 Document', 0, 'application/fh8', '/gfx/documenttype/fh8', 'gif', 0, 0)
/

insert into DOCUMENTTYPES
            (DOCTYPEID, EXTENSION, DESCRIPTION, DESCRIPTION_SHORT, INTERNAL, MIMETYPE, IMGPATH, ICON_EXTENSION, CONVERTIBLE, EDITABLE)
     values (28, 'FH11', 'Bildformat für "Free Hand"', 'FH11 Document', 0, 'application/fh11', '/gfx/documenttype/fh11', 'gif', 0, 0)
/

insert into DOCUMENTTYPES
            (DOCTYPEID, EXTENSION, DESCRIPTION, DESCRIPTION_SHORT, INTERNAL, MIMETYPE, IMGPATH, ICON_EXTENSION, CONVERTIBLE, EDITABLE)
     values (29, 'ODT', 'OpenOffice Textdatei', 'OpenOffice Textdatei', 0, 'application/odt', '/gfx/documenttype/odt', 'gif', 0, 0)
/

insert into DOCUMENTCLASSES
            (DOCCLASSID, NAME_KEY, DESCR_KEY)
     values (0, 'vkc.documentclass.none', '')
/

insert into DOCUMENTCLASSES
            (DOCCLASSID, NAME_KEY, DESCR_KEY)
     values (1, 'vkc.documentclass.report', '')
/

insert into DOCUMENTCLASSES
            (DOCCLASSID, NAME_KEY, DESCR_KEY)
     values (2, 'vkc.documentclass.memo', '')
/

insert into DOCUMENTCLASSES
            (DOCCLASSID, NAME_KEY, DESCR_KEY)
     values (3, 'vkc.documentclass.protocol', '')
/

insert into DOCUMENTCLASSES
            (DOCCLASSID, NAME_KEY, DESCR_KEY)
     values (4, 'vkc.documentclass.status', '')
/

insert into DOCUMENTCLASSES
            (DOCCLASSID, NAME_KEY, DESCR_KEY)
     values (5, 'vkc.documentclass.offer', '')
/

insert into DOCUMENTCLASSES
            (DOCCLASSID, NAME_KEY, DESCR_KEY)
     values (6, 'vkc.documentclass.bill', '')
/

insert into DOCUMENTCLASSES
            (DOCCLASSID, NAME_KEY, DESCR_KEY)
     values (7, 'vkc.documentclass.balance', '')
/

insert into DOCUMENTCLASSES
            (DOCCLASSID, NAME_KEY, DESCR_KEY)
     values (8, 'vkc.documentclass.requirement', '')
/

insert into DOCUMENTCLASSES
            (DOCCLASSID, NAME_KEY, DESCR_KEY)
     values (9, 'vkc.documentclass.data', '')
/

insert into DOCUMENTCLASSES
			(DOCCLASSID, NAME_KEY, DESCR_KEY)
	 values (10, 'vkc.documentclass.instruction', '')
/

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

insert into GROUPS
            (GROUPID, NAME, DESCRIPTION, ACCOUNTVALID, ADMINPRIVILEGES, VALIDFROM, VALIDUNTIL, CREATED, CREATORID, LASTCHANGED, LASTCHANGERID)
     values (2, 'public', 'Default group', 1, 0, null, null, null, null, null, null)
/

insert into LANGUAGES
            (LANGUAGEID, NAME, NAME_KEY, SHORTNAME, ISOCODE, DEFAULTLANGUAGE)
     values (1, 'Deutsch', 'vkc.language.german', 'de', 'ISO8859-1', 1)
/

insert into LANGUAGES
            (LANGUAGEID, NAME, NAME_KEY, SHORTNAME, ISOCODE, DEFAULTLANGUAGE)
     values (2, 'English', 'vkc.language.english', 'en', 'ISO8859-1', 0)
/

insert into LANGUAGEPACKS
            (LANGPACKID, COUNTRYCODE, NAME, DESCRIPTION, CLASSNAME, CLASSPATH, ENABLED)
     values (0, ' ', 'Language Pack: unkown', 'unkown', ' ', ' ', 1)
/

insert into LANGUAGEPACKS
            (LANGPACKID, COUNTRYCODE, NAME, DESCRIPTION, CLASSNAME, CLASSPATH, ENABLED)
     values (1, 'de', 'Language Pack: German', 'Analyser Language Pack German', 'vkc.analyse.Analyser_de', 'vkc/analyse', 1)
/

insert into LANGUAGEPACKS
            (LANGPACKID, COUNTRYCODE, NAME, DESCRIPTION, CLASSNAME, CLASSPATH, ENABLED)
     values (2, 'es', 'Language Pack: Spanish', 'Analyser Language Pack Spanish', 'vkc.analyse.Analyser_es', 'vkc/analyse', 1)
/

insert into LANGUAGEPACKS
            (LANGPACKID, COUNTRYCODE, NAME, DESCRIPTION, CLASSNAME, CLASSPATH, ENABLED)
     values (3, 'gb', 'Language Pack: English', 'Analyser Language Pack English', 'vkc.analyse.Analyser_gb', 'vkc/analyse', 1)
/

insert into SYSPARAMETERS
            (SYSPARAMETERID, CONTEXT, CONTEXT_KEY, NAME, NAME_KEY, VALUESTRING, DESCRIPTION, DESCR_KEY, ALLOWNULL, READONLY, HIDE, DATATYPE)
     values (1, 'SYSTEMINFO', 'sysparam.context.systeminfo', 'DBName', 'sysparam.context.systeminfo.dbname', 'VKC.GDB', 'Name of the VKC database', 'sysparam.context.systeminfo.dbname.descr', 0, 1, 0, 0)
/

insert into SYSPARAMETERS
            (SYSPARAMETERID, CONTEXT, CONTEXT_KEY, NAME, NAME_KEY, VALUESTRING, DESCRIPTION, DESCR_KEY, ALLOWNULL, READONLY, HIDE, DATATYPE)
     values (2, 'SYSTEMINFO', 'sysparam.context.systeminfo', 'DBMS', 'sysparam.context.systeminfo.dbms', 'Interbase', 'VKC database management system', 'sysparam.context.systeminfo.dbms.descr', 0, 1, 0, 0)
/

insert into SYSPARAMETERS
            (SYSPARAMETERID, CONTEXT, CONTEXT_KEY, NAME, NAME_KEY, VALUESTRING, DESCRIPTION, DESCR_KEY, ALLOWNULL, READONLY, HIDE, DATATYPE)
     values (3, 'SYSTEMINFO', 'sysparam.context.systeminfo', 'DBCopyright', 'sysparam.context.systeminfo.dbcopyright', 'C-LAB', 'Owner of the db schema', 'sysparam.context.systeminfo.dbcopyright.descr', 0, 1, 0, 0)
/

insert into SYSPARAMETERS
            (SYSPARAMETERID, CONTEXT, CONTEXT_KEY, NAME, NAME_KEY, VALUESTRING, DESCRIPTION, DESCR_KEY, ALLOWNULL, READONLY, HIDE, DATATYPE)
     values (4, 'SYSTEMINFO', 'sysparam.context.systeminfo', 'DBVersionHigh', 'sysparam.context.systeminfo.dbversionhigh', '1', 'Database Version High Number', 'sysparam.context.systeminfo.dbversionhigh.descr', 0, 1, 0, 1)
/

insert into SYSPARAMETERS
            (SYSPARAMETERID, CONTEXT, CONTEXT_KEY, NAME, NAME_KEY, VALUESTRING, DESCRIPTION, DESCR_KEY, ALLOWNULL, READONLY, HIDE, DATATYPE)
     values (5, 'SYSTEMINFO', 'sysparam.context.systeminfo', 'DBVersionLow', 'sysparam.context.systeminfo.dbversionlow', '167', 'Database Version Low Number', 'sysparam.context.systeminfo.dbversionlow.descr', 0, 1, 0, 1)
/

insert into SYSPARAMETERS
            (SYSPARAMETERID, CONTEXT, CONTEXT_KEY, NAME, NAME_KEY, VALUESTRING, DESCRIPTION, DESCR_KEY, ALLOWNULL, READONLY, HIDE, DATATYPE)
     values (6, 'SYSTEMINFO', 'sysparam.context.systeminfo', 'DBCreationDate', 'sysparam.context.systeminfo.dbcreationdate', '2006-02-28', 'Database Creation Date', 'sysparam.context.systeminfo.dbcreationdate.descr', 0, 1, 0, 0)
/

insert into SYSPARAMETERS
            (SYSPARAMETERID, CONTEXT, CONTEXT_KEY, NAME, NAME_KEY, VALUESTRING, DESCRIPTION, DESCR_KEY, ALLOWNULL, READONLY, HIDE, DATATYPE)
     values (7, 'CATEGORYVIEW', 'sysparam.context.categoryview', 'EnableCountCatDocs', 'sysparam.context.categoryview.enablecountcatdocs', '0', 'Enable computation of count of subcats. and docs.', 'sysparam.context.categoryview.enablecountcatdocs.descr', 0, 0, 0, 2)
/

insert into SYSPARAMETERS
            (SYSPARAMETERID, CONTEXT, CONTEXT_KEY, NAME, NAME_KEY, VALUESTRING, DESCRIPTION, DESCR_KEY, ALLOWNULL, READONLY, HIDE, DATATYPE)
     values (8, 'CATEGORYVIEW', 'sysparam.context.categoryview', 'ShowDisplayAscii', 'sysparam.context.categoryview.showdisplayascii', '1', 'Show link to display document in ascii format', 'sysparam.context.categoryview.showdisplayascii.descr', 0, 0, 0, 2)
/

insert into SYSPARAMETERS
            (SYSPARAMETERID, CONTEXT, CONTEXT_KEY, NAME, NAME_KEY, VALUESTRING, DESCRIPTION, DESCR_KEY, ALLOWNULL, READONLY, HIDE, DATATYPE)
     values (9, 'CATEGORYVIEW', 'sysparam.context.categoryview', 'ListAccessibleCategoriesOnly', 'sysparam.context.categoryview.listaccessiblecategoriesonly', '1', 'List only accessible categories', 'sysparam.context.categoryview.listaccessiblecategoriesonly.descr', 0, 0, 0, 2)
/

insert into SYSPARAMETERS
            (SYSPARAMETERID, CONTEXT, CONTEXT_KEY, NAME, NAME_KEY, VALUESTRING, DESCRIPTION, DESCR_KEY, ALLOWNULL, READONLY, HIDE, DATATYPE)
     values (10, 'MAIL', 'sysparam.context.mail', 'AdminEmail', 'sysparam.context.mail.adminemail', 'admin@company.com', 'EMail adress of the administrator', 'sysparam.context.mail.adminemail.descr', 0, 0, 0, 0)
/

insert into SYSPARAMETERS
            (SYSPARAMETERID, CONTEXT, CONTEXT_KEY, NAME, NAME_KEY, VALUESTRING, DESCRIPTION, DESCR_KEY, ALLOWNULL, READONLY, HIDE, DATATYPE)
     values (11, 'MAIL', 'sysparam.context.mail', 'MailServer', 'sysparam.context.mail.mailserver', 'mailserver.company.com', 'Mailservers adress', 'sysparam.context.mail.mailserver.descr', 0, 0, 0, 0)
/

insert into SYSPARAMETERS
            (SYSPARAMETERID, CONTEXT, CONTEXT_KEY, NAME, NAME_KEY, VALUESTRING, DESCRIPTION, DESCR_KEY, ALLOWNULL, READONLY, HIDE, DATATYPE)
     values (12, 'MAIL', 'sysparam.context.mail', 'RootURL', 'sysparam.context.mail.rooturl', 'http://localhost:8080', 'URL of ', 'sysparam.context.mail.rooturl.descr', 0, 0, 0, 0)
/

insert into SYSPARAMETERS
            (SYSPARAMETERID, CONTEXT, CONTEXT_KEY, NAME, NAME_KEY, VALUESTRING, DESCRIPTION, DESCR_KEY, ALLOWNULL, READONLY, HIDE, DATATYPE)
     values (13, 'MAIL', 'sysparam.context.mail', 'DeleteDocumentPeriod', 'sysparam.context.mail.deletedocumentperiod', '28', 'Period of days when document should be deleted', 'sysparam.context.mail.deletedocumentperiod.descr', 0, 0, 0, 1)
/

insert into SYSPARAMETERS
            (SYSPARAMETERID, CONTEXT, CONTEXT_KEY, NAME, NAME_KEY, VALUESTRING, DESCRIPTION, DESCR_KEY, ALLOWNULL, READONLY, HIDE, DATATYPE)
     values (14, 'MAIL', 'sysparam.context.mail', 'CheckExpirationTime', 'sysparam.context.mail.checkexpirationtime', '00:00:00', 'Time, when the expiration thread should be called', 'sysparam.context.mail.checkexpirationtime.descr', 0, 0, 0, 0)
/

insert into SYSPARAMETERS
            (SYSPARAMETERID, CONTEXT, CONTEXT_KEY, NAME, NAME_KEY, VALUESTRING, DESCRIPTION, DESCR_KEY, ALLOWNULL, READONLY, HIDE, DATATYPE)
     values (15, 'MAIL', 'sysparam.context.mail', 'EnableMail', 'sysparam.context.mail.enablemail', '1', 'Enable Mail', 'sysparam.context.mail.enablemail.descr', 0, 0, 0, 2)
/

insert into SYSPARAMETERS
            (SYSPARAMETERID, CONTEXT, CONTEXT_KEY, NAME, NAME_KEY, VALUESTRING, DESCRIPTION, DESCR_KEY, ALLOWNULL, READONLY, HIDE, DATATYPE)
     values (16, 'LOGGING', 'sysparam.context.logging', 'AccessLogFile', 'sysparam.context.logging.accesslogfile', 'c:/temp/vkc_access.log', 'File for logging access of VKC', 'sysparam.context.logging.accesslogfile.descr', 0, 0, 0, 0)
/

insert into SYSPARAMETERS
            (SYSPARAMETERID, CONTEXT, CONTEXT_KEY, NAME, NAME_KEY, VALUESTRING, DESCRIPTION, DESCR_KEY, ALLOWNULL, READONLY, HIDE, DATATYPE)
     values (18, 'LOGGING', 'sysparam.context.logging', 'InfoLogFile', 'sysparam.context.logging.infologfile', 'c:/temp/vkc_info.log', 'File for logging infos of VKC', 'sysparam.context.logging.infologfile.descr', 0, 0, 0, 0)
/

insert into SYSPARAMETERS
            (SYSPARAMETERID, CONTEXT, CONTEXT_KEY, NAME, NAME_KEY, VALUESTRING, DESCRIPTION, DESCR_KEY, ALLOWNULL, READONLY, HIDE, DATATYPE)
     values (19, 'LOGGING', 'sysparam.context.logging', 'ErrorLogFile', 'sysparam.context.logging.errorlogfile', 'c:/temp/vkc_error.log', 'File for logging errors of VKC', 'sysparam.context.logging.errorlogfile.descr', 0, 0, 0, 0)
/

insert into SYSPARAMETERS
            (SYSPARAMETERID, CONTEXT, CONTEXT_KEY, NAME, NAME_KEY, VALUESTRING, DESCRIPTION, DESCR_KEY, ALLOWNULL, READONLY, HIDE, DATATYPE)
     values (20, 'LOGGING', 'sysparam.context.logging', 'MaxLogFileCount', 'sysparam.context.logging.maxlogfilecount', '1', '', 'sysparam.context.logging.maxlogfilecount.descr', 0, 0, 0, 1)
/

insert into SYSPARAMETERS
            (SYSPARAMETERID, CONTEXT, CONTEXT_KEY, NAME, NAME_KEY, VALUESTRING, DESCRIPTION, DESCR_KEY, ALLOWNULL, READONLY, HIDE, DATATYPE)
     values (21, 'LOGGING', 'sysparam.context.logging', 'MaxLogFileSize', 'sysparam.context.logging.maxlogfilesize', '1000000', '', 'sysparam.context.logging.maxlogfilesize.descr', 0, 0, 0, 1)
/

insert into SYSPARAMETERS
            (SYSPARAMETERID, CONTEXT, CONTEXT_KEY, NAME, NAME_KEY, VALUESTRING, DESCRIPTION, DESCR_KEY, ALLOWNULL, READONLY, HIDE, DATATYPE)
     values (22, 'LOGGING', 'sysparam.context.logging', 'EnableLogging', 'sysparam.context.logging.enablelogging', '1', '', 'sysparam.context.logging.enablelogging.descr', 0, 0, 0, 2)
/

insert into SYSPARAMETERS
            (SYSPARAMETERID, CONTEXT, CONTEXT_KEY, NAME, NAME_KEY, VALUESTRING, DESCRIPTION, DESCR_KEY, ALLOWNULL, READONLY, HIDE, DATATYPE)
     values (23, 'LOGGING', 'sysparam.context.logging', 'LoggingLevel', 'sysparam.context.logging.logginglevel', '1', '', 'sysparam.context.logging.logginglevel.descr', 0, 0, 0, 1)
/

insert into SYSPARAMETERS
            (SYSPARAMETERID, CONTEXT, CONTEXT_KEY, NAME, NAME_KEY, VALUESTRING, DESCRIPTION, DESCR_KEY, ALLOWNULL, READONLY, HIDE, DATATYPE)
     values (24, 'SYSTEMPATHS', 'sysparam.context.systempaths', 'DatastoreDir', 'sysparam.context.systempaths.datastoredir', 'WEB-INF/datastorage', '', 'sysparam.context.systempaths.datastoredir.descr', 0, 0, 0, 0)
/

insert into SYSPARAMETERS
            (SYSPARAMETERID, CONTEXT, CONTEXT_KEY, NAME, NAME_KEY, VALUESTRING, DESCRIPTION, DESCR_KEY, ALLOWNULL, READONLY, HIDE, DATATYPE)
     values (25, 'SYSTEMPATHS', 'sysparam.context.systempaths', 'SearchIndexDir', 'sysparam.context.systempaths.searchindexdir', 'WEB-INF/searchindex', '', 'sysparam.context.systempaths.searchindexdir.descr', 0, 0, 0, 0)
/

insert into SYSPARAMETERS
            (SYSPARAMETERID, CONTEXT, CONTEXT_KEY, NAME, NAME_KEY, VALUESTRING, DESCRIPTION, DESCR_KEY, ALLOWNULL, READONLY, HIDE, DATATYPE)
     values (26, 'SYSTEMPATHS', 'sysparam.context.systempaths', 'ClassifyIndexDir', 'sysparam.context.systempaths.classifyindexdir', 'WEB-INF/classifyindex', '', 'sysparam.context.systempaths.classifyindexdir.descr', 0, 0, 0, 0)
/

insert into SYSPARAMETERS
            (SYSPARAMETERID, CONTEXT, CONTEXT_KEY, NAME, NAME_KEY, VALUESTRING, DESCRIPTION, DESCR_KEY, ALLOWNULL, READONLY, HIDE, DATATYPE)
     values (27, 'SYSTEMPATHS', 'sysparam.context.systempaths', 'ConverterDir', 'sysparam.context.systempaths.converterdir', 'WEB-INF/bin/win32', '', 'sysparam.context.systempaths.converterdir.descr', 0, 0, 0, 0)
/

insert into SYSPARAMETERS
            (SYSPARAMETERID, CONTEXT, CONTEXT_KEY, NAME, NAME_KEY, VALUESTRING, DESCRIPTION, DESCR_KEY, ALLOWNULL, READONLY, HIDE, DATATYPE)
     values (28, 'SYSTEMPATHS', 'sysparam.context.systempaths', 'LanguageDir', 'sysparam.context.systempaths.languagedir', 'lang', '', 'sysparam.context.systempaths.languagedir.descr', 0, 0, 0, 0)
/

insert into SYSPARAMETERS
            (SYSPARAMETERID, CONTEXT, CONTEXT_KEY, NAME, NAME_KEY, VALUESTRING, DESCRIPTION, DESCR_KEY, ALLOWNULL, READONLY, HIDE, DATATYPE)
     values (33, 'LOGIN', 'sysparam.context.login', 'EnableUserRegistration', 'sysparam.context.login.enableuserregistration', '0', 'Enable self registration for a user', 'sysparam.context.login.enableuserregistration.descr', 0, 0, 0, 2)
/

insert into SYSPARAMETERS
            (SYSPARAMETERID, CONTEXT, CONTEXT_KEY, NAME, NAME_KEY, VALUESTRING, DESCRIPTION, DESCR_KEY, ALLOWNULL, READONLY, HIDE, DATATYPE)
     values (34, 'LOGIN', 'sysparam.context.login', 'EnableGuestLogin', 'sysparam.context.login.enableguestlogin', '0', 'Enable login for a guest user', 'sysparam.context.login.enableguestlogin.descr', 0, 0, 0, 2)
/

insert into SYSPARAMETERS
            (SYSPARAMETERID, CONTEXT, CONTEXT_KEY, NAME, NAME_KEY, VALUESTRING, DESCRIPTION, DESCR_KEY, ALLOWNULL, READONLY, HIDE, DATATYPE)
     values (37, 'QUOTA', 'sysparam.context.quota', 'EnableQuotaChecking', 'sysparam.context.quota.enablequotachecking', '1', 'Enables checking for quota', 'sysparam.context.quota.enablequotachecking.descr', 0, 0, 0, 2)
/

insert into SYSPARAMETERS
            (SYSPARAMETERID, CONTEXT, CONTEXT_KEY, NAME, NAME_KEY, VALUESTRING, DESCRIPTION, DESCR_KEY, ALLOWNULL, READONLY, HIDE, DATATYPE)
     values (38, 'ARCHIVE', 'sysparam.context.archive', 'CleaningPeriod', 'sysparam.context.archive.cleaningperiod', 7, 'Cleaning period of the data archive in days', 'sysparam.context.archive.cleaningperiod.descr', 0, 0, 0, 1)
/

insert into SYSPARAMETERS
            (SYSPARAMETERID, CONTEXT, CONTEXT_KEY, NAME, NAME_KEY, VALUESTRING, DESCRIPTION, DESCR_KEY, ALLOWNULL, READONLY, HIDE, DATATYPE)
     values (39, 'ARCHIVE', 'sysparam.context.archive', 'MinimumAge', 'sysparam.context.archive.minimumage', 30, 'Minimum Age of files can be deleted in minutes', 'sysparam.context.archive.minimumage.descr', 0, 0, 0, 1)
/

insert into SYSPARAMETERS
            (SYSPARAMETERID, CONTEXT, CONTEXT_KEY, NAME, NAME_KEY, VALUESTRING, DESCRIPTION, DESCR_KEY, ALLOWNULL, READONLY, HIDE, DATATYPE)
     values (40, 'ARCHIVE', 'sysparam.context.archive', 'StartBackupHour', 'sysparam.context.archive.startbackuphour', 0, 'Scheduling hour for backup (start)', 'sysparam.context.archive.startbackuphour.descr', 0, 0, 0, 1)
/

insert into SYSPARAMETERS
            (SYSPARAMETERID, CONTEXT, CONTEXT_KEY, NAME, NAME_KEY, VALUESTRING, DESCRIPTION, DESCR_KEY, ALLOWNULL, READONLY, HIDE, DATATYPE)
     values (41, 'ARCHIVE', 'sysparam.context.archive', 'EndBackupHour', 'sysparam.context.archive.endbackuphour', 3, 'Scheduling hour for backup (end)', 'sysparam.context.archive.endbackuphour.descr', 0, 0, 0, 1)
/

insert into SYSPARAMETERS
            (SYSPARAMETERID, CONTEXT, CONTEXT_KEY, NAME, NAME_KEY, VALUESTRING, DESCRIPTION, DESCR_KEY, ALLOWNULL, READONLY, HIDE, DATATYPE)
     values (42, 'ARCHIVECATEGORY', 'sysparam.context.archivecategory', 'EnableArchiveCategory', 'sysparam.context.archivecategory.enablearchivecategory', '0', 'Enable archive (zipping) of a category', 'sysparam.context.archivecategory.enablearchivecategory.descr', 0, 0, 0, 2)
/

insert into SYSPARAMETERS
            (SYSPARAMETERID, CONTEXT, CONTEXT_KEY, NAME, NAME_KEY, VALUESTRING, DESCRIPTION, DESCR_KEY, ALLOWNULL, READONLY, HIDE, DATATYPE)
     values (43, 'ARCHIVECATEGORY', 'sysparam.context.archivecategory', 'ArchiveCategoryPath', 'sysparam.context.archivecategory.archivecategorypath', '/tmp', 'Enable archive (zipping) of a category', 'sysparam.context.archivecategory.archivecategorypath.descr', 0, 0, 0, 0)
/

insert into SYSPARAMETERS
            (SYSPARAMETERID, CONTEXT, CONTEXT_KEY, NAME, NAME_KEY, VALUESTRING, DESCRIPTION, DESCR_KEY, ALLOWNULL, READONLY, HIDE, DATATYPE)
     values (44, 'DOCUMENT', 'sysparam.context.document', 'EnableDocumentStatusCoverage', 'sysparam.context.document.enabledocumentstatuscoverage', '0', 'Enable input of document status', 'sysparam.context.document.enabledocumentstatuscoverage.descr', 0, 0, 0, 2)
/

insert into SYSPARAMETERS
            (SYSPARAMETERID, CONTEXT, CONTEXT_KEY, NAME, NAME_KEY, VALUESTRING, DESCRIPTION, DESCR_KEY, ALLOWNULL, READONLY, HIDE, DATATYPE)
     values (45, 'DOCUMENT', 'sysparam.context.document', 'EnableDocumentClassCoverage', 'sysparam.context.document.enabledocumentclasscoverage', '0', 'Enable input of document class', 'sysparam.context.document.enabledocumentclasscoverage.descr', 0, 0, 0, 2)
/

insert into SYSPARAMETERS
            (SYSPARAMETERID, CONTEXT, CONTEXT_KEY, NAME, NAME_KEY, VALUESTRING, DESCRIPTION, DESCR_KEY, ALLOWNULL, READONLY, HIDE, DATATYPE)
     values (46, 'PROJECTMANAGEMENT', 'sysparam.context.projectmanagement', 'EnableProjectManagement', 'sysparam.context.projectmanagement.enableprojectmanagement', '0', 'Enable project management', 'sysparam.context.projectmanagement.enableprojectmanagement.descr', 0, 0, 0, 2)
/

insert into SYSPARAMETERS
            (SYSPARAMETERID, CONTEXT, CONTEXT_KEY, NAME, NAME_KEY, VALUESTRING, DESCRIPTION, DESCR_KEY, ALLOWNULL, READONLY, HIDE, DATATYPE)
     values (47, 'PROJECTMANAGEMENT', 'sysparam.context.projectmanagement', 'ProjectRootCategoryId', 'sysparam.context.projectmanagement.projectrootcategoryid', '0', 'ID of the root category for projectmanagement', 'sysparam.context.projectmanagement.projectrootcategoryid.descr', 0, 0, 0, 1)
/

insert into SYSPARAMETERS
            (SYSPARAMETERID, CONTEXT, CONTEXT_KEY, NAME, NAME_KEY, VALUESTRING, DESCRIPTION, DESCR_KEY, ALLOWNULL, READONLY, HIDE, DATATYPE)
     values (48, 'PROJECTMANAGEMENT', 'sysparam.context.projectmanagement', 'TemplatesRootCategoryId', 'sysparam.context.projectmanagement.templatesrootcategoryid', '0', 'ID of the template category', 'sysparam.context.projectmanagement.templatesrootcategoryid.descr', 0, 0, 0, 1)
/

insert into SYSPARAMETERS
            (SYSPARAMETERID, CONTEXT, CONTEXT_KEY, NAME, NAME_KEY, VALUESTRING, DESCRIPTION, DESCR_KEY, ALLOWNULL, READONLY, HIDE, DATATYPE)
     values (49, 'FUNCTIONALVIEW', 'sysparam.context.functionalview', 'FunctionalViewRootCategoryId', 'sysparam.context.functionalview.functionalviewrootcategoryid', '0', 'ID of the root category for functional views', 'sysparam.context.functionalview.functionalviewrootcategoryid.descr', 0, 0, 0, 1)
/

insert into SYSPARAMETERS
            (SYSPARAMETERID, CONTEXT, CONTEXT_KEY, NAME, NAME_KEY, VALUESTRING, DESCRIPTION, DESCR_KEY, ALLOWNULL, READONLY, HIDE, DATATYPE)
     values (50, 'LOGGING', 'sysparam.context.logging', 'TraceLogFile', 'sysparam.context.logging.tracelogfile', '/WEB-INF/log/vkc_trace.log', 'File for tracing logs of VKC', 'sysparam.context.logging.tracelogfile.descr', 0, 0, 0, 0)
/

insert into SYSPARAMETERS
            (SYSPARAMETERID, CONTEXT, CONTEXT_KEY, NAME, NAME_KEY, VALUESTRING, DESCRIPTION, DESCR_KEY, ALLOWNULL, READONLY, HIDE, DATATYPE)
     values (51, 'LOGIN', 'sysparam.context.login', 'DefaultLoginPage', 'sysparam.context.login.defaultLoginPage', '/common/Login.jsp', 'Default JSP page for login into VKC', 'sysparam.context.login.defaultLoginPage.descr', 1, 0, 0, 0)
/

insert into SYSPARAMETERS
            (SYSPARAMETERID, CONTEXT, CONTEXT_KEY, NAME, NAME_KEY, VALUESTRING, DESCRIPTION, DESCR_KEY, ALLOWNULL, READONLY, HIDE, DATATYPE)
     values (52, 'CATEGORYVIEW', 'sysparam.context.categoryview', 'DisplayEmptyFoldersWithEmptyIcon', 'sysparam.context.categoryview.emptyfolder', '0', 'Display special icon if folder is empty', 'sysparam.context.categoryview.emptyfolder.descr', 1, 0, 0, 2)
/

insert into SYSPARAMETERS
            (SYSPARAMETERID, CONTEXT, CONTEXT_KEY, NAME, NAME_KEY, VALUESTRING, DESCRIPTION, DESCR_KEY, ALLOWNULL, READONLY, HIDE, DATATYPE)
     values (53, 'QUOTA', 'sysparam.context.quota', 'ConsiderAdditionalDocFormats', 'sysparam.context.quota.adddocformats', '0', 'Consider amount of additional document formats', 'sysparam.context.quota.adddocformats.consideration', 0, 0, 0, 2)
/

insert into SYSPARAMETERS
            (SYSPARAMETERID, CONTEXT, CONTEXT_KEY, NAME, NAME_KEY, VALUESTRING, DESCRIPTION, DESCR_KEY, ALLOWNULL, READONLY, HIDE, DATATYPE)
     values (54, 'NEWS', 'sysparam.context.news', 'EnableNews', 'sysparam.context.news.enablenews', '1', 'Enable news system', 'sysparam.context.news.enablenews.descr', 0, 0, 0, 2)
/

insert into SYSPARAMETERS
            (SYSPARAMETERID, CONTEXT, CONTEXT_KEY, NAME, NAME_KEY, VALUESTRING, DESCRIPTION, DESCR_KEY, ALLOWNULL, READONLY, HIDE, DATATYPE)
     values (55, 'NEWS', 'sysparam.context.news', 'MaxCountNews', 'sysparam.context.news.maxcountnews', '20', 'Maxmium count of displayed news', 'sysparam.context.news.maxcountnews.descr', 0, 0, 0, 1)
/

insert into SYSPARAMETERS
            (SYSPARAMETERID, CONTEXT, CONTEXT_KEY, NAME, NAME_KEY, VALUESTRING, DESCRIPTION, DESCR_KEY, ALLOWNULL, READONLY, HIDE, DATATYPE)
     values (56, 'NEWS', 'sysparam.context.news', 'ConsiderValidNewsOnly', 'sysparam.context.news.validnewsonly', '0', 'Consider valid news only', 'sysparam.context.news.validnewsonly.descr', 0, 0, 0, 2)
/

insert into SYSPARAMETERS
            (SYSPARAMETERID, CONTEXT, CONTEXT_KEY, NAME, NAME_KEY, VALUESTRING, DESCRIPTION, DESCR_KEY, ALLOWNULL, READONLY, HIDE, DATATYPE)
     values (57, 'MAIL', 'sysparam.context.mail', 'NotificationCheckPeriod', 'sysparam.context.mail.notificationcheckperiod', '10', 'Period of minutes to check for notifications', 'sysparam.context.mail.notificationcheckperiod.descr', 0, 0, 0, 1)
/

insert into SYSPARAMETERS
            (SYSPARAMETERID, CONTEXT, CONTEXT_KEY, NAME, NAME_KEY, VALUESTRING, DESCRIPTION, DESCR_KEY, ALLOWNULL, READONLY, HIDE, DATATYPE)
     values (58, 'LDAP', 'sysparam.context.ldap', 'EnableLdapSupport', 'sysparam.context.ldap.enableLdapSupport', '0', 'Enables LDAP Support', 'sysparam.context.ldap.enableLdapSupport.descr', 0, 0, 0, 2)
/

insert into SYSPARAMETERS
            (SYSPARAMETERID, CONTEXT, CONTEXT_KEY, NAME, NAME_KEY, VALUESTRING, DESCRIPTION, DESCR_KEY, ALLOWNULL, READONLY, HIDE, DATATYPE)
     values (59, 'CATEGORYVIEW', 'sysparam.context.categoryview', 'MarkForbiddenCategories', 'sysparam.context.categoryview.markforbiddencategories', '1', 'Mark forbidden categories with special icon', 'sysparam.context.categoryview.markforbiddencategories.descr', 0, 0, 0, 2)
/

insert into SYSPARAMETERS
            (SYSPARAMETERID, CONTEXT, CONTEXT_KEY, NAME, NAME_KEY, VALUESTRING, DESCRIPTION, DESCR_KEY, ALLOWNULL, READONLY, HIDE, DATATYPE)
     values (60, 'LOGGING', 'sysparam.context.logging', 'enableAccessLog', 'sysparam.context.logging.enableAccessLog', '1', 'Enable access log', 'sysparam.context.logging.enableAccessLog.descr', 0, 0, 0, 2)
/

insert into SYSPARAMETERS
            (SYSPARAMETERID, CONTEXT, CONTEXT_KEY, NAME, NAME_KEY, VALUESTRING, DESCRIPTION, DESCR_KEY, ALLOWNULL, READONLY, HIDE, DATATYPE)
     values (61, 'LOGGING', 'sysparam.context.logging', 'anonymizeAccessLog', 'sysparam.context.logging.anonymizeAccessLog', '0', 'Anonymize access log', 'sysparam.context.logging.anonymizeAccessLog.descr', 0, 0, 0, 2)
/

insert into SYSPARAMETERS
            (SYSPARAMETERID, CONTEXT, CONTEXT_KEY, NAME, NAME_KEY, VALUESTRING, DESCRIPTION, DESCR_KEY, ALLOWNULL, READONLY, HIDE, DATATYPE)
     values (62, 'DOCUMENT', 'sysparam.context.document', 'EnableDocumentVersionManagement', 'sysparam.context.document.enabledocumentversionmanagement', '0', 'Enable management of document versions', 'sysparam.context.document.enabledocumentversionmanagement.descr', 0, 0, 0, 2)
/

insert into SYSPARAMETERS
            (SYSPARAMETERID, CONTEXT, CONTEXT_KEY, NAME, NAME_KEY, VALUESTRING, DESCRIPTION, DESCR_KEY, ALLOWNULL, READONLY, HIDE, DATATYPE)
     values (63, 'CATEGORYVIEW', 'sysparam.context.categoryview', 'EnableClusterCategory', 'sysparam.context.categoryview.enableclustercategory', '0', 'Enable clustering of all category documents', 'sysparam.context.categoryview.enableclustercategory.descr', 0, 0, 0, 2)
/

insert into SYSPARAMETERS
            (SYSPARAMETERID, CONTEXT, CONTEXT_KEY, NAME, NAME_KEY, VALUESTRING, DESCRIPTION, DESCR_KEY, ALLOWNULL, READONLY, HIDE, DATATYPE)
     values (64, 'DOCUMENT', 'sysparam.context.document', 'EnableDocumentDescription', 'sysparam.context.document.enabledocumentdescription', '1', 'Enable automatically description of document', 'sysparam.context.document.enabledocumentdescription.descr', 0, 0, 0, 2)
/

insert into SYSPARAMETERS
            (SYSPARAMETERID, CONTEXT, CONTEXT_KEY, NAME, NAME_KEY, VALUESTRING, DESCRIPTION, DESCR_KEY, ALLOWNULL, READONLY, HIDE, DATATYPE)
     values (65, 'DOCUMENT', 'sysparam.context.document', 'EnableDocumentTitle', 'sysparam.context.document.enabledocumenttitle', '1', 'Enable automatically title of document', 'sysparam.context.document.enabledocumenttitle.descr', 0, 0, 0, 2)
/

insert into SYSPARAMETERS
            (SYSPARAMETERID, CONTEXT, CONTEXT_KEY, NAME, NAME_KEY, VALUESTRING, DESCRIPTION, DESCR_KEY, ALLOWNULL, READONLY, HIDE, DATATYPE)
     values (66, 'DOCUMENT', 'sysparam.context.document', 'EnableDocumentKeyword', 'sysparam.context.document.enabledocumentkeyword', '1', 'Enable automatically generate keyword of document', 'sysparam.context.document.enabledocumentkeyword.descr', 0, 0, 0, 2)
/

insert into SYSPARAMETERS
            (SYSPARAMETERID, CONTEXT, CONTEXT_KEY, NAME, NAME_KEY, VALUESTRING, DESCRIPTION, DESCR_KEY, ALLOWNULL, READONLY, HIDE, DATATYPE)
     values (67, 'DOCUMENT', 'sysparam.context.document', 'EnableMultiIcon', 'sysparam.context.document.enablemultiicon', '1', 'Enable different icons for different documenttypes ', 'sysparam.context.document.enablemultiicon.descr', 0, 0, 0, 2)
/

insert into SYSPARAMETERS
            (SYSPARAMETERID, CONTEXT, CONTEXT_KEY, NAME, NAME_KEY, VALUESTRING, DESCRIPTION, DESCR_KEY, ALLOWNULL, READONLY, HIDE, DATATYPE)
     values (68, 'TRASH', 'sysparam.context.trash', 'EnableTrash', 'sysparam.context.trash.enable', '1', 'Enables Trash', 'sysparam.context.trash.enable.descr', 0, 0, 0, 2)
/

insert into SYSPARAMETERS
            (SYSPARAMETERID, CONTEXT, CONTEXT_KEY, NAME, NAME_KEY, VALUESTRING, DESCRIPTION, DESCR_KEY, ALLOWNULL, READONLY, HIDE, DATATYPE)
     values (69, 'TRASH', 'sysparam.context.trash', 'TrashCategoryId', 'sysparam.context.trash.categoryid', '0', 'Define a category for a trash', 'sysparam.context.trash.categoryid.descr', 0, 0, 0, 1)
/

insert into SYSPARAMETERS
            (SYSPARAMETERID, CONTEXT, CONTEXT_KEY, NAME, NAME_KEY, VALUESTRING, DESCRIPTION, DESCR_KEY, ALLOWNULL, READONLY, HIDE, DATATYPE)
     values (70, 'DOCUMENT', 'sysparam.context.document', 'EnableDocumentCreationDateCoverage', 'sysparam.context.document.enabledocumentcreationdatecoverage', '0', 'Enable input of document creation date', 'sysparam.context.document.enabledocumentcreationdatecoverage.descr', 0, 0, 0, 2)
/

insert into SYSPARAMETERS
            (SYSPARAMETERID, CONTEXT, CONTEXT_KEY, NAME, NAME_KEY, VALUESTRING, DESCRIPTION, DESCR_KEY, ALLOWNULL, READONLY, HIDE, DATATYPE)
     values (71, 'STATISTICS', 'sysparam.context.statistics', 'EnableStatistics', 'sysparam.context.statistics.enablestatistics', '0', 'Enable display of statistical graphs', 'sysparam.context.statistics.enablestatistics.descr', 0, 0, 0, 2)
/

insert into SYSPARAMETERS
            (SYSPARAMETERID, CONTEXT, CONTEXT_KEY, NAME, NAME_KEY, VALUESTRING, DESCRIPTION, DESCR_KEY, ALLOWNULL, READONLY, HIDE, DATATYPE)
     values (72, 'LOGIN', 'sysparam.context.login', 'MaxPwdMismatchCount', 'sysparam.context.login.maxpwdmismatchcount', '3', 'Maximum number of unsuccessful password authentication attempts', 'sysparam.context.login.maxpwdmismatchcount.descr', 0, 0, 0, 1)
/

insert into SYSPARAMETERS
            (SYSPARAMETERID, CONTEXT, CONTEXT_KEY, NAME, NAME_KEY, VALUESTRING, DESCRIPTION, DESCR_KEY, ALLOWNULL, READONLY, HIDE, DATATYPE)
     values (73, 'LOGIN', 'sysparam.context.login', 'UserLockTime', 'sysparam.context.login.userlocktime', '24', 'User locktime (in Hours) after max. num. unsuccessful pwd. authentication attempts (0 = permanent)', 'sysparam.context.login.userlocktime.descr', 0, 0, 0, 1)
/

insert into SYSPARAMETERS
            (SYSPARAMETERID, CONTEXT, CONTEXT_KEY, NAME, NAME_KEY, VALUESTRING, DESCRIPTION, DESCR_KEY, ALLOWNULL, READONLY, HIDE, DATATYPE)
     values (74, 'LOGIN', 'sysparam.context.login', 'UserLockNotification', 'sysparam.context.login.userlocknotification', '1', 'Notificate locked user after max. num. unsuccessful pwd. authentication attempts', 'sysparam.context.login.userlocknotification.descr', 0, 0, 0, 2)
/

insert into SYSPARAMETERS
            (SYSPARAMETERID, CONTEXT, CONTEXT_KEY, NAME, NAME_KEY, VALUESTRING, DESCRIPTION, DESCR_KEY, ALLOWNULL, READONLY, HIDE, DATATYPE)
     values (75, 'LOGIN', 'sysparam.context.login', 'UserLockEnabled', 'sysparam.context.login.userlockenabled', '1', 'Enables user lock management and counting of unsuccessful pwd. authentication attempts', 'sysparam.context.login.userlockenabled.descr', 0, 0, 0, 2)
/

insert into SYSPARAMETERS
            (SYSPARAMETERID, CONTEXT, CONTEXT_KEY, NAME, NAME_KEY, VALUESTRING, DESCRIPTION, DESCR_KEY, ALLOWNULL, READONLY, HIDE, DATATYPE)
     values (76, 'MAIL', 'sysparam.context.mail', 'MailUsername', 'sysparam.context.mail.mailusername', '', 'Mailservers username', 'sysparam.context.mail.mailusername.descr', 1, 0, 0, 0)
/

insert into SYSPARAMETERS
            (SYSPARAMETERID, CONTEXT, CONTEXT_KEY, NAME, NAME_KEY, VALUESTRING, DESCRIPTION, DESCR_KEY, ALLOWNULL, READONLY, HIDE, DATATYPE)
     values (77, 'MAIL', 'sysparam.context.mail', 'MailPassword', 'sysparam.context.mail.mailpassword', '', 'Mailservers password', 'sysparam.context.mail.mailpassword.descr', 1, 0, 0, 0)
/

insert into SYSPARAMETERS
            (SYSPARAMETERID, CONTEXT, CONTEXT_KEY, NAME, NAME_KEY, VALUESTRING, DESCRIPTION, DESCR_KEY, ALLOWNULL, READONLY, HIDE, DATATYPE)
     values (78, 'MAIL', 'sysparam.context.mail', 'MailPort', 'sysparam.context.mail.mailport', '25', 'Mailservers port (Default: 25)', 'sysparam.context.mail.mailport.descr', 0, 0, 0, 1)
/

insert into SYSPARAMETERS
            (SYSPARAMETERID, CONTEXT, CONTEXT_KEY, NAME, NAME_KEY, VALUESTRING, DESCRIPTION, DESCR_KEY, ALLOWNULL, READONLY, HIDE, DATATYPE)
     values (79, 'MAIL', 'sysparam.context.mail', 'MailSsl', 'sysparam.context.mail.mailssl', '0', 'Use SSL connection with the mailserver', 'sysparam.context.mail.mailssl.descr', 0, 0, 0, 2)
/

insert into SYSPARAMETERS
            (SYSPARAMETERID, CONTEXT, CONTEXT_KEY, NAME, NAME_KEY, VALUESTRING, DESCRIPTION, DESCR_KEY, ALLOWNULL, READONLY, HIDE, DATATYPE)
     values (80, 'MAIL', 'sysparam.context.mail', 'MailUntrustedCertificate', 'sysparam.context.mail.mailuntrustedcertificate', '0', 'Allow untrusted certificates for SSL connection with the mailserver', 'sysparam.context.mail.mailuntrustedcertificate.descr', 0, 0, 0, 2)
/

commit
/

insert into USERS
            (USERID, USERNAME, FIRSTNAME, LASTNAME, PASSWD, PASSWDCHANGED, PASSWDCHANGEDTS, PWDMISMATCHCOUNT, EMAIL, SHOWEMAIL, ADMINPRIVILEGES, SESSIONTIMEOUT, QUOTA, MANAGEOWNUSERS, MANAGEOWNUSERS_S_V, MANAGEOWNGROUPS, MANAGEOWNPROXIES, MANAGEVIRTUALDOC_Q, LANGUAGEID, ACCOUNTVALID, CREATED, CREATORID, MESSAGINGTIMEPERIOD, ALLOWMANAGE_S_V_T, SYSTEMVIEWTYPEID)
     values (0, 'SYSTEM', '', 'VKC-SYSTEM-User', 'f89SqyHAVp5mPUirW+wHzA==', 1, null, 0, 'trash@company.com', 1, 1, 120, null, 1, 1, 1, 1, 1, 1, 1, SYSDATE, 0, 0, 0, 2)
/

insert into USERS
            (USERID, USERNAME, FIRSTNAME, LASTNAME, TITLE, PASSWD, PASSWDCHANGED, PASSWDCHANGEDTS, PWDMISMATCHCOUNT, EMAIL, SHOWEMAIL, ENABLEMESSAGING, MESSAGINGTIMEPERIOD, COMPANY, DEPARTMENT, ZIP, CITY, STREET, PHONE, FAX, MOBILE, HOMEPAGEURL, CONTACTURL, ADMINPRIVILEGES, SESSIONTIMEOUT, QUOTA, MANAGEOWNUSERS, MANAGEOWNUSERS_S_V, MANAGEOWNGROUPS, MANAGEOWNPROXIES, MANAGEVIRTUALDOC_Q, LANGUAGEID, ACCOUNTVALID, VALIDFROM, VALIDUNTIL, CREATED, CREATORID, LASTCHANGED, LASTCHANGERID, DYNATTRSID, STARTCATEGORYID, MOSTRECENTLOGIN, ALLOWMANAGE_S_V_T, SYSTEMVIEWTYPEID)
     values (1, 'Admin', 'Administrator', 'VKC-Administrator', '...', 'f89SqyHAVp5mPUirW+wHzA==', 1, null, 0, 'trash@company.com', 0, 1, 1, 'Company1', 'Department1', '00000', 'City1', 'Street1', '00000/00001', '00000/00001', '00000/00001', 'http://www.homepage1.de', 'http://www.contacturl1.de', 1, 120, null, 1, 1, 1, 1, 1, 1, 1, null, null, null, null, null, null, null, 1, null, 0, 2)
/

insert into TEMPLATES
            (TEMPLATEID, NAME, PATH, DESCRIPTION, PREVIEWPIC, ENABLED)
     values (1, 'default', '/templates/default/', 'default template', null, 1)
/

insert into CONVERTERTIMING
            (ID, POLLING_PERIOD_MINUTES, TIME_FRAME_START, TIME_FRAME_END)
     values (1, 1, '00:00', '23:59')
/

insert into DOCUMENTVIEWFIELDS
            (FIELDID, NAME, NAMEKEY, DEFAULTFIELD)
     values (1, 'fileName', 'vkc.document.type.file', 1)
/

insert into DOCUMENTVIEWFIELDS
            (FIELDID, NAME, NAMEKEY, DEFAULTFIELD)
     values (2, 'fileFormat', 'vkc.document.type.fileformat', 1)
/

insert into DOCUMENTVIEWFIELDS
            (FIELDID, NAME, NAMEKEY, DEFAULTFIELD)
     values (3, 'fileSize', 'vkc.document.type.filesize', 1)
/

insert into DOCUMENTVIEWFIELDS
            (FIELDID, NAME, NAMEKEY, DEFAULTFIELD)
     values (4, 'classType', 'vkc.document.class', 1)
/

insert into DOCUMENTVIEWFIELDS
            (FIELDID, NAME, NAMEKEY, DEFAULTFIELD)
     values (5, 'statusType', 'vkc.document.status', 1)
/

insert into DOCUMENTVIEWFIELDS
            (FIELDID, NAME, NAMEKEY, DEFAULTFIELD)
     values (6, 'versionNo', 'vkc.document.version', 0)
/

insert into DOCUMENTVIEWFIELDS
            (FIELDID, NAME, NAMEKEY, DEFAULTFIELD)
     values (7, 'versionLabel', 'vkc.document.label', 0)
/

insert into DOCUMENTVIEWFIELDS
            (FIELDID, NAME, NAMEKEY, DEFAULTFIELD)
     values (8, 'versionDescr', 'vkc.document.versiondescr', 0)
/

insert into DOCUMENTVIEWFIELDS
            (FIELDID, NAME, NAMEKEY, DEFAULTFIELD)
     values (9, 'expires', 'vkc.document.expires', 0)
/

insert into DOCUMENTVIEWFIELDS
            (FIELDID, NAME, NAMEKEY, DEFAULTFIELD)
     values (10, 'published', 'vkc.published', 0)
/

insert into DOCUMENTVIEWFIELDS
            (FIELDID, NAME, NAMEKEY, DEFAULTFIELD)
     values (11, 'author', 'vkc.author', 0)
/

insert into DOCUMENTVIEWFIELDS
            (FIELDID, NAME, NAMEKEY, DEFAULTFIELD)
     values (12, 'publisher', 'vkc.publisher', 0)
/

insert into DOCUMENTVIEWFIELDS
            (FIELDID, NAME, NAMEKEY, DEFAULTFIELD)
     values (13, 'accessCount', 'vkc.accesscount', 0)
/

insert into DOCUMENTVIEWFIELDS
            (FIELDID, NAME, NAMEKEY, DEFAULTFIELD)
     values (14, 'lastAccessed', 'vkc.lastaccessed', 0)
/

insert into DOCUMENTVIEWFIELDS
            (FIELDID, NAME, NAMEKEY, DEFAULTFIELD)
     values (15, 'keywords', 'vkc.keywords', 0)
/

insert into DOCUMENTVIEWFIELDS
            (FIELDID, NAME, NAMEKEY, DEFAULTFIELD)
     values (16, 'description', 'vkc.description', 0)
/

insert into DOCUMENTVIEWFIELDS
            (FIELDID, NAME, NAMEKEY, DEFAULTFIELD)
     values (17, 'additionalFormats', 'vkc.document.additional_formats', 0)
/

insert into DOCUMENTVIEWFIELDS
            (FIELDID, NAME, NAMEKEY, DEFAULTFIELD)
     values (18, 'dynaAttributes', 'vkc.string.dynaAttributes', 0)
/

insert into DOCUMENTVIEWFIELDS
            (FIELDID, NAME, NAMEKEY, DEFAULTFIELD)
     values (19, 'addAttributes', 'vkc.string.addAttributes', 0)
/

insert into DOCUMENTVIEWFIELDS
            (FIELDID, NAME, NAMEKEY, DEFAULTFIELD)
     values (20, 'creationDate', 'vkc.creationdate', 0)
/

INSERT INTO USERRATINGS (USERRATINGID, MINPUBDOCSCOUNT, DESCRIPTION,  DESCR_KEY, ICON)
     VALUES (1, 50, 'graduate', 'vkc.userrating.graduate', 'userrating/graduate.gif')
/

INSERT INTO USERRATINGS (USERRATINGID, MINPUBDOCSCOUNT, DESCRIPTION,  DESCR_KEY, ICON)
     VALUES (2, 100, 'professional', 'vkc.userrating.professional', 'userrating/professional.gif')
/

INSERT INTO USERRATINGS (USERRATINGID, MINPUBDOCSCOUNT, DESCRIPTION,  DESCR_KEY, ICON)
     VALUES (3, 200, 'wizard', 'vkc.userrating.wizard', 'userrating/wizard.gif')
/

INSERT INTO USERRATINGS (USERRATINGID, MINPUBDOCSCOUNT, DESCRIPTION,  DESCR_KEY, ICON)
     VALUES (4, 300, 'king', 'vkc.userrating.king', 'userrating/king.gif')
/

INSERT INTO USERRATINGS (USERRATINGID, MINPUBDOCSCOUNT, DESCRIPTION,  DESCR_KEY, ICON)
     VALUES (5, 400, 'pharao', 'vkc.userrating.pharao', 'userrating/pharao.gif')
/

INSERT INTO USERRATINGS (USERRATINGID, MINPUBDOCSCOUNT, DESCRIPTION,  DESCR_KEY, ICON)
     VALUES (6, 500, 'olympian', 'vkc.userrating.olympian', 'userrating/olympian.gif')
/

insert into TABVIEWS
            (TABVIEWID, UNIQUENAME, FLAG, STATUS, VIEWTYPEID, ENABLED, HIDE)
     values (1, 'DOCUMENT_TAB', null, null, 1, 1, 0)
/

insert into TABVIEWS
            (TABVIEWID, UNIQUENAME, FLAG, STATUS, VIEWTYPEID, ENABLED, HIDE)
     values (2, 'MESSENGER_TAB', null, null, 1, 1, 0)
/

insert into TABVIEWS
            (TABVIEWID, UNIQUENAME, FLAG, STATUS, VIEWTYPEID, ENABLED, HIDE)
     values (3, 'PROFILE_TAB', null, null, 1, 1, 0)
/

insert into TABVIEWS
            (TABVIEWID, UNIQUENAME, FLAG, STATUS, VIEWTYPEID, ENABLED, HIDE)
     values (4, 'SEARCH_TAB', null, null, 1, 1, 0)
/

insert into TABVIEWS
            (TABVIEWID, UNIQUENAME, FLAG, STATUS, VIEWTYPEID, ENABLED, HIDE)
     values (5, 'HELP_TAB', null, null, 1, 1, 0)
/

insert into TABVIEWS
            (TABVIEWID, UNIQUENAME, FLAG, STATUS, VIEWTYPEID, ENABLED, HIDE)
     values (6, 'BESTSELLER_TAB', null, null, 1, 1, 0)
/

insert into TABVIEWS
            (TABVIEWID, UNIQUENAME, FLAG, STATUS, VIEWTYPEID, ENABLED, HIDE)
     values (7, 'LATESTADDITIONS_TAB', null, null, 1, 1, 0)
/

insert into TABVIEWS
            (TABVIEWID, UNIQUENAME, FLAG, STATUS, VIEWTYPEID, ENABLED, HIDE)
     values (8, 'ADMINISTRATION_TAB', null, null, 1, 1, 0)
/

insert into TABVIEWS
            (TABVIEWID, UNIQUENAME, FLAG, STATUS, VIEWTYPEID, ENABLED, HIDE)
     values (9, 'PROJECT_TAB', null, null, 1, 1, 0)
/

insert into TABVIEWS
            (TABVIEWID, UNIQUENAME, FLAG, STATUS, VIEWTYPEID, ENABLED, HIDE)
     values (10, 'STATISTICS_TAB', null, null, 1, 1, 0)
/

insert into TABVIEWS
            (TABVIEWID, UNIQUENAME, FLAG, STATUS, VIEWTYPEID, ENABLED, HIDE)
     values (11, 'HISTORY_TAB', null, null, 1, 1, 0)
/

insert into TABVIEWS
            (TABVIEWID, UNIQUENAME, FLAG, STATUS, VIEWTYPEID, ENABLED, HIDE)
     values (12, 'FAVORITES_TAB', null, null, 1, 1, 0)
/

insert into TABVIEWS
            (TABVIEWID, UNIQUENAME, FLAG, STATUS, VIEWTYPEID, ENABLED, HIDE)
     values (13, 'NEWS_TAB', null, null, 1, 1, 0)
/

insert into TABVIEWS
            (TABVIEWID, UNIQUENAME, FLAG, STATUS, VIEWTYPEID, ENABLED, HIDE)
     values (14, 'WORKFLOW_TAB', null, null, 1, 1, 0)
/

insert into TABVIEWS
            (TABVIEWID, UNIQUENAME, FLAG, STATUS, VIEWTYPEID, ENABLED, HIDE)
     values (15, 'TRASH_TAB', null, null, 1, 1, 0)
/

create sequence ACLIDS_SEQ start with 1 minvalue 0 increment by 1
/

create sequence ACLTYPES_SEQ start with 8 minvalue 0 increment by 1
/

create sequence ADDCATATTRS_SEQ start with 1 minvalue 0 increment by 1
/

create sequence ADDDOCATTRS_SEQ start with 1 minvalue 0 increment by 1
/

create sequence ADDGROUPATTRS_SEQ start with 1 minvalue 0 increment by 1
/

create sequence ADDUSERATTRS_SEQ start with 1 minvalue 0 increment by 1
/

create sequence ADDITIONALDOCUMENTFORMATS_SEQ start with 0 minvalue 0 increment by 1
/

create sequence CATEGORIES_SEQ start with 2 minvalue 0 increment by 1
/

create sequence CATEGORYACLS_SEQ start with 2 minvalue 0 increment by 1
/

create sequence CATEGORYDOCUMENTS_SEQ start with 1 minvalue 0 increment by 1
/

create sequence CATEGORYLINKS_SEQ start with 1 minvalue 0 increment by 1
/

create sequence CATEGORYDOCUMENTLINKS_SEQ start with 1 minvalue 0 increment by 1
/

create sequence CATPROJECTSTEPS_SEQ start with 0 minvalue 0 increment by 1
/

create sequence CONVERTERTIMING_SEQ start with 2 minvalue 0 increment by 1
/

create sequence CONVERSIONSTATI_SEQ start with 0 minvalue 0 increment by 1
/

create sequence CONVERTER_SEQ start with 0 minvalue 0 increment by 1
/

create sequence DEFAULTCATACLS_SEQ start with 11 minvalue 0 increment by 1
/

create sequence DEFAULTDOCACLS_SEQ start with 1 minvalue 0 increment by 1
/

create sequence DOCUMENTS_SEQ start with 1 minvalue 0 increment by 1
/

create sequence DOCUMENTACLS_SEQ start with 1 minvalue 0 increment by 1
/

create sequence DOCUMENTCLASSES_SEQ start with 11 minvalue 0 increment by 1
/

create sequence DOCUMENTSTATI_SEQ start with 5 minvalue 0 increment by 1
/

create sequence DOCUMENTTYPES_SEQ start with 23 minvalue 0 increment by 1
/

create sequence DOCUMENTVIEWFIELDS_SEQ start with 21 minvalue 0 increment by 1
/

create sequence DYNATTRIBUTES_SEQ start with 1 minvalue 0 increment by 1
/

create sequence DYNAENTRIES_SEQ start with 1 minvalue 0 increment by 1
/

create sequence GROUPS_SEQ start with 3 minvalue 0 increment by 1
/

create sequence LANGUAGES_SEQ start with 3 minvalue 0 increment by 1
/

create sequence LANGUAGEPACKS_SEQ start with 4 minvalue 0 increment by 1
/

create sequence LDAPGROUPS_SEQ start with 0 minvalue 0 increment by 1
/

create sequence LDAPSERVERS_SEQ start with 0 minvalue 0 increment by 1
/

create sequence LDAPUSERS_SEQ start with 0 minvalue 0 increment by 1
/

create sequence MSGTIMEPERIODS_SEQ start with 1 minvalue 0 increment by 1
/

create sequence NEWS_SEQ start with 1 minvalue 0 increment by 1
/

create sequence PERMISSIONS_SEQ start with 17 minvalue 0 increment by 1
/

create sequence PROJECTMESSAGES_SEQ start with 1 minvalue 0 increment by 1
/

create sequence PROXYUSERS_SEQ start with 1 minvalue 0 increment by 1
/

create sequence SEARCHQUERIES_SEQ start with 0 minvalue 0 increment by 1
/

create sequence SYSPARAMETERS_SEQ start with 81 minvalue 0 increment by 1
/

create sequence TEMPLATES_SEQ start with 2 minvalue 0 increment by 1
/

create sequence USERS_SEQ start with 2 minvalue 0 increment by 1
/

create sequence USERDOCMAILS_SEQ start with 1 minvalue 0 increment by 1
/

create sequence USERDOCVIEWFIELDS_SEQ start with 1 minvalue 0 increment by 1
/

create sequence USERREGSEARCHQUERIES_SEQ start with 0 minvalue 0 increment by 1
/

create sequence VKC_AVAILS_SEQ start with 0 minvalue 0 increment by 1
/

create sequence VKCSERVER_SEQ start with 0 minvalue 0 increment by 1
/

create sequence USERRATINGS_SEQ start with 6 minvalue 0 increment by 1
/

create sequence TABVIEWS_SEQ start with 16 minvalue 0 increment by 1
/

commit
/

CREATE VIEW CATEGORIES_READABLE_BY_USER (
  CATEGORYID,
  USERID
) AS SELECT CATEGORIES.CATEGORYID,
            CATEGORYACLS.ACCESSORID
       FROM CATEGORIES, CATEGORYACLS
      WHERE CATEGORIES.ACLID = CATEGORYACLS.ACLID 
        AND ( CATEGORYACLS.ACLTYPEID=1 OR CATEGORYACLS.ACLTYPEID=3 ) 
        AND CATEGORYACLS.PERMISSIONID = 2
/

CREATE VIEW CATEGORIES_READABLE_BY_GROUP (
  CATEGORYID,
  GROUPID
) AS SELECT CATEGORIES.CATEGORYID,
            CATEGORYACLS.ACCESSORID
       FROM CATEGORIES, CATEGORYACLS
      WHERE CATEGORIES.ACLID = CATEGORYACLS.ACLID 
        AND CATEGORYACLS.ACLTYPEID=2 
        AND CATEGORYACLS.PERMISSIONID = 2
/

CREATE VIEW CATEGORIES_READABLE_BY_LGROUP (
  CATEGORYID, 
  LDAPGROUPID
) AS SELECT CATEGORIES.CATEGORYID,
            CATEGORYACLS.ACCESSORID
       FROM CATEGORIES, CATEGORYACLS, LDAPGROUPS
      WHERE CATEGORIES.ACLID = CATEGORYACLS.ACLID
        AND CATEGORYACLS.ACLTYPEID=7
        AND CATEGORYACLS.PERMISSIONID = 2
        AND CATEGORYACLS.ACCESSORID = LDAPGROUPS.LDAPGROUPID
/

