Class: Kaltura::KalturaMetadataService

Inherits:
KalturaServiceBase show all
Defined in:
lib/kaltura_plugins/kaltura_metadata_client_plugin.rb

Overview

Metadata service

Instance Attribute Summary

Attributes inherited from KalturaServiceBase

#client

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ KalturaMetadataService

Returns a new instance of KalturaMetadataService.



823
824
825
# File 'lib/kaltura_plugins/kaltura_metadata_client_plugin.rb', line 823

def initialize(client)
	super(client)
end

Instance Method Details

#add(metadata_profile_id, object_type, object_id, xml_data) ⇒ KalturaMetadata

Allows you to add a metadata object and metadata content associated with Kaltura object

Returns:



829
830
831
832
833
834
835
836
837
838
839
840
# File 'lib/kaltura_plugins/kaltura_metadata_client_plugin.rb', line 829

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) ⇒ KalturaMetadata

Allows you to add a metadata XML data from remote URL. Enables different permissions than addFromUrl action.

Returns:



845
846
847
848
849
850
851
852
853
854
855
856
# File 'lib/kaltura_plugins/kaltura_metadata_client_plugin.rb', line 845

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) ⇒ KalturaMetadata

Allows you to add a metadata object and metadata file associated with Kaltura object

Returns:



860
861
862
863
864
865
866
867
868
869
870
871
872
# File 'lib/kaltura_plugins/kaltura_metadata_client_plugin.rb', line 860

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) ⇒ KalturaMetadata

Allows you to add a metadata XML data from remote URL

Returns:



876
877
878
879
880
881
882
883
884
885
886
887
# File 'lib/kaltura_plugins/kaltura_metadata_client_plugin.rb', line 876

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

Returns:



891
892
893
894
895
896
897
898
899
# File 'lib/kaltura_plugins/kaltura_metadata_client_plugin.rb', line 891

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) ⇒ KalturaMetadata

Retrieve a metadata object by id

Returns:



903
904
905
906
907
908
909
910
911
# File 'lib/kaltura_plugins/kaltura_metadata_client_plugin.rb', line 903

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) ⇒ int

Index metadata by id, will also index the related object

Returns:

  • (int)


915
916
917
918
919
920
921
922
923
924
# File 'lib/kaltura_plugins/kaltura_metadata_client_plugin.rb', line 915

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

Returns:



929
930
931
932
933
934
935
936
937
938
# File 'lib/kaltura_plugins/kaltura_metadata_client_plugin.rb', line 929

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) ⇒ KalturaMetadataListResponse

List metadata objects by filter and pager



942
943
944
945
946
947
948
949
950
951
# File 'lib/kaltura_plugins/kaltura_metadata_client_plugin.rb', line 942

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) ⇒ file

Serves metadata XML file

Returns:

  • (file)


955
956
957
958
959
960
# File 'lib/kaltura_plugins/kaltura_metadata_client_plugin.rb', line 955

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) ⇒ KalturaMetadata

Update an existing metadata object with new XML content

Returns:



964
965
966
967
968
969
970
971
972
973
974
# File 'lib/kaltura_plugins/kaltura_metadata_client_plugin.rb', line 964

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) ⇒ KalturaMetadata

Update an existing metadata object with new XML file

Returns:



978
979
980
981
982
983
984
985
986
987
988
# File 'lib/kaltura_plugins/kaltura_metadata_client_plugin.rb', line 978

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) ⇒ KalturaMetadata

Action transforms current metadata object XML using a provided XSL.

Returns:



992
993
994
995
996
997
998
999
1000
1001
1002
# File 'lib/kaltura_plugins/kaltura_metadata_client_plugin.rb', line 992

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