Developer:Google Gadgets

From myExperiment

Jump to: navigation, search

The following Google Gadgets are available can be added to your iGoogle homepage, Web site or Blog using the hyperlinks provided in each description.

Contents

Trading Card

The Trading Card Google Gadget showing Workflow #59
The Trading Card Google Gadget showing Workflow #59
This Google Gadget is a fully customisable Trading Card that displays a detailed description of the selected myExperiment workflow.

When fully expanded, the Trading Card shows the following information:

  • Title (clickable)
  • Description
  • Created at and Last updated timestamps
  • Thumbnail (clickable)
  • Tags (each tag is clickable)
  • Definition (SCUFL) download (clickable) - this hyperlink can be copied and pasted into the Taverna Workbench Workflow editor!
  • Previous Versions (clickable)
  • Uploader Name (clickable)
  • Uploader Description
  • Uploader Avatar (clickable)


JavaScript Code

 _IG_FetchXmlContent("http://www.myexperiment.org/workflow.xml?id=59&all_elements=yes", function(response) {
   // the iGoogle Fetch XML Content function takes 2 parameters, a url and an anonymous "onResponse" function
   // the onResponse function is called with a single parameter, shown here as the "response" object
   if (response == null || typeof(response) != "object" || response.firstChild == null) {
     return;
   } // after testing for errors, the response must be "<workflow> ... </workflow>"
   
   var uri = response.getAttribute("uri");
   var resource = response.getAttribute("resource");
   var version = response.getAttribute("version");
   
   for (var i = 0; i < response.childNodes.length; ++i) { // iterate over child nodes
     var node = response.childNodes.item(i);
     if (node.nodeName == "title") { // do something with the workflow title...
       var title = node.nodeValue;
     }      
   } // ...parse other child nodes
   
   // do something with the response
 });

Workflows Feed Reader

The Workflows Feed Reader Google Gadget showing the latest myExperiment workflows
The Workflows Feed Reader Google Gadget showing the latest myExperiment workflows
This Google Gadget is a customisable Feed Reader that uses the myExperiment Workflows feed [1] and the workflows index REST function [2] provided by the myExperiment REST API. The screen-shot on the right was produced using the following REST function call:
 http://www.myexperiment.org/workflows.xml?num=20&page=1&sort=updated&order=reverse

The workflows index function has five optional parameters:

  • num and page are used for pagination of results
  • sort the results by title, created, updated (or name for objects with a name attribute!)
  • results can be returned in reverse order
  • tag is used to obtain tagged objects

The workflows index function returns an ordered list of <workflow> elements:

 <workflows>
   <workflow uri="http://www.myexperiment.org/workflow.xml?id=337" resource="...">
     Download from ChemSpider using Accurate Mass
   </workflow>
   <workflow uri="http://www.myexperiment.org/workflow.xml?id=59" resource="...">
     QR code (matrix code) generator
   </workflow>
   ... 
 </workflows>

Tag Cloud

The Tag Cloud Google Gadget
The Tag Cloud Google Gadget
This Google Gadget is a customisable Tag Cloud that uses the myExperiment REST API. The screen-shot on the right was produced using the following REST function call:
 http://www.myexperiment.org/tag-cloud.xml?num=all

The tag cloud function has one optional parameter:

  • num specifies the number of tags in the tag cloud (or all for a complete cloud)
  • type specifies the allowed object types (workflow, file, group or user)

The tag cloud function returns an list of <tag> elements, ordered by name:

 <tag-cloud type="all">
   <tag uri="http://www.myexperiment.org/tag.xml?id=547" resource="..." count="2">
     abstracts
   </tag>
   <tag uri="http://www.myexperiment.org/tag.xml?id=559" resource="..." count="1">
     access grid
   </tag>
   <tag uri="http://www.myexperiment.org/tag.xml?id=642" resource="..." count="3">
     accurate mass
   </tag>
   ...
 </tag-cloud>
Personal tools