Entwickler.NotificationCenter History

Hide minor edits - Show changes to markup

 
 
March 08, 2011, at 10:33 AM by mlunzena -
Changed lines 62-63 from:

<TODO: mlunzena> http://www.goodbyehelicopter.com/?p=259

to:

Dazu gibt es bisher keine gültige Richtlinie. Offenbar scheint sich aber abzuzeichnen, dass der Name in CamelCase geschrieben und eine Handlung beschreibt. Da das NotificationCenter an die Originalimplementation aus NextStep angelehnt ist, macht es vermutlich Sinnn, ähnliche Konventionen wie dort zu verwenden. So beschreibt der Artikel NSNotfication Not Working, But Looks Right? :: Find That Bug! ein BestPractice, wonach die Notifications:

JJColorChange

und:

JJColorChanged

nur schwer im Code zu unterscheiden sind, da sie sich lediglich um einen Buchstaben unterscheiden. Die Empfehlung lautet statt:

  • CamelCase
  • CamelCased

lieber:

  • CamelCase
  • CamelDidCase
  • CamelWillCase
  • CamelByCase

zu verwenden. Aus diesen Gründen wurden bei den Notifications für Dateien, Wikiseiten und Forumsbeiträgen die Namen entsprechend gewählt.

 
 
March 08, 2011, at 10:23 AM by mlunzena -
Added line 15:
Added lines 19-20:

<TODO: elmar oder anoack>

Added lines 27-35:

Notifications: CourseRemovedFromModule und CourseAddedToModule

lib/classes/StudipSemTree.class.php:                            NotificationCenter::postNotification('CourseRemovedFromModule', $studyarea, array('module_id' => $sem_tree_id, 'course_id' => $seminar_id));
lib/classes/StudipSemTree.class.php:                NotificationCenter::postNotification('CourseAddedToModule', $studyarea, array('module_id' => $sem_tree_id, 'course_id' => $seminar_id));

<TODO: elmar oder anoack>

Changed lines 44-66 from:

Notifications: @@PostingWillDelete

lib/dates.inc.php:    NotificationCenter::postNotification('PostingWillDelete', $topic_id);
lib/dates.inc.php:    NotificationCenter::postNotification('PostingDidDelete', $topic_id);
lib/wiki.inc.php:        NotificationCenter::postNotification('WikiPageWillUpdate', array($range_id, $keyword));
lib/wiki.inc.php:        NotificationCenter::postNotification('WikiPageDidUpdate', array($range_id, $keyword));
lib/wiki.inc.php:        NotificationCenter::postNotification('WikiPageWillCreate', array($range_id, $keyword));
lib/wiki.inc.php:        NotificationCenter::postNotification('WikiPageDidCreate', array($range_id, $keyword));
lib/wiki.inc.php:    NotificationCenter::postNotification('WikiPageWillDelete', array($range_id, $keyword));
lib/wiki.inc.php:    NotificationCenter::postNotification('WikiPageDidDelete', array($range_id, $keyword));
public/forum.php:        NotificationCenter::postNotification('PostingWillCreate', $update);
public/forum.php:        NotificationCenter::postNotification('PostingDidCreate', $update);
public/forum.php:        NotificationCenter::postNotification('PostingWillUpdate', $update);
public/forum.php:        NotificationCenter::postNotification('PostingDidUpdate', $update);

Notifications: CourseRemovedFromModule und CourseAddedToModule

lib/classes/StudipSemTree.class.php:                            NotificationCenter::postNotification('CourseRemovedFromModule', $studyarea, array('module_id' => $sem_tree_id, 'course_id' => $seminar_id));
lib/classes/StudipSemTree.class.php:                NotificationCenter::postNotification('CourseAddedToModule', $studyarea, array('module_id' => $sem_tree_id, 'course_id' => $seminar_id));
to:

Notifications: Forum

Wenn ein Forumsbeitrag verfasst wurde, wird vor dem tatsächlichen Speichern die Notification PostingWillCreate und nach dem Speichern PostingDidCreate versendet. Das subject ist die ID des Forumsbeitrags.

Wenn ein Forumsbeitrag verändert wurde, wird vor dem tatsächlichen Speichern die Notification PostingWillUpdate und nach dem Speichern PostingDidUpdate versendet. Das subject ist die ID des Forumsbeitrags.

Auch wenn ein Forumsbeitrag gelöscht wird, gibt es Notifications: PostingWillDelete und PostingDidDelete. Auch dort wird der Vollständigkeit halber die ID des Forumsbeitrags übergeben.

Notifications: Wiki

Wenn eine Wikiseite verfasst wurde, wird vor dem tatsächlichen Speichern die Notification PostingWillCreate und nach dem Speichern PostingDidCreate versendet. Das subject ist ein Array mit range_id und keyword der Wikiseite.

