. // // @ignore // =================================================================================================== /** * @package Kaltura * @subpackage Client */ class Kaltura_Client_Document_DocumentsService extends Kaltura_Client_ServiceBase { function __construct(Kaltura_Client_Client $client = null) { parent::__construct($client); } function addFromUploadedFile(Kaltura_Client_Document_Type_DocumentEntry $documentEntry, $uploadTokenId) { $kparams = array(); $this->client->addParam($kparams, "documentEntry", $documentEntry->toParams()); $this->client->addParam($kparams, "uploadTokenId", $uploadTokenId); $this->client->queueServiceActionCall("document_documents", "addFromUploadedFile", $kparams); if ($this->client->isMultiRequest()) return $this->client->getMultiRequestResult(); $resultObject = $this->client->doQueue(); $this->client->throwExceptionIfError($resultObject); $this->client->validateObjectType($resultObject, "Kaltura_Client_Document_Type_DocumentEntry"); return $resultObject; } function addFromEntry($sourceEntryId, Kaltura_Client_Document_Type_DocumentEntry $documentEntry = null, $sourceFlavorParamsId = null) { $kparams = array(); $this->client->addParam($kparams, "sourceEntryId", $sourceEntryId); if ($documentEntry !== null) $this->client->addParam($kparams, "documentEntry", $documentEntry->toParams()); $this->client->addParam($kparams, "sourceFlavorParamsId", $sourceFlavorParamsId); $this->client->queueServiceActionCall("document_documents", "addFromEntry", $kparams); if ($this->client->isMultiRequest()) return $this->client->getMultiRequestResult(); $resultObject = $this->client->doQueue(); $this->client->throwExceptionIfError($resultObject); $this->client->validateObjectType($resultObject, "Kaltura_Client_Document_Type_DocumentEntry"); return $resultObject; } function addFromFlavorAsset($sourceFlavorAssetId, Kaltura_Client_Document_Type_DocumentEntry $documentEntry = null) { $kparams = array(); $this->client->addParam($kparams, "sourceFlavorAssetId", $sourceFlavorAssetId); if ($documentEntry !== null) $this->client->addParam($kparams, "documentEntry", $documentEntry->toParams()); $this->client->queueServiceActionCall("document_documents", "addFromFlavorAsset", $kparams); if ($this->client->isMultiRequest()) return $this->client->getMultiRequestResult(); $resultObject = $this->client->doQueue(); $this->client->throwExceptionIfError($resultObject); $this->client->validateObjectType($resultObject, "Kaltura_Client_Document_Type_DocumentEntry"); return $resultObject; } function convert($entryId, $conversionProfileId = null, array $dynamicConversionAttributes = null) { $kparams = array(); $this->client->addParam($kparams, "entryId", $entryId); $this->client->addParam($kparams, "conversionProfileId", $conversionProfileId); if ($dynamicConversionAttributes !== null) foreach($dynamicConversionAttributes as $index => $obj) { $this->client->addParam($kparams, "dynamicConversionAttributes:$index", $obj->toParams()); } $this->client->queueServiceActionCall("document_documents", "convert", $kparams); if ($this->client->isMultiRequest()) return $this->client->getMultiRequestResult(); $resultObject = $this->client->doQueue(); $this->client->throwExceptionIfError($resultObject); $this->client->validateObjectType($resultObject, "integer"); return $resultObject; } function get($entryId, $version = -1) { $kparams = array(); $this->client->addParam($kparams, "entryId", $entryId); $this->client->addParam($kparams, "version", $version); $this->client->queueServiceActionCall("document_documents", "get", $kparams); if ($this->client->isMultiRequest()) return $this->client->getMultiRequestResult(); $resultObject = $this->client->doQueue(); $this->client->throwExceptionIfError($resultObject); $this->client->validateObjectType($resultObject, "Kaltura_Client_Document_Type_DocumentEntry"); return $resultObject; } function update($entryId, Kaltura_Client_Document_Type_DocumentEntry $documentEntry) { $kparams = array(); $this->client->addParam($kparams, "entryId", $entryId); $this->client->addParam($kparams, "documentEntry", $documentEntry->toParams()); $this->client->queueServiceActionCall("document_documents", "update", $kparams); if ($this->client->isMultiRequest()) return $this->client->getMultiRequestResult(); $resultObject = $this->client->doQueue(); $this->client->throwExceptionIfError($resultObject); $this->client->validateObjectType($resultObject, "Kaltura_Client_Document_Type_DocumentEntry"); return $resultObject; } function delete($entryId) { $kparams = array(); $this->client->addParam($kparams, "entryId", $entryId); $this->client->queueServiceActionCall("document_documents", "delete", $kparams); if ($this->client->isMultiRequest()) return $this->client->getMultiRequestResult(); $resultObject = $this->client->doQueue(); $this->client->throwExceptionIfError($resultObject); return $resultObject; } function listAction(Kaltura_Client_Document_Type_DocumentEntryFilter $filter = null, Kaltura_Client_Type_FilterPager $pager = null) { $kparams = array(); if ($filter !== null) $this->client->addParam($kparams, "filter", $filter->toParams()); if ($pager !== null) $this->client->addParam($kparams, "pager", $pager->toParams()); $this->client->queueServiceActionCall("document_documents", "list", $kparams); if ($this->client->isMultiRequest()) return $this->client->getMultiRequestResult(); $resultObject = $this->client->doQueue(); $this->client->throwExceptionIfError($resultObject); $this->client->validateObjectType($resultObject, "Kaltura_Client_Document_Type_DocumentListResponse"); return $resultObject; } function upload($fileData) { $kparams = array(); $kfiles = array(); $this->client->addParam($kfiles, "fileData", $fileData); $this->client->queueServiceActionCall("document_documents", "upload", $kparams, $kfiles); if ($this->client->isMultiRequest()) return $this->client->getMultiRequestResult(); $resultObject = $this->client->doQueue(); $this->client->throwExceptionIfError($resultObject); if(!$resultObject) $resultObject = array(); $this->client->validateObjectType($resultObject, "string"); return $resultObject; } function convertPptToSwf($entryId) { $kparams = array(); $this->client->addParam($kparams, "entryId", $entryId); $this->client->queueServiceActionCall("document_documents", "convertPptToSwf", $kparams); if ($this->client->isMultiRequest()) return $this->client->getMultiRequestResult(); $resultObject = $this->client->doQueue(); $this->client->throwExceptionIfError($resultObject); if(!$resultObject) $resultObject = array(); $this->client->validateObjectType($resultObject, "string"); return $resultObject; } function serve($entryId, $flavorAssetId = null, $forceProxy = false) { $kparams = array(); $this->client->addParam($kparams, "entryId", $entryId); $this->client->addParam($kparams, "flavorAssetId", $flavorAssetId); $this->client->addParam($kparams, "forceProxy", $forceProxy); $this->client->queueServiceActionCall('document_documents', 'serve', $kparams); $resultObject = $this->client->getServeUrl(); return $resultObject; } function serveByFlavorParamsId($entryId, $flavorParamsId = null, $forceProxy = false) { $kparams = array(); $this->client->addParam($kparams, "entryId", $entryId); $this->client->addParam($kparams, "flavorParamsId", $flavorParamsId); $this->client->addParam($kparams, "forceProxy", $forceProxy); $this->client->queueServiceActionCall('document_documents', 'serveByFlavorParamsId', $kparams); $resultObject = $this->client->getServeUrl(); return $resultObject; } function updateContent($entryId, Kaltura_Client_Type_Resource $resource, $conversionProfileId = null) { $kparams = array(); $this->client->addParam($kparams, "entryId", $entryId); $this->client->addParam($kparams, "resource", $resource->toParams()); $this->client->addParam($kparams, "conversionProfileId", $conversionProfileId); $this->client->queueServiceActionCall("document_documents", "updateContent", $kparams); if ($this->client->isMultiRequest()) return $this->client->getMultiRequestResult(); $resultObject = $this->client->doQueue(); $this->client->throwExceptionIfError($resultObject); $this->client->validateObjectType($resultObject, "Kaltura_Client_Document_Type_DocumentEntry"); return $resultObject; } function approveReplace($entryId) { $kparams = array(); $this->client->addParam($kparams, "entryId", $entryId); $this->client->queueServiceActionCall("document_documents", "approveReplace", $kparams); if ($this->client->isMultiRequest()) return $this->client->getMultiRequestResult(); $resultObject = $this->client->doQueue(); $this->client->throwExceptionIfError($resultObject); $this->client->validateObjectType($resultObject, "Kaltura_Client_Document_Type_DocumentEntry"); return $resultObject; } function cancelReplace($entryId) { $kparams = array(); $this->client->addParam($kparams, "entryId", $entryId); $this->client->queueServiceActionCall("document_documents", "cancelReplace", $kparams); if ($this->client->isMultiRequest()) return $this->client->getMultiRequestResult(); $resultObject = $this->client->doQueue(); $this->client->throwExceptionIfError($resultObject); $this->client->validateObjectType($resultObject, "Kaltura_Client_Document_Type_DocumentEntry"); return $resultObject; } }