當前位置: 首頁>>代碼示例>>PHP>>正文


PHP myEntryUtils類代碼示例

本文整理匯總了PHP中myEntryUtils的典型用法代碼示例。如果您正苦於以下問題:PHP myEntryUtils類的具體用法?PHP myEntryUtils怎麽用?PHP myEntryUtils使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了myEntryUtils類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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


注:本文中的myEntryUtils類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。