Class: Thron::Gateway::PublishingProcess
- Defined in:
- lib/thron/gateway/publishing_process.rb
Constant Summary collapse
- PACKAGE =
Package.new(:xadmin, :resources, self.service_name)
Constants inherited from Base
Instance Attribute Summary
Attributes inherited from Base
Class Method Summary collapse
Instance Method Summary collapse
- #change_channel_status(options = {}) ⇒ Object
- #get_content_types(options = {}) ⇒ Object
- #unpublish_content(options = {}) ⇒ Object
- #update_pagelet_content(options = {}) ⇒ Object
- #update_publishing_properties(options = {}) ⇒ Object
Methods inherited from Session
Methods included from Pageable
Methods inherited from Base
#check_session, client_id, #client_id, service_name
Methods included from Routable
Constructor Details
This class inherits a constructor from Thron::Gateway::Session
Class Method Details
.routes ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/thron/gateway/publishing_process.rb', line 9 def self.routes @routes ||= { change_channel_status: Route::factory(name: 'changeChannelStatus', package: PACKAGE), create_content_for_channel: Route::factory(name: 'createContentForChannel', package: PACKAGE), get_content_types: Route::factory(name: 'getContentTypes', package: PACKAGE), new_content: Route::factory(name: 'newContent', package: PACKAGE), new_live_event_content: Route::factory(name: 'newLiveEventContent', package: PACKAGE), new_pagelet_content: Route::factory(name: 'newPageletContent', package: PACKAGE), new_playlist_content: Route::factory(name: 'newPlayListContent', package: PACKAGE), publish_channel: Route::factory(name: 'publishChannel', package: PACKAGE), remove_channel: Route::factory(name: 'removeChannel', package: PACKAGE), replace_thumbnail: Route::factory(name: 'replaceThumbnailInPublishedContent', package: PACKAGE), unpublish_content: Route::factory(name: 'unpublishContent', package: PACKAGE), update_pagelet_content: Route::factory(name: 'updatePageletContent', package: PACKAGE), update_publishing_properties: Route::factory(name: 'updatePublishingProperties', package: PACKAGE) } end |
Instance Method Details
#change_channel_status(options = {}) ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/thron/gateway/publishing_process.rb', line 27 def change_channel_status( = {}) media_content_id = [:media_content_id] content_id = [:content_id] channel = [:channel] active = .fetch(:active) { false } body = { clientId: client_id, mediaContentId: media_content_id, xcontentId: content_id, channel: channel, active: active } route(to: __callee__, body: body, token_id: token_id) do |response| response.extra(attribute: 'actionsInError') response.body = Entity::Base::factory(response.body.fetch('content') { {} }) end end |
#get_content_types(options = {}) ⇒ Object
45 46 47 48 49 50 51 52 53 54 |
# File 'lib/thron/gateway/publishing_process.rb', line 45 def get_content_types( = {}) file_names = [:file_names] body = { clientId: client_id, files: { fileNames: file_names } } route(to: __callee__, body: body, token_id: token_id) do |response| response.body = Entity::Base::factory(response.body.fetch('fileContentTypes') { [] }) end end |
#unpublish_content(options = {}) ⇒ Object
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/thron/gateway/publishing_process.rb', line 56 def unpublish_content( = {}) media_content_id = [:media_content_id] content_id = [:content_id] force = .fetch(:force) { false } remove_source_files = .fetch(:remove_source_files) { false } body = { clientId: client_id, mediaContentId: media_content_id, xcontentId: content_id, force: force, removeSourceFiles: remove_source_files } route(to: __callee__, body: body, token_id: token_id) do |response| response.extra(attribute: 'actionsInError') response.body = Entity::Base::factory(response.body.fetch('content') { {} }) end end |
#update_pagelet_content(options = {}) ⇒ Object
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
# File 'lib/thron/gateway/publishing_process.rb', line 74 def update_pagelet_content( = {}) media_content_id = [:media_content_id] content_id = [:content_id] body = [:body] mime_type = [:mime_type] body = { clientId: client_id, mediaContentId: media_content_id, xcontentId: content_id, body: body, mimeType: mime_type } route(to: __callee__, body: body, token_id: token_id) do |response| response.extra(attribute: 'actionsInError') response.body = Entity::Base::factory(response.body.fetch('content') { {} }) end end |
#update_publishing_properties(options = {}) ⇒ Object
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 |
# File 'lib/thron/gateway/publishing_process.rb', line 92 def update_publishing_properties( = {}) media_content_id = [:media_content_id] content_id = [:content_id] properties = [:properties] body = { clientId: client_id, mediaContentId: media_content_id, xcontentId: content_id, properties: properties } route(to: __callee__, body: body, token_id: token_id) do |response| response.extra(attribute: 'actionsInError') response.body = Entity::Base::factory(response.body.fetch('content') { {} }) end end |