Opensocial.Album (v0.9)
- 1 Methods
- 2 opensocial.Album.Field
- 2.1 opensocial.Album.Field.DESCRIPTION
- 2.2 opensocial.Album.Field.ID
- 2.3 opensocial.Album.Field.LOCATION
- 2.4 opensocial.Album.Field.MEDIA_ITEM_COUNT
- 2.5 opensocial.Album.Field.MEDIA_MIME_TYPE
- 2.6 opensocial.Album.Field.MEDIA_TYPE
- 2.7 opensocial.Album.Field.OWNER_ID
- 2.8 opensocial.Album.Field.THUMBNAIL_URL
- 2.9 opensocial.Album.Field.TITLE
- 3 Example
opensocial.Album
Class for Album features.
Methods
opensocial.Album.getField
;String getField(key, opt_params)
Parameters
NameTypeDescription |
Returns
TypeDescription |
Description
Gets the album data that's associated with the specified key.
opensocial.Album.setField
;setField(key, data)
Parameters
NameTypeDescription |
Description
Sets data for this album associated with the given key.
opensocial.Album.Field
All of the fields that albums can have. It is only required to set ID. Other possible fields to set are: THUMBNAIL_URL, TITLE, DESCRIPTION, LOCATION, OWNER_ID, MEDIA_TYPE, MEDIA_MIME_TYPE, MEDIA_ITEM_COUNT. See also: opensocial.Album.getField()
opensocial.Album.Field.DESCRIPTION
string, description of the album. May be used interchangeably with the string 'description'.
opensocial.Album.Field.ID
string, unique identifier for the album. May be used interchangeably with the string 'id'.
opensocial.Album.Field.LOCATION
opensocial.Address, location corresponding to the album. May be used interchangeably with the string 'location'.
opensocial.Album.Field.MEDIA_ITEM_COUNT
integer, number of items in the album. May be used interchangeably with the string 'mediaItemCount'.
opensocial.Album.Field.MEDIA_MIME_TYPE
array of strings identifying the mime-types of media items in the Album. May be used interchangeably with the string 'mediaMimeType'.
opensocial.Album.Field.MEDIA_TYPE
array of MediaItem.TYPE, types of MediaItems in the Album. May be used interchangeably with the string 'mediaType'.
opensocial.Album.Field.OWNER_ID
string, ID of the owner of the album. May be used interchangeably with the string 'ownerId'.
opensocial.Album.Field.THUMBNAIL_URL
string, URL to a thumbnail cover of the album. May be used interchangeably with the string 'thumbnailUrl'.
opensocial.Album.Field.TITLE
string, the title of the album. May be used interchangeably with the string 'title'.
Example
Requesting orkut Albums and Photos, by Jason Cooper, orkut Team, Februrary 2009
CSS
img {
border: solid gray 1px;
}
photoGrid img {
}
table {
border: solid gray 1px;
background-color: #EEEEEE;
margin-bottom: 15px;
}
HTML
Photos from selected album:
JavaScript
// Fetches all of the viewer's albums that are publicly viewable (i.e.
// "shared with everyone"
function fetchAlbums() {
var req = opensocial.newDataRequest();
var idspec = opensocial.newIdSpec( {
'userId' : 'VIEWER',
'groupId' : 'SELF'
});