Gadgets.views (v0.9)

From VZ Developer Wiki
Revision as of 12:37, 29 July 2010 by Seba (talk | contribs) (Created page with '{{NeedsExamples}} <div style="float:right; margin: 0 0 10px 10px;">__TOC__</div> <span style="font-size:150%"><strong>gadgets.views</strong></span> Provides operations for deal…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This documentation is not completed yet and will be extended by more examples in future.

gadgets.views

Provides operations for dealing with views. See also: gadgets.views.View

Methods

gadgets.views.bind

<static> String gadgets.views.bind(urlTemplate, environment)
Parameters
Name Type Description
urlTemplate String A url template for a container view
environmentArrayA set of named variables of type string (for example, [OWNER, PATH, PARAMS, NAME]).
Returns
Type Description
String A URL string
Description
Binds a URL template with variables in the passed environment to produce a URL string.

See also: View.getUrlTemplate()

gadgets.views.getCurrentView

<static> gadgets.views.View gadgets.views.getCurrentView()
Returns
Type Description
gadgets.views.View The current view
Description
Returns the current view.

gadgets.views.getParams

<static> Map.<String|String> gadgets.views.getParams()
Returns
Type Description
Map.<String|String> The parameter map
Description
Returns the parameters passed into this gadget for this view. Does not include all URL parameters, only the ones passed into gadgets.views.requestNavigateTo.

gadgets.views.getSupportedViews

<static> Map<gadgets.views.ViewType | String|gadgets.views.View> gadgets.views.getSupportedViews()
Returns
Type Description
Map<gadgets.views.ViewType | String|gadgets.views.View> All supported views, keyed by their name attribute.
Description
Returns a map of all the supported views. Keys each gadgets.view.View by its name. This function only returns the primary views and does not return any secondary views. Example: if the markup indicates a set of views named Canvas.About, Profile.About, Home.About, Canvas.Help the returned views will only be Canvas, Profile, Home.

gadgets.views.requestNavigateTo

<static> gadgets.views.requestNavigateTo(view, opt_params, opt_ownerId)
Parameters
Name Type Description
view String | gadgets.views.View {string} view If set to a string, the name of the view to navigate to. If set to a View, the View object to navigate to. Passing a View has been deprecated.
opt_params Map.<String|String> {string} opt_params If the value is an object, it represents parameters to pass to the gadget after it has been navigated to on the surface. If the view navigated to contains an href and opt_params is a string, the value in opt_params is treated as a relative path that must be resolved relative to the href of the referenced view according to RFC 3986. If opt_params is a string all query parameters including query parameters encoded in a fragment are available in the receiving view using gadgets.views.getParams()
opt_ownerId String The ID of the owner of the page to navigate to; defaults to the current owner
Description
Attempts to navigate to this gadget in a different view. If the container supports parameter passing it will pass the optional parameters along to the gadget in the new view. This also allows for navigation to named views on the current surface. Views are composed of names that are [Surface](.[Secondary])?. The canonical Surface names are Canvas, Profile, Home. The Secondary names are user defined. When navigating from [Surface].valueX to [Surface].valueY, the container can stay on the same Surface but will show the appropriate <Content> sections whose View is [Surface].valueY. When navigating from SurfaceA.[Secondary] to SurfaceB.[Secondary], the container will switch to the SurfaceB surface and show the appropriate <Content> sections whose View is SurfaceB.[Secondary].In no cases must the .[Secondary] item ever be declared.

gadgets.views.View

Base interface for all view objects.

gadgets.views.ViewType

Used by gadgets.views.Views.

gadgets.views.ViewType.CANVAS

A view where the gadget is displayed in a very large mode. It is typically the main content on the page. The viewer is not always the same as the owner. This field may be used interchangeably with the string 'CANVAS'.

gadgets.views.ViewType.HOME

A view where the gadget is displayed in a small area usually on a page with other gadgets. Typically the viewer is the same as the owner. This field may be used interchangeably with the string 'HOME'.

gadgets.views.ViewType.PREVIEW

A demo view of the gadget. In this view the owner and viewer are not known. This field may be used interchangeably with the string 'PREVIEW'.

gadgets.views.ViewType.PROFILE

A view where the gadget is displayed in a small area usually on a page with other gadgets. The viewer is not always the same as the owner. This field may be used interchangeably with the string 'PROFILE'.



OpenSocial (v0.9)

gadgets

gadgets.io

gadgets.json

gadgets.Prefs

gadgets.util

gadgets.views

gadgets.flash

gadgets.MiniMessage

gadgets.oauth.Popup

gadgets.rpc

gadgets.skins

gadgets.pubsub

gadgets.Tab

gadgets.TabSet

gadgets.window

gadgets.i18n

opensocial

opensocial.Activity

opensocial.Address

opensocial.Album

opensocial.BodyType

opensocial.Collection

opensocial.CreateActivityPriority

opensocial.DataRequest

opensocial.DataResponse

opensocial.Email

opensocial.Enum

opensocial.Environment

opensocial.EscapeType

opensocial.IdSpec

opensocial.MediaItem

opensocial.Message

opensocial.MessageCollection

opensocial.Name

opensocial.NavigationParameters

opensocial.Organization

opensocial.Permission

opensocial.Person

opensocial.Phone

opensocial.ResponseItem

opensocial.Url

osapi.Request

osapi.BatchRequest

osapi.people

osapi.activities

osapi.appdata

osapi.messages

osapi.http