Zend Framework  1.12
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
Zend_Service_SlideShare Class Reference

Public Member Functions

 setHttpClient (Zend_Http_Client $client)
 Sets the Zend_Http_Client object to use in requests.
 
 getHttpClient ()
 Returns the instance of the Zend_Http_Client which will be used.
 
 setCacheObject (Zend_Cache_Core $cacheobject)
 Sets the Zend_Cache object to use to cache the results of API queries.
 
 getCacheObject ()
 Gets the Zend_Cache object which will be used to cache API queries.
 
 getUserName ()
 Returns the user name used for API calls.
 
 setUserName ($un)
 Sets the user name to use for API calls.
 
 getPassword ()
 Gets the password to use in API calls.
 
 setPassword ($pw)
 Sets the password to use in API calls.
 
 getApiKey ()
 Gets the API key to be used in making API calls.
 
 setApiKey ($key)
 Sets the API key to be used in making API calls.
 
 getSharedSecret ()
 Gets the shared secret used in making API calls.
 
 setSharedSecret ($secret)
 Sets the shared secret used in making API calls.
 
 __construct ($apikey, $sharedSecret, $username=null, $password=null)
 The Constructor.
 
 uploadSlideShow (Zend_Service_SlideShare_SlideShow $ss, $makeSrcPublic=true)
 Uploads the specified Slide show the the server.
 
 getSlideShow ($ss_id)
 Retrieves a slide show's information based on slide show ID.
 
 getSlideShowsByUsername ($username, $offset=null, $limit=null)
 Retrieves an array of slide shows for a given username.
 
 getSlideShowsByTag ($tag, $offset=null, $limit=null)
 Retrieves an array of slide shows based on tag.
 
 getSlideShowsByGroup ($group, $offset=null, $limit=null)
 Retrieves an array of slide shows based on group name.
 

Public Attributes

const SERVICE_ERROR_BAD_APIKEY = 1
 Web service result code mapping.
 
const SERVICE_ERROR_BAD_AUTH = 2
 
const SERVICE_ERROR_MISSING_TITLE = 3
 
const SERVICE_ERROR_MISSING_FILE = 4
 
const SERVICE_ERROR_EMPTY_TITLE = 5
 
const SERVICE_ERROR_NOT_SOURCEOBJ = 6
 
const SERVICE_ERROR_INVALID_EXT = 7
 
const SERVICE_ERROR_FILE_TOO_BIG = 8
 
const SERVICE_ERROR_SHOW_NOT_FOUND = 9
 
const SERVICE_ERROR_USER_NOT_FOUND = 10
 
const SERVICE_ERROR_GROUP_NOT_FOUND = 11
 
const SERVICE_ERROR_MISSING_TAG = 12
 
const SERVICE_ERROR_DAILY_LIMIT = 99
 
const SERVICE_ERROR_ACCOUNT_BLOCKED = 100
 
const SERVICE_UPLOAD_URI = 'https://www.slideshare.net/api/2/upload_slideshow'
 Slide share Web service communication URIs.
 
const SERVICE_GET_SHOW_URI = 'https://www.slideshare.net/api/2/get_slideshow'
 
const SERVICE_GET_SHOW_BY_USER_URI = 'https://www.slideshare.net/api/2/get_slideshows_by_user'
 
const SERVICE_GET_SHOW_BY_TAG_URI = 'https://www.slideshare.net/api/2/get_slideshows_by_tag'
 
const SERVICE_GET_SHOW_BY_GROUP_URI = 'https://www.slideshare.net/api/2/get_slideshows_by_group'
 
const POWERPOINT_MIME_TYPE = "application/vnd.ms-powerpoint"
 The MIME type of Slideshow files.
 

Protected Member Functions

 _getSlideShowsByType ($key, $value, $offset=null, $limit=null)
 Retrieves Zend_Service_SlideShare_SlideShow object arrays based on the type of list desired.
 
 _slideShowNodeToObject (SimpleXMLElement $node)
 Converts a SimpleXMLElement object representing a response from the service into a Zend_Service_SlideShare_SlideShow object.
 

Protected Attributes

 $_apiKey
 
 $_sharedSecret
 
 $_username
 
 $_password
 
 $_httpclient
 
 $_cacheobject
 

Constructor & Destructor Documentation

__construct (   $apikey,
  $sharedSecret,
  $username = null,
  $password = null 
)

The Constructor.

Parameters
string$apikeyThe API key
string$sharedSecretThe shared secret
string$usernameThe username
string$passwordThe password

Member Function Documentation

_getSlideShowsByType (   $key,
  $value,
  $offset = null,
  $limit = null 
)
protected

Retrieves Zend_Service_SlideShare_SlideShow object arrays based on the type of list desired.

Parameters
string$keyThe type of slide show object to retrieve
string$valueThe specific search query for the slide show type to look up
int$offsetThe offset of the list to start retrieving from
int$limitThe maximum number of slide shows to retrieve
Returns
array An array of Zend_Service_SlideShare_SlideShow objects
Exceptions
Zend_Service_SlideShare_Exception
_slideShowNodeToObject ( SimpleXMLElement  $node)
protected

Converts a SimpleXMLElement object representing a response from the service into a Zend_Service_SlideShare_SlideShow object.

Parameters
SimpleXMLElement$nodeThe input XML from the slideshare.net service
Returns
Zend_Service_SlideShare_SlideShow The resulting object
Exceptions
Zend_Service_SlideShare_Exception
getApiKey ( )

Gets the API key to be used in making API calls.

Returns
string the API Key
getCacheObject ( )

