Describes a Photoset on flickr.com
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.
0.5.0
Kelvin Luck < kelvin at kelvinluck dot com >
$Id: Photoset.as 79 2006-09-06 16:57:39Z kluck $
| com. kelvinluck. flashr. core. Photoset | Describes a Photoset on flickr.com |
| id | The id of this Photoset |
| owner | The Person who owns this Photoset |
| url | The URL to this Photoset on flickr.com |
| primaryPhoto | The primary Photo for this Photoset |
| numPhotos | The total number of Photos in this Photoset |
| _photos | Private array of Photos in this Photoset (empty until Flashr.photosetsGetPhotos is called or indivdual Photos are added to the set via Flashr.photosetsAddPhoto). |
| title | The title of this Photoset |
| description | The description of this Photoset |
| _comments | Array which holds the PhotosetComments that have been made on this Photoset. |
| _photosets | A private static Object containing Photoset objects. |
| Photoset | Private constructor - do not call directly, is accessed via Photoset.getPhotoset |
| _setPhotos | Private internal function - sets this photosets _photos Array to the passed in array. |
| _addPhoto | 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. |
| _removePhoto | Private internal function - Removes a Photo from this Photoset - called as a result of a call to Flashr.photosetsRemovePhoto |
| _editPhotos | Replaces this photoset’s _photos array with one made up from the passed photoIds. |
| _clearPhotos | Clears this photoset’s _photos array. |
| getPhotos | Get’s this Photosets _photos Array. |
| _clearComments | Private function used internally to clear the _comments array when we are getting a complete new list (e.g. |
| _addComment | Called by Flashr.photosetsCommentsAddComment and Flashr.photosetsCommentsGetList to add PhotosetComments to this Photoset’s internal representation. |
| 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 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. |
| _destroy | Destroys and deletes this Photoset. |
| getPhotoset | Get’s a Photoset object for the given photoset ID. |
| toString |
var id: String
The id of this Photoset
var url: String
The URL to this Photoset on flickr.com
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.
getPhotos, _setPhotos, _addPhoto, _removePhoto, _editPhotos, _clearPhotos
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.
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
private function Photoset( id: String )
Private constructor - do not call directly, is accessed via Photoset.getPhotoset
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
private function _removePhoto( photo: Photo )
Private internal function - Removes a Photo from this Photoset - called as a result of a call to Flashr.photosetsRemovePhoto
| photo | The Photo to remove from this Photoset |
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
| primaryPhoto | The primary Photo for this set. |
| photoIds | An array of the ids of Photos in this set. |
private function _clearPhotos()
Clears this photoset’s _photos array. Used when the photo list is loaded completely e.g. from Flashr.photosetsGetPhotos
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)
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.
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.
| commentId | The id of the PhotosetComment being released. |
Whether the comment was in the _comments Array and so was deleted.
private function _destroy()
Destroys and deletes this Photoset. Private and called internally on a sucessful response from Flashr.photosetsDelete.
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
| id | The id of the Photoset you want to get |
The id of this Photoset
var id: String
Private constructor - do not call directly, is accessed via Photoset.getPhotoset
private function Photoset( id: String )
The Person who owns this Photoset
var owner: Person
The URL to this Photoset on flickr.com
var url: String
The primary Photo for this Photoset
var primaryPhoto: Photo
The total number of Photos in this Photoset
var numPhotos: Number
Private array of Photos in this Photoset (empty until Flashr.photosetsGetPhotos is called or indivdual Photos are added to the set via Flashr.photosetsAddPhoto).
private var _photos: Array
Get the list of photos in a set.
function photosetsGetPhotos( photosetId: String, extras: String, privacyFilter: Number ):FlashrRequest
Add a photo to the end of an existing photoset.
function photosetsAddPhoto( photosetId: String, photoId: String ):FlashrRequest
The title of this Photoset
var title: String
The description of this Photoset
var description: String
Array which holds the PhotosetComments that have been made on this Photoset.
private var _comments: Array
A private static Object containing Photoset objects.
private static var _photosets: Object
Get’s a Photoset object for the given photoset ID.
public static function getPhotoset( id: String ):Photoset
Private internal function - sets this photosets _photos Array to the passed in array.
private function _setPhotos( photos: Array )
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 _addPhoto( photo: Photo )
Private internal function - Removes a Photo from this Photoset - called as a result of a call to Flashr.photosetsRemovePhoto
private function _removePhoto( photo: Photo )
Remove a photo from a photoset.
function photosetsRemovePhoto( photosetId: String, photoId: String ):FlashrRequest
Replaces this photoset’s _photos array with one made up from the passed photoIds.
private function _editPhotos( primaryPhoto: Photo, photoIds: Array )
Clears this photoset’s _photos array.
private function _clearPhotos()
Get’s this Photosets _photos Array.
function getPhotos():Array
Private function used internally to clear the _comments array when we are getting a complete new list (e.g.
private function _clearComments()
Called by Flashr.photosetsCommentsAddComment and Flashr.photosetsCommentsGetList to add PhotosetComments to this Photoset’s internal representation.
private function _addComment( comment: PhotosetComment )
Add a comment to a photoset.
function photosetsCommentsAddComment( photosetId: String, comment: String ):FlashrRequest
Returns the comments for a photoset.
function photosetsCommentsGetList( photosetId: String, comment: String ):FlashrRequest
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).
function getComments()
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.
private function _deleteComment( commentId: String ):Boolean
Delete a photoset comment as the currently authenticated user.
function photosetsCommentsDeleteComment( commentId: String ):FlashrRequest
Destroys and deletes this Photoset.
private function _destroy()
public function toString():String
Modify the photos in a photoset.
function photosetsEditPhotos( photosetId: String, primaryPhotoId: Number, photoIds: Array ):FlashrRequest
Delete a photoset.
function photosetsDelete( photosetId: String ):FlashrRequest