scrivito_sdk 0.18.1 → 0.30.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (144) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/scrivito/blobs_controller.rb +1 -2
  3. data/app/controllers/scrivito/default_cms_controller.rb +9 -75
  4. data/app/controllers/scrivito/objs_controller.rb +107 -119
  5. data/app/controllers/scrivito/tasks_controller.rb +1 -1
  6. data/app/controllers/scrivito/users_controller.rb +1 -1
  7. data/app/controllers/scrivito/webservice_controller.rb +6 -2
  8. data/app/controllers/scrivito/workspaces_controller.rb +57 -17
  9. data/app/helpers/scrivito_helper.rb +285 -0
  10. data/app/views/google_maps_widget/show.html.erb +1 -0
  11. data/app/views/scrivito/_editing_auth_warning.html.erb +43 -0
  12. data/app/views/scrivito/blobs/upload_permission.json.jbuilder +1 -0
  13. data/app/views/scrivito/objs/copy.json.jbuilder +1 -0
  14. data/app/views/scrivito/objs/copy_widget.html.erb +1 -1
  15. data/app/views/scrivito/objs/create.json.jbuilder +1 -0
  16. data/app/views/scrivito/objs/create_widget.html.erb +1 -1
  17. data/app/views/scrivito/objs/details.json.jbuilder +1 -0
  18. data/app/views/scrivito/objs/format_missing_error.json.jbuilder +1 -0
  19. data/app/views/scrivito/objs/modification.json.jbuilder +1 -0
  20. data/app/views/scrivito/objs/page_class_selection.json.jbuilder +1 -0
  21. data/app/views/scrivito/objs/search.json.jbuilder +6 -0
  22. data/app/views/scrivito/objs/search_only_size.json.jbuilder +1 -0
  23. data/app/views/scrivito/objs/update.json.jbuilder +1 -0
  24. data/app/views/scrivito/objs/widget_class_selection.json.jbuilder +1 -0
  25. data/app/views/scrivito/objs/widget_modification.json.jbuilder +1 -0
  26. data/app/views/scrivito/tasks/show.json.jbuilder +3 -0
  27. data/app/views/scrivito/users/suggest.json.jbuilder +1 -0
  28. data/app/views/scrivito/webservice/empty.json +1 -0
  29. data/app/views/scrivito/webservice/error.json.jbuilder +2 -0
  30. data/app/views/scrivito/workspaces/_workspace.json.jbuilder +5 -0
  31. data/app/views/scrivito/workspaces/check.json.jbuilder +1 -0
  32. data/app/views/scrivito/workspaces/create.json.jbuilder +1 -0
  33. data/app/views/scrivito/workspaces/index.json.jbuilder +1 -0
  34. data/app/views/scrivito/workspaces/show.json.jbuilder +1 -0
  35. data/app/views/scrivito/workspaces/task.json.jbuilder +5 -0
  36. data/config/ca-bundle.crt +259 -234
  37. data/config/cms_routes.rb +2 -2
  38. data/config/routes.rb +3 -0
  39. data/lib/assets/javascripts/{scrivito_editing.js → scrivito_sdk.js} +1662 -1180
  40. data/lib/assets/stylesheets/{scrivito_editing.css → scrivito_sdk.css} +242 -6
  41. data/lib/generators/scrivito/install/install_generator.rb +62 -0
  42. data/lib/generators/scrivito/install/templates/app/controllers/cms_controller.rb +3 -0
  43. data/lib/generators/scrivito/install/templates/app/controllers/page_controller.rb +2 -0
  44. data/lib/generators/scrivito/install/templates/app/models/headline_widget.rb +7 -0
  45. data/lib/generators/scrivito/install/templates/app/models/image.rb +5 -0
  46. data/lib/generators/scrivito/install/templates/app/models/image_widget.rb +7 -0
  47. data/lib/generators/scrivito/install/templates/app/models/obj.rb +2 -0
  48. data/lib/generators/scrivito/install/templates/app/models/page.rb +8 -0
  49. data/lib/generators/scrivito/install/templates/app/models/text_widget.rb +7 -0
  50. data/lib/generators/scrivito/install/templates/app/models/widget.rb +2 -0
  51. data/lib/generators/scrivito/install/templates/app/views/headline_widget/show.html.erb +1 -0
  52. data/lib/generators/scrivito/install/templates/app/views/headline_widget/thumbnail.html.erb +3 -0
  53. data/lib/generators/scrivito/install/templates/app/views/image_widget/show.html.erb +1 -0
  54. data/lib/generators/scrivito/install/templates/app/views/image_widget/thumbnail.html.erb +3 -0
  55. data/lib/generators/scrivito/install/templates/app/views/page/details.html.erb +1 -0
  56. data/lib/generators/scrivito/install/templates/app/views/page/index.html.erb +16 -0
  57. data/lib/generators/scrivito/install/templates/app/views/page/thumbnail.html.erb +3 -0
  58. data/lib/generators/scrivito/install/templates/app/views/text_widget/show.html.erb +1 -0
  59. data/lib/generators/scrivito/install/templates/app/views/text_widget/thumbnail.html.erb +3 -0
  60. data/lib/generators/scrivito/install/templates/config/initializers/scrivito.rb +10 -0
  61. data/lib/generators/scrivito/install/templates/scrivito/migrate/install_scrivito.rb +49 -0
  62. data/lib/generators/scrivito/migration/USAGE +9 -0
  63. data/lib/generators/{cms → scrivito}/migration/migration_generator.rb +4 -9
  64. data/lib/generators/{cms → scrivito}/migration/templates/migration.erb +3 -3
  65. data/lib/generators/{cms → scrivito}/widget/templates/details.html.erb +0 -0
  66. data/lib/generators/{cms → scrivito}/widget/templates/migration.erb +0 -0
  67. data/lib/generators/{cms → scrivito}/widget/templates/model.erb +0 -0
  68. data/lib/generators/{cms → scrivito}/widget/templates/show.html.erb +0 -0
  69. data/lib/generators/scrivito/widget/templates/thumbnail.html.erb +3 -0
  70. data/lib/generators/{cms → scrivito}/widget/widget_generator.rb +3 -2
  71. data/lib/obj.rb +17 -3
  72. data/lib/scrivito/attribute_collection.rb +7 -12
  73. data/lib/scrivito/attribute_content.rb +31 -12
  74. data/lib/scrivito/basic_obj.rb +186 -96
  75. data/lib/scrivito/basic_widget.rb +25 -10
  76. data/lib/scrivito/binary.rb +75 -0
  77. data/lib/scrivito/cache_garbage_collector.rb +19 -4
  78. data/lib/scrivito/child_list_tag.rb +108 -0
  79. data/lib/scrivito/client_config.rb +2 -1
  80. data/lib/scrivito/client_error.rb +3 -2
  81. data/lib/scrivito/cms_backend.rb +81 -16
  82. data/lib/scrivito/cms_dispatch_controller.rb +7 -0
  83. data/lib/scrivito/cms_env.rb +0 -2
  84. data/lib/scrivito/cms_field_tag.rb +44 -35
  85. data/lib/scrivito/cms_rest_api.rb +23 -6
  86. data/lib/scrivito/cms_rest_api/attribute_serializer.rb +1 -1
  87. data/lib/scrivito/cms_routing.rb +120 -0
  88. data/lib/scrivito/configuration.rb +69 -58
  89. data/lib/scrivito/connection_manager.rb +30 -1
  90. data/lib/scrivito/content_service.rb +10 -7
  91. data/lib/scrivito/controller_actions.rb +108 -0
  92. data/lib/scrivito/diff.rb +30 -15
  93. data/lib/scrivito/editing_context.rb +4 -0
  94. data/lib/scrivito/editing_context_helper.rb +19 -0
  95. data/lib/scrivito/editing_context_middleware.rb +20 -1
  96. data/lib/scrivito/image_tag_helper.rb +44 -0
  97. data/lib/scrivito/layout_tags.rb +33 -0
  98. data/lib/scrivito/link.rb +4 -2
  99. data/lib/scrivito/membership.rb +0 -8
  100. data/lib/scrivito/migrations.rb +0 -1
  101. data/lib/scrivito/migrations/installer.rb +1 -1
  102. data/lib/scrivito/migrations/migration.rb +0 -2
  103. data/lib/scrivito/migrations/migrator.rb +2 -3
  104. data/lib/scrivito/obj_class.rb +64 -16
  105. data/lib/scrivito/obj_class_data.rb +4 -0
  106. data/lib/scrivito/obj_search_enumerator.rb +1 -1
  107. data/lib/scrivito/routing_helper.rb +42 -0
  108. data/lib/scrivito/{engine.rb → sdk_engine.rb} +15 -29
  109. data/lib/scrivito/tag_renderer.rb +40 -0
  110. data/lib/scrivito/test_request.rb +40 -0
  111. data/lib/scrivito/type_computer.rb +1 -6
  112. data/lib/scrivito/user.rb +33 -15
  113. data/lib/scrivito/user_definition.rb +34 -6
  114. data/lib/scrivito/widget_tag.rb +67 -0
  115. data/lib/scrivito/workspace.rb +12 -24
  116. data/lib/scrivito_sdk.rb +17 -1
  117. data/lib/tasks/cache.rake +4 -5
  118. data/lib/tasks/migration.rake +1 -1
  119. data/lib/widget.rb +21 -3
  120. metadata +119 -70
  121. data/README +0 -6
  122. data/app/controllers/cms_controller.rb +0 -7
  123. data/app/helpers/cms_helper.rb +0 -7
  124. data/app/helpers/cms_routing_helper.rb +0 -7
  125. data/app/helpers/scrivito/cms_asset_helper.rb +0 -110
  126. data/app/helpers/scrivito/cms_tag_helper.rb +0 -232
  127. data/app/helpers/scrivito/default_cms_helper.rb +0 -21
  128. data/app/helpers/scrivito/default_cms_routing_helper.rb +0 -128
  129. data/app/helpers/scrivito/display_helper.rb +0 -64
  130. data/app/helpers/scrivito/editing_helper.rb +0 -32
  131. data/app/helpers/scrivito/layout_helper.rb +0 -21
  132. data/app/models/named_link.rb +0 -2
  133. data/app/views/cms/_index.html.erb +0 -7
  134. data/app/views/cms/index.html.erb +0 -1
  135. data/app/views/scrivito/_editing_javascript.html.erb +0 -7
  136. data/app/views/scrivito/default_cms/show_widget.html.erb +0 -1
  137. data/lib/assets/stylesheets/scrivito.css +0 -199
  138. data/lib/generators/cms/migration/USAGE +0 -9
  139. data/lib/generators/cms/widget/templates/thumbnail.html.erb +0 -2
  140. data/lib/scrivito/blob.rb +0 -48
  141. data/lib/scrivito/cms_accessible.rb +0 -30
  142. data/lib/scrivito/cms_rest_api/blob_uploader.rb +0 -18
  143. data/lib/scrivito/cms_test_request.rb +0 -23
  144. data/lib/scrivito/migrations/migration_dsl.rb +0 -180
