infopark_cloud_connector 6.9.0.3.197272233 → 6.9.1.3.22208381

Sign up to get free protection for your applications and to get access to all the features.
@@ -689,6 +689,14 @@ module RailsConnector
689
689
  output_objs
690
690
  end
691
691
 
692
+ def destroy
693
+ if children.any?
694
+ raise ClientError.new(I18n.t('rails_connector.errors.models.basic_obj.has_children'), 412)
695
+ end
696
+ self.class.find_objs_by(:ppath, ["/_widgets/#{id}"]).first.map(&:destroy)
697
+ CmsRestApi.delete("revisions/#{Workspace.current.revision_id}/objs/#{id}")
698
+ end
699
+
692
700
  private
693
701
 
694
702
  attr_accessor :data_from_cms
@@ -23,21 +23,17 @@ module RailsConnector
23
23
  private
24
24
 
25
25
  def create
26
- # Create attribute
27
- CmsRestApi.post(
28
- endpoint('attributes'),
29
- :attribute => {
30
- :name => attribute_name,
31
- :type => :text,
32
- }
33
- )
34
-
35
26
  # Create obj class
36
27
  CmsRestApi.post(
37
28
  endpoint('obj_classes'),
38
29
  :obj_class => {
39
30
  :name => obj_class_name,
40
- :attributes => [attribute_name],
31
+ :attributes => [
32
+ {
33
+ :name => attribute_name,
34
+ :type => :text,
35
+ },
36
+ ],
41
37
  :type => :publication,
42
38
  :title => obj_class_name,
43
39
  }
@@ -1,5 +1,7 @@
1
1
  module RailsConnector
2
+ # @api public
2
3
  module Migrations
4
+ # @api public
3
5
  module MigrationDsl
4
6
  # Creates a CMS attribute.
5
7
  #
@@ -11,7 +13,11 @@ module RailsConnector
11
13
  # CMS attribute.
12
14
  #
13
15
  # @return nothing
16
+ # @deprecated Please use local attributes. Create attributes using {#create_obj_class} or
17
+ # {#update_obj_class}.
18
+ # @api public
14
19
  def create_attribute(attributes = {})
20
+ warn_deprecated __callee__, 'create_obj_class', 'update_obj_class'
15
21
  endpoint = "revisions/#{Workspace.current.revision_id}/attributes"
16
22
 
17
23
  CmsRestApi.post(endpoint, :attribute => attributes)
@@ -27,6 +33,7 @@ module RailsConnector
27
33
  # CMS object.
28
34
  #
29
35
  # @return nothing
36
+ # @api public
30
37
  def create_obj(attributes = {})
31
38
  endpoint = "revisions/#{Workspace.current.revision_id}/objs"
32
39
 
@@ -43,6 +50,7 @@ module RailsConnector
43
50
  # CMS object class.
44
51
  #
45
52
  # @return nothing
53
+ # @api public
46
54
  def create_obj_class(attributes = {})
47
55
  endpoint = "revisions/#{Workspace.current.revision_id}/obj_classes"
48
56
 
@@ -58,7 +66,10 @@ module RailsConnector
58
66
  # @param id [String] The ID of the CMS attribute.
59
67
  #
60
68
  # @return nothing
69
+ # @deprecated Please use local attributes. Delete attributes using {#update_obj_class}.
70
+ # @api public
61
71
  def delete_attribute(id)
72
+ warn_deprecated __callee__, 'update_obj_class'
62
73
  endpoint = "revisions/#{Workspace.current.revision_id}/attributes/#{id}"
63
74
 
64
75
  CmsRestApi.delete(endpoint)
@@ -73,6 +84,7 @@ module RailsConnector
73
84
  # @param id [String] The ID of the CMS object.
74
85
  #
75
86
  # @return nothing
87
+ # @api public
76
88
  def delete_obj(id)
77
89
  endpoint = "revisions/#{Workspace.current.revision_id}/objs/#{id}"
78
90
 
@@ -88,7 +100,10 @@ module RailsConnector
88
100
  # @param id [String] The ID of the attribute.
89
101
  #
90
102
  # @return [Hash] a hash with attributes and their values.
103
+ # @deprecated Please use local attributes. Get attributes using {#get_obj_class}.
104
+ # @api public
91
105
  def get_attribute(id)
106
+ warn_deprecated __callee__, 'get_obj_class'
92
107
  endpoint = "revisions/#{Workspace.current.revision_id}/attributes/#{id}"
93
108
 
94
109
  CmsRestApi.get(endpoint)
@@ -103,6 +118,7 @@ module RailsConnector
103
118
  # @param id [String] The ID of the CMS object.
104
119
  #
105
120
  # @return [Hash] a hash with attributes and their values.
121
+ # @api public
106
122
  def get_obj(id)
107
123
  endpoint = "revisions/#{Workspace.current.revision_id}/objs/#{id}"
108
124
 
@@ -118,6 +134,7 @@ module RailsConnector
118
134
  # @param id [String] The ID of the object class.
119
135
  #
120
136
  # @return [Hash] a hash with attributes and their values.
137
+ # @api public
121
138
  def get_obj_class(id)
122
139
  endpoint = "revisions/#{Workspace.current.revision_id}/obj_classes/#{id}"
123
140
 
@@ -134,7 +151,10 @@ module RailsConnector
134
151
  # @param attributes [Hash] The updated attributes and their values.
135
152
  #
136
153
  # @return nothing
154
+ # @deprecated Please use local attributes. Update attributes using {#update_obj_class}.
155
+ # @api public
137
156
  def update_attribute(id, attributes = {})
157
+ warn_deprecated __callee__, 'update_obj_class'
138
158
  endpoint = "revisions/#{Workspace.current.revision_id}/attributes/#{id}"
139
159
 
140
160
  CmsRestApi.put(endpoint, :attribute => attributes)
@@ -150,6 +170,7 @@ module RailsConnector
150
170
  # @param attributes [Hash] The updated attributes and their values.
151
171
  #
152
172
  # @return nothing
173
+ # @api public
153
174
  def update_obj(id, attributes = {})
154
175
  endpoint = "revisions/#{Workspace.current.revision_id}/objs/#{id}"
155
176
 
@@ -166,11 +187,18 @@ module RailsConnector
166
187
  # @param attributes [Hash] The updated attributes and their values.
167
188
  #
168
189
  # @return nothing
190
+ # @api public
169
191
  def update_obj_class(id, attributes = {})
170
192
  endpoint = "revisions/#{Workspace.current.revision_id}/obj_classes/#{id}"
171
193
 
172
194
  CmsRestApi.put(endpoint, :obj_class => attributes)
173
195
  end
196
+
197
+ private
198
+
199
+ def warn_deprecated(method, *substitutes)
200
+ warn "[DEPRECATION] '#{method}' is deprecated. Use '#{substitutes.join("' or '")}' instead."
201
+ end
174
202
  end
175
203
  end
176
- end
204
+ end
@@ -13,7 +13,7 @@ module RailsConnector
13
13
  type = type_of_internal(attribute_name)
14
14
  [default_attribute_value(type), type]
15
15
  else
16
- raise "Illegal attribute name #{attribute_name}"
16
+ raise RailsConnectorError.new("Illegal attribute name #{attribute_name}")
17
17
  end
18
18
  elsif value_and_type.length == 1
19
19
  [value_and_type.first, type_of_internal(attribute_name)]
@@ -18,12 +18,12 @@ class WidgetRenderer < AbstractController::Base
18
18
  @widget_field_name = widget_field_name
19
19
  @container = container
20
20
 
21
- render_to_string "#{widget.obj_class.underscore}/show"
21
+ render_to_string "#{widget.obj_class.underscore}/views/show"
22
22
  end
23
23
 
24
24
  def thumbnail(widget_dir)
25
25
  begin
26
- render_to_string "#{widget_dir}/thumbnail"
26
+ render_to_string "#{widget_dir}/views/thumbnail"
27
27
  rescue ActionView::MissingTemplate => e
28
28
  view_context.widget_thumbnail(
29
29
  widget_dir.titleize,
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: infopark_cloud_connector
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.9.0.3.197272233
4
+ version: 6.9.1.3.22208381
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-04-05 00:00:00.000000000 Z
12
+ date: 2013-04-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rest-client
@@ -69,19 +69,29 @@ extra_rdoc_files: []
69
69
  files:
70
70
  - .yardopts
71
71
  - README
72
+ - app/controllers/rails_connector/blobs_controller.rb
72
73
  - app/controllers/rails_connector/objs_controller.rb
74
+ - app/controllers/rails_connector/tasks_controller.rb
75
+ - app/controllers/rails_connector/webservice_controller.rb
76
+ - app/controllers/rails_connector/workspaces_controller.rb
77
+ - app/helpers/rails_connector/cms_asset_helper.rb
73
78
  - app/helpers/rails_connector/cms_tag_helper.rb
74
79
  - app/helpers/rails_connector/editing_helper.rb
75
80
  - app/helpers/rails_connector/marker_helper.rb
76
81
  - app/helpers/rails_connector/widget_helper.rb
77
82
  - app/views/rails_connector/_editing_javascript.html.erb
78
83
  - app/views/rails_connector/objs/create_widget.html.erb
84
+ - config/locales/de.rails_connector.models.yml
85
+ - config/locales/en.rails_connector.models.yml
79
86
  - config/routes.rb
80
87
  - lib/assets/fonts/infopark_icons-webfont.eot
81
88
  - lib/assets/fonts/infopark_icons-webfont.ttf
82
89
  - lib/assets/fonts/infopark_icons-webfont.woff
83
90
  - lib/assets/images/180x120.gif
91
+ - lib/assets/images/ip_logo_app.png
92
+ - lib/assets/images/ip_logo_app2x.png
84
93
  - lib/assets/images/irongrip.png
94
+ - lib/assets/images/rails_connector/image_placeholder.png
85
95
  - lib/assets/javascripts/infopark_editing.js
86
96
  - lib/assets/stylesheets/infopark_editing.css
87
97
  - lib/generators/cms/migration/USAGE
@@ -146,7 +156,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
146
156
  version: '0'
147
157
  segments:
148
158
  - 0
149
- hash: 779053553
159
+ hash: 22411057
150
160
  required_rubygems_version: !ruby/object:Gem::Requirement
151
161
  none: false
152
162
  requirements:
@@ -155,7 +165,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
155
165
  version: 1.3.5
156
166
  requirements: []
157
167
  rubyforge_project:
158
- rubygems_version: 1.8.23
168
+ rubygems_version: 1.8.25
159
169
  signing_key:
160
170
  specification_version: 3
161
171
  summary: Infopark Cloud Connector