Skip to content

Commit

Permalink
Revert "Merge branch 'master' of https://github.com/kaltura/server"
Browse files Browse the repository at this point in the history
This reverts commit d307679, reversing
changes made to 3eb8161.
  • Loading branch information
erankor committed Jul 15, 2013
1 parent 133ec88 commit 00c2810
Show file tree
Hide file tree
Showing 1,308 changed files with 148,602 additions and 3,313 deletions.
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
configurations/admin.ini
configurations/batch.ini
configurations/db.ini
configurations/dc_config.ini
configurations/generator.ini
configurations/html5.php
configurations/local.ini
configurations/logger.ini
configurations/plugins.ini
configurations/system.ini
configurations/url_managers.ini
15 changes: 8 additions & 7 deletions admin_console/controllers/PartnerController.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,7 @@ public function createAction()
$systemPartnerPlugin->systemPartner->getPackages();
$systemPartnerPlugin->systemPartner->getPackagesVertical();
$systemPartnerPlugin->systemPartner->getPackagesClassOfService();
//Retrieve partner 0 template partners.
$partnerFilter = new Kaltura_Client_SystemPartner_Type_SystemPartnerFilter();
$partnerFilter->partnerGroupTypeEqual = Kaltura_Client_Enum_PartnerGroupType::TEMPLATE;
$partnerFilter->partnerParentIdEqual = 0;
$systemPartnerPlugin->systemPartner->listAction($partnerFilter);
list($packages, $packagesVertical, $packagesClassOfService, $templatePartners) = $client->doMultiRequest();
list($packages, $packagesVertical, $packagesClassOfService) = $client->doMultiRequest();

if (!(Infra_AclHelper::isAllowed('partner', 'configure-account-packages-service-paid')))
{
Expand All @@ -43,7 +38,13 @@ public function createAction()
Form_PackageHelper::addPackagesToForm($form, $packages, 'partner_package', $allowNonePackage);
Form_PackageHelper::addPackagesToForm($form, $packagesVertical, 'vertical_clasiffication');
Form_PackageHelper::addPackagesToForm($form, $packagesClassOfService, 'partner_package_class_of_service');
Form_PackageHelper::addOptionsToForm($form, $templatePartners->objects, 'partner_template_id', 'name');

//Retrieve partner 0 template partners.
$partnerFilter = new Kaltura_Client_SystemPartner_Type_SystemPartnerFilter();
$partnerFilter->partnerGroupTypeEqual = Kaltura_Client_Enum_PartnerGroupType::TEMPLATE;
$partnerFilter->partnerParentIdEqual = 0;
$result = $systemPartnerPlugin->systemPartner->listAction($partnerFilter);
Form_PackageHelper::addOptionsToForm($form, $result->objects, 'template_partner_id', 'name');

//Add languages
$languages = Zend_Registry::get('config')->languages;
Expand Down
4 changes: 2 additions & 2 deletions admin_console/forms/PartnerCreate.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function init()
'filters' => array('StringTrim'),
));

$this->addElement('select', 'partner_template_id', array(
$this->addElement('select', 'template_partner_id', array(
'label' => 'Select Template Partner ID:',
'filters' => array('StringTrim'),
));
Expand All @@ -69,7 +69,7 @@ public function init()
'filters' => array('StringTrim'),
));

