Difference between revisions of "Opensocial.DataResponse (v0.8)"

From VZ Developer Wiki
Jump to: navigation, search
(Die Seite wurde neu angelegt: „<span style="font-size:150%">'''opensocial.DataResponse'''</span> This object contains the requested server data mapped to the requested keys. See also: [[opens…“)
(No difference)

Revision as of 11:14, 14 September 2009

opensocial.DataResponse

This object contains the requested server data mapped to the requested keys.

See also: opensocial.DataRequest

Methods

get

opensocial.ResponseItem get(key)
Gets the ResponseItem for the requested field.
Parameters
key the string specified in the corresponding data request item.
Returns
opensocial.ResponseItem The requested response calculated by the server

getErrorMessage

String getErrorMessage()
If the entire request had a batch level error, returns the error message.
Returns 
String A human-readable description of the error that occurred.

hadError

Boolean hadError()
Returns true if there was an error in fetching this data from the server.
Returns 
Boolean True if there was an error; otherwise, false

Examples

function response(data) {
  if (data.hadError()) {
    output("Error: " + data.get("req").getErrorMessage());
  } else {
    output(data.get("req").getData().getDisplayName());
  }
  gadgets.window.adjustHeight();
};

function request() {
  var req = opensocial.newDataRequest();
  req.add(req.newFetchPersonRequest(opensocial.DataRequest.PersonId.OWNER), "req");
  req.send(response);
};


We are implementing the following APIs from the OpenSocial 0.8 spec

gadgets.flash

gadgets.io

gadgets.json

gadgets.MiniMessage

gadgets.Prefs

gadgets.pubsub

gadgets.rpc

gadgets.skins

gadgets.Tab


gadgets.TabSet

gadgets.util

gadgets.views

gadgets.window

opensocial

opensocial.Activity

opensocial.Address

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.Name

opensocial.NavigationParameters

opensocial.Organization

opensocial.Permission

opensocial.Person

opensocial.Phone

opensocial.ResponseItem

opensocial.Url