MethodGroupHelper

Kind of class:internal class
Package:com.adobe.webapis.flickr.methodgroups
Inherits from:none
Classpath:com.adobe.webapis.flickr.methodgroups.MethodGroupHelper
File last modified:Monday, 03 July 2006, 15:44:36
Contains helper functions for the method group classes that are reused throughout them.

Summary


Class methods
  • invokeMethod (service:FlickrService, callBack:Function, method:String, signed:Boolean, params:Array) : void
    • Reusable method that the "method group" classes can call to invoke a
  • processAndDispatch (service:FlickrService, propertyName:String = "", parseFunction:Function = null) : void
    • Handle processing the result of the API call.
  • processResponse (flickrResponse:String, propertyName:String, parseFunction:Function) : Object
    • Reusable method that the "method group" classes can call
  • dateToString (date:Date) : String
    • Converts a date object into a Flickr date string
  • stringToDate (str:String = "") : Date
    • Converts a Flickr date string into a date object
  • parseAuthResult (xml:XML) : AuthResult
    • Converts an auth result XML object into an AuthResult instance
  • parseFrob (xml:XML) : String
    • Converts a frob XML object into a string (the frob value)
  • parseBlogList (xml:XML) : Array
    • Converts a blog list XML object into an arry of Blog instances
  • parseContactList (xml:XML) : Array
    • Converts a contact list XML object into an array of User instances
  • parsePagedPhotoList (xml:XML) : PagedPhotoList
    • Converts a pages photo list XML object into a PagesPhotoList instance
  • parseGroupCategory (xml:XML) : Category
    • Converts a group category XML object into a Category instance
  • parseGroup (xml:XML) : Group
    • Converts a group XML object into a Group instance
  • parsePagedGroupList (xml:XML) : PagedGroupList
    • Converts a paged group list XML object into a PagedGroupList instance
  • parseContext (xml:XML) : Array
    • Converts a context XML object into an Array of Photo instances.
  • parseGroupList (xml:XML) : Array
    • Converts a group list XML object into an Array of Group instances.
  • parseUser (xml:XML) : User
    • Converts a user XML object into a User instance
  • parsePerson (xml:XML) : User
    • Converts a person XML object into a User instance
  • parsePhotoContext (xml:XML) : PhotoContext
    • Converts a photo context XML object into a PhotoContext instance
  • parsePhotoList (xml:XML) : Array
    • Converts a photo list XML object into an Array of Photo instances
  • parsePhotoCountList (xml:XML) : Array
    • Converts a photo context XML object into a PhotoContext instance
  • parsePhotoExifs (xml:XML) : Photo
    • Converts a photo exif list XML object into a Photo instance
  • parsePhoto (xml:XML) : Photo
    • Converts a photo XML object into a Photo instance
  • parsePhotoPerms (xml:XML) : Photo
    • Converts a photo perm XML object into a Photo instance
  • parsePhotoSizeList (xml:XML) : Array
    • Converts a size list XML object into an array of PhotoSize instances
  • parseLicenseList (xml:XML) : Array
    • Converts a license list XML object into an array of License instances
  • parsePhotoNote (xml:XML) : PhotoNote
    • Converts a note XML object into a Note instance
  • parseUploadTicketList (xml:XML) : Array
    • Converts an uploader ticket list XML object into an Array of UploadTicket instances
  • parsePhotoSet (xml:XML) : PhotoSet
    • Converts a photo set XML object into a PhotoSet instance
  • parsePhotoSetList (xml:XML) : Array
    • Converts a photo set list XML object into a PhotoSet instance
  • parseUserTags (xml:XML) : User
    • Converts a tag list XML object into a User instance
  • parseTagList (xml:XML) : Array
    • Converts a tag list XML object into an Array of PhotoTag instances

Class methods

dateToString

internal public static function dateToString (
date:Date) : String

Converts a date object into a Flickr date string
Parameters:
date:
The date to convert
Returns:
  • A string representing the date in a format that Flickr understands @langversion ActionScript 3.0 @playerversion Flash 8.5

invokeMethod

internal public static function invokeMethod (
service:FlickrService, callBack:Function, method:String, signed:Boolean, params:Array) : void

Reusable method that the "method group" classes can call to invoke a method on the API.
Parameters:
callBack:
The function to be notified when the RPC is complete
method :
The name of the method to invoke ( like flickr.test.echo )
signed :
A boolean value indicating if the method call needs an api_sig attached to it
params :
An array of NameValuePair or primitive elements to pass as parameters to the remote method @langversion ActionScript 3.0 @playerversion Flash 8.5

parseAuthResult

internal public static function parseAuthResult (
xml:XML) : AuthResult

Converts an auth result XML object into an AuthResult instance

parseBlogList

internal public static function parseBlogList (
xml:XML) : Array

Converts a blog list XML object into an arry of Blog instances

parseContactList

internal public static function parseContactList (
xml:XML) : Array

Converts a contact list XML object into an array of User instances

parseContext

internal public static function parseContext (
xml:XML) : Array

Converts a context XML object into an Array of Photo instances. The first element is the previous photo, the second element is the next photo.

parseFrob

internal public static function parseFrob (
xml:XML) : String

Converts a frob XML object into a string (the frob value)

parseGroup

internal public static function parseGroup (
xml:XML) : Group

Converts a group XML object into a Group instance

parseGroupCategory

internal public static function parseGroupCategory (
xml:XML) : Category

Converts a group category XML object into a Category instance

parseGroupList

internal public static function parseGroupList (
xml:XML) : Array

Converts a group list XML object into an Array of Group instances.

parseLicenseList

internal public static function parseLicenseList (
xml:XML) : Array

Converts a license list XML object into an array of License instances

parsePagedGroupList

internal public static function parsePagedGroupList (
xml:XML) : PagedGroupList

Converts a paged group list XML object into a PagedGroupList instance

parsePagedPhotoList

internal public static function parsePagedPhotoList (
xml:XML) : PagedPhotoList

Converts a pages photo list XML object into a PagesPhotoList instance

parsePerson

internal public static function parsePerson (
xml:XML) : User

Converts a person XML object into a User instance

parsePhoto

internal public static function parsePhoto (
xml:XML) : Photo

Converts a photo XML object into a Photo instance

parsePhotoContext

internal public static function parsePhotoContext (
xml:XML) : PhotoContext

Converts a photo context XML object into a PhotoContext instance

parsePhotoCountList

internal public static function parsePhotoCountList (
xml:XML) : Array

Converts a photo context XML object into a PhotoContext instance

parsePhotoExifs

internal public static function parsePhotoExifs (
xml:XML) : Photo

Converts a photo exif list XML object into a Photo instance

parsePhotoList

internal public static function parsePhotoList (
xml:XML) : Array

Converts a photo list XML object into an Array of Photo instances

parsePhotoNote

internal public static function parsePhotoNote (
xml:XML) : PhotoNote

Converts a note XML object into a Note instance

parsePhotoPerms

internal public static function parsePhotoPerms (
xml:XML) : Photo

Converts a photo perm XML object into a Photo instance

parsePhotoSet

internal public static function parsePhotoSet (
xml:XML) : PhotoSet

Converts a photo set XML object into a PhotoSet instance

parsePhotoSetList

internal public static function parsePhotoSetList (
xml:XML) : Array

Converts a photo set list XML object into a PhotoSet instance

parsePhotoSizeList

internal public static function parsePhotoSizeList (
xml:XML) : Array

Converts a size list XML object into an array of PhotoSize instances

parseTagList

internal public static function parseTagList (
xml:XML) : Array

Converts a tag list XML object into an Array of PhotoTag instances

parseUploadTicketList

internal public static function parseUploadTicketList (
xml:XML) : Array

Converts an uploader ticket list XML object into an Array of UploadTicket instances

parseUser

internal public static function parseUser (
xml:XML) : User

Converts a user XML object into a User instance

parseUserTags

internal public static function parseUserTags (
xml:XML) : User

Converts a tag list XML object into a User instance

processAndDispatch

internal public static function processAndDispatch (
service:FlickrService, response:String, result:FlickrResultEvent, propertyName:String = "", parseFunction:Function = null) : void

Handle processing the result of the API call.
Parameters:
service :
The FlickrService associated with the method group
response :
The XML response we got from the loader call
result :
The event to fill in the details of and dispatch
propertyName :
The property in event.data that the results should be placed
parseFunction:
The function to parse the response XML with @langversion ActionScript 3.0 @playerversion Flash 8.5

processResponse

internal public static function processResponse (
flickrResponse:String, propertyName:String, parseFunction:Function) : Object

Reusable method that the "method group" classes can call to process the results of the Flickr method.
Parameters:
flickrResponse:
The rest response string that aligns with the documentation here: http://www.flickr.com/services/api/response.rest.html
parseFunction :
A reference to the function that should be used to parse the XML received from the server
propertyName :
The name of the property to put the parsed data in. For example, the result object will contain a "data" property that will contain an additional property (the value of propertyName) that contains the actual data.
Returns:
  • An object with success and data properties. Success will be true if the call was completed, false otherwise. Data will contain ether an array of NameValuePair (if successful) or errorCode and errorMessage properties. @langversion ActionScript 3.0 @playerversion Flash 8.5

stringToDate

internal public static function stringToDate (
str:String = "") : Date

Converts a Flickr date string into a date object
Parameters:
date:
The string to convert @langversion ActionScript 3.0 @playerversion Flash 8.5