@@ -26,6 +26,35 @@ module Scrivito
26
26
  def reset_instance!
27
27
  @instance = nil
28
28
  end
29
+
30
+ def request(uri, request, timeout = nil)
31
+ instance_for(uri).request(request, timeout)
32
+ end
33
+
34
+ # For test purpose only.
35
+ def clear_cache!
36
+ @instances = nil
37
+ end
38
+
39
+ def cert_store
40
+ @cert_store ||= OpenSSL::X509::Store.new.tap do |store|
41
+ store.set_default_paths
42
+ store.add_file(Configuration.ca_file)
43
+ end
44
+ end
45
+
46
+ private
47
+
48
+ def instance_for(uri)
49
+ endpoint_url = "#{uri.scheme}://#{uri.host}:#{uri.port}"
50
+ instances.fetch(endpoint_url) do
51
+ instances[endpoint_url] = new(URI.parse(endpoint_url))
52
+ end
53
+ end
54
+
55
+ def instances
56
+ @instances ||= {}
57
+ end
29
58
  end
30
59
 
31
60
  def initialize(uri)
@@ -56,7 +85,7 @@ module Scrivito
56
85
  if uri.scheme == 'https'
57
86
  conn.use_ssl = true
58
87
  conn.verify_mode = OpenSSL::SSL::VERIFY_PEER
