Class: Thron::Gateway::Dashboard
- Defined in:
- lib/thron/gateway/dashboard.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_contents_owner(options = {}) ⇒ Object
- #download_source_file(options = {}) ⇒ Object
- #migrate_user_stuff(options = {}) ⇒ Object
- #propagate_acl_to_sub_categories(options = {}) ⇒ Object
- #replace_source_files(options = {}) ⇒ Object
- #reset_content_user_preferences(options = {}) ⇒ Object
- #trash_contents(options = {}) ⇒ Object
- #untrash_contents(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 |
# File 'lib/thron/gateway/dashboard.rb', line 9 def self.routes @routes ||= { change_contents_owner: Route::factory(name: 'changeContentsOwner', package: PACKAGE), download_source_file: Route::factory(name: 'downloadSourceFile', package: PACKAGE, verb: Route::Verbs::GET), migrate_user_stuff: Route::factory(name: 'migrateUserStuff', package: PACKAGE), propagate_acl_to_sub_categories: Route::factory(name: 'propagateAclToSubCategories', package: PACKAGE), replace_source_files: Route::factory(name: 'replaceSourceFiles', package: PACKAGE), reset_content_user_preferences: Route::factory(name: 'resetUserPreferences', package: PACKAGE), trash_contents: Route::factory(name: 'trashContent', package: PACKAGE), untrash_contents: Route::factory(name: 'untrashContent', package: PACKAGE) } end |
Instance Method Details
#change_contents_owner(options = {}) ⇒ Object
22 23 24 25 26 27 28 29 |
# File 'lib/thron/gateway/dashboard.rb', line 22 def change_contents_owner( = {}) contents = [:contents] body = { clientId: client_id, contents: contents } route(to: __callee__, body: body, token_id: token_id) end |
#download_source_file(options = {}) ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/thron/gateway/dashboard.rb', line 31 def download_source_file( = {}) content_id = [:content_id] save_as = [:save_as] query = { clientId: client_id, tokenId: token_id, xcontentId: content_id, saveAs: save_as } route(to: __callee__, query: query, token_id: token_id) end |
#migrate_user_stuff(options = {}) ⇒ Object
43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/thron/gateway/dashboard.rb', line 43 def migrate_user_stuff( = {}) user_id1 = [:user_id1] user_id2 = [:user_id2] remove_user_id1 = .fetch(:remove_user_id1) { false } body = { clientId: client_id, userId1: user_id1, userId2: user_id2, removeUserId1: remove_user_id1 } route(to: __callee__, body: body, token_id: token_id) end |
#propagate_acl_to_sub_categories(options = {}) ⇒ Object
56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/thron/gateway/dashboard.rb', line 56 def propagate_acl_to_sub_categories( = {}) category_id = [:category_id] acls = [:acls] force = .fetch(:force) { false } body = { clientId: client_id, categoryId: category_id, acls: acls, force: force } route(to: __callee__, body: body, token_id: token_id) end |
#replace_source_files(options = {}) ⇒ Object
69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/thron/gateway/dashboard.rb', line 69 def replace_source_files( = {}) media_content_id = [:media_content_id] content_id = [:content_id] file_ids = [:file_ids] remove_original_files = .fetch(:remove_original_files) { false } body = { clientId: client_id, mediaContentId: media_content_id, xcontentId: content_id, sourceFiles: { repositoryFileIds: file_ids }, removeOriginalFiles: remove_original_files } route(to: __callee__, body: body, token_id: token_id) end |
#reset_content_user_preferences(options = {}) ⇒ Object
84 85 86 87 88 89 90 91 |
# File 'lib/thron/gateway/dashboard.rb', line 84 def reset_content_user_preferences( = {}) content_id = [:content_id] body = { clientId: client_id, xcontentId: content_id } route(to: __callee__, body: body, token_id: token_id) end |
#trash_contents(options = {}) ⇒ Object
93 94 95 96 97 98 99 100 101 102 |
# File 'lib/thron/gateway/dashboard.rb', line 93 def trash_contents( = {}) contents = [:contents] body = { clientId: client_id, contentList: { contentsToTrash: contents.map(&:payload) } } route(to: __callee__, body: body, token_id: token_id) do |response| response.extra(attribute: 'contentsInIssue') end end |
#untrash_contents(options = {}) ⇒ Object
104 105 106 107 108 109 110 111 112 113 114 115 116 117 |
# File 'lib/thron/gateway/dashboard.rb', line 104 def untrash_contents( = {}) new_user_id = [:new_user_id] content_ids = [:content_ids] body = { clientId: client_id, contentList: { newUserId: new_user_id, xcontentIds: content_ids } } route(to: __callee__, body: body, token_id: token_id) do |response| response.extra(attribute: 'contentsInIssue') end end |