Difference between revisions of "widget-examples"

From Microformats Wiki
Jump to navigation Jump to search
Line 53: Line 53:
 
== WSRP ==
 
== WSRP ==
  
 +
* [[http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=wsrp|Homepage]]
 
* SOAP envelopes to transport modules, but there is no specific formatting required for the actual content of the "portlet" (module or widget).
 
* SOAP envelopes to transport modules, but there is no specific formatting required for the actual content of the "portlet" (module or widget).
 +
 +
=== Example ===
 +
 +
<pre>&lt;urn:getMarkupResponse xmlns:urn=&#34;urn:oasis:names:tc:wsrp:v1:types&#34;&gt;
 +
  &lt;urn:markupContext&gt;
 +
    &lt;urn:mimeType&gt;text/html; charset=UTF-8&lt;/urn:mimeType&gt;
 +
    &lt;urn:markupString&gt;&lt;![CDATA[
 +
      &lt;form method=&#34;post&#34;
 +
        action=&#34;wsrp_rewrite?wsrp-urlType=blockingAction/wsrp_rewrite&#34;
 +
        id=&#34;wsrp_rewrite_stockForm&#34;&gt;
 +
        &lt;table border=&#34;0&#34; width=&#34;100%&#34;&gt;
 +
          &lt;tr&gt;
 +
            &lt;td&gt;Enter Stock Symbol&lt;/td&gt;
 +
            &lt;td&gt;&lt;input name=&#34;symbol&#34;&gt;&lt;/td&gt;
 +
          &lt;/tr&gt;
 +
          &lt;tr&gt;
 +
            &lt;td&gt;&lt;input type=&#34;submit&#34; value=&#34;Submit&#34;&gt;&lt;/td&gt;
 +
          &lt;/tr&gt;
 +
        &lt;/table&gt;
 +
      &lt;/form&gt;
 +
    ]]&gt;&lt;/urn:markupString&gt;
 +
    &lt;urn:locale&gt;en-US&lt;/urn:locale&gt;
 +
    &lt;urn:requiresUrlRewriting&gt;true&lt;/urn:requiresUrlRewriting&gt;
 +
    &lt;urn:preferredTitle&gt;Portfolio Manager&lt;/urn:preferredTitle&gt;
 +
  &lt;/urn:markupContext&gt;
 +
  &lt;urn:sessionContext&gt;
 +
    &lt;urn:sessionID&gt;sessionID_1&lt;/urn:sessionID&gt;
 +
    &lt;urn:expires&gt;300&lt;/urn:expires&gt;
 +
  &lt;/urn:sessionContext&gt;
 +
&lt;/urn:getMarkupResponse&gt;</pre>

Revision as of 16:01, 27 September 2005

Apple's Dashboard

  • Uses an XML Manifest file to specify data about the "widget" (width, height, thumbnail image, title and version).
  • No requirements for markup around widgets.

Dashboard Example (plist)

<code><?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
        <key>AllowNetworkAccess</key>
        <true/>
        <key>CFBundleDisplayName</key>
        <string>AIM Fighter</string>
        <key>CFBundleIdentifier</key>
        <string>com.aimfight.widget</string>
        <key>CFBundleName</key>
        <string>AOL Fighter</string>
        <key>CFBundleShortVersionString</key>
        <string>2.0</string>
        <key>CFBundleVersion</key>
        <string>2.0</string>
        <key>CloseBoxInsetX</key>
        <integer>5</integer>
        <key>CloseBoxInsetY</key>
        <integer>5</integer>
        <key>MainHTML</key>
        <string>fight.html</string>
</dict>
</plist></code>

AOL's Channel Content Modules - [Sports example]

  • Each module (widget) has a markup envelope and some required elements that make it a module and allow for consistent styles across products.

Example

<div class="module themedList">
    <div class="header"><h3>Kevin's List Of Fruit</h3></div>
    <div class="body">
        <ul>
            <li>Apples</li>
            <li>Oranges</li>
        </ul>
    </div>
</div>

Konfabulator

  • (need someone else to fill this in, have never built one or taken them apart)

WSRP

  • [[1]]
  • SOAP envelopes to transport modules, but there is no specific formatting required for the actual content of the "portlet" (module or widget).

Example

<urn:getMarkupResponse xmlns:urn="urn:oasis:names:tc:wsrp:v1:types">
  <urn:markupContext> 
    <urn:mimeType>text/html; charset=UTF-8</urn:mimeType>
    <urn:markupString><![CDATA[ 
      <form method="post" 
        action="wsrp_rewrite?wsrp-urlType=blockingAction/wsrp_rewrite"
        id="wsrp_rewrite_stockForm">
        <table border="0" width="100%">
          <tr>
            <td>Enter Stock Symbol</td>
            <td><input name="symbol"></td>
          </tr> 
          <tr>
            <td><input type="submit" value="Submit"></td>
          </tr> 
        </table>
      </form> 
    ]]></urn:markupString>
    <urn:locale>en-US</urn:locale>
    <urn:requiresUrlRewriting>true</urn:requiresUrlRewriting>
    <urn:preferredTitle>Portfolio Manager</urn:preferredTitle>
  </urn:markupContext> 
  <urn:sessionContext> 
    <urn:sessionID>sessionID_1</urn:sessionID> 
    <urn:expires>300</urn:expires> 
  </urn:sessionContext> 
</urn:getMarkupResponse>