Wenn eine Wikiseite verändert wurde, wird vor dem tatsächlichen Speichern die Notification PostingWillUpdate und nach dem Speichern PostingDidUpdate versendet. Das subject ist ein Array mit range_id und keyword der Wikiseite.

Auch wenn eine Wikiseite gelöscht wird, gibt es Notifications: PostingWillDelete und PostingDidDelete. Auch dort wird der Vollständigkeit halber ein Array mit range_id und keyword der Wikiseite übergeben.

 
 
March 08, 2011, at 10:14 AM by mlunzena -
Changed lines 15-16 from:

<TODO: mlunzena>

to:

Notification: ConfigValueChanged

Dies Notification wird versendet, wenn sich ein in der Klasse Config enthaltener Parameter geändert hat. Als subject wird die Config-Instanz mitgegeben und als userdata der neue und alte Wert.

Deleted line 19:
Deleted lines 21-38:

lib/classes/StudipDocument.class.php: NotificationCenter::postNotification('DocumentWillDelete', $to_delete); lib/classes/StudipDocument.class.php: NotificationCenter::postNotification('DocumentDidDelete', $to_delete); lib/classes/StudipDocument.class.php: NotificationCenter::postNotification($notifications[0], $doc); lib/classes/StudipDocument.class.php: NotificationCenter::postNotification($notifications[1], $doc); lib/classes/StudipSemTree.class.php: NotificationCenter::postNotification('CourseRemovedFromModule', $studyarea, array('module_id' => $sem_tree_id, 'course_id' => $seminar_id)); lib/classes/StudipSemTree.class.php: NotificationCenter::postNotification('CourseAddedToModule', $studyarea, array('module_id' => $sem_tree_id, 'course_id' => $seminar_id)); lib/dates.inc.php: NotificationCenter::postNotification('PostingWillDelete', $topic_id); lib/dates.inc.php: NotificationCenter::postNotification('PostingDidDelete', $topic_id); lib/wiki.inc.php: NotificationCenter::postNotification('WikiPageWillUpdate', array($range_id, $keyword)); lib/wiki.inc.php: NotificationCenter::postNotification('WikiPageDidUpdate', array($range_id, $keyword)); lib/wiki.inc.php: NotificationCenter::postNotification('WikiPageWillCreate', array($range_id, $keyword)); lib/wiki.inc.php: NotificationCenter::postNotification('WikiPageDidCreate', array($range_id, $keyword)); lib/wiki.inc.php: NotificationCenter::postNotification('WikiPageWillDelete', array($range_id, $keyword)); lib/wiki.inc.php: NotificationCenter::postNotification('WikiPageDidDelete', array($range_id, $keyword)); public/forum.php: NotificationCenter::postNotification('PostingWillCreate', $update); public/forum.php: NotificationCenter::postNotification('PostingDidCreate', $update); public/forum.php: NotificationCenter::postNotification('PostingWillUpdate', $update); public/forum.php: NotificationCenter::postNotification('PostingDidUpdate', $update);

Added lines 23-54:

Notifications: Dateien

Wenn eine Datei hochgeladen wird, wird vor dem tatsächlichen Anlegen die Notification DocumentWillCreate und nach dem Anlegen DocumentDidCreate versendet. Als subject dient dabei stets die zugehörige Instanz der Klasse StudipDocument.

Wenn der Inhalt einer Datei upgedatet wird, wird analog vorher die Notification DocumentWillUpdate und hinterher DocumentDidUpdate verschickt. Auch hier ist das subject wieder die Instanz der Klasse StudipDocument.

Auch wenn eine Datei gelöscht wird, werden Notifications versendet: DocumentWillDelete und DocumentDidDelete. Auch in diesen Fällen werden als subject Instanzen der Klasse StudipDocument verwendet, wenn gleich diese gerade bei DocumentDidDelete eher dokumentarisch verwendet werden können, da sie ja gelöscht wurden.

Notifications: @@PostingWillDelete

lib/dates.inc.php:    NotificationCenter::postNotification('PostingWillDelete', $topic_id);
lib/dates.inc.php:    NotificationCenter::postNotification('PostingDidDelete', $topic_id);
lib/wiki.inc.php:        NotificationCenter::postNotification('WikiPageWillUpdate', array($range_id, $keyword));
lib/wiki.inc.php:        NotificationCenter::postNotification('WikiPageDidUpdate', array($range_id, $keyword));
lib/wiki.inc.php:        NotificationCenter::postNotification('WikiPageWillCreate', array($range_id, $keyword));
lib/wiki.inc.php:        NotificationCenter::postNotification('WikiPageDidCreate', array($range_id, $keyword));
lib/wiki.inc.php:    NotificationCenter::postNotification('WikiPageWillDelete', array($range_id, $keyword));
lib/wiki.inc.php:    NotificationCenter::postNotification('WikiPageDidDelete', array($range_id, $keyword));
public/forum.php:        NotificationCenter::postNotification('PostingWillCreate', $update);
public/forum.php:        NotificationCenter::postNotification('PostingDidCreate', $update);
public/forum.php:        NotificationCenter::postNotification('PostingWillUpdate', $update);
public/forum.php:        NotificationCenter::postNotification('PostingDidUpdate', $update);