59
- conn.ca_file = Scrivito::Configuration.ca_file
88
+ conn.cert_store = self.class.cert_store
60
89
  end
61
90
  configure_timeout(conn, timeout)
62
91
  retry_twice_on_socket_error do
@@ -93,16 +93,19 @@ class ContentService
93
93
  end
94
94
 
95
95
  def handle_response(response)
96
- if response.code.first == '2'
97
- retry_after = response["Retry-After"]
96
+ case code = response.code
97
+ when /^2/
98
+ retry_after = response['Retry-After']
98
99
  @next_request_not_before = retry_after ? Time.now + retry_after.to_f : nil
99
100
  MultiJson.load(response.body)
100
- elsif response.code == "429"
101
- raise RateLimitExceeded.new(response["Retry-After"])
102
- elsif response.code == '403'
103
- raise AccessDenied.new(response.body)
101
+ when '429' then raise RateLimitExceeded.new(response['Retry-After'])
102
+ when '403' then raise AccessDenied.new(response.body)
103
+ when '401', '404'
104
+ raise NetworkError.new(
105
+ 'There was a problem communicating with the Scrivito backend. '\
106
+ 'Check your configuration, i.e. "tenant" and "api_key".', code)
104
107
  else
105
- raise NetworkError.new("Server responded with status code #{response.code}", response.code)
108
+ raise NetworkError.new("Server responded with status code #{code}", code)
106
109
  end
