/**
  * @action export
  * Action for manually exporting an entry
  * @param string $entryId
  * @param int $storageProfileId
  * @throws KalturaErrors::ENTRY_ID_NOT_FOUND
  * @throws KalturaErrors::STORAGE_PROFILE_ID_NOT_FOUND
  * @return KalturaBaseEntry The exported entry
  */
 public function exportAction($entryId, $storageProfileId)
 {
     $dbEntry = entryPeer::retrieveByPK($entryId);
     if (!$dbEntry) {
         throw new KalturaAPIException(KalturaErrors::ENTRY_ID_NOT_FOUND, $entryId);
     }
     $dbStorageProfile = StorageProfilePeer::retrieveByPK($storageProfileId);
     if (!$dbStorageProfile) {
         throw new KalturaAPIException(KalturaErrors::STORAGE_PROFILE_ID_NOT_FOUND, $storageProfileId);
     }
     kStorageExporter::exportEntry($dbEntry, $dbStorageProfile);
     //TODO: implement export errors
     $entry = KalturaEntryFactory::getInstanceByType($dbEntry->getType());
     $entry->fromObject($dbEntry);
     return $entry;
 }
Пример #2
0
 /**
  * @action export
  * Action for manually exporting an entry
  * @param string $entryId
  * @param int $storageProfileId
  * @throws KalturaErrors::ENTRY_ID_NOT_FOUND
  * @throws KalturaErrors::STORAGE_PROFILE_ID_NOT_FOUND
  * @return KalturaBaseEntry The exported entry
  */
 public function exportAction($entryId, $storageProfileId)
 {
     $dbEntry = entryPeer::retrieveByPK($entryId);
     if (!$dbEntry) {
         throw new KalturaAPIException(KalturaErrors::ENTRY_ID_NOT_FOUND, $entryId);
     }
     $dbStorageProfile = StorageProfilePeer::retrieveByPK($storageProfileId);
     if (!$dbStorageProfile) {
         throw new KalturaAPIException(KalturaErrors::STORAGE_PROFILE_ID_NOT_FOUND, $storageProfileId);
     }
     $scope = $dbStorageProfile->getScope();
     $scope->setEntryId($entryId);
     if (!$dbStorageProfile->fulfillsRules($scope)) {
         throw new KalturaAPIException(KalturaErrors::STORAGE_PROFILE_RULES_NOT_FULFILLED, $storageProfileId);
     }
     try {
         kStorageExporter::exportEntry($dbEntry, $dbStorageProfile);
     } catch (kCoreException $e) {
         if ($e->getCode() == kCoreException::PROFILE_STATUS_DISABLED) {
             throw new KalturaAPIException(APIErrors::PROFILE_STATUS_DISABLED, $entryId);
         }
     }
     //TODO: implement export errors
     $entry = KalturaEntryFactory::getInstanceByType($dbEntry->getType());
     $entry->fromObject($dbEntry, $this->getResponseProfile());
     return $entry;
 }