Notifications: CourseRemovedFromModule und CourseAddedToModule

lib/classes/StudipSemTree.class.php:                            NotificationCenter::postNotification('CourseRemovedFromModule', $studyarea, array('module_id' => $sem_tree_id, 'course_id' => $seminar_id));
lib/classes/StudipSemTree.class.php:                NotificationCenter::postNotification('CourseAddedToModule', $studyarea, array('module_id' => $sem_tree_id, 'course_id' => $seminar_id));
 
 
March 07, 2011, at 11:30 AM by mlunzena -
Added lines 43-44:

<TODO: mlunzena> http://www.goodbyehelicopter.com/?p=259

 
 
March 07, 2011, at 11:29 AM by mlunzena -
Deleted lines 20-22:

lib/classes/NotificationCenter.class.php: * Event notifications are sent via the postNotification() method: lib/classes/NotificationCenter.class.php: * NotificationCenter::postNotification('shutdown', $sender); lib/classes/NotificationCenter.class.php: public static function postNotification($event, $object, $user_data = NULL)

Changed lines 39-42 from:

@]

to:

@]

Wie benenne ich eine Notification?

 
 
March 07, 2011, at 11:13 AM by mlunzena -
Changed lines 16-42 from:
to:

<TODO: mlunzena>


lib/classes/Config.class.php:                   NotificationCenter::postNotification('ConfigValueChanged', $this, array('field' => $field, 'old_value' => $old_value, 
'new_value' => $value_entry->value));
lib/classes/NotificationCenter.class.php: * Event notifications are sent via the postNotification() method:
lib/classes/NotificationCenter.class.php: * NotificationCenter::postNotification('shutdown', $sender);
lib/classes/NotificationCenter.class.php:    public static function postNotification($event, $object, $user_data = NULL)
lib/classes/StudipDocument.class.php:        NotificationCenter::postNotification('DocumentWillDelete', $to_delete);
lib/classes/StudipDocument.class.php:            NotificationCenter::postNotification('DocumentDidDelete', $to_delete);
lib/classes/StudipDocument.class.php:        NotificationCenter::postNotification($notifications[0], $doc);
lib/classes/StudipDocument.class.php:        NotificationCenter::postNotification($notifications[1], $doc);
lib/classes/StudipSemTree.class.php:                            NotificationCenter::postNotification('CourseRemovedFromModule', $studyarea, array('module_id' => $sem_tree_id, 'course_id' => $seminar_id));
lib/classes/StudipSemTree.class.php:                NotificationCenter::postNotification('CourseAddedToModule', $studyarea, array('module_id' => $sem_tree_id, 'course_id' => $seminar_id));
lib/dates.inc.php:    NotificationCenter::postNotification('PostingWillDelete', $topic_id);
lib/dates.inc.php:    NotificationCenter::postNotification('PostingDidDelete', $topic_id);
lib/wiki.inc.php:        NotificationCenter::postNotification('WikiPageWillUpdate', array($range_id, $keyword));
lib/wiki.inc.php:        NotificationCenter::postNotification('WikiPageDidUpdate', array($range_id, $keyword));
lib/wiki.inc.php:        NotificationCenter::postNotification('WikiPageWillCreate', array($range_id, $keyword));
lib/wiki.inc.php:        NotificationCenter::postNotification('WikiPageDidCreate', array($range_id, $keyword));
lib/wiki.inc.php:    NotificationCenter::postNotification('WikiPageWillDelete', array($range_id, $keyword));
lib/wiki.inc.php:    NotificationCenter::postNotification('WikiPageDidDelete', array($range_id, $keyword));
public/forum.php:        NotificationCenter::postNotification('PostingWillCreate', $update);
public/forum.php:        NotificationCenter::postNotification('PostingDidCreate', $update);
public/forum.php:        NotificationCenter::postNotification('PostingWillUpdate', $update);
public/forum.php:        NotificationCenter::postNotification('PostingDidUpdate', $update);
 
 
March 07, 2011, at 11:11 AM by mlunzena -
Added lines 1-16:

NotificationCenter

Verschicken von Notifications

<TODO: elmar>

Empfangen von Notifications

<TODO: elmar>

Gegenwärtige Verwendungen

Die im offiziellen verwendeten Notifications werden im folgenden beschrieben.

 

 

Source: Basis-Wiki-Hilfe | Last change: March 08, 2011, at 10:33 AM, mlunzena | Local view: Basis-Hilfe