Class: Kaltura::KalturaDocumentsService
- Inherits:
-
KalturaServiceBase
- Object
- KalturaServiceBase
- Kaltura::KalturaDocumentsService
- Defined in:
- lib/kaltura_plugins/kaltura_document_client_plugin.rb
Overview
Document service lets you upload and manage document files
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) ⇒ KalturaDocumentsService
constructor
A new instance of KalturaDocumentsService.
-
#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) ⇒ KalturaDocumentsService
Returns a new instance of KalturaDocumentsService.
447 448 449 |
# File 'lib/kaltura_plugins/kaltura_document_client_plugin.rb', line 447 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
466 467 468 469 470 471 472 473 474 475 476 |
# File 'lib/kaltura_plugins/kaltura_document_client_plugin.rb', line 466 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_documents', '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
480 481 482 483 484 485 486 487 488 489 |
# File 'lib/kaltura_plugins/kaltura_document_client_plugin.rb', line 480 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_documents', '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
453 454 455 456 457 458 459 460 461 462 |
# File 'lib/kaltura_plugins/kaltura_document_client_plugin.rb', line 453 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_documents', 'addFromUploadedFile', 'KalturaDocumentEntry', kparams) if (client.is_multirequest) return nil end return client.do_queue() end |
#approve_replace(entry_id) ⇒ Object
Approves document replacement
620 621 622 623 624 625 626 627 628 |
# File 'lib/kaltura_plugins/kaltura_document_client_plugin.rb', line 620 def approve_replace(entry_id) kparams = {} client.add_param(kparams, 'entryId', entry_id) client.queue_service_action_call('document_documents', 'approveReplace', 'KalturaDocumentEntry', kparams) if (client.is_multirequest) return nil end return client.do_queue() end |
#cancel_replace(entry_id) ⇒ Object
Cancels document replacement
632 633 634 635 636 637 638 639 640 |
# File 'lib/kaltura_plugins/kaltura_document_client_plugin.rb', line 632 def cancel_replace(entry_id) kparams = {} client.add_param(kparams, 'entryId', entry_id) client.queue_service_action_call('document_documents', '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
493 494 495 496 497 498 499 500 501 502 503 |
# File 'lib/kaltura_plugins/kaltura_document_client_plugin.rb', line 493 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_documents', '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
572 573 574 575 576 577 578 579 580 |
# File 'lib/kaltura_plugins/kaltura_document_client_plugin.rb', line 572 def convert_ppt_to_swf(entry_id) kparams = {} client.add_param(kparams, 'entryId', entry_id) client.queue_service_action_call('document_documents', 'convertPptToSwf', 'string', kparams) if (client.is_multirequest) return nil end return client.do_queue() end |
#delete(entry_id) ⇒ Object
Delete a document entry.
533 534 535 536 537 538 539 540 541 |
# File 'lib/kaltura_plugins/kaltura_document_client_plugin.rb', line 533 def delete(entry_id) kparams = {} client.add_param(kparams, 'entryId', entry_id) client.queue_service_action_call('document_documents', '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.
507 508 509 510 511 512 513 514 515 516 |
# File 'lib/kaltura_plugins/kaltura_document_client_plugin.rb', line 507 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_documents', '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.
545 546 547 548 549 550 551 552 553 554 |
# File 'lib/kaltura_plugins/kaltura_document_client_plugin.rb', line 545 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_documents', '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
584 585 586 587 588 589 590 591 |
# File 'lib/kaltura_plugins/kaltura_document_client_plugin.rb', line 584 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_documents', '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
595 596 597 598 599 600 601 602 |
# File 'lib/kaltura_plugins/kaltura_document_client_plugin.rb', line 595 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_documents', '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.
520 521 522 523 524 525 526 527 528 529 |
# File 'lib/kaltura_plugins/kaltura_document_client_plugin.rb', line 520 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_documents', '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.
606 607 608 609 610 611 612 613 614 615 616 |
# File 'lib/kaltura_plugins/kaltura_document_client_plugin.rb', line 606 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_documents', '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.
558 559 560 561 562 563 564 565 566 567 |
# File 'lib/kaltura_plugins/kaltura_document_client_plugin.rb', line 558 def upload(file_data) kparams = {} kfiles = {} client.add_param(kfiles, 'fileData', file_data) client.queue_service_action_call('document_documents', 'upload', 'string', kparams, kfiles) if (client.is_multirequest) return nil end return client.do_queue() end |