本文整理汇总了PHP中myEntryUtils类的典型用法代码示例。如果您正苦于以下问题:PHP myEntryUtils类的具体用法?PHP myEntryUtils怎么用?PHP myEntryUtils使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了myEntryUtils类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: getLocalThumbFilePath
public function getLocalThumbFilePath($version, $width, $height, $type, $bgcolor = "ffffff", $crop_provider = null, $quality = 0, $src_x = 0, $src_y = 0, $src_w = 0, $src_h = 0, $vid_sec = -1, $vid_slice = 0, $vid_slices = -1, $density = 0, $stripProfiles = false, $flavorId = null, $fileName = null)
{
if ($this->getStatus() == entryStatus::DELETED || $this->getModerationStatus() == moderation::MODERATION_STATUS_BLOCK) {
KalturaLog::log("rejected live stream entry - not serving thumbnail");
KExternalErrors::dieError(KExternalErrors::ENTRY_DELETED_MODERATED);
}
$contentPath = myContentStorage::getFSContentRootPath();
$liveEntryExist = false;
$liveThumbEntry = null;
$liveThumbEntryId = null;
$partner = $this->getPartner();
if ($partner) {
$liveThumbEntryId = $partner->getLiveThumbEntryId();
}
if ($liveThumbEntryId) {
$liveThumbEntry = entryPeer::retrieveByPK($liveThumbEntryId);
}
if ($liveThumbEntry && $liveThumbEntry->getMediaType() == entry::ENTRY_MEDIA_TYPE_IMAGE) {
$fileSyncVersion = $partner->getLiveThumbEntryVersion();
$liveEntryKey = $liveThumbEntry->getSyncKey(entry::FILE_SYNC_ENTRY_SUB_TYPE_DATA, $fileSyncVersion);
$contentPath = kFileSyncUtils::getLocalFilePathForKey($liveEntryKey);
if ($contentPath) {
$msgPath = $contentPath;
$liveEntryExist = true;
} else {
KalturaLog::err('no local file sync for audio entry id');
}
}
if (!$liveEntryExist) {
$msgPath = $contentPath . "content/templates/entry/thumbnail/live_thumb.jpg";
}
return myEntryUtils::resizeEntryImage($this, $version, $width, $height, $type, $bgcolor, $crop_provider, $quality, $src_x, $src_y, $src_w, $src_h, $vid_sec, $vid_slice, $vid_slices, $msgPath, $density, $stripProfiles);
}
开发者ID:DBezemer,项目名称:server,代码行数:33,代码来源:LiveEntry.php
示例2: executeImpl
public function executeImpl($partner_id, $subp_id, $puser_id, $partner_prefix, $puser_kuser)
{
if (!$puser_kuser) {
$this->addError(APIErrors::INVALID_USER_ID, $puser_id);
return;
}
$time_offset = $this->getPM("time_offset");
$entry_ids = $this->getPM("entry_ids");
$detailed = $this->getP("detailed", false);
$separator = $this->getP("separator", ",");
$id_arr = explode($separator, $entry_ids);
$limit = 50;
$id_arr = array_splice($id_arr, 0, $limit);
$entries = entryPeer::retrieveByPKs($id_arr);
$updated_entries = array();
if (!$entries) {
$this->addError(APIErrors::INVALID_ENTRY_IDS, $entry_ids);
} else {
foreach ($entries as $entry) {
if (!myEntryUtils::createThumbnailFromEntry($entry, $entry, $time_offset)) {
$this->addError(APIErrors::INVALID_ENTRY_TYPE, "ENTRY_TYPE_MEDIACLIP [" . $entry->getId() . "]");
continue;
}
$updated_entries[] = $entry;
myNotificationMgr::createNotification(kNotificationJobData::NOTIFICATION_TYPE_ENTRY_UPDATE_THUMBNAIL, $entry);
$wrapper = objectWrapperBase::getWrapperClass($entry, objectWrapperBase::DETAIL_LEVEL_DETAILED);
$wrapper->removeFromCache("entry", $entry->getId());
}
}
$this->addMsg("entries", objectWrapperBase::getWrapperClass($updated_entries, objectWrapperBase::DETAIL_LEVEL_REGULAR));
}
开发者ID:DBezemer,项目名称:server,代码行数:31,代码来源:updateentriesthumbnailsAction.class.php
示例3: addAction
/**
* Adds a new mix.
* If the dataContent is null, a default timeline will be created.
*
* @action add
* @param KalturaMixEntry $mixEntry Mix entry metadata
* @return KalturaMixEntry The new mix entry
*/
function addAction(KalturaMixEntry $mixEntry)
{
$mixEntry->validatePropertyMinLength("name", 1);
$mixEntry->validatePropertyNotNull("editorType");
$dbEntry = $mixEntry->toObject(new entry());
$this->checkAndSetValidUser($mixEntry, $dbEntry);
$this->checkAdminOnlyInsertProperties($mixEntry);
$this->validateAccessControlId($mixEntry);
$this->validateEntryScheduleDates($mixEntry);
$kshow = $this->createDummyKShow();
$dbEntry->setKshowId($kshow->getId());
$dbEntry->setPartnerId($this->getPartnerId());
$dbEntry->setSubpId($this->getPartnerId() * 100);
$dbEntry->setStatus(KalturaEntryStatus::READY);
$dbEntry->setMediaType(entry::ENTRY_MEDIA_TYPE_SHOW);
// for backward compatibility
if (!$dbEntry->getThumbnail()) {
$dbEntry->setThumbnail("&auto_edit.jpg");
}
$dbEntry->save();
// we need the id for setDataContent
// set default data if no data given
if ($mixEntry->dataContent === null) {
myEntryUtils::modifyEntryMetadataWithText($dbEntry, "", 0);
} else {
$dbEntry->setDataContent($mixEntry->dataContent, true, true);
$dbEntry->save();
}
$kshow->setShowEntry($dbEntry);
$kshow->save();
$mixEntry->fromObject($dbEntry);
myNotificationMgr::createNotification(kNotificationJobData::NOTIFICATION_TYPE_ENTRY_ADD, $dbEntry);
return $mixEntry;
}
开发者ID:richhl,项目名称:kalturaCE,代码行数:42,代码来源:MixingService.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: addFromUploadedFileAction
/**
* Generic add entry using an uploaded file, should be used when the uploaded entry type is not known
*
* @action addFromUploadedFile
* @param KalturaBaseEntry $entry
* @param string $uploadTokenId
* @param KalturaEntryType $type
* @return KalturaBaseEntry
*/
function addFromUploadedFileAction(KalturaBaseEntry $entry, $uploadTokenId, $type = -1)
{
try {
// check that the uploaded file exists
$entryFullPath = kUploadTokenMgr::getFullPathByUploadTokenId($uploadTokenId);
} catch (kCoreException $ex) {
if ($ex->getCode() == kUploadTokenException::UPLOAD_TOKEN_INVALID_STATUS) {
}
throw new KalturaAPIException(KalturaErrors::UPLOAD_TOKEN_INVALID_STATUS_FOR_ADD_ENTRY);
throw $ex;
}
if (!file_exists($entryFullPath)) {
$remoteDCHost = kUploadTokenMgr::getRemoteHostForUploadToken($uploadTokenId, kDataCenterMgr::getCurrentDcId());
if ($remoteDCHost) {
kFile::dumpApiRequest($remoteDCHost);
} else {
throw new KalturaAPIException(KalturaErrors::UPLOADED_FILE_NOT_FOUND_BY_TOKEN);
}
}
// validate the input object
//$entry->validatePropertyMinLength("name", 1);
if (!$entry->name) {
$entry->name = $this->getPartnerId() . '_' . time();
}
// first copy all the properties to the db entry, then we'll check for security stuff
$dbEntry = $entry->toInsertableObject(new entry());
$dbEntry->setType($type);
$dbEntry->setMediaType(entry::ENTRY_MEDIA_TYPE_AUTOMATIC);
$this->checkAndSetValidUser($entry, $dbEntry);
$this->checkAdminOnlyInsertProperties($entry);
$this->validateAccessControlId($entry);
$this->validateEntryScheduleDates($entry);
$dbEntry->setPartnerId($this->getPartnerId());
$dbEntry->setSubpId($this->getPartnerId() * 100);
$dbEntry->setSourceId($uploadTokenId);
$dbEntry->setSourceLink($entryFullPath);
$dbEntry->setDefaultModerationStatus();
$dbEntry->save();
$kshow = $this->createDummyKShow();
$kshowId = $kshow->getId();
myEntryUtils::setEntryTypeAndMediaTypeFromFile($dbEntry, $entryFullPath);
// setup the needed params for my insert entry helper
$paramsArray = array("entry_media_source" => KalturaSourceType::FILE, "entry_media_type" => $dbEntry->getMediaType(), "entry_full_path" => $entryFullPath, "entry_license" => $dbEntry->getLicenseType(), "entry_credit" => $dbEntry->getCredit(), "entry_source_link" => $dbEntry->getSourceLink(), "entry_tags" => $dbEntry->getTags());
$token = $this->getKsUniqueString();
$insert_entry_helper = new myInsertEntryHelper(null, $dbEntry->getKuserId(), $kshowId, $paramsArray);
$insert_entry_helper->setPartnerId($this->getPartnerId(), $this->getPartnerId() * 100);
$insert_entry_helper->insertEntry($token, $dbEntry->getType(), $dbEntry->getId(), $dbEntry->getName(), $dbEntry->getTags(), $dbEntry);
$dbEntry = $insert_entry_helper->getEntry();
kUploadTokenMgr::closeUploadTokenById($uploadTokenId);
myNotificationMgr::createNotification(kNotificationJobData::NOTIFICATION_TYPE_ENTRY_ADD, $dbEntry);
$entry->fromObject($dbEntry);
return $entry;
}
开发者ID:richhl,项目名称:kalturaCE,代码行数:62,代码来源:BaseEntryService.php
示例6: updateEntryThumbnail
protected function updateEntryThumbnail()
{
if ($this->getEntryStatus() != entryStatus::READY || !strlen($this->getThumbnailUrl()) || $this->getThumbnailSaved()) {
return;
}
try {
$entry = entryPeer::retrieveByPKNoFilter($this->getObjectId());
myEntryUtils::updateThumbnailFromFile($entry, $this->getThumbnailUrl());
} catch (Exception $e) {
KalturaLog::err($e->getMessage());
return;
}
$this->setThumbnailSaved(true);
}
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:14,代码来源:BulkUploadResultEntry.php
示例7: executeImpl
public function executeImpl($partner_id, $subp_id, $puser_id, $partner_prefix, $puser_kuser)
{
if (!$puser_kuser) {
$this->addError(APIErrors::INVALID_USER_ID, $puser_id);
return;
}
$entry_id = $this->getPM("entry_id");
$entry = entryPeer::retrieveByPK($entry_id);
// TODO - verify the user is allowed to modify the entry
$source_entry_id = $this->getP("source_entry_id");
if ($source_entry_id) {
$source_entry = entryPeer::retrieveByPK($source_entry_id);
if (!$source_entry) {
return;
}
} else {
$source_entry = $entry;
}
$time_offset = $this->getP("time_offset", -1);
if (!myEntryUtils::createThumbnailFromEntry($entry, $source_entry, $time_offset)) {
$this->addError(APIErrors::INVALID_ENTRY_TYPE, "ENTRY_TYPE_MEDIACLIP");
return;
}
if ($entry->getType() == entryType::MIX) {
/*
$roughcutPath = myContentStorage::getFSContentRootPath() . $entry->getDataPath(); // replaced__getDataPath
$xml_doc = new DOMDocument();
$xml_doc->load( $roughcutPath );
if (myMetadataUtils::updateThumbUrl($xml_doc, $entry->getThumbnailUrl()))
$xml_doc->save($roughcutPath);
*/
$sync_key = $entry->getSyncKey(entry::FILE_SYNC_ENTRY_SUB_TYPE_DATA);
$xml_doc = new DOMDocument();
$xml_doc->loadXML(kFileSyncUtils::file_get_contents($sync_key));
if (myMetadataUtils::updateThumbUrl($xml_doc, $entry->getThumbnailUrl())) {
$entry->setMetadata(null, $xml_doc->saveXML(), true, null, null);
//$entry->getVersion() );
}
myNotificationMgr::createNotification(kNotificationJobData::NOTIFICATION_TYPE_ENTRY_UPDATE_THUMBNAIL, $entry);
}
$wrapper = objectWrapperBase::getWrapperClass($entry, objectWrapperBase::DETAIL_LEVEL_DETAILED);
$wrapper->removeFromCache("entry", $entry->getId());
$this->addMsg("entry", $wrapper);
}
开发者ID:richhl,项目名称:kalturaCE,代码行数:45,代码来源:updateentrythumbnailAction.class.php
示例8: 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);
if (!$detailed) {
$detailed = false;
}
$playlist_id = $this->getPM("playlist_id");
if ($create_cachekey) {
if ($this->isAdmin()) {
return null;
}
$ks_partner_id = null;
$privileges = null;
$ks = ks::fromSecureString(kCurrentContext::$ks);
if ($ks) {
$ks_partner_id = $ks->getPartnerId();
$privileges = $ks->getPrivileges();
}
$cache_key_arr = array("playlist_id" => $playlist_id, "partner_id" => $partner_id, "ks_partner_id" => $ks_partner_id, "detailed" => $detailed, "user" => kCurrentContext::$ks_uid, "privileges" => $privileges, "is_admin" => $this->isAdmin(), "protocol" => infraRequestUtils::getProtocol());
$cahce_key = new executionCacheKey();
$cahce_key->expiry = 600;
$cahce_key->key = md5(print_r($cache_key_arr, true));
return $cahce_key;
}
// 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('accessControl', $playlist->getPartnerId(), $this->getPrivatePartnerData(), $this->partnerGroup2(), null);
$this->playlist = $playlist;
}
if ($this->isAdmin()) {
myPlaylistUtils::setIsAdminKs(true);
}
$entry_list = myPlaylistUtils::executePlaylistById($partner_id, $playlist_id, null, $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:DBezemer,项目名称:server,代码行数:45,代码来源:executeplaylistAction.class.php
示例9: deleteObject
function deleteObject(FileSync $fileSync)
{
$object = kFileSyncUtils::retrieveObjectForFileSync($fileSync);
$key = $object->getSyncKey($fileSync->getObjectSubType());
if ($key->version != $fileSync->getVersion()) {
return;
}
switch ($fileSync->getObjectType()) {
case FileSyncObjectType::UICONF:
$object->setStatus(uiConf::UI_CONF_STATUS_DELETED);
$object->save();
break;
case FileSyncObjectType::ENTRY:
myEntryUtils::deleteEntry($object);
try {
$wrapper = objectWrapperBase::getWrapperClass($object);
$wrapper->removeFromCache("entry", $object->getId());
} catch (Exception $e) {
KalturaLog::err($e);
}
break;
case FileSyncObjectType::ASSET:
$object->setStatus(flavorAsset::FLAVOR_ASSET_STATUS_DELETED);
$object->setDeletedAt(time());
$object->save();
break;
case FileSyncObjectType::METADATA:
$object->setStatus(Metadata::STATUS_DELETED);
$object->save();
break;
default:
return;
}
if ($fileSync->getFileType() == FileSync::FILE_SYNC_FILE_TYPE_LINK) {
return;
}
$criteria = new Criteria();
$criteria->add(FileSyncPeer::DC, $fileSync->getDc());
$criteria->add(FileSyncPeer::FILE_TYPE, FileSync::FILE_SYNC_FILE_TYPE_LINK);
$criteria->add(FileSyncPeer::LINKED_ID, $fileSync->getId());
$links = FileSyncPeer::doSelect($criteria);
foreach ($links as $link) {
deleteObject($link);
}
}
开发者ID:DBezemer,项目名称:server,代码行数:45,代码来源:validateFileSyncs.php
示例10: 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
示例11: 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;
}
// 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);
$entry_list = myPlaylistUtils::executePlaylist($partner_id, $playlist, null, $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:DBezemer,项目名称:server,代码行数:22,代码来源:executeplaylistfromcontentAction.class.php
示例12: executeImpl
public function executeImpl($partner_id, $subp_id, $puser_id, $partner_prefix, $puser_kuser)
{
$prefix = $this->getObjectPrefix();
$entry_id_to_delete = $this->getPM("{$prefix}_id");
$kshow_id_for_entry_id_to_delete = $this->getP("kshow_id");
$c = $this->getCriteria();
if ($c == null) {
$entry_to_delete = entryPeer::retrieveByPK($entry_id_to_delete);
} else {
$entry_to_delete = entryPeer::doSelectOne($c);
}
if (!$entry_to_delete) {
$this->addError(APIErrors::INVALID_ENTRY_ID, $prefix, $entry_id_to_delete);
return;
}
if ($kshow_id_for_entry_id_to_delete != null) {
// match the kshow_id
if ($kshow_id_for_entry_id_to_delete != $entry_to_delete->getKshowId()) {
$this->addError(APIErrors::CANNOT_DELETE_ENTRY, $entry_id_to_delete, $kshow_id_for_entry_id_to_delete);
return;
}
}
myEntryUtils::deleteEntry($entry_to_delete);
/*
All move into myEntryUtils::deleteEntry
$entry_to_delete->setStatus ( entryStatus::DELETED );
// make sure the moderation_status is set to moderation::MODERATION_STATUS_DELETE
$entry_to_delete->setModerationStatus ( moderation::MODERATION_STATUS_DELETE );
$entry_to_delete->setModifiedAt( time() ) ;
$entry_to_delete->save();
myNotificationMgr::createNotification( kNotificationJobData::NOTIFICATION_TYPE_ENTRY_DELETE , $entry_to_delete );
*/
$this->addMsg("deleted_" . $prefix, objectWrapperBase::getWrapperClass($entry_to_delete, objectWrapperBase::DETAIL_LEVEL_REGULAR));
}
开发者ID:richhl,项目名称:kalturaCE,代码行数:37,代码来源:deleteentryAction.class.php
示例13: execute
//.........这里部分代码省略.........
}
if ($rel_height != -1) {
$heightRatio = $entry->getHeight() / $rel_height;
$src_y = $src_y * $heightRatio;
$src_h = $src_h * $heightRatio;
}
$subType = entry::FILE_SYNC_ENTRY_SUB_TYPE_THUMB;
if ($entry->getMediaType() == entry::ENTRY_MEDIA_TYPE_IMAGE) {
$subType = entry::FILE_SYNC_ENTRY_SUB_TYPE_DATA;
}
KalturaLog::debug("get thumbnail filesyncs");
$dataKey = $entry->getSyncKey($subType);
list($file_sync, $local) = kFileSyncUtils::getReadyFileSyncForKey($dataKey, true, false);
$tempThumbPath = null;
$entry_status = $entry->getStatus();
// both 640x480 and 0x0 requests are probably coming from the kdp
// 640x480 - old kdp version requesting thumbnail
// 0x0 - new kdp version requesting the thumbnail of an unready entry
// we need to distinguish between calls from the kdp and calls from a browser: <img src=...>
// that can't handle swf input
if (($width == 640 && $height == 480 || $width == 0 && $height == 0) && ($entry_status == entryStatus::PRECONVERT || $entry_status == entryStatus::IMPORT || $entry_status == entryStatus::ERROR_CONVERTING || $entry_status == entryStatus::DELETED)) {
$contentPath = myContentStorage::getFSContentRootPath();
$msgPath = $contentPath . "content/templates/entry/bigthumbnail/";
if ($entry_status == entryStatus::DELETED) {
$msgPath .= $entry->getModerationStatus() == moderation::MODERATION_STATUS_BLOCK ? "entry_blocked.swf" : "entry_deleted.swf";
} else {
$msgPath .= $entry_status == entryStatus::ERROR_CONVERTING ? "entry_error.swf" : "entry_converting.swf";
}
kFile::dumpFile($msgPath, null, 0);
}
if (!$file_sync) {
$tempThumbPath = $entry->getLocalThumbFilePath($entry, $version, $width, $height, $type, $bgcolor, $crop_provider, $quality, $src_x, $src_y, $src_w, $src_h, $vid_sec, $vid_slice, $vid_slices, $density, $stripProfiles, $flavor_id, $file_name);
if (!$tempThumbPath) {
KExternalErrors::dieError(KExternalErrors::MISSING_THUMBNAIL_FILESYNC);
}
}
if (!$local && !$tempThumbPath && $file_sync) {
if (!in_array($file_sync->getDc(), kDataCenterMgr::getDcIds())) {
$remoteUrl = $file_sync->getExternalUrl($entry->getId());
header("Location: {$remoteUrl}");
die;
}
$remoteUrl = kDataCenterMgr::getRedirectExternalUrl($file_sync, $_SERVER['REQUEST_URI']);
kFile::dumpUrl($remoteUrl);
}
// if we didnt return a template for the player die and dont return the original deleted thumb
if ($entry_status == entryStatus::DELETED) {
KExternalErrors::dieError(KExternalErrors::ENTRY_DELETED_MODERATED);
}
if (!$tempThumbPath) {
try {
$tempThumbPath = myEntryUtils::resizeEntryImage($entry, $version, $width, $height, $type, $bgcolor, $crop_provider, $quality, $src_x, $src_y, $src_w, $src_h, $vid_sec, $vid_slice, $vid_slices, null, $density, $stripProfiles, $thumbParams);
} catch (Exception $ex) {
if ($ex->getCode() != kFileSyncException::FILE_DOES_NOT_EXIST_ON_CURRENT_DC) {
KalturaLog::log("Error - resize image failed");
KExternalErrors::dieError(KExternalErrors::MISSING_THUMBNAIL_FILESYNC);
}
// get original flavor asset
$origFlavorAsset = assetPeer::retrieveOriginalByEntryId($entry_id);
if (!$origFlavorAsset) {
KalturaLog::log("Error - no original flavor for entry [{$entry_id}]");
KExternalErrors::dieError(KExternalErrors::FLAVOR_NOT_FOUND);
}
$syncKey = $origFlavorAsset->getSyncKey(flavorAsset::FILE_SYNC_FLAVOR_ASSET_SUB_TYPE_ASSET);
$remoteFileSync = kFileSyncUtils::getOriginFileSyncForKey($syncKey, false);
if (!$remoteFileSync) {
// file does not exist on any DC - die
KalturaLog::log("Error - no FileSync for entry [{$entry_id}]");
KExternalErrors::dieError(KExternalErrors::MISSING_THUMBNAIL_FILESYNC);
}
if ($remoteFileSync->getDc() == kDataCenterMgr::getCurrentDcId()) {
KalturaLog::log("ERROR - Trying to redirect to myself - stop here.");
KExternalErrors::dieError(KExternalErrors::MISSING_THUMBNAIL_FILESYNC);
}
if (!in_array($remoteFileSync->getDc(), kDataCenterMgr::getDcIds())) {
KExternalErrors::dieError(KExternalErrors::MISSING_THUMBNAIL_FILESYNC);
}
$remoteUrl = kDataCenterMgr::getRedirectExternalUrl($remoteFileSync);
kFile::dumpUrl($remoteUrl);
}
}
$nocache = strpos($tempThumbPath, "_NOCACHE_") !== false;
if ($securyEntryHelper->shouldDisableCache() || kApiCache::hasExtraFields() || !$securyEntryHelper->isKsWidget() && $securyEntryHelper->hasRules()) {
$nocache = true;
}
// notify external proxy, so it'll cache this url
if (!$nocache && requestUtils::getHost() == kConf::get("apphome_url") && file_exists($tempThumbPath)) {
self::notifyProxy($_SERVER["REQUEST_URI"]);
}
// cache result
if (!$nocache) {
$requestKey = $_SERVER["REQUEST_URI"];
$cache = new myCache("thumb", 86400 * 30);
// 30 days
$cache->put($requestKey, $tempThumbPath);
}
kFile::dumpFile($tempThumbPath, null, $nocache ? 0 : null);
// TODO - can delete from disk assuming we caneasily recreate it and it will anyway be cached in the CDN
// however dumpfile dies at the end so we cant just write it here (maybe register a shutdown callback)
}
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:101,代码来源:thumbnailAction.class.php
示例14: updateThumbnail
public static function updateThumbnail($kshow, entry $entry, $should_force = false)
{
// We don't want to copy thumbnails of entries that are not ready - they are bad and will later be replaced anyway
if ($entry->getThumbnail() != null && $entry->isReady()) {
$show_entry = $kshow->getShowEntry();
return myEntryUtils::createThumbnail($show_entry, $entry, $should_force);
}
return false;
}
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:9,代码来源:myKshowUtils.class.php
示例15: executeImpl
public function executeImpl($partner_id, $subp_id, $puser_id, $partner_prefix, $puser_kuser)
{
$kshows_from_db = null;
// works in one of 2 ways:
// 1. get no requested name - will create a new kshow and return its details
// 2. get some name - tries to fetch by name. if already exists - return it
// get the new properties for the kuser from the request
$kshow = new kshow();
$allow_duplicate_names = $this->getP("allow_duplicate_names", true, true);
if ($allow_duplicate_names === "false" || $allow_duplicate_names === 0) {
$allow_duplicate_names = false;
}
$return_metadata = $this->getP("metadata", false);
$detailed = $this->getP("detailed", false);
$level = $detailed ? objectWrapperBase::DETAIL_LEVEL_DETAILED : objectWrapperBase::DETAIL_LEVEL_REGULAR;
$obj_wrapper = objectWrapperBase::getWrapperClass($kshow, 0);
$fields_modified = baseObjectUtils::fillObjectFromMap($this->getInputParams(), $kshow, "kshow_", $obj_wrapper->getUpdateableFields());
// check that mandatory fields were set
// TODO
$kshow->setName(trim($kshow->getName()));
// ASSUME - the name is UNIQUE per partner_id !
if ($kshow->getName()) {
if (myPartnerUtils::shouldForceUniqueKshow($partner_id, $allow_duplicate_names)) {
// in this case willsearch for an existing kshow with this name and return with an error if found
$kshows_from_db = kshowPeer::getKshowsByName(trim($kshow->getName()));
if ($kshows_from_db) {
$kshow_from_db = $kshows_from_db[0];
$this->addDebug("already_exists_objects", count($kshows_from_db));
$this->addError(APIErrors::DUPLICATE_KSHOW_BY_NAME, $kshow->getName());
// This field in unique. Please change ");
if (myPartnerUtils::returnDuplicateKshow($partner_id)) {
$this->addMsg("kshow", objectWrapperBase::getWrapperClass($kshow_from_db, $level));
}
return;
}
}
}
// the first kuser to create this kshow will be it's producer
$producer_id = $puser_kuser->getKuserId();
$kshow->setProducerId($producer_id);
// moved to the update - where there is
$kshow->setPartnerId($partner_id);
$kshow->setSubpId($subp_id);
$kshow->setViewPermissions(kshow::KSHOW_PERMISSION_EVERYONE);
// by default the permissions should be public
if ($kshow->getPermissions() === null) {
$kshow->setPermissions(myPrivilegesMgr::PERMISSIONS_PUBLIC);
}
// have to save the kshow before creating the default entries
$kshow->save();
$show_entry = $kshow->createEntry(entry::ENTRY_MEDIA_TYPE_SHOW, $producer_id, "&auto_edit.jpg", $kshow->getName());
// roughcut
$kshow->createEntry(entry::ENTRY_MEDIA_TYPE_VIDEO, $producer_id);
// intro
/*
$sample_text = $kshow->getName();
$host = requestUtils::getHost();
*/
$sample_text = "";
myEntryUtils::modifyEntryMetadataWithText($show_entry, $sample_text, "");
// set the roughcut to false so the update iwll override with better data
$kshow->setHasRoughcut(false);
$kshow->initFromTemplate($producer_id, $sample_text);
$kshow->save();
myNotificationMgr::createNotification(kNotificationJobData::NOTIFICATION_TYPE_KSHOW_ADD, $kshow);
$this->addMsg("kshow", objectWrapperBase::getWrapperClass($kshow, $level));
if ($return_metadata) {
$this->addMsg("metadata", $kshow->getMetadata());
}
$this->addDebug("added_fields", $fields_modified);
if ($kshows_from_db) {
$this->addDebug("already_exists_objects", count($kshows_from_db));
}
}
开发者ID:richhl,项目名称:kalturaCE,代码行数:74,代码来源:addkshowAction.class.php
示例16: updateConvertedEntry
private function updateConvertedEntry($ok, $entry, kConversionResult $conv_res)
{
$file_before_conversion = $conv_res->conv_cmd->source_file;
$file_after_conversion = $conv_res->conv_cmd->target_file;
// TODO -get all targets
if ($ok == true) {
// TODO - write all targets not only primary one
KalturaLog::debug("File [{$file_before_conversion}] converted OK to [{$file_after_conversion}]");
try {
// TODO - do we need to create the helpers eagerly ??
// $this->createFlvWrappersForTargets( $conv_res );
} catch (Exception $ex) {
KalturaLog::debug("Error while creating helper files for [{$file_after_conversion}]");
}
$entry->setStatusReady();
} else {
KalturaLog::debug("Problem converting file [{$file_before_conversion}]");
$entry->setStatus(entryStatus::ERROR_CONVERTING);
}
$this->updateConversionInDb($entry, $conv_res);
// loop until the file is really ready - sometimes the size of the file or the mtime is wrong
for ($i = 0; $i < 15; $i++) {
clearstatcache();
if (!file_exists($file_after_conversion) || filesize($file_after_conversion) == 0) {
// KalturaLog::debug ( "Entry id [" . $entry->getId() . "] printing file stats: " . print_r( stat ($file_after_conversion ) , true ) );
KalturaLog::debug("Entry id [" . $entry->getId() . "]. no such file [{$file_after_conversion}]. Sleeping for 1 second for the [{$i}] time.");
sleep(2);
} else {
break;
}
}
KalturaLog::debug("Entry id [" . $entry->getId() . "] setting duration");
$entry->setLengthInMsecs(kConversionHelper::getFlvDuration($file_after_conversion));
KalturaLog::debug("Entry id [" . $entry->getId() . "] duration [" . $entry->getLengthInMsecs() . "]");
// how could it be otherwise ??
if ($entry->getMediaType() == entry::ENTRY_MEDIA_TYPE_VIDEO) {
// TODO - move out of this function if the partner is required for more configurations
$partner = PartnerPeer::retrieveByPK($entry->getPartnerId());
// TODO - make sure the width & height of the target are part of the kConversionReulst
// if ( $conversion_info ) $entry->setDimensions ( $conversion_info->video_width , $conversion_info->video_height );
$offset = $entry->getBestThumbOffset($partner->getDefThumbOffset());
KalturaLog::debug("Entry id [" . $entry->getId() . "] Thumb offset: [{$offset}]");
// first create the thumb for the entry
myEntryUtils::createThumbnailFromEntry($entry, $entry, $offset);
// then make sure it will propage to the roughcut if needed
myEntryUtils::createRoughcutThumbnailFromEntry($entry, false);
$entry->updateVideoDimensions();
KalturaLog::debug("Entry id [" . $entry->getId() . "] dimensions: [" . $entry->getWidth() . "x" . $entry->getHeight() . "]");
}
// send notification - regardless its status
myNotificationMgr::createNotification(kNotificationJobData::NOTIFICATION_TYPE_ENTRY_UPDATE, $entry);
$entry->save();
}
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:53,代码来源:kConversionClient.class.php
示例17: initFromTemplate
public function initFromTemplate($kuser_id, $sample_text = null)
{
if (!$this->getHasRoughcut() && $sample_text != null) {
$show_entry = $this->getShowEntry();
if (!$show_entry) {
// have to save the kshow before creating the default entries
$show_entry = $this->createEntry(entry::ENTRY_MEDIA_TYPE_SHOW, $kuser_id, null, $this->getName());
// roughcut
}
if (!$this->getIntroId()) {
$this->createEntry(entry::ENTRY_MEDIA_TYPE_VIDEO, $kuser_id);
// intro
}
// this text should be placed in the partner-config
KalturaLog::info("before modifyEntryMetadataWithText:\n{$sample_text}");
myEntryUtils::modifyEntryMetadataWithText($show_entry, $sample_text, 0, true);
// override the current entry
$this->setHasRoughcut(false);
}
}
开发者ID:DBezemer,项目名称:server,代码行数:20,代码来源:kshow.php
示例18: copyEntriesByType
public static function copyEntriesByType(Partner $fromPartner, Partner $toPartner, $entryType, $dontCopyUsers = false)
{
KalturaLog::log("Copying entries from partner [" . $fromPartner->getId() . "] to partner [" . $toPartner->getId() . "] with type [" . $entryType . "]");
entryPeer::setUseCriteriaFilter(false);
$c = new Criteria();
$c->addAnd(entryPeer::PARTNER_ID, $fromPartner->getId());
$c->addAnd(entryPeer::TYPE, $entryType);
$c->addAnd(entryPee
|
请发表评论