scrivito_sdk 0.30.0 → 0.40.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/scrivito/objs_controller.rb +29 -20
  3. data/app/controllers/scrivito/ui_controller.rb +18 -0
  4. data/app/helpers/scrivito_helper.rb +21 -4
  5. data/app/views/scrivito/objs/obj.json.jbuilder +1 -0
  6. data/app/views/scrivito/objs/update.json.jbuilder +1 -1
  7. data/app/views/scrivito/ui/index.html.erb +13 -0
  8. data/config/ca-bundle.crt +565 -3
  9. data/config/routes.rb +4 -0
  10. data/lib/assets/javascripts/scrivito_sdk.js +28 -19545
  11. data/lib/assets/javascripts/scrivito_ui.js +30398 -0
  12. data/lib/assets/stylesheets/scrivito_sdk.css +228 -232
  13. data/lib/assets/stylesheets/scrivito_ui.css +3148 -0
  14. data/lib/generators/scrivito/install/install_generator.rb +4 -0
  15. data/lib/generators/scrivito/install/templates/app/views/layouts/scrivito_dialog.html.erb +13 -0
  16. data/lib/generators/scrivito/page/templates/details.html.erb +1 -1
  17. data/lib/generators/scrivito/widget/templates/details.html.erb +1 -1
  18. data/lib/generators/scrivito/widget/templates/show.html.erb +1 -1
  19. data/lib/generators/scrivito/widget/templates/thumbnail.html.erb +2 -2
  20. data/lib/generators/scrivito/widget/widget_generator.rb +12 -0
  21. data/lib/scrivito/attribute_content.rb +4 -5
  22. data/lib/scrivito/basic_obj.rb +47 -8
  23. data/lib/scrivito/basic_widget.rb +41 -14
  24. data/lib/scrivito/cache.rb +2 -0
  25. data/lib/scrivito/child_list_tag.rb +1 -1
  26. data/lib/scrivito/client_config.rb +9 -11
  27. data/lib/scrivito/cms_backend.rb +5 -4
  28. data/lib/scrivito/cms_field_tag.rb +6 -2
  29. data/lib/scrivito/cms_rest_api/attribute_serializer.rb +2 -0
  30. data/lib/scrivito/cms_rest_api/widget_extractor.rb +5 -5
  31. data/lib/scrivito/connection_manager.rb +1 -0
  32. data/lib/scrivito/controller_actions.rb +24 -3
  33. data/lib/scrivito/image_tag_helper.rb +0 -12
  34. data/lib/scrivito/layout_tags.rb +1 -8
  35. data/lib/scrivito/link_parser.rb +5 -0
  36. data/lib/scrivito/{memberships_collection.rb → membership_collection.rb} +2 -2
  37. data/lib/scrivito/obj_class.rb +3 -6
  38. data/lib/scrivito/{objs_collection.rb → obj_collection.rb} +1 -1
  39. data/lib/scrivito/obj_create_params_parser.rb +15 -0
  40. data/lib/scrivito/obj_params_parser.rb +37 -45
  41. data/lib/scrivito/obj_update_params_parser.rb +25 -0
  42. data/lib/scrivito/revision.rb +6 -2
  43. data/lib/scrivito/sdk_engine.rb +6 -1
  44. data/lib/scrivito/test_request.rb +4 -0
  45. data/lib/scrivito/uploaded_binary.rb +4 -0
  46. data/lib/scrivito/user.rb +8 -0
  47. data/lib/scrivito/widget_collection.rb +22 -0
  48. data/lib/scrivito/workspace.rb +11 -6
  49. metadata +17 -11
  50. data/app/views/scrivito/objs/copy.json.jbuilder +0 -1
  51. data/app/views/scrivito/objs/create.json.jbuilder +0 -1
  52. data/app/views/scrivito/objs/details.json.jbuilder +0 -1
  53. data/lib/scrivito/widget_field_params.rb +0 -61
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scrivito_sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.30.0
4
+ version: 0.40.0.rc1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Infopark AG
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-05 00:00:00.000000000 Z
11
+ date: 2015-01-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -161,6 +161,7 @@ files:
161
161
  - app/controllers/scrivito/default_cms_controller.rb
162
162
  - app/controllers/scrivito/objs_controller.rb
163
163
  - app/controllers/scrivito/tasks_controller.rb
