[dev] AJAX Framework changes

Michael M Slusarz slusarz at horde.org
Wed Jan 25 19:04:14 UTC 2012


Since the UI is going to be updated for Horde 4.1, it is a necessity  
to move common AJAX components from the applications (e.g. IMP,  
Kronolith) into Horde_Core.  In fact, I've already been working on  
this for a few days.

FYI: I'm going to move all the IMP stuff over first, since that is  
what I am most familiar with.  I'm going to look at Kronolith after I  
am done to see if there is any additional features that can/should be  
merged.  From my understanding, Jan mostly copied what we did in DIMP  
so the code should mostly be the same.

Here's what's moving (as of now):

* Most of the basic, non-IMP (or Kronolith) specific methods from  
DimpCore into a new JS class called HordeCore.  This includes:
   - debug
   - doAction (and the related exception/failure/complete handlers)
   - submitForm
   - addRequestParams (centralized addition of Session ID to URL if needed)
   - Growler/Show Notifications/Growler Log
   - popupWindow/closePopup
   - logout
   - redirect
   - loadingImg
   - addURLParam
   - Determination of "base" window

* Initializing the base horde AJAX browser environment from a  
centralized location (tentatively, this is Horde_Core_Ajax::init()).   
Configuration/Gettext needed for this base environment will be moved  
from the applications (e.g. imp/templates/dimp/javascript_defs.php)

* Move the AjaxStatus notification handler to Core.  Deprecate use of  
'notification_handler' session variable.  Instead, add a  
Horde_Registry::setView()  method to allow easy switching between  
views.  Side benefit: this should allow correct switching between ALL  
views in an authenticated session.

* Merge IMP_Ajax_Queue code into centralized Core code.  Will allow an  
application to modify the outgoing JSON object at send-time.  From the  
IMP persepective, this allows us to bundle things like folder tree  
changes and newmail polling into a single location, rather than  
needing to tack on this data to individual requests.

* Deprecate Horde::sendHTTPResponse() and Horde::prepareResponse() and  
instead integrate into the core AJAX framework.

Anything else I missed?  Other comments?  Integration of the mobile  
view should also be a part of this, but I haven't thought much about  
that yet.

michael

___________________________________
Michael Slusarz [slusarz at horde.org]



More information about the dev mailing list