Rass Class Reference

Class containing interface methods for RASS API. More...

Inherits Raws.

List of all members.

Public Member Functions

 __construct ($user=null, $pwd=null, $base_uri=null, $path=null, $client=null, $applicationId= 'MyCompany-MyApp-1.0', $ssl=False)
 Instantiate a Rats object.
 getUserEntry ($className='Rass_UserEntry')
 Retrieve an entry containing the RASS user data (GET /user).
 deleteUser ($username)
 Retrieve an entry containing the RASS user data (GET /user).
 getDirFeed ($path=null, $query=null, $className='Rass_DirFeed')
 Retrieve a feed of existing item and/or dir entries inside a RASS dir (GET /dir/{path}).
 getDirFeedFromUrl ($uri, $className='Rass_DirFeed')
 Retrieve a feed of existing item and/or dir entries from a full RASS url.
 createDir ($path, $force_create=False)
 Create a new directory (PUT /dir/{path}).
 deleteDir ($path, $recursive=False)
 Delete an existing directory (DELETE /dir/{path}).
 createItem ($path, $src_location)
 Upload a binary file, creating an item resource instance (PUT /item/{path}).
 deleteItem ($path)
 Delete an item on the Rambla CDN.
 getItem ($path, $tgt_location_local)
 DEPRECATED: use getItemFromCDN() instead !!!! Retrieve an existing media item (GET /item/{path}/) from RASS and store it in a location on the local machine.
 getItemFromCDN ($entry, $tgt_location_local)
 Uses the enclosure link inside the entry to download the file directly from the CDN.
 createItemCurl ($path, $src_location)
 Upload a binary file using curl (= streaming upload), creating an item resource instance (PUT /item/{path}).
 postItem ($dirpath, $filename, $src_location)
 Upload a binary file using RATS POST method (POST /item/{path}).
 getVocabFeed ($className='Rass_VocabFeed')
 Retrieve a feed of existing vocabularies (GET /vocab/{username}/).
 getVocabEntry ($name)
 Retrieve an existing vocabulary entry (GET /vocab/{username}/{vocab_name}/).
 createVocab ($name, $xml_namespace, $description=null)
 Create a new vocabulary (POST /vocab/{username}/).
 updateVocab ($name, $xml_namespace, $description=null)
 Update an existing vocabulary (POST /vocab/{username}/{vocab_name}/).
 deleteVocab ($name)
 Delete an existing vocabulary (POST /vocab/{username}/{vocab_name}/).
 getMetaFeed ($path=null, $query=null, $className='Rass_MetaFeed')
 Retrieve a feed of existing metadata (GET /meta/{username}/{path}).
 getMetaEntry ($path, $query=null)
 Retrieve an existing meta entry (GET /meta/{username}/{path}).
 addMetadata ($entry, $tag_array, $meta_array)
 Set tag(s) on a RASS item or dir resource.
 setMetadata ($entry, $tag_array, $meta_array)
 Set tag(s) on a RASS item or dir resource.
 setMetadataFromPath ($path, $tag_array, $meta_array=null)
 Create or overwrite a RASS meta entry.
 deleteMetaEntry ($entry)
 Delete the metadata for an existing RASS item or dir resource.
 deleteMetaEntry_from_path ($path)
 Delete the metadata for an existing RASS item or dir resource.
 getSizeHeader ($username)
 Rambla-internal method to retrieve dir sizes.
 getExtFeed ($path=null, $query=null, $className='Rass_MetaFeed')
 Retrieve an external atom feed (GET /ext/atom/{username}/{path}).


Detailed Description

Class containing interface methods for RASS API.
Examples:

rams_set_traffic_limit.php, rass_basics_get_feed.php, rass_basics_manage_file_dir.php, rass_batch_upload.php, rass_meta_create.php, rass_meta_search.php, rass_meta_vocabs.php, rass_tag_search.php, rass_tag_set.php, and raws_links_and_pagination.php.


Constructor & Destructor Documentation

Rass.__construct ( user = null,
pwd = null,
base_uri = null,
path = null,
client = null,
applicationId = 'MyCompany-MyApp-1.0',
ssl = False 
)

