Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

A gadget /widget author can create any type of gadgets and add it to WSO2 DS, so that you can make use of them when creating a dashboard.

...

  1. Navigate to the <DS_HOME>/repository/deployment/server/jaggeryapps/portal/store directory.
  2. Create a folder by the name of the tenant.
    <DS_HOME>/repository/deployment/server/jaggeryapps/portal/store/<TENANT_NAME>

    Example:
    <DS_HOME>/repository/deployment/server/jaggeryapps/portal/store/kim
  3. Create a folder based on the name of the gadget in the newly created tenant directory.
    <DS_HOME>/repository/deployment/server/jaggeryapps/portal/store/<TENANT_NAME>/<GADGET_NAME>

    Example:
    <DS_HOME>/repository/deployment/server/jaggeryapps/portal/store/kim/age_group

Step 2 - Define the

...

gadget XML

Gadgets are defined using an XML file, which can be later rendered using Shindig to HTML document. Create this XML file within the <DS_HOME>/repository/deployment/server/jaggeryapps/portal/store/<TENANT_NAME>/<GADGET_NAME> directory, and use any name to name the gadget XML file.

...

Tip

If you wish to learn more on creating gadget XMLs, go to https://developers.google.com/gadgets/docs/gs

In addition, if you do not want the user preferences to be rendered using the default view, customize the way in which the user preferences should appear. For more information, see Configuring Customized User Preference Settings.

Step 3 - Define the gadget.json file

The gadget.json file is a configuration file that is specifically used by the WSO2 Dashboard Server (WSO2 DS) for a gadget. Create the gadget.json file in the the <DS_HOME>/repository/deployment/server/jaggeryapps/portal/store/<TENANT_NAME>/<GADGET_NAME> directory. 

...

  • type - This defines the type of this document to be rendered by the Shindig. In this case, specify the type as gadget.
  • data - This contains the URL of the location of the index.xml that corresponds to the gadget.
  • notify - This is the most important. This is the property that defines whether this gadget is a publisher or not. By adding this property we can define a channel to publish messages. In this sample, a channel named history is being created. The notify property has two sub properties which are as follows: type and description. The property named type is used to define the type of the publisher.
  • listen - This property defines whether this specific gadget can subscribe to a channel or not. A listener named state has been created for this sample, which has the same properties that a publisher channel has. Type will filter the publisher channels that the gadget can listen to.

...