#832 Elements names in playlists are now considered case sensitive.
This commit is contained in:
parent
49c6517346
commit
db4f5da722
|
@ -223,20 +223,20 @@ class uiPlaylist
|
|||
function plwalk($arr, $parent=0, $attrs=0)
|
||||
{
|
||||
foreach ($arr['children'] as $node=>$sub) {
|
||||
if ($sub['elementname']==='playlistelement') {
|
||||
if ($sub['elementname']==='playlistElement') {
|
||||
$this->plwalk($sub, $node, $sub['attrs']);
|
||||
}
|
||||
if ($sub['elementname']==='audioclip' || $sub['elementname']==='playlist') {
|
||||
if ($sub['elementname']==='audioClip' || $sub['elementname']==='playlist') {
|
||||
#$this->flat["$parent.$node"] = $sub['attrs'];
|
||||
#$this->flat["$parent.$node"]['type'] = $sub['elementname'];
|
||||
$this->flat[$parent] = $this->Base->_getMetaInfo($this->Base->gb->_idFromGunid($sub['attrs']['id']));
|
||||
$this->flat[$parent]['attrs'] = $attrs;
|
||||
}
|
||||
if ($sub['elementname']==='fadeinfo') {
|
||||
$this->flat[$parent]['fadein'] = GreenBox::_plTimeToSecs($sub['attrs']['fadein']);
|
||||
$this->flat[$parent]['fadeout'] = GreenBox::_plTimeToSecs($sub['attrs']['fadeout']);
|
||||
$this->flat[$parent]['fadein_ms'] = $sub['attrs']['fadein'] ? GreenBox::_plTimeToSecs($sub['attrs']['fadein']) * 1000 : 0;
|
||||
$this->flat[$parent]['fadeout_ms'] = $sub['attrs']['fadeout'] ? GreenBox::_plTimeToSecs($sub['attrs']['fadeout']) * 1000 : 0;
|
||||
if ($sub['elementname']==='fadeInfo') {
|
||||
$this->flat[$parent]['fadein'] = GreenBox::_plTimeToSecs($sub['attrs']['fadeIn']);
|
||||
$this->flat[$parent]['fadeout'] = GreenBox::_plTimeToSecs($sub['attrs']['fadeOut']);
|
||||
$this->flat[$parent]['fadein_ms'] = $sub['attrs']['fadeIn'] ? GreenBox::_plTimeToSecs($sub['attrs']['fadeIn']) * 1000 : 0;
|
||||
$this->flat[$parent]['fadeout_ms'] = $sub['attrs']['fadeOut'] ? GreenBox::_plTimeToSecs($sub['attrs']['fadeOut']) * 1000 : 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
|
||||
|
||||
Author : $Author: tomas $
|
||||
Version : $Revision: 1.29 $
|
||||
Version : $Revision: 1.30 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/MetaData.php,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
@ -188,7 +188,7 @@ class MetaData{
|
|||
function getMetadataEl($category, $parid=NULL)
|
||||
{
|
||||
// handle predicate namespace shortcut
|
||||
$a = XML_Util::splitQualifiedName(strtolower($category));
|
||||
$a = XML_Util::splitQualifiedName($category);
|
||||
if(PEAR::isError($a)) return $a;
|
||||
$catNs = $a['namespace'];
|
||||
$cat = $a['localPart'];
|
||||
|
@ -268,7 +268,7 @@ class MetaData{
|
|||
*/
|
||||
function insertMetadataEl($parid, $category, $value=NULL, $predxml='T')
|
||||
{
|
||||
$category = strtolower($category);
|
||||
//$category = strtolower($category);
|
||||
$parent = $this->dbc->getRow("
|
||||
SELECT predns, predicate, predxml FROM {$this->mdataTable}
|
||||
WHERE gunid=x'{$this->gunid}'::bigint AND id=$parid
|
||||
|
@ -647,8 +647,8 @@ class MetaData{
|
|||
$objns=NULL, $object=NULL)
|
||||
{
|
||||
//echo "$subjns, $subject, $predns, $predicate, $predxml, $objns, $object\n";
|
||||
$predns = strtolower($predns);
|
||||
$predicate = strtolower($predicate);
|
||||
//$predns = strtolower($predns);
|
||||
//$predicate = strtolower($predicate);
|
||||
$predns_sql = (is_null($predns) ? "NULL" : "'$predns'" );
|
||||
$objns_sql = (is_null($objns) ? "NULL" : "'$objns'" );
|
||||
$object_sql = (is_null($object)? "NULL" : "'$object'");
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
|
||||
|
||||
Author : $Author: tomas $
|
||||
Version : $Revision: 1.12 $
|
||||
Version : $Revision: 1.13 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/Playlist.php,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
@ -72,7 +72,7 @@ class Playlist extends StoredFile{
|
|||
* <li>acGunid, string - audioClip gunid</li>
|
||||
* <li>acLen string - length of clip in dcterms:extent format</li>
|
||||
* <li>acTit string - clip title</li>
|
||||
* <li>elType string - audioclip | playlist</li>
|
||||
* <li>elType string - audioClip | playlist</li>
|
||||
* </ul>
|
||||
*/
|
||||
function getAcInfo($acId)
|
||||
|
@ -89,7 +89,10 @@ class Playlist extends StoredFile{
|
|||
if(isset($r[0]['value'])) $acTit = $r[0]['value'];
|
||||
else $acTit = $acGunid;
|
||||
$elType = $this->gb->getObjType($acId);
|
||||
if($elType == 'webstream') $elType = 'audioclip';
|
||||
$trTbl = array('audioclip'=>'audioClip', 'webstream'=>'audioClip',
|
||||
'playlist'=>'playlist');
|
||||
$elType = $trTbl[$elType];
|
||||
if($elType == 'webstream') $elType = 'audioClip';
|
||||
return compact('acGunid', 'acLen', 'acTit', 'elType');
|
||||
}
|
||||
|
||||
|
@ -163,8 +166,8 @@ class Playlist extends StoredFile{
|
|||
* @param acGunid string - audioClip gunid
|
||||
* @param acLen string - audiClip length in extent format
|
||||
* @param acTit string - audioClip title
|
||||
* @param fadeIn string - fadein value in ss.ssssss or extent format
|
||||
* @param fadeOut string - fadeout value in ss.ssssss or extent format
|
||||
* @param fadeIn string - fadeIn value in ss.ssssss or extent format
|
||||
* @param fadeOut string - fadeOut value in ss.ssssss or extent format
|
||||
* @param plElGunid string - optional playlist element gunid
|
||||
* @param elType string - optional 'audioClip' | 'playlist'
|
||||
* @return array with fields:
|
||||
|
@ -287,7 +290,7 @@ class Playlist extends StoredFile{
|
|||
}
|
||||
|
||||
/**
|
||||
* Add audioclip specified by local id to the playlist
|
||||
* Add audioClip specified by local id to the playlist
|
||||
*
|
||||
* @param acId string, local ID of added file
|
||||
* @param fadeIn string, optional, in time format hh:mm:ss.ssssss
|
||||
|
@ -329,7 +332,7 @@ class Playlist extends StoredFile{
|
|||
|
||||
|
||||
/**
|
||||
* Remove audioclip from playlist
|
||||
* Remove audioClip from playlist
|
||||
*
|
||||
* @param plElGunid string, global id of deleted playlistElement
|
||||
* @return boolean
|
||||
|
@ -440,7 +443,7 @@ class Playlist extends StoredFile{
|
|||
$arr = $this->md->genPhpArray();
|
||||
$els =& $arr['children'];
|
||||
foreach($els as $i=>$el){
|
||||
if($el['elementname'] != 'playlistelement'){
|
||||
if($el['elementname'] != 'playlistElement'){
|
||||
$metadata = array_splice($els, $i, 1);
|
||||
continue;
|
||||
}
|
||||
|
@ -462,11 +465,11 @@ class Playlist extends StoredFile{
|
|||
$fadeIn = NULL;
|
||||
$fadeOut = NULL;
|
||||
foreach($el['children'] as $j=>$af){
|
||||
if($af['elementname'] == 'audioclip'){
|
||||
if($af['elementname'] == 'audioClip'){
|
||||
$acGunid = $af['attrs']['id'];
|
||||
}elseif($af['elementname'] == 'fadeinfo'){
|
||||
$fadeIn = $af['attrs']['fadein'];
|
||||
$fadeOut = $af['attrs']['fadeout'];
|
||||
}elseif($af['elementname'] == 'fadeInfo'){
|
||||
$fadeIn = $af['attrs']['fadeIn'];
|
||||
$fadeOut = $af['attrs']['fadeOut'];
|
||||
}else{
|
||||
}
|
||||
}
|
||||
|
@ -508,8 +511,8 @@ class Playlist extends StoredFile{
|
|||
$plElGunidArr = $this->md->getMetadataEl('id', $elId);
|
||||
if(PEAR::isError($plElGunidArr)){ return $plElGunidArr; }
|
||||
$plElGunid = $plElGunidArr[0]['value'];
|
||||
// get relativeoffset:
|
||||
$offArr = $this->md->getMetadataEl('relativeoffset', $elId);
|
||||
// get relativeOffset:
|
||||
$offArr = $this->md->getMetadataEl('relativeOffset', $elId);
|
||||
if(PEAR::isError($offArr)){ return $offArr; }
|
||||
$offsetId = $offArr[0]['mid'];
|
||||
$offset = $offArr[0]['value'];
|
||||
|
@ -598,26 +601,26 @@ class Playlist extends StoredFile{
|
|||
$plArr = array('els'=>array());
|
||||
foreach($arr[children] as $i=>$plEl){
|
||||
switch($plEl['elementname']){
|
||||
case"playlistelement":
|
||||
case"playlistElement":
|
||||
$plInfo = array(
|
||||
'acLen' => '00:00:00.000000', 'acLenS' => 0,
|
||||
'fadein' => '00:00:00.000000', 'fadeinS' => 0,
|
||||
'fadeout' => '00:00:00.000000', 'fadeoutS' => 0,
|
||||
'fadeIn' => '00:00:00.000000', 'fadeInS' => 0,
|
||||
'fadeOut' => '00:00:00.000000', 'fadeOutS' => 0,
|
||||
);
|
||||
$plInfo['elOffset'] = $pom = $plEl['attrs']['relativeoffset'];
|
||||
$plInfo['elOffset'] = $pom = $plEl['attrs']['relativeOffset'];
|
||||
$plInfo['elOffsetS'] = $this->_plTimeToSecs($pom);
|
||||
foreach($plEl['children'] as $j=>$acFi){
|
||||
switch($acFi['elementname']){
|
||||
case"audioclip":
|
||||
case"audioClip":
|
||||
$plInfo['acLen'] = $pom = $acFi['attrs']['playlength'];
|
||||
$plInfo['acLenS'] = $this->_plTimeToSecs($pom);
|
||||
$plInfo['acGunid'] = $pom = $acFi['attrs']['id'];
|
||||
break;
|
||||
case"fadeinfo":
|
||||
$plInfo['fadein'] = $pom = $acFi['attrs']['fadein'];
|
||||
$plInfo['fadeinS'] = $this->_plTimeToSecs($pom);
|
||||
$plInfo['fadeout'] = $pom = $acFi['attrs']['fadeout'];
|
||||
$plInfo['fadeoutS'] = $this->_plTimeToSecs($pom);
|
||||
case"fadeInfo":
|
||||
$plInfo['fadeIn'] = $pom = $acFi['attrs']['fadeIn'];
|
||||
$plInfo['fadeInS'] = $this->_plTimeToSecs($pom);
|
||||
$plInfo['fadeOut'] = $pom = $acFi['attrs']['fadeOut'];
|
||||
$plInfo['fadeOutS'] = $this->_plTimeToSecs($pom);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -705,7 +708,7 @@ class Playlist extends StoredFile{
|
|||
* Cyclic-recursion checking
|
||||
*
|
||||
* @param insGunid string, gunid of playlist beeing inserted
|
||||
* @return
|
||||
* @return boolean - true if recursion is detected
|
||||
*/
|
||||
function _cyclicRecursion($insGunid)
|
||||
{
|
||||
|
@ -717,7 +720,7 @@ class Playlist extends StoredFile{
|
|||
$els =& $arr['children'];
|
||||
if(!is_array($els)) return FALSE;
|
||||
foreach($els as $i=>$plEl){
|
||||
if($plEl['elementname'] != "playlistelement") continue;
|
||||
if($plEl['elementname'] != "playlistElement") continue;
|
||||
foreach($plEl['children'] as $j=>$elCh){
|
||||
if($elCh['elementname'] != "playlist") continue;
|
||||
$nextGunid = $elCh['attrs']['id'];
|
||||
|
|
|
@ -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/Validator.php,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
@ -146,7 +146,7 @@ class Validator{
|
|||
*/
|
||||
function validateNode(&$node, $fname)
|
||||
{
|
||||
$dname = strtolower(($node->ns? $node->ns.":" : '').$node->name);
|
||||
$dname = (($node->ns? $node->ns.":" : '').$node->name);
|
||||
$formTree =& $this->formTree;
|
||||
if(DEBUG) echo"\nVAL::validateNode: 1 $dname/$fname\n";
|
||||
// check root node name:
|
||||
|
@ -181,7 +181,7 @@ class Validator{
|
|||
$attrs = array();
|
||||
// check if all attrs are permitted here:
|
||||
foreach($node->attrs as $i=>$attr){
|
||||
$aname = strtolower(($attr->ns? $attr->ns.":" : '').$attr->name);
|
||||
$aname = (($attr->ns? $attr->ns.":" : '').$attr->name);
|
||||
$attrs[$aname] =& $node->attrs[$i];
|
||||
if(!$this->isAttrInFormat($fname, $aname))
|
||||
return $this->_err(VAL_UNKNOWNA, $aname);
|
||||
|
@ -219,7 +219,7 @@ class Validator{
|
|||
$childs = array();
|
||||
// check if all children are permitted here:
|
||||
foreach($node->children as $i=>$ch){
|
||||
$chname = strtolower(($ch->ns? $ch->ns.":" : '').$ch->name);
|
||||
$chname = (($ch->ns? $ch->ns.":" : '').$ch->name);
|
||||
// echo "XXE $chname\n";
|
||||
if(!$this->isChildInFormat($fname, $chname))
|
||||
return $this->_err(VAL_UNKNOWNE, $chname);
|
||||
|
|
|
@ -22,15 +22,15 @@
|
|||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
|
||||
Author : $Author: sebastian $
|
||||
Version : $Revision: 1.3 $
|
||||
Author : $Author: tomas $
|
||||
Version : $Revision: 1.4 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/audioClipFormat.php,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
||||
$audioClipFormat = array(
|
||||
'_root'=>'audioclip',
|
||||
'audioclip'=>array(
|
||||
'_root'=>'audioClip',
|
||||
'audioClip'=>array(
|
||||
'childs'=>array(
|
||||
'required'=>array('metadata'),
|
||||
),
|
||||
|
@ -56,7 +56,7 @@ $audioClipFormat = array(
|
|||
'dcterms:spatial', 'dcterms:entity', 'dc:description',
|
||||
'dc:creator', 'dc:subject', 'dc:type', 'dc:format',
|
||||
'dc:contributor', 'dc:language', 'dc:rights',
|
||||
'dcterms:ispartof', 'dc:date',
|
||||
'dcterms:isPartOf', 'dc:date',
|
||||
'dc:publisher',
|
||||
// extra
|
||||
'dcterms:alternative',
|
||||
|
@ -327,7 +327,7 @@ $audioClipFormat = array(
|
|||
'area'=>'Talk',
|
||||
'attrs'=>array('implied'=>array('xml:lang')),
|
||||
),
|
||||
'dcterms:ispartof'=>array(
|
||||
'dcterms:isPartOf'=>array(
|
||||
'type'=>'Text',
|
||||
'area'=>'Talk',
|
||||
'attrs'=>array('implied'=>array('xml:lang')),
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
|
||||
|
||||
Author : $Author: tomas $
|
||||
Version : $Revision: 1.3 $
|
||||
Version : $Revision: 1.4 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/playlistFormat.php,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
@ -32,24 +32,24 @@ $playlistFormat = array(
|
|||
'_root'=>'playlist',
|
||||
'playlist'=>array(
|
||||
'childs'=>array(
|
||||
// 'repeatable'=>array('playlistelement'),
|
||||
'optional'=>array('metadata', 'playlistelement'),
|
||||
// 'repeatable'=>array('playlistElement'),
|
||||
'optional'=>array('metadata', 'playlistElement'),
|
||||
),
|
||||
'attrs'=>array(
|
||||
'required'=>array('id', 'playlength'),
|
||||
'implied'=>array('title'),
|
||||
),
|
||||
),
|
||||
'playlistelement'=>array(
|
||||
'playlistElement'=>array(
|
||||
'childs'=>array(
|
||||
'oneof'=>array('audioclip', 'playlist'),
|
||||
'optional'=>array('fadeinfo'),
|
||||
'oneof'=>array('audioClip', 'playlist'),
|
||||
'optional'=>array('fadeInfo'),
|
||||
),
|
||||
'attrs'=>array(
|
||||
'required'=>array('id', 'relativeoffset'),
|
||||
'required'=>array('id', 'relativeOffset'),
|
||||
),
|
||||
),
|
||||
'audioclip'=>array(
|
||||
'audioClip'=>array(
|
||||
'childs'=>array(
|
||||
'optional'=>array('metadata'),
|
||||
),
|
||||
|
@ -57,9 +57,9 @@ $playlistFormat = array(
|
|||
'implied'=>array('id', 'title', 'playlength', 'uri'),
|
||||
),
|
||||
),
|
||||
'fadeinfo'=>array(
|
||||
'fadeInfo'=>array(
|
||||
'attrs'=>array(
|
||||
'required'=>array('id', 'fadein', 'fadeout'),
|
||||
'required'=>array('id', 'fadeIn', 'fadeOut'),
|
||||
),
|
||||
),
|
||||
'metadata'=>array(
|
||||
|
@ -98,11 +98,11 @@ $playlistFormat = array(
|
|||
'type'=>'Attribute',
|
||||
'regexp'=>'^[0-9a-f]{16}$',
|
||||
),
|
||||
'fadein'=>array(
|
||||
'fadeIn'=>array(
|
||||
'type'=>'Attribute',
|
||||
'regexp'=>'^((\d{2}:)?\d{2}:)?\d{1,2}(.\d{6})?$',
|
||||
),
|
||||
'fadeout'=>array(
|
||||
'fadeOut'=>array(
|
||||
'type'=>'Attribute',
|
||||
'regexp'=>'^((\d{2}:)?\d{2}:)?\d{1,2}(.\d{6})?$',
|
||||
),
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<playlistElement id="0000000000000101" relativeOffset="0" >
|
||||
<audioClip id="0000000000010001" playlength="01:00:00.000000"
|
||||
title="one"/>
|
||||
<fadeinfo fadein="02.000000" fadeout="03.000000"
|
||||
<fadeInfo fadeIn="02.000000" fadeOut="03.000000"
|
||||
id="15015b4b70a054f1" />
|
||||
</playlistElement>
|
||||
<playlistElement id="0000000000000102" relativeOffset="01:00:00.000000" >
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<audioclip>
|
||||
<audioClip>
|
||||
<metadata
|
||||
xmlns="http://mdlf.org/livesupport/elements/1.0/"
|
||||
xmlns:ls="http://mdlf.org/livesupport/elements/1.0/"
|
||||
|
@ -11,4 +11,4 @@
|
|||
<dcterms:extent>01:30:00.000000</dcterms:extent>
|
||||
<ls:url>http://localhost/y</ls:url>
|
||||
</metadata>
|
||||
</audioclip>
|
||||
</audioClip>
|
||||
|
|
|
@ -22,15 +22,15 @@
|
|||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
|
||||
Author : $Author: sebastian $
|
||||
Version : $Revision: 1.3 $
|
||||
Author : $Author: tomas $
|
||||
Version : $Revision: 1.4 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/webstreamFormat.php,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
||||
$webstreamFormat = array(
|
||||
'_root'=>'audioclip',
|
||||
'audioclip'=>array(
|
||||
'_root'=>'audioClip',
|
||||
'audioClip'=>array(
|
||||
'childs'=>array(
|
||||
'required'=>array('metadata'),
|
||||
),
|
||||
|
@ -56,7 +56,7 @@ $webstreamFormat = array(
|
|||
'dcterms:spatial', 'dcterms:entity', 'dc:description',
|
||||
'dc:creator', 'dc:subject', 'dc:type', 'dc:format',
|
||||
'dc:contributor', 'dc:language', 'dc:rights',
|
||||
'dcterms:ispartof', 'dc:date',
|
||||
'dcterms:isPartOf', 'dc:date',
|
||||
'dc:publisher',
|
||||
// extra
|
||||
'dcterms:alternative',
|
||||
|
@ -330,7 +330,7 @@ $webstreamFormat = array(
|
|||
'area'=>'Talk',
|
||||
'attrs'=>array('implied'=>array('xml:lang')),
|
||||
),
|
||||
'dcterms:ispartof'=>array(
|
||||
'dcterms:isPartOf'=>array(
|
||||
'type'=>'Text',
|
||||
'area'=>'Talk',
|
||||
'attrs'=>array('implied'=>array('xml:lang')),
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
|
||||
|
||||
Author : $Author: tomas $
|
||||
Version : $Revision: 1.16 $
|
||||
Version : $Revision: 1.17 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/xmlrpc/XR_LocStor.php,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
@ -906,7 +906,8 @@ class XR_LocStor extends LocStor{
|
|||
*
|
||||
* On success, returns a XML-RPC struct with single field:
|
||||
* <ul>
|
||||
* <li> url : string - readable url</li>
|
||||
* <li> url : string - readable url of accessed playlist in
|
||||
* XML format</li>
|
||||
* <li> token : string - playlist token</li>
|
||||
* <li> chsum : string - md5 checksum</li>
|
||||
* </ul>
|
||||
|
|
Loading…
Reference in New Issue