/**
  * @param $entry
  * @param $syndicationFeed
  * @return string
  */
 private static function getMrssEntryXml(entry $entry, syndicationFeed $syndicationFeed = null, $link = null)
 {
     $mrss = kMrssManager::getEntryMrssXml($entry, null, $link, $syndicationFeed->getFlavorParamId());
     if (!$mrss) {
         KalturaLog::err("No MRSS returned for entry [" . $entry->getId() . "]");
         return null;
     }
     $uiconfId = $syndicationFeed->getPlayerUiconfId ? '/ui_conf_id/' . $syndicationFeed->getPlayerUiconfId : '';
     $playerUrl = 'http://' . kConf::get('www_host') . '/kwidget/wid/_' . $entry->getPartnerId() . '/entry_id/' . $entry->getId() . $syndicationFeed->getPlayerUiconfId();
     $player = $mrss->addChild('player');
     $player->addAttribute('url', $playerUrl);
     return $mrss->asXML();
 }
 private function getFlavorAssetUrl($kalturaEntry)
 {
     $partner = PartnerPeer::retrieveByPK($this->syndicationFeed->partnerId);
     if (!$partner) {
         return null;
     }
     $flavorAsset = assetPeer::retrieveByEntryIdAndParams($kalturaEntry->id, $this->syndicationFeed->flavorParamId);
     if (!$flavorAsset) {
         return null;
     }
     $syncKey = $flavorAsset->getSyncKey(flavorAsset::FILE_SYNC_FLAVOR_ASSET_SUB_TYPE_ASSET);
     $externalStorageUrl = $this->getExternalStorageUrl($partner, $flavorAsset, $syncKey);
     if ($externalStorageUrl) {
         return $externalStorageUrl;
     }
     if ($partner->getStorageServePriority() == StorageProfile::STORAGE_SERVE_PRIORITY_EXTERNAL_ONLY) {
         return null;
     }
     if ($this->syndicationFeedDb->getServePlayManifest()) {
         $cdnHost = requestUtils::getApiCdnHost();
         $clientTag = 'feed:' . $this->syndicationFeedDb->getId();
         $url = $cdnHost . $flavorAsset->getPlayManifestUrl($clientTag);
     } else {
         $urlManager = DeliveryProfilePeer::getDeliveryProfile($flavorAsset->getEntryId());
         $urlManager->initDeliveryDynamicAttributes(null, $flavorAsset);
         $url = "http://" . $urlManager->getFullAssetUrl($flavorAsset);
     }
     return $url;
 }
 private function getFlavorAssetUrl($kalturaEntry)
 {
     $partner = PartnerPeer::retrieveByPK($this->syndicationFeed->partnerId);
     if (!$partner) {
         return null;
     }
     $flavorAsset = assetPeer::retrieveByEntryIdAndParams($kalturaEntry->id, $this->syndicationFeed->flavorParamId);
     if (!$flavorAsset) {
         return null;
     }
     $syncKey = $flavorAsset->getSyncKey(flavorAsset::FILE_SYNC_FLAVOR_ASSET_SUB_TYPE_ASSET);
     $externalStorageUrl = $this->getExternalStorageUrl($partner, $flavorAsset, $syncKey);
     if ($externalStorageUrl) {
         return $externalStorageUrl;
     }
     if ($partner->getStorageServePriority() == StorageProfile::STORAGE_SERVE_PRIORITY_EXTERNAL_ONLY) {
         return null;
     }
     if ($this->syndicationFeedDb->getServePlayManifest()) {
         $shouldAddKtToken = false;
         if ($this->syndicationFeed->type == KalturaSyndicationFeedType::ITUNES) {
             $entry = $flavorAsset->getentry();
             $accessControl = $entry->getaccessControl();
             if ($accessControl && $accessControl->hasRules()) {
                 $shouldAddKtToken = true;
             }
         }
         $cdnHost = requestUtils::getApiCdnHost();
         $clientTag = 'feed:' . $this->syndicationFeedDb->getId();
         $url = $cdnHost . $flavorAsset->getPlayManifestUrl($clientTag, null, PlaybackProtocol::HTTP, $shouldAddKtToken);
     } else {
         $urlManager = DeliveryProfilePeer::getDeliveryProfile($flavorAsset->getEntryId());
         $urlManager->initDeliveryDynamicAttributes(null, $flavorAsset);
         $protocol = requestUtils::getProtocol();
         if (!$urlManager->isProtocolSupported($protocol)) {
             $protocol = $protocol == 'http' ? 'https' : 'http';
             if (!$urlManager->isProtocolSupported($protocol)) {
                 $protocol = 'http';
             }
         }
         $url = $protocol . '://' . $urlManager->getFullAssetUrl($flavorAsset);
     }
     return $url;
 }
 /**
  * @param $entry
  * @param $syndicationFeed
  * @return string
  */
 private static function getMrssEntryXml(entry $entry, syndicationFeed $syndicationFeed = null, $link = null)
 {
     if ($syndicationFeed->getMrssParameters()) {
         $mrssParams = clone $syndicationFeed->getMrssParameters();
     } else {
         $mrssParams = new kMrssParameters();
     }
     $mrssParams->setLink($link);
     $mrssParams->setFilterByFlavorParams($syndicationFeed->getFlavorParamId());
     $mrssParams->setIncludePlayerTag(true);
     $mrssParams->setPlayerUiconfId($syndicationFeed->getPlayerUiconfId());
     $mrssParams->setStorageId($syndicationFeed->getStorageId());
     $mrss = kMrssManager::getEntryMrssXml($entry, null, $mrssParams);
     if (!$mrss) {
         KalturaLog::err("No MRSS returned for entry [" . $entry->getId() . "]");
         return null;
     }
     return $mrss->asXML();
 }
 public function setAddXmlHeader($addXmlHeader)
 {
     parent::putInCustomData(self::CUSTOM_DATA_FIELD_ADD_XML_HEADER, $addXmlHeader);
 }
