Golem.de API

Golem  alpha

Golem.de API > Golem > Golem.Api.Article.Images
Search:
 
Filters

Class Golem.Api.Article.Images - extends Golem.Api

Get a list of images associated with an article

Constructor

Golem.Api.Article.Images ( idArticle )
Parameters:
idArticle <Integer> the identifier of the article

Properties

ERROR_INVALID_IDENTIFIER - {Integer}

Indicates, that the article identifier is invalid or article does not exists

idArticle - protected {Integer}

Identifier of the article the images to fetch for

TYPE - protected {String}

The type of access method for the web service

URL - protected {String}

The URL of the used web service

Methods

each

void each ( fnCallback , params )
Traverses through the image list.

After a succesful request you can traverse through the image list. You pass a callback function to the method, and the method is called for each image entry

The first argument to this callback function is an image object with the properties:

  • imageid - {Integer} - The image identifier. The identifier should be not expected to be unique!
  • subtext - {String} - A text associated with the image.
  • small - {Array} - The data for the image as thumbnail. The typical size of an thumbnail is 120x90 pixel.
    • url - {String} - The image url
    • width - {Integer} - The image width in pixel
    • height - {Integer} - The image height in pixel
  • medium - {Array} - The data for the image in a medium size. The maximum width of a medium size image is 480 pixel. The height may differ.
    • url - {String} - The image url
    • width - {Integer} - The image width in pixel
    • height - {Integer} - The image height in pixel
  • native - {Array} - The data for the image. The size of the image is not limited, but a size of 1024x786 is exceeded in rare situations only.
    • url - {String} - The image url
    • width - {Integer} - The image width in pixel
    • height - {Integer} - The image height in pixel
The second argument will be the data provided by params.

Parameters:
fnCallback <Function> - the callback function to call for each article
params <Mixed> - additional data passed to the callback function
Returns: void

fetch

void fetch ( obj )
Fetches the list of images for an article via Webservice

In case of a successful request, the obj.fnSuccess-callback function will be called. The first argument for the callback method is the result data of the request. The second argument will be the data provided by obj.params.

In case of a failed request, the obj.fnError callback function will be called. The first argument to the callback is the error code, the second ist the error message.

Parameters:
obj <Object> - Object literal specifing the callback methods
Returns: void

fetchEach

void fetchEach ( fnCallback , params )
Shortcut method for traversing the article data

Fetches the articles via fetch() first and then calls fnCallback for every article record like each() does.

There is no way to handle errors with this method!

Parameters:
fnCallback <Function> - Function to call for every article record
params <Mixed> - additional data to pass to the callback function
Returns: void


Copyright © 2010 Golem.de.