ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
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

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

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

Referenced by setupTables().

{
ilNotificationDatabaseHandler::registerChannel($name, $title, $description, $class, $classfile, $config_type);
}

+ Here is the caller graph for this function:

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

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

Referenced by setupTables().

{
ilNotificationDatabaseHandler::registerType($name, $title, $description, $notification_group, $config_type);
}

+ Here is the caller graph for this function:

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

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

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

{
global $ilDB;
if (!$ilDB->tableExists(self::$tbl_userconfig)) {
$fields = array(
'usr_id' => array('type' => 'integer', 'notnull' => true, 'length' => 4),
'module' => array('type' => 'text' , 'notnull' => true, 'length' => 100),
'channel' => array('type' => 'text' , 'notnull' => true, 'length' => 100),
);
$ilDB->createTable(self::$tbl_userconfig, $fields);
$ilDB->addPrimaryKey(self::$tbl_userconfig, array('usr_id', 'module', 'channel'));
}
if (!$ilDB->tableExists(self::$tbl_userlistener)) {
$fields = array(
'usr_id' => array('type' => 'integer', 'notnull' => true, 'length' => 4),
'module' => array('type' => 'text' , 'notnull' => true, 'length' => 100),
'sender_id' => array('type' => 'integer', 'notnull' => true, 'length' => 4),
'disabled' => array('type' => 'integer', 'notnull' => true, 'length' => 1),
);
$ilDB->createTable(self::$tbl_userlistener, $fields);
$ilDB->addPrimaryKey(self::$tbl_userlistener, array('usr_id', 'module', 'sender_id'));
}
if (!$ilDB->tableExists(self::$tbl_notification_data)) {
$fields = array(
'notification_id' => array('type' => 'integer', 'notnull' => true, 'length' => 4),
'serialized' => array('type' => 'text' , 'notnull' => true, 'length' => 4000),
);
$ilDB->createTable(self::$tbl_notification_data, $fields);
$ilDB->addPrimaryKey(self::$tbl_notification_data, array('notification_id'));
$ilDB->createSequence(self::$tbl_notification_data);
}
if (!$ilDB->tableExists(self::$tbl_notification_queue)) {
$fields = array(
'notification_id' => array('type' => 'integer' , 'notnull' => true, 'length' => 4),
'usr_id' => array('type' => 'integer' , 'notnull' => true, 'length' => 4),
#'notification_channel' => array('type' => 'text' , 'notnull' => true, 'length' => 100),
'valid_until' => array('type' => 'integer' , 'notnull' => true, 'length' => 4),
);
$ilDB->createTable(self::$tbl_notification_queue, $fields);
#$ilDB->addPrimaryKey(self::$tbl_notification_queue, array('notification_id', 'usr_id', 'notification_channel'));
$ilDB->addPrimaryKey(self::$tbl_notification_queue, array('notification_id', 'usr_id'));
}
if (!$ilDB->tableExists(self::$tbl_notification_osd_handler)) {
$fields = array(
'notification_osd_id' => array('type' => 'integer' , 'notnull' => true, 'length' => 4),
'usr_id' => array('type' => 'integer' , 'notnull' => true, 'length' => 4),
'serialized' => array('type' => 'text' , 'notnull' => true, 'length' => 4000),
'valid_until' => array('type' => 'integer' , 'notnull' => true, 'length' => 4),
'time_added' => array('type' => 'integer' , 'notnull' => true, 'length' => 4),
'type' => array('type' => 'text' , 'notnull' => true, 'length' => 100),
);
$ilDB->createTable(self::$tbl_notification_osd_handler, $fields);
$ilDB->addPrimaryKey(self::$tbl_notification_osd_handler, array('notification_osd_id'));
#$ilDB->addIndex(self::$tbl_notification_osd_handler, array('usr_id', 'valid_until', 'time_added'));
$ilDB->createSequence(self::$tbl_notification_osd_handler);
}
if(!$ilDB->tableExists(self::$tbl_notification_channels)) {
$fields = array(
'channel_name'=> array('type' => 'text', 'notnull' => true, 'length' => 100),
'title' => array('type' => 'text', 'notnull' => true, 'length' => 100),
'description'=> array('type' => 'text', 'notnull' => true, 'length' => 4000),
'class' => array('type' => 'text', 'notnull' => true, 'length' => 100),
'include' => array('type' => 'text', 'notnull' => true, 'length' => 100),
'config_type' => array('type' => 'text', 'notnull' => true, 'length' => 30),
);
$ilDB->createTable(self::$tbl_notification_channels, $fields);
$ilDB->addPrimaryKey(self::$tbl_notification_channels, array('channel_name'));
ilNotificationSetupHelper::registerChannel('mail', 'mail', 'mail_desc', 'ilNotificationMailHandler', 'Services/Notifications/classes/class.ilNotificationMailHandler.php');
ilNotificationSetupHelper::registerChannel('osd', 'osd', 'osd_desc', 'ilNotificationOSDHandler', 'Services/Notifications/classes/class.ilNotificationOSDHandler.php');
}
if(!$ilDB->tableExists(self::$tbl_notification_types)) {
$fields = array(
'type_name'=> array('type' => 'text', 'notnull' => true, 'length' => 100),
'title' => array('type' => 'text', 'notnull' => true, 'length' => 100),
'description' => array('type' => 'text', 'notnull' => true, 'length' => 100),
'notification_group' => array('type' => 'text', 'notnull' => true, 'length' => 100),
'config_type' => array('type' => 'text', 'notnull' => true, 'length' => 30),
);
$ilDB->createTable(self::$tbl_notification_types, $fields);
$ilDB->addPrimaryKey(self::$tbl_notification_types, array('type_name'));
ilNotificationSetupHelper::registerType('chat_invitation', 'chat_invitation', 'chat_invitation_description', 'chat');
//ilNotificationSetupHelper::registerType('adobe_connect_invitation', 'adobe_connect_invitation', 'adobe_connect_invitation_description', 'adobe_connect');
ilNotificationSetupHelper::registerType('osd_maint', 'osd_maint', 'osd_maint_description', 'osd_notification');
}
}

+ Here is the call graph for this function:

Field Documentation

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

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