Example #6
0
 /**
  * @param syndicationFeed $syndicationFeed
  */
 protected function syndicationFeedDeleted(syndicationFeed $syndicationFeed)
 {
     if ($syndicationFeed->getType() == syndicationFeedType::KALTURA_XSLT) {
         $this->syncableDeleted($syndicationFeed->getId(), FileSyncObjectType::SYNDICATION_FEED);
     }
 }
 /**
  * Adds an object to the instance pool.
  *
  * Propel keeps cached copies of objects in an instance pool when they are retrieved
  * from the database.  In some cases -- especially when you override doSelect*()
  * methods in your stub classes -- you may need to explicitly add objects
  * to the cache in order to ensure that the same objects are always returned by doSelect*()
  * and retrieveByPK*() calls.
  *
  * @param      syndicationFeed $value A syndicationFeed object.
  * @param      string $key (optional) key to use for instance map (for performance boost if key was already calculated externally).
  */
 public static function addInstanceToPool(syndicationFeed $obj, $key = null)
 {
     if (Propel::isInstancePoolingEnabled()) {
         if ($key === null) {
             $key = (string) $obj->getId();
         }
         if (isset(self::$instances[$key]) || count(self::$instances) < kConf::get('max_num_instances_in_pool')) {
             self::$instances[$key] = $obj;
             kMemoryManager::registerPeer('syndicationFeedPeer');
         }
     }
 }
 /**
  * Adds an object to the instance pool.
  *
  * Propel keeps cached copies of objects in an instance pool when they are retrieved
  * from the database.  In some cases -- especially when you override doSelect*()
  * methods in your stub classes -- you may need to explicitly add objects
  * to the cache in order to ensure that the same objects are always returned by doSelect*()
  * and retrieveByPK*() calls.
  *
  * @param      syndicationFeed $value A syndicationFeed object.
  * @param      string $key (optional) key to use for instance map (for performance boost if key was already calculated externally).
  */
 public static function addInstanceToPool(syndicationFeed $obj, $key = null)
 {
     if (Propel::isInstancePoolingEnabled()) {
         if ($key === null) {
             $key = (string) $obj->getId();
         }
         // if key === null
         self::$instances[$key] = $obj;
     }
 }
Example #9
0
 /**
  * @param $entry
  * @param $syndicationFeed
  * @return string
  */
 private function getMrssEntryXml(entry $entry, syndicationFeed $syndicationFeed = null, $link = null)
 {
     if ($syndicationFeed->getMrssParameters()) {
         $mrssParams = clone $syndicationFeed->getMrssParameters();
     } else {
         $mrssParams = new kMrssParameters();
     }
     $mrssParams->setLink($link);
     $mrssParams->setFilterByFlavorParams($syndicationFeed->getFlavorParamId());
     $mrssParams->setIncludePlayerTag(true);
     $mrssParams->setPlayerUiconfId($syndicationFeed->getPlayerUiconfId());
     $mrssParams->setStorageId($syndicationFeed->getStorageId());
     $mrssParams->setServePlayManifest($syndicationFeed->getServePlayManifest());
     $mrssParams->setPlayManifestClientTag('feed:' . $syndicationFeed->getId());
     $features = null;
     if ($syndicationFeed->getUseCategoryEntries()) {
         KalturaLog::info("Getting entry's associated categories from the category_entry table");
         $features = array(ObjectFeatureType::CATEGORY_ENTRIES);
     }
     $mrss = kMrssManager::getEntryMrssXml($entry, null, $mrssParams, $features);
     if (!$mrss) {
         KalturaLog::err("No MRSS returned for entry [" . $entry->getId() . "]");
         return null;
     }
     return $mrss->asXML();
 }
 public function applyDefaultValues()
 {
     parent::applyDefaultValues();
     $this->setType(syndicationFeedType::KALTURA);
 }