diff --git a/livesupport/modules/storageServer/Makefile b/livesupport/modules/storageServer/Makefile index 98582cc81..9fcb3fe12 100644 --- a/livesupport/modules/storageServer/Makefile +++ b/livesupport/modules/storageServer/Makefile @@ -20,7 +20,7 @@ # # # Author : $Author: tomas $ -# Version : $Revision: 1.7 $ +# Version : $Revision: 1.8 $ # Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/Attic/Makefile,v $ # # @configure_input@ @@ -124,6 +124,8 @@ testonly: ${TEST_RUNNER} check: all testonly +recheck: clean check + #------------------------------------------------------------------------------- # Specific targets #------------------------------------------------------------------------------- diff --git a/livesupport/modules/storageServer/var/BasicStor.php b/livesupport/modules/storageServer/var/BasicStor.php index ebcc7832f..521f3c031 100644 --- a/livesupport/modules/storageServer/var/BasicStor.php +++ b/livesupport/modules/storageServer/var/BasicStor.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/BasicStor.php,v $ ------------------------------------------------------------------------------*/ @@ -48,7 +48,7 @@ require_once "Transport.php"; * Core of LiveSupport file storage module * * @author $Author: tomas $ - * @version $Revision: 1.7 $ + * @version $Revision: 1.8 $ * @see Alib */ class BasicStor extends Alib{ @@ -184,9 +184,9 @@ class BasicStor extends Alib{ */ function bsCopyFile($id, $did) { - if($this->getObjType($did)!=='Folder') + if($this->getObjType($did) !== 'Folder') return PEAR::raiseError( - 'GreenBox::copyFile: destination is not folder', GBERR_WRTYPE + 'BasicStor::bsCopyFile: destination is not folder', GBERR_WRTYPE ); return $this->_copySubtree($id, $did); } @@ -424,12 +424,12 @@ class BasicStor extends Alib{ function bsCreateReplica($id, $did, $replicaName) { 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( - 'GreenBox::createReplica: dest is not folder', GBERR_WRTYPE + 'BasicStor::bsCreateReplica: dest is not folder', GBERR_WRTYPE ); if($replicaName=='') $replicaName = $this->getObjName($id); while(($exid = $this->getObjId($replicaName, $did))<>'') @@ -452,7 +452,7 @@ class BasicStor extends Alib{ function bsCreateVersion($id, $did, $versionLabel) { 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) { - if($this->getObjType($id)!=='Folder') + if($this->getObjType($id) !== 'Folder') 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'); return $a; @@ -580,7 +580,7 @@ class BasicStor extends Alib{ function getObjIdFromRelPath($id, $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; foreach($a as $i=>$item){ switch($item){ @@ -700,7 +700,7 @@ class BasicStor extends Alib{ $this->test_dump = $this->dumpTree($this->storId); if($this->test_dump==$this->test_correct) { $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'. "
\ncorrect:\n.{$this->test_correct}.\n".
"dump:\n.{$this->test_dump}.\n\n");
}
diff --git a/livesupport/modules/storageServer/var/GreenBox.php b/livesupport/modules/storageServer/var/GreenBox.php
index 0c37d008c..b4619991b 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.15 $
+ Version : $Revision: 1.16 $
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
*
* @author $Author: tomas $
- * @version $Revision: 1.15 $
+ * @version $Revision: 1.16 $
* @see BasicStor
*/
class GreenBox extends BasicStor{
@@ -290,7 +290,16 @@ class GreenBox extends BasicStor{
{
if(($res = $this->_authorize('read', $id, $sessid)) !== TRUE)
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 */
@@ -362,6 +371,23 @@ class GreenBox extends BasicStor{
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 */
/**
@@ -373,10 +399,15 @@ class GreenBox extends BasicStor{
function copyObj($id, $newParid, $after='')
{
$nid = parent::copyObj($id, $newParid, $after='');
- if($this->getObjType($id)==='File'){
- $ac =& StoredFile::recall(&$this, $id);
- if(PEAR::isError($ac)){ return $ac; }
- $ac2 =& StoredFile::copyOf(&$ac, $nid);
+ switch($this->getObjType($id)){
+ case"audioclip":
+ case"playlist":
+ case"File":
+ $ac =& StoredFile::recall(&$this, $id);
+ if(PEAR::isError($ac)){ return $ac; }
+ $ac2 =& StoredFile::copyOf(&$ac, $nid);
+ break;
+ default:
}
return $nid;
}
@@ -403,6 +434,8 @@ class GreenBox extends BasicStor{
function removeObj($id)
{
switch($this->getObjType($id)){
+ case"audioclip":
+ case"playlist":
case"File":
$ac =& StoredFile::recall(&$this, $id);
if(!PEAR::isError($ac)){
diff --git a/livesupport/modules/storageServer/var/MetaData.php b/livesupport/modules/storageServer/var/MetaData.php
index 38835ed5f..72151fc11 100644
--- a/livesupport/modules/storageServer/var/MetaData.php
+++ b/livesupport/modules/storageServer/var/MetaData.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/MetaData.php,v $
------------------------------------------------------------------------------*/
@@ -34,6 +34,7 @@
* LiveSupport file storage support class.| fname | gunid | actions |
|---|---|---|
| href="gbHtmlBrowse.php?id="> + | + () |
- 'D', 'File'=>'F', 'Replica'=>'R'); echo$a[$o['type']]?>
+ 'D', 'File'=>'F', 'Replica'=>'R', 'audioclip'=>'A', 'playlist'=>'P'); echo$a[$o['type']]?>
rename
move
copy
@@ -171,12 +174,15 @@ $tpldata['showMenu']=true;
replicate
permissions
- DEL
-
- Access
- Analyze
- MetaData
+
+ simpleGet
+ Analyze
+ MetaData
+
+
+ MetaData
(->)
@@ -228,7 +234,7 @@ $tpldata['showMenu']=true;
|