ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilNotificationSetupHelper Class Reference

Helper class for initial database setup and registration of notification. More...

+ Collaboration diagram for ilNotificationSetupHelper:

Static Public Member Functions

static setupTables ()
 
static registerChannel ($name, $title, $description, $class, $classfile, $config_type='set_by_user')
 
static registerType ($name, $title, $description, $notification_group, $config_type='set_by_user')
 

Static Public Attributes

static $tbl_userconfig = 'notification_usercfg'
 
static $tbl_userlistener = 'notification_listener'
 
static $tbl_notification_data = 'notification_data'
 
static $tbl_notification_queue = 'notification_queue'
 
static $tbl_notification_osd_handler = 'notification_osd'
 
static $tbl_notification_channels = 'notification_channels'
 
static $tbl_notification_types = 'notification_types'
 

Detailed Description

Helper class for initial database setup and registration of notification.

Definition at line 8 of file class.ilNotificationSetupHelper.php.

Member Function Documentation

◆ registerChannel()

static ilNotificationSetupHelper::registerChannel (   $name,
  $title,
  $description,
  $class,
  $classfile,
  $config_type = 'set_by_user' 
)
static

Definition at line 121 of file class.ilNotificationSetupHelper.php.

References $description, $name, $title, and ilNotificationDatabaseHandler\registerChannel().

Referenced by setupTables().

122  {
123  ilNotificationDatabaseHandler::registerChannel($name, $title, $description, $class, $classfile, $config_type);
124  }
static registerChannel($name, $title, $description, $class, $classfile, $config_type)
Registers a new notification channel for distributing notifications.
if($format !==null) $name
Definition: metadata.php:146
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ registerType()

static ilNotificationSetupHelper::registerType (   $name,
  $title,
  $description,
  $notification_group,
  $config_type = 'set_by_user' 
)
static

Definition at line 126 of file class.ilNotificationSetupHelper.php.

References $description, $name, $title, and ilNotificationDatabaseHandler\registerType().

Referenced by setupTables().

127  {
128  ilNotificationDatabaseHandler::registerType($name, $title, $description, $notification_group, $config_type);
129  }
static registerType($name, $title, $description, $notification_group, $config_type)
Registers a new notification type.
if($format !==null) $name
Definition: metadata.php:146
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setupTables()

static ilNotificationSetupHelper::setupTables ( )
static
Todo:
hier wird ein fehler geworfen...

Definition at line 18 of file class.ilNotificationSetupHelper.php.

References $ilDB, array, registerChannel(), and registerType().

