O'Reilly logo

Programming Social Applications by Jonathan LeBlanc

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Extending the Person Object

While exploring the Person object, you might have noted a need for additional layers of data to help you drill down to exactly the information you want to use. Fortunately, OpenSocial defines extensions to several Person fields to allow developers to obtain more specific details. These extensions are broken down into the following subsections.

Addresses (opensocial.Address)

The OpenSocial Address object is a standardized way to display an address in an OpenSocial application. Address information may contain street information, data about the type of place, and geographically relevant plotting data. For example:

"address": {
   "country": "United States",
   "latitude": 37.371609,
   "longitude": −122.038254,
   "locality": "Sunnyvale",
   "region": "California",
   "streetAddress": "701 First Avenue",
   "type": "work"
}

Depending on the container’s needs or implementation specifications, an OpenSocial Address object may contain a number of different fields. These are listed in Table 5-4.

Table 5-4. Address object fields

Key

Description

opensocial.Address.Field.COUNTRY (string)

The country of the address. May be used interchangeably with country.

opensocial.Address.Field.EXTENDED_ADDRESS (string)

The extended address specified as a string. May be used interchangeably with extendedAddress.

opensocial.Address.Field.LATITUDE (number)

The latitude of the address. May be used interchangeably with latitude.

opensocial.Address.Field.LOCALITY (string)

The address locality. May be used interchangeably ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required