Changed result struct from resetStorage,

see note #641 in http://bugs.campware.org/view.php?id=546
This commit is contained in:
tomas 2005-01-17 15:22:39 +00:00
parent 39284fdce2
commit 0c69b280b1
3 changed files with 16 additions and 10 deletions

View file

@ -23,7 +23,7 @@
Author : $Author: tomas $
Version : $Revision: 1.19 $
Version : $Revision: 1.20 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/LocStor.php,v $
------------------------------------------------------------------------------*/
@ -388,7 +388,7 @@ class LocStor extends BasicStor{
$this->deleteData();
$rootHD = $this->getObjId('root', $this->storId);
include"../tests/sampleData.php";
$res = array();
$res = array('audioclips'=>array(), 'playlists'=>array());
foreach($sampleData as $k=>$it){
switch($it['type']){
case"audioclip":
@ -400,6 +400,8 @@ class LocStor extends BasicStor{
$rootHD, basename($media),
$media, $xml, $gunid, 'audioclip'
);
if(PEAR::isError($r)){ return $r; }
$res['audioclips'][] = $this->_gunidFromId($r);
break;
case"playlist":
$xml = $it['xml'];
@ -408,10 +410,10 @@ class LocStor extends BasicStor{
$r = $this->bsPutFile(
$rootHD, basename($xml), '', $xml, $gunid, 'playlist'
);
if(PEAR::isError($r)){ return $r; }
$res['playlists'][] = $this->_gunidFromId($r);
break;
}
if(PEAR::isError($r)){ return $r; }
$res[] = $this->_gunidFromId($r);
}
return $res;
}

View file

@ -19,7 +19,8 @@
),
array(
'type' => 'playlist',
'xml' => '../tests/plist1.xml'
'xml' => '../tests/plist1.xml',
'gunid' => '123456789abcdef3'
)
);
?>

View file

@ -23,7 +23,7 @@
Author : $Author: tomas $
Version : $Revision: 1.5 $
Version : $Revision: 1.6 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/xmlrpc/XR_LocStor.php,v $
------------------------------------------------------------------------------*/
@ -1186,10 +1186,13 @@ class XR_LocStor extends LocStor{
*
* The input parameters are an empty XML-RPC struct.
*
* On success, returns a XML-RPC struct with single field:
* On success, returns a XML-RPC struct with following
* fields:
* <ul>
* <li> gunids : array -
* array with gunids/playlisIds of inserted files </li>
* <li> audioclips : array -
* array with gunids of inserted audioclips </li>
* <li> playlists : array -
* array with gunids of inserted playlists </li>
* </ul>
*
* On errors, returns an XML-RPC error response.
@ -1216,7 +1219,7 @@ class XR_LocStor extends LocStor{
"xr_getAudioClip: ".$res->getMessage()." ".$res->getUserInfo()
);
}
return new XML_RPC_Response(XML_RPC_encode(array('gunids'=>$res)));
return new XML_RPC_Response(XML_RPC_encode($res));
}
/**