scrivito_sdk 1.0.0 → 1.1.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.yardopts +1 -0
- data/README.md +1 -1
- data/app/controllers/scrivito/legacy_redirect_controller.rb +11 -0
- data/app/controllers/scrivito/objs_controller.rb +15 -5
- data/app/controllers/scrivito/webservice_controller.rb +4 -3
- data/app/controllers/scrivito/workspaces_controller.rb +24 -29
- data/app/helpers/scrivito_helper.rb +82 -37
- data/app/views/scrivito/objs/binary_no_cache.json.jbuilder +1 -0
- data/app/views/scrivito/objs/search.json.jbuilder +5 -5
- data/app/views/scrivito/webservice/error.json.jbuilder +2 -2
- data/config/ca-bundle.crt +1 -1
- data/config/precedence_routes.rb +51 -48
- data/config/routes.rb +1 -14
- data/lib/assets/javascripts/scrivito_ui.js +2447 -266
- data/lib/assets/stylesheets/scrivito.css +1 -1
- data/lib/assets/stylesheets/scrivito_ui.css +1 -1
- data/lib/generators/scrivito/install/install_generator.rb +12 -0
- data/lib/generators/scrivito/install/templates/config/initializers/scrivito.rb +3 -0
- data/lib/scrivito/attribute_definition.rb +13 -1
- data/lib/scrivito/attribute_deserializer.rb +4 -4
- data/lib/scrivito/attribute_value_renderer.rb +79 -0
- data/lib/scrivito/backend/obj_data_cache.rb +15 -15
- data/lib/scrivito/backend/obj_data_from_rest.rb +1 -21
- data/lib/scrivito/backend/obj_query.rb +2 -2
- data/lib/scrivito/basic_obj.rb +17 -6
- data/lib/scrivito/binary.rb +13 -5
- data/lib/scrivito/cache/chainable.rb +10 -5
- data/lib/scrivito/cache/file_store.rb +4 -0
- data/lib/scrivito/cache/ram_store.rb +4 -0
- data/lib/scrivito/child_list_tag.rb +16 -14
- data/lib/scrivito/client_error.rb +10 -0
- data/lib/scrivito/cms_backend.rb +66 -291
- data/lib/scrivito/cms_data_cache.rb +7 -9
- data/lib/scrivito/cms_dispatch_controller.rb +1 -10
- data/lib/scrivito/cms_field_tag.rb +2 -1
- data/lib/scrivito/cms_rest_api.rb +2 -0
- data/lib/scrivito/cms_routing.rb +26 -22
- data/lib/scrivito/configuration.rb +38 -0
- data/lib/scrivito/connection_manager.rb +69 -0
- data/lib/scrivito/controller_actions.rb +2 -2
- data/lib/scrivito/controller_helper.rb +2 -2
- data/lib/scrivito/date_attribute.rb +4 -1
- data/lib/scrivito/deprecation.rb +5 -4
- data/lib/scrivito/editing_context.rb +2 -2
- data/lib/scrivito/errors.rb +17 -0
- data/lib/scrivito/image_tag.rb +2 -2
- data/lib/scrivito/link_parser.rb +10 -5
- data/lib/scrivito/meta_data_collection.rb +11 -0
- data/lib/scrivito/obj_collection.rb +1 -1
- data/lib/scrivito/obj_facet_value.rb +19 -7
- data/lib/scrivito/obj_params_parser.rb +43 -14
- data/lib/scrivito/obj_search_builder.rb +1 -2
- data/lib/scrivito/obj_search_enumerator/batch.rb +22 -0
- data/lib/scrivito/obj_search_enumerator/batch_iterator.rb +36 -0
- data/lib/scrivito/obj_search_enumerator/query_executor.rb +35 -0
- data/lib/scrivito/obj_search_enumerator.rb +218 -93
- data/lib/scrivito/obj_update_params_parser.rb +1 -0
- data/lib/scrivito/preset_routes.rb +25 -0
- data/lib/scrivito/revision.rb +13 -11
- data/lib/scrivito/route.rb +62 -0
- data/lib/scrivito/routing_extensions.rb +92 -0
- data/lib/scrivito/sdk_engine.rb +4 -0
- data/lib/scrivito/task.rb +77 -0
- data/lib/scrivito/type_computer.rb +3 -3
- data/lib/scrivito/ui_config.rb +4 -0
- data/lib/scrivito/user.rb +24 -18
- data/lib/scrivito/workspace/publish_checker.rb +2 -3
- data/lib/scrivito/workspace.rb +38 -6
- data/lib/scrivito/workspace_data.rb +0 -14
- metadata +14 -10
- data/lib/scrivito/content_service.rb +0 -121
- data/lib/scrivito/content_state.rb +0 -109
- data/lib/scrivito/content_state_caching.rb +0 -47
- data/lib/scrivito/content_state_visitor.rb +0 -19
- data/lib/scrivito/obj_data_from_service.rb +0 -63
- data/lib/scrivito/workspace_data_from_service.rb +0 -43
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 12a55c387b16a4a537845c0ef7d10d00b4c6bd4a
|
4
|
+
data.tar.gz: e79c326cc3f757de2d46b05d4287ab0548550aeb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1a9338acbdbd0901b6ed31bc8962c1278f9057c507f2af2791c83291de9480f0d8230fb58acd1c039753a34ab18fd5a2033c39676f67d09ba0205b9c92b7e4e0
|
7
|
+
data.tar.gz: cd8ba88553f5bf4a3974a7a1901391dda745100e3749b54801e3507825caa8e52817506fe0c3622f105363311db88841596a53c5df4e2b15a3ee88843750c0ff
|
data/.yardopts
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Scrivito SDK
|
2
2
|
|
3
|
-
[![Gem Version](https://badge.fury.io/rb/scrivito_sdk.
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/scrivito_sdk.svg)](https://badge.fury.io/rb/scrivito_sdk)
|
4
4
|
|
5
5
|
The Scrivito SDK makes CMS objects maintained by means of the cloud-based Scrivito CMS available
|
6
6
|
to your Rails application. It offers easy-to-use functionality for rendering CMS content, doing
|
@@ -0,0 +1,11 @@
|
|
1
|
+
module Scrivito
|
2
|
+
class LegacyRedirectController < ActionController::Metal
|
3
|
+
include ActionController::Redirecting
|
4
|
+
include Rails.application.routes.url_helpers
|
5
|
+
|
6
|
+
def index
|
7
|
+
route = Route.find(_routes, :slug_id)
|
8
|
+
redirect_to route.generate_path(self, params.slice(:id, :slug).symbolize_keys)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
@@ -35,8 +35,12 @@ module Scrivito
|
|
35
35
|
params_parser = ObjCreateParamsParser.new(request.host, request.port)
|
36
36
|
@obj = Obj.create(params_parser.parse(params[:obj]), scrivito_user: scrivito_user)
|
37
37
|
render :obj
|
38
|
-
rescue ObjClassNotFound
|
39
|
-
|
38
|
+
rescue ObjClassNotFound => e
|
39
|
+
raise ClientError.new(
|
40
|
+
"You've tried to create a CMS object based on the \"#{e.message}\" class, which is "\
|
41
|
+
"either missing or not suitable for the object.",
|
42
|
+
400
|
43
|
+
)
|
40
44
|
end
|
41
45
|
|
42
46
|
def details
|
@@ -48,14 +52,12 @@ module Scrivito
|
|
48
52
|
params_parser = ObjUpdateParamsParser.new(request.host, request.port,
|
49
53
|
current_obj: current_obj, scrivito_user: scrivito_user)
|
50
54
|
current_obj.update(params_parser.parse(params[:obj]))
|
51
|
-
rescue ObjClassNotFound
|
52
|
-
head :not_found
|
53
55
|
end
|
54
56
|
|
55
57
|
def destroy
|
56
58
|
in_selected_workspace do
|
57
59
|
parent = current_obj.parent
|
58
|
-
@redirect_to = parent ? scrivito_path(parent) :
|
60
|
+
@redirect_to = parent ? scrivito_path(parent) : "/"
|
59
61
|
current_obj.destroy
|
60
62
|
end
|
61
63
|
end
|
@@ -94,6 +96,13 @@ module Scrivito
|
|
94
96
|
in_selected_workspace { @is_outdated = current_obj.outdated? }
|
95
97
|
end
|
96
98
|
|
99
|
+
def binary_no_cache
|
100
|
+
in_selected_workspace do
|
101
|
+
binary = current_obj[params[:attribute_name]]
|
102
|
+
@no_cache_url = binary.no_cache_url
|
103
|
+
end
|
104
|
+
end
|
105
|
+
|
97
106
|
def mark_resolved
|
98
107
|
in_selected_workspace { current_obj.mark_resolved }
|
99
108
|
render_empty_json
|
@@ -158,6 +167,7 @@ module Scrivito
|
|
158
167
|
return render action: 'search/facet'
|
159
168
|
end
|
160
169
|
|
170
|
+
@batch = @enumerator.fetch_batch(params[:continuation])
|
161
171
|
render :search
|
162
172
|
end
|
163
173
|
end
|
@@ -1,9 +1,10 @@
|
|
1
1
|
module Scrivito
|
2
2
|
|
3
3
|
class WebserviceController < ActionController::Base
|
4
|
-
rescue_from ClientError do |
|
5
|
-
@
|
6
|
-
|
4
|
+
rescue_from ApplicationError, ClientError, ResourceNotFound do |error|
|
5
|
+
@error = error
|
6
|
+
@timestamp = Time.zone.now
|
7
|
+
render 'scrivito/webservice/error', formats: :json, status: error.http_code
|
7
8
|
end
|
8
9
|
|
9
10
|
before_filter :merge_correctly_parsed_json_params
|
@@ -1,9 +1,20 @@
|
|
1
1
|
module Scrivito
|
2
2
|
class WorkspacesController < WebserviceController
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
3
|
+
def self.restrict_access_to(action_name, require_permission:)
|
4
|
+
around_action only: action_name do |_, block|
|
5
|
+
subject = params.has_key?(:id) ? current_workspace : :workspace
|
6
|
+
authorize_workspace_access(require_permission, subject, &block)
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
restrict_access_to :create, require_permission: :create
|
11
|
+
restrict_access_to :show, require_permission: :read
|
12
|
+
restrict_access_to :rename, require_permission: :write
|
13
|
+
restrict_access_to :memberships, require_permission: :invite_to
|
14
|
+
restrict_access_to :destroy, require_permission: :delete
|
15
|
+
restrict_access_to :rebase, require_permission: :write
|
16
|
+
restrict_access_to :check, require_permission: :publish
|
17
|
+
restrict_access_to :publish, require_permission: :publish
|
7
18
|
|
8
19
|
def index
|
9
20
|
@workspaces = Workspace.all.select(&method(:can_user_read_workspace?))
|
@@ -25,8 +36,13 @@ module Scrivito
|
|
25
36
|
end
|
26
37
|
end
|
27
38
|
|
28
|
-
def
|
29
|
-
current_workspace.update(workspace_params)
|
39
|
+
def rename
|
40
|
+
current_workspace.update(workspace_params.slice(:title))
|
41
|
+
render_empty_json
|
42
|
+
end
|
43
|
+
|
44
|
+
def memberships
|
45
|
+
current_workspace.update(workspace_params.slice(:memberships))
|
30
46
|
render_empty_json
|
31
47
|
end
|
32
48
|
|
@@ -65,9 +81,8 @@ module Scrivito
|
|
65
81
|
end
|
66
82
|
|
67
83
|
def conditional_publish
|
68
|
-
task_unaware_request(:put, current_workspace_backend_path('/publish'),
|
69
|
-
if_content_state_id_equals: current_workspace.
|
70
|
-
})
|
84
|
+
task_unaware_request(:put, current_workspace_backend_path('/publish'),
|
85
|
+
if_content_state_id_equals: current_workspace.content_state_id)
|
71
86
|
end
|
72
87
|
|
73
88
|
def valid_publish_request?
|
@@ -78,26 +93,6 @@ module Scrivito
|
|
78
93
|
Workspace::PublishChecker.new(current_workspace, scrivito_user)
|
79
94
|
end
|
80
95
|
|
81
|
-
def authorize_workspace_create(&block)
|
82
|
-
authorize_workspace_access(:create, :workspace, &block)
|
83
|
-
end
|
84
|
-
|
85
|
-
def authorize_current_workspace_read(&block)
|
86
|
-
authorize_current_workspace_access(:read, &block)
|
87
|
-
end
|
88
|
-
|
89
|
-
def authorize_current_workspace_write(&block)
|
90
|
-
authorize_current_workspace_access(:write, &block)
|
91
|
-
end
|
92
|
-
|
93
|
-
def authorize_current_workspace_publish(&block)
|
94
|
-
authorize_current_workspace_access(:publish, &block)
|
95
|
-
end
|
96
|
-
|
97
|
-
def authorize_current_workspace_access(verb, &block)
|
98
|
-
authorize_workspace_access(verb, current_workspace, &block)
|
99
|
-
end
|
100
|
-
|
101
96
|
def current_workspace
|
102
97
|
@current_workspace ||= Workspace.find(params[:id])
|
103
98
|
end
|
@@ -75,39 +75,64 @@ module ScrivitoHelper
|
|
75
75
|
)).render(html_options, &block)
|
76
76
|
end
|
77
77
|
|
78
|
+
#
|
79
|
+
# Renders a navigation ready for in-place editing.
|
78
80
|
#
|
79
81
|
# @api public
|
80
82
|
#
|
81
|
-
#
|
82
|
-
#
|
83
|
-
# @param field_name [String, Symbol] Which field_name of the Obj should be rendered. Currently
|
84
|
-
# only +toclist+ is supported
|
85
|
-
# @param options [Hash] Additional options, which are passed to +content_tag+. Use them to add
|
86
|
-
# HTML attributes to the tag
|
83
|
+
# If a navigation is rendered using this helper method, a special menu is attached to it that lets
|
84
|
+
# you change the order of the child pages or insert a new child.
|
87
85
|
#
|
88
|
-
#
|
89
|
-
#
|
86
|
+
# For making the child pages sortable, the parent {Scrivito::BasicObj Obj} requires a
|
87
|
+
# +referencelist+ attribute named +child_order+. When creating a page model using the page
|
88
|
+
# generator, such an attribute is automatically added to the model.
|
90
89
|
#
|
91
|
-
# @
|
90
|
+
# @param tag_name [String, Symbol] Name of the outer HTML tag (e.g. +:ul+ or +:div+).
|
91
|
+
# @param obj [Scrivito::BasicObj] The parent {Scrivito::BasicObj Obj}, on which +method_name+ will
|
92
|
+
# be called in order to fetch the children.
|
93
|
+
# @param method_name [String, Symbol] Name of the method to be called on the parent
|
94
|
+
# {Scrivito::BasicObj Obj} in order to fetch the children. Currently, only +toclist+ is
|
95
|
+
# supported.
|
96
|
+
# @param options [Hash] Options to be passed to +content_tag+. Use them to add HTML attributes to
|
97
|
+
# the tag.
|
92
98
|
#
|
93
|
-
# @
|
94
|
-
#
|
95
|
-
#
|
99
|
+
# @yieldparam [Scrivito::ChildListTag::ObjTag] list An object on which the
|
100
|
+
# {Scrivito::ChildListTag::ObjTag#tag tag} method should be called once per child to enable
|
101
|
+
# in-place editing.
|
102
|
+
# @yieldparam [Scrivito::BasicObj] child Each child of +toclist+.
|
103
|
+
#
|
104
|
+
# @return [String] The rendered HTML string.
|
105
|
+
#
|
106
|
+
# @see Scrivito::ChildListTag::ObjTag#tag
|
107
|
+
#
|
108
|
+
# @example Renders a navigation for an +@obj+ with two children in its +toclist+, whose titles are +"Toys"+ and +"Electronics"+ respectively:
|
109
|
+
# scrivito_tag_list(:ul, @obj, :toclist, class: "my_list") do |list, child|
|
110
|
+
# list.tag(:li, class: "my_list_element") do
|
96
111
|
# link_to(scrivito_path(child)) do
|
97
112
|
# scrivito_tag(:span, child, :title)
|
98
113
|
# end
|
99
114
|
# end
|
100
115
|
# end
|
101
116
|
#
|
102
|
-
# # result for an obj with two children:
|
103
117
|
# #
|
104
|
-
# #
|
105
|
-
# #
|
106
|
-
# #
|
107
|
-
# #
|
118
|
+
# # Basically, the rendered HTML will look like this:
|
119
|
+
# #
|
120
|
+
# # <ul class="my_list">
|
121
|
+
# # <li class="my_list_element">
|
122
|
+
# # <a href="/toys-902b3e8d6ec861c1">
|
123
|
+
# # <span>Toys</span>
|
124
|
+
# # </a>
|
125
|
+
# # </li>
|
126
|
+
# # <li class="my_list_element">
|
127
|
+
# # <a href="/electronics-59c6995988ce78f4">
|
128
|
+
# # <span>Electronics</span>
|
129
|
+
# # </a>
|
130
|
+
# # </li>
|
131
|
+
# # </ul>
|
132
|
+
# #
|
108
133
|
#
|
109
|
-
def scrivito_tag_list(tag_name, obj,
|
110
|
-
Scrivito::ChildListTag.new(tag_name, obj,
|
134
|
+
def scrivito_tag_list(tag_name, obj, method_name, options = {}, &block)
|
135
|
+
Scrivito::ChildListTag.new(tag_name, obj, method_name.to_s, self).render(options, &block)
|
111
136
|
end
|
112
137
|
|
113
138
|
#
|
@@ -181,30 +206,29 @@ module ScrivitoHelper
|
|
181
206
|
end
|
182
207
|
|
183
208
|
#
|
184
|
-
# Renders an attribute
|
209
|
+
# Renders an attribute value of a CMS model, taking its type into account.
|
185
210
|
#
|
186
|
-
#
|
187
|
-
# Renders the value, taking its type into account.
|
188
|
-
# * An HtmlString will be exported by converting its links
|
189
|
-
# * A Time will be exported in an international form: Year-Month-Day Hour:Minutes
|
190
|
-
# * A non-HTML String will be quoted
|
191
|
-
# * other values will be rendered unchanged
|
211
|
+
# @api public
|
192
212
|
#
|
193
|
-
#
|
194
|
-
#
|
195
|
-
#
|
213
|
+
# Links inside +html+ attributes are rendered using the routing of the application. Values from
|
214
|
+
# +string+ attributes are escaped. For other attribute types, a simple default representation is
|
215
|
+
# rendered.
|
196
216
|
#
|
197
|
-
# @
|
217
|
+
# @example
|
218
|
+
# scrivito_value(@obj.title)
|
219
|
+
#
|
220
|
+
# @note Content rendered using this method will not be editable in the Scrivito UI. If you want
|
221
|
+
# in-place editing, use {ScrivitoHelper#scrivito_tag} instead.
|
198
222
|
#
|
199
223
|
def scrivito_value(value)
|
224
|
+
renderer = Scrivito::AttributeValueRenderer.new(self)
|
225
|
+
|
200
226
|
case value
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
render(template: value.show_view_path, locals: {widget: value})
|
207
|
-
else value
|
227
|
+
when Scrivito::BasicWidget then render(template: value.show_view_path, locals: {widget: value})
|
228
|
+
when Scrivito::HtmlString then renderer.render_as_html(value)
|
229
|
+
when String then renderer.render_as_string(value)
|
230
|
+
when Time then renderer.render_as_date(value)
|
231
|
+
else value
|
208
232
|
end
|
209
233
|
end
|
210
234
|
|
@@ -398,4 +422,25 @@ module ScrivitoHelper
|
|
398
422
|
Please use helper method `scrivito_user` instead.
|
399
423
|
}
|
400
424
|
end
|
425
|
+
|
426
|
+
# @api public
|
427
|
+
#
|
428
|
+
# This method wraps Rails' built-in fragment caching to work with content delivered by Scrivito.
|
429
|
+
# Fragment caching applies to computed parts of views and helps to improve performance. The
|
430
|
+
# Rails guides provide an excellent introduction to caching if you haven't used it yet.
|
431
|
+
#
|
432
|
+
# The +scrivito_cache+ method extends built-in fragment caching so that cached
|
433
|
+
# parts of a view are automatically recomputed when Scrivito content changes. The
|
434
|
+
# fragments are only cached for the published content. In editable working copies
|
435
|
+
# no caching takes place, and the fragments are computed for every request.
|
436
|
+
#
|
437
|
+
# @param key [String] a name describing the data to be cached.
|
438
|
+
# @param options [Hash] a hash that enables further configuration of the fragment
|
439
|
+
# cache. The options are passed to the +cache+ helper of Rails. See the Rails
|
440
|
+
# {http://api.rubyonrails.org/classes/ActionView/Helpers/CacheHelper.html#method-i-cache documentation}
|
441
|
+
# for details.
|
442
|
+
def scrivito_cache(key, options=nil, &block)
|
443
|
+
workspace = Scrivito::Workspace.current
|
444
|
+
cache_if(workspace.published?, [workspace.cache_key, key], options, &block)
|
445
|
+
end
|
401
446
|
end
|
@@ -0,0 +1 @@
|
|
1
|
+
json.no_cache_url @no_cache_url
|
@@ -1,6 +1,6 @@
|
|
1
|
-
json.total @
|
2
|
-
json.
|
3
|
-
|
4
|
-
|
5
|
-
|
1
|
+
json.total @batch.total
|
2
|
+
json.continuation @batch.continuation
|
3
|
+
json.hits @batch.objs do |obj|
|
4
|
+
json.id obj.id
|
5
|
+
json.serialized_obj @formatter.call(obj, scrivito_user, controller.view_context)
|
6
6
|
end
|
@@ -1,2 +1,2 @@
|
|
1
|
-
json.
|
2
|
-
json.
|
1
|
+
json.merge! @error.as_json
|
2
|
+
json.timestamp @timestamp.to_s
|
data/config/ca-bundle.crt
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
##
|
2
2
|
## Bundle of CA Root Certificates
|
3
3
|
##
|
4
|
-
## Certificate data from Mozilla as of:
|
4
|
+
## Certificate data from Mozilla as of: Fri Jan 8 14:27:07 2016
|
5
5
|
##
|
6
6
|
## This is a bundle of X.509 certificates of public Certificate Authorities
|
7
7
|
## (CA). These were automatically extracted from Mozilla's root certificates
|
data/config/precedence_routes.rb
CHANGED
@@ -3,64 +3,67 @@ Rails.application.routes.draw do
|
|
3
3
|
end
|
4
4
|
|
5
5
|
Scrivito::SdkEngine.routes.draw do
|
6
|
-
|
7
|
-
|
8
|
-
collection do
|
9
|
-
get :page_class_selection
|
10
|
-
get :search
|
11
|
-
end
|
12
|
-
|
13
|
-
member do
|
14
|
-
get :widget
|
15
|
-
get :widget_class_selection
|
16
|
-
get :widget_modification
|
17
|
-
get :conflicting_workspaces
|
18
|
-
get :is_outdated
|
6
|
+
get 'scrivito', to: 'scrivito/ui#index'
|
7
|
+
get 'scrivito/*application_path', to: 'scrivito/ui#index', format: false
|
19
8
|
|
20
|
-
|
21
|
-
|
9
|
+
scope '__scrivito', module: 'scrivito' do
|
10
|
+
get ':id', to: 'cms_dispatch#index', as: :base_id, constraints: {id: /\h{16}/}
|
22
11
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
put :transfer_modifications
|
30
|
-
end
|
31
|
-
end
|
12
|
+
resources :objs, controller: 'objs', only: [:show, :create, :update, :destroy],
|
13
|
+
defaults: {format: :json} do
|
14
|
+
collection do
|
15
|
+
get :page_class_selection
|
16
|
+
get :search
|
17
|
+
end
|
32
18
|
|
33
|
-
|
34
|
-
|
19
|
+
member do
|
20
|
+
get :widget
|
21
|
+
get :widget_class_selection
|
22
|
+
get :widget_modification
|
23
|
+
get :conflicting_workspaces
|
24
|
+
get :is_outdated
|
25
|
+
get :binary_no_cache
|
35
26
|
|
36
|
-
|
37
|
-
|
38
|
-
put '__scrivito/blobs/activate_upload' => 'scrivito/blobs#activate_upload',
|
39
|
-
defaults: {format: :json}
|
27
|
+
post :copy
|
28
|
+
post :duplicate
|
40
29
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
put :
|
48
|
-
put :publish
|
49
|
-
get :check
|
30
|
+
put :revert
|
31
|
+
put :restore
|
32
|
+
put :mark_resolved
|
33
|
+
put :destroy_widget
|
34
|
+
put :revert_widget
|
35
|
+
put :restore_widget
|
36
|
+
put :transfer_modifications
|
50
37
|
end
|
51
38
|
end
|
52
39
|
|
53
|
-
|
54
|
-
get '__scrivito/suggest_completion' => 'scrivito/completion#suggest', defaults: {format: :json}
|
40
|
+
resources :tasks, controller: 'tasks', only: [:show], defaults: {format: :json}
|
55
41
|
|
56
|
-
|
57
|
-
|
42
|
+
get 'blobs/upload_permission' => 'blobs#upload_permission', defaults: {format: :json}
|
43
|
+
put 'blobs/activate_upload' => 'blobs#activate_upload', defaults: {format: :json}
|
58
44
|
|
59
|
-
|
60
|
-
|
45
|
+
resources :workspaces,
|
46
|
+
controller: 'workspaces',
|
47
|
+
only: [:index, :show, :create, :destroy],
|
48
|
+
defaults: {format: :json} do
|
49
|
+
member do
|
50
|
+
put :rename
|
51
|
+
put :memberships
|
52
|
+
put :rebase
|
53
|
+
put :publish
|
54
|
+
get :check
|
55
|
+
end
|
56
|
+
end
|
61
57
|
|
62
|
-
|
58
|
+
get 'users/suggest' => 'users#suggest', defaults: {format: :json}
|
59
|
+
get 'suggest_completion' => 'completion#suggest', defaults: {format: :json}
|
63
60
|
|
64
|
-
|
65
|
-
|
61
|
+
get 'render_widget/:id/show_widget/:widget_id' => 'cms_dispatch#show_widget'
|
62
|
+
get 'render_widget/:id/widget_details/:widget_id' => 'cms_dispatch#widget_details'
|
63
|
+
|
64
|
+
get 'page_details/:id' => 'cms_dispatch#page_details'
|
65
|
+
get 'resource_details/:resource_id', to: 'ui#index'
|
66
|
+
|
67
|
+
get 'to_binary' => 'binary_redirect#to_binary', as: :binary
|
68
|
+
end
|
66
69
|
end
|
data/config/routes.rb
CHANGED
@@ -1,14 +1 @@
|
|
1
|
-
Rails.application.routes
|
2
|
-
match '/', via: :all, to: 'scrivito/cms_dispatch#index', as: :scrivito_root
|
3
|
-
|
4
|
-
with_options via: :all, constraints: {id: /[0-9a-f]{16}/} do |proxy|
|
5
|
-
proxy.match '(/)(*slug-):id', to: 'scrivito/cms_dispatch#index', as: :cms_id
|
6
|
-
proxy.match ':id(/*slug)', to: 'scrivito/cms_dispatch#legacy', as: :cms_legacy_id
|
7
|
-
end
|
8
|
-
|
9
|
-
match '/*permalink',
|
10
|
-
to: 'scrivito/cms_dispatch#index',
|
11
|
-
as: :scrivito_permalink,
|
12
|
-
format: false,
|
13
|
-
via: :all
|
14
|
-
end
|
1
|
+
Scrivito::PresetRoutes.install_into(Rails.application.routes)
|