/**
  * @param AttachmentAsset $attachmentAsset
  * @param SimpleXMLElement $mrss
  * @return SimpleXMLElement
  */
 public function contributeAttachmentAssets(AttachmentAsset $attachmentAsset, SimpleXMLElement $mrss)
 {
     $attachment = $mrss->addChild('attachment');
     $attachment->addAttribute('url', $attachmentAsset->getDownloadUrl(true));
     $attachment->addAttribute('attachmentAssetId', $attachmentAsset->getId());
     $attachment->addAttribute('format', $attachmentAsset->getContainerFormat());
     $tags = $attachment->addChild('tags');
     foreach (explode(',', $attachmentAsset->getTags()) as $tag) {
         $tags->addChild('tag', kMrssManager::stringToSafeXml($tag));
     }
     $attachment->addChild('filename', $attachmentAsset->getFilename());
     $attachment->addChild('title', $attachmentAsset->getTitle());
     $attachment->addChild('description', $attachmentAsset->getPartnerDescription());
 }
 /**
  * @param AttachmentAsset $attachmentAsset
  * @param IRemoteStorageResource $contentResource
  * @throws KalturaErrors::STORAGE_PROFILE_ID_NOT_FOUND
  */
 protected function attachRemoteStorageResource(AttachmentAsset $attachmentAsset, IRemoteStorageResource $contentResource)
 {
     $resources = $contentResource->getResources();
     $attachmentAsset->setFileExt($contentResource->getFileExt());
     $attachmentAsset->incrementVersion();
     $attachmentAsset->setStatus(AttachmentAsset::ASSET_STATUS_READY);
     $attachmentAsset->save();
     $syncKey = $attachmentAsset->getSyncKey(AttachmentAsset::FILE_SYNC_ASSET_SUB_TYPE_ASSET);
     foreach ($resources as $currentResource) {
         $storageProfile = StorageProfilePeer::retrieveByPK($currentResource->getStorageProfileId());
         $fileSync = kFileSyncUtils::createReadyExternalSyncFileForKey($syncKey, $currentResource->getUrl(), $storageProfile);
     }
 }
Esempio n. 3
0
 public function applyDefaultValues()
 {
     parent::applyDefaultValues();
     $this->setType(TranscriptPlugin::getAssetTypeCoreValue(TranscriptAssetType::TRANSCRIPT));
 }