当前位置: 首页>>代码示例>>PHP>>正文


PHP kJobsManager::addBulkUploadJob方法代码示例

本文整理汇总了PHP中kJobsManager::addBulkUploadJob方法的典型用法代码示例。如果您正苦于以下问题:PHP kJobsManager::addBulkUploadJob方法的具体用法?PHP kJobsManager::addBulkUploadJob怎么用?PHP kJobsManager::addBulkUploadJob使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在kJobsManager的用法示例。


在下文中一共展示了kJobsManager::addBulkUploadJob方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: addXMLBulkUploadJob

 /**
  * Add bulk upload job
  * @param DropFolder $folder
  * @param DropFolderFile $leadDropFolderFile
  * @throws Exception
  */
 private function addXMLBulkUploadJob(DropFolder $folder, DropFolderFile $leadDropFolderFile)
 {
     /* @var $leadDropFolderFile FeedDropFolderFile */
     KalturaLog::info('Adding BulkUpload job');
     try {
         $coreBulkUploadType = BulkUploadXmlPlugin::getBulkUploadTypeCoreValue(BulkUploadXmlType::XML);
         $objectId = $leadDropFolderFile->getId();
         $objectType = DropFolderXmlBulkUploadPlugin::getBatchJobObjectTypeCoreValue(DropFolderBatchJobObjectType::DROP_FOLDER_FILE);
         $partner = PartnerPeer::retrieveByPK($folder->getPartnerId());
         $data = KalturaPluginManager::loadObject('kBulkUploadJobData', $coreBulkUploadType);
         /* @var $data kBulkUploadJobData */
         $data->setUploadedBy(kDropFolderXmlEventsConsumer::UPLOADED_BY);
         KalturaLog::info("Feed XML path: " . $leadDropFolderFile->getFeedXmlPath());
         $data->setFilePath($leadDropFolderFile->getFeedXmlPath());
         $data->setFileName(basename($data->getFilePath()) . '.xml');
         $objectData = new kBulkUploadEntryData();
         KalturaLog::info('Conversion profile id: ' . $folder->getConversionProfileId());
         $objectData->setConversionProfileId($folder->getConversionProfileId());
         $data->setObjectData($objectData);
         $job = kJobsManager::addBulkUploadJob($partner, $data, $coreBulkUploadType, $objectId, $objectType);
         $this->setFileToProcessing($leadDropFolderFile);
         return $job;
     } catch (Exception $e) {
         KalturaLog::err("Error adding BulkUpload job -" . $e->getMessage());
         throw new Exception(DropFolderXmlBulkUploadPlugin::ERROR_ADDING_BULK_UPLOAD_MESSAGE, DropFolderXmlBulkUploadPlugin::getErrorCodeCoreValue(DropFolderXmlBulkUploadErrorCode::ERROR_ADDING_BULK_UPLOAD));
     }
 }
开发者ID:kubrickfr,项目名称:server,代码行数:33,代码来源:kDropFolderFeedXmlFileHandler.php

示例2: executeImpl

 public function executeImpl($partner_id, $subp_id, $puser_id, $partner_prefix, $puser_kuser)
 {
     $fileField = "csv_file";
     $profileId = $this->getP("profile_id");
     if (count($_FILES) == 0) {
         $this->addError(APIErrors::NO_FILES_RECEIVED);
         return;
     }
     if (!@$_FILES[$fileField]) {
         $this->addError(APIErrors::INVALID_FILE_FIELD, $fileField);
         return;
     }
     // first we copy the file to "content/batchfiles/[partner_id]/"
     $fileName = $_FILES[$fileField]['name'];
     $filePath = $_FILES[$fileField]['tmp_name'];
     $kuser = kuser::getKuserById($puser_kuser->getKuserId());
     $partner = PartnerPeer::retrieveByPK($partner_id);
     kJobsManager::addBulkUploadJob($filePath, $fileName, $partner, $kuser->getPuserId(), $kuser->getPuserId(), $profileId);
 }
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:19,代码来源:addbulkuploadAction.class.php

