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.
-
#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.
418 419 420 |
# File 'lib/kaltura_plugins/kaltura_metadata_client_plugin.rb', line 418 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
424 425 426 427 428 429 430 431 432 433 434 435 436 |
# File 'lib/kaltura_plugins/kaltura_metadata_client_plugin.rb', line 424 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); # XML metadata client.add_param(kparams, 'xmlData', xml_data); client.queue_service_action_call('metadata_metadata', 'add', 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.
473 474 475 476 477 478 479 480 481 482 483 484 485 |
# File 'lib/kaltura_plugins/kaltura_metadata_client_plugin.rb', line 473 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); # XML metadata remote url client.add_param(kparams, 'url', url); client.queue_service_action_call('metadata_metadata', 'addFromBulk', 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
440 441 442 443 444 445 446 447 448 449 450 451 452 |
# File 'lib/kaltura_plugins/kaltura_metadata_client_plugin.rb', line 440 def add_from_file(, object_type, object_id, xml_file) kparams = {} client.add_param(kparams, 'metadataProfileId', ); client.add_param(kparams, 'objectType', object_type); client.add_param(kparams, 'objectId', object_id); # XML metadata client.add_param(kparams, 'xmlFile', xml_file); client.queue_service_action_call('metadata_metadata', 'addFromFile', kparams); 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
456 457 458 459 460 461 462 463 464 465 466 467 468 |
# File 'lib/kaltura_plugins/kaltura_metadata_client_plugin.rb', line 456 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); # XML metadata remote url client.add_param(kparams, 'url', url); client.queue_service_action_call('metadata_metadata', 'addFromUrl', kparams); if (client.is_multirequest) return nil; end return client.do_queue(); end |
#delete(id) ⇒ Object
Delete an existing metadata
544 545 546 547 548 549 550 551 552 |
# File 'lib/kaltura_plugins/kaltura_metadata_client_plugin.rb', line 544 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
489 490 491 492 493 494 495 496 497 |
# File 'lib/kaltura_plugins/kaltura_metadata_client_plugin.rb', line 489 def get(id) kparams = {} client.add_param(kparams, 'id', id); client.queue_service_action_call('metadata_metadata', 'get', 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
557 558 559 560 561 562 563 564 565 566 567 |
# File 'lib/kaltura_plugins/kaltura_metadata_client_plugin.rb', line 557 def invalidate(id, version=KalturaNotImplemented) kparams = {} client.add_param(kparams, 'id', id); # Enable update only if the metadata object version did not change by other process 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
531 532 533 534 535 536 537 538 539 540 |
# File 'lib/kaltura_plugins/kaltura_metadata_client_plugin.rb', line 531 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', kparams); if (client.is_multirequest) return nil; end return client.do_queue(); end |
#serve(id) ⇒ Object
Serves metadata XML file
571 572 573 574 575 576 |
# File 'lib/kaltura_plugins/kaltura_metadata_client_plugin.rb', line 571 def serve(id) kparams = {} client.add_param(kparams, 'id', id); client.queue_service_action_call('metadata_metadata', 'serve', kparams); return client.get_serve_url(); end |
#update(id, xml_data = KalturaNotImplemented, version = KalturaNotImplemented) ⇒ Object
Update an existing metadata object with new XML content
501 502 503 504 505 506 507 508 509 510 511 512 513 |
# File 'lib/kaltura_plugins/kaltura_metadata_client_plugin.rb', line 501 def update(id, xml_data=KalturaNotImplemented, version=KalturaNotImplemented) kparams = {} client.add_param(kparams, 'id', id); # XML metadata client.add_param(kparams, 'xmlData', xml_data); # Enable update only if the metadata object version did not change by other process client.add_param(kparams, 'version', version); client.queue_service_action_call('metadata_metadata', 'update', 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
517 518 519 520 521 522 523 524 525 526 527 |
# File 'lib/kaltura_plugins/kaltura_metadata_client_plugin.rb', line 517 def update_from_file(id, xml_file=KalturaNotImplemented) kparams = {} client.add_param(kparams, 'id', id); # XML metadata client.add_param(kparams, 'xmlFile', xml_file); client.queue_service_action_call('metadata_metadata', 'updateFromFile', kparams); 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.
580 581 582 583 584 585 586 587 588 589 |
# File 'lib/kaltura_plugins/kaltura_metadata_client_plugin.rb', line 580 def update_from_xsl(id, xsl_file) kparams = {} client.add_param(kparams, 'id', id); client.add_param(kparams, 'xslFile', xsl_file); client.queue_service_action_call('metadata_metadata', 'updateFromXSL', kparams); if (client.is_multirequest) return nil; end return client.do_queue(); end |