107
110
  end
108
111
 
@@ -0,0 +1,108 @@
1
+ module Scrivito
2
+ #
3
+ # This module provides CMS controller actions.
4
+ # Include it in controller you want to make able to deliver +Obj+s.
5
+ #
6
+ # @api public
7
+ #
8
+ # @see Scrivito::TestRequest#for_scrivito_obj
9
+ #
10
+ # @example
11
+ # class PageCmsController < ApplicationController
12
+ # include Scrivito::ControllerActions
13
+ # end
14
+ #
15
+ module ControllerActions
16
+ extend ActiveSupport::Concern
17
+
18
+ included do
19
+ before_filter :require_authenticated_editor, only: [
20
+ :details_page,
21
+ :show_widget,
22
+ :widget_details,
23
+ ]
24
+
25
+ before_filter :load_object
26
+ end
27
+
28
+ #
29
+ # Default action.
30
+ # Delivers files directly if +Obj+ is binary.
31
+ # Otherwise the view is rendered.
32
+ #
33
+ # @api public
34
+ #
35
+ def index
36
+ deliver_file if @obj.binary?
37
+ end
38
+
39
+ def show_widget
40
+ widget = load_widget
41
+ render text: Scrivito::WidgetTag.new(view_context, widget).render, layout: false
42
+ end
43
+
44
+ def widget_details
45
+ widget = load_widget
46
+ template_path = "#{widget.obj_class_name.underscore}/details"
47
+ render template_path, layout: false, locals: {widget: widget}
48
+ end
49
+
50
+ def details_page
51
+ @scrivito_resource = editing_context.selected_workspace.objs
52
+ .find_including_deleted(params[:resource_id])
53
+ render text: '', layout: true
54
+ end
55
+
56
+ module ClassMethods
57
+ #
58
+ # This method indicates if this controller should be used automatically when an +Obj+ is
59
+ # requested via the SDK's standard routes. It returns +true+ by default.
60
+ #
61
+ # Overwrite it to return +false+ if you do want your controller to be excluded from +Obj+
62
+ # dispatching.
63
+ #
64
+ # @api public
65
+ # @see Obj#controller_name
66
+ #
67
+ def use_for_obj_dispatch?
68
+ true
69
+ end
70
+ end
71
+
72
+ private
73
+
74
+ def require_authenticated_editor
75
+ head(:forbidden) unless editing_context.authenticated_editor?
76
+ end
77
+
78
+ def editing_context
79
+ request.env[EditingContextMiddleware::ENVKEY] || EditingContext.new
80
+ end
81
+
82
+ def load_object
83
+ CmsEnv.new(request.env).load
84
+ loaded_obj = request.env[CmsEnv::OBJ_ENV_KEY]
85
+ raise loaded_obj if loaded_obj.is_a?(StandardError)
86
+ @obj = loaded_obj
87
+ end
88
+
89
+ def load_widget
90
+ @obj.widget_from_pool(params[:widget_id])
91
+ end
92
+
93
+ #
94
+ # Deliver a binary +Obj+ by redirecting to its {BasicObj#binary Obj#binary}'s url.
95
+ # Will respond with 404 if the +Obj+ has no +blob+.
96
+ #
97
+ # @api public
98
+ #
99
+ def deliver_file
100
+ if url = @obj.binary_url
101
+ redirect_to CmsRouting.match_protocol(url, request)
102
+ else
103
+ render text: 'Empty Blob', status: 404
104
+ end
105
+ end
106
+ end
107
+
108
+ end
@@ -25,25 +25,40 @@ class Diff; class << self
25
25
  end
26
26
 
27
27
  def for_html(mode, old, new)
28
- return nil if !old
29
- return nil if !new
30
-
31
- hyp_diff_options =
32
- case mode
33
- when "added"
34
- {render_deletion: proc {}, markup_from: "after"}
35
- when "deleted"
36
- {render_insertion: proc {}, markup_from: "before"}
37
- when "diff"
38
- {}
39
- else
40
- return nil
41
- end
28
+ return if !old
29
+ return if !new
30
+ return unless %w[added deleted diff].include?(mode)
42
31
 
