-- MySQL Administrator dump 1.4
--
-- ------------------------------------------------------





--
-- Create schema `jodp-demo`
--

CREATE DATABASE IF NOT EXISTS `jodp-demo`;
USE `jodp-demo`;

--
-- Definition of table `authorities`
--

CREATE TABLE `authorities` (
  `authorityCode` varchar(45) NOT NULL,
  `authorityName` varchar(255) NOT NULL,
  PRIMARY KEY  (`authorityCode`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `authorities`
--



--
-- Definition of table `backgrounds`
--

CREATE TABLE `backgrounds` (
  `backgroundID` int(10) unsigned NOT NULL auto_increment,
  `name` varchar(255) NOT NULL,
  `filename` varchar(255) NOT NULL,
  `orgImage` longblob NOT NULL,
  `thumbImage` blob NOT NULL,
  PRIMARY KEY  (`backgroundID`),
  UNIQUE KEY `Index_2` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `backgrounds`
--

INSERT INTO `backgrounds` (`backgroundID`,`name`,`filename`,`orgImage`,`thumbImage`) VALUES 
 (11,'Konfidentiellt','Konfidentiellt.gif',0x[BLOB],0x[BLOB]),
 (13,'Internt arbetsmaterial','Internt_arbetsmaterial.gif',0x[BLOB],0x[BLOB]),
 (15,'Utkast','Testar.gif',0x[BLOB],0x[BLOB]);


--
-- Definition of table `categories`
--

CREATE TABLE `categories` (
  `categoryID` int(10) unsigned NOT NULL auto_increment,
  `name` varchar(255) NOT NULL,
  `description` text NOT NULL,
  `global` tinyint(1) NOT NULL,
  `categoryIndex` int(10) unsigned default NULL,
  PRIMARY KEY  (`categoryID`),
  KEY `Index_2` (`categoryIndex`)
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `categories`
--

INSERT INTO `categories` (`categoryID`,`name`,`description`,`global`,`categoryIndex`) VALUES 
 (6,'Gemensamma mallar','Denna kategori innehåller mallar som är gemensamma för hela organisationen',1,0),
 (9,'Exempelkategori 1','Innehåller mallar som är tillhörs exempelkategori 1',0,2),
 (12,'Exempelkategori 2','Innehåller mallar som är tillhörs exempelkategori 2',0,5);


--
-- Definition of table `category-mappings`
--

CREATE TABLE `category-mappings` (
  `categoryMappingID` int(10) unsigned NOT NULL auto_increment,
  `categoryID` int(10) unsigned NOT NULL,
  `mapping` varchar(255) NOT NULL,
  `value` varchar(255) NOT NULL,
  PRIMARY KEY  (`categoryMappingID`),
  KEY `FK_category-mappings_1` (`categoryID`),
  CONSTRAINT `FK_category-mappings_1` FOREIGN KEY (`categoryID`) REFERENCES `categories` (`categoryID`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `category-mappings`
--



--
-- Definition of table `categoryfields`
--

CREATE TABLE `categoryfields` (
  `categoryFieldID` int(10) unsigned NOT NULL auto_increment,
  `categoryID` int(10) unsigned NOT NULL,
  `name` varchar(255) NOT NULL,
  `value` varchar(255) NOT NULL,
  PRIMARY KEY  (`categoryFieldID`),
  UNIQUE KEY `Index_3` (`categoryID`,`name`),
  KEY `FK_categoryFields_1` (`categoryID`),
  CONSTRAINT `FK_categoryFields_1` FOREIGN KEY (`categoryID`) REFERENCES `categories` (`categoryID`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `categoryfields`
--

INSERT INTO `categoryfields` (`categoryFieldID`,`categoryID`,`name`,`value`) VALUES 
 (2,9,'Enhet','Exempelenheten');


--
-- Definition of table `components`
--

CREATE TABLE `components` (
  `componentID` int(10) unsigned NOT NULL auto_increment,
  `name` varchar(255) NOT NULL,
  `contentXML` mediumtext,
  `styleXML` mediumtext,
  `validationType` varchar(10) default NULL,
  `adminFormType` varchar(45) default NULL,
  `userFormType` varchar(45) default NULL,
  PRIMARY KEY  (`componentID`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `components`
--

INSERT INTO `components` (`componentID`,`name`,`contentXML`,`styleXML`,`validationType`,`adminFormType`,`userFormType`) VALUES 
 (2,'Flervalslista',NULL,NULL,'STRINGLIST','TEXTAREA','DROPDOWN'),
 (3,'Dagens datum',NULL,NULL,'DATETIME','','TEXTFIELD'),
 (5,'Logotyp',NULL,NULL,NULL,'DROPDOWN',NULL);


--
-- Definition of table `componentvalues`
--

CREATE TABLE `componentvalues` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `fieldID` int(10) unsigned NOT NULL,
  `value` varchar(255) NOT NULL,
  PRIMARY KEY  (`id`),
  UNIQUE KEY `Index_3` (`fieldID`,`value`),
  CONSTRAINT `FK_componentvalues_2` FOREIGN KEY (`fieldID`) REFERENCES `fields` (`fieldID`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=2892 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `componentvalues`
--

INSERT INTO `componentvalues` (`id`,`fieldID`,`value`) VALUES 
 (2890,2533,'Exempelenhet 1\n'),
 (2891,2533,'Exempelenhet 2\n');


--
-- Definition of table `fields`
--

CREATE TABLE `fields` (
  `fieldID` int(10) unsigned NOT NULL auto_increment,
  `templateID` int(10) unsigned NOT NULL,
  `name` varchar(255) NOT NULL,
  `description` varchar(255) NOT NULL,
  `mapping` varchar(255) default NULL,
  `required` tinyint(1) NOT NULL,
  `categoryFieldMapping` int(10) unsigned default NULL,
  `componentFieldMapping` int(10) unsigned default NULL,
  PRIMARY KEY  (`fieldID`),
  UNIQUE KEY `Index_3` (`templateID`,`name`),
  KEY `FK_fields_2` (`categoryFieldMapping`),
  KEY `FK_fields_3` (`componentFieldMapping`),
  CONSTRAINT `FK_fields_1` FOREIGN KEY (`templateID`) REFERENCES `templates` (`templateID`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `FK_fields_2` FOREIGN KEY (`categoryFieldMapping`) REFERENCES `categoryfields` (`categoryFieldID`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `FK_fields_3` FOREIGN KEY (`componentFieldMapping`) REFERENCES `components` (`componentID`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=2545 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `fields`
--

INSERT INTO `fields` (`fieldID`,`templateID`,`name`,`description`,`mapping`,`required`,`categoryFieldMapping`,`componentFieldMapping`) VALUES 
 (2533,370,'Enhet','Enhet',NULL,0,NULL,2),
 (2534,370,'Handläggare','Handläggare',NULL,0,NULL,NULL),
 (2535,370,'Adressat','Adress mottagare',NULL,0,NULL,NULL),
 (2536,370,'Postnummer','Postnummer mottagare',NULL,0,NULL,NULL),
 (2537,370,'Postort','Postord mottagare',NULL,0,NULL,NULL),
 (2538,370,'Rubrik','Brevets rubrik',NULL,0,NULL,NULL),
 (2539,370,'Datum','Dagnes datum',NULL,0,NULL,3),
 (2540,371,'Namn','Namn',NULL,0,NULL,NULL),
 (2541,371,'Titel','Titel',NULL,0,NULL,NULL),
 (2542,371,'Datum','Dagens datum',NULL,0,NULL,3),
 (2543,371,'Beteckning','Beteckning',NULL,0,NULL,NULL),
 (2544,371,'Enhet','Enhet',NULL,0,2,NULL);


--
-- Definition of table `groups`
--

CREATE TABLE `groups` (
  `groupID` int(10) unsigned NOT NULL auto_increment,
  `name` varchar(255) NOT NULL,
  `description` varchar(255) NOT NULL,
  `enabled` tinyint(1) NOT NULL,
  PRIMARY KEY  (`groupID`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `groups`
--

INSERT INTO `groups` (`groupID`,`name`,`description`,`enabled`) VALUES 
 (6,'Exempelgruppen 1','Innehåller användare som tillhör exempelgruppen 1',1);


--
-- Definition of table `logotype-groups`
--

CREATE TABLE `logotype-groups` (
  `logotypegroupID` int(10) unsigned NOT NULL auto_increment,
  `name` varchar(255) NOT NULL,
  `description` varchar(255) NOT NULL,
  PRIMARY KEY  (`logotypegroupID`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `logotype-groups`
--

INSERT INTO `logotype-groups` (`logotypegroupID`,`name`,`description`) VALUES 
 (1,'Logotyp standard','Logotypen är av typen standard och knyts automatiskt till den användare som är inloggad.'),
 (2,'Logotyp svart/vit','Logotypen är svart/vit och knyts automatiskt till den användare som är inloggad.');


--
-- Definition of table `logotype-mappings`
--

CREATE TABLE `logotype-mappings` (
  `logotypeMappingID` int(10) unsigned NOT NULL auto_increment,
  `logotypeID` int(10) unsigned NOT NULL,
  `mapping` varchar(255) NOT NULL,
  PRIMARY KEY  (`logotypeMappingID`),
  UNIQUE KEY `Index_4` (`logotypeID`,`mapping`),
  KEY `FK_logotype-mappings_2` (`mapping`),
  CONSTRAINT `FK_logotype-mappings_1` FOREIGN KEY (`logotypeID`) REFERENCES `logotypes` (`logotypeID`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `FK_logotype-mappings_2` FOREIGN KEY (`mapping`) REFERENCES `authorities` (`authorityCode`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=222 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `logotype-mappings`
--



--
-- Definition of table `logotypegroup-settings`
--

CREATE TABLE `logotypegroup-settings` (
  `logotypegroupsettingID` int(10) unsigned NOT NULL auto_increment,
  `logotypegroupID` int(10) unsigned NOT NULL,
  `name` varchar(255) NOT NULL,
  `value` varchar(255) NOT NULL,
  PRIMARY KEY  (`logotypegroupsettingID`),
  KEY `FK_logotype-settings_1` (`logotypegroupID`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `logotypegroup-settings`
--

INSERT INTO `logotypegroup-settings` (`logotypegroupsettingID`,`logotypegroupID`,`name`,`value`) VALUES 
 (4,1,'Liten för sidhuvud','70'),
 (5,1,'Stor för försättsblad','90');


--
-- Definition of table `logotypes`
--

CREATE TABLE `logotypes` (
  `logotypeID` int(10) unsigned NOT NULL auto_increment,
  `name` varchar(255) NOT NULL,
  `filename` varchar(255) NOT NULL,
  `logotype` blob NOT NULL,
  `logotypegroupID` int(10) unsigned default NULL,
  `height` double NOT NULL,
  `width` double NOT NULL,
  `thumb` blob NOT NULL,
  PRIMARY KEY  (`logotypeID`),
  KEY `FK_logotypes_1` (`logotypegroupID`),
  CONSTRAINT `FK_logotypes_1` FOREIGN KEY (`logotypegroupID`) REFERENCES `logotype-groups` (`logotypegroupID`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=184 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `logotypes`
--



--
-- Definition of table `menuindex`
--

CREATE TABLE `menuindex` (
  `menuIndexID` int(10) unsigned NOT NULL auto_increment,
  `sectionID` int(10) unsigned NOT NULL default '0',
  `menuIndex` int(10) unsigned NOT NULL default '0',
  `moduleID` int(10) unsigned default NULL,
  `uniqueID` varchar(255) default NULL,
  `subSectionID` int(10) unsigned default NULL,
  `menuItemID` int(10) unsigned default NULL,
  PRIMARY KEY  (`menuIndexID`),
  UNIQUE KEY `UniqueID / ModuleID` (`moduleID`,`uniqueID`,`sectionID`),
  UNIQUE KEY `Index_5` (`sectionID`,`subSectionID`),
  KEY `FK_menuindex_3` (`subSectionID`),
  KEY `FK_menuindex_4` (`menuItemID`),
  CONSTRAINT `FK_menuindex_1` FOREIGN KEY (`moduleID`) REFERENCES `modules` (`moduleID`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `FK_menuindex_2` FOREIGN KEY (`sectionID`) REFERENCES `sections` (`sectionID`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `FK_menuindex_3` FOREIGN KEY (`subSectionID`) REFERENCES `sections` (`sectionID`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `FK_menuindex_4` FOREIGN KEY (`menuItemID`) REFERENCES `virtualmenuitems` (`menuItemID`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=300 DEFAULT CHARSET=latin1 COMMENT='InnoDB free: 206848 kB; (`sectionID`) REFER `foraldramotet-o';

--
-- Dumping data for table `menuindex`
--

INSERT INTO `menuindex` (`menuIndexID`,`sectionID`,`menuIndex`,`moduleID`,`uniqueID`,`subSectionID`,`menuItemID`) VALUES 
 (284,4,1,16,'16',NULL,NULL),
 (285,4,2,70,'70',NULL,NULL),
 (286,4,3,69,'69',NULL,NULL),
 (287,4,4,40,'40',NULL,NULL),
 (288,4,5,37,'37',NULL,NULL),
 (289,4,6,61,'61',NULL,NULL),
 (290,4,7,39,'39',NULL,NULL),
 (291,4,8,56,'56',NULL,NULL),
 (293,4,10,64,'64',NULL,NULL),
 (294,1,3,NULL,NULL,4,NULL),
 (295,1,1,NULL,NULL,6,NULL),
 (296,1,2,NULL,NULL,20,NULL),
 (297,1,4,NULL,NULL,13,NULL),
 (298,14,1,9,'9',NULL,NULL),
 (299,1,5,NULL,NULL,14,NULL);


--
-- Definition of table `modulegroups`
--

CREATE TABLE `modulegroups` (
  `moduleID` int(10) unsigned NOT NULL,
  `groupID` int(10) unsigned NOT NULL,
  PRIMARY KEY  (`moduleID`,`groupID`),
  KEY `FK_modulegroups_2` (`groupID`),
  CONSTRAINT `FK_modulegroups_1` FOREIGN KEY (`moduleID`) REFERENCES `modules` (`moduleID`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `modulegroups`
--



--
-- Definition of table `modules`
--

CREATE TABLE `modules` (
  `moduleID` int(10) unsigned NOT NULL auto_increment,
  `classname` varchar(255) NOT NULL default '',
  `name` text NOT NULL,
  `alias` varchar(45) NOT NULL default '',
  `description` text NOT NULL,
  `xslPath` text,
  `xslPathType` varchar(255) default NULL,
  `anonymousAccess` tinyint(1) NOT NULL default '0',
  `userAccess` tinyint(1) NOT NULL default '0',
  `adminAccess` tinyint(1) NOT NULL default '0',
  `enabled` tinyint(1) NOT NULL default '0',
  `visibleInMenu` tinyint(1) NOT NULL default '0',
  `sectionID` int(10) unsigned NOT NULL default '0',
  `dataSourceID` int(10) unsigned default NULL,
  `staticContentPackage` varchar(255) default NULL,
  PRIMARY KEY  (`moduleID`),
  UNIQUE KEY `Index_3` (`sectionID`,`alias`),
  KEY `FK_modules_1` (`sectionID`),
  KEY `FK_modules_2` (`dataSourceID`),
  CONSTRAINT `FK_modules_1` FOREIGN KEY (`sectionID`) REFERENCES `sections` (`sectionID`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `FK_modules_2` FOREIGN KEY (`dataSourceID`) REFERENCES `datasources` (`dataSourceID`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=87 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `modules`
--

INSERT INTO `modules` (`moduleID`,`classname`,`name`,`alias`,`description`,`xslPath`,`xslPathType`,`anonymousAccess`,`userAccess`,`adminAccess`,`enabled`,`visibleInMenu`,`sectionID`,`dataSourceID`,`staticContentPackage`) VALUES 
 (8,'se.unlogic.hierarchy.modules.login.LoginModule','Logga in','loginmodule','Modul för inloggning','LoginModule.se.xsl','Classpath',1,0,0,1,0,13,NULL,NULL),
 (9,'se.unlogic.hierarchy.modules.logout.LogoutModule','Logga ut','logout','Modul fÃ¶r utloggning','LogoutModule.se.xsl','Classpath',0,1,1,1,1,14,NULL,NULL),
 (13,'se.unlogic.hierarchy.modules.pagemodules.PageViewModule','Sidvisningsmodul','page','Modul för visning av statiska sidor','PageViewModule.se.xsl','Classpath',1,1,1,1,1,1,NULL,'staticcontent'),
 (16,'se.unlogic.hierarchy.modules.useradmin.UserAdminModule','Användare','useradmin','Användare','UserAdminModule.xsl','Classpath',0,0,1,1,1,4,NULL,'staticcontent'),
 (17,'se.unlogic.hierarchy.modules.userprofile.UserProfileModule','Mina inställningar','userprofile','Modul för ändring av användaruppgifter','userprofile.xsl','Classpath',0,1,1,1,1,0,NULL,NULL),
 (37,'se.unlogic.hierarchy.modules.menuadmin.MenuAdminModule','Meny','menuadmin','Modul för menyadministration','MenuAdminModule.xsl','Classpath',0,0,1,1,1,4,NULL,'staticcontent'),
 (38,'se.unlogic.hierarchy.modules.pagemodules.PageViewModule','Sidvisningsmodul','page','Modul för visning av statiska sidor','PageViewModule.se.xsl','Classpath',1,1,1,1,0,4,NULL,'staticcontent'),
 (39,'se.unlogic.hierarchy.modules.pagemodules.PageAdminModule','Sidor','pageadmin','Modul för administration av statiska sidor','PageAdminModule.xsl','Classpath',0,0,1,1,1,4,NULL,'staticcontentadmin'),
 (40,'se.unlogic.hierarchy.modules.test.XSLReload','Ladda om stilmall','xslreload','Module for reloading XSL stylesheet','',NULL,0,0,1,1,1,4,NULL,'staticcontent'),
 (56,'se.unlogic.hierarchy.modules.runtimeinfo.RuntimeInfoModule','System info','runtimeinfo','Visar info om minne och processorer','runtimeinfo.xsl','Classpath',0,0,1,1,1,4,NULL,NULL),
 (61,'se.unlogic.hierarchy.modules.systemadmin.SystemAdminModule','Moduler och sektioner','systemadmin','Systemadministration','SystemAdminModule.xsl','Classpath',0,0,1,1,1,4,NULL,'staticcontent'),
 (64,'se.unlogic.hierarchy.modules.threadinfo.ThreadInfoModule','Tråd info','threadinfo','Visar alla aktiva trådar i systemet','threadinfo.xsl','Classpath',0,0,1,1,1,4,NULL,NULL),
 (67,'se.unlogic.hierarchy.modules.staticcontent.StaticContentModule','Staticcontent','static','Modul som möjligör åtkomt till statiska filer i classpath',NULL,NULL,1,1,1,1,0,1,NULL,NULL),
 (69,'se.unlogic.hierarchy.modules.usersessionadmin.UserSessionAdminModule','Inloggade användare','sessionadmin','Administration av inloggade användare','UserSessionAdminModule.xsl','Classpath',0,0,1,1,1,4,NULL,'staticcontent'),
 (70,'se.unlogic.hierarchy.modules.useradmin.GroupAdminModule','Grupper','groups','Grupp administration','GroupAdminModule.xsl','Classpath',0,0,1,1,1,4,NULL,'staticcontent'),
 (71,'se.unlogic.hierarchy.modules.dbuserprovider.DBUserProviderModule','DB User Provider','userprovider','Provides users and groups from multiple sources',NULL,NULL,0,0,0,1,0,4,NULL,NULL),
 (79,'se.unlogic.hierarchy.modules.pagemodules.PageViewModule','Sidvisningsmodul','page','Modul för visning av statiska sidor','PageViewModule.se.xsl','Classpath',1,1,1,1,1,20,NULL,'staticcontent'),
 (81,'se.akroken.osf.jodp.modules.PublicModule','Dokument','browse','Dokument arkiv','/se/jodp/demo/modules/PublicModule.xsl','Classpath',1,1,1,1,0,6,NULL,'/se/jodp/demo/modules/staticcontent'),
 (82,'se.akroken.osf.jodp.modules.AdminModule','Dokument adm','browse','Dokument administration','/se/jodp/demo/modules/AdminModule.xsl','Classpath',1,1,1,1,0,20,NULL,'/se/jodp/demo/modules/staticcontent');


--
-- Definition of table `modulesettings`
--

CREATE TABLE `modulesettings` (
  `counter` int(10) unsigned NOT NULL auto_increment,
  `moduleID` int(10) unsigned NOT NULL,
  `id` varchar(255) NOT NULL,
  `value` mediumtext NOT NULL,
  PRIMARY KEY  (`counter`),
  KEY `FK_modulesettings_1` (`moduleID`),
  CONSTRAINT `FK_modulesettings_1` FOREIGN KEY (`moduleID`) REFERENCES `modules` (`moduleID`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=118 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `modulesettings`
--

INSERT INTO `modulesettings` (`counter`,`moduleID`,`id`,`value`) VALUES 
 (113,81,'allowConvert','false'),
 (114,81,'hostAddress1','127.0.0.1'),
 (115,81,'hostPort1','8100'),
 (116,81,'menuItemType','MENUITEM'),
 (117,82,'menuItemType','MENUITEM');


--
-- Definition of table `moduleusers`
--

CREATE TABLE `moduleusers` (
  `moduleID` int(10) unsigned NOT NULL auto_increment,
  `userID` int(10) unsigned NOT NULL,
  PRIMARY KEY  (`moduleID`,`userID`),
  CONSTRAINT `FK_moduleusers_1` FOREIGN KEY (`moduleID`) REFERENCES `modules` (`moduleID`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `moduleusers`
--



--
-- Definition of table `pagegroups`
--

CREATE TABLE `pagegroups` (
  `pageID` int(10) unsigned NOT NULL,
  `groupID` int(10) unsigned NOT NULL,
  PRIMARY KEY  (`pageID`,`groupID`),
  CONSTRAINT `FK_pagegroups_1` FOREIGN KEY (`pageID`) REFERENCES `pages` (`pageID`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `pagegroups`
--



--
-- Definition of table `pages`
--

CREATE TABLE `pages` (
  `pageID` int(10) unsigned NOT NULL auto_increment,
  `name` varchar(255) NOT NULL default '',
  `description` varchar(255) NOT NULL default '',
  `text` mediumtext NOT NULL,
  `enabled` varchar(45) NOT NULL default '',
  `visibleInMenu` tinyint(1) NOT NULL default '0',
  `anonymousAccess` tinyint(1) NOT NULL default '0',
  `userAccess` tinyint(1) NOT NULL default '0',
  `adminAccess` tinyint(1) NOT NULL default '0',
  `sectionID` int(10) unsigned NOT NULL default '0',
  `alias` varchar(255) NOT NULL default '',
  `breadCrumb` tinyint(1) NOT NULL default '1',
  PRIMARY KEY  (`pageID`),
  UNIQUE KEY `Index_3` (`sectionID`,`alias`),
  KEY `FK_pages_1` (`sectionID`),
  CONSTRAINT `FK_pages_1` FOREIGN KEY (`sectionID`) REFERENCES `sections` (`sectionID`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=latin1 COMMENT='InnoDB free: 191488 kB; (`sectionID`) REFER `fkdb-system/sec';

--
-- Dumping data for table `pages`
--

INSERT INTO `pages` (`pageID`,`name`,`description`,`text`,`enabled`,`visibleInMenu`,`anonymousAccess`,`userAccess`,`adminAccess`,`sectionID`,`alias`,`breadCrumb`) VALUES 
 (8,'Dokument','Beskrivning av dokumentgeneratorn','<h1>Dokumentgeneratorn</h1>\r\n<p>Dokumentgeneratorn &auml;r en Java-baserad webbapplikation f&ouml;r hantering och genering av dokument i OpenDocument Format. Dokument&nbsp;genereras direkt i webbl&auml;saren utan att anv&auml;nda makron eller&nbsp;annan&nbsp;programvara p&aring; klienten.</p>\r\n<p>Applikationens grafiska gr&auml;nssnitt &auml;r helt webbaserat och kan anpassas efter&nbsp;en&nbsp;organisations&nbsp;grafiska profil och riktlinjer f&ouml;r att&nbsp;sm&auml;lta in i ett intran&auml;t/portal. Med hj&auml;lp av webbgr&auml;nssnittet f&aring;r anv&auml;ndaren bl&auml;dra och s&ouml;ka bland organisationens dokumentmallar och utifr&aring;n dessa&nbsp;generera dokument.</p>\r\n<p>Det finns m&ouml;jlighet att&nbsp;h&auml;mta anv&auml;ndaruppgifter fr&aring;n en databas och utifr&aring;n dessa uppgifter prioritera vilka mallar som skall visas p&aring; f&ouml;rsta sidan n&auml;r anv&auml;ndaren bes&ouml;ker applikationen samt att automatisk fylla i&nbsp; f&auml;lt i de dokument som anv&auml;ndaren v&auml;ljer att generera.<br />\r\n&nbsp;</p>\r\n<h2>Administration</h2>\r\n<p>Utvalda&nbsp;anv&auml;ndare kan&nbsp;administrera Dokumentgeneratorn direkt i webbl&auml;saren.&nbsp;<br />\r\nDe administrativa funktionerna&nbsp;som kan&nbsp;hanteras &auml;r bland annat:</p>\r\n<ul type=\"disc\" style=\"margin-top: 0cm;\">\r\n    <li>Uppladdning av nya dokumentmallar</li>\r\n    <li>Borttagning av befintliga dokumentmallar</li>\r\n    <li>Kategorisering av dokumentmallar</li>\r\n    <li>Koppling av beh&ouml;righeter fr&aring;n&nbsp;metakatalogen till olika mallkategorier</li>\r\n    <li>Hantering av administrat&ouml;rskonton</li>\r\n</ul>\r\n<p>&nbsp;</p>','1',0,1,1,1,1,'firstpage',1);


--
-- Definition of table `pageusers`
--

CREATE TABLE `pageusers` (
  `pageID` int(10) unsigned NOT NULL,
  `userID` int(10) unsigned NOT NULL,
  PRIMARY KEY  (`pageID`,`userID`),
  CONSTRAINT `FK_pageusers_1` FOREIGN KEY (`pageID`) REFERENCES `pages` (`pageID`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `pageusers`
--



--
-- Definition of table `sectiongroups`
--

CREATE TABLE `sectiongroups` (
  `sectionID` int(10) unsigned NOT NULL,
  `groupID` int(10) unsigned NOT NULL,
  PRIMARY KEY  (`sectionID`,`groupID`),
  CONSTRAINT `FK_sectiongroups_1` FOREIGN KEY (`sectionID`) REFERENCES `sections` (`sectionID`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `sectiongroups`
--



--
-- Definition of table `sections`
--

CREATE TABLE `sections` (
  `sectionID` int(10) unsigned NOT NULL auto_increment,
  `parentSectionID` int(10) unsigned default NULL,
  `alias` varchar(20) NOT NULL default '',
  `enabled` tinyint(1) NOT NULL default '0',
  `anonymousAccess` tinyint(1) NOT NULL default '0',
  `userAccess` tinyint(1) NOT NULL default '0',
  `adminAccess` tinyint(1) NOT NULL default '0',
  `visibleInMenu` tinyint(1) NOT NULL default '0',
  `name` varchar(255) NOT NULL default '',
  `description` varchar(255) NOT NULL default '',
  `anonymousDefaultURI` varchar(255) NOT NULL default '',
  `userDefaultURI` varchar(255) NOT NULL default '',
  `adminDefaultURI` varchar(255) NOT NULL default '',
  PRIMARY KEY  (`sectionID`),
  UNIQUE KEY `Index_2` (`parentSectionID`,`alias`),
  CONSTRAINT `FK_sections_1` FOREIGN KEY (`parentSectionID`) REFERENCES `sections` (`sectionID`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `sections`
--

INSERT INTO `sections` (`sectionID`,`parentSectionID`,`alias`,`enabled`,`anonymousAccess`,`userAccess`,`adminAccess`,`visibleInMenu`,`name`,`description`,`anonymousDefaultURI`,`userDefaultURI`,`adminDefaultURI`) VALUES 
 (1,NULL,'Home',1,1,1,1,1,'Home','Unlogic.se','/login/loginmodule','/page/firstpage','/page/firstpage'),
 (4,1,'administration',1,0,0,1,1,'Administration','System administration','/useradmin','/useradmin','/useradmin'),
 (6,1,'documents',1,1,1,1,1,'Dokument','Dokumentmallar','/browse','/browse','/browse'),
 (13,1,'login',1,1,0,0,1,'Logga in','Logga in i dokumentgeneratorn','/loginmodule','/loginmodule','/loginmodule'),
 (14,1,'logout',1,0,1,0,1,'Logga ut','Logga ut från dokumentgeneratorn','/logout','/logout','/logout'),
 (20,1,'document-admin',1,1,1,1,1,'Dokument adm.','Dokument administration','/browse','/browse','/browse');


--
-- Definition of table `sectionusers`
--

CREATE TABLE `sectionusers` (
  `sectionID` int(10) unsigned NOT NULL auto_increment,
  `userID` int(10) unsigned NOT NULL,
  PRIMARY KEY  (`sectionID`,`userID`),
  CONSTRAINT `FK_sectionusers_1` FOREIGN KEY (`sectionID`) REFERENCES `sections` (`sectionID`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `sectionusers`
--



--
-- Definition of table `templates`
--

CREATE TABLE `templates` (
  `templateID` int(10) unsigned NOT NULL auto_increment,
  `categoryID` int(10) unsigned NOT NULL,
  `filename` varchar(255) NOT NULL,
  `size` int(10) unsigned NOT NULL,
  `description` text NOT NULL,
  `blob` mediumblob NOT NULL,
  `name` varchar(255) NOT NULL,
  `allowBackground` tinyint(1) unsigned NOT NULL,
  `allowIndentation` tinyint(1) unsigned NOT NULL,
  `allowLogoswitch` tinyint(1) unsigned default NULL,
  PRIMARY KEY  (`templateID`),
  KEY `FK_templates_1` (`categoryID`),
  CONSTRAINT `FK_templates_1` FOREIGN KEY (`categoryID`) REFERENCES `categories` (`categoryID`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=372 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `templates`
--

INSERT INTO `templates` (`templateID`,`categoryID`,`filename`,`size`,`description`,`blob`,`name`,`allowBackground`,`allowIndentation`,`allowLogoswitch`) VALUES 
 (370,6,'brev_externt.odt',12090,'Mallen används vi brevförsändelser',0x[BLOB],'Brevmall',1,0,0),
 (371,9,'pm.odt',10362,'Denna mall används vid skapande av PM',0x[BLOB],'PM mall',1,0,0);


--
-- Definition of table `userattributes`
--

CREATE TABLE `userattributes` (
  `userAttributeID` int(10) unsigned NOT NULL auto_increment,
  `name` varchar(255) NOT NULL,
  `enabled` tinyint(1) unsigned NOT NULL,
  PRIMARY KEY  (`userAttributeID`)
) ENGINE=InnoDB AUTO_INCREMENT=36 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `userattributes`
--

INSERT INTO `userattributes` (`userAttributeID`,`name`,`enabled`) VALUES 
 (1,'Adress',1),
 (2,'Användartyp',1),
 (3,'Avdelning',1),
 (4,'Efternamn',1),
 (5,'Extern E-post',1),
 (18,'Faxnummer',1),
 (19,'Förnamn',1),
 (20,'Funktion',1),
 (21,'Intern E-post',1),
 (22,'Mellannamn',1),
 (23,'Mobilnummer',1),
 (24,'Myndighetsbenämning',0),
 (25,'Myndighetskod',0),
 (26,'Namn',1),
 (27,'Ort',1),
 (28,'Personnummer',1),
 (29,'Placering',1),
 (30,'Postnummer',0),
 (31,'Sekundär myndighet',0),
 (32,'Sekundär myndighetskod',1),
 (33,'Svarskod',0),
 (34,'Telefonnummer',1),
 (35,'Titel',1);


--
-- Definition of table `usergroups`
--

CREATE TABLE `usergroups` (
  `userID` int(10) unsigned NOT NULL,
  `groupID` int(10) unsigned NOT NULL,
  PRIMARY KEY  (`userID`,`groupID`),
  KEY `FK_usergroups_2` (`groupID`),
  CONSTRAINT `FK_usergroups_1` FOREIGN KEY (`userID`) REFERENCES `users` (`userID`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `FK_usergroups_2` FOREIGN KEY (`groupID`) REFERENCES `groups` (`groupID`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `usergroups`
--

INSERT INTO `usergroups` (`userID`,`groupID`) VALUES 
 (1,6);


--
-- Definition of table `virtualmenuitemgroups`
--

CREATE TABLE `virtualmenuitemgroups` (
  `menuItemID` int(10) unsigned NOT NULL auto_increment,
  `groupID` int(10) unsigned NOT NULL,
  PRIMARY KEY  (`menuItemID`,`groupID`),
  CONSTRAINT `FK_virtualmenuitemgroups_1` FOREIGN KEY (`menuItemID`) REFERENCES `virtualmenuitems` (`menuItemID`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `virtualmenuitemgroups`
--



--
-- Definition of table `virtualmenuitems`
--

CREATE TABLE `virtualmenuitems` (
  `menuItemID` int(10) unsigned NOT NULL auto_increment,
  `itemtype` varchar(20) NOT NULL default '',
  `name` varchar(45) default NULL,
  `description` text,
  `url` text,
  `anonymousAccess` tinyint(1) NOT NULL default '0',
  `userAccess` tinyint(1) NOT NULL default '0',
  `adminAccess` tinyint(1) NOT NULL default '0',
  `sectionID` int(10) unsigned NOT NULL default '0',
  PRIMARY KEY  (`menuItemID`),
  KEY `FK_menuadmin_1` (`sectionID`),
  CONSTRAINT `FK_virtualmenuitems_1` FOREIGN KEY (`sectionID`) REFERENCES `sections` (`sectionID`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `virtualmenuitems`
--



--
-- Definition of table `virtualmenuitemusers`
--

CREATE TABLE `virtualmenuitemusers` (
  `menuItemID` int(10) unsigned NOT NULL auto_increment,
  `userID` int(10) unsigned NOT NULL,
  PRIMARY KEY  (`menuItemID`,`userID`),
  CONSTRAINT `FK_virtualmenuitemusers_1` FOREIGN KEY (`menuItemID`) REFERENCES `virtualmenuitems` (`menuItemID`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `virtualmenuitemusers`
--





