ILIAS  release_7 Revision v7.30-3-g800a261c036
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 123 of file class.ilNotificationSetupHelper.php.

124 {
125 ilNotificationDatabaseHandler::registerChannel($name, $title, $description, $class, $classfile, $config_type);
126 }
static registerChannel($name, $title, $description, $class, $classfile, $config_type)
Registers a new notification channel for distributing notifications.
if($format !==null) $name
Definition: metadata.php:230

References $name, and 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 128 of file class.ilNotificationSetupHelper.php.

129 {
130 ilNotificationDatabaseHandler::registerType($name, $title, $description, $notification_group, $config_type);
131 }
static registerType($name, $title, $description, $notification_group, $config_type)
Registers a new notification type.

References $name, and 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.

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

References $DIC, $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: