Opensocial.Collection (v0.9)

From VZ Developer Wiki
Revision as of 12:13, 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>opensocial.Collection</strong></span> Collection of multip…')
(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.

opensocial.Collection

Collection of multiple objects with useful accessors. May also represent subset of a larger collection (for example, page 1 of 10) and contain information about the larger collection.

Methods

opensocial.Collection.asArray

Array.<Object> asArray()
Returns
Type Description
Array.<Object> The values in this collection
Description
Returns an array of all the objects in this collection.

opensocial.Collection.each

each(fn)
Parameters
Name Type Description
fn Function The function to call with each collection entry
Description
Executes the provided function once per member of the collection, with each member in turn as the parameter to the function.

opensocial.Collection.getById

Object? getById(id)
Parameters
Name Type Description
id String The ID to look for
Returns
Type Description
Object? The data
Description
Finds the entry with the given ID value, or returns null if none is found.

opensocial.Collection.getOffset

Number getOffset()
Returns
Type Description
Number The offset into the total collection
Description
Gets the offset of this collection within a larger result set.

opensocial.Collection.getTotalSize

Number getTotalSize()
Returns
Type Description
Number The total size of the result
Description
Gets the total size of the larger result set that this collection belongs to.

opensocial.Collection.size

Number size()
Returns
Type Description
Number The size of this collection
Description
Gets the size of this collection, which is equal to or less than the total size of the result.



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