164
+ - app/controllers/scrivito/ui_controller.rb
164
165
  - app/controllers/scrivito/users_controller.rb
165
166
  - app/controllers/scrivito/webservice_controller.rb
166
167
  - app/controllers/scrivito/workspaces_controller.rb
@@ -168,13 +169,11 @@ files:
168
169
  - app/views/google_maps_widget/show.html.erb
169
170
  - app/views/scrivito/_editing_auth_warning.html.erb
170
171
  - app/views/scrivito/blobs/upload_permission.json.jbuilder
171
- - app/views/scrivito/objs/copy.json.jbuilder
172
172
  - app/views/scrivito/objs/copy_widget.html.erb
173
- - app/views/scrivito/objs/create.json.jbuilder
174
173
  - app/views/scrivito/objs/create_widget.html.erb
175
- - app/views/scrivito/objs/details.json.jbuilder
176
174
  - app/views/scrivito/objs/format_missing_error.json.jbuilder
177
175
  - app/views/scrivito/objs/modification.json.jbuilder
176
+ - app/views/scrivito/objs/obj.json.jbuilder
178
177
  - app/views/scrivito/objs/page_class_selection.json.jbuilder
179
178
  - app/views/scrivito/objs/search.json.jbuilder
180
179
  - app/views/scrivito/objs/search_only_size.json.jbuilder
@@ -182,6 +181,7 @@ files:
182
181
  - app/views/scrivito/objs/widget_class_selection.json.jbuilder
183
182
  - app/views/scrivito/objs/widget_modification.json.jbuilder
184
183
  - app/views/scrivito/tasks/show.json.jbuilder
184
+ - app/views/scrivito/ui/index.html.erb
185
185
  - app/views/scrivito/users/suggest.json.jbuilder
186
186
  - app/views/scrivito/webservice/empty.json
187
187
  - app/views/scrivito/webservice/error.json.jbuilder
@@ -204,7 +204,9 @@ files:
204
204
  - lib/assets/images/180x120.gif
205
205
  - lib/assets/images/scrivito/image_placeholder.png
206
206
  - lib/assets/javascripts/scrivito_sdk.js
207
+ - lib/assets/javascripts/scrivito_ui.js
207
208
  - lib/assets/stylesheets/scrivito_sdk.css
209
+ - lib/assets/stylesheets/scrivito_ui.css
208
210
  - lib/generators/scrivito/install/install_generator.rb
209
211
  - lib/generators/scrivito/install/templates/app/controllers/cms_controller.rb
210
212
  - lib/generators/scrivito/install/templates/app/controllers/page_controller.rb
@@ -219,6 +221,7 @@ files:
219
221
  - lib/generators/scrivito/install/templates/app/views/headline_widget/thumbnail.html.erb
220
222
  - lib/generators/scrivito/install/templates/app/views/image_widget/show.html.erb
221
223
  - lib/generators/scrivito/install/templates/app/views/image_widget/thumbnail.html.erb
224
+ - lib/generators/scrivito/install/templates/app/views/layouts/scrivito_dialog.html.erb
222
225
  - lib/generators/scrivito/install/templates/app/views/page/details.html.erb
223
226
  - lib/generators/scrivito/install/templates/app/views/page/index.html.erb
224
227
  - lib/generators/scrivito/install/templates/app/views/page/thumbnail.html.erb
@@ -292,7 +295,7 @@ files:
292
295
  - lib/scrivito/link_parser.rb
293
296
  - lib/scrivito/log_subscriber.rb
294
297
  - lib/scrivito/membership.rb
295
- - lib/scrivito/memberships_collection.rb
298
+ - lib/scrivito/membership_collection.rb
296
299
  - lib/scrivito/migration.rb
297
300
  - lib/scrivito/migrations.rb
298
301
  - lib/scrivito/migrations/cms_backend.rb
@@ -308,13 +311,15 @@ files:
308
311
  - lib/scrivito/obj_class.rb
309
312
  - lib/scrivito/obj_class_collection.rb
310
313
  - lib/scrivito/obj_class_data.rb
314
+ - lib/scrivito/obj_collection.rb
315
+ - lib/scrivito/obj_create_params_parser.rb
311
316
  - lib/scrivito/obj_data.rb
312
317
  - lib/scrivito/obj_data_from_hash.rb
313
318
  - lib/scrivito/obj_data_from_service.rb