Instantiate a Rats object.

Parameters:
string $user The Rambla username.
string $pwd The Rambla pwd.
string $base_uri URI of the RASS server; use 'http://rass.cdn01.rambla.be/' or http://rass.cdn02.rambla.be/' depending on your account setup.
string $path Currently not being used; leave null.
Zend_Http_Client $client Leave null, unless the caller has instantiated his own Zend_Http_Client object.
string $applicationId Identification string for your client, to be sent in the HTTP headers.

Reimplemented from Raws.


Member Function Documentation

Rass.getUserEntry ( className = 'Rass_UserEntry'  ) 

Retrieve an entry containing the RASS user data (GET /user).

Returns:
Rass_UserEntry

Rass.deleteUser ( username  ) 

Retrieve an entry containing the RASS user data (GET /user).

Returns:
Rass_UserEntry

Rass.getDirFeed ( path = null,
query = null,
className = 'Rass_DirFeed' 
)

Retrieve a feed of existing item and/or dir entries inside a RASS dir (GET /dir/{path}).

Parameters:
string $path The location of the directory for which data is being retrieved.
Rass_DirQuery $query A Rass_DirQuery that allows passing query-string parameters.
Returns:
Rass_DirFeed

Rass.getDirFeedFromUrl ( uri,
className = 'Rass_DirFeed' 
)

Retrieve a feed of existing item and/or dir entries from a full RASS url.

Parameters:
string $url The url to retrieve, including query-string args.
Returns:
Rass_DirFeed

Rass.createDir ( path,
force_create = False 
)

Create a new directory (PUT /dir/{path}).

Parameters:
string $path The location of the directory that needs to be created
bool $force_create If set to True, POST dir will be used instead of PUT dir => the caller should check the response entry for the actual directory name
Returns:
Rass_DirEntry if created

Rass.deleteDir ( path,
recursive = False 
)

Delete an existing directory (DELETE /dir/{path}).

Parameters:
string $path The location of the directory that needs to be deleted

Rass.createItem ( path,
src_location 
)

Upload a binary file, creating an item resource instance (PUT /item/{path}).

Parameters:
string $path The location of the item that needs to be created.
string $src_location The location of the file that needs to be uploaded on the client machine's filesystem.
Returns:
Rass_ItemEntry if created

Rass.deleteItem ( path  ) 

Delete an item on the Rambla CDN.

Parameters:
string $path The location of the file that needs to be deleted (DELETE /item/{path}).

Rass.getItem ( path,
tgt_location_local 
)

DEPRECATED: use getItemFromCDN() instead !!!! Retrieve an existing media item (GET /item/{path}/) from RASS and store it in a location on the local machine.

Parameters:
string $path The path of the item on the RASS server (to be added to "/item/").
string $tgt_location_local Path (including filename + extension) of where to store the file locally.
Returns:
$response object in case of success, otherwise exception is thrown

Rass.getItemFromCDN ( entry,
tgt_location_local 
)

Uses the enclosure link inside the entry to download the file directly from the CDN.

Parameters:
string $entry An item entry.
string $tgt_location_local Path (including filename + extension) of where to store the file locally.
Returns:
$response object in case of success, otherwise exception is thrown

Rass.createItemCurl ( path,
src_location 
)

Upload a binary file using curl (= streaming upload), creating an item resource instance (PUT /item/{path}).

Parameters:
string $path The location of the item that needs to be created.
string $src_location The location of the file that needs to be uploaded on the client machine's filesystem.
Returns:
Rass_ItemEntry if created

Rass.postItem ( dirpath,
filename,
src_location 
)

Upload a binary file using RATS POST method (POST /item/{path}).

Parameters:
string $dirpath The location of the directory in which the item needs to be stored.
string $filename The (suggested) filename for the item on the RASS server.
string $src_location The location of the file that needs to be uploaded on the client machine's filesystem.
Returns:
Rass_ItemEntry if created

Rass.getVocabFeed ( className = 'Rass_VocabFeed'  ) 

Retrieve a feed of existing vocabularies (GET /vocab/{username}/).

Parameters:
string $name The vocabulary name.
Returns:
Rass_VocabFeed

