audioclip and playlist internal file types added,

several next mime-types supported now
This commit is contained in:
tomas 2004-12-30 02:35:47 +00:00
parent 562705b031
commit 2fe057b9e5
10 changed files with 119 additions and 88 deletions

View file

@ -20,7 +20,7 @@
# #
# #
# Author : $Author: tomas $ # Author : $Author: tomas $
# Version : $Revision: 1.7 $ # Version : $Revision: 1.8 $
# Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/Attic/Makefile,v $ # Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/Attic/Makefile,v $
# #
# @configure_input@ # @configure_input@
@ -124,6 +124,8 @@ testonly: ${TEST_RUNNER}
check: all testonly check: all testonly
recheck: clean check
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# Specific targets # Specific targets
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------

View file

@ -23,7 +23,7 @@
Author : $Author: tomas $ Author : $Author: tomas $
Version : $Revision: 1.7 $ Version : $Revision: 1.8 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/BasicStor.php,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/BasicStor.php,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -48,7 +48,7 @@ require_once "Transport.php";
* Core of LiveSupport file storage module * Core of LiveSupport file storage module
* *
* @author $Author: tomas $ * @author $Author: tomas $
* @version $Revision: 1.7 $ * @version $Revision: 1.8 $
* @see Alib * @see Alib
*/ */
class BasicStor extends Alib{ class BasicStor extends Alib{
@ -184,9 +184,9 @@ class BasicStor extends Alib{
*/ */
function bsCopyFile($id, $did) function bsCopyFile($id, $did)
{ {
if($this->getObjType($did)!=='Folder') if($this->getObjType($did) !== 'Folder')
return PEAR::raiseError( return PEAR::raiseError(
'GreenBox::copyFile: destination is not folder', GBERR_WRTYPE 'BasicStor::bsCopyFile: destination is not folder', GBERR_WRTYPE
); );
return $this->_copySubtree($id, $did); return $this->_copySubtree($id, $did);
} }
@ -424,12 +424,12 @@ class BasicStor extends Alib{
function bsCreateReplica($id, $did, $replicaName) function bsCreateReplica($id, $did, $replicaName)
{ {
return PEAR::raiseError( return PEAR::raiseError(
'GreenBox::createVersion: not implemented', GBERR_NOTIMPL 'BasicStor::bsCreateReplica: not implemented', GBERR_NOTIMPL
); );
// --- // ---
if($this->getObjType($did)!=='Folder') if($this->getObjType($did) !== 'Folder')
return PEAR::raiseError( return PEAR::raiseError(
'GreenBox::createReplica: dest is not folder', GBERR_WRTYPE 'BasicStor::bsCreateReplica: dest is not folder', GBERR_WRTYPE
); );
if($replicaName=='') $replicaName = $this->getObjName($id); if($replicaName=='') $replicaName = $this->getObjName($id);
while(($exid = $this->getObjId($replicaName, $did))<>'') while(($exid = $this->getObjId($replicaName, $did))<>'')
@ -452,7 +452,7 @@ class BasicStor extends Alib{
function bsCreateVersion($id, $did, $versionLabel) function bsCreateVersion($id, $did, $versionLabel)
{ {
return PEAR::raiseError( return PEAR::raiseError(
'GreenBox::createVersion: not implemented', GBERR_NOTIMPL 'BasicStor::bsCreateVersion: not implemented', GBERR_NOTIMPL
); );
} }
@ -562,9 +562,9 @@ class BasicStor extends Alib{
*/ */
function bsListFolder($id) function bsListFolder($id)
{ {
if($this->getObjType($id)!=='Folder') if($this->getObjType($id) !== 'Folder')
return PEAR::raiseError( return PEAR::raiseError(
'GreenBox::listFolder: not a folder', GBERR_NOTF 'BasicStor::bsListFolder: not a folder', GBERR_NOTF
); );
$a = $this->getDir($id, 'id, name, type, param as target', 'name'); $a = $this->getDir($id, 'id, name, type, param as target', 'name');
return $a; return $a;
@ -580,7 +580,7 @@ class BasicStor extends Alib{
function getObjIdFromRelPath($id, $relPath='.') function getObjIdFromRelPath($id, $relPath='.')
{ {
$a = split('/', $relPath); $a = split('/', $relPath);
if($this->getObjType($id)!=='Folder') $nid = $this->getparent($id); if($this->getObjType($id) !== 'Folder') $nid = $this->getparent($id);
else $nid = $id; else $nid = $id;
foreach($a as $i=>$item){ foreach($a as $i=>$item){
switch($item){ switch($item){
@ -700,7 +700,7 @@ class BasicStor extends Alib{
$this->test_dump = $this->dumpTree($this->storId); $this->test_dump = $this->dumpTree($this->storId);
if($this->test_dump==$this->test_correct) if($this->test_dump==$this->test_correct)
{ $this->test_log.="storageServer: OK\n"; return true; } { $this->test_log.="storageServer: OK\n"; return true; }
else PEAR::raiseError('GreenBox::test:', 1, PEAR_ERROR_DIE, '%s'. else PEAR::raiseError('BasicStor::test:', 1, PEAR_ERROR_DIE, '%s'.
"<pre>\ncorrect:\n.{$this->test_correct}.\n". "<pre>\ncorrect:\n.{$this->test_correct}.\n".
"dump:\n.{$this->test_dump}.\n</pre>\n"); "dump:\n.{$this->test_dump}.\n</pre>\n");
} }

View file

@ -23,7 +23,7 @@
Author : $Author: tomas $ Author : $Author: tomas $
Version : $Revision: 1.15 $ Version : $Revision: 1.16 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/GreenBox.php,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/GreenBox.php,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -35,7 +35,7 @@ require_once "BasicStor.php";
* LiveSupport file storage module * LiveSupport file storage module
* *
* @author $Author: tomas $ * @author $Author: tomas $
* @version $Revision: 1.15 $ * @version $Revision: 1.16 $
* @see BasicStor * @see BasicStor
*/ */
class GreenBox extends BasicStor{ class GreenBox extends BasicStor{
@ -290,7 +290,16 @@ class GreenBox extends BasicStor{
{ {
if(($res = $this->_authorize('read', $id, $sessid)) !== TRUE) if(($res = $this->_authorize('read', $id, $sessid)) !== TRUE)
return $res; return $res;
return $this->bsListFolder($id); $listArr = $this->bsListFolder($id);
foreach($listArr as $i=>$v){
if($v['type'] == 'File'){
$gunid = $this->_gunidFromId($v['id']);
$listArr[$i]['type'] =
StoredFile::_getType($gunid);
$listArr[$i]['gunid'] = $gunid;
}
}
return $listArr;
} }
/* ---------------------------------------------------- redefined methods */ /* ---------------------------------------------------- redefined methods */
@ -362,6 +371,23 @@ class GreenBox extends BasicStor{
return $pa; return $pa;
} }
/**
* Get object type by id.
* (RootNode, Folder, File, )
*
* @param oid int, local object id
* @return string/err
*/
function getObjType($oid)
{
$type = $this->getObjName($oid, 'type');
if($type == 'File'){
$type =
StoredFile::_getType($this->_gunidFromId($oid));
}
return $type;
}
/* ==================================================== "private" methods */ /* ==================================================== "private" methods */
/** /**
@ -373,10 +399,15 @@ class GreenBox extends BasicStor{
function copyObj($id, $newParid, $after='') function copyObj($id, $newParid, $after='')
{ {
$nid = parent::copyObj($id, $newParid, $after=''); $nid = parent::copyObj($id, $newParid, $after='');
if($this->getObjType($id)==='File'){ switch($this->getObjType($id)){
case"audioclip":
case"playlist":
case"File":
$ac =& StoredFile::recall(&$this, $id); $ac =& StoredFile::recall(&$this, $id);
if(PEAR::isError($ac)){ return $ac; } if(PEAR::isError($ac)){ return $ac; }
$ac2 =& StoredFile::copyOf(&$ac, $nid); $ac2 =& StoredFile::copyOf(&$ac, $nid);
break;
default:
} }
return $nid; return $nid;
} }
@ -403,6 +434,8 @@ class GreenBox extends BasicStor{
function removeObj($id) function removeObj($id)
{ {
switch($this->getObjType($id)){ switch($this->getObjType($id)){
case"audioclip":
case"playlist":
case"File": case"File":
$ac =& StoredFile::recall(&$this, $id); $ac =& StoredFile::recall(&$this, $id);
if(!PEAR::isError($ac)){ if(!PEAR::isError($ac)){

View file

@ -23,7 +23,7 @@
Author : $Author: tomas $ Author : $Author: tomas $
Version : $Revision: 1.8 $ Version : $Revision: 1.9 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/MetaData.php,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/MetaData.php,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -34,6 +34,7 @@
* LiveSupport file storage support class.<br> * LiveSupport file storage support class.<br>
* Store metadata tree in relational database.<br> * Store metadata tree in relational database.<br>
* <b>requires DOMXML support in PHP!</b> * <b>requires DOMXML support in PHP!</b>
* TODO: use SAX parser instead of DOMXML
* *
* @see StoredFile * @see StoredFile
*/ */
@ -53,7 +54,11 @@ class MetaData{
$this->gunid = $gunid; $this->gunid = $gunid;
$this->resDir = $resDir; $this->resDir = $resDir;
$this->fname = $this->makeFname(); $this->fname = $this->makeFname();
$this->exists = $this->dbCheck($gunid) && file_exists($this->fname); $this->exists =
$this->dbCheck($gunid) &&
is_file($this->fname) &&
is_readable($this->fname)
;
} }
/** /**
* Parse and store metadata from XML file or XML string * Parse and store metadata from XML file or XML string
@ -213,11 +218,16 @@ class MetaData{
{ {
switch($loc){ switch($loc){
case"file": case"file":
if(!file_exists($mdata)){ if(!is_file($mdata)){
return PEAR::raiseError( return PEAR::raiseError(
"MetaData::storeXMLDoc: metadata file not found ($mdata)" "MetaData::storeXMLDoc: metadata file not found ($mdata)"
); );
} }
if(!is_readable($mdata)){
return PEAR::raiseError(
"MetaData::storeXMLDoc: can't read metadata file ($mdata)"
);
}
$xml = domxml_open_file($mdata); $xml = domxml_open_file($mdata);
break; break;
case"string": case"string":

View file

@ -23,7 +23,7 @@
Author : $Author: tomas $ Author : $Author: tomas $
Version : $Revision: 1.5 $ Version : $Revision: 1.6 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/RawMediaData.php,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/RawMediaData.php,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -52,7 +52,10 @@ class RawMediaData{
$this->gunid = $gunid; $this->gunid = $gunid;
$this->resDir = $resDir; $this->resDir = $resDir;
$this->fname = $this->makeFname(); $this->fname = $this->makeFname();
$this->exists = file_exists($this->fname); $this->exists =
is_file($this->fname) &&
is_readable($this->fname)
;
} }
/** /**
@ -116,41 +119,6 @@ class RawMediaData{
return $this->fname; return $this->fname;
} }
/*
/**
* Make access symlink to the media file
*
* @param accLinkName string, access symlink name
* @return string, access symlink name
* /
function access($accLinkName)
{
if(!$this->exists) return FALSE;
if(file_exists($accLinkName)) return $accLinkName;
if(@symlink($this->fname, $accLinkName)){
return $accLinkName;
}else return PEAR::raiseError(
"RawMediaData::access: symlink create failed ($accLinkName)",
GBERR_FILEIO
);
}
/**
* Delete access symlink
*
* @param accLinkName string, access symlink name
* @return boolean or PEAR::error
* /
function release($accLinkName)
{
if(!$this->exists) return FALSE;
if(@unlink($accLinkName)) return TRUE;
else return PEAR::raiseError(
"RawMediaData::release: unlink failed ($accLinkName)", GBERR_FILEIO
);
}
*/
/** /**
* Delete media file from filesystem * Delete media file from filesystem
* *

View file

@ -23,7 +23,7 @@
Author : $Author: tomas $ Author : $Author: tomas $
Version : $Revision: 1.11 $ Version : $Revision: 1.12 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/StoredFile.php,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/StoredFile.php,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -107,7 +107,7 @@ class StoredFile{
if($mdataLoc=='file' && !file_exists($metadata)) if($mdataLoc=='file' && !file_exists($metadata))
{ {
return PEAR::raiseError("StoredFile::insert: ". return PEAR::raiseError("StoredFile::insert: ".
"metadata file doesn't exists ($metadata)"); "metadata file not found ($metadata)");
} }
$res = $ac->md->insert($metadata, $mdataLoc); $res = $ac->md->insert($metadata, $mdataLoc);
if(PEAR::isError($res)){ if(PEAR::isError($res)){
@ -120,7 +120,7 @@ class StoredFile{
if(!file_exists($mediaFileLP)) if(!file_exists($mediaFileLP))
{ {
return PEAR::raiseError("StoredFile::insert: ". return PEAR::raiseError("StoredFile::insert: ".
"media file doesn't exists ($mediaFileLP)"); "media file not found ($mediaFileLP)");
} }
$res = $ac->rmd->insert($mediaFileLP); $res = $ac->rmd->insert($mediaFileLP);
if(PEAR::isError($res)){ if(PEAR::isError($res)){
@ -550,11 +550,18 @@ class StoredFile{
*/ */
function _getExt() function _getExt()
{ {
switch($this->mime){ switch(strtolower($this->mime)){
case"audio/mpeg": $ext="mp3"; break; case"audio/mpeg":
case"audio/x-wave": $ext="wav"; break; $ext="mp3"; break;
case"application/x-ogg": $ext="ogg"; break; case"audio/x-wav":
default: $ext="bin"; break; case"audio/x-wave":
$ext="wav"; break;
case"audio/x-ogg":
case"application/x-ogg":
case"application/x-ogg":
$ext="ogg"; break;
default:
$ext="bin"; break;
} }
return $ext; return $ext;
} }

View file

@ -23,7 +23,7 @@
Author : $Author: tomas $ Author : $Author: tomas $
Version : $Revision: 1.6 $ Version : $Revision: 1.7 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/conf.php,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/conf.php,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -88,12 +88,16 @@ $config = array(
'Storage' => array('Folder', 'File', 'Replica'), 'Storage' => array('Folder', 'File', 'Replica'),
'Folder' => array('Folder', 'File', 'Replica'), 'Folder' => array('Folder', 'File', 'Replica'),
'File' => array(), 'File' => array(),
'audioclip' => array(),
'playlist' => array(),
'Replica' => array(), 'Replica' => array(),
), ),
'allowedActions'=> array( 'allowedActions'=> array(
'RootNode' => array('classes', 'subjects'), 'RootNode' => array('classes', 'subjects'),
'Folder' => array('editPrivs', 'write', 'read'), 'Folder' => array('editPrivs', 'write', 'read'),
'File' => array('editPrivs', 'write', 'read'), 'File' => array('editPrivs', 'write', 'read'),
'audioclip' => array('editPrivs', 'write', 'read'),
'playlist' => array('editPrivs', 'write', 'read'),
'Replica' => array('editPrivs', 'write', 'read'), 'Replica' => array('editPrivs', 'write', 'read'),
'_class' => array('editPrivs', 'write', 'read'), '_class' => array('editPrivs', 'write', 'read'),
), ),

View file

@ -100,22 +100,22 @@ $tpldata['showMenu']=true;
function fmove(id, relPath){ function fmove(id, relPath){
var newPath=prompt('Destination folder (relative path):', relPath); var newPath=prompt('Destination folder (relative path):', relPath);
if(newPath==null) return; if(newPath==null) return;
location.href='gbHttp.php?id='+id+'&act=move&newPath='+newPath; location.href='gbHttp.php?id='+id+'&amp;act=move&amp;newPath='+newPath;
} }
function fcopy(id, relPath){ function fcopy(id, relPath){
var newPath=prompt('Destination folder (relative path):', relPath); var newPath=prompt('Destination folder (relative path):', relPath);
if(newPath==null) return; if(newPath==null) return;
location.href='gbHttp.php?id='+id+'&act=copy&newPath='+newPath; location.href='gbHttp.php?id='+id+'&amp;act=copy&amp;newPath='+newPath;
} }
function freplicate(name, id){ function freplicate(name, id){
var np=prompt('Destination folder (relative path):', id); var np=prompt('Destination folder (relative path):', id);
if(np==null) return; if(np==null) return;
location.href='gbHttp.php?id='+id+'&act=repl&newparid='+np; location.href='gbHttp.php?id='+id+'&amp;act=repl&amp;newparid='+np;
} }
function newFolder(){ function newFolder(){
var nn=prompt('New folder name:'); var nn=prompt('New folder name:');
if(nn==null) return; if(nn==null) return;
location.href='gbHttp.php?id=<?php echo$tpldata['id']?>&act=newFolder&newname='+nn; location.href='gbHttp.php?id=<?php echo$tpldata['id']?>&amp;act=newFolder&amp;newname='+nn;
} }
--> -->
</script> </script>
@ -130,15 +130,15 @@ $tpldata['showMenu']=true;
<?php if($tpldata['showMenu']){?> <?php if($tpldata['showMenu']){?>
<h3> <h3>
<a href="gbHtmlBrowse.php?act=getHomeDir" class="button">Home directory</a> <a href="gbHtmlBrowse.php?act=getHomeDir" class="button">Home directory</a>
<a href="gbHtmlBrowse.php?id=<?php echo$tpldata['id']?>&act=newfile" class="button"><span class="hidden">[</span>Upload&nbsp;new&nbsp;file<span class="hidden">]</span></a> <a href="gbHtmlBrowse.php?id=<?php echo$tpldata['id']?>&amp;act=newfile" class="button"><span class="hidden">[</span>Upload&nbsp;new&nbsp;file<span class="hidden">]</span></a>
<a href="javascript:newFolder()" class="button"><span class="hidden">[</span>Create&nbsp;new&nbsp;folder<span class="hidden">]</span></a> <a href="javascript:newFolder()" class="button"><span class="hidden">[</span>Create&nbsp;new&nbsp;folder<span class="hidden">]</span></a>
<!-- <a href="gbHtmlBrowse.php?id=<?php echo$tpldata['id']?>&act=sform" class="button"><span class="hidden">[</span>Search<span class="hidden">]</span></a>--> <!-- <a href="gbHtmlBrowse.php?id=<?php echo$tpldata['id']?>&amp;act=sform" class="button"><span class="hidden">[</span>Search<span class="hidden">]</span></a>-->
</h3> </h3>
<?php }?> <?php }?>
<?php if($tpldata['showPath']){?> <?php if($tpldata['showPath']){?>
<h3> <h3>
<a href="gbHtmlBrowse.php?id=<?php echo$tpldata['id']?>&tree=Y" class="button">Tree</a>&nbsp;&nbsp; <a href="gbHtmlBrowse.php?id=<?php echo$tpldata['id']?>&amp;tree=Y" class="button">Tree</a>&nbsp;&nbsp;
<?php foreach($tpldata['pathdata'] as $o){?> <?php foreach($tpldata['pathdata'] as $o){?>
<a href="gbHtmlBrowse.php?id=<?php echo urlencode($o['id'])?>"><?php echo$o['name']?></a> <a href="gbHtmlBrowse.php?id=<?php echo urlencode($o['id'])?>"><?php echo$o['name']?></a>
<?php if($o['type']=='Folder'){?><span class="slash b">/</span><?php }?> <?php if($o['type']=='Folder'){?><span class="slash b">/</span><?php }?>
@ -157,13 +157,16 @@ $tpldata['showMenu']=true;
<?php }?> <?php }?>
<?php }else{?> <?php }else{?>
<table border="0"> <table border="0">
<tr><th>fname</th><th>gunid</th><th>actions</th></tr>
<?php foreach($tpldata['listdata'] as $o){?> <?php foreach($tpldata['listdata'] as $o){?>
<tr><td valign="top"> <tr><td valign="top">
<?php echo str_repeat('&nbsp;', ($tpldata['tree']?intval($o['level']):3)*2)?><span id="ID<?php echo$o['id']?>" <?php echo str_repeat('&nbsp;', ($tpldata['tree']?intval($o['level']):3)*2)?><span id="ID<?php echo$o['id']?>"
><a <?php if($o['type']=='Folder'){?>href="gbHtmlBrowse.php?id=<?php echo$o['id']?>"<?php }?>><?php echo$o['name']?></a ><a <?php if($o['type']=='Folder'){?>href="gbHtmlBrowse.php?id=<?php echo$o['id']?>"<?php }?>><?php echo$o['name']?></a
></span> ></span>
</td><td valign="top">
<i>(<?php echo$o['gunid']?>)</i>
</td><td> </td><td>
<?php $a=array('Folder'=>'D', 'File'=>'F', 'Replica'=>'R'); echo$a[$o['type']]?> <?php $a=array('Folder'=>'D', 'File'=>'F', 'Replica'=>'R', 'audioclip'=>'A', 'playlist'=>'P'); echo$a[$o['type']]?>
&nbsp;<a href="javascript:frename('<?php echo$o['name']?>', '<?php echo$o['id']?>')" class="button">rename</a> &nbsp;<a href="javascript:frename('<?php echo$o['name']?>', '<?php echo$o['id']?>')" class="button">rename</a>
&nbsp;<a href="javascript:fmove('<?php echo$o['id']?>', '.')" class="button">move</a> &nbsp;<a href="javascript:fmove('<?php echo$o['id']?>', '.')" class="button">move</a>
&nbsp;<a href="javascript:fcopy('<?php echo$o['id']?>', '.')" class="button">copy</a> &nbsp;<a href="javascript:fcopy('<?php echo$o['id']?>', '.')" class="button">copy</a>
@ -171,12 +174,15 @@ $tpldata['showMenu']=true;
&nbsp;<a href="javascript:freplicate('<?php echo$o['name']?>', '<?php echo$o['id']?>')" class="button">replicate</a> &nbsp;<a href="javascript:freplicate('<?php echo$o['name']?>', '<?php echo$o['id']?>')" class="button">replicate</a>
<?php */?> <?php */?>
&nbsp;<a href="gbHtmlPerms.php?id=<?php echo$o['id']?>" class="button">permissions</a> &nbsp;<a href="gbHtmlPerms.php?id=<?php echo$o['id']?>" class="button">permissions</a>
&nbsp;<a href="gbHttp.php?act=delete&id=<?php echo$o['id']?>" class="button" &nbsp;<a href="gbHttp.php?act=delete&amp;id=<?php echo$o['id']?>" class="button"
onClick="return confirm('Delete object &quot;<?php echo$o['name']?>&quot;?')">DEL</a> onClick="return confirm('Delete object &quot;<?php echo$o['name']?>&quot;?')">DEL</a>
<?php if($o['type']=='File'){?> <?php if($o['type']=='File' || $o['type']=='audioclip'){?>
&nbsp;<a href="gbHttp.php?act=getFile&id=<?php echo$o['id']?>" class="button">Access</a> &nbsp;<a href="../xmlrpc/simpleGet.php?sessid=<?php echo$sessid?>&amp;id=<?php echo$o['gunid']?>" class="button">simpleGet</a>
&nbsp;<a href="gbHttp.php?act=getInfo&id=<?php echo$o['id']?>" class="button">Analyze</a> &nbsp;<a href="gbHttp.php?act=getInfo&amp;id=<?php echo$o['id']?>" class="button">Analyze</a>
&nbsp;<a href="gbHttp.php?act=getMdata&id=<?php echo$o['id']?>" class="button">MetaData</a> &nbsp;<a href="gbHttp.php?act=getMdata&amp;id=<?php echo$o['id']?>" class="button">MetaData</a>
<?php }?>
<?php if($o['type']=='playlist'){?>
&nbsp;<a href="gbHttp.php?act=getMdata&amp;id=<?php echo$o['id']?>" class="button">MetaData</a>
<?php }?> <?php }?>
<?php if($o['type']=='Replica'){?> <?php if($o['type']=='Replica'){?>
&nbsp; (-&gt;<?php echo$o['target']?>) &nbsp; (-&gt;<?php echo$o['target']?>)
@ -228,7 +234,7 @@ $tpldata['showMenu']=true;
<?php if($tpldata['showSRes']){?> <?php if($tpldata['showSRes']){?>
<ul> <ul>
<?php if(is_array($tpldata['search'])) foreach($tpldata['search'] as $k=>$v){?> <?php if(is_array($tpldata['search'])) foreach($tpldata['search'] as $k=>$v){?>
<li><a href="gbHttp.php?act=getMdata&id=<?php echo$gb->_idFromGunid($v['gunid'])?>"><?php echo$v['gunid']?></a> <li><a href="gbHttp.php?act=getMdata&amp;id=<?php echo$gb->_idFromGunid($v['gunid'])?>"><?php echo$v['gunid']?></a>
<?php }else{?> <?php }else{?>
No items found No items found
<?php }?> <?php }?>

View file

@ -23,7 +23,7 @@
Author : $Author: tomas $ Author : $Author: tomas $
Version : $Revision: 1.9 $ Version : $Revision: 1.10 $
Location : $ $ Location : $ $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -33,7 +33,7 @@ require_once"gbHtml_h.php";
* storageServer WWW-form interface * storageServer WWW-form interface
* *
* @author $Author: tomas $ * @author $Author: tomas $
* @version $Revision: 1.9 $ * @version $Revision: 1.10 $
* @see Alib * @see Alib
* @see GreenBox * @see GreenBox
*/ */
@ -244,6 +244,7 @@ switch($_REQUEST['act']){
header("Content-type: text/plain"); header("Content-type: text/plain");
$ia = $gb->analyzeFile($id, $sessid); $ia = $gb->analyzeFile($id, $sessid);
echo"fileformat: {$ia['fileformat']}\n"; echo"fileformat: {$ia['fileformat']}\n";
echo"mime: {$ia['mime_type']}\n";
echo"channels: {$ia['audio']['channels']}\n"; echo"channels: {$ia['audio']['channels']}\n";
echo"sample_rate: {$ia['audio']['sample_rate']}\n"; echo"sample_rate: {$ia['audio']['sample_rate']}\n";
echo"bits_per_sample: {$ia['audio']['bits_per_sample']}\n"; echo"bits_per_sample: {$ia['audio']['bits_per_sample']}\n";

View file

@ -23,7 +23,7 @@
# #
# #
# Author : $Author: tomas $ # Author : $Author: tomas $
# Version : $Revision: 1.10 $ # Version : $Revision: 1.11 $
# Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/xmlrpc/testRunner.sh,v $ # Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/xmlrpc/testRunner.sh,v $
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
@ -220,7 +220,7 @@ existsPlaylist() {
} }
deletePlaylist() { deletePlaylist() {
echo -n "# deletePlaylist: " echo -n "# deletePlaylist (${PLID}): "
$XR_CLI deletePlaylist $SESSID $PLID $XR_CLI deletePlaylist $SESSID $PLID
# || exit $? # || exit $?
echo "# status: $?" echo "# status: $?"
@ -280,7 +280,7 @@ elif [ "$COMM" == "playlists" ]; then
accessPlaylist accessPlaylist
editPlaylist editPlaylist
accessPlaylist accessPlaylist
# deletePlaylist deletePlaylist
existsPlaylist existsPlaylist
logout logout
echo "#XMLRPC: playlists: OK." echo "#XMLRPC: playlists: OK."