Class: Kaltura::Service::BaseEntryService
- Inherits:
-
BaseService
- Object
- BaseService
- Kaltura::Service::BaseEntryService
- Defined in:
- lib/kaltura/service/base_entry_service.rb
Overview
BaseEntryService is a service for generic entries. If you do not know what type of media you are working with, this is a good service to use. You need to know what media type you are working with for MediaService.
Instance Attribute Summary
Attributes inherited from BaseService
Instance Method Summary collapse
-
#add_from_uploaded_file(entry, upload_token_id, type = -1)) ⇒ Kaltura::BaseEntry
Generic add entry using an uploaded file, should be used when the uploaded entry type is not known.
-
#anonymous_rank(entry_id, rank) ⇒ nil
Anonymously ranks an entry.
-
#approve(entry_id) ⇒ nil
Approves an entry and marks any pending flags as moderated.
-
#count(filter = nil) ⇒ Integer
Returns a count based on a specified base entry filter.
-
#delete(entry_id) ⇒ nil
Deletes the specified Kaltura Entry.
-
#flag(moderation_flag) ⇒ nil
Flags an inappropriate Kaltura entry for moderation.
-
#get(entry_id, version = -1)) ⇒ Kaltura::BaseEntry
Gets a base entry by ID.
-
#get_by_ids(entry_ids) ⇒ Array
Retrieves an array of BaseEntries when provided a comma seperated list of entry_id’s.
-
#get_context_data(entry_id, context_data_params) ⇒ Kaltura::EntryContextDataResult
Retrieves the context data from a Kaltura entry.
-
#list(filter = nil, pager = nil) ⇒ Kaltura::Response::BaseEntryListResponse
Lists base entries by the filter with paging support.
-
#list_flags(entry_id, pager = nil) ⇒ Kaltura::Response::ModerationFlagListResponse
Lists all pending moderation flags for the specified entry.
-
#reject(entry_id) ⇒ nil
Rejects a Kaltura entry and marks any pending flags as moderated.
-
#update(entry_id, base_entry) ⇒ Kaltura::BaseEntry
Updates a base entry.
-
#update_thumbnail_from_source_entry(entry_id, source_entry_id, time_offset) ⇒ Kaltura::BaseEntry
Updates the entries thumbnail from another entry given a specified time offset.
-
#update_thumbnail_from_url(entry_id, url) ⇒ Kaltura::BaseEntry
Updates an entries thumbnail using a valid URL.
-
#update_thumbnail_jpeg(entry_id, file_data) ⇒ Kaltura::BaseEntry
Updates an entries thumbnail using a raw jpeg file.
-
#upload(file_data) ⇒ String
Uploads a file to the Kaltura server and returns a token to be used to create a Kaltura entry.
Methods inherited from BaseService
Constructor Details
This class inherits a constructor from Kaltura::Service::BaseService
Instance Method Details
#add_from_uploaded_file(entry, upload_token_id, type = -1)) ⇒ Kaltura::BaseEntry
Generic add entry using an uploaded file, should be used when the uploaded entry type is not known.
48 49 50 51 52 53 54 |
# File 'lib/kaltura/service/base_entry_service.rb', line 48 def add_from_uploaded_file(entry, upload_token_id, type=-1) kparams = {} client.add_param(kparams, 'entry', entry) client.add_param(kparams, 'uploadTokenId', upload_token_id) client.add_param(kparams, 'type', type) perform_request('baseEntry','addFromUploadedFile',kparams,false) end |
#anonymous_rank(entry_id, rank) ⇒ nil
Anonymously ranks an entry. There is no validation done on duplicate rankings.
304 305 306 307 308 309 |
# File 'lib/kaltura/service/base_entry_service.rb', line 304 def anonymous_rank(entry_id, rank) kparams = {} client.add_param(kparams, 'entryId', entry_id) client.add_param(kparams, 'rank', rank) perform_request('baseEntry','anonymousRank',kparams,false) end |
#approve(entry_id) ⇒ nil
Approves an entry and marks any pending flags as moderated.
This makes the entry playable.
270 271 272 273 274 |
# File 'lib/kaltura/service/base_entry_service.rb', line 270 def approve(entry_id) kparams = {} client.add_param(kparams, 'entryId', entry_id) perform_request('baseEntry','approve',kparams,false) end |
#count(filter = nil) ⇒ Integer
Returns a count based on a specified base entry filter.
147 148 149 150 151 |
# File 'lib/kaltura/service/base_entry_service.rb', line 147 def count(filter=nil) kparams = {} client.add_param(kparams, 'filter', filter) perform_request('baseEntry','count',kparams,false) end |
#delete(entry_id) ⇒ nil
Deletes the specified Kaltura Entry.
115 116 117 118 119 |
# File 'lib/kaltura/service/base_entry_service.rb', line 115 def delete(entry_id) kparams = {} client.add_param(kparams, 'entryId', entry_id) perform_request('baseEntry','delete',kparams,false) end |
#flag(moderation_flag) ⇒ nil
Flags an inappropriate Kaltura entry for moderation. The entry ID is provided in the moderation_flag, so it isn’t blatently obvious which entry you are interacting with. The method also outputs nothing, so success/failure is more difficult than necessary to track.
238 239 240 241 242 |
# File 'lib/kaltura/service/base_entry_service.rb', line 238 def flag(moderation_flag) kparams = {} client.add_param(kparams, 'moderationFlag', moderation_flag) perform_request('baseEntry','flag',kparams,false) end |
#get(entry_id, version = -1)) ⇒ Kaltura::BaseEntry
Gets a base entry by ID.
66 67 68 69 70 71 |
# File 'lib/kaltura/service/base_entry_service.rb', line 66 def get(entry_id, version=-1) kparams = {} client.add_param(kparams, 'entryId', entry_id) client.add_param(kparams, 'version', version) perform_request('baseEntry','get',kparams,false) end |
#get_by_ids(entry_ids) ⇒ Array
Retrieves an array of BaseEntries when provided a comma seperated list of entry_id’s.
100 101 102 103 104 |
# File 'lib/kaltura/service/base_entry_service.rb', line 100 def get_by_ids(entry_ids) kparams = {} client.add_param(kparams, 'entryIds', entry_ids) perform_request('baseEntry','getByIds',kparams,false) end |
#get_context_data(entry_id, context_data_params) ⇒ Kaltura::EntryContextDataResult
Retrieves the context data from a Kaltura entry. This is not documented in the API. I’d be cautious about actually using this method.
323 324 325 326 327 328 |
# File 'lib/kaltura/service/base_entry_service.rb', line 323 def get_context_data(entry_id, context_data_params) kparams = {} client.add_param(kparams, 'entryId', entry_id) client.add_param(kparams, 'contextDataParams', context_data_params) perform_request('baseEntry','getContextData',kparams,false) end |
#list(filter = nil, pager = nil) ⇒ Kaltura::Response::BaseEntryListResponse
Lists base entries by the filter with paging support.
131 132 133 134 135 136 |
# File 'lib/kaltura/service/base_entry_service.rb', line 131 def list(filter=nil, pager=nil) kparams = {} client.add_param(kparams, 'filter', filter) client.add_param(kparams, 'pager', pager) perform_request('baseEntry','list',kparams,false) end |
#list_flags(entry_id, pager = nil) ⇒ Kaltura::Response::ModerationFlagListResponse
Lists all pending moderation flags for the specified entry.
286 287 288 289 290 291 |
# File 'lib/kaltura/service/base_entry_service.rb', line 286 def list_flags(entry_id, pager=nil) kparams = {} client.add_param(kparams, 'entryId', entry_id) client.add_param(kparams, 'pager', pager) perform_request('baseEntry','listFlags',kparams,false) end |
#reject(entry_id) ⇒ nil
Rejects a Kaltura entry and marks any pending flags as moderated. This makes the entry unplayable and is a much more sane method to flag content than the flag method.
254 255 256 257 258 |
# File 'lib/kaltura/service/base_entry_service.rb', line 254 def reject(entry_id) kparams = {} client.add_param(kparams, 'entryId', entry_id) perform_request('baseEntry','reject',kparams,false) end |
#update(entry_id, base_entry) ⇒ Kaltura::BaseEntry
Updates a base entry. It is best to instantiate a new base entry for the second parameter and initilize those fields for the changes you want to change instead of using an existing entry object.
84 85 86 87 88 89 |
# File 'lib/kaltura/service/base_entry_service.rb', line 84 def update(entry_id, base_entry) kparams = {} client.add_param(kparams, 'entryId', entry_id) client.add_param(kparams, 'baseEntry', base_entry) perform_request('baseEntry','update',kparams,false) end |
#update_thumbnail_from_source_entry(entry_id, source_entry_id, time_offset) ⇒ Kaltura::BaseEntry
Updates the entries thumbnail from another entry given a specified time offset. This is one truly odd API call.
218 219 220 221 222 223 224 |
# File 'lib/kaltura/service/base_entry_service.rb', line 218 def update_thumbnail_from_source_entry(entry_id, source_entry_id, time_offset) kparams = {} client.add_param(kparams, 'entryId', entry_id) client.add_param(kparams, 'sourceEntryId', source_entry_id) client.add_param(kparams, 'timeOffset', time_offset) perform_request('baseEntry','updateThumbnailFromSourceEntry',kparams,false) end |
#update_thumbnail_from_url(entry_id, url) ⇒ Kaltura::BaseEntry
Updates an entries thumbnail using a valid URL.
198 199 200 201 202 203 |
# File 'lib/kaltura/service/base_entry_service.rb', line 198 def update_thumbnail_from_url(entry_id, url) kparams = {} client.add_param(kparams, 'entryId', entry_id) client.add_param(kparams, 'url', url) perform_request('baseEntry','updateThumbnailFromUrl',kparams,false) end |
#update_thumbnail_jpeg(entry_id, file_data) ⇒ Kaltura::BaseEntry
Updates an entries thumbnail using a raw jpeg file.
180 181 182 183 184 185 |
# File 'lib/kaltura/service/base_entry_service.rb', line 180 def update_thumbnail_jpeg(entry_id, file_data) kparams = {} client.add_param(kparams, 'entryId', entry_id) client.add_param(kparams, 'fileData', file_data) perform_request('baseEntry','updateThumbnailJpeg',kparams,false) end |
#upload(file_data) ⇒ String
Uploads a file to the Kaltura server and returns a token to be used to create a Kaltura entry.
162 163 164 165 166 |
# File 'lib/kaltura/service/base_entry_service.rb', line 162 def upload(file_data) kparams = {} client.add_param(kparams, 'fileData', file_data) perform_request('baseEntry','upload',kparams,false) end |