diff --git a/livesupport/modules/storageServer/var/GreenBox.php b/livesupport/modules/storageServer/var/GreenBox.php index b411ccf43..f7c3c24a9 100644 --- a/livesupport/modules/storageServer/var/GreenBox.php +++ b/livesupport/modules/storageServer/var/GreenBox.php @@ -23,7 +23,7 @@ Author : $Author: tomas $ - Version : $Revision: 1.8 $ + Version : $Revision: 1.9 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/GreenBox.php,v $ ------------------------------------------------------------------------------*/ @@ -48,7 +48,7 @@ require_once "Transport.php"; * LiveSupport file storage module * * @author $Author: tomas $ - * @version $Revision: 1.8 $ + * @version $Revision: 1.9 $ * @see Alib */ class GreenBox extends Alib{ @@ -446,10 +446,10 @@ class GreenBox extends Alib{ function localSearch($searchData, $sessid='') { $ftsrch = $searchData; - $res = $this->dbc->getAll("SELECT md.gunid as gunid + $res = $this->dbc->getCol("SELECT md.gunid as gunid FROM {$this->filesTable} f, {$this->mdataTable} md WHERE f.gunid=md.gunid AND md.objns='_L' AND - md.object like '$ftsrch' + md.object like '%$ftsrch%' GROUP BY md.gunid "); if(!is_array($res)) $res = array(); diff --git a/livesupport/modules/storageServer/var/LocStor.php b/livesupport/modules/storageServer/var/LocStor.php index 9db68419e..0e13fba15 100644 --- a/livesupport/modules/storageServer/var/LocStor.php +++ b/livesupport/modules/storageServer/var/LocStor.php @@ -23,7 +23,7 @@ Author : $Author: tomas $ - Version : $Revision: 1.7 $ + Version : $Revision: 1.8 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/LocStor.php,v $ ------------------------------------------------------------------------------*/ @@ -209,5 +209,27 @@ class LocStor extends GreenBox{ if(PEAR::isError($md)) return $md; return $md; } + /** + * Reset storageServer for debugging. + * + * @param input string + */ + function resetStorage($input='') + { + $this->deleteData(); + $rootHD = $this->getObjId('root', $this->storId); + $this->login('root', $this->config['tmpRootPass']); + $s = $this->sessid; + include"../tests/sampleData.php"; + $res = array(); + foreach($sampleData as $k=>$it){ + list($media, $meta) = $it; + $r = $this->putFile($rootHD, "file".($k+1), $media, $meta, $s); + if(PEAR::isError($r)){ return $r; } + $res[] = $this->_gunidFromId($r); + } + $this->logout($this->sessid); + return $res; + } } ?> \ No newline at end of file diff --git a/livesupport/modules/storageServer/var/html/gbHtmlBrowse.php b/livesupport/modules/storageServer/var/html/gbHtmlBrowse.php index b13ee1ef5..fb00d0012 100644 --- a/livesupport/modules/storageServer/var/html/gbHtmlBrowse.php +++ b/livesupport/modules/storageServer/var/html/gbHtmlBrowse.php @@ -132,7 +132,7 @@ $tpldata['showMenu']=true; Home directory [Upload new file] [Create new folder] - [Search] + diff --git a/livesupport/modules/storageServer/var/tests/sampleData.php b/livesupport/modules/storageServer/var/tests/sampleData.php new file mode 100644 index 000000000..3ea42894d --- /dev/null +++ b/livesupport/modules/storageServer/var/tests/sampleData.php @@ -0,0 +1,8 @@ + + $sampleData = array( + array('../tests/ex1.mp3', '../tests/mdata1.xml'), + array('../tests/ex2.ogg', '../tests/mdata2.xml'), + array('../tests/ex2.wav', '../tests/mdata3.xml'), +// array('', ''), + ); +?> \ No newline at end of file diff --git a/livesupport/modules/storageServer/var/xmlrpc/xrLocStor.php b/livesupport/modules/storageServer/var/xmlrpc/xrLocStor.php index 193bf84c1..808667318 100644 --- a/livesupport/modules/storageServer/var/xmlrpc/xrLocStor.php +++ b/livesupport/modules/storageServer/var/xmlrpc/xrLocStor.php @@ -23,7 +23,7 @@ Author : $Author: tomas $ - Version : $Revision: 1.6 $ + Version : $Revision: 1.7 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/xmlrpc/xrLocStor.php,v $ ------------------------------------------------------------------------------*/ @@ -56,7 +56,7 @@ require_once '../LocStor.php'; function errHndl($errno, $errmsg, $filename, $linenum, $vars){ if($errno == 8 /*E_NOTICE*/) return; $xr =& new XML_RPC_Response(0, 805, - "ERROR:xrLoctor: $errno $errmsg ($filename:$linenum)"); + "ERROR:xrLocStor: $errno $errmsg ($filename:$linenum)"); header("Content-type: text/xml"); echo $xr->serialize(); exit($errno); @@ -495,7 +495,7 @@ class XR_LocStor extends LocStor{ if(!$ok) return $r; $res = $this->searchMetadata($r['sessid'], $r['criteria']); if(!PEAR::isError($res)) - return new XML_RPC_Response(new XML_RPC_Value($res, "boolean")); + return new XML_RPC_Response(XML_RPC_encode($res)); else return new XML_RPC_Response(0, 803, "xr_searchAudioClip: ".$res->getMessage(). @@ -637,6 +637,45 @@ class XR_LocStor extends LocStor{ "xr_getAudioClip: ".$res->getMessage()." ".$res->getUserInfo() ); } + + /** + * Reset storageServer for debugging. + * + * The XML-RPC name of this method is "locstor.resetStorage". + * + * There are no input parameters + * + * On success, returns a single XML-RPC value: + *