Class: Kaltura::KalturaMetadataService
- Inherits:
-
KalturaServiceBase
- Object
- KalturaServiceBase
- Kaltura::KalturaMetadataService
- Defined in:
- lib/kaltura_plugins/kaltura_metadata_client_plugin.rb
Overview
Metadata service
Instance Attribute Summary
Attributes inherited from KalturaServiceBase
Instance Method Summary collapse
-
#add(metadata_profile_id, object_type, object_id, xml_data) ⇒ Object
Allows you to add a metadata object and metadata content associated with Kaltura object.
-
#add_from_bulk(metadata_profile_id, object_type, object_id, url) ⇒ Object
Allows you to add a metadata xml data from remote URL.
-
#add_from_file(metadata_profile_id, object_type, object_id, xml_file) ⇒ Object
Allows you to add a metadata object and metadata file associated with Kaltura object.
-
#add_from_url(metadata_profile_id, object_type, object_id, url) ⇒ Object
Allows you to add a metadata xml data from remote URL.
-
#delete(id) ⇒ Object
Delete an existing metadata.
-
#get(id) ⇒ Object
Retrieve a metadata object by id.
-
#index(id, should_update) ⇒ Object
Index metadata by id, will also index the related object.
-
#initialize(client) ⇒ KalturaMetadataService
constructor
A new instance of KalturaMetadataService.
-
#invalidate(id, version = KalturaNotImplemented) ⇒ Object
Mark existing metadata as invalid Used by batch metadata transform.
-
#list(filter = KalturaNotImplemented, pager = KalturaNotImplemented) ⇒ Object
List metadata objects by filter and pager.
-
#serve(id) ⇒ Object
Serves metadata XML file.
-
#update(id, xml_data = KalturaNotImplemented, version = KalturaNotImplemented) ⇒ Object
Update an existing metadata object with new XML content.
-
#update_from_file(id, xml_file = KalturaNotImplemented) ⇒ Object
Update an existing metadata object with new XML file.
-
#update_from_xsl(id, xsl_file) ⇒ Object
Action transforms current metadata object XML using a provided XSL.
Constructor Details
#initialize(client) ⇒ KalturaMetadataService
Returns a new instance of KalturaMetadataService.
599 600 601 |
# File 'lib/kaltura_plugins/kaltura_metadata_client_plugin.rb', line 599 def initialize(client) super(client) end |
Instance Method Details
#add(metadata_profile_id, object_type, object_id, xml_data) ⇒ Object
Allows you to add a metadata object and metadata content associated with Kaltura object
605 606 607 608 609 610 611 612 613 614 615 616 |
# File 'lib/kaltura_plugins/kaltura_metadata_client_plugin.rb', line 605 def add(, object_type, object_id, xml_data) kparams = {} client.add_param(kparams, 'metadataProfileId', ) client.add_param(kparams, 'objectType', object_type) client.add_param(kparams, 'objectId', object_id) client.add_param(kparams, 'xmlData', xml_data) client.queue_service_action_call('metadata_metadata', 'add', 'KalturaMetadata', kparams) if (client.is_multirequest) return nil end return client.do_queue() end |
#add_from_bulk(metadata_profile_id, object_type, object_id, url) ⇒ Object
Allows you to add a metadata xml data from remote URL. Enables different permissions than addFromUrl action.
652 653 654 655 656 657 658 659 660 661 662 663 |
# File 'lib/kaltura_plugins/kaltura_metadata_client_plugin.rb', line 652 def add_from_bulk(, object_type, object_id, url) kparams = {} client.add_param(kparams, 'metadataProfileId', ) client.add_param(kparams, 'objectType', object_type) client.add_param(kparams, 'objectId', object_id) client.add_param(kparams, 'url', url) client.queue_service_action_call('metadata_metadata', 'addFromBulk', 'KalturaMetadata', kparams) if (client.is_multirequest) return nil end return client.do_queue() end |
#add_from_file(metadata_profile_id, object_type, object_id, xml_file) ⇒ Object
Allows you to add a metadata object and metadata file associated with Kaltura object
620 621 622 623 624 625 626 627 628 629 630 631 632 |
# File 'lib/kaltura_plugins/kaltura_metadata_client_plugin.rb', line 620 def add_from_file(, object_type, object_id, xml_file) kparams = {} kfiles = {} client.add_param(kparams, 'metadataProfileId', ) client.add_param(kparams, 'objectType', object_type) client.add_param(kparams, 'objectId', object_id) client.add_param(kfiles, 'xmlFile', xml_file) client.queue_service_action_call('metadata_metadata', 'addFromFile', 'KalturaMetadata', kparams, kfiles) if (client.is_multirequest) return nil end return client.do_queue() end |
#add_from_url(metadata_profile_id, object_type, object_id, url) ⇒ Object
Allows you to add a metadata xml data from remote URL
636 637 638 639 640 641 642 643 644 645 646 647 |
# File 'lib/kaltura_plugins/kaltura_metadata_client_plugin.rb', line 636 def add_from_url(, object_type, object_id, url) kparams = {} client.add_param(kparams, 'metadataProfileId', ) client.add_param(kparams, 'objectType', object_type) client.add_param(kparams, 'objectId', object_id) client.add_param(kparams, 'url', url) client.queue_service_action_call('metadata_metadata', 'addFromUrl', 'KalturaMetadata', kparams) if (client.is_multirequest) return nil end return client.do_queue() end |
#delete(id) ⇒ Object
Delete an existing metadata
720 721 722 723 724 725 726 727 728 |
# File 'lib/kaltura_plugins/kaltura_metadata_client_plugin.rb', line 720 def delete(id) kparams = {} client.add_param(kparams, 'id', id) client.queue_service_action_call('metadata_metadata', 'delete', '', kparams) if (client.is_multirequest) return nil end return client.do_queue() end |
#get(id) ⇒ Object
Retrieve a metadata object by id
667 668 669 670 671 672 673 674 675 |
# File 'lib/kaltura_plugins/kaltura_metadata_client_plugin.rb', line 667 def get(id) kparams = {} client.add_param(kparams, 'id', id) client.queue_service_action_call('metadata_metadata', 'get', 'KalturaMetadata', kparams) if (client.is_multirequest) return nil end return client.do_queue() end |
#index(id, should_update) ⇒ Object
Index metadata by id, will also index the related object
746 747 748 749 750 751 752 753 754 755 |
# File 'lib/kaltura_plugins/kaltura_metadata_client_plugin.rb', line 746 def index(id, should_update) kparams = {} client.add_param(kparams, 'id', id) client.add_param(kparams, 'shouldUpdate', should_update) client.queue_service_action_call('metadata_metadata', 'index', 'int', kparams) if (client.is_multirequest) return nil end return client.do_queue() end |
#invalidate(id, version = KalturaNotImplemented) ⇒ Object
Mark existing metadata as invalid Used by batch metadata transform
733 734 735 736 737 738 739 740 741 742 |
# File 'lib/kaltura_plugins/kaltura_metadata_client_plugin.rb', line 733 def invalidate(id, version=KalturaNotImplemented) kparams = {} client.add_param(kparams, 'id', id) client.add_param(kparams, 'version', version) client.queue_service_action_call('metadata_metadata', 'invalidate', '', kparams) if (client.is_multirequest) return nil end return client.do_queue() end |
#list(filter = KalturaNotImplemented, pager = KalturaNotImplemented) ⇒ Object
List metadata objects by filter and pager
707 708 709 710 711 712 713 714 715 716 |
# File 'lib/kaltura_plugins/kaltura_metadata_client_plugin.rb', line 707 def list(filter=KalturaNotImplemented, pager=KalturaNotImplemented) kparams = {} client.add_param(kparams, 'filter', filter) client.add_param(kparams, 'pager', pager) client.queue_service_action_call('metadata_metadata', 'list', 'KalturaMetadataListResponse', kparams) if (client.is_multirequest) return nil end return client.do_queue() end |
#serve(id) ⇒ Object
Serves metadata XML file
759 760 761 762 763 764 |
# File 'lib/kaltura_plugins/kaltura_metadata_client_plugin.rb', line 759 def serve(id) kparams = {} client.add_param(kparams, 'id', id) client.queue_service_action_call('metadata_metadata', 'serve', 'file', kparams) return client.get_serve_url() end |
#update(id, xml_data = KalturaNotImplemented, version = KalturaNotImplemented) ⇒ Object
Update an existing metadata object with new XML content
679 680 681 682 683 684 685 686 687 688 689 |
# File 'lib/kaltura_plugins/kaltura_metadata_client_plugin.rb', line 679 def update(id, xml_data=KalturaNotImplemented, version=KalturaNotImplemented) kparams = {} client.add_param(kparams, 'id', id) client.add_param(kparams, 'xmlData', xml_data) client.add_param(kparams, 'version', version) client.queue_service_action_call('metadata_metadata', 'update', 'KalturaMetadata', kparams) if (client.is_multirequest) return nil end return client.do_queue() end |
#update_from_file(id, xml_file = KalturaNotImplemented) ⇒ Object
Update an existing metadata object with new XML file
693 694 695 696 697 698 699 700 701 702 703 |
# File 'lib/kaltura_plugins/kaltura_metadata_client_plugin.rb', line 693 def update_from_file(id, xml_file=KalturaNotImplemented) kparams = {} kfiles = {} client.add_param(kparams, 'id', id) client.add_param(kfiles, 'xmlFile', xml_file) client.queue_service_action_call('metadata_metadata', 'updateFromFile', 'KalturaMetadata', kparams, kfiles) if (client.is_multirequest) return nil end return client.do_queue() end |
#update_from_xsl(id, xsl_file) ⇒ Object
Action transforms current metadata object XML using a provided XSL.
768 769 770 771 772 773 774 775 776 777 778 |
# File 'lib/kaltura_plugins/kaltura_metadata_client_plugin.rb', line 768 def update_from_xsl(id, xsl_file) kparams = {} kfiles = {} client.add_param(kparams, 'id', id) client.add_param(kfiles, 'xslFile', xsl_file) client.queue_service_action_call('metadata_metadata', 'updateFromXSL', 'KalturaMetadata', kparams, kfiles) if (client.is_multirequest) return nil end return client.do_queue() end |