Another Notification rewrite.
authorMichael M Slusarz <slusarz@curecanti.org>
Tue, 16 Feb 2010 06:27:31 +0000 (23:27 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Thu, 18 Feb 2010 07:46:01 +0000 (00:46 -0700)
commite48b8a54fc54a179be749967a6a8b6b73cc1162e
tree6c1acd2aecbed5ff566a912cbb70dfb92626e997
parenta97a35b17ec2884b85b10503c7f795b1811d7719
Another Notification rewrite.

First, fix Bug #8870. Fixed by removing Nag specific event type
(nag.alarm).  However, this was just a symptom of a larger problem.

The problem: using application specific Notification handlers to handle
application specific event types.  The problem comes when switching
between applications.  Since these application handlers don't have any
knowledge of each other, events created by one handler may not be able
to be displayed when notify() was eventually called, because another
status handler had replaced the original handler.

The solution: all notifications need to be handled by a single,
centralized source - namely, the horde-level handlers.  Application
specific details are instead injected into the horde-level handler to
extend behavior.

While reworking the code, also provided opportunity to remove all
application-specific code from Notification.  Horde-specific
instantiation (i.e. adding Horde logging and Alarm decorators) is now
done in Horde_Core rather than in the base Notification object.

Additionally, rework some of the complexity added to the package.  I
believe the goal of the recent Notification changes was to make the
Notification package testable and/or usable outside of a base Horde
install.  But these changes also made the code unreadable, redundant,
and overly complex.

e.g. using interfaces where simple class extensions
make much more sense (IMHO - there are very few cases where an interface
makes more sense than an abstract class. Using interfaces for the
Handler class was simply overkill.  Out of the 10 methods defined, there
are only 2 methods useful for decorator purposes - push() and notify().
And any given decorator won't even use both of these.  Having to contort
code to do things like chaining handlers to achieve this in an interface
pattern was almost impossible to follow.  It is much simpler to simply
add decorators directly to the base handler object.
60 files changed:
framework/Ajax/lib/Horde/Ajax/Application/Base.php
framework/Core/lib/Horde.php
framework/Core/lib/Horde/Core/Binder/Notification.php [new file with mode: 0644]
framework/Core/lib/Horde/Core/Notification/Status.php [new file with mode: 0644]
framework/Core/lib/Horde/Registry.php
framework/Core/package.xml
framework/Notification/lib/Horde/Notification.php
framework/Notification/lib/Horde/Notification/Event.php
framework/Notification/lib/Horde/Notification/Event/Status.php [new file with mode: 0644]
framework/Notification/lib/Horde/Notification/Handler.php [new file with mode: 0644]
framework/Notification/lib/Horde/Notification/Handler/Base.php [deleted file]
framework/Notification/lib/Horde/Notification/Handler/Decorator/Alarm.php
framework/Notification/lib/Horde/Notification/Handler/Decorator/Base.php [new file with mode: 0644]
framework/Notification/lib/Horde/Notification/Handler/Decorator/Hordelog.php
framework/Notification/lib/Horde/Notification/Handler/Decorator/Log.php
framework/Notification/lib/Horde/Notification/Handler/Interface.php [deleted file]
framework/Notification/lib/Horde/Notification/Listener.php
framework/Notification/lib/Horde/Notification/Listener/Audio.php
framework/Notification/lib/Horde/Notification/Listener/Javascript.php
framework/Notification/lib/Horde/Notification/Listener/Mobile.php [deleted file]
framework/Notification/lib/Horde/Notification/Listener/Status.php
framework/Notification/package.xml
framework/Notification/test/Horde/Notification/Autoload.php
framework/Notification/test/Horde/Notification/Class/Notification/EventTest.php
framework/Notification/test/Horde/Notification/Class/Notification/Handler/BaseTest.php [deleted file]
framework/Notification/test/Horde/Notification/Class/Notification/Handler/Decorator/AlarmTest.php
framework/Notification/test/Horde/Notification/Class/Notification/Handler/Decorator/HordelogTest.php
framework/Notification/test/Horde/Notification/Class/Notification/Handler/Decorator/LogTest.php
framework/Notification/test/Horde/Notification/Class/Notification/HandlerTest.php [new file with mode: 0644]
framework/Notification/test/Horde/Notification/Class/Notification/Listener/AudioTest.php
framework/Notification/test/Horde/Notification/Class/Notification/Listener/JavascriptTest.php
framework/Notification/test/Horde/Notification/Class/Notification/Listener/MobileTest.php [deleted file]
framework/Notification/test/Horde/Notification/Class/Notification/Listener/StatusTest.php
framework/Notification/test/Horde/Notification/Class/Notification/ListenerTest.php
framework/Notification/test/Horde/Notification/Class/NotificationTest.php
framework/Prefs/lib/Horde/Prefs/Ui.php
horde/services/ajax.php
horde/services/prefs.php
imp/compose-dimp.php
imp/js/DimpCore.js
imp/lib/Ajax/Application.php
imp/lib/Application.php
imp/lib/Auth.php
imp/lib/Dimp.php
imp/lib/Notification/Event/Status.php [new file with mode: 0644]
imp/lib/Notification/Handler/Decorator/Imap.php [new file with mode: 0644]
imp/lib/Notification/Listener/AjaxStatus.php [new file with mode: 0644]
imp/lib/Notification/Listener/Status.php [deleted file]
imp/lib/Notification/Listener/StatusMobile.php [deleted file]
imp/message-dimp.php
imp/message-mimp.php
imp/templates/compose/compose-mimp.inc
imp/templates/compose/redirect-mimp.inc
imp/templates/folders/folders-mimp.inc
imp/templates/mailbox/mailbox-mimp.inc
imp/templates/mailbox/search-mimp.inc
kronolith/lib/Ajax/Application.php
nag/lib/Application.php
nag/lib/Nag.php
nag/lib/Notification/Listener/Status.php [deleted file]