ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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 120 of file class.ilNotificationSetupHelper.php.

120 {
121 ilNotificationDatabaseHandler::registerChannel($name, $title, $description, $class, $classfile, $config_type);
122 }
static registerChannel($name, $title, $description, $class, $classfile, $config_type)
Registers a new notification channel for distributing notifications.

References ilNotificationDatabaseHandler\registerChannel().

Referenced by setupTables().

+ 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 124 of file class.ilNotificationSetupHelper.php.

124 {
125 ilNotificationDatabaseHandler::registerType($name, $title, $description, $notification_group, $config_type);
126 }
static registerType($name, $title, $description, $notification_group, $config_type)
Registers a new notification type.

References ilNotificationDatabaseHandler\registerType().

Referenced by setupTables().

+ 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.

18 {
19 global $ilDB;
20
21 if (!$ilDB->tableExists(self::$tbl_userconfig)) {
22 $fields = array(
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),
26 );
27 $ilDB->createTable(self::$tbl_userconfig, $fields);
28 $ilDB->addPrimaryKey(self::$tbl_userconfig, array('usr_id', 'module', 'channel'));
29 }
30
31 if (!$ilDB->tableExists(self::$tbl_userlistener)) {
32 $fields = array(
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),
37 );
38 $ilDB->createTable(self::$tbl_userlistener, $fields);
39 $ilDB->addPrimaryKey(self::$tbl_userlistener, array('usr_id', 'module', 'sender_id'));
40 }
41
42 if (!$ilDB->tableExists(self::$tbl_notification_data)) {
43 $fields = array(
44 'notification_id' => array('type' => 'integer', 'notnull' => true, 'length' => 4),
45 'serialized' => array('type' => 'text' , 'notnull' => true, 'length' => 4000),
46 );
47 $ilDB->createTable(self::$tbl_notification_data, $fields);
48 $ilDB->addPrimaryKey(self::$tbl_notification_data, array('notification_id'));
49
50 $ilDB->createSequence(self::$tbl_notification_data);
51 }
52
53 if (!$ilDB->tableExists(self::$tbl_notification_queue)) {
54 $fields = array(
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),
59 );
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'));
63 }
64
65 if (!$ilDB->tableExists(self::$tbl_notification_osd_handler)) {
66 $fields = array(
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),
73 );
74 $ilDB->createTable(self::$tbl_notification_osd_handler, $fields);
75
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'));
81
82 $ilDB->createSequence(self::$tbl_notification_osd_handler);
83 }
84
85 if(!$ilDB->tableExists(self::$tbl_notification_channels)) {
86 $fields = array(
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),
93 );
94 $ilDB->createTable(self::$tbl_notification_channels, $fields);
95
96 $ilDB->addPrimaryKey(self::$tbl_notification_channels, array('channel_name'));
97
98 ilNotificationSetupHelper::registerChannel('mail', 'mail', 'mail_desc', 'ilNotificationMailHandler', 'Services/Notifications/classes/class.ilNotificationMailHandler.php');
99 ilNotificationSetupHelper::registerChannel('osd', 'osd', 'osd_desc', 'ilNotificationOSDHandler', 'Services/Notifications/classes/class.ilNotificationOSDHandler.php');
100 }
101
102 if(!$ilDB->tableExists(self::$tbl_notification_types)) {
103 $fields = array(
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),
109 );
110 $ilDB->createTable(self::$tbl_notification_types, $fields);
111 $ilDB->addPrimaryKey(self::$tbl_notification_types, array('type_name'));
112
113 ilNotificationSetupHelper::registerType('chat_invitation', 'chat_invitation', 'chat_invitation_description', 'chat');
114 //ilNotificationSetupHelper::registerType('adobe_connect_invitation', 'adobe_connect_invitation', 'adobe_connect_invitation_description', 'adobe_connect');
115 ilNotificationSetupHelper::registerType('osd_maint', 'osd_maint', 'osd_maint_description', 'osd_notification');
116 }
117 }
static registerChannel($name, $title, $description, $class, $classfile, $config_type='set_by_user')
static registerType($name, $title, $description, $notification_group, $config_type='set_by_user')
global $ilDB

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

+ 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: