An AMD module that can be used to manage an OpenSocial container. This module depends on the container Javascript
to already be loaded. This module requires the following container features to be loaded as well.
- embedded-experiences
- open-views
- actions
- selection
Extends
- dijit/_WidgetBase
- dijit/_TemplatedMixin
- dojo/Evented
Classes
Methods
-
getContainer() → {osapi.container.Container}
-
Gets the common container.
- Source:
- See:
Returns:
The common container.- Type
- osapi.container.Container
-
getContainerToken(result)
-
Will get called when Shindig needs to get a new container security token.
Parameters:
Name Type Description resultmodule:explorer/widgets/ExplorerContainer~containerTokenCallback The callback that gets called with the container token. - Source:
-
handleDestroyElement() → {Function}
-
Returns a closure to handle destroy element calls from gadgets closing other gadgets they have opened.
- Source:
Returns:
A closure to handle destroy element calls from gadgets closing other gadgets they have opened.- Type
- Function
-
handleNavigateEE() → {Function}
-
Returns a closure to handle navigate embedded experience calls from gadgets.
- Source:
Returns:
A closure that handles navigate embedded experience calls for gadgets.- Type
- Function
-
handleNavigateGadget() → {Function}
-
Returns a closure to handle navigate gadget calls from gadgets.
- Source:
Returns:
A closure that handles navigate gadget calls for gadgets.- Type
- Function
-
handleNavigateUrl() → {Function}
-
Returns a closure to handle navigate URL calls from gadgets.
- Source:
Returns:
A closure that handles navigate URL calls for gadgets.- Type
- Function
-
hideActions(actionObjArray)
-
Called when actions from a gadget should be hidden.
Parameters:
Name Type Description actionObjArrayObject[] The actions that should be hidden. - Source:
-
navigateForActions(gadgetUrl, opt_params)
-
Emits an event letting listeners know to navigate to a gadget for an action.
Parameters:
Name Type Argument Description gadgetUrlString The URL to the gadget to render. opt_paramsObject <optional>
Optional parameter used by the container, see the OpenSocial spec for more details about how this object should be constructed. - Source:
-
renderEmbeddedExperience(dataModel, siteNode) → {module:dojo/promise/Promise}
-
Renders an embedded experience gadget.
Parameters:
Name Type Description dataModelObject A JSON object representing the embedded experiences data model. siteNodeElement The element to be used for the site. - Source:
Returns:
Returns a Dojo Promise. Call the then method of this Promise with a function that takes in one parameter, the gadget metadata and the osapi.container.GadgetSite|gadget site.- Type
- module:dojo/promise/Promise
Example
var container = new ExplorerContainer(); container.renderEmbeddedExperience(....).then(function(metadata, site) { if(metadata && metadata[gadgetUrl]) { //Do something with the metadata } }); -
renderGadget(url, site, opt_renderParams) → {module:dojo/promise/Promise}
-
Renders a gadget.
Parameters:
Name Type Argument Description urlString The URL of the gadget to render. siteosapi.container.GadgetSite The site to render the gadget in. opt_renderParamsObject <optional>
Optional parameter used by the container, see the OpenSocial spec for more details about how this object should be constructed. - Source:
Returns:
Returns a Dojo Promise. Call the then method of this Promise with a function that takes in one parameter, the gadget metadata.- Type
- module:dojo/promise/Promise
Example
var container = new ExplorerContainer(); container.renderGadget(....).then(function(metadata) { if(metadata && metadata[gadgetUrl]) { //Do something with the metadata } }); -
showActions(actionObjArray, container, runAction)
-
Called when a gadget is rendered which has actions.
Parameters:
Name Type Description actionObjArrayObject[] The array of actions from the gadget. containerosapi.container.Container The OpenSocial container object. runActionFunction Function which will run an action in the OpeSocial container. - Source:
-
subscribe()
-
This classes topic subscriptions. Subclasses may override this method to add their own.
- Source:
-
updateContainerSecurityToken(token, ttl)
-
Updates the container security token and forces a refresh of all of the gadget security tokens to ensure owner/viewer information is up-to-date.
Parameters:
Name Type Description tokenString The security token. ttlNumber The time to live for the security token. - Source:
Type Definitions
-
containerTokenCallback(containerToken, ttl)
-
Callback to get the container security token.
Parameters:
Name Type Description containerTokenString Container security token. ttlNumber Container security token time to live. - Source:
Events
-
addaction
-
addaction event.
Parameters:
Name Type Description actionObject The action that was added. - Source:
- See:
-
destroyelement
-
destroyelement event.
Parameters:
Name Type Description siteosapi.container.GadgetSite The osapi.container.GadgetSite|gadget site to destroy. - Source:
-
navigateee
-
navigateee event.
Parameters:
Name Type Argument Description relElement The element containing the gadget requesting to open the URL. opt_gadgetInfoObject <optional>
The metadata of the embedded experience gadget being opened. opt_viewTargetString <optional>
The view target to open. opt_coordinatesObject <optional>
The coordinates of where to open the URL. osapi.container.GadgetSite The osapi.container.GadgetSite|gadget site of the gadget requesting to open the URL. opt_callbackFunction A function to call once the DOM element to be used for the URL site has been created. You should call this function and pass the DOM element. - Source:
-
navigateforactions
-
navigateforactions event.
Parameters:
Name Type Argument Description gadgetUrlString The URL of the gadget that is being navigated to. opt_paramsObject <optional>
Optional parameter used by the container, see the OpenSocial spec for more details about how this object should be constructed. - Source:
-
navigategadget
-
navigategadget event.
Parameters:
Name Type Argument Description metadataObject The gadget metadata for the gadget being opened. relElement The element containing the gadget requesting to open the URL. opt_viewString <optional>
The view of the gadget to open. opt_viewTargetString <optional>
The view target to open. opt_coordinatesObject <optional>
The coordinates of where to open the URL. osapi.container.GadgetSite The osapi.container.GadgetSite|gadget site of the gadget requesting to open the URL. opt_callbackFunction A function to call once the DOM element to be used for the URL site has been created. You should call this function and pass the DOM element. - Source:
-
navigateurl
-
navigateurl event.
Parameters:
Name Type Argument Description relElement The element containing the gadget requesting to open the URL. opt_viewTargetString <optional>
The view target to open. opt_coordinatesObject <optional>
The coordinates of where to open the URL. osapi.container.GadgetSite The osapi.container.GadgetSite|gadget site of the gadget requesting to open the URL. opt_callbackFunction A function to call once the DOM element to be used for the URL site has been created. You should call this function and pass the DOM element. - Source:
-
removeaction
-
removeaction event.
Parameters:
Name Type Description actionObject The action that was removed. - Source:
- See: