Internal class which deals with parsing the XML returned from flickr.com.
This functionality was originally contained within Flashr.as but had to be moved out when the Flashr class broke Flash’s 32K of bytecode per class limit. You shouldn’t need to directly call or use anything in this class - if you do it will break all the queuing etc which is dealt with in Flashr.
Flashr, http://www.flickr.com/services/api/
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: FlashrApiResponse.as 84 2007-03-11 21:18:17Z kluck $
| com. kelvinluck. flashr. core. FlashrApiResponse | Internal class which deals with parsing the XML returned from flickr.com. |
| FlashrApiResponse | Private constructor (singleton) |
| onAPIResponse | Called internally on recepit of a response from a request to the Flashr.REST_ENDPOINT. |
| _parsePhotoXml | Private internal function used to avoid duplicate code to parse “the standard photo list xml” |
| _parsePhotosetXml | Private internal function used to avoid duplicate code when parsing the standard photoset XML |
| _parseContextXml | Private internal function used to avoid duplicate code when parsing the standard context XML |
| getInstance | Returns the one and only instance of this class. |
| toString |
private function onAPIResponse( success: Boolean ):Void
Called internally on recepit of a response from a request to the Flashr.REST_ENDPOINT. Interperets the received XML and broadcasts an onAPIResponse event to any registered listeners. If the XML was the result of a known method call then the broadcast event will include sensible information, otherwise it will just be the XML for parsing outside this class (e.g. if a new method has been added to the Flickr.com API and not programmed into this class).
| success | Whether the call to the API was successfull (e.g. the server specfied in Flashr.REST_ENDPOINT was connected to) or not. |
private function _parsePhotoXml( px: XMLNode, owner: Person ):ResultsSet
Private internal function used to avoid duplicate code to parse “the standard photo list xml”
| px | The “standard photo list xml” from flickr. |
| owner | A Person if we know who created all these Photos (as is the case for a response from flickr.photosets.getPhotos) |
A ResultsSet.
private function _parsePhotosetXml( photosetXml: XMLNode, owner: Person ):Photoset
Private internal function used to avoid duplicate code when parsing the standard photoset XML
| photosetXml | An XML node describing a photoset. |
| owner | The owner of this Photoset - leave as undefined if they exist as an attribute in the XML... |
The created Photoset.
private function _parseContextXml( contextXML: XMLNode ):Object
Private internal function used to avoid duplicate code when parsing the standard context XML
| contextXML | The contextXML to parse |
An object containing count:Number, prevphoto:Photo and nextphoto:Photo
Private constructor (singleton)
private function FlashrApiResponse()
Called internally on recepit of a response from a request to the Flashr.REST_ENDPOINT.
private function onAPIResponse( success: Boolean ):Void
The place for all API calls to connect to.
static var REST_ENDPOINT: String
Private internal function used to avoid duplicate code to parse “the standard photo list xml”
private function _parsePhotoXml( px: XMLNode, owner: Person ):ResultsSet
Private internal function used to avoid duplicate code when parsing the standard photoset XML
private function _parsePhotosetXml( photosetXml: XMLNode, owner: Person ):Photoset
Private internal function used to avoid duplicate code when parsing the standard context XML
private function _parseContextXml( contextXML: XMLNode ):Object
Returns the one and only instance of this class.
public static function getInstance():FlashrApiResponse
public function toString():String