Internal structure
Internal structure
Understanding Movim’s internals isn’t necessary to use it. However, it may help finding out problems and developing more efficiently.
Movim is consists of a widgets system and an XMPP abstration that communicate together through an asynchronous event handler. This is all triggered by a controller, which is loaded depending on the page you visit.
XMPP connection
The XMPP connection is managed by the JAXL library. It abstracts the raw sending and receiving of XML messages. Each message is handled and pops up as an event.
Widgets
Widgets are small pieces of software that plug into Movim to provide extra ability to the system. These are mostly graphical, and generate ajax code automatically.
Movim comes with several widgets. These sit in the ‘lib/widgets’ directory. User-defined widgets should be in the `widgets' directory. Note that user-defined widgets always shadow the system widgets.
Widgets can declare ajax functions and XMPP event handlers in order to interact with their GUI part and the XMPP subsystem.
Note that almost everything in Movim is a widget. Even things like the menu and the configuration panel. One notable exception is the login page, which is mostly static.
Events manager
The XMPP connection is not aware of the widgets, nor is it able to access them. However, the event manager knows what widgets are loaded on the client’s interface at any time. When the XMPP connection triggers an event in the event manager, it loops through all the loaded widgets and executes all handlers that are attached to this event.