43
- diff = HypDiff.compare(old, new, hyp_diff_options)
32
+ diff = HypDiff.compare(old, new, hyp_diff_options(mode))
44
33
  [StringTagging.tag_as_html(diff)]
45
34
  end
46
35
 
36
+ def hyp_diff_options(mode)
37
+ render_insertion_proc = proc { |html| "<span class='scrivito_insertion'>#{html}</span>" }
38
+ render_deletion_proc = proc { |html| "<span class='scrivito_deletion'>#{html}</span>" }
39
+ render_nothing_proc = proc {}
40
+
41
+ case mode
42
+ when 'added'
43
+ {
44
+ render_insertion: render_insertion_proc,
45
+ render_deletion: render_nothing_proc,
46
+ markup_from: 'after'
47
+ }
48
+ when 'deleted'
49
+ {
50
+ render_insertion: render_nothing_proc,
51
+ render_deletion: render_deletion_proc,
52
+ markup_from: 'before'
53
+ }
54
+ when 'diff'
55
+ {
56
+ render_insertion: render_insertion_proc,
57
+ render_deletion: render_deletion_proc
58
+ }
59
+ end
60
+ end
61
+
47
62
  class ListComparison
48
63
  def self.for(mode, old, new)
49
64
  new(mode).compare(old, new).result
@@ -65,6 +65,10 @@ class EditingContext
65
65
  end
66
66
  end
67
67
 
68
+ def editable_display_mode?
69
+ display_mode == 'editing'
70
+ end
71
+
68
72
  def to_params
