All Versions
Gadgets and Dashboards 3.0Gadgets and Dashboards 2.0
Gadgets and Dashboards 1.0
More...
This page gives an overview of the options available for allowing users to configure their instance of your gadget.
Security Note
Keep in mind that user preferences are stored in the container server, and are passed as URL parameters to the gadget rendering server. You may want to be careful about what you put in there. In particular, a shipping gadget would never want to store a username and password in user preferences, because then anyone with read access to a shared dashboard with that gadget would be able to get the owner's login information. See user authentication guidelines.
On this page:
UserPref
Element in the Gadget XMLYou can make use of the user preferences section of your gadget XML specification, where you can declaratively specify a set of configurable options. See our guide to the gadget XML specification.
Each user preference has a name, a display name, a data type and a default value. You can also flag a user preference as required or optional.
To access the user preferences from your gadget, you can use one or more of the following:
__UP_pref_name__
.setprefs
feature. See our guide to including features into your gadget.Enum
type preferencess (rendered as a radio button or select list) can only have values that are hardcoded in the specification file. This means that they are not useful for something like choosing a project from JIRA.prefs.getString()
. (See SHINDIG-89.) This means:
The other option is to handle configuration yourself, inside the gadget. This is the approach used by the Remember the Milk gadget, for example. In this case, you can store the settings in a user preference of type hidden
, using the setprefs
API as described in the Google developer guide, or you can come up with some other way to store the settings. You might be interested in looking at the json API for serialising data.
UserPref
. For example, if you want your gadget's title to be based on a user preference, you will have to use the settitle feature to do that yourself.UserPref
.Creating your Gadget XML Specification
Writing an Atlassian Gadget
Gadgets and Dashboards Development Hub