I added these 2 functions to the IMFS.php
in SetMetadata, the $metainfo variable is an array consisting of the several Key:Value pairs for the metadata to be set, so that several metadata can be set at the same time.
The functions don't check for invalid chars so be warned and double check if it works for you
hope it helps
ciao Luca
//Set Metadata for the file
public function SetMetadata($sessionToken, $destFilePath, $metainfo)
{
global $DEBUG;
global $IMFSHOST;
// Set the parameters
$filePathParams = 'sessionToken=' . $sessionToken . '&';
$filePathParams .= 'path=' . urlencode($destFilePath) . '&';
foreach ($metainfo as $metadata){
$filePathParams .= 'metadata=' . $metadata. '&';
}
// retrieve from the REST interface the response xml.
$xmlstring = curlGet($IMFSHOST . '/ws/Metadata/SetMetadata.ashx?' . $filePathParams);
if ($DEBUG)
{
print '<!--SetMetadata: '.$filePathParams ;
print_r($xmlstring);
print '-->';
}
// turn into an object for easier handling.
$xml = new SimpleXMLElement($xmlstring);
return $xml;
}
//Get Metadata for the file
public function GetMetadata($sessionToken, $destFilePath)
{
global $DEBUG;
global $IMFSHOST;
// Set the parameters
$filePathParams = 'sessionToken=' . $sessionToken . '&';
$filePathParams .= 'path=' . urlencode($destFilePath) . '&';
// retrieve from the REST interface the response xml.
$xmlstring = curlGet($IMFSHOST . '/ws/Metadata/GetMetadata.ashx?' . $filePathParams);
if ($DEBUG)
{
print '<!--GetMetadata: '.$filePathParams ;
print_r($xmlstring);
print '-->';
}
// turn into an object for easier handling.
$xml = new SimpleXMLElement($xmlstring);
return $xml;
}