Class: Kaltura::KalturaDocumentService

Inherits:
KalturaServiceBase show all
Defined in:
lib/kaltura_client.rb

Overview

Document service

Instance Attribute Summary

Attributes inherited from KalturaServiceBase

#client

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ KalturaDocumentService

Returns a new instance of KalturaDocumentService.



10201
10202
10203
# File 'lib/kaltura_client.rb', line 10201

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



10222
10223
10224
10225
10226
10227
10228
10229
10230
10231
10232
10233
10234
10235
# File 'lib/kaltura_client.rb', line 10222

def add_from_entry(source_entry_id, document_entry=KalturaNotImplemented, source_flavor_params_id=KalturaNotImplemented)
	kparams = {}
	# Document entry id to copy from
	client.add_param(kparams, 'sourceEntryId', source_entry_id);
	# Document entry metadata
	client.add_param(kparams, 'documentEntry', document_entry);
	# The flavor to be used as the new entry source, source flavor will be used if not specified
	client.add_param(kparams, 'sourceFlavorParamsId', source_flavor_params_id);
	client.queue_service_action_call('document', 'addFromEntry', 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



10239
10240
10241
10242
10243
10244
10245
10246
10247
10248
10249
10250
# File 'lib/kaltura_client.rb', line 10239

def add_from_flavor_asset(source_flavor_asset_id, document_entry=KalturaNotImplemented)
	kparams = {}
	# Flavor asset id to be used as the new entry source
	client.add_param(kparams, 'sourceFlavorAssetId', source_flavor_asset_id);
	# Document entry metadata
	client.add_param(kparams, 'documentEntry', document_entry);
	client.queue_service_action_call('document', 'addFromFlavorAsset', 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



10207
10208
10209
10210
10211
10212
10213
10214
10215
10216
10217
10218
# File 'lib/kaltura_client.rb', line 10207

def add_from_uploaded_file(document_entry, upload_token_id)
	kparams = {}
	# Document entry metadata
	client.add_param(kparams, 'documentEntry', document_entry);
	# Upload token id
	client.add_param(kparams, 'uploadTokenId', upload_token_id);
	client.queue_service_action_call('document', 'addFromUploadedFile', kparams);
	if (client.is_multirequest)
		return nil;
	end
	return client.do_queue();
end

#approve_replace(entry_id) ⇒ Object

Approves document replacement



10400
10401
10402
10403
10404
10405
10406
10407
10408
10409
# File 'lib/kaltura_client.rb', line 10400

def approve_replace(entry_id)
	kparams = {}
	# document entry id to replace
	client.add_param(kparams, 'entryId', entry_id);
	client.queue_service_action_call('document', 'approveReplace', kparams);
	if (client.is_multirequest)
		return nil;
	end
	return client.do_queue();
end

#cancel_replace(entry_id) ⇒ Object

Cancels document replacement



10413
10414
10415
10416
10417
10418
10419
10420
10421
10422
# File 'lib/kaltura_client.rb', line 10413

def cancel_replace(entry_id)
	kparams = {}
	# Document entry id to cancel
	client.add_param(kparams, 'entryId', entry_id);
	client.queue_service_action_call('document', 'cancelReplace', 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



10254
10255
10256
10257
10258
10259
10260
10261
10262
10263
10264
10265
10266
10267
# File 'lib/kaltura_client.rb', line 10254

def convert(entry_id, conversion_profile_id=KalturaNotImplemented, dynamic_conversion_attributes=KalturaNotImplemented)
	kparams = {}
	# Document entry id
	client.add_param(kparams, 'entryId', entry_id);
	client.add_param(kparams, 'conversionProfileId', conversion_profile_id);
	dynamicConversionAttributes.each do |obj|
		client.add_param(kparams, 'dynamicConversionAttributes', obj);
	end
	client.queue_service_action_call('document', 'convert', 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



10343
10344
10345
10346
10347
10348
10349
10350
10351
# File 'lib/kaltura_client.rb', line 10343

def convert_ppt_to_swf(entry_id)
	kparams = {}
	client.add_param(kparams, 'entryId', entry_id);
	client.queue_service_action_call('document', 'convertPptToSwf', kparams);
	if (client.is_multirequest)
		return nil;
	end
	return client.do_queue();
end

#delete(entry_id) ⇒ Object

Delete a document entry.



10301
10302
10303
10304
10305
10306
10307
10308
10309
10310
# File 'lib/kaltura_client.rb', line 10301

def delete(entry_id)
	kparams = {}
	# Document entry id to delete
	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.



10271
10272
10273
10274
10275
10276
10277
10278
10279
10280
10281
10282
# File 'lib/kaltura_client.rb', line 10271

def get(entry_id, version=-1)
	kparams = {}
	# Document entry id
	client.add_param(kparams, 'entryId', entry_id);
	# Desired version of the data
	client.add_param(kparams, 'version', version);
	client.queue_service_action_call('document', 'get', 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.



10314
10315
10316
10317
10318
10319
10320
10321
10322
10323
10324
10325
# File 'lib/kaltura_client.rb', line 10314

def list(filter=KalturaNotImplemented, pager=KalturaNotImplemented)
	kparams = {}
	# Document entry filter
	client.add_param(kparams, 'filter', filter);
	# Pager
	client.add_param(kparams, 'pager', pager);
	client.queue_service_action_call('document', 'list', 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



10355
10356
10357
10358
10359
10360
10361
10362
10363
10364
10365
# File 'lib/kaltura_client.rb', line 10355

def serve(entry_id, flavor_asset_id=KalturaNotImplemented, force_proxy=false)
	kparams = {}
	# Document entry id
	client.add_param(kparams, 'entryId', entry_id);
	# Flavor asset id
	client.add_param(kparams, 'flavorAssetId', flavor_asset_id);
	# force to get the content without redirect
	client.add_param(kparams, 'forceProxy', force_proxy);
	client.queue_service_action_call('document', 'serve', 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



10369
10370
10371
10372
10373
10374
10375
10376
10377
10378
10379
# File 'lib/kaltura_client.rb', line 10369

def serve_by_flavor_params_id(entry_id, flavor_params_id=KalturaNotImplemented, force_proxy=false)
	kparams = {}
	# Document entry id
	client.add_param(kparams, 'entryId', entry_id);
	# Flavor params id
	client.add_param(kparams, 'flavorParamsId', flavor_params_id);
	# force to get the content without redirect
	client.add_param(kparams, 'forceProxy', force_proxy);
	client.queue_service_action_call('document', 'serveByFlavorParamsId', 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.



10286
10287
10288
10289
10290
10291
10292
10293
10294
10295
10296
10297
# File 'lib/kaltura_client.rb', line 10286

def update(entry_id, document_entry)
	kparams = {}
	# Document entry id to update
	client.add_param(kparams, 'entryId', entry_id);
	# Document entry metadata to update
	client.add_param(kparams, 'documentEntry', document_entry);
	client.queue_service_action_call('document', 'update', 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.



10383
10384
10385
10386
10387
10388
10389
10390
10391
10392
10393
10394
10395
10396
# File 'lib/kaltura_client.rb', line 10383

def update_content(entry_id, resource, conversion_profile_id=KalturaNotImplemented)
	kparams = {}
	# document entry id to update
	client.add_param(kparams, 'entryId', entry_id);
	# Resource to be used to replace entry doc content
	client.add_param(kparams, 'resource', resource);
	# The conversion profile id to be used on the entry
	client.add_param(kparams, 'conversionProfileId', conversion_profile_id);
	client.queue_service_action_call('document', 'updateContent', 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.



10329
10330
10331
10332
10333
10334
10335
10336
10337
10338
# File 'lib/kaltura_client.rb', line 10329

def upload(file_data)
	kparams = {}
	# The file data
	client.add_param(kparams, 'fileData', file_data);
	client.queue_service_action_call('document', 'upload', kparams);
	if (client.is_multirequest)
		return nil;
	end
	return client.do_queue();
end