本文整理汇总了PHP中BatchJob::getData方法的典型用法代码示例。如果您正苦于以下问题:PHP BatchJob::getData方法的具体用法?PHP BatchJob::getData怎么用?PHP BatchJob::getData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BatchJob
的用法示例。
在下文中一共展示了BatchJob::getData方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: shouldConsumeJobStatusEvent
public function shouldConsumeJobStatusEvent(BatchJob $dbBatchJob)
{
if ($dbBatchJob->getJobType() == IntegrationPlugin::getBatchJobTypeCoreValue(IntegrationBatchJobType::INTEGRATION) && $dbBatchJob->getStatus() == BatchJob::BATCHJOB_STATUS_DONT_PROCESS && $dbBatchJob->getData()->getTriggerType() == BpmEventNotificationIntegrationPlugin::getIntegrationTriggerCoreValue(BpmEventNotificationIntegrationTrigger::BPM_EVENT_NOTIFICATION)) {
return true;
}
return false;
}
示例2: copyModifiedColumns
protected function copyModifiedColumns(BatchJobLog $batchJobLog, BatchJob $batchJob, array $modifiedColumns)
{
$shouldSkipInTranslation = array(BatchJobPeer::LOCK_INFO, BatchJobPeer::HISTORY, BatchJobPeer::BATCH_JOB_LOCK_ID, BatchJobPeer::EXECUTION_STATUS);
foreach ($modifiedColumns as $modifiedColumn) {
$fieldPosLog = -1;
try {
if (in_array($modifiedColumn, $shouldSkipInTranslation)) {
if ($modifiedColumn == BatchJobPeer::EXECUTION_STATUS) {
$batchJobLog->setAbort($batchJob->getExecutionStatus() == BatchJobExecutionStatus::ABORTED);
}
continue;
}
$fieldName = BatchJobPeer::translateFieldName($modifiedColumn, BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME);
$fieldPosJob = BatchJobPeer::translateFieldName($modifiedColumn, BasePeer::TYPE_COLNAME, BasePeer::TYPE_NUM);
$fieldPosLog = BatchJobLogPeer::translateFieldName($fieldName, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM);
} catch (PropelException $e) {
KalturaLog::err("Could not set value for BatchJobLog field {$fieldName}, exception thrown: " . $e->getMessage());
}
if ($fieldPosLog != -1) {
$batchJobLog->setByPosition($fieldPosLog, $batchJob->getByPosition($fieldPosJob));
}
if ($modifiedColumn == BatchJobPeer::DATA) {
//set param_1 for the $batchJobLog
$batchJobData = $batchJob->getData();
/* @var $batchJobData kBulkUploadJobData */
$batchJobLog->setParam1($batchJobData->getBulkUploadObjectType());
}
}
return $batchJobLog;
}
示例3: shouldConsumeJobStatusEvent
public function shouldConsumeJobStatusEvent(BatchJob $dbBatchJob)
{
// consume import jobs with data of type kDropFolderImportJobData
if ($dbBatchJob->getJobType() == BatchJobType::IMPORT && get_class($dbBatchJob->getData()) == 'kDropFolderImportJobData') {
return true;
}
return false;
}
示例4: updatedJob
public function updatedJob(BatchJob $dbBatchJob)
{
$data = $dbBatchJob->getData();
$providerData = $data->getProviderData();
$entryId = $providerData->getEntryId();
$partnerId = $dbBatchJob->getPartnerId();
$spokenLanguage = $providerData->getSpokenLanguage();
if ($dbBatchJob->getStatus() == BatchJob::BATCHJOB_STATUS_DONT_PROCESS) {
$transcript = $this->getAssetsByLanguage($entryId, array(TranscriptPlugin::getAssetTypeCoreValue(TranscriptAssetType::TRANSCRIPT)), $spokenLanguage, true);
if (!$transcript) {
$transcript = new TranscriptAsset();
$transcript->setType(TranscriptPlugin::getAssetTypeCoreValue(TranscriptAssetType::TRANSCRIPT));
$transcript->setEntryId($entryId);
$transcript->setPartnerId($partnerId);
$transcript->setLanguage($spokenLanguage);
$transcript->setContainerFormat(AttachmentType::TEXT);
$transcript->setAccuracy(self::DEFAULT_ACCURACY);
}
$transcript->setStatus(AttachmentAsset::ASSET_STATUS_QUEUED);
$transcript->save();
return true;
}
$formatsString = $providerData->getCaptionAssetFormats();
if ($dbBatchJob->getStatus() == BatchJob::BATCHJOB_STATUS_FINISHED) {
$clientHelper = VoicebasePlugin::getClientHelper($providerData->getApiKey(), $providerData->getApiPassword());
$externalEntryExists = $clientHelper->checkExistingExternalContent($entryId);
if (!$externalEntryExists) {
KalturaLog::err('remote content does not exist');
return true;
}
$formatsArray = explode(',', $formatsString);
$formatsArray[] = "TXT";
$contentsArray = $clientHelper->getRemoteTranscripts($entryId, $formatsArray);
KalturaLog::debug('contents are - ' . print_r($contentsArray, true));
$transcript = $this->getAssetsByLanguage($entryId, array(TranscriptPlugin::getAssetTypeCoreValue(TranscriptAssetType::TRANSCRIPT)), $spokenLanguage, true);
$captions = $this->getAssetsByLanguage($entryId, array(CaptionPlugin::getAssetTypeCoreValue(CaptionAssetType::CAPTION)), $spokenLanguage);
$this->setObjectContent($transcript, $contentsArray["TXT"], null, true);
unset($contentsArray["TXT"]);
foreach ($contentsArray as $format => $content) {
$captionFormatConst = constant("KalturaCaptionType::" . $format);
if (isset($captions[$captionFormatConst])) {
$caption = $captions[$captionFormatConst];
} else {
$caption = new CaptionAsset();
$caption->setEntryId($entryId);
$caption->setPartnerId($partnerId);
$caption->setLanguage($spokenLanguage);
$caption->setContainerFormat($captionFormatConst);
$caption->setAccuracy(self::DEFAULT_ACCURACY);
$caption->setStatus(CaptionAsset::ASSET_STATUS_QUEUED);
$caption->save();
}
$this->setObjectContent($caption, $content, $format);
}
}
return true;
}
示例5: updatedJob
/**
* @param BatchJob $dbBatchJob
* @return bool true if should continue to the next consumer
*/
public function updatedJob(BatchJob $dbBatchJob)
{
$data = $dbBatchJob->getData();
switch ($dbBatchJob->getStatus()) {
case BatchJob::BATCHJOB_STATUS_FINISHED:
return self::handleJobFinished($dbBatchJob, $data);
default:
return $dbBatchJob;
}
}
示例6: updatedJob
public function updatedJob(BatchJob $dbBatchJob)
{
switch ($dbBatchJob->getStatus()) {
case BatchJob::BATCHJOB_STATUS_FINISHED:
$data = $dbBatchJob->getData();
$kontikiFileSync = FileSyncPeer::retrieveByPK($data->getSrcFileSyncId());
/* @var $data kStorageExportJobData */
$asset = assetPeer::retrieveByFileSync($kontikiFileSync);
$asset->setTags(KontikiPlugin::KONTIKI_ASSET_TAG);
$asset->save();
//Get Kontiki file sync and set the external URL
$kontikiFileSync->setFileRoot("");
$kontikiFileSync->setFilePath($data->getContentMoid());
$kontikiFileSync->save();
break;
}
return true;
}
示例7: updatedJob
public function updatedJob(BatchJob $dbBatchJob)
{
$data = $dbBatchJob->getData();
if (!$data instanceof kDistributionJobData) {
return true;
}
$doubleClickCoreValueType = kPluginableEnumsManager::apiToCore('DistributionProviderType', DoubleClickDistributionPlugin::getApiValue(DoubleClickDistributionProviderType::DOUBLECLICK));
if ($data->getProviderType() != $doubleClickCoreValueType) {
return true;
}
if ($dbBatchJob->getStatus() != BatchJob::BATCHJOB_STATUS_PENDING) {
return true;
}
$jobTypesToFinish = array(ContentDistributionPlugin::getBatchJobTypeCoreValue(ContentDistributionBatchJobType::DISTRIBUTION_SUBMIT), ContentDistributionPlugin::getBatchJobTypeCoreValue(ContentDistributionBatchJobType::DISTRIBUTION_UPDATE), ContentDistributionPlugin::getBatchJobTypeCoreValue(ContentDistributionBatchJobType::DISTRIBUTION_DELETE), ContentDistributionPlugin::getBatchJobTypeCoreValue(ContentDistributionBatchJobType::DISTRIBUTION_FETCH_REPORT), ContentDistributionPlugin::getBatchJobTypeCoreValue(ContentDistributionBatchJobType::DISTRIBUTION_ENABLE), ContentDistributionPlugin::getBatchJobTypeCoreValue(ContentDistributionBatchJobType::DISTRIBUTION_DISABLE));
if (in_array($dbBatchJob->getJobType(), $jobTypesToFinish)) {
kJobsManager::updateBatchJob($dbBatchJob, BatchJob::BATCHJOB_STATUS_FINISHED);
}
return true;
}
示例8: updatedJob
public function updatedJob(BatchJob $dbBatchJob, BatchJob $twinJob = null)
{
$data = $dbBatchJob->getData();
if (!$data instanceof kDistributionJobData) {
return true;
}
$attUverseCoreValueType = kPluginableEnumsManager::apiToCore('DistributionProviderType', AttUverseDistributionPlugin::getApiValue(AttUverseDistributionProviderType::ATT_UVERSE));
if ($data->getProviderType() != $attUverseCoreValueType) {
return true;
}
$jobTypesToFinish = array(ContentDistributionPlugin::getBatchJobTypeCoreValue(ContentDistributionBatchJobType::DISTRIBUTION_SUBMIT), ContentDistributionPlugin::getBatchJobTypeCoreValue(ContentDistributionBatchJobType::DISTRIBUTION_UPDATE));
if (in_array($dbBatchJob->getJobType(), $jobTypesToFinish) && $dbBatchJob->getStatus() == BatchJob::BATCHJOB_STATUS_FINISHED) {
return self::onDistributionJobFinished($dbBatchJob, $data, $twinJob);
}
if ($dbBatchJob->getJobType() == ContentDistributionPlugin::getBatchJobTypeCoreValue(ContentDistributionBatchJobType::DISTRIBUTION_DELETE) && $dbBatchJob->getStatus() == BatchJob::BATCHJOB_STATUS_PENDING) {
kJobsManager::updateBatchJob($dbBatchJob, BatchJob::BATCHJOB_STATUS_FINISHED);
}
return true;
}
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:19,代码来源:kAttUverseDistributionEventConsumer.php
示例9: copyModifiedColumns
protected function copyModifiedColumns(BatchJobLog $batchJobLog, BatchJob $batchJob, array $modifiedColumns)
{
foreach ($modifiedColumns as $modifiedColumn) {
try {
$fieldName = BatchJobPeer::translateFieldName($modifiedColumn, BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME);
$fieldPosJob = BatchJobPeer::translateFieldName($modifiedColumn, BasePeer::TYPE_COLNAME, BasePeer::TYPE_NUM);
$fieldPosLog = BatchJobLogPeer::translateFieldName($fieldName, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM);
} catch (PropelException $e) {
KalturaLog::err("Could not set value for BatchJobLog field {$fieldName}, exception thrown: " . $e->getMessage());
}
$batchJobLog->setByPosition($fieldPosLog, $batchJob->getByPosition($fieldPosJob));
if ($modifiedColumn == BatchJobPeer::DATA) {
//set param_1 for the $batchJobLog
$batchJobData = $batchJob->getData();
/* @var $batchJobData kBulkUploadJobData */
$batchJobLog->setParam1($batchJobData->getBulkUploadObjectType());
}
}
return $batchJobLog;
}
示例10: onDistributionJobFinished
/**
* @param BatchJob $dbBatchJob
* @return BatchJob
*/
public static function onDistributionJobFinished(BatchJob $dbBatchJob)
{
$data = $dbBatchJob->getData();
$entryDistribution = EntryDistributionPeer::retrieveByPK($data->getEntryDistributionId());
if (!$entryDistribution) {
KalturaLog::err('Entry distribution [' . $data->getEntryDistributionId() . '] not found');
return $dbBatchJob;
}
$providerData = $data->getProviderData();
if (!$providerData instanceof kCrossKalturaDistributionJobProviderData) {
KalturaLog::err('Wrong provider data class [' . get_class($providerData) . ']');
return $dbBatchJob;
}
$entryDistribution->putInCustomData(CrossKalturaDistributionCustomDataField::DISTRIBUTED_FLAVOR_ASSETS, $providerData->getDistributedFlavorAssets());
$entryDistribution->putInCustomData(CrossKalturaDistributionCustomDataField::DISTRIBUTED_THUMB_ASSETS, $providerData->getDistributedThumbAssets());
$entryDistribution->putInCustomData(CrossKalturaDistributionCustomDataField::DISTRIBUTED_METADATA, $providerData->getDistributedMetadata());
$entryDistribution->putInCustomData(CrossKalturaDistributionCustomDataField::DISTRIBUTED_CAPTION_ASSETS, $providerData->getDistributedCaptionAssets());
$entryDistribution->putInCustomData(CrossKalturaDistributionCustomDataField::DISTRIBUTED_CUE_POINTS, $providerData->getDistributedCuePoints());
$entryDistribution->save();
return $dbBatchJob;
}
示例11: onBulkUploadJobStatusUpdated
private function onBulkUploadJobStatusUpdated(BatchJob $dbBatchJob)
{
$xmlDropFolderFile = DropFolderFilePeer::retrieveByPK($dbBatchJob->getObjectId());
if (!$xmlDropFolderFile) {
return;
}
switch ($dbBatchJob->getStatus()) {
case BatchJob::BATCHJOB_STATUS_QUEUED:
$jobData = $dbBatchJob->getData();
if (!is_null($jobData->getFilePath())) {
$syncKey = $dbBatchJob->getSyncKey(BatchJob::FILE_SYNC_BATCHJOB_SUB_TYPE_BULKUPLOAD);
try {
kFileSyncUtils::moveFromFile($jobData->getFilePath(), $syncKey, true);
} catch (Exception $e) {
KalturaLog::err($e);
throw new APIException(APIErrors::BULK_UPLOAD_CREATE_CSV_FILE_SYNC_ERROR);
}
$filePath = kFileSyncUtils::getLocalFilePathForKey($syncKey);
$jobData->setFilePath($filePath);
//save new info on the batch job
$dbBatchJob->setData($jobData);
$dbBatchJob->save();
}
break;
case BatchJob::BATCHJOB_STATUS_FINISHED:
case BatchJob::BATCHJOB_STATUS_FINISHED_PARTIALLY:
$xmlDropFolderFile->setStatus(DropFolderFileStatus::HANDLED);
$xmlDropFolderFile->save();
break;
case BatchJob::BATCHJOB_STATUS_FAILED:
case BatchJob::BATCHJOB_STATUS_FATAL:
$relatedFiles = DropFolderFilePeer::retrieveByLeadIdAndStatuses($xmlDropFolderFile->getId(), array(DropFolderFileStatus::PROCESSING));
foreach ($relatedFiles as $relatedFile) {
$this->setFileError($relatedFile, DropFolderFileStatus::ERROR_HANDLING, DropFolderXmlBulkUploadPlugin::getErrorCodeCoreValue(DropFolderXmlBulkUploadErrorCode::ERROR_IN_BULK_UPLOAD), DropFolderXmlBulkUploadPlugin::ERROR_IN_BULK_UPLOAD_MESSAGE);
}
break;
}
}
示例12: toData
//.........这里部分代码省略.........
$this->data = KalturaProvisionJobData::getJobDataInstance($jobSubType);
}
break;
case KalturaBatchJobType::CONVERT_COLLECTION:
$dbData = new kConvertCollectionJobData();
if (is_null($this->data)) {
$this->data = new KalturaConvertCollectionJobData();
}
break;
case KalturaBatchJobType::STORAGE_EXPORT:
$dbData = new kStorageExportJobData();
if (is_null($this->data)) {
$this->data = new KalturaStorageExportJobData();
}
break;
case KalturaBatchJobType::MOVE_CATEGORY_ENTRIES:
$dbData = new kMoveCategoryEntriesJobData();
if (is_null($this->data)) {
$this->data = new KalturaMoveCategoryEntriesJobData();
}
break;
case KalturaBatchJobType::STORAGE_DELETE:
$dbData = new kStorageDeleteJobData();
if (is_null($this->data)) {
$this->data = new KalturaStorageDeleteJobData();
}
break;
case KalturaBatchJobType::CAPTURE_THUMB:
$dbData = new kCaptureThumbJobData();
if (is_null($this->data)) {
$this->data = new KalturaCaptureThumbJobData();
}
break;
case KalturaBatchJobType::INDEX:
$dbData = new kIndexJobData();
if (is_null($this->data)) {
$this->data = new KalturaIndexJobData();
}
break;
case KalturaBatchJobType::COPY:
$dbData = new kCopyJobData();
if (is_null($this->data)) {
$this->data = new KalturaCopyJobData();
}
break;
case KalturaBatchJobType::DELETE:
$dbData = new kDeleteJobData();
if (is_null($this->data)) {
$this->data = new KalturaDeleteJobData();
}
break;
case KalturaBatchJobType::DELETE_FILE:
$dbData = new kDeleteFileJobData();
if (is_null($this->data)) {
$this->data = new KalturaDeleteFileJobData();
}
break;
case KalturaBatchJobType::CONVERT_LIVE_SEGMENT:
$dbData = new kConvertLiveSegmentJobData();
if (is_null($this->data)) {
$this->data = new KalturaConvertLiveSegmentJobData();
}
break;
case KalturaBatchJobType::CONCAT:
$dbData = new kConcatJobData();
if (is_null($this->data)) {
$this->data = new KalturaConcatJobData();
}
break;
case KalturaBatchJobType::COPY_PARTNER:
$dbData = new kCopyPartnerJobData();
if (is_null($this->data)) {
$this->data = new KalturaCopyPartnerJobData();
}
break;
case KalturaBatchJobType::RECALCULATE_CACHE:
switch ($dbBatchJob->getJobSubType()) {
case RecalculateCacheType::RESPONSE_PROFILE:
$dbData = new kRecalculateResponseProfileCacheJobData();
if (is_null($this->data)) {
$this->data = new KalturaRecalculateResponseProfileCacheJobData();
}
break;
}
break;
default:
$dbData = KalturaPluginManager::loadObject('kJobData', $dbBatchJob->getJobType());
if (is_null($this->data)) {
$this->data = KalturaPluginManager::loadObject('KalturaJobData', $this->jobType);
}
}
if (is_null($dbBatchJob->getData())) {
$dbBatchJob->setData($dbData);
}
if ($this->data instanceof KalturaJobData) {
$dbData = $this->data->toObject($dbBatchJob->getData());
$dbBatchJob->setData($dbData);
}
return $dbData;
}
示例13: handleExtractMediaClosed
/**
* @param BatchJob $dbBatchJob
* @param kExtractMediaJobData $data
* @param BatchJob $twinJob
* @return BatchJob
*/
public static function handleExtractMediaClosed(BatchJob $dbBatchJob, kExtractMediaJobData $data, BatchJob $twinJob = null)
{
KalturaLog::debug("Extract media closed");
if ($dbBatchJob->getAbort()) {
return $dbBatchJob;
}
$rootBatchJob = $dbBatchJob->getRootJob();
if (!$rootBatchJob) {
return $dbBatchJob;
}
if ($twinJob) {
// copy media info
$twinData = $twinJob->getData();
if ($twinData->getMediaInfoId()) {
$twinMediaInfo = mediaInfoPeer::retrieveByPK($twinData->getMediaInfoId());
if ($twinMediaInfo) {
$mediaInfo = $twinMediaInfo->copy();
$mediaInfo->setFlavorAssetId($data->getFlavorAssetId());
$mediaInfo = kBatchManager::addMediaInfo($mediaInfo);
$data->setMediaInfoId($mediaInfo->getId());
$dbBatchJob->setData($data);
$dbBatchJob->save();
}
}
}
if ($dbBatchJob->getStatus() == BatchJob::BATCHJOB_STATUS_FINISHED) {
$entry = $dbBatchJob->getEntry();
if ($entry->getStatus() < entryStatus::READY) {
kBatchManager::updateEntry($dbBatchJob, entryStatus::PRECONVERT);
}
}
switch ($dbBatchJob->getJobSubType()) {
case mediaInfo::ASSET_TYPE_ENTRY_INPUT:
if ($rootBatchJob->getJobType() == BatchJobType::CONVERT_PROFILE) {
$conversionsCreated = kBusinessPreConvertDL::decideProfileConvert($dbBatchJob, $rootBatchJob, $data->getMediaInfoId());
if ($conversionsCreated) {
// handle the source flavor as if it was converted, makes the entry ready according to ready behavior rules
$currentFlavorAsset = flavorAssetPeer::retrieveById($data->getFlavorAssetId());
if ($currentFlavorAsset) {
$dbBatchJob = kBusinessPostConvertDL::handleConvertFinished($dbBatchJob, $currentFlavorAsset);
}
}
}
break;
case mediaInfo::ASSET_TYPE_FLAVOR_INPUT:
if ($rootBatchJob->getJobType() == BatchJobType::REMOTE_CONVERT) {
$remoteConvertData = $rootBatchJob->getData();
$errDescription = null;
$syncKey = null;
// TODO - how to get or create the sync key?
$newConvertJob = kBusinessPreConvertDL::decideFlavorConvert($syncKey, $remoteConvertData->getFlavorParamsOutputId(), $errDescription, $remoteConvertData->getMediaInfoId(), $dbBatchJob);
if (!$newConvertJob) {
kJobsManager::failBatchJob($rootBatchJob);
}
}
break;
default:
// currently do nothing
break;
}
return $dbBatchJob;
}
示例14: handleConvertFailed
public static function handleConvertFailed(BatchJob $dbBatchJob, $engineType, $flavorAssetId, $flavorParamsOutputId, $mediaInfoId)
{
$flavorAsset = assetPeer::retrieveById($flavorAssetId);
// verifies that flavor asset exists
if (!$flavorAsset) {
throw new APIException(APIErrors::INVALID_FLAVOR_ASSET_ID, $flavorAssetId);
}
$flavorAsset->setStatus(flavorAsset::FLAVOR_ASSET_STATUS_ERROR);
$flavorAsset->save();
// try to create a convert job with the next engine
if (!is_null($engineType)) {
$data = $dbBatchJob->getData();
if ($data instanceof kConvartableJobData) {
$data->incrementOperationSet();
$dbBatchJob->setData($data);
$dbBatchJob->save();
}
$newDbBatchJob = kBusinessPreConvertDL::redecideFlavorConvert($flavorAssetId, $flavorParamsOutputId, $mediaInfoId, $dbBatchJob, $engineType);
if ($newDbBatchJob) {
return true;
}
}
// find the root job
$rootBatchJob = $dbBatchJob->getRootJob();
if (!$rootBatchJob) {
return false;
}
// the root is already failed
if ($rootBatchJob->getStatus() == BatchJob::BATCHJOB_STATUS_FAILED || $rootBatchJob->getStatus() == BatchJob::BATCHJOB_STATUS_FATAL) {
return false;
}
// bulk download root job no need to handle
if ($rootBatchJob->getJobType() == BatchJobType::BULKDOWNLOAD) {
kJobsManager::failBatchJob($rootBatchJob, "Convert job " . $dbBatchJob->getId() . " failed");
return false;
}
if (is_null($flavorParamsOutputId)) {
kJobsManager::failBatchJob($rootBatchJob, "Job " . $dbBatchJob->getId() . " failed");
kBatchManager::updateEntry($dbBatchJob->getEntryId(), entryStatus::ERROR_CONVERTING);
return false;
}
$readyBehavior = $dbBatchJob->getData()->getReadyBehavior();
if ($readyBehavior == flavorParamsConversionProfile::READY_BEHAVIOR_REQUIRED) {
kJobsManager::failBatchJob($rootBatchJob, "Job " . $dbBatchJob->getId() . " failed");
kBatchManager::updateEntry($dbBatchJob->getEntryId(), entryStatus::ERROR_CONVERTING);
return false;
}
// failing the root profile job if all child jobs failed
if ($rootBatchJob->getJobType() != BatchJobType::CONVERT_PROFILE) {
return false;
}
$siblingJobs = $rootBatchJob->getChildJobs();
foreach ($siblingJobs as $siblingJob) {
/* @var $siblingJob BatchJob */
// not conversion job and should be ignored
if ($siblingJob->getJobType() != BatchJobType::CONVERT && $siblingJob->getJobType() != BatchJobType::POSTCONVERT) {
continue;
}
$jobData = $siblingJob->getData();
if (!$jobData || !$jobData instanceof kConvertJobData && !$jobData instanceof kPostConvertJobData) {
KalturaLog::err("Job id [" . $siblingJob->getId() . "] has no valid job data");
continue;
}
// found child flavor asset that hasn't failed, no need to fail the root job
$siblingFlavorAssetId = $jobData->getFlavorAssetId();
$siblingFlavorAsset = assetPeer::retrieveById($siblingFlavorAssetId);
if ($siblingFlavorAsset->getStatus() != flavorAsset::FLAVOR_ASSET_STATUS_ERROR && $siblingFlavorAsset->getStatus() != flavorAsset::FLAVOR_ASSET_STATUS_NOT_APPLICABLE && $siblingFlavorAsset->getStatus() != flavorAsset::FLAVOR_ASSET_STATUS_DELETED) {
return false;
}
}
// all conversions failed, should fail the root job
kJobsManager::failBatchJob($rootBatchJob, "All conversions failed");
kBatchManager::updateEntry($dbBatchJob->getEntryId(), entryStatus::ERROR_CONVERTING);
return false;
}
示例15: prepareNotificationData
public static function prepareNotificationData($url, $signature_key, BatchJob $job, $prefix = null)
{
$type = $job->getData()->getType();
$params = array("notification_id" => $job->getId(), "notification_type" => $job->getData()->getTypeAsString(), "puser_id" => $job->getData()->getUserId(), "partner_id" => $job->getPartnerId());
if (kNotificationJobData::isEntryNotification($type)) {
$params["entry_id"] = $job->getData()->getObjectId();
}
//$params["entryId"] = $not->getObjectId();
if (kNotificationJobData::isKshowNotification($type)) {
$params["kshow_id"] = $job->getData()->getObjectId();
}
// $params["kshowId"] = $not->getObjectId();
$object_data_params = myNotificationMgr::getDataAsArray($job->getData()->getData());
if ($object_data_params) {
$params = array_merge($params, $object_data_params);
}
$params = self::fixParams($params, $prefix);
$params['signed_fields'] = '';
foreach ($params as $key => $value) {
$params['signed_fields'] .= $key . ',';
}
return self::signParams($signature_key, $params);
}