314
319
  - lib/scrivito/obj_params_parser.rb
315
320
  - lib/scrivito/obj_search_builder.rb
316
321
  - lib/scrivito/obj_search_enumerator.rb
317
- - lib/scrivito/objs_collection.rb
322
+ - lib/scrivito/obj_update_params_parser.rb
318
323
  - lib/scrivito/rate_limit_exceeded.rb
319
324
  - lib/scrivito/restriction_set.rb
320
325
  - lib/scrivito/revision.rb
@@ -326,9 +331,10 @@ files:
326
331
  - lib/scrivito/text_link.rb
327
332
  - lib/scrivito/text_link_conversion.rb
328
333
  - lib/scrivito/type_computer.rb
334
+ - lib/scrivito/uploaded_binary.rb
329
335
  - lib/scrivito/user.rb
330
336
  - lib/scrivito/user_definition.rb
331
- - lib/scrivito/widget_field_params.rb
337
+ - lib/scrivito/widget_collection.rb
332
338
  - lib/scrivito/widget_garbage_collection.rb
333
339
  - lib/scrivito/widget_tag.rb
334
340
  - lib/scrivito/workspace.rb
@@ -354,12 +360,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
354
360
  version: 2.0.0
355
361
  required_rubygems_version: !ruby/object:Gem::Requirement
356
362
  requirements:
357
- - - '>='
363
+ - - '>'
358
364
  - !ruby/object:Gem::Version
359
- version: '0'
365
+ version: 1.3.1
360
366
  requirements: []
361
367
  rubyforge_project:
362
- rubygems_version: 2.2.2
368
+ rubygems_version: 2.4.5
363
369
  signing_key:
364
370
  specification_version: 4
365
371
  summary: SDK for the Scrivito CMS
@@ -1 +0,0 @@
1
- json.extract! @attributes, :_id, :_last_changed, :_obj_class, :_path
@@ -1 +0,0 @@
1
- json.extract! @obj, '_id', '_obj_class'
@@ -1 +0,0 @@
1
- json.markup @markup
@@ -1,61 +0,0 @@
1
- module Scrivito
2
-
3
- class WidgetFieldParams
4
- class UnknownWidgetAction < ScrivitoError
5
- end
6
-
7
- attr_reader :pool_params
8
-
9
- def initialize
10
- @pool_params = {}
11
- end
12
-
13
- def convert(params)
14
- widget_ids = []
15
-
16
- params.each do |widget_id_or_spec|
17
- if widget_id_or_spec.is_a?(Hash)
18
- action, spec = parse_action_and_spec(widget_id_or_spec)
19
- case action
20
- when 'create' then widget_ids << create_widget(spec)
21
- when 'copy' then widget_ids << copy_widget(*spec.values_at(:src_obj_id, :src_widget_id))
22
- else raise UnknownWidgetAction
23
- end
24
- else
25
- widget_ids << widget_id_or_spec
26
- end
27
- end
28
-
29
- {'list' => widget_ids.map { |widget_id| {'widget' => widget_id} }}
30
- end
31
-
32
- private
33
-
34
- def parse_action_and_spec(params)
35
- action, spec = params.flatten
36
- [action.to_s, spec.with_indifferent_access]
37
- end
38
-
39
- def create_widget(params)
40
- widget_pool_id = BasicObj.generate_widget_pool_id
41
- # At the moment the 'create' action supports only the '_obj_class' field.
42
- @pool_params[widget_pool_id] = {'_obj_class' => params['_obj_class']}
43
- widget_pool_id
44
- end
45
-
46
- def copy_widget(src_obj_id, src_widget_id)
47
- src_obj_content = CmsRestApi.get("workspaces/#{Workspace.current.id}/objs/#{src_obj_id}")
48
- widget_params = src_obj_content['_widget_pool']["#{src_widget_id}"]
49
-
50
- raise ResourceNotFound, "could not find widget with id #{src_widget_id}" unless widget_params
51
-
52
- src_widget = BasicObj.find(src_obj_id).widget_from_pool(src_widget_id)
53
- widget_params.delete_if { |field_name, _| src_widget.type_of_attribute(field_name) == 'widget' }
54
-
55
- widget_pool_id = BasicObj.generate_widget_pool_id
56
- @pool_params[widget_pool_id] = widget_params
57
- widget_pool_id
58
- end
59
- end
60
-
61
- end