Gadget Loading

From MemberWiki

Jump to: navigation, search

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 these code blocks scoped? The IDE Widget spec has since scoped the code to the window
      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.

Image:gadgetHub.png
Figure 1: Conceptual Gadget/Hub Architecture

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

Image:hubinteraction.png
Figure 2: Sample Interaction between a trusted and untrusted gadget

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.

Image:trustedDynamicV2.png

Trusted Widget, statically added to the assembly canvas

Image:trustedStaticV2.png

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

Untrusted Widget, added to the assembly canvas dynamically

Image:untrustedDymaicV2.png

Unstrusted Widget, added statically to the canvas

Image:unstructStaticV2.png

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

Personal tools