69
73
  {
70
74
  '_scrivito_display_mode' => display_mode,
@@ -0,0 +1,19 @@
1
+ module Scrivito
2
+
3
+ class EditingContextHelper < Struct.new(:request)
4
+ def scrivito_user
5
+ editing_context.editor
6
+ end
7
+
8
+ def in_editable_view?
9
+ editing_context.editable_display_mode?
10
+ end
11
+
12
+ private
13
+
14
+ def editing_context
15
+ Scrivito::EditingContextMiddleware.from_request(request)
16
+ end
17
+ end
18
+
19
+ end
@@ -5,6 +5,10 @@ module Scrivito
5
5
  class EditingContextMiddleware
6
6
  ENVKEY = 'SCRIVITO_EDITING_CONTEXT'
7
7
 
8
+ def self.from_request(request)
9
+ request.env[ENVKEY]
10
+ end
11
+
8
12
  def initialize(app)
9
13
  @app = app
10
14
  end
@@ -26,7 +30,7 @@ class EditingContextMiddleware
26
30
 
27
31
  env[ENVKEY] = EditingContext.new(
28
32
  display_mode: display_mode,
29
- editor: -> { Configuration.editing_auth_callback.call(env) },
33
+ editor: editor_proc(env),
30
34
  selected_workspace_id: workspace_id
31
35
  )
32
36
 
@@ -35,6 +39,21 @@ class EditingContextMiddleware
35
39
 
36
40
  private
37
41
 
42
+ def editor_proc(env)
43
+ if editing_auth_callback = Configuration.editing_auth_callback
44
+ -> { editing_auth_callback.call(env) }
45
+ else
46
+ Rails.logger.warn(%{
47
+ WARNING!
48
+
49
+ Application is running in "#{Rails.env}" environment, but authentication is not configured.
50
+ For security reasons the in-place editing is disabled.
51
+ Please see https://scrivito.com/permissions for details.
52
+ })
53
+ nil
54
+ end
55
+ end
56
+
38
57
  def parse_url_params(request)
39
58
  {
40
59
  'display_mode' => request.params['_scrivito_display_mode'],
@@ -0,0 +1,44 @@
1
+ module Scrivito
2
+
3
+ class ImageTagHelper < Struct.new(:view_context)
4
+
5
+ def self.display_title(target)
6
+ if target.respond_to?(:display_title)
7
+ return target.display_title
8
+ elsif target.respond_to?(:first) && target.first.respond_to?(:display_title)
9
+ return target.first.display_title
10
+ end
11
+ end
12
+
13
+ def options(obj, field_name, tag_options, editing_options)
14
+ tag_options.reverse_merge(src: scrivito_image_tag_src(obj, field_name, editing_options),
15
+ alt: scrivito_image_tag_alt(obj, field_name))
16
+ end
17
+
18
+ private
19
+
20
+ def scrivito_image_tag_src(obj, field_name, editing_options)
21
+ scrivito_image_tag_path(obj, field_name) || editing_options[:placeholder] ||
22
+ view_context.image_path('scrivito/image_placeholder.png')
23
+ end
24
+
25
+ def scrivito_image_tag_alt(obj, field_name)
26
+ self.class.display_title(obj[field_name])
27
+ end
28
+
29
+ def scrivito_image_tag_path(obj, field_name)
30
+ field_type = obj.type_of_attribute(field_name)
31
+ field_value = obj[field_name]
32
+
33
+ case field_type
34
+ when 'reference' then field_value && view_context.scrivito_path(field_value)
35
+ when 'link' then field_value && view_context.scrivito_path(field_value)
36
+ when 'linklist'
37
+ path = view_context.scrivito_path(field_value)
38
+ path == CmsRouting::LINK_TO_EMPTY_LINKLIST ? nil : path
39
+ end
40
+ end
41
+
42
+ end
43
+
44
+ end
@@ -0,0 +1,33 @@
1
+ module Scrivito
2
+
3
+ class LayoutTags < Struct.new(:view)
4
+ def client_config(obj, resource)
5
+ if view.scrivito_user
6
+ editing_context = EditingContextMiddleware.from_request(view.request)
7
+ config = ClientConfig.new(obj, editing_context, view.lookup_context,
8
+ resource: resource,
9
+ return_to: view.params[:return_to]
10
+ ).to_json
11
+ view.content_tag(:div, '', 'data-scrivito-private-config' => config, style: 'display:none')
12
+ end
13
+ end
14
+
15
+ def editing_auth_warning
16
+ view.render('scrivito/editing_auth_warning') unless Configuration.editing_auth_callback
17
+ end
18
+
19
+ def generator_meta_tag
20
+ content = 'Scrivito by Infopark AG (scrivito.com)'
21
+ content << "; Version #{GemInfo.version}" if view.scrivito_user
22
+ view.tag(:meta, name: 'generator', content: content)
23
+ end
24
+
25
+ def reset_stylesheet_tag
26
+ view.content_tag(:style, %{
27
+ *[data-scrivito-field-type="widget"],
28
+ *[data-scrivito-private-widget-id] { position: relative; }
29
+ }.squish, {type: 'text/css'}, false)
30
+ end
31
+ end
32
+
33
+ end
@@ -1,6 +1,8 @@
1
+ require 'active_model/naming'
2
+
1
3
  module Scrivito
2
4
  # This class provides an interfaces for handling CMS Links.
3
- # To format a link for rendering in an html page, use the +cms_path+ or +cms_url+ methods.
5
+ # To format a link for rendering in an html page, use the +scrivito_path+ or +scrivito_url+ methods.
4
6
  # @api public
5
7
  class Link
6
8
 
@@ -31,7 +33,7 @@ module Scrivito
31
33
 
32
34
  # The link's external url. Only available for external links.
33
35
  # Warning: Do not output the url directly unless you know what you are doing.
34
- # Normally you want to use the +cms_path+ or +cms_url+ methods to format a link.
36
+ # Normally you want to use the +scrivito_path+ or +scrivito_url+ methods to format a link.
35
37
  # @api public
36
38
  def url
37
39
  @link_data[:url]
@@ -33,13 +33,5 @@ module Scrivito
33
33
  def user
34
34
  User.find(user_id) || User.unknown_user(user_id)
35
35
  end
36
-
37
- def as_json(options = nil)
38
- {
39
- user_id: user_id,
40
- role: role,
41
- description: user.description,
42
- }
43
- end
44
36
  end
45
37
  end
@@ -5,7 +5,6 @@ module Scrivito
5
5
  autoload :Migration
6
6
  autoload :Migrator
7
7
  autoload :MigrationStore
8
- autoload :MigrationDsl
9
8
  autoload :CmsBackend
10
9
  autoload :WorkspaceLock
11
10
  end
@@ -38,7 +38,7 @@ module Scrivito
38
38
  end
39
39
 
40
40
  def relative_migration_path
41
- 'cms/migrate'
41
+ Scrivito::Configuration.migration_path
42
42
  end
43
43
  end
44
44
  end
@@ -13,8 +13,6 @@ module Scrivito
13
13
  # end
14
14
  # end
15
15
  class Migration
16
- include MigrationDsl
17
-
18
16
  class << self
19
17
  def copy(destination, sources)
20
18
  unless File.exist?(destination)