本文整理汇总了PHP中entryFilter类的典型用法代码示例。如果您正苦于以下问题:PHP entryFilter类的具体用法?PHP entryFilter怎么用?PHP entryFilter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了entryFilter类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: setExtraFilters
protected function setExtraFilters(entryFilter &$fields_set)
{
$fields_set->set("_eq_type", entryType::DATA);
$fields_set->set("_eq_status", entryStatus::READY);
// make sure will display only
$this->setP("use_filter_puser_id", "false");
// don't mind filtering according to the puser/kuser
}
开发者ID:richhl,项目名称:kalturaCE,代码行数:8,代码来源:listdataentriesAction.class.php
示例2: getEntryFilter
protected function getEntryFilter($extraData)
{
$entry_filter = new entryFilter();
// This is the old way to search within a partner - allow both
$entry_filter->setByName("_eq_partner_id", $extraData);
// this is the better way -
$entry_filter->setPartnerSearchScope($extraData);
return $entry_filter;
}
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:9,代码来源:myKalturaPartnerServices.class.php
示例3: setExtraFilters
protected function setExtraFilters(entryFilter &$fields_set)
{
if (intval($fields_set->get("_in_moderation_status")) == moderation::MODERATION_STATUS_APPROVED) {
$fields_set->set("_in_moderation_status", array(moderation::MODERATION_STATUS_APPROVED, moderation::MODERATION_STATUS_AUTO_APPROVED));
}
$fields_set->set("_eq_type", entryType::PLAYLIST);
$fields_set->set("_eq_status", entryStatus::READY);
// make sure will display only
$this->setP("use_filter_puser_id", "false");
// don't mind filtering according to the puser/kuser
}
开发者ID:DBezemer,项目名称:server,代码行数:11,代码来源:listplaylistsAction.class.php
示例4: executeImpl
public function executeImpl($partner_id, $subp_id, $puser_id, $partner_prefix, $puser_kuser, $create_cachekey = false)
{
myDbHelper::$use_alternative_con = myDbHelper::DB_HELPER_CONN_PROPEL3;
// TODO - verify permissions for viewing lists
$detailed = $this->getP("detailed", false);
$limit = $this->getP("page_size", 10);
$limit = $this->maxPageSize($limit);
$page = $this->getP("page", 1);
$user_filter_prefix = $this->getP("fp", "filter");
$offset = ($page - 1) * $limit;
// TODO - should limit search to partner ??
// kuserPeer::setUseCriteriaFilter( false );
// entryPeer::setUseCriteriaFilter( false );
$playlist_id = $this->getPM("playlist_id");
$input_params = $this->getInputParams();
$extra_filters = array();
for ($i = 1; $i < self::MAX_FILTER_COUNT; $i++) {
// filter
$extra_filter = new entryFilter();
$fields_set = $extra_filter->fillObjectFromRequest($input_params, "{$user_filter_prefix}{$i}_", null);
if ($fields_set) {
$extra_filters[$i] = $extra_filter;
}
}
// this service is executed twice! (first time for the cache key, second time for the execution)
if (is_null($this->playlist)) {
$playlist = entryPeer::retrieveByPK($playlist_id);
if (!$playlist) {
throw new APIException(APIErrors::INVALID_ENTRY_ID, "Playlist", $playlist_id);
}
myPartnerUtils::addPartnerToCriteria(new accessControlPeer(), $playlist->getPartnerId(), $this->getPrivatePartnerData(), $this->partnerGroup2(), null);
$this->playlist = $playlist;
}
if ($create_cachekey) {
if ($this->isAdmin()) {
return null;
}
$cache_key_arr = array("playlist_id" => $playlist_id, "filters" => $extra_filters);
$cahce_key = new executionCacheKey();
$cahce_key->expiry = 600;
$cahce_key->key = md5(print_r($cache_key_arr, true));
return $cahce_key;
}
if ($this->isAdmin()) {
myPlaylistUtils::setIsAdminKs(true);
}
$entry_list = myPlaylistUtils::executePlaylistById($partner_id, $playlist_id, $extra_filters, $detailed);
myEntryUtils::updatePuserIdsForEntries($entry_list);
$level = $detailed ? objectWrapperBase::DETAIL_LEVEL_DETAILED : objectWrapperBase::DETAIL_LEVEL_REGULAR;
$wrapper = objectWrapperBase::getWrapperClass($entry_list, $level);
$this->addMsg("count", count($entry_list));
$this->addMsg($this->getObjectPrefix(), $wrapper);
}
开发者ID:richhl,项目名称:kalturaCE,代码行数:53,代码来源:executeplaylistAction.class.php
示例5: resolveEntryTag
function resolveEntryTag(Tag $tag)
{
$c = KalturaCriteria::create(entryPeer::OM_CLASS);
$c->add(entryPeer::PARTNER_ID, $tag->getPartnerId());
if ($tag->getPrivacyContext() != kTagFlowManager::NULL_PC) {
$c->addAnd(entryPeer::PRIVACY_BY_CONTEXTS, $tag->getPrivacyContext(), Criteria::LIKE);
}
$entryFilter = new entryFilter();
$entryFilter->set('_mlikeand_tags', $tag->getTag());
$entryFilter->attachToCriteria($c);
$count = $c->getRecordsCount();
if (!$count) {
$tag->delete();
}
}
开发者ID:DBezemer,项目名称:server,代码行数:15,代码来源:resolveTags.php
示例6: applyCondition
public function applyCondition(IKalturaDbQuery $query)
{
if (is_null($this->categoriesMatchOr) && is_null($this->categoryIdEqual)) {
return;
}
// Fetch the list of categories
$categoryEntries = null;
if ($this->categoriesMatchOr) {
$categoryEntries = entryFilter::categoryFullNamesToIdsParsed($this->categoriesMatchOr, $this->categoryEntryStatusIn);
} else {
$categoryEntries = entryFilter::categoryIdsToSphinxIds($this->categoryIdEqual, $this->categoryEntryStatusIn);
}
if ($categoryEntries == '') {
// Set a non-exiting cat. id. in order to return empty results (instead of throwing an exception)
$categoryEntries = category::CATEGORY_ID_THAT_DOES_NOT_EXIST;
}
$categoryEntries = explode(',', $categoryEntries);
$query->addColumnWhere(entryPeer::CATEGORIES_IDS, $categoryEntries, KalturaCriteria::IN_LIKE);
if ($this->orderBy) {
$orderByField = substr($this->orderBy, 1);
$orderBy = $this->orderBy[0] == '+' ? Criteria::ASC : Criteria::DESC;
if ($orderByField != self::CREATED_AT) {
throw new kCoreException("Unsupported orderBy criteria [{$orderByField}]");
}
$dynAttribCriteriaFieldName = entryIndex::DYNAMIC_ATTRIBUTES . '.' . self::getCategoryCreatedAtDynamicAttributeName($this->categoryIdEqual);
$query->addNumericOrderBy($dynAttribCriteriaFieldName, $orderBy);
}
}
开发者ID:AdiTal,项目名称:server,代码行数:28,代码来源:kCategoryEntryAdvancedFilter.php
示例7: executeImpl
public function executeImpl($partner_id, $subp_id, $puser_id, $partner_prefix, $puser_kuser)
{
// TODO - verify permissions for viewing lists
$detailed = $this->getP("detailed", false);
if (!$detailed) {
$detailed = false;
}
$limit = $this->getP("page_size", 10);
$limit = $this->maxPageSize($limit);
$page = $this->getP("page", 1);
$user_filter_prefix = $this->getP("fp", "filter");
$offset = ($page - 1) * $limit;
// TODO - should limit search to partner ??
// kuserPeer::setUseCriteriaFilter( false );
// entryPeer::setUseCriteriaFilter( false );
$input_params = $this->getInputParams();
// fill the playlist (infact only the mediaType and contentData are important
$playlist = new entry();
$playlist->setType(entryType::PLAYLIST);
// prepare the playlist type before filling from request
$obj_wrapper = objectWrapperBase::getWrapperClass($playlist, 0);
$playlist->setMediaType($this->getP("playlist_mediaType"));
$data_content = $this->getP("playlist_dataContent");
$playlist->setDataContent($data_content);
/*
$updateable_fields = $obj_wrapper->getUpdateableFields() ;
$fields_modified = baseObjectUtils::fillObjectFromMapOrderedByFields( $input_params , $playlist , "playlist_" ,
$updateable_fields , BasePeer::TYPE_PHPNAME ,false );
*/
// rest is similar to the executeplaylist service
$extra_filters = array();
for ($i = 1; $i < self::MAX_FILTER_COUNT; $i++) {
// filter
$extra_filter = new entryFilter();
$fields_set = $extra_filter->fillObjectFromRequest($input_params, "{$user_filter_prefix}{$i}_", null);
$extra_filters[$i] = $extra_filter;
}
$entry_list = myPlaylistUtils::executePlaylist($partner_id, $playlist, $extra_filters, $detailed);
myEntryUtils::updatePuserIdsForEntries($entry_list);
$level = $detailed ? objectWrapperBase::DETAIL_LEVEL_DETAILED : objectWrapperBase::DETAIL_LEVEL_REGULAR;
$wrapper = objectWrapperBase::getWrapperClass($entry_list, $level);
$this->addMsg("count", count($entry_list));
$this->addMsg($this->getObjectPrefix(), $wrapper);
}
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:44,代码来源:executeplaylistfromcontentAction.class.php
示例8: postInsert
public function postInsert(PropelPDO $con = null)
{
parent::postInsert($con);
if (!$this->getFeedId() || !$this->getId()) {
return;
}
$syndicationFeed = syndicationFeedPeer::retrieveByPK($this->getFeedId());
if (!$syndicationFeed || !$syndicationFeed instanceof genericSyndicationFeed) {
return;
}
// "Creates advanced filter on distribution profile
$distributionAdvancedSearch = new ContentDistributionSearchFilter();
$distributionAdvancedSearch->setDistributionProfileId($this->getId());
$distributionAdvancedSearch->setDistributionSunStatus(EntryDistributionSunStatus::AFTER_SUNRISE);
$distributionAdvancedSearch->setEntryDistributionStatus(EntryDistributionStatus::READY);
$distributionAdvancedSearch->setEntryDistributionFlag(EntryDistributionDirtyStatus::NONE);
//Creates entry filter with advanced filter
$entryFilter = new entryFilter();
$entryFilter->setPartnerIdEquel($this->getPartnerId());
$entryFilter->setAdvancedSearch($distributionAdvancedSearch);
// Creates playlist with entry filter
$playlistXml = new SimpleXMLElement("<playlist/>");
$filtersXml = $playlistXml->addChild("filters");
$filterXml = $filtersXml->addChild("filter");
$entryFilter->toXml($filterXml);
$playlistContent = $playlistXml->asXML();
// creates playlist based on the filter XML
$playlist = new entry();
$playlist->setKuserId(kCurrentContext::$uid);
$playlist->setCreatorKuserId(kCurrentContext::$uid);
$playlist->setDisplayInSearch(mySearchUtils::DISPLAY_IN_SEARCH_SYSTEM);
$playlist->setPartnerId($this->getPartnerId());
$playlist->setStatus(entryStatus::READY);
$playlist->setKshowId(null);
$playlist->setType(entryType::PLAYLIST);
$playlist->setMediaType(entry::ENTRY_MEDIA_TYPE_XML);
$playlist->setDataContent($playlistContent);
$playlist->save();
KalturaLog::log("Playlist [" . $playlist->getId() . "] created");
// creates feed based on the playlist
$syndicationFeed->setPlaylistId($playlist->getId());
$syndicationFeed->save();
}
开发者ID:DBezemer,项目名称:server,代码行数:43,代码来源:SyndicationDistributionProfile.php
示例9: apply
public function apply(baseObjectFilter $filter, IKalturaDbQuery $query)
{
if (is_null($this->categoriesMatchOr) || is_null($this->categoryEntryStatusIn)) {
return;
}
$categoriesTocategoryEntryStatus = entryFilter::categoryFullNamesToIdsParsed($this->categoriesMatchOr, $this->categoryEntryStatusIn);
if ($categoriesTocategoryEntryStatus == '') {
$categoriesTocategoryEntryStatus = category::CATEGORY_ID_THAT_DOES_NOT_EXIST;
}
$query->addColumnWhere(entryPeer::CATEGORIES_IDS, explode(',', $categoriesTocategoryEntryStatus), kalturaCriteria::IN_LIKE);
}
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:11,代码来源:kCategoryEntryAdvancedFilter.php
示例10: getFeedAction
/**
* @action getFeed
* @disableTags TAG_WIDGET_SESSION,TAG_ENTITLEMENT_ENTRY,TAG_ENTITLEMENT_CATEGORY
* @param int $distributionProfileId
* @param string $hash
* @return file
*/
public function getFeedAction($distributionProfileId, $hash)
{
if (!$this->getPartnerId() || !$this->getPartner()) {
throw new KalturaAPIException(KalturaErrors::INVALID_PARTNER_ID, $this->getPartnerId());
}
$profile = DistributionProfilePeer::retrieveByPK($distributionProfileId);
if (!$profile || !$profile instanceof SynacorHboDistributionProfile) {
throw new KalturaAPIException(ContentDistributionErrors::DISTRIBUTION_PROFILE_NOT_FOUND, $distributionProfileId);
}
if ($profile->getStatus() != KalturaDistributionProfileStatus::ENABLED) {
throw new KalturaAPIException(ContentDistributionErrors::DISTRIBUTION_PROFILE_DISABLED, $distributionProfileId);
}
if ($profile->getUniqueHashForFeedUrl() != $hash) {
throw new KalturaAPIException(SynacorHboDistributionErrors::INVALID_FEED_URL);
}
// "Creates advanced filter on distribution profile
$distributionAdvancedSearch = new ContentDistributionSearchFilter();
$distributionAdvancedSearch->setDistributionProfileId($profile->getId());
$distributionAdvancedSearch->setDistributionSunStatus(EntryDistributionSunStatus::AFTER_SUNRISE);
$distributionAdvancedSearch->setEntryDistributionStatus(EntryDistributionStatus::READY);
$distributionAdvancedSearch->setEntryDistributionFlag(EntryDistributionDirtyStatus::NONE);
$distributionAdvancedSearch->setHasEntryDistributionValidationErrors(false);
//Creates entry filter with advanced filter
$entryFilter = new entryFilter();
$entryFilter->setStatusEquel(entryStatus::READY);
$entryFilter->setModerationStatusNot(entry::ENTRY_MODERATION_STATUS_REJECTED);
$entryFilter->setPartnerSearchScope($this->getPartnerId());
$entryFilter->setAdvancedSearch($distributionAdvancedSearch);
$baseCriteria = KalturaCriteria::create(entryPeer::OM_CLASS);
$baseCriteria->add(entryPeer::DISPLAY_IN_SEARCH, mySearchUtils::DISPLAY_IN_SEARCH_SYSTEM, Criteria::NOT_EQUAL);
$entryFilter->attachToCriteria($baseCriteria);
$entries = entryPeer::doSelect($baseCriteria);
$feed = new SynacorHboFeed('synacor_hbo_feed_template.xml');
$feed->setDistributionProfile($profile);
$counter = 0;
foreach ($entries as $entry) {
/* @var $entry entry */
$entryDistribution = EntryDistributionPeer::retrieveByEntryAndProfileId($entry->getId(), $profile->getId());
if (!$entryDistribution) {
KalturaLog::err('Entry distribution was not found for entry [' . $entry->getId() . '] and profile [' . $profile->getId() . ']');
continue;
}
$fields = $profile->getAllFieldValues($entryDistribution);
$flavorAssets = assetPeer::retrieveByIds(explode(',', $entryDistribution->getFlavorAssetIds()));
$thumbAssets = assetPeer::retrieveByIds(explode(',', $entryDistribution->getThumbAssetIds()));
$additionalAssets = assetPeer::retrieveByIds(explode(',', $entryDistribution->getAssetIds()));
$feed->addItem($fields, $entry, $flavorAssets, $thumbAssets, $additionalAssets);
$counter++;
//to avoid the cache exceeding the memory size
if ($counter >= 100) {
kMemoryManager::clearMemory();
$counter = 0;
}
}
header('Content-Type: text/xml');
echo $feed->getXml();
die;
}
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:65,代码来源:SynacorHboService.php
示例11: getFeedAction
/**
* @action getFeed
* @disableTags TAG_WIDGET_SESSION,TAG_ENTITLEMENT_ENTRY,TAG_ENTITLEMENT_CATEGORY
* @param int $distributionProfileId
* @param string $hash
* @return file
*/
public function getFeedAction($distributionProfileId, $hash)
{
if (!$this->getPartnerId() || !$this->getPartner()) {
throw new KalturaAPIException(KalturaErrors::INVALID_PARTNER_ID, $this->getPartnerId());
}
$profile = DistributionProfilePeer::retrieveByPK($distributionProfileId);
if (!$profile || !$profile instanceof UverseDistributionProfile) {
throw new KalturaAPIException(ContentDistributionErrors::DISTRIBUTION_PROFILE_NOT_FOUND, $distributionProfileId);
}
if ($profile->getStatus() != KalturaDistributionProfileStatus::ENABLED) {
throw new KalturaAPIException(ContentDistributionErrors::DISTRIBUTION_PROFILE_DISABLED, $distributionProfileId);
}
if ($profile->getUniqueHashForFeedUrl() != $hash) {
throw new KalturaAPIException(UverseDistributionErrors::INVALID_FEED_URL);
}
// "Creates advanced filter on distribution profile
$distributionAdvancedSearch = new ContentDistributionSearchFilter();
$distributionAdvancedSearch->setDistributionProfileId($profile->getId());
$distributionAdvancedSearch->setDistributionSunStatus(EntryDistributionSunStatus::AFTER_SUNRISE);
$distributionAdvancedSearch->setEntryDistributionStatus(EntryDistributionStatus::READY);
$distributionAdvancedSearch->setHasEntryDistributionValidationErrors(false);
//Creates entry filter with advanced filter
$entryFilter = new entryFilter();
$entryFilter->setStatusEquel(entryStatus::READY);
$entryFilter->setModerationStatusNot(entry::ENTRY_MODERATION_STATUS_REJECTED);
$entryFilter->setPartnerSearchScope($this->getPartnerId());
$entryFilter->setAdvancedSearch($distributionAdvancedSearch);
$baseCriteria = KalturaCriteria::create(entryPeer::OM_CLASS);
$baseCriteria->add(entryPeer::DISPLAY_IN_SEARCH, mySearchUtils::DISPLAY_IN_SEARCH_SYSTEM, Criteria::NOT_EQUAL);
$entryFilter->attachToCriteria($baseCriteria);
$entries = entryPeer::doSelect($baseCriteria);
$feed = new UverseFeed('uverse_template.xml');
$feed->setDistributionProfile($profile);
$feed->setChannelFields();
$lastBuildDate = $profile->getUpdatedAt(null);
foreach ($entries as $entry) {
/* @var $entry entry */
$entryDistribution = EntryDistributionPeer::retrieveByEntryAndProfileId($entry->getId(), $profile->getId());
if (!$entryDistribution) {
KalturaLog::err('Entry distribution was not found for entry [' . $entry->getId() . '] and profile [' . $profile->getId() . ']');
continue;
}
$fields = $profile->getAllFieldValues($entryDistribution);
$flavorAssets = assetPeer::retrieveByIds(explode(',', $entryDistribution->getFlavorAssetIds()));
$flavorAsset = reset($flavorAssets);
$flavorAssetRemoteUrl = $entryDistribution->getFromCustomData(UverseEntryDistributionCustomDataField::REMOTE_ASSET_URL);
$thumbAssets = assetPeer::retrieveByIds(explode(',', $entryDistribution->getThumbAssetIds()));
$feed->addItem($fields, $flavorAsset, $flavorAssetRemoteUrl, $thumbAssets);
// we want to find the newest update time between all entries
if ($entry->getUpdatedAt(null) > $lastBuildDate) {
$lastBuildDate = $entry->getUpdatedAt(null);
}
}
$feed->setChannelLastBuildDate($lastBuildDate);
header('Content-Type: text/xml');
echo $feed->getXml();
die;
}
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:65,代码来源:UverseService.php
示例12: getEntryFilter
protected function getEntryFilter($context, $keepScheduling = true)
{
// "Creates advanced filter on distribution profile
$distributionAdvancedSearch = new ContentDistributionSearchFilter();
$distributionAdvancedSearch->setDistributionProfileId($this->profile->getId());
$distributionAdvancedSearch->setDistributionSunStatus(EntryDistributionSunStatus::AFTER_SUNRISE);
$distributionAdvancedSearch->setEntryDistributionStatus(EntryDistributionStatus::READY);
$distributionAdvancedSearch->setHasEntryDistributionValidationErrors(false);
//Creates entry filter with advanced filter
$entryFilter = new entryFilter();
$entryFilter->setStatusEquel(entryStatus::READY);
$entryFilter->setModerationStatusNot(entry::ENTRY_MODERATION_STATUS_REJECTED);
$entryFilter->setPartnerSearchScope($this->getPartnerId());
$entryFilter->setAdvancedSearch($distributionAdvancedSearch);
return $entryFilter;
}
开发者ID:DBezemer,项目名称:server,代码行数:16,代码来源:UverseService.php
示例13: requestConversionAction
/**
* request conversion for all entries that doesnt have the required flavor param
* returns a comma-separated ids of conversion jobs
*
* @action requestConversion
* @param string $feedId
* @return string
*/
public function requestConversionAction($feedId)
{
// find entry ids that already converted to the flavor
$feedRendererWithTheFlavor = new KalturaSyndicationFeedRenderer($feedId);
$feedRendererWithTheFlavor->addFlavorParamsAttachedFilter();
$entriesWithTheFlavor = $feedRendererWithTheFlavor->getEntriesIds();
// create filter of the entries that not converted
$entryFilter = new entryFilter();
$entryFilter->setIdNotIn($entriesWithTheFlavor);
// create feed with the new filter
$feedRendererToConvert = new KalturaSyndicationFeedRenderer($feedId);
$feedRendererToConvert->addFilter($entryFilter);
$createdJobsIds = array();
$flavorParamsId = $feedRendererToConvert->syndicationFeed->flavorParamId;
while ($entry = $feedRendererToConvert->getNextEntry()) {
$originalFlavorAsset = flavorAssetPeer::retrieveOriginalByEntryId($entry->getId());
if (!is_null($originalFlavorAsset)) {
$err = "";
$job = kBusinessPreConvertDL::decideAddEntryFlavor(null, $entry->getId(), $flavorParamsId, $err);
if ($job && is_object($job)) {
$createdJobsIds[] = $job->getId();
}
}
}
return implode(',', $createdJobsIds);
}
开发者ID:richhl,项目名称:kalturaCE,代码行数:34,代码来源:SyndicationFeedService.php
示例14: setExtraFilters
protected function setExtraFilters(entryFilter &$fields_set)
{
$fields_set->set("_eq_group_id", myPartnerUtils::PARTNER_GROUP);
$fields_set->set("_in_type", entryType::MEDIA_CLIP . "," . entryType::MIX);
}
开发者ID:richhl,项目名称:kalturaCE,代码行数:5,代码来源:listpartnerentriesAction.class.php
示例15: getFeedAction
/**
* @action getFeed
* @disableTags TAG_WIDGET_SESSION,TAG_ENTITLEMENT_ENTRY,TAG_ENTITLEMENT_CATEGORY
* @param int $distributionProfileId
* @param string $hash
* @return file
*/
public function getFeedAction($distributionProfileId, $hash)
{
if (!$this->getPartnerId() || !$this->getPartner()) {
throw new KalturaAPIException(KalturaErrors::INVALID_PARTNER_ID, $this->getPartnerId());
}
$profile = DistributionProfilePeer::retrieveByPK($distributionProfileId);
if (!$profile || !$profile instanceof AttUverseDistributionProfile) {
throw new KalturaAPIException(ContentDistributionErrors::DISTRIBUTION_PROFILE_NOT_FOUND, $distributionProfileId);
}
if ($profile->getStatus() != KalturaDistributionProfileStatus::ENABLED) {
throw new KalturaAPIException(ContentDistributionErrors::DISTRIBUTION_PROFILE_DISABLED, $distributionProfileId);
}
if ($profile->getUniqueHashForFeedUrl() != $hash) {
throw new KalturaAPIException(AttUverseDistributionErrors::INVALID_FEED_URL);
}
// "Creates advanced filter on distribution profile
$distributionAdvancedSearch = new ContentDistributionSearchFilter();
$distributionAdvancedSearch->setDistributionProfileId($profile->getId());
$distributionAdvancedSearch->setDistributionSunStatus(EntryDistributionSunStatus::AFTER_SUNRISE);
$distributionAdvancedSearch->setEntryDistributionStatus(EntryDistributionStatus::READY);
$distributionAdvancedSearch->setEntryDistributionFlag(EntryDistributionDirtyStatus::NONE);
$distributionAdvancedSearch->setHasEntryDistributionValidationErrors(false);
//Creates entry filter with advanced filter
$entryFilter = new entryFilter();
$entryFilter->setStatusEquel(entryStatus::READY);
$entryFilter->setModerationStatusNot(entry::ENTRY_MODERATION_STATUS_REJECTED);
$entryFilter->setPartnerSearchScope($this->getPartnerId());
$entryFilter->setAdvancedSearch($distributionAdvancedSearch);
$baseCriteria = KalturaCriteria::create(entryPeer::OM_CLASS);
$baseCriteria->add(entryPeer::DISPLAY_IN_SEARCH, mySearchUtils::DISPLAY_IN_SEARCH_SYSTEM, Criteria::NOT_EQUAL);
$entryFilter->attachToCriteria($baseCriteria);
$entries = entryPeer::doSelect($baseCriteria);
$feed = new AttUverseDistributionFeedHelper('feed_template.xml', $profile);
$channelTitle = $profile->getChannelTitle();
$counter = 0;
foreach ($entries as $entry) {
/* @var $entry entry */
/* @var $entryDistribution Entrydistribution */
$entryDistribution = EntryDistributionPeer::retrieveByEntryAndProfileId($entry->getId(), $profile->getId());
if (!$entryDistribution) {
KalturaLog::err('Entry distribution was not found for entry [' . $entry->getId() . '] and profile [' . $profile->getId() . ']');
continue;
}
$fields = $profile->getAllFieldValues($entryDistribution);
//flavors assets and remote flavor asset file urls
$flavorAssets = assetPeer::retrieveByIds(explode(',', $entryDistribution->getFromCustomData(AttUverseEntryDistributionCustomDataField::DISTRIBUTED_FLAVOR_IDS)));
$remoteAssetFileUrls = unserialize($entryDistribution->getFromCustomData(AttUverseEntryDistributionCustomDataField::REMOTE_ASSET_FILE_URLS));
//thumb assets and remote thumb asset file urls
$thumbAssets = assetPeer::retrieveByIds(explode(',', $entryDistribution->getFromCustomData(AttUverseEntryDistributionCustomDataField::DISTRIBUTED_THUMBNAIL_IDS)));
$remoteThumbailFileUrls = unserialize($entryDistribution->getFromCustomData(AttUverseEntryDistributionCustomDataField::REMOTE_THUMBNAIL_FILE_URLS));
//thumb assets and remote thumb asset file urls
$captionAssets = assetPeer::retrieveByIds(explode(',', $entryDistribution->getFromCustomData(AttUverseEntryDistributionCustomDataField::DISTRIBUTED_CAPTION_IDS)));
$feed->addItem($fields, $flavorAssets, $remoteAssetFileUrls, $thumbAssets, $remoteThumbailFileUrls, $captionAssets);
$counter++;
//to avoid the cache exceeding the memory size
if ($counter >= 100) {
kMemoryManager::clearMemory();
$counter = 0;
}
}
//set channel title
if (isset($fields)) {
$channelTitle = $fields[AttUverseDistributionField::CHANNEL_TITLE];
}
$feed->setChannelTitle($channelTitle);
header('Content-Type: text/xml');
echo str_replace('&', '&', html_entity_decode($feed->getXml(), ENT_QUOTES, 'UTF-8'));
die;
}
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:76,代码来源:AttUverseService.php
示例16: array
/**
return array('status' => $status, 'message' => $message, 'objects' => $objects);
objects - array of
'thumb'
'title'
'description'
'id' - unique id to be passed to getMediaInfo
*/
public function searchMedia($media_type, $searchText, $page, $pageSize, $authData = null, $extraData = null)
{
$page_size = $pageSize > 20 ? 20 : $pageSize;
$page--;
if ($page < 0) {
$page = 0;
}
$status = "ok";
$message = '';
$objects = array();
$should_serach = true;
if (defined("KALTURA_API_V3")) {
$kuser = kuserPeer::getKuserByPartnerAndUid(self::$partner_id, self::$puser_id);
$should_serach = true;
$kuser_id = $kuser->getId();
} else {
$puser_kuser = PuserKuserPeer::retrieveByPartnerAndUid(self::$partner_id, self::$subp_id, self::$puser_id, true);
if (!$puser_kuser) {
// very bad - does not exist in system
$should_serach = false;
} else {
$kuser = $puser_kuser->getKuser();
if (!$kuser) {
$should_serach = false;
} else {
$kuser_id = $kuser->getId();
}
}
}
// echo "[" . self::$partner_id . "],[". self::$subp_id . "],[" . self::$puser_id . "],[$kuser_id]";
if ($should_serach) {
$c = KalturaCriteria::create(entryPeer::OM_CLASS);
$c->add(entryPeer::KUSER_ID, $kuser_id);
$c->add(entryPeer::MEDIA_TYPE, $media_type);
$c->add(entryPeer::TYPE, entryType::MEDIA_CLIP);
// $keywords_array = mySearchUtils::getKeywordsFromStr ( $searchText );
$filter = new entryFilter();
$filter->setPartnerSearchScope(self::$partner_id);
$filter->addSearchMatchToCriteria($c, $searchText, entry::getSearchableColumnName());
$c->setLimit($pageSize);
$c->setOffset($page * $pageSize);
$entry_results = entryPeer::doSelect($c);
//JoinAll( $c );
$number_of_results = $c->getRecordsCount();
$number_of_pages = (int) ($number_of_results / $pageSize);
if ($number_of_results % $pageSize != 0) {
$number_of_pages += 1;
}
// if there are some left-overs - there must be a nother page
// add thumbs when not image or video
$should_add_thumbs = $media_type != entry::ENTRY_MEDIA_TYPE_AUDIO;
foreach ($entry_results as $entry) {
// send the id as the url
$object = array("id" => $entry->getId(), "url" => $entry->getDataUrl(), "tags" => $entry->getTags(), "title" => $entry->getName(), "description" => $entry->getDescription());
if ($should_add_thumbs) {
$object["thumb"] = $entry->getThumbnailUrl();
}
$objects[] = $object;
}
}
return array('status' => $status, 'message' => $message, 'objects' => $objects, "needMediaInfo" => self::$NEED_MEDIA_INFO);
}
开发者ID:richhl,项目名称:kalturaCE,代码行数:70,代码来源:myKalturaUserClipsServices.class.php
示例17: hasWidevineFlavorAssetsWithSameWvAssetIdInOtherEntries
private function hasWidevineFlavorAssetsWithSameWvAssetIdInOtherEntries($wvAssetId, $entryId)
{
$entryFilter = new entryFilter();
$entryFilter->fields['_like_plugins_data'] = WidevinePlugin::getWidevineAssetIdSearchData($wvAssetId);
$entryFilter->setPartnerSearchScope(baseObjectFilter::MATCH_KALTURA_NETWORK_AND_PRIVATE);
$c = KalturaCriteria::create(entryPeer::OM_CLASS);
$entryFilter->attachToCriteria($c);
$c->add(entryPeer::ID, $entryId, Criteria::NOT_EQUAL);
$c->applyFilters();
$entriesCount = $c->getRecordsCount();
if ($entriesCount) {
KalturaLog::debug('Found active flavors for WV asset id [' . $wvAssetId . ']');
return true;
} else {
return false;
}
}
开发者ID:kubrickfr,项目名称:server,代码行数:17,代码来源:kWidevineEventsConsumer.php
示例18: authenticateAction
/**
* Authenticate live-stream entry against stream token and partner limitations
*
* @action authenticate
* @param string $entryId Live stream entry id
* @param string $token Live stream broadcasting token
* @return KalturaLiveStreamEntry The authenticated live stream entry
*
* @throws KalturaErrors::ENTRY_ID_NOT_FOUND
* @throws KalturaErrors::LIVE_STREAM_INVALID_TOKEN
*/
function authenticateAction($entryId, $token)
{
$dbEntry = entryPeer::retrieveByPK($entryId);
if (!$dbEntry || $dbEntry->getType() != entryType::LIVE_STREAM) {
throw new KalturaAPIException(KalturaErrors::ENTRY_ID_NOT_FOUND, $entryId);
}
/* @var $dbEntry LiveStreamEntry */
if ($dbEntry->getStreamPassword() != $token) {
throw new KalturaAPIException(KalturaErrors::LIVE_STREAM_INVALID_TOKEN, $entryId);
}
$mediaServer = $dbEntry->getMediaServer(true);
if ($mediaServer) {
$url = null;
$protocol = null;
foreach (array(KalturaPlaybackProtocol::HLS, KalturaPlaybackProtocol::APPLE_HTTP) as $hlsProtocol) {
$config = $dbEntry->getLiveStreamConfigurationByProtocol($hlsProtocol, requestUtils::PROTOCOL_HTTP, null, true);
if ($config) {
$url = $config->getUrl();
$protocol = $hlsProtocol;
break;
}
}
if ($url) {
KalturaLog::info('Determining status of live stream URL [' . $url . ']');
$dpda = new DeliveryProfileDynamicAttributes();
$dpda->setEntryId($entryId);
$dpda->setFormat($protocol);
$deliveryProfile = DeliveryProfilePeer::getLiveDeliveryProfileByHostName(parse_url($url, PHP_URL_HOST), $dpda);
if ($deliveryProfile && $deliveryProfile->isLive($url)) {
throw new KalturaAPIException(KalturaErrors::LIVE_STREAM_ALREADY_BROADCASTING, $entryId, $mediaServer->getHostname());
}
}
}
// fetch current stream live params
$liveParamsIds = flavorParamsConversionProfilePeer::getFlavorIdsByProfileId($dbEntry->getConversionProfileId());
$usedLiveParamsIds = array();
foreach ($liveParamsIds as $liveParamsId) {
$usedLiveParamsIds[$liveParamsId] = array($entryId);
}
// fetch all live entries that currently are live
$baseCriteria = KalturaCriteria::create(entryPeer::OM_CLASS);
$filter = new entryFilter();
$filter->setIsLive(true);
$filter->setIdNotIn(array($entryId));
$filter->setPartnerSearchScope(baseObjectFilter::MATCH_KALTURA_NETWORK_AND_PRIVATE);
$filter->attachToCriteria($baseCriteria);
$entries = entryPeer::doSelect($baseCriteria);
$maxInputStreams = $this->getPartner()->getMaxLiveStreamInputs();
if (!$maxInputStreams) {
$maxInputStreams = kConf::get('partner_max_live_stream_inputs', 'local', 10);
}
KalturaLog::debug("Max live stream inputs [{$maxInputStreams}]");
$maxTranscodedStreams = 0;
if (PermissionPeer::isValidForPartner(PermissionName::FEATURE_KALTURA_LIVE_STREAM_TRANSCODE, $this->getPartnerId())) {
$maxTranscodedStreams = $this->getPartner()->getMaxLiveStreamOutputs();
if (!$maxTranscodedStreams) {
$maxTranscodedStreams = kConf::get('partner_max_live_stream_outputs', 'local', 10);
}
}
KalturaLog::debug("Max live stream outputs [{$maxTranscodedStreams}]");
$totalInputStreams = count($entries) + 1;
if ($totalInputStreams > $maxInputStreams + $maxTranscodedStreams) {
KalturaLog::debug("Live input stream [{$totalInputStreams}]");
throw new KalturaAPIException(KalturaErrors::LIVE_STREAM_EXCEEDED_MAX_PASSTHRU, $entryId);
}
$entryIds = array($entryId);
foreach ($entries as $liveEntry) {
/* @var $liveEntry LiveEntry */
$entryIds[] = $liveEntry->getId();
$liveParamsIds = array_map('intval', explode(',', $liveEntry->getFlavorParamsIds()));
foreach ($liveParamsIds as $liveParamsId) {
if (isset($usedLiveParamsIds[$liveParamsId])) {
$usedLiveParamsIds[$liveParamsId][] = $liveEntry->getId();
} else {
$usedLiveParamsIds[$liveParamsId] = array($liveEntry->getId());
}
}
}
$liveParams = assetParamsPeer::retrieveByPKs(array_keys($usedLiveParamsIds));
$passthruEntries = null;
$transcodedEntries = null;
foreach ($liveParams as $liveParamsItem) {
/* @var $liveParamsItem LiveParams */
if ($liveParamsItem->hasTag(liveParams::TAG_INGEST)) {
$passthruEntries = array_intersect(is_array($passthruEntries) ? $passthruEntries : $entryIds, $usedLiveParamsIds[$liveParamsItem->getId()]);
} else {
$transcodedEntries = array_intersect(is_array($transcodedEntries) ? $transcodedEntries : $entryIds, $usedLiveParamsIds[$liveParamsItem->getId()]);
}
}
//.........这里部分代码省略.........
开发者ID:dozernz,项目名称:server,代码行数:101,代码来源:LiveStreamService.php
示例19: listByReferenceId
/**
* List base entries by filter according to reference id
*
* @action listByReferenceId
* @param string $refId Entry Reference ID
* @param KalturaFilterPager $pager Pager
* @throws KalturaErrors::MISSING_MANDATORY_PARAMETER
*/
function listByReferenceId($refId, KalturaFilterPager $pager = null)
{
if (!$refId) {
//if refId wasn't provided return an error of missing parameter
throw new KalturaAPIException(KalturaErrors::MISSING_MANDATORY_PARAMETER, $refId);
}
if (!$pager) {
$pager = new KalturaFilterPager();
}
$entryFilter = new entryFilter();
$entryFilter->setPartnerSearchScope(baseObjectFilter::MATCH_KALTURA_NETWORK_AND_PRIVATE);
//setting reference ID
$entryFilter->set('_eq_reference_id', $refId);
$c = KalturaCriteria::create(entryPeer::OM_CLASS);
$pager->attachToCriteria($c);
$entryFilter->attachToCriteria($c);
$c->add(entryPeer::DISPLAY_IN_SEARCH, mySearchUtils::DISPLAY_IN_SEARCH_SYSTEM, Criteria::NOT_EQUAL);
KalturaCriterion::disableTag(KalturaCriterion::TAG_WIDGET_SESSION);
$list = entryPeer::doSelect($c);
KalturaCriterion::restoreTag(KalturaCriterion::TAG_WIDGET_SESSION);
$totalCount = $c->getRecordsCount();
$newList = KalturaBaseEntryArray::fromEntryArray($list, false);
$response = new KalturaBaseEntryListResponse();
$response->objects = $newList;
$response->totalCount = $totalCount;
return $response;
}
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:35,代码来源:BaseEntryService.php
示例20: getLicenseRequestEntry
|
请发表评论