Gets the Zend_Cache object which will be used to cache API queries.

If no cache object was previously set the the default will be used (Filesystem caching in /tmp with a life time of 43200 seconds)

Returns
Zend_Cache_Core The object used in caching
getHttpClient ( )

Returns the instance of the Zend_Http_Client which will be used.

Creates an instance of Zend_Http_Client if no previous client was set.

Returns
Zend_Http_Client The HTTP client which will be used
getPassword ( )

Gets the password to use in API calls.

Returns
string the password to use in API calls
getSharedSecret ( )

Gets the shared secret used in making API calls.

Returns
string the Shared secret
getSlideShow (   $ss_id)

Retrieves a slide show's information based on slide show ID.

Parameters
int$ss_idThe slide show ID
Returns
Zend_Service_SlideShare_SlideShow the Slideshow object
Exceptions
Zend_Service_SlideShare_Exception
getSlideShowsByGroup (   $group,
  $offset = null,
  $limit = null 
)

Retrieves an array of slide shows based on group name.

Parameters
string$groupThe group name to retrieve slide shows for
int$offsetThe offset of the list to start retrieving from
int$limitThe maximum number of slide shows to retrieve
Returns
array An array of Zend_Service_SlideShare_SlideShow objects
getSlideShowsByTag (   $tag,
  $offset = null,
  $limit = null 
)

Retrieves an array of slide shows based on tag.

Parameters
string$tagThe tag to retrieve slide shows with
int$offsetThe offset of the list to start retrieving from
int$limitThe maximum number of slide shows to retrieve
Returns
array An array of Zend_Service_SlideShare_SlideShow objects
getSlideShowsByUsername (   $username,
  $offset = null,
  $limit = null 
)

Retrieves an array of slide shows for a given username.

Parameters
string$usernameThe username to retrieve slide shows from
int$offsetThe offset of the list to start retrieving from
int$limitThe maximum number of slide shows to retrieve
Returns
array An array of Zend_Service_SlideShare_SlideShow objects
getUserName ( )

Returns the user name used for API calls.

Returns
string The username
setApiKey (   $key)

Sets the API key to be used in making API calls.

Parameters
string$keyThe API key to use
Returns
Zend_Service_SlideShare
setCacheObject ( Zend_Cache_Core  $cacheobject)

Sets the Zend_Cache object to use to cache the results of API queries.

Parameters
Zend_Cache_Core$cacheobjectThe Zend_Cache object used
Returns
Zend_Service_SlideShare
setHttpClient ( Zend_Http_Client  $client)

Sets the Zend_Http_Client object to use in requests.

If not provided a default will be used.

Parameters
Zend_Http_Client$clientThe HTTP client instance to use
Returns
Zend_Service_SlideShare
setPassword (   $pw)

Sets the password to use in API calls.

Parameters
string$pwThe password to use
Returns
Zend_Service_SlideShare
setSharedSecret (   $secret)

Sets the shared secret used in making API calls.

Parameters
string$secretthe shared secret
Returns
Zend_Service_SlideShare
setUserName (   $un)

Sets the user name to use for API calls.

Parameters
string$unThe username to use
Returns
Zend_Service_SlideShare
uploadSlideShow ( Zend_Service_SlideShare_SlideShow  $ss,
  $makeSrcPublic = true 
)

Uploads the specified Slide show the the server.

Parameters
Zend_Service_SlideShare_SlideShow$ssThe slide show object representing the slide show to upload
boolean$makeSrcPublicDetermines if the the slide show's source file is public or not upon upload
Returns
Zend_Service_SlideShare_SlideShow The passed Slide show object, with the new assigned ID provided
Exceptions
Zend_Service_SlideShare_Exception

Member Data Documentation

$_apiKey
protected
$_cacheobject
protected
$_httpclient
protected
$_password
protected
$_sharedSecret
protected
$_username
protected
const POWERPOINT_MIME_TYPE = "application/vnd.ms-powerpoint"

The MIME type of Slideshow files.

const SERVICE_ERROR_ACCOUNT_BLOCKED = 100
const SERVICE_ERROR_BAD_APIKEY = 1

Web service result code mapping.

const SERVICE_ERROR_BAD_AUTH = 2
const SERVICE_ERROR_DAILY_LIMIT = 99
const SERVICE_ERROR_EMPTY_TITLE = 5
const SERVICE_ERROR_FILE_TOO_BIG = 8
const SERVICE_ERROR_GROUP_NOT_FOUND = 11
const SERVICE_ERROR_INVALID_EXT = 7
const SERVICE_ERROR_MISSING_FILE = 4
const SERVICE_ERROR_MISSING_TAG = 12
const SERVICE_ERROR_MISSING_TITLE = 3
const SERVICE_ERROR_NOT_SOURCEOBJ = 6
const SERVICE_ERROR_SHOW_NOT_FOUND = 9
const SERVICE_ERROR_USER_NOT_FOUND = 10
const SERVICE_GET_SHOW_BY_GROUP_URI = 'https://www.slideshare.net/api/2/get_slideshows_by_group'
const SERVICE_GET_SHOW_BY_TAG_URI = 'https://www.slideshare.net/api/2/get_slideshows_by_tag'
const SERVICE_GET_SHOW_BY_USER_URI = 'https://www.slideshare.net/api/2/get_slideshows_by_user'
const SERVICE_GET_SHOW_URI = 'https://www.slideshare.net/api/2/get_slideshow'
const SERVICE_UPLOAD_URI = 'https://www.slideshare.net/api/2/upload_slideshow'

Slide share Web service communication URIs.