Adding New Gadgets to Openspace

You can add new gadgets to Openspace. You can do this in one of three ways. You can import an arbitrary web page and use it as a gadget in Openspace, import a gadget spec (in other words, a URL that ends with a filename with a .xml extension), import a gadget spec from a web site where no file .xml is specified (this relies on the web pages’ default document being a gadget spec).

Note: You must be logged in as a user that has privileges with the ContributeGadget system action assigned to it.

To do this, you must specify the URL of the web page you want to add. The URL must point to an OpenSocial gadget that complies with OpenSocial Specification V0.8/V0.9. An OpenSocial gadget is hosted in a server infrastructure to provide its data.

OpenSocial gadgets are part of the OpenSocial initiative. OpenSocial gadgets are web based UI components. A gadget is defined via an XML file which contains a header with definitions of the gadget and an embedded content payload. This payload is a combination of HTML and JavaScript which defines the gadget’s look and behavior.

A very simple gadget looks like this:

<?xml version="1.0" encoding="UTF-8" ?>
<Module>
  <ModulePrefs title="Hello OpenSocial Gadgets!">
    <Require feature="opensocial-0.8" />
  </ModulePrefs>
  <Content type="html">
    <![CDATA[
      Hello, OpenSocial Gadgets!
  </Content>
</Module>

A gadget always has the root tag <Module>. This root tag contains a <ModulePrefs> and a <Content> section. The <ModulePrefs> contains information about which OpenSocial features are required by the module and information about the author. The content section contains the actual HTML and JavaScript.

When adding a gadget to Openspace, note the following:

  • When specifying a thumbnail or screenshot URL in <ModulePrefs>:
    • If you do not specify a thumbnail or screenshot URL that is a publicly accessible URL, the gadget is displayed in Openspace as shown below:
      The thumbnail is a grey box with white square. A page icon is in the square. The text is in white and is "Contributed gadget (n)" where n is the number of contributed gadgets.
    • If you do not specify any thumbnail or screenshot URL, then Openspace uses its default thumbnail or screenshot and the gadget is displayed in Openspace as shown below:
      The default thumbnail is a grey box with a white square. A cog icon is in the white square. The text is in white and is the name of the actual gadget.
  • If you do not specify a description in <ModulePrefs>, Openspace defaults to Contributed Gadget[n] where n is an incremental number for each gadget you add that has no description.

For more information:

Procedure

  1. Click the down arrow of a tab to display the User Preferences area The tab names are in blue boxes with white text..
  2. Click The icon is a grey arrow pointing right. It is contained in a white circle. The icon is located in the top right hand corner of the User Preferences area. next to Get More Gadgets.
    The Openspace Gadget Store displays.
  3. Click next to Contribute Gadget.
    The Contribute Gadget dialog displays.
  4. In the Gadget Spec URL box, type the URL of the gadget you want to add.
    Note: Your system administrator can configure Openspace to display a specific Gadget Spec URL by specifying the path to the gadget server using the useConfiguredServerUrl property in the OSProperties.properties file. See TIBCO ActiveMatrix BPM Administration guide for more information.

    You can specify one of the following:

    • a gadget spec (that is, a URL that ends with a filename with a .xml extension). See TIBCO ActiveMatrix Web Client Developer API Guide for more information.
    • an arbitrary web page instead of a gadget spec (and use it as a gadget).

      In this case, select the URL is not a Gadget Spec - it is a web site. See below.

    • a gadget spec from a web site where no file .xml is specified (this relies on the web pages’ default document being a gadget spec).
  5. In the Hub Policy URL: box, type the URL of the Hub Policy for the Openspace Sample Gadget.
    The first part of the URL is always http://amxbpmhost:8080/openspace where amxbpmhost is the IP address of the machine hosting TIBCO Openspace. The rest of the URL is the location you specified in your HubPolicy xml. Once you have typed in the URL of your Hub Policy, the Hub Policy Administrator dialog displays. You can close this dialog as it is for informational purposes only.
  6. In the Category of Gadget: box, type the name of the category where you want the gadget to be stored in the Openspace Gadget Store. If the category does not already exist, it is created automatically. If you do not specify a category, the gadget is stored in the UNCATEGORIZED category.
  7. Ensure that the URL is not a Gadget Spec - it is a web site check box is selected.
    Note: The URL is not a gadget spec - it is a website checkbox is automatically selected when you start to type in the Gadget Spec URL box.

    You can then configure the following:

    • (optional) Select a checkbox to allow a user to edit the preference. If this checkbox is selected, it means that you can amend the URL of the gadget spec at a later date, if required.
    • Add your own name and description for the gadget.
    • (optional) Adjust the gadget height.
    • (optional) Add URLs for Thumbnail image and Screenshot image of the gadget.
  8. Click Import Gadget. The new gadget is added to the Openspace Gadget Store to the category you specified and is available to be added to a tab, see Adding Gadgets to a Tab.
    Note: The content of gadgets within Openspace may change dynamically. You can specify whether the Openspace user should be able to edit dynamic content, by setting the isDynamicGadgetEditable property in the OSProperties.properties file. By default, this is set to false. To enable editing, it should be set to true. See TIBCO ActiveMatrix BPM Administration guide for more information.