Class attributes for iWidgets on static pages

Similar to the portlet microformat, the portal supports the iWidget microformat. You use it to place an instance of an iWidget on a static page that you want to be rendered by the portal. If the iWidget definition that is referenced in the iWidget microformat has not been registered to the portal before creating the static page, the static page deployment process makes sure of the iWidget registration.

For more information refer to the following list of class attributes. Examples of iWidgets rendered from HTML is also provided. For more information about the iWidget microformat for including iWidgets into a broader set of markup, such as a portal page, refer to the link to the iWidget specification below.


Including iWidgets in a static page


iw-iWidget


iw-Definition

Example:

<html>
   <head>
      <title>Sample Static Page with iWidget instance</title>
   </head>
   <body>
      <p>This is a static page example, which includes a single iWidget instance.</p>
 
      <div class="component-container" name="sampleContainer">
         <!-- microformat to include an instance of the SampleWidget iWidget in the page -->
         <div class="iw-iWidget" id="sampleWidget" style="skin:csa2.standard">
            <!-- references the definition of this iWidget instance using a WebDAV file store URI -->
            <a class="iw-Definition" href="dav:fs-type1/iwidgets/sampleWidget/SampleWidget.xml"></a>
         </div>
      </div>
   </body>
</html>

The iWidget specification details further class attribute values. Those microformats can be used when placing an iWidget instance on a static page to override specifications from the referenced iWidget definition or to define iWidget items that do not exist in the referenced iWidget definition. The following paragraphs provide an overview of the available class attribute values.


Defining iWidget event descriptions and events


iw-EventDescription


iw-PayloadType


iw-Description


iw-Title


iw-Event


iw-DescRef


iw-Handler


iw-NewWire


iw-RemoveWire

Example:

<div class="component-container" name="sampleContainer">
   <div class="iw-iWidget" id="sampleWidget" style="skin:csa2.standard">
      <a class="iw-Definition" href="dav:fs-type1/iwidgets/sampleWidget/SampleWidget.xml"></a>
 
      <!-- one per described iWidget event -->
      <span class="iw-EventDescription" title="sampleEventDescription">
         <span class="iw-PayloadType">{text/javascript}String</span>
         <span class="iw-Description">
            <!-- one per locale -->
            <span class="iw-Value" lang="en">This is a sample event description.</span>
         </span>
         <span class="iw-Title">
            <!-- one per locale -->
            <span class="iw-Value" lang="en">Sample Event Description</span>
         </span>
      </span>
 
      <!-- one per event -->
      <span class="iw-Event iw-Published iw-Handled" title="sampleEvent">
         <a class="iw-DescRef" href="#sampleEventDescription"></a>
         <span class="iw-Handler">handleEventFn</span>
         <span class="iw-NewWire">handleNewWireFn</span>
         <span class="iw-RemoveWire">handleRemoveWireFn</span>
      </span>
   </div>
</div>


Defining wires between iWidget instances


iw-ReceivedEvent


iw-SourceEvent


iw-TargetEvent

The following example shows the specification of a wire when placing a single iWidget instance on a static page from an HTML fragment. The example does not show the microformat that includes the source iWidget instance, and it assumes that the target endpoint of the wire is defined in the iWidget definition of the shown iWidget instance.

<div class="component-container" name="sampleContainer">
   <div class="iw-iWidget" id="sampleWidget" style="skin:csa2.standard">
      <a class="iw-Definition" href="dav:fs-type1/iwidgets/sampleWidget/SampleWidget.xml"></a>
 
      <!-- one per event to receive -->
      <span class="iw-ReceivedEvent">
         <a class="iw-SourceEvent" href="#anotherSampleWidgetID">sampleSourceEvent</a>
         <span class="iw-TargetEvent">sampleTargetEvent</span>
      </span>
   </div>
</div>


Initializing iWidget item sets


iw-ItemSet


iw-Item

The following example shows the initialization of an iWidget item set, which contains one item, when placing a single iWidget instance on a static page from an HTML fragment:

<div class="component-container" name="sampleContainer">
   <div class="iw-iWidget" id="sampleWidget" style="skin:csa2.standard">
      <a class="iw-Definition" href="dav:fs-type1/iwidgets/sampleWidget/SampleWidget.xml"></a>
 
      <!-- override values from iWidget definition -->
      <span class="iw-ItemSet" title="sampleItemSet">
         <!-- one per item value supplied -->
         <a class="iw-Item" lang="en" href="#sampleItem">sampleValueForEnglish
            <!-- one per additional locale -->
            <span class="iw-Value" lang="de">sampleValueForGerman</span>
         </a>
      </span>
   </div>