示例3: addAction

 /**
  * Add new bulk upload batch job
  * Conversion profile id can be specified in the API or in the CSV file, the one in the CSV file will be stronger.
  * If no conversion profile was specified, partner's default will be used
  * 
  * @action add
  * @param int $conversionProfileId Convertion profile id to use for converting the current bulk (-1 to use partner's default)
  * @param file $csvFileData bulk upload file
  * @param KalturaBulkUploadType $bulkUploadType
  * @param string $uploadedBy
  * @param string $fileName Friendly name of the file, used to be recognized later in the logs.
  * @return KalturaBulkUpload
  */
 public function addAction($conversionProfileId, $csvFileData, $bulkUploadType = null, $uploadedBy = null, $fileName = null)
 {
     if ($conversionProfileId == self::PARTNER_DEFAULT_CONVERSION_PROFILE_ID) {
         $conversionProfileId = $this->getPartner()->getDefaultConversionProfileId();
     }
     $conversionProfile = conversionProfile2Peer::retrieveByPK($conversionProfileId);
     if (!$conversionProfile) {
         throw new KalturaAPIException(KalturaErrors::CONVERSION_PROFILE_ID_NOT_FOUND, $conversionProfileId);
     }
     $coreBulkUploadType = kPluginableEnumsManager::apiToCore('BulkUploadType', $bulkUploadType);
     if (is_null($uploadedBy)) {
         $uploadedBy = $this->getKuser()->getPuserId();
     }
     if (!$fileName) {
         $fileName = $csvFileData["name"];
     }
     $data = $this->constructJobData($csvFileData["tmp_name"], $fileName, $this->getPartner(), $this->getKuser()->getPuserId(), $uploadedBy, $conversionProfileId, $coreBulkUploadType);
     $dbJob = kJobsManager::addBulkUploadJob($this->getPartner(), $data, $coreBulkUploadType);
     $dbJobLog = BatchJobLogPeer::retrieveByBatchJobId($dbJob->getId());
     $bulkUpload = new KalturaBulkUpload();
     $bulkUpload->fromObject($dbJobLog, $this->getResponseProfile());
     return $bulkUpload;
 }
开发者ID:DBezemer,项目名称:server,代码行数:36,代码来源:BulkUploadService.php

示例4: addCategoryEntriesAction

 /**
  * @action addCategoryEntries
  * @actionAlias categoryEntry.addFromBulkUpload
  * Action adds active category entries
  * @param KalturaBulkServiceData $bulkUploadData
  * @param KalturaBulkUploadCategoryEntryData $bulkUploadCategoryEntryData
  * @return KalturaBulkUpload
  */
 public function addCategoryEntriesAction(KalturaBulkServiceData $bulkUploadData, KalturaBulkUploadCategoryEntryData $bulkUploadCategoryEntryData = null)
 {
     if ($bulkUploadData instanceof KalturaBulkServiceFilterData) {
         if ($bulkUploadData->filter instanceof KalturaBaseEntryFilter) {
             if ($bulkUploadData->filter->idEqual == null && $bulkUploadData->filter->idIn == null && $bulkUploadData->filter->categoriesIdsMatchOr == null && $bulkUploadData->filter->categoriesMatchAnd == null && $bulkUploadData->filter->categoriesMatchOr == null && $bulkUploadData->filter->categoriesIdsMatchAnd == null) {
                 throw new KalturaAPIException(KalturaErrors::MUST_FILTER_ON_ENTRY_OR_CATEGORY);
             }
         } else {
             if ($bulkUploadData->filter instanceof KalturaCategoryEntryFilter) {
                 if ($bulkUploadData->filter->entryIdEqual == null && $bulkUploadData->filter->categoryIdIn == null && $bulkUploadData->filter->categoryIdEqual == null) {
                     throw new KalturaAPIException(KalturaErrors::MUST_FILTER_ON_ENTRY_OR_CATEGORY);
                 }
             }
         }
     }
     $bulkUploadJobData = KalturaPluginManager::loadObject('KalturaBulkUploadJobData', $bulkUploadData->getType());
     $bulkUploadData->toBulkUploadJobData($bulkUploadJobData);
     if (!$bulkUploadCategoryEntryData) {
         $bulkUploadCategoryEntryData = new KalturaBulkUploadCategoryEntryData();
     }
     $dbBulkUploadJobData = $bulkUploadJobData->toInsertableObject();
     $bulkUploadCoreType = kPluginableEnumsManager::apiToCore("BulkUploadType", $bulkUploadJobData->type);
     $dbBulkUploadJobData->setBulkUploadObjectType(BulkUploadObjectType::CATEGORY_ENTRY);
     $dbBulkUploadJobData->setUserId($this->getKuser()->getPuserId());
     $dbObjectData = $bulkUploadCategoryEntryData->toInsertableObject();
     $dbBulkUploadJobData->setObjectData($dbObjectData);
     $dbJob = kJobsManager::addBulkUploadJob($this->getPartner(), $dbBulkUploadJobData, $bulkUploadCoreType);
     $dbJobLog = BatchJobLogPeer::retrieveByBatchJobId($dbJob->getId());
     if (!$dbJobLog) {
         return null;
     }
     $bulkUpload = new KalturaBulkUpload();
     $bulkUpload->fromObject($dbJobLog, $this->getResponseProfile());
     return $bulkUpload;
 }