Rass.getVocabEntry ( name  ) 

Retrieve an existing vocabulary entry (GET /vocab/{username}/{vocab_name}/).

Parameters:
string $name The vocabulary name.
Returns:
Rass_VocabFeed

Rass.createVocab ( name,
xml_namespace,
description = null 
)

Create a new vocabulary (POST /vocab/{username}/).

Parameters:
string $name The vocabulary name.
string $xml_namespace The vocabulary's XML namespace.
string $description The vocabulary description.
Returns:
Rass_VocabFeed

Rass.updateVocab ( name,
xml_namespace,
description = null 
)

Update an existing vocabulary (POST /vocab/{username}/{vocab_name}/).

Parameters:
string $name The vocabulary name.
string $xml_namespace The vocabulary's XML namespace.
string $description The vocabulary description.
Returns:
Rass_VocabFeed

Rass.deleteVocab ( name  ) 

Delete an existing vocabulary (POST /vocab/{username}/{vocab_name}/).

Parameters:
string $name The vocabulary name.
Exceptions:
Zend_Gdata_App_Exception 

Rass.getMetaFeed ( path = null,
query = null,
className = 'Rass_MetaFeed' 
)

Retrieve a feed of existing metadata (GET /meta/{username}/{path}).

Parameters:
string $path The location of the directory for which metadata is being retrieved.
Rass_DirQuery $query A Rass_DirQuery that allows passing query-string parameters.
Returns:
Rass_DirFeed

Rass.getMetaEntry ( path,
query = null 
)

Retrieve an existing meta entry (GET /meta/{username}/{path}).

Parameters:
string $uri The URI that is pointing to the meta entry instance.
Returns:
Rats_OutputEntry

Rass.addMetadata ( entry,
tag_array,
meta_array 
)

Set tag(s) on a RASS item or dir resource.

Parameters:
Rass_MetaEntry $entry An existing Rass_MetaEntry resource.
array $tag_array array of Rass_Extension_Tag objects
array $meta_array array of Rass_Extension_Meta objects
Returns:
Rass_MetaEntry The entry returned from the server
Exceptions:
Zend_Gdata_App_Exception 

Rass.setMetadata ( entry,
tag_array,
meta_array 
)

Set tag(s) on a RASS item or dir resource.

Parameters:
Rass_MetaEntry $entry An existing Rass_MetaEntry resource.
array $tag_array array of Rass_Extension_Tag objects
array $meta_array array of Rass_Extension_Meta objects
Returns:
Rass_MetaEntry The entry returned from the server
Exceptions:
Zend_Gdata_App_Exception 

Rass.setMetadataFromPath ( path,
tag_array,
meta_array = null 
)

Create or overwrite a RASS meta entry.

Parameters:
string $path The location of the file or directory for which metadata is being set.
array $tag_array array of Rass_Extension_Tag objects
array $meta_array array of Rass_Extension_Meta objects
Returns:
Rass_MetaEntry The entry returned from the server
Exceptions:
Zend_Gdata_App_Exception 

Rass.deleteMetaEntry ( entry  ) 

Delete the metadata for an existing RASS item or dir resource.

Parameters:
string $path The location of the file or directory for which metadata is being deleted.
Exceptions:
Zend_Gdata_App_Exception 

Rass.deleteMetaEntry_from_path ( path  ) 

Delete the metadata for an existing RASS item or dir resource.

Parameters:
Rass_MetaEntry $entry An existing Rass_MetaEntry resource.
Exceptions:
Zend_Gdata_App_Exception 

Rass.getSizeHeader ( username  ) 

Rambla-internal method to retrieve dir sizes.

Parameters:
string $username Name of the CDN user.

Rass.getExtFeed ( path = null,
query = null,
className = 'Rass_MetaFeed' 
)

Retrieve an external atom feed (GET /ext/atom/{username}/{path}).

Parameters:
string $path The location of the directory for which metadata is being retrieved.
Rass_DirQuery $query A Rass_DirQuery that allows passing query-string parameters.
Returns:
Rass_DirFeed


Generated on Mon Mar 28 15:03:20 2011 for RawsClient PHP by  doxygen 1.5.3