WDialog is an environment to create web applications. It is a good choice for "dialog-intensive" applications with many input and output fields, and for application that need exact control of the possible user interactions.
As WDialog is a large project, it is hosted at Sourceforge. The homepage, the download files, and the complete CVS repository can be found there.
In contrast to the other O'Caml components, WDialog is licensed under the GPL.
The application is considered as a number of dialogs, i.e. groups of interactions that share the same state. Dialogs are defined by terms of object-oriented programming. There is a class-like definition for the user interface containing which dialog variables exist, and which output methods ("pages") can produce visualizations of the dialog state. This definition focuses on the user interface as such, and because of this it is also known as the "user interface definition". This definition is given as an XML file, e.g.
<ui:dialog name="foo" start-page="start"> <ui:variable name="x" type="string"/> <ui:page name="start"> <html> <body> One can include all HTML tags in pages, but also special elements generating special contents, and controlling the generation process <ui:text variable="x"/> <ui:button name="q" label="Trigger event 'q'"/> </body> </html> </ui:page> </ui:dialog>Within the output methods (inside ui:page), one can use normal HTML elements intermixed with the special user interface tags that have the "ui:" prefix.
Of course, it would not be realistic to write the whole application in a language that is restricted by the XML syntax. This works well for the I/O part of the application, but not for the algorithmic part, and not for the database part. Because of this, there is also a backend program that is written in a universal programming language. Usually, there is a class for every dialog, and the class defines certain methods that are called in certain phases of the overall request processing. In particular, one can program "pre actions" that are executed just before a page is generated, and "post actions" to handle events resulting from mouse clicks. There is a registry saying which class is used for which dialog.
Dialog state is made persistant between page invocations. This is done by data marshalling; one can either include the marshalled dialog literally into the HTML page, or a reference to a backend store. The effect is that the dialog variables ("x" in the above example) keep their value automatically, it is not necessary to pass them explicitly from page to page.
There are special variants of the HTML form interactors like <input>. These variants are bound to dialog variables, i.e. they are initialized from the current variable state, and user modifications are propagated back to the variables. For buttons and hyperlinks, there are variants of the standard HTML elements that "send events". WDialog automatically recognized when such buttons and links are clicked, and the "event" is extracted from the request, and stored as a regular O'Caml value. Usually, these events are evaluated by user-written in code in the post action method.
This is just a small introduction into the basic concepts, so I do not go further here. The reference manual contains some introductory chapters, and there are smaller and bigger examples of code that hopefully explain arising questions. You can find links to the manual and to examles on the homepage.