</div>


Defining iWidget instance content


iw-Content

The following example shows how you specify of the iWidget content for the view mode when you place a single iWidget instance on a static page from an HTML fragment:

<div class="component-container" name="sampleContainer">
   <div class="iw-iWidget" id="sampleWidget" style="skin:csa2.standard">
      <a class="iw-Definition" href="dav:fs-type1/iwidgets/sampleWidget/SampleWidget.xml"></a>
 
      <!-- one per iWidget mode (if allowed by the iWidget definition) -->
      <div class="iw-Content view">
         <!-- content for this iWidget mode -->
         <p>The iWidget instance is currently rendered in view mode.</p>
      </div>
   </div>
</div>


Complex example of a static page including iWidgets

The code snippet given below combines all the examples shown above in one single static page from full HTML markup. In order to create a wire between iWidgets, a second iWidget instance is placed on the static page that serves as the publisher of the event.

<html>
   <head>
      <title>Sample Static Page with two wired iWidget instances</title>
   </head>
   <body>
      <p>This is a static page example, which includes two iWidget instance that can exchange events.</p>
 
      <div class="component-container" name="sampleContainer">
         <!-- microformat to include an instance of the SampleWidgetA iWidget in the page -->
         <div class="iw-iWidget" id="SampleWidgetA" style="skin:csa2.standard">
            <!-- references the definition of this iWidget instance using an portal server relative URL -->
            <a class="iw-Definition" href="/sampleWidgetA/sampleWidgetA/SampleWidgetA.xml"></a>
         </div>
 
         <!-- microformat to include an instance of the SampleWidgetB iWidget in the page -->
         <div class="iw-iWidget" id="SampleWidgetB" style="skin:csa2.standard">
            <!-- references the definition of this iWidget instance using a WebDAV file store URI -->
            <a class="iw-Definition" href="dav:fs-type1/iwidgets/sampleWidgetB/SampleWidgetB.xml"></a>
 
            <!-- defines an event description -->
            <span class="iw-EventDescription" title="sampleEventDescription">
               <!-- defines the JavaScript type String as payload of events based on this event description -->
               <span class="iw-PayloadType">{text/javascript}String</span>
               <span class="iw-Description">
                  <!-- defines the description of this event description for the English locale -->
                  <span class="iw-Value" lang="en">This is a sample event description.</span>
               </span>
               <span class="iw-Title">
                  <!-- defines the title of this event description for the English locale-->
                  <span class="iw-Value" lang="en">Sample Event Description</span>
               </span>
            </span>
 
            <!-- defines a target event based on the sampleEventDescription event description;
                 this event is handled by the handleEventFn JavaScript function -->
            <span class="iw-Event iw-Handled" title="sampleTargetEvent">
               <a class="iw-DescRef" href="#sampleEventDescription"></a>
               <span class="iw-Handler">handleEventFn</span>
            </span>
 
            <!-- defines wire between sampleWidgetA and sampleWidgetB, where
                 - the source event is specified in the definition of sampleWidgetA and
                 - the target event is specified in the microformat of sampleWidgetB -->
            <span class="iw-ReceivedEvent">
               <a class="iw-SourceEvent" href="#SampleWidgetA">sampleSourceEvent</a>
               <span class="iw-TargetEvent">sampleTargetEvent</span>
            </span>
 
            <!-- overrides the items of the sampleItemSet item set from the iWidget definition -->
            <span class="iw-ItemSet" title="sampleItemSet">
               <!-- overrides the values of the sampleItem item of the iWidget definition
                    with values for the English and for the German locale -->
               <a class="iw-Item" lang="en" href="#sampleItem">sampleValueForEnglish
                  <!-- defines the value of this item for the German locale -->
                  <span class="iw-Value" lang="de">sampleValueForGerman</span>
               </a>
            </span>
 
            <!-- defines the markup of the iWidget instance in view mode -->
            <div class="iw-Content view">
               <!-- defines the content for this iWidget mode -->
               <p>The iWidget instance of SampleWidgetB is currently rendered in view mode.</p>
            </div>
         </div>
      </div>
   </body>
</html>


Parent

Defining and rendering a static portal page in HTML
Example HTML markup for defining a portal page
Class attributes for portlets on static pages
Class attributes for a portlet container on static pages
Class attributes for components on static pages
Navigation options for static pages
Portlets for adding dynamic elements to static pages January 4, 2012

  2012/01/04 v7. Edition 2: Second edition includes corrections a... 2011/12/15 documentation refresh


        +

        Search Tips   |   Advanced Search