19  {
20  global $ilDB;
21 
22  if (!$ilDB->tableExists(self::$tbl_userconfig)) {
23  $fields = array(
24  'usr_id' => array('type' => 'integer', 'notnull' => true, 'length' => 4),
25  'module' => array('type' => 'text' , 'notnull' => true, 'length' => 100),
26  'channel' => array('type' => 'text' , 'notnull' => true, 'length' => 100),
27  );
28  $ilDB->createTable(self::$tbl_userconfig, $fields);
29  $ilDB->addPrimaryKey(self::$tbl_userconfig, array('usr_id', 'module', 'channel'));
30  }
31 
32  if (!$ilDB->tableExists(self::$tbl_userlistener)) {
33  $fields = array(
34  'usr_id' => array('type' => 'integer', 'notnull' => true, 'length' => 4),
35  'module' => array('type' => 'text' , 'notnull' => true, 'length' => 100),
36  'sender_id' => array('type' => 'integer', 'notnull' => true, 'length' => 4),
37  'disabled' => array('type' => 'integer', 'notnull' => true, 'length' => 1),
38  );
39  $ilDB->createTable(self::$tbl_userlistener, $fields);
40  $ilDB->addPrimaryKey(self::$tbl_userlistener, array('usr_id', 'module', 'sender_id'));
41  }
42 
43  if (!$ilDB->tableExists(self::$tbl_notification_data)) {
44  $fields = array(
45  'notification_id' => array('type' => 'integer', 'notnull' => true, 'length' => 4),
46  'serialized' => array('type' => 'text' , 'notnull' => true, 'length' => 4000),
47  );
48  $ilDB->createTable(self::$tbl_notification_data, $fields);
49  $ilDB->addPrimaryKey(self::$tbl_notification_data, array('notification_id'));
50 
51  $ilDB->createSequence(self::$tbl_notification_data);
52  }
53 
54  if (!$ilDB->tableExists(self::$tbl_notification_queue)) {
55  $fields = array(
56  'notification_id' => array('type' => 'integer' , 'notnull' => true, 'length' => 4),
57  'usr_id' => array('type' => 'integer' , 'notnull' => true, 'length' => 4),
58  #'notification_channel' => array('type' => 'text' , 'notnull' => true, 'length' => 100),
59  'valid_until' => array('type' => 'integer' , 'notnull' => true, 'length' => 4),
60  );
61  $ilDB->createTable(self::$tbl_notification_queue, $fields);
62  #$ilDB->addPrimaryKey(self::$tbl_notification_queue, array('notification_id', 'usr_id', 'notification_channel'));
63  $ilDB->addPrimaryKey(self::$tbl_notification_queue, array('notification_id', 'usr_id'));
64  }
65 
66  if (!$ilDB->tableExists(self::$tbl_notification_osd_handler)) {
67  $fields = array(
68  'notification_osd_id' => array('type' => 'integer' , 'notnull' => true, 'length' => 4),
69  'usr_id' => array('type' => 'integer' , 'notnull' => true, 'length' => 4),
70  'serialized' => array('type' => 'text' , 'notnull' => true, 'length' => 4000),
71  'valid_until' => array('type' => 'integer' , 'notnull' => true, 'length' => 4),
72  'time_added' => array('type' => 'integer' , 'notnull' => true, 'length' => 4),
73  'type' => array('type' => 'text' , 'notnull' => true, 'length' => 100),
74  );
75  $ilDB->createTable(self::$tbl_notification_osd_handler, $fields);
76 
77  $ilDB->addPrimaryKey(self::$tbl_notification_osd_handler, array('notification_osd_id'));
81  #$ilDB->addIndex(self::$tbl_notification_osd_handler, array('usr_id', 'valid_until', 'time_added'));
82 
83  $ilDB->createSequence(self::$tbl_notification_osd_handler);
84  }
85 
86  if (!$ilDB->tableExists(self::$tbl_notification_channels)) {
87  $fields = array(
88  'channel_name'=> array('type' => 'text', 'notnull' => true, 'length' => 100),
89  'title' => array('type' => 'text', 'notnull' => true, 'length' => 100),
90  'description'=> array('type' => 'text', 'notnull' => true, 'length' => 4000),
91  'class' => array('type' => 'text', 'notnull' => true, 'length' => 100),
92  'include' => array('type' => 'text', 'notnull' => true, 'length' => 100),
93  'config_type' => array('type' => 'text', 'notnull' => true, 'length' => 30),
94  );
95  $ilDB->createTable(self::$tbl_notification_channels, $fields);
96 
97  $ilDB->addPrimaryKey(self::$tbl_notification_channels, array('channel_name'));
98 
99  ilNotificationSetupHelper::registerChannel('mail', 'mail', 'mail_desc', 'ilNotificationMailHandler', 'Services/Notifications/classes/class.ilNotificationMailHandler.php');
100  ilNotificationSetupHelper::registerChannel('osd', 'osd', 'osd_desc', 'ilNotificationOSDHandler', 'Services/Notifications/classes/class.ilNotificationOSDHandler.php');
101  }
102 
103  if (!$ilDB->tableExists(self::$tbl_notification_types)) {
104  $fields = array(
105  'type_name'=> array('type' => 'text', 'notnull' => true, 'length' => 100),
106  'title' => array('type' => 'text', 'notnull' => true, 'length' => 100),
107  'description' => array('type' => 'text', 'notnull' => true, 'length' => 100),
108  'notification_group' => array('type' => 'text', 'notnull' => true, 'length' => 100),
109  'config_type' => array('type' => 'text', 'notnull' => true, 'length' => 30),
110  );
111  $ilDB->createTable(self::$tbl_notification_types, $fields);
112  $ilDB->addPrimaryKey(self::$tbl_notification_types, array('type_name'));
113 
114  ilNotificationSetupHelper::registerType('chat_invitation', 'chat_invitation', 'chat_invitation_description', 'chat');
115  //ilNotificationSetupHelper::registerType('adobe_connect_invitation', 'adobe_connect_invitation', 'adobe_connect_invitation_description', 'adobe_connect');
116  ilNotificationSetupHelper::registerType('osd_maint', 'osd_maint', 'osd_maint_description', 'osd_notification');
117  }
118  }
static registerChannel($name, $title, $description, $class, $classfile, $config_type='set_by_user')
Create styles array
The data for the language used.
static registerType($name, $title, $description, $notification_group, $config_type='set_by_user')
global $ilDB
+ Here is the call graph for this function:

Field Documentation

◆ $tbl_notification_channels

ilNotificationSetupHelper::$tbl_notification_channels = 'notification_channels'
static

◆ $tbl_notification_data

ilNotificationSetupHelper::$tbl_notification_data = 'notification_data'
static

◆ $tbl_notification_osd_handler

ilNotificationSetupHelper::$tbl_notification_osd_handler = 'notification_osd'
static

◆ $tbl_notification_queue

ilNotificationSetupHelper::$tbl_notification_queue = 'notification_queue'
static

◆ $tbl_notification_types

ilNotificationSetupHelper::$tbl_notification_types = 'notification_types'
static

◆ $tbl_userconfig

ilNotificationSetupHelper::$tbl_userconfig = 'notification_usercfg'
static

◆ $tbl_userlistener


The documentation for this class was generated from the following file: