3 require_once 
'Services/Notifications/classes/class.ilNotificationDatabaseHelper.php';
 
   21         if (!$ilDB->tableExists(self::$tbl_userconfig)) {
 
   23                 'usr_id' =>  array(
'type' => 
'integer', 
'notnull' => 
true, 
'length' => 4),
 
   24                 'module' =>  array(
'type' => 
'text'   , 
'notnull' => 
true, 
'length' => 100),
 
   25                 'channel' => array(
'type' => 
'text'   , 
'notnull' => 
true, 
'length' => 100),
 
   27             $ilDB->createTable(self::$tbl_userconfig, $fields);
 
   28             $ilDB->addPrimaryKey(self::$tbl_userconfig, array(
'usr_id', 
'module', 
'channel'));
 
   31         if (!$ilDB->tableExists(self::$tbl_userlistener)) {
 
   33                 'usr_id' =>    array(
'type' => 
'integer', 
'notnull' => 
true, 
'length' => 4),
 
   34                 'module' =>    array(
'type' => 
'text'   , 
'notnull' => 
true, 
'length' => 100),
 
   35                 'sender_id' => array(
'type' => 
'integer', 
'notnull' => 
true, 
'length' => 4),
 
   36                 'disabled' =>  array(
'type' => 
'integer', 
'notnull' => 
true, 
'length' => 1),
 
   38             $ilDB->createTable(self::$tbl_userlistener, $fields);
 
   39             $ilDB->addPrimaryKey(self::$tbl_userlistener, array(
'usr_id', 
'module', 
'sender_id'));
 
   42         if (!$ilDB->tableExists(self::$tbl_notification_data)) {
 
   44                 'notification_id' =>  array(
'type' => 
'integer', 
'notnull' => 
true, 
'length' => 4),
 
   45                 'serialized' =>       array(
'type' => 
'text'   , 
'notnull' => 
true, 
'length' => 4000),
 
   47             $ilDB->createTable(self::$tbl_notification_data, $fields);
 
   48             $ilDB->addPrimaryKey(self::$tbl_notification_data, array(
'notification_id'));
 
   50             $ilDB->createSequence(self::$tbl_notification_data);
 
   53         if (!$ilDB->tableExists(self::$tbl_notification_queue)) {
 
   55                 'notification_id' =>      array(
'type' => 
'integer'  , 
'notnull' => 
true, 
'length' => 4),
 
   56                 'usr_id' =>               array(
'type' => 
'integer'  , 
'notnull' => 
true, 
'length' => 4),
 
   57                 #
'notification_channel' => array(
'type' => 
'text'     , 
'notnull' => 
true, 
'length' => 100),
 
   58                 'valid_until' =>          array(
'type' => 
'integer'  , 
'notnull' => 
true, 
'length' => 4),
 
   60             $ilDB->createTable(self::$tbl_notification_queue, $fields);
 
   61             #$ilDB->addPrimaryKey(self::$tbl_notification_queue, array('notification_id', 'usr_id', 'notification_channel')); 
   62             $ilDB->addPrimaryKey(self::$tbl_notification_queue, array(
'notification_id', 
'usr_id'));
 
   65         if (!$ilDB->tableExists(self::$tbl_notification_osd_handler)) {
 
   67                 'notification_osd_id' => array(
'type' => 
'integer'  , 
'notnull' => 
true, 
'length' => 4),
 
   68                 'usr_id' =>              array(
'type' => 
'integer'  , 
'notnull' => 
true, 
'length' => 4),
 
   69                 'serialized' =>          array(
'type' => 
'text'     , 
'notnull' => 
true, 
'length' => 4000),
 
   70                 'valid_until' =>         array(
'type' => 
'integer'  , 
'notnull' => 
true, 
'length' => 4),
 
   71                 'time_added' =>          array(
'type' => 
'integer'  , 
'notnull' => 
true, 
'length' => 4),
 
   72                 'type' =>                array(
'type' => 
'text'     , 
'notnull' => 
true, 
'length' => 100),
 
   74             $ilDB->createTable(self::$tbl_notification_osd_handler, $fields);
 
   76             $ilDB->addPrimaryKey(self::$tbl_notification_osd_handler, array(
'notification_osd_id'));
 
   80             #$ilDB->addIndex(self::$tbl_notification_osd_handler, array('usr_id', 'valid_until', 'time_added')); 
   82             $ilDB->createSequence(self::$tbl_notification_osd_handler);
 
   85         if(!$ilDB->tableExists(self::$tbl_notification_channels)) {
 
   87                 'channel_name'=> array(
'type' => 
'text', 
'notnull' => 
true, 
'length' => 100),
 
   88                 'title' =>       array(
'type' => 
'text', 
'notnull' => 
true, 
'length' => 100),
 
   89                 'description'=>  array(
'type' => 
'text', 
'notnull' => 
true, 
'length' => 4000),
 
   90                 'class' =>       array(
'type' => 
'text', 
'notnull' => 
true, 
'length' => 100),
 
   91                 'include' =>     array(
'type' => 
'text', 
'notnull' => 
true, 
'length' => 100),
 
   92                 'config_type' => array(
'type' => 
'text', 
'notnull' => 
true, 
'length' => 30),
 
   94             $ilDB->createTable(self::$tbl_notification_channels, $fields);
 
   96             $ilDB->addPrimaryKey(self::$tbl_notification_channels, array(
'channel_name'));
 
  102         if(!$ilDB->tableExists(self::$tbl_notification_types)) {
 
  104                 'type_name'=>           array(
'type' => 
'text', 
'notnull' => 
true, 
'length' => 100),
 
  105                 'title' =>              array(
'type' => 
'text', 
'notnull' => 
true, 
'length' => 100),
 
  106                 'description' =>        array(
'type' => 
'text', 
'notnull' => 
true, 
'length' => 100),
 
  107                 'notification_group' => array(
'type' => 
'text', 
'notnull' => 
true, 
'length' => 100),
 
  108                 'config_type' =>        array(
'type' => 
'text', 
'notnull' => 
true, 
'length' => 30),
 
  110             $ilDB->createTable(self::$tbl_notification_types, $fields);
 
  111             $ilDB->addPrimaryKey(self::$tbl_notification_types, array(
'type_name'));
 
  120     public static function registerChannel($name, 
$title, $description,  $class, $classfile, $config_type = 
'set_by_user') {
 
  124     public static function registerType($name, 
$title, $description, $notification_group, $config_type = 
'set_by_user') {