Dynamic Layout Markup Language

Contact

mail@internetcommons.ca

Search


Custodians:

dlml grammar

In a nutshell, dlml is a simple xml grammer consisting of four elements:

dl:module, dl:widget, dl:settings, and dl:marker (reserved).


Note: to avoid compatibility issues, the grammar could be implemented as html element classes: eg. <div class="dlmodule" dlname="module-name" ...>...</div> etc., but for the moment the embedded xml namespace grammar seems to be working.


Each of the grammar elements can have attributes.

dl:module is used to convey configuration information to module managers for overall module behaviour (through attributes and contained settings - attribute trees).

dl:widget elements are used to define embedded browser page objects (a.k.a. widgets). On browser page creation they are converted (if necessary) to regular html, and linked to parallel javascript objects; put another way, a dynamic layout document object model (dom) is matched by a parallel javascript object model. Each widget is linked to a javascript object through a unique session id.

dl:settings elements are children of widgets or settings. Settings may have a type attribute (dltype) and a name attribute (dlname). If a dltype attribute is absent, it is inherited from its parent settings element, if available. Without a type, a settings element is ignored.

Widget definitions (including their attributes) can be enhanced with contained typed settings, and settings can be enhanced with contained dlsettings (recursivley). Again, an attribute tree.

html can contain dl:widget objects. dl:widget objects can have attributes, and can contain dl:settings, dl:widget objects, or html. dl:settings are typed collections of attributes, and can contain dl:settings in collections. dl:settings can themselves contain dl:settings. All contained elements are 0-n.

All dlml elements are embedded in html. The module and settings dlml elements are removed, and thewidget elements are replaced with html as needed, during browser page setup. (In principle this could be done at the server side, with JSON objects created for the javascript object model).

Widget hierarchies are composed of four types of widgets: elemental widgets, container widgets (containing widgets), package widgets (defining an operational unit of widgets), and platform widgets (hosting the other three types - required). A single widget can be all four types. The root node of a widget hierarchy (as defined by modules), is considered to be a platform widget (required). "package", "container", and "elemental" widgets are hosted by "platform" widgets (required), which are in turn managed by modules. Package widgets can hold default settings for descendant widget objects (see defaults mechanism below). Together these comprise a classic object hierarchy (orthogonal to the classic class hierarchy).

Overall, dlml is a declarative way of specifying dynamic layout behaviour within html.

Here is a slighlty more formal definition (dl = dynamic layout). htmlelement is any legal html element in context.

Basic Grammar

html-root-element:

    <body html-attributes >
        html-element | dl-root-element
    </body>

dl-root-element:

    dlmodule-element | dlwidget-element

dlmodule-element:

    <div class="dlmodule" dlmodule-attributes >
        dlsettings-element
    </div>

dlwidget-element:

    <htmlelement class="dlwidgetclass" dlwidget-attributes >
        dlsettings-element | dlwidget-element | html-element
    </htmlelement>

dlsettings-element:

    <htmlelement class="dlsettings" dlsettings-attributes >
        dlsettings-element | indexed-dlsettings-element
    </htmlelement>

html-element:

    html-opentag html-attributes
        html-element | dlwidget-element
    html-closetag

indexed-dlsettings-element:

    <htmlelement class="dlsettings" indexed-dlsettings-attributes >
        dlsettings-element
    </htmlelement>

dlmodule-attributes:

    dlname = "module-manager-name" 
    [module-defined-attributes]

dlwidget-attributes:

    dltype = "widget-type" 
    [dlid = "identifier"] 
    [module-defined-attributes]

dlsettings-attributes:

    dltype = "settings-type"
    [module-defined-attributes]

indexed-dlsettings-attributes:

    [dltype = "settings-type"]
    dlindex = "settings-index"
    [module-defined-attributes]

module-defined-attributes:

    as defined by attribute-trees

html-element, html-opentag, html-closetag, html-attributes:

    as publicly defined
Defaults Mechanism

widget defined with dlml can inherit attributes from ancestor containers, up to and including the containing platform widget.

Defaults from a platform widget are applied to all descendant widgets.

Defaults from a dl:widget's immediate ancestor container (as defined by the module) are applied. In addition, if the immediate ancestor defaults are specified with the "inherits" attribute, then the next ancestor container default attributes (for all widget types) are also applied, potentially in a chain.

Finally, defaults for dl:widget types from any ancestor container, where that ancestor's widget type defaults are marked with dlscope="branch", are applied to all contained widgets.

Module authors also have the option of defining attribute trees such that default sets can themselves be inherited as defaults, allowing for a two step default inheritance process.

dlwidget-element:

    dl-platform-widget-element | dl-container-widget-element | dl-simple-widget-element

dl-platform-widget-element:

    <htmlelement class="dlwidgetclass" dlwidget-attributes >
        dl-platform-defaults-setting-element | dlsettings-element
            | dlwidget-element | html-element
    </htmlelement>

dl-container-widget-element:

    <htmlelement class="dlwidgetclass" dlwidget-attributes >
        dl-container-defaults-setting-element | dlsettings-element
            | dlwidget-element | html-element
    </htmlelement>

dl-simple-widget-element:

    <htmlelement  class="dlwidgetclass" dlwidget-attributes >
        dlsettings-element | dlwidget-element | html-element
    </htmlelement>

dl-platform-defaults-setting-element:

    <htmlelement class="dlsettings" dltype="defaults" >
        dl-platform-defaults-collection-element
    </htmlelement>

dl-platform-defaults-collection-element:

    <htmlelement class="dlsettings" dlindex="widget-type" module-defined-attributes >
        dlsettings-element
    </htmlelement>

dl-container-defaults-setting-element:

    <htmlelement class="dlsettings" dltype="defaults" [dlinherits = "true"] >
        dl-container-defaults-collection-element
    </htmlelement>

dl-container-defaults-collection-element:

    <htmlelement class="dlsettings" dlindex = "widget-type"
        [dlscope = "branch"] module-defined-attributes >
        dlsettings-element
    </htmlelement>
Attribute Replacement Mechanism

By default, defaults (and other attributes) that are applied to a widget's attribute tree are aggregated, that is they merge with existing attributes. However the module author can over-ride this behaviour by applying the attribute "replace=true" to attribute trees (or branches) that should replace existing ones. This is done generally for animation attribute trees: effects, animations, and animationoptions.


hosted by webhosting.bechmann.ca | powered by pmwiki-2.2.78
Content last modified on March 29, 2013, at 06:30 PM EST