开发者ID:DBezemer,项目名称:server,代码行数:43,代码来源:BulkService.php

示例5: addXMLBulkUploadJob

 /**
  * Add bulk upload job
  * @param DropFolder $folder
  * @param DropFolderFile $leadDropFolderFile
  * @throws Exception
  */
 private function addXMLBulkUploadJob(DropFolder $folder, DropFolderFile $leadDropFolderFile)
 {
     try {
         $coreBulkUploadType = DropFolderXmlBulkUploadPlugin::getBulkUploadTypeCoreValue(DropFolderXmlBulkUploadType::DROP_FOLDER_XML);
         $objectId = $leadDropFolderFile->getId();
         $objectType = DropFolderXmlBulkUploadPlugin::getBatchJobObjectTypeCoreValue(DropFolderBatchJobObjectType::DROP_FOLDER_FILE);
         $partner = PartnerPeer::retrieveByPK($folder->getPartnerId());
         $data = KalturaPluginManager::loadObject('kBulkUploadJobData', $coreBulkUploadType);
         $data->setUploadedBy(kDropFolderXmlEventsConsumer::UPLOADED_BY);
         $data->setFileName($leadDropFolderFile->getFileName());
         $objectData = new kBulkUploadEntryData();
         $objectData->setConversionProfileId($folder->getConversionProfileId());
         $data->setObjectData($objectData);
         $job = kJobsManager::addBulkUploadJob($partner, $data, $coreBulkUploadType, $objectId, $objectType);
         return $job;
     } catch (Exception $e) {
         KalturaLog::err("Error adding BulkUpload job -" . $e->getMessage());
         throw new Exception(DropFolderXmlBulkUploadPlugin::ERROR_ADDING_BULK_UPLOAD_MESSAGE, DropFolderXmlBulkUploadPlugin::getErrorCodeCoreValue(DropFolderXmlBulkUploadErrorCode::ERROR_ADDING_BULK_UPLOAD));
     }
 }
开发者ID:DBezemer,项目名称:server,代码行数:26,代码来源:kDropFolderXmlFileHandler.php

示例6: addUsersAction

 /**
  * @action addUsers
  * @actionAlias user.addFromBulkUpload
  * Action adds users from a bulkupload CSV file
  * @param file $fileData
  * @param KalturaBulkUploadJobData $bulkUploadData
  * @param KalturaBulkUploadUserData $bulkUploadUserData
  * @return KalturaBulkUpload
  */
 public function addUsersAction($fileData, KalturaBulkUploadJobData $bulkUploadData = null, KalturaBulkUploadUserData $bulkUploadUserData = null)
 {
     if (!$bulkUploadData) {
         $bulkUploadData = KalturaPluginManager::loadObject('KalturaBulkUploadJobData', null);
     }
     if (!$bulkUploadUserData) {
         $bulkUploadUserData = new KalturaBulkUploadUserData();
     }
     if (!$bulkUploadData->fileName) {
         $bulkUploadData->fileName = $fileData["name"];
     }
     $dbBulkUploadJobData = $bulkUploadData->toInsertableObject();
     $bulkUploadCoreType = kPluginableEnumsManager::apiToCore("BulkUploadType", $bulkUploadData->type);
     $dbBulkUploadJobData->setBulkUploadObjectType(BulkUploadObjectType::USER);
     $dbBulkUploadJobData->setUserId($this->getKuser()->getPuserId());
     $dbObjectData = $bulkUploadUserData->toInsertableObject();
     $dbBulkUploadJobData->setObjectData($dbObjectData);
     $dbBulkUploadJobData->setFilePath($fileData["tmp_name"]);
     $dbJob = kJobsManager::addBulkUploadJob($this->getPartner(), $dbBulkUploadJobData, $bulkUploadCoreType);
     $dbJobLog = BatchJobLogPeer::retrieveByBatchJobId($dbJob->getId());
     if (!$dbJobLog) {
         return null;
     }
     $bulkUpload = new KalturaBulkUpload();
     $bulkUpload->fromObject($dbJobLog);
     return $bulkUpload;
 }
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:36,代码来源:BulkService.php


注:本文中的kJobsManager::addBulkUploadJob方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。