Gadget Loading
From MemberWiki
Contents |
Overview
Listed below are 4 different scenarios for creating gadgets described by the IDE and Gadget Metadata.
For each scenario below consider the following widget:
<widget name="Calendar" xmlns="http://ns.openajax.org/widgets" widgetVersion='1.0' specVersion="0.1b" jsClass='Calendar'>
<requires>
<require type="library" name='dojo'/>
<require type="javascript" src="calendar.js"/>
<require type="css" src="../../lib/dojo/resources/dojo.css"/>
<require type="css" src="../../lib/dijit/themes/tundra/tundra.css"/>
<require type="css" src="../../lib/dijit/themes/tundra/tundra_rtl.css"/>
</requires>
<properties>
<property name='date' type='date' publish='true' topic='date'/>
</properties>
<javascript location='atEnd'>
//ED: How are this code blocks scoped? This is scoped to the instance.
this.onAdd();
</javascript>
<content type='frame'>
<![CDATA[
<input ID="__GID___calendar" class='tundra' style="background-color:#f5f5f5" dojoType="dijit._Calendar" lang="en-us"/>
]]>
</content>
</widget>
For reference we include the following diagrams which describe the Hub 1.1 interactions and conceptual architecture.

This figure illustrates an example interaction of two widgets one that is trusted publishing content to a widget that is untrusted:

Trusted Widget, added to the assembly canvas dynamically
In this scenario the widget metadata file is specified through some visual mechanism and the assembly canvas then inserts the widget along with its assets into the existing page.

Trusted Widget, statically added to the assembly canvas

NOTE: In this scenario the beforeContent, afterContent and atEnd script blocks are expanded in the page.
Untrusted Widget, added to the assembly canvas dynamically

Unstrusted Widget, added statically to the canvas

NOTE: In this scenario the beforeContent, afterContent and atEnd script blocks are expanded in the page.