$this->addDisplayGroup(array('name', 'company', 'admin_email', 'phone', 'describe_yourself', 'partner_package', 'partner_package_class_of_service' , 'vertical_clasiffication', 'partner_language' , 'partner_template_id'), 'partner_info', array(
$this->addDisplayGroup(array('name', 'company', 'admin_email', 'phone', 'describe_yourself', 'partner_package', 'partner_package_class_of_service' , 'vertical_clasiffication', 'partner_language' , 'template_partner_id'), 'partner_info', array(
'legend' => 'Publisher Info',
'decorators' => array(
'Description',
Expand Down
2 changes: 1 addition & 1 deletion admin_console/views/scripts/index/testme-doc.phtml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<iframe width="100%" height="550" src="/api_v3/testmeDoc?hideMenu=true" frameborder="0" class="auto-height"></iframe>
<iframe width="100%" height="550" src="/api_v3/testmeDoc/?hideMenu=true" frameborder="0" class="auto-height"></iframe>
2 changes: 1 addition & 1 deletion admin_console/views/scripts/index/testme.phtml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<iframe width="100%" height="550" src="/api_v3/testme?hideMenu=true" frameborder="0" class="auto-height"></iframe>
<iframe width="100%" height="550" src="/api_v3/testme/?hideMenu=true" frameborder="0" class="auto-height"></iframe>
2 changes: 1 addition & 1 deletion admin_console/views/scripts/index/xsd-doc.phtml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<iframe width="100%" height="550" src="/api_v3/xsdDoc?hideMenu=true" frameborder="0" class="auto-height"></iframe>
<iframe width="100%" height="550" src="/api_v3/xsdDoc/?hideMenu=true" frameborder="0" class="auto-height"></iframe>
8 changes: 6 additions & 2 deletions alpha/apps/kaltura/lib/access_control/model/rules/kRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,12 @@ public function applyContext(kEntryContextDataResult $context)
{
$context->addAccessControlMessage($this->message);
}
foreach($this->actions as $action)
$context->addAccessControlAction($action);

if(is_array($this->actions))
{
foreach($this->actions as $action)
$context->addAccessControlAction($action);
}

return true;
}
Expand Down
14 changes: 8 additions & 6 deletions alpha/apps/kaltura/lib/batch2/bcdl/kBusinessConvertDL.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,9 @@ public static function replaceEntry(entry $entry, entry $tempEntry = null)

//flush deffered events to re-index sphinx before temp entry deletion
kEventsManager::flushEvents();


kEventsManager::raiseEvent(new kObjectReplacedEvent($entry));

myEntryUtils::deleteEntry($tempEntry,null,true);

$te = new TrackEntry();
Expand Down Expand Up @@ -314,8 +316,8 @@ public static function compareFlavors(flavorParamsOutput $a, flavorParamsOutput
{
KalturaLog::debug("flavor[$flavorA] before flavor[$flavorB] at line[" . __LINE__ . "]");
return -1;
}
}

if($a->getReadyBehavior() == flavorParamsConversionProfile::READY_BEHAVIOR_NO_IMPACT && $b->getReadyBehavior() > flavorParamsConversionProfile::READY_BEHAVIOR_NO_IMPACT)
{
KalturaLog::debug("flavor[$flavorB] before flavor[$flavorA] at line[" . __LINE__ . "]");
Expand Down Expand Up @@ -349,12 +351,12 @@ public static function compareFlavors(flavorParamsOutput $a, flavorParamsOutput
KalturaLog::debug("flavor[$flavorA] before flavor[$flavorB] at line[" . __LINE__ . "]");
return -1;
}

private static function isSourceFlavor(flavorParamsOutput $a, flavorParamsOutput $b)
{
$aSources = explode(',', $a->getSourceAssetParamsIds());
$bSources = explode(',',$b->getSourceAssetParamsIds());

if(in_array($a->getFlavorParamsId(), $bSources))
{
KalturaLog::debug('Flavor '.$a->getId().' is source of flavor '.$b->getId());
Expand All @@ -365,7 +367,7 @@ private static function isSourceFlavor(flavorParamsOutput $a, flavorParamsOutput
KalturaLog::debug('Flavor '.$b->getId().' is source of flavor '.$a->getId());
return 1;
}

return 0;
}
}
10 changes: 0 additions & 10 deletions alpha/apps/kaltura/lib/batch2/bcdl/kBusinessPostConvertDL.php
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,6 @@ public static function handleConvertFinished(BatchJob $dbBatchJob = null, flavor
return $dbBatchJob;
}

$inheritedFlavorParamsIds = array();
$requiredFlavorParamsIds = array();
$flavorParamsConversionProfileItems = array();
if($profile)
Expand All @@ -184,18 +183,9 @@ public static function handleConvertFinished(BatchJob $dbBatchJob = null, flavor
{
if($flavorParamsConversionProfile->getReadyBehavior() == flavorParamsConversionProfile::READY_BEHAVIOR_REQUIRED)
$requiredFlavorParamsIds[$flavorParamsConversionProfile->getFlavorParamsId()] = true;
if($flavorParamsConversionProfile->getReadyBehavior() == flavorParamsConversionProfile::READY_BEHAVIOR_NO_IMPACT)
$inheritedFlavorParamsIds[] = $flavorParamsConversionProfile->getFlavorParamsId();
}
$flavorParamsItems = assetParamsPeer::retrieveByPKs($inheritedFlavorParamsIds);
foreach($flavorParamsItems as $flavorParams)
{
if($flavorParams->getReadyBehavior() == flavorParamsConversionProfile::READY_BEHAVIOR_REQUIRED)
$requiredFlavorParamsIds[$flavorParamsConversionProfile->getFlavorParamsId()] = true;
}
KalturaLog::debug("required flavor params ids [" . print_r($requiredFlavorParamsIds, true) . "]");


// go over all the flavor assets of the entry
$inCompleteFlavorIds = array();
$origianlAssetFlavorId = null;
Expand Down
2 changes: 1 addition & 1 deletion alpha/apps/kaltura/lib/batch2/kBatchManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ public static function addMediaInfo(mediaInfo $mediaInfoDb)
$contentDuration = $mediaInfoDb->getAudioDuration();
}

if ($contentDuration)
if ($contentDuration && $entry->getCalculateDuration())
{
$entry->setLengthInMsecs($contentDuration);
}
Expand Down
4 changes: 3 additions & 1 deletion alpha/apps/kaltura/lib/batch2/kFlowHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -1191,7 +1191,9 @@ protected static function createThumbnail(BatchJob $dbBatchJob, kPostConvertJobD
{
KalturaLog::debug("Set duration to: " . $mediaInfo->getContainerDuration());
$entry->setDimensions($mediaInfo->getVideoWidth(), $mediaInfo->getVideoHeight());
$entry->setLengthInMsecs($mediaInfo->getContainerDuration());

if($entry->getCalculateDuration())
$entry->setLengthInMsecs($mediaInfo->getContainerDuration());
}
}

Expand Down
12 changes: 8 additions & 4 deletions alpha/apps/kaltura/lib/batch2/kJobsManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -1208,7 +1208,6 @@ public static function addStorageExportJob(BatchJob $parentJob = null, $entryId,

$batchJob->setObjectId($fileSync->getId());
$batchJob->setObjectType(BatchJobObjectType::FILE_SYNC);
$batchJob->setJobSubType($externalStorage->getProtocol());
$batchJob->setDc($dc);
KalturaLog::log("Creating Storage export job, with source file: " . $netStorageExportData->getSrcFileSyncLocalPath());
return self::addJob($batchJob, $netStorageExportData, BatchJobType::STORAGE_EXPORT, $externalStorage->getProtocol());
Expand Down Expand Up @@ -1247,9 +1246,14 @@ public static function addMoveCategoryEntriesJob(BatchJob $parentJob = null, $pa

public static function addStorageDeleteJob(BatchJob $parentJob = null, $entryId = null, StorageProfile $storage, FileSync $fileSync)
{
$netStorageDeleteData = kStorageDeleteJobData::getInstance($storage->getProtocol());
$netStorageDeleteData->setJobData($storage, $filesync);

$netStorageDeleteData = new kStorageDeleteJobData();
$netStorageDeleteData->setServerUrl($storage->getStorageUrl());
$netStorageDeleteData->setServerUsername($storage->getStorageUsername());
$netStorageDeleteData->setServerPassword($storage->getStoragePassword());
$netStorageDeleteData->setFtpPassiveMode($storage->getStorageFtpPassiveMode());

$netStorageDeleteData->setSrcFileSyncId($fileSync->getId());
$netStorageDeleteData->setDestFileSyncStoredPath($storage->getStorageBaseDir() . '/' . $fileSync->getFilePath());
if ($parentJob)
{
$batchJob = $parentJob->createChild(BatchJobType::STORAGE_DELETE, $storage->getProtocol(), false);
Expand Down
29 changes: 0 additions & 29 deletions alpha/apps/kaltura/lib/batch2/model/kStorageDeleteJobData.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,4 @@
*/
class kStorageDeleteJobData extends kStorageJobData
{
/**
* @return kStorageDeleteJobData
*/
public static function getInstance($protocol)
{
$data = null;

$data = KalturaPluginManager::loadObject('kStorageDeleteJobData', $protocol);

if (!$data)
$data = new kStorageDeleteJobData();

return $data;
}
/**
* @var StorageProfile $storage
* @var FileSync $fileSync
*/
public function setJobData (StorageProfile $storage, FileSync $filesync)
{
$this->setServerUrl($storage->getStorageUrl());
$this->setServerUsername($storage->getStorageUsername());
$this->setServerPassword($storage->getStoragePassword());
$this->setFtpPassiveMode($storage->getStorageFtpPassiveMode());

$this->setSrcFileSyncId($fileSync->getId());
$this->setDestFileSyncStoredPath($storage->getStorageBaseDir() . '/' . $fileSync->getFilePath());
}

}
9 changes: 2 additions & 7 deletions alpha/apps/kaltura/lib/batch2/model/kStorageExportJobData.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,13 @@ class kStorageExportJobData extends kStorageJobData

public static function getInstance($protocol)
{
$data = null;
switch($protocol)
{
case StorageProfile::STORAGE_PROTOCOL_S3:
$data = new kAmazonS3StorageExportJobData();
return new kAmazonS3StorageExportJobData();
default:
$data = KalturaPluginManager::loadObject('kStorageExportJobData', $protocol);
return new kStorageExportJobData();
}
if (!$data)
$data = new kStorageExportJobData();

return $data;
}

public function setStorageExportJobData(StorageProfile $externalStorage, FileSync $fileSync, $srcFileSyncLocalPath, $force = false)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php
/**
* Applicative event that raised explicitly by the developer
* @package Core
* @subpackage events
*/
interface kObjectReplacedEventConsumer extends KalturaEventConsumer
{
/**
* @param BaseObject $object
* @param BatchJob $raisedJob
* @return bool true if should continue to the next consumer
*/
public function objectReplaced(BaseObject $object, BatchJob $raisedJob = null);

/**
* @param BaseObject $object
* @return bool true if the consumer should handle the event
*/
public function shouldConsumeReplacedEvent(BaseObject $object);
}
33 changes: 33 additions & 0 deletions alpha/apps/kaltura/lib/events/events/kObjectReplacedEvent.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php
/**
* Applicative event that raised explicitly by the developer
* @package Core
* @subpackage events
*/
class kObjectReplacedEvent extends kApplicativeEvent
{
const EVENT_CONSUMER = 'kObjectReplacedEventConsumer';

public function getConsumerInterface()
{
return self::EVENT_CONSUMER;
}

/**
* @param kObjectReadyForReplacmentEventConsumer $consumer
* @return bool true if should continue to the next consumer
*/
protected function doConsume(KalturaEventConsumer $consumer)
{
if(!$consumer->shouldConsumeReplacedEvent($this->object))
return true;

$additionalLog = '';
if(method_exists($this->object, 'getId'))
$additionalLog .= 'id [' . $this->object->getId() . ']';

KalturaLog::debug(get_class($this) . ' event consumed by ' . get_class($consumer) . ' object type [' . get_class($this->object) . '] ' . $additionalLog);
return $consumer->objectReplaced($this->object, $this->raisedJob);
}

}
8 changes: 0 additions & 8 deletions alpha/apps/kaltura/lib/model/objectWrapperBase.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,6 @@ public static function shouldWrap ( $v )
self::$s_should_wrap = $v;
}

public static function classForName ( $clazz_name )
{
echo __METHOD__ . " $clazz_name";
require_once ( "lib/model/" . $clazz_name . ".php" );
$clazz = get_class( $clazz_name );
return new $clazz();
}

// will return the proper object wrapper
public static function getWrapperClass ( $obj , $detail_level = self::DETAIL_LEVEL_REGULAR ,
$detail_policy_velocity = -3 , $recursion_depth = 0 , $extra_fields = null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,12 @@ class BatchJobFilter extends baseObjectFilter
"_gte_lock_version",
"_lte_lock_version",
"_lt_estimated_effort",
"_gt_estimated_effort",);
"_gt_estimated_effort",
"_gte_urgency",
"_lte_urgency",
"_gte_batch_version",
"_lte_batch_version",
"_eq_batch_version");

protected $BATCH_JOB_COMMON_FIELDS = array(
"_eq_id",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ public function init ()
"_matchand_categories_ids", // see alias
"_matchor_categories_ids", // see alias
"_notcontains_categories_ids",
"_empty_categories_ids",
"_matchand_flavor_params_ids",
"_matchor_flavor_params_ids",
"_matchor_duration_type", // see alias
Expand Down
Loading

0 comments on commit 00c2810

Please sign in to comment.