Class: Kaltura::KalturaDocumentService
- Inherits:
-
KalturaServiceBase
- Object
- KalturaServiceBase
- Kaltura::KalturaDocumentService
- Defined in:
- lib/kaltura_client.rb
Overview
Document service
Instance Attribute Summary
Attributes inherited from KalturaServiceBase
Instance Method Summary collapse
-
#add_from_entry(source_entry_id, document_entry = KalturaNotImplemented, source_flavor_params_id = KalturaNotImplemented) ⇒ Object
Copy entry into new entry.
-
#add_from_flavor_asset(source_flavor_asset_id, document_entry = KalturaNotImplemented) ⇒ Object
Copy flavor asset into new entry.
-
#add_from_uploaded_file(document_entry, upload_token_id) ⇒ Object
Add new document entry after the specific document file was uploaded and the upload token id exists.
-
#approve_replace(entry_id) ⇒ Object
Approves document replacement.
-
#cancel_replace(entry_id) ⇒ Object
Cancels document replacement.
-
#convert(entry_id, conversion_profile_id = KalturaNotImplemented, dynamic_conversion_attributes = KalturaNotImplemented) ⇒ Object
Convert entry.
-
#convert_ppt_to_swf(entry_id) ⇒ Object
This will queue a batch job for converting the document file to swf Returns the URL where the new swf will be available.
-
#delete(entry_id) ⇒ Object
Delete a document entry.
-
#get(entry_id, version = -1)) ⇒ Object
Get document entry by ID.
-
#initialize(client) ⇒ KalturaDocumentService
constructor
A new instance of KalturaDocumentService.
-
#list(filter = KalturaNotImplemented, pager = KalturaNotImplemented) ⇒ Object
List document entries by filter with paging support.
-
#serve(entry_id, flavor_asset_id = KalturaNotImplemented, force_proxy = false) ⇒ Object
Serves the file content.
-
#serve_by_flavor_params_id(entry_id, flavor_params_id = KalturaNotImplemented, force_proxy = false) ⇒ Object
Serves the file content.
-
#update(entry_id, document_entry) ⇒ Object
Update document entry.
-
#update_content(entry_id, resource, conversion_profile_id = KalturaNotImplemented) ⇒ Object
Replace content associated with the given document entry.
-
#upload(file_data) ⇒ Object
Upload a document file to Kaltura, then the file can be used to create a document entry.
Constructor Details
#initialize(client) ⇒ KalturaDocumentService
Returns a new instance of KalturaDocumentService.
1388 1389 1390 |
# File 'lib/kaltura_client.rb', line 1388 def initialize(client) super(client) end |
Instance Method Details
#add_from_entry(source_entry_id, document_entry = KalturaNotImplemented, source_flavor_params_id = KalturaNotImplemented) ⇒ Object
Copy entry into new entry
1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 |
# File 'lib/kaltura_client.rb', line 1407 def add_from_entry(source_entry_id, document_entry=KalturaNotImplemented, source_flavor_params_id=KalturaNotImplemented) kparams = {} client.add_param(kparams, 'sourceEntryId', source_entry_id) client.add_param(kparams, 'documentEntry', document_entry) client.add_param(kparams, 'sourceFlavorParamsId', source_flavor_params_id) client.queue_service_action_call('document', 'addFromEntry', 'KalturaDocumentEntry', kparams) if (client.is_multirequest) return nil end return client.do_queue() end |
#add_from_flavor_asset(source_flavor_asset_id, document_entry = KalturaNotImplemented) ⇒ Object
Copy flavor asset into new entry
1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 |
# File 'lib/kaltura_client.rb', line 1421 def add_from_flavor_asset(source_flavor_asset_id, document_entry=KalturaNotImplemented) kparams = {} client.add_param(kparams, 'sourceFlavorAssetId', source_flavor_asset_id) client.add_param(kparams, 'documentEntry', document_entry) client.queue_service_action_call('document', 'addFromFlavorAsset', 'KalturaDocumentEntry', kparams) if (client.is_multirequest) return nil end return client.do_queue() end |
#add_from_uploaded_file(document_entry, upload_token_id) ⇒ Object
Add new document entry after the specific document file was uploaded and the upload token id exists
1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 |
# File 'lib/kaltura_client.rb', line 1394 def add_from_uploaded_file(document_entry, upload_token_id) kparams = {} client.add_param(kparams, 'documentEntry', document_entry) client.add_param(kparams, 'uploadTokenId', upload_token_id) client.queue_service_action_call('document', 'addFromUploadedFile', 'KalturaDocumentEntry', kparams) if (client.is_multirequest) return nil end return client.do_queue() end |
#approve_replace(entry_id) ⇒ Object
Approves document replacement
1561 1562 1563 1564 1565 1566 1567 1568 1569 |
# File 'lib/kaltura_client.rb', line 1561 def approve_replace(entry_id) kparams = {} client.add_param(kparams, 'entryId', entry_id) client.queue_service_action_call('document', 'approveReplace', 'KalturaDocumentEntry', kparams) if (client.is_multirequest) return nil end return client.do_queue() end |
#cancel_replace(entry_id) ⇒ Object
Cancels document replacement
1573 1574 1575 1576 1577 1578 1579 1580 1581 |
# File 'lib/kaltura_client.rb', line 1573 def cancel_replace(entry_id) kparams = {} client.add_param(kparams, 'entryId', entry_id) client.queue_service_action_call('document', 'cancelReplace', 'KalturaDocumentEntry', kparams) if (client.is_multirequest) return nil end return client.do_queue() end |
#convert(entry_id, conversion_profile_id = KalturaNotImplemented, dynamic_conversion_attributes = KalturaNotImplemented) ⇒ Object
Convert entry
1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 |
# File 'lib/kaltura_client.rb', line 1434 def convert(entry_id, conversion_profile_id=KalturaNotImplemented, dynamic_conversion_attributes=KalturaNotImplemented) kparams = {} client.add_param(kparams, 'entryId', entry_id) client.add_param(kparams, 'conversionProfileId', conversion_profile_id) client.add_param(kparams, 'dynamicConversionAttributes', dynamic_conversion_attributes) client.queue_service_action_call('document', 'convert', 'bigint', kparams) if (client.is_multirequest) return nil end return client.do_queue() end |
#convert_ppt_to_swf(entry_id) ⇒ Object
This will queue a batch job for converting the document file to swf Returns the URL where the new swf will be available
1513 1514 1515 1516 1517 1518 1519 1520 1521 |
# File 'lib/kaltura_client.rb', line 1513 def convert_ppt_to_swf(entry_id) kparams = {} client.add_param(kparams, 'entryId', entry_id) client.queue_service_action_call('document', 'convertPptToSwf', 'string', kparams) if (client.is_multirequest) return nil end return client.do_queue() end |
#delete(entry_id) ⇒ Object
Delete a document entry.
1474 1475 1476 1477 1478 1479 1480 1481 1482 |
# File 'lib/kaltura_client.rb', line 1474 def delete(entry_id) kparams = {} client.add_param(kparams, 'entryId', entry_id) client.queue_service_action_call('document', 'delete', '', kparams) if (client.is_multirequest) return nil end return client.do_queue() end |
#get(entry_id, version = -1)) ⇒ Object
Get document entry by ID.
1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 |
# File 'lib/kaltura_client.rb', line 1448 def get(entry_id, version=-1) kparams = {} client.add_param(kparams, 'entryId', entry_id) client.add_param(kparams, 'version', version) client.queue_service_action_call('document', 'get', 'KalturaDocumentEntry', kparams) if (client.is_multirequest) return nil end return client.do_queue() end |
#list(filter = KalturaNotImplemented, pager = KalturaNotImplemented) ⇒ Object
List document entries by filter with paging support.
1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 |
# File 'lib/kaltura_client.rb', line 1486 def list(filter=KalturaNotImplemented, pager=KalturaNotImplemented) kparams = {} client.add_param(kparams, 'filter', filter) client.add_param(kparams, 'pager', pager) client.queue_service_action_call('document', 'list', 'KalturaDocumentListResponse', kparams) if (client.is_multirequest) return nil end return client.do_queue() end |
#serve(entry_id, flavor_asset_id = KalturaNotImplemented, force_proxy = false) ⇒ Object
Serves the file content
1525 1526 1527 1528 1529 1530 1531 1532 |
# File 'lib/kaltura_client.rb', line 1525 def serve(entry_id, flavor_asset_id=KalturaNotImplemented, force_proxy=false) kparams = {} client.add_param(kparams, 'entryId', entry_id) client.add_param(kparams, 'flavorAssetId', flavor_asset_id) client.add_param(kparams, 'forceProxy', force_proxy) client.queue_service_action_call('document', 'serve', 'file', kparams) return client.get_serve_url() end |
#serve_by_flavor_params_id(entry_id, flavor_params_id = KalturaNotImplemented, force_proxy = false) ⇒ Object
Serves the file content
1536 1537 1538 1539 1540 1541 1542 1543 |
# File 'lib/kaltura_client.rb', line 1536 def serve_by_flavor_params_id(entry_id, flavor_params_id=KalturaNotImplemented, force_proxy=false) kparams = {} client.add_param(kparams, 'entryId', entry_id) client.add_param(kparams, 'flavorParamsId', flavor_params_id) client.add_param(kparams, 'forceProxy', force_proxy) client.queue_service_action_call('document', 'serveByFlavorParamsId', 'file', kparams) return client.get_serve_url() end |
#update(entry_id, document_entry) ⇒ Object
Update document entry. Only the properties that were set will be updated.
1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 |
# File 'lib/kaltura_client.rb', line 1461 def update(entry_id, document_entry) kparams = {} client.add_param(kparams, 'entryId', entry_id) client.add_param(kparams, 'documentEntry', document_entry) client.queue_service_action_call('document', 'update', 'KalturaDocumentEntry', kparams) if (client.is_multirequest) return nil end return client.do_queue() end |
#update_content(entry_id, resource, conversion_profile_id = KalturaNotImplemented) ⇒ Object
Replace content associated with the given document entry.
1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 |
# File 'lib/kaltura_client.rb', line 1547 def update_content(entry_id, resource, conversion_profile_id=KalturaNotImplemented) kparams = {} client.add_param(kparams, 'entryId', entry_id) client.add_param(kparams, 'resource', resource) client.add_param(kparams, 'conversionProfileId', conversion_profile_id) client.queue_service_action_call('document', 'updateContent', 'KalturaDocumentEntry', kparams) if (client.is_multirequest) return nil end return client.do_queue() end |
#upload(file_data) ⇒ Object
Upload a document file to Kaltura, then the file can be used to create a document entry.
1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 |
# File 'lib/kaltura_client.rb', line 1499 def upload(file_data) kparams = {} kfiles = {} client.add_param(kfiles, 'fileData', file_data) client.queue_service_action_call('document', 'upload', 'string', kparams, kfiles) if (client.is_multirequest) return nil end return client.do_queue() end |