com. kelvinluck. flashr. core. Photoset

Describes a Photoset on flickr.com

Licence

This code and documentation is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 2.0.  http://creativecommons.org/licenses/by-nc-sa/2.0/

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Version

0.5.0

Author

Kelvin Luck < kelvin at kelvinluck dot com >

Project Website

http://flashr.kelvinluck.com/

Subversion Id

$Id: Photoset.as 79 2006-09-06 16:57:39Z kluck $

Summary
com. kelvinluck. flashr. core. PhotosetDescribes a Photoset on flickr.com
idThe id of this Photoset
ownerThe Person who owns this Photoset
urlThe URL to this Photoset on flickr.com
primaryPhotoThe primary Photo for this Photoset
numPhotosThe total number of Photos in this Photoset
_photosPrivate array of Photos in this Photoset (empty until Flashr.photosetsGetPhotos is called or indivdual Photos are added to the set via Flashr.photosetsAddPhoto).
titleThe title of this Photoset
descriptionThe description of this Photoset
_commentsArray which holds the PhotosetComments that have been made on this Photoset.
_photosetsA private static Object containing Photoset objects.
PhotosetPrivate constructor - do not call directly, is accessed via Photoset.getPhotoset
_setPhotosPrivate internal function - sets this photosets _photos Array to the passed in array.
_addPhotoPrivate internal function - adds a Photo to the end of this Photoset’s _photos array and updates numPhotos Called internally on a successful response from flickr.photosets.addPhoto.
_removePhotoPrivate internal function - Removes a Photo from this Photoset - called as a result of a call to Flashr.photosetsRemovePhoto
_editPhotosReplaces this photoset’s _photos array with one made up from the passed photoIds.
_clearPhotosClears this photoset’s _photos array.
getPhotosGet’s this Photosets _photos Array.
_clearCommentsPrivate function used internally to clear the _comments array when we are getting a complete new list (e.g.
_addCommentCalled by Flashr.photosetsCommentsAddComment and Flashr.photosetsCommentsGetList to add PhotosetComments to this Photoset’s internal representation.
getCommentsGet’s the _comments Array containing all of the comments that have been made on this Photoset (providing that Flashr.photosetsCommentsGetList has been called first).
_deleteCommentPrivate function to be used internally by Flashr to remove a PhotosetComment from the _comments Array when the PhotosetComment has been deleted via a call to Flashr.photosetsCommentsDeleteComment.
_destroyDestroys and deletes this Photoset.
getPhotosetGet’s a Photoset object for the given photoset ID.
toString

id

var id: String

The id of this Photoset

owner

var owner: Person

The Person who owns this Photoset

url

var url: String

The URL to this Photoset on flickr.com

primaryPhoto

var primaryPhoto: Photo

The primary Photo for this Photoset

numPhotos

var numPhotos: Number

The total number of Photos in this Photoset

_photos

private var _photos: Array

Private array of Photos in this Photoset (empty until Flashr.photosetsGetPhotos is called or indivdual Photos are added to the set via Flashr.photosetsAddPhoto).  Public access is only available through getPhotos.

See Also

getPhotos, _setPhotos, _addPhoto, _removePhoto, _editPhotos, _clearPhotos

title

var title: String

The title of this Photoset

description

var description: String

The description of this Photoset

_comments

private var _comments: Array

Array which holds the PhotosetComments that have been made on this Photoset.

See Also

_addComment, getComments, _deleteComment

_photosets

private static var _photosets: Object

A private static Object containing Photoset objects.  Used by getPhotoset to insure that only one Photoset is created for each photoset ID returned from flickr.com

Photoset

private function Photoset(id: String)

Private constructor - do not call directly, is accessed via Photoset.getPhotoset

_setPhotos

private function _setPhotos(photos: Array)

Private internal function - sets this photosets _photos Array to the passed in array.  Called internally when there is a response to Flashr.photosetsGetPhotos

_addPhoto

private function _addPhoto(photo: Photo)

Private internal function - adds a Photo to the end of this Photoset’s _photos array and updates numPhotos Called internally on a successful response from flickr.photosets.addPhoto.

Parameters

photoThe photo to add.

_removePhoto

private function _removePhoto(photo: Photo)

Private internal function - Removes a Photo from this Photoset - called as a result of a call to Flashr.photosetsRemovePhoto

Parameters

photoThe Photo to remove from this Photoset

See Also

Flashr.photosetsRemovePhoto

_editPhotos

private function _editPhotos(primaryPhoto: Photo,
photoIds: Array)

Replaces this photoset’s _photos array with one made up from the passed photoIds.  Called when there is a response from flickr.com to flickr.photosets.editPhotos

Parameters

primaryPhotoThe primary Photo for this set.
photoIdsAn array of the ids of Photos in this set.

See Also

Flashr.photosetsEditPhotos

_clearPhotos

private function _clearPhotos()

Clears this photoset’s _photos array.  Used when the photo list is loaded completely e.g. from Flashr.photosetsGetPhotos

getPhotos

function getPhotos():Array

Get’s this Photosets _photos Array.

Returns

The _photos for this Photoset

_clearComments

private function _clearComments()

Private function used internally to clear the _comments array when we are getting a complete new list (e.g. from Flashr.photosetsCommentsGetList)

_addComment

private function _addComment(comment: PhotosetComment)

Called by Flashr.photosetsCommentsAddComment and Flashr.photosetsCommentsGetList to add PhotosetComments to this Photoset’s internal representation.  Private because should only be used internally by Flashr.

getComments

function getComments()

Get’s the _comments Array containing all of the comments that have been made on this Photoset (providing that Flashr.photosetsCommentsGetList has been called first).

_deleteComment

private function _deleteComment(commentId: String):Boolean

Private function to be used internally by Flashr to remove a PhotosetComment from the _comments Array when the PhotosetComment has been deleted via a call to Flashr.photosetsCommentsDeleteComment.

Parameters

commentIdThe id of the PhotosetComment being released.

Returns

Whether the comment was in the _comments Array and so was deleted.

_destroy

private function _destroy()

Destroys and deletes this Photoset.  Private and called internally on a sucessful response from Flashr.photosetsDelete.

getPhotoset

public static function getPhotoset(id: String):Photoset

Get’s a Photoset object for the given photoset ID.

Consults _photosets to make sure that only one Photoset instance is created for each photoset ID from flickr.com

Parameters

idThe id of the Photoset you want to get

toString

public function toString():String
var id: String
The id of this Photoset
private function Photoset(id: String)
Private constructor - do not call directly, is accessed via Photoset.getPhotoset
var owner: Person
The Person who owns this Photoset
Class to describe a person from Flickr.
var url: String
The URL to this Photoset on flickr.com
var primaryPhoto: Photo
The primary Photo for this Photoset
Class to describe a photo from Flickr.
var numPhotos: Number
The total number of Photos in this Photoset
private var _photos: Array
Private array of Photos in this Photoset (empty until Flashr.photosetsGetPhotos is called or indivdual Photos are added to the set via Flashr.photosetsAddPhoto).
function photosetsGetPhotos(photosetId: String,
extras: String,
privacyFilter: Number):FlashrRequest
Get the list of photos in a set.
function photosetsAddPhoto(photosetId: String,
photoId: String):FlashrRequest
Add a photo to the end of an existing photoset.
var title: String
The title of this Photoset
var description: String
The description of this Photoset
private var _comments: Array
Array which holds the PhotosetComments that have been made on this Photoset.
Class to describe a comment on a Photoset on Flickr.
private static var _photosets: Object
A private static Object containing Photoset objects.
public static function getPhotoset(id: String):Photoset
Get’s a Photoset object for the given photoset ID.
private function _setPhotos(photos: Array)
Private internal function - sets this photosets _photos Array to the passed in array.
private function _addPhoto(photo: Photo)
Private internal function - adds a Photo to the end of this Photoset’s _photos array and updates numPhotos Called internally on a successful response from flickr.photosets.addPhoto.
private function _removePhoto(photo: Photo)
Private internal function - Removes a Photo from this Photoset - called as a result of a call to Flashr.photosetsRemovePhoto
function photosetsRemovePhoto(photosetId: String,
photoId: String):FlashrRequest
Remove a photo from a photoset.
private function _editPhotos(primaryPhoto: Photo,
photoIds: Array)
Replaces this photoset’s _photos array with one made up from the passed photoIds.
private function _clearPhotos()
Clears this photoset’s _photos array.
function getPhotos():Array
Get’s this Photosets _photos Array.
private function _clearComments()
Private function used internally to clear the _comments array when we are getting a complete new list (e.g.
private function _addComment(comment: PhotosetComment)
Called by Flashr.photosetsCommentsAddComment and Flashr.photosetsCommentsGetList to add PhotosetComments to this Photoset’s internal representation.
function photosetsCommentsAddComment(photosetId: String,
comment: String):FlashrRequest
Add a comment to a photoset.
function photosetsCommentsGetList(photosetId: String,
comment: String):FlashrRequest
Returns the comments for a photoset.
function getComments()
Get’s the _comments Array containing all of the comments that have been made on this Photoset (providing that Flashr.photosetsCommentsGetList has been called first).
private function _deleteComment(commentId: String):Boolean
Private function to be used internally by Flashr to remove a PhotosetComment from the _comments Array when the PhotosetComment has been deleted via a call to Flashr.photosetsCommentsDeleteComment.
function photosetsCommentsDeleteComment(commentId: String):FlashrRequest
Delete a photoset comment as the currently authenticated user.
private function _destroy()
Destroys and deletes this Photoset.
public function toString():String
function photosetsEditPhotos(photosetId: String,
primaryPhotoId: Number,
photoIds: Array):FlashrRequest
Modify the photos in a photoset.
function photosetsDelete(photosetId: String):FlashrRequest
Delete a photoset.