Difference between revisions of "Opensocial.Enum (v0.9)"

From VZ Developer Wiki
Jump to: navigation, search
(Created page with '{{NeedsExamples}} <div style="float:right; margin: 0 0 10px 10px;">__TOC__</div> <span style="font-size:150%"><strong>opensocial.Enum</strong></span> Base interface for all enu…')
(No difference)

Revision as of 12:15, 29 July 2010

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

opensocial.Enum

Base interface for all enum objects. This class allows containers to use constants for fields that are usually have a common set of values. There are two main ways to use this class. If your gadget just wants to display how much of a smoker someone is, it can simply use: <figure> <artwork xml:space="preserve"> html = "This person smokes: " + person.getField('smoker').getValue(); </artwork> </figure> This value field will be correctly set up by the container. This is a place where the container can even localize the value for the gadget so that it always shows the right thing. If your gadget wants to have some logic around the smoker field it can use: <figure> <artwork xml:space="preserve"> if (person.getField('smoker').getKey() != "NO") { //gadget logic here } </artwork> </figure> Note: The key may be null if the person's smoker field cannot be coerced into one of the standard enum types. The value, on the other hand, is never null.

Methods

opensocial.Enum.getDisplayValue

String getDisplayValue()
Returns
Type Description
String The enum's value.
Description
The value of this enum. This will be a user displayable string. If the container supports localization, the string will be localized.

opensocial.Enum.getKey

String getKey()
Returns
Type Description
String The enum's key. This should be one of the defined enums below.
Description
Use this for logic within your gadget. If they key is null then the value does not fit in the defined enums.

opensocial.Enum.Drinker

The enum keys used by the drinker field. See also: opensocial.Person.Field.Drinker

opensocial.Enum.Drinker.HEAVILY

This field may be used interchangeably with the string 'HEAVILY'.

opensocial.Enum.Drinker.NO

This field may be used interchangeably with the string 'NO'.

opensocial.Enum.Drinker.OCCASIONALLY

This field may be used interchangeably with the string 'OCCASIONALLY'.

opensocial.Enum.Drinker.QUIT

This field may be used interchangeably with the string 'QUIT'.

opensocial.Enum.Drinker.QUITTING

This field may be used interchangeably with the string 'QUITTING'.

opensocial.Enum.Drinker.REGULARLY

This field may be used interchangeably with the string 'REGULARLY'.

opensocial.Enum.Drinker.SOCIALLY

This field may be used interchangeably with the string 'SOCIALLY'.

opensocial.Enum.Drinker.YES

This field may be used interchangeably with the string 'YES'.

opensocial.Enum.Gender

The enum keys used by the gender field. See also: opensocial.Person.Field.Gender

opensocial.Enum.Gender.FEMALE

This field may be used interchangeably with the string 'FEMALE'.

opensocial.Enum.Gender.MALE

This field may be used interchangeably with the string 'MALE'.

opensocial.Enum.LookingFor

The enum keys used by the lookingFor field. See also: opensocial.Person.Field.LookingFor

opensocial.Enum.LookingFor.ACTIVITY_PARTNERS

<static> Member of: opensocial.Enum.LookingFor.ACTIVITY_PARTNERS This field may be used interchangeably with the string 'ACTIVITY_PARTNERS'.

opensocial.Enum.LookingFor.DATING

This field may be used interchangeably with the string 'DATING'.

opensocial.Enum.LookingFor.FRIENDS

This field may be used interchangeably with the string 'FRIENDS'.

opensocial.Enum.LookingFor.NETWORKING

This field may be used interchangeably with the string 'NETWORKING'.

opensocial.Enum.LookingFor.RANDOM

This field may be used interchangeably with the string 'RANDOM'.

opensocial.Enum.LookingFor.RELATIONSHIP

This field may be used interchangeably with the string 'RELATIONSHIP'.

opensocial.Enum.Presence

The enum keys used by the networkPresence field. See also: opensocial.Person.Field.NetworkPresence

opensocial.Enum.Presence.AWAY

The entity or resource is temporarily away. This field may be used interchangeably with the string 'AWAY'.

opensocial.Enum.Presence.CHAT

The entity or resource is actively interested in chatting. This field may be used interchangeably with the string 'CHAT'.

opensocial.Enum.Presence.DND

The entity or resource is busy (dnd = "Do Not Disturb"). This field may be used interchangeably with the string 'DND'.

opensocial.Enum.Presence.OFFLINE

The entity or resource is off line. This field may be used interchangeably with the string 'OFFLINE'.

opensocial.Enum.Presence.ONLINE

The entity or resource is on line. This field may be used interchangeably with the string 'ONLINE'.

opensocial.Enum.Presence.XA

The entity or resource is away for an extended period (xa = "eXtended Away"). This field may be used interchangeably with the string 'XA'.

opensocial.Enum.Smoker

The enum keys used by the smoker field. See also: opensocial.Person.Field.Smoker

opensocial.Enum.Smoker.HEAVILY

This field may be used interchangeably with the string 'HEAVILY'.

opensocial.Enum.Smoker.NO

This field may be used interchangeably with the string 'NO'.

opensocial.Enum.Smoker.OCCASIONALLY

This field may be used interchangeably with the string 'OCCASIONALLY'.

opensocial.Enum.Smoker.QUIT

This field may be used interchangeably with the string 'QUIT'.

opensocial.Enum.Smoker.QUITTING

This field may be used interchangeably with the string 'QUITTING'.

opensocial.Enum.Smoker.REGULARLY

This field may be used interchangeably with the string 'REGULARLY'.

opensocial.Enum.Smoker.SOCIALLY

This field may be used interchangeably with the string 'SOCIALLY'.

opensocial.Enum.Smoker.YES

This field may be used interchangeably with the string 'YES'.



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