Require/Optional
The Require
(must include) and
Optional
(may include if available) elements denote feature
dependencies to be made available to a gadget. Both tags have a single
attribute available, feature
,
whose value denotes the feature that should be included.
Within the confines of an OpenSocial gadget, the Require
and Optional
statements are typically used to
indicate feature dependencies such as the OpenSocial version to use
(e.g., opensocial-1.0) or library-specific methods like the OpenSocial
lightweight JavaScript APIs (e.g., osapi).
Following are some sample Require
or Optional
elements within the ModulePrefs
node:
<ModulePrefs> <Require feature="opensocial-0.9"/> <Require feature="osapi"/> <Require feature="dynamic-height"/> <Optional feature="shareable-prefs"/> </ModulePrefs>
Get Programming Social Applications now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.