public static function setDefaultCriteriaFilter() { if (self::$s_criteria_filter == null) { self::$s_criteria_filter = new criteriaFilter(); } $c = KalturaCriteria::create(CuePointPeer::OM_CLASS); $c->addAnd(CuePointPeer::STATUS, CuePointStatus::DELETED, Criteria::NOT_EQUAL); if (self::$userContentOnly) { $puserId = kCurrentContext::$ks_uid; $partnerId = kCurrentContext::$ks_partner_id; if ($puserId && $partnerId) { $kuser = kuserPeer::getKuserByPartnerAndUid($partnerId, $puserId); if (!$kuser) { $kuser = kuserPeer::createKuserForPartner($partnerId, $puserId); } // Temporarily change user filter to (user==kuser OR cuepoint of type THUMB/CODE). Long term fix will be accomplished // by adding a public property on the cuepoint object and checking (user==kuser OR is public) //$c->addAnd(CuePointPeer::KUSER_ID, $kuser->getId()); $criterionUserOrPublic = $c->getNewCriterion(CuePointPeer::KUSER_ID, $kuser->getId()); $criterionUserOrPublic->addOr($c->getNewCriterion(self::IS_PUBLIC, true, Criteria::EQUAL)); $criterionUserOrPublic->addTag(KalturaCriterion::TAG_USER_SESSION); $criterionUserOrPublic->addOr($c->getNewCriterion(CuePointPeer::TYPE, array(ThumbCuePointPlugin::getCuePointTypeCoreValue(ThumbCuePointType::THUMB), CodeCuePointPlugin::getCuePointTypeCoreValue(CodeCuePointType::CODE), AdCuePointPlugin::getCuePointTypeCoreValue(AdCuePointType::AD)), Criteria::IN)); $c->addAnd($criterionUserOrPublic); } } self::$s_criteria_filter->setFilter($c); }
public static function dependsOn() { $bulkUploadXmlVersion = new KalturaVersion(self::BULK_UPLOAD_XML_VERSION_MAJOR, self::BULK_UPLOAD_XML_VERSION_MINOR, self::BULK_UPLOAD_XML_VERSION_BUILD); $bulkUploadXmlDependency = new KalturaDependency(self::BULK_UPLOAD_XML_PLUGIN_NAME, $bulkUploadXmlVersion); $adCuePointDependency = new KalturaDependency(AdCuePointPlugin::getPluginName()); return array($bulkUploadXmlDependency, $adCuePointDependency); }
/** * Called on the server side and enables you to populate the object with any data from the DB * * @param KalturaDistributionJobData $distributionJobData */ public function __construct(KalturaDistributionJobData $distributionJobData = null) { parent::__construct($distributionJobData); if (!$distributionJobData) { return; } if (!$distributionJobData->distributionProfile instanceof KalturaFreewheelGenericDistributionProfile) { return; } $this->videoAssetFilePaths = new KalturaStringArray(); // loads all the flavor assets that should be submitted to the remote destination site $flavorAssets = assetPeer::retrieveByIds(explode(',', $distributionJobData->entryDistribution->flavorAssetIds)); foreach ($flavorAssets as $flavorAsset) { $videoAssetFilePath = new KalturaString(); $syncKey = $flavorAsset->getSyncKey(flavorAsset::FILE_SYNC_FLAVOR_ASSET_SUB_TYPE_ASSET); $videoAssetFilePath->value = kFileSyncUtils::getLocalFilePathForKey($syncKey, false); $this->videoAssetFilePaths[] = $videoAssetFilePath; } $thumbAssets = assetPeer::retrieveByIds(explode(',', $distributionJobData->entryDistribution->thumbAssetIds)); if (count($thumbAssets)) { $thumbAsset = reset($thumbAssets); $syncKey = $thumbAssets->getSyncKey(thumbAsset::FILE_SYNC_FLAVOR_ASSET_SUB_TYPE_ASSET); $this->thumbAssetFilePath = kFileSyncUtils::getLocalFilePathForKey($syncKey, false); } // entry cue points $c = KalturaCriteria::create(CuePointPeer::OM_CLASS); $c->add(CuePointPeer::PARTNER_ID, $distributionJobData->entryDistribution->partnerId); $c->add(CuePointPeer::ENTRY_ID, $distributionJobData->entryDistribution->entryId); $c->add(CuePointPeer::TYPE, AdCuePointPlugin::getCuePointTypeCoreValue(AdCuePointType::AD)); $c->addAscendingOrderByColumn(CuePointPeer::START_TIME); $cuePointsDb = CuePointPeer::doSelect($c); $this->cuePoints = KalturaCuePointArray::fromDbArray($cuePointsDb); }
/** * @param $partnerId * @param $entryId */ protected function getCuePoints($partnerId, $entryId) { $c = KalturaCriteria::create(CuePointPeer::OM_CLASS); $c->add(CuePointPeer::PARTNER_ID, $partnerId); $c->add(CuePointPeer::ENTRY_ID, $entryId); $c->add(CuePointPeer::TYPE, AdCuePointPlugin::getCuePointTypeCoreValue(AdCuePointType::AD)); $c->addAscendingOrderByColumn(CuePointPeer::START_TIME); return CuePointPeer::doSelect($c); }
/** * Called on the server side and enables you to populate the object with any data from the DB * * @param KalturaDistributionJobData $distributionJobData */ public function __construct(KalturaDistributionJobData $distributionJobData = null) { parent::__construct($distributionJobData); if (!$distributionJobData) { return; } if (!$distributionJobData->distributionProfile instanceof KalturaHuluDistributionProfile) { return; } // loads all the flavor assets that should be submitted to the remote destination site $flavorAssets = assetPeer::retrieveByIds(explode(',', $distributionJobData->entryDistribution->flavorAssetIds)); if (count($flavorAssets)) { $flavorAsset = reset($flavorAssets); $syncKey = $flavorAsset->getSyncKey(flavorAsset::FILE_SYNC_FLAVOR_ASSET_SUB_TYPE_ASSET); $this->videoAssetFilePath = kFileSyncUtils::getLocalFilePathForKey($syncKey, false); } $thumbAssets = assetPeer::retrieveByIds(explode(',', $distributionJobData->entryDistribution->thumbAssetIds)); if (count($thumbAssets)) { $thumbAsset = reset($thumbAssets); $syncKey = $thumbAsset->getSyncKey(thumbAsset::FILE_SYNC_FLAVOR_ASSET_SUB_TYPE_ASSET); $this->thumbAssetFilePath = kFileSyncUtils::getLocalFilePathForKey($syncKey, false); } $additionalAssets = assetPeer::retrieveByIds(explode(',', $distributionJobData->entryDistribution->assetIds)); $this->captionLocalPaths = new KalturaStringArray(); if (count($additionalAssets)) { $captionAssetFilePathArray = array(); foreach ($additionalAssets as $additionalAsset) { $assetType = $additionalAsset->getType(); $syncKey = $additionalAsset->getSyncKey(CaptionAsset::FILE_SYNC_ASSET_SUB_TYPE_ASSET); if (kFileSyncUtils::fileSync_exists($syncKey)) { if ($assetType == CaptionPlugin::getAssetTypeCoreValue(CaptionAssetType::CAPTION) || $assetType == AttachmentPlugin::getAssetTypeCoreValue(AttachmentAssetType::ATTACHMENT)) { $string = new KalturaString(); $string->value = kFileSyncUtils::getLocalFilePathForKey($syncKey, false); $this->captionLocalPaths[] = $string; } } } } $tempFieldValues = unserialize($this->fieldValues); $pattern = '/[^A-Za-z0-9_\\-]/'; $seriesTitle = preg_replace($pattern, '', $tempFieldValues[HuluDistributionField::SERIES_TITLE]); $seasonNumber = preg_replace($pattern, '', $tempFieldValues[HuluDistributionField::SEASON_NUMBER]); $videoEpisodeNumber = preg_replace($pattern, '', $tempFieldValues[HuluDistributionField::VIDEO_EPISODE_NUMBER]); $videoTitle = preg_replace($pattern, '', $tempFieldValues[HuluDistributionField::VIDEO_TITLE]); $this->fileBaseName = $seriesTitle . '-' . $seasonNumber . '-' . $videoEpisodeNumber . '-' . $videoTitle; // entry cue points $c = KalturaCriteria::create(CuePointPeer::OM_CLASS); $c->add(CuePointPeer::PARTNER_ID, $distributionJobData->entryDistribution->partnerId); $c->add(CuePointPeer::ENTRY_ID, $distributionJobData->entryDistribution->entryId); $c->add(CuePointPeer::TYPE, AdCuePointPlugin::getCuePointTypeCoreValue(AdCuePointType::AD)); $c->addAscendingOrderByColumn(CuePointPeer::START_TIME); $cuePointsDb = CuePointPeer::doSelect($c); $this->cuePoints = KalturaCuePointArray::fromDbArray($cuePointsDb); }
public function getTypeListResponse(KalturaFilterPager $pager, KalturaDetachedResponseProfile $responseProfile = null, $type = null) { return parent::getTypeListResponse($pager, $responseProfile, AdCuePointPlugin::getCuePointTypeCoreValue(AdCuePointType::AD)); }
/** * Applies default values to this object. * This method should be called from the object's constructor (or equivalent initialization method). * @see __construct() */ public function applyDefaultValues() { $this->setType(AdCuePointPlugin::getCuePointTypeCoreValue(AdCuePointType::AD)); }
public function __construct() { $this->cuePointType = AdCuePointPlugin::getApiValue(AdCuePointType::AD); }