Module: explorer/ExplorerContainer

explorer/ExplorerContainer

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
Source:
See:

Extends

  • dijit/_WidgetBase
  • dijit/_TemplatedMixin
  • dojo/Evented

Classes

constructor

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
result module: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
actionObjArray Object[] The actions that should be hidden.
Source:
Emits an event letting listeners know to navigate to a gadget for an action.
Parameters:
Name Type Argument Description
gadgetUrl String The URL to the gadget to render.
opt_params Object <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
dataModel Object A JSON object representing the embedded experiences data model.
siteNode Element 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
url String The URL of the gadget to render.
site osapi.container.GadgetSite The site to render the gadget in.
opt_renderParams Object <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
actionObjArray Object[] The array of actions from the gadget.
container osapi.container.Container The OpenSocial container object.
runAction Function 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
token String The security token.
ttl Number 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
containerToken String Container security token.
ttl Number Container security token time to live.
Source:

Events

addaction

addaction event.
Parameters:
Name Type Description
action Object The action that was added.
Source:
See:

destroyelement

destroyelement event.
Parameters:
Name Type Description
site osapi.container.GadgetSite The osapi.container.GadgetSite|gadget site to destroy.
Source:

navigateee

navigateee event.
Parameters:
Name Type Argument Description
rel Element The element containing the gadget requesting to open the URL.
opt_gadgetInfo Object <optional>
The metadata of the embedded experience gadget being opened.
opt_viewTarget String <optional>
The view target to open.
opt_coordinates Object <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_callback Function 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
gadgetUrl String The URL of the gadget that is being navigated to.
opt_params Object <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
metadata Object The gadget metadata for the gadget being opened.
rel Element The element containing the gadget requesting to open the URL.
opt_view String <optional>
The view of the gadget to open.
opt_viewTarget String <optional>
The view target to open.
opt_coordinates Object <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_callback Function 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
rel Element The element containing the gadget requesting to open the URL.
opt_viewTarget String <optional>
The view target to open.
opt_coordinates Object <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_callback Function 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
action Object The action that was removed.
Source:
See: