infopark_cloud_connector 6.8.0.beta.200.869.9609b39 → 6.8.0.beta.200.883.f5f063b
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/infopark_cloud_connector.rb +0 -1
- data/lib/rails_connector/blob.rb +0 -2
- data/lib/rails_connector/chain.rb +5 -6
- data/lib/rails_connector/cms_base_model.rb +8 -13
- data/lib/rails_connector/revision.rb +1 -3
- metadata +29 -28
- data/lib/rails_connector/couch_blob.rb +0 -38
- data/lib/rails_connector/couchdb_views_source_path.rb +0 -7
data/lib/rails_connector/blob.rb
CHANGED
@@ -49,11 +49,11 @@ class Chain
|
|
49
49
|
# returns a hash of results from the query.
|
50
50
|
# the keys are the criterion by which the query results are grouped (typically the OBJ ID).
|
51
51
|
# the values are tuples where
|
52
|
-
# the first element denotes the diff type and
|
53
|
-
# the second the document rows
|
54
|
-
def query(index, key
|
52
|
+
# - the first element denotes the diff type and
|
53
|
+
# - the second the document rows
|
54
|
+
def query(index, key)
|
55
55
|
self.class.count_query
|
56
|
-
result_map = perform_queries(index, key
|
56
|
+
result_map = perform_queries(index, key)
|
57
57
|
version_map = result_map.merge(result_map) do |ignore, results|
|
58
58
|
results.map {|row| Version.new(row) }
|
59
59
|
end
|
@@ -79,13 +79,12 @@ class Chain
|
|
79
79
|
end
|
80
80
|
end
|
81
81
|
|
82
|
-
def perform_queries(index, key
|
82
|
+
def perform_queries(index, key)
|
83
83
|
result_map = {}
|
84
84
|
|
85
85
|
query_options = {
|
86
86
|
:hash_value => key,
|
87
87
|
}
|
88
|
-
query_options[:range_value_extender] = "/" if is_compound_index
|
89
88
|
|
90
89
|
if content_cache.present?
|
91
90
|
result_map[:content_cache] = CmsBaseModel.query_index(:obj, index, query_options.merge({
|
@@ -17,8 +17,6 @@ module RailsConnector
|
|
17
17
|
def configure_database(connection_spec)
|
18
18
|
@@cms_database_adapter =
|
19
19
|
case connection_spec["type"]
|
20
|
-
when "couch"
|
21
|
-
Kvom::Adapter::CouchdbAdapter.new(connection_spec)
|
22
20
|
when "dynamo"
|
23
21
|
Kvom::Adapter::DynamodbAdapter.new(connection_spec)
|
24
22
|
when "file"
|
@@ -31,21 +29,18 @@ module RailsConnector
|
|
31
29
|
def query_index(model, index, params = {})
|
32
30
|
hash_value = "#{model}/#{index}/#{params[:hash_value]}"
|
33
31
|
range_value = params[:range_value] || ""
|
34
|
-
range_value_extender = params[:range_value_extender]
|
35
32
|
|
36
33
|
# up to this point: backend independent
|
37
34
|
|
38
35
|
# this may be backend dependent (suffix character)
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
range_value = Range.new(start_key + range_value_extender, end_key + range_value_extender + "~")
|
48
|
-
end
|
36
|
+
start_key, end_key =
|
37
|
+
case range_value
|
38
|
+
when Range
|
39
|
+
[range_value.begin, range_value.end]
|
40
|
+
else
|
41
|
+
[range_value, range_value]
|
42
|
+
end
|
43
|
+
range_value = Range.new(start_key, end_key + "~")
|
49
44
|
|
50
45
|
adapter.query(hash_value, range_value)
|
51
46
|
end
|
@@ -97,8 +97,6 @@ module RailsConnector
|
|
97
97
|
|
98
98
|
private
|
99
99
|
|
100
|
-
COMPOUND_KEY_INDICES = [:ppath].freeze
|
101
|
-
|
102
100
|
def self.persistent_cache
|
103
101
|
Cache.new(:fallback_backend => Rails.cache, :cache_prefix => CACHE_PREFIX)
|
104
102
|
end
|
@@ -110,7 +108,7 @@ module RailsConnector
|
|
110
108
|
"cms_load.rails_connector", :name => "Obj Load", :index => index, :keys => keys
|
111
109
|
) do
|
112
110
|
keys.map do |key|
|
113
|
-
results = chain.query(index, key
|
111
|
+
results = chain.query(index, key)
|
114
112
|
results.values.map { |row| extract_obj_data(row) }
|
115
113
|
end
|
116
114
|
end
|
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
|
-
hash:
|
4
|
+
hash: -54897454
|
5
5
|
prerelease: 6
|
6
6
|
segments:
|
7
7
|
- 6
|
@@ -9,11 +9,13 @@ version: !ruby/object:Gem::Version
|
|
9
9
|
- 0
|
10
10
|
- beta
|
11
11
|
- 200
|
12
|
-
-
|
13
|
-
-
|
12
|
+
- 883
|
13
|
+
- f
|
14
|
+
- 5
|
15
|
+
- f
|
16
|
+
- 63
|
14
17
|
- b
|
15
|
-
|
16
|
-
version: 6.8.0.beta.200.869.9609b39
|
18
|
+
version: 6.8.0.beta.200.883.f5f063b
|
17
19
|
platform: ruby
|
18
20
|
authors:
|
19
21
|
- Infopark AG
|
@@ -21,11 +23,10 @@ autorequire:
|
|
21
23
|
bindir: bin
|
22
24
|
cert_chain: []
|
23
25
|
|
24
|
-
date: 2012-
|
26
|
+
date: 2012-08-10 00:00:00 +02:00
|
25
27
|
default_executable:
|
26
28
|
dependencies:
|
27
29
|
- !ruby/object:Gem::Dependency
|
28
|
-
type: :runtime
|
29
30
|
requirement: &id001 !ruby/object:Gem::Requirement
|
30
31
|
none: false
|
31
32
|
requirements:
|
@@ -34,50 +35,52 @@ dependencies:
|
|
34
35
|
hash: 23
|
35
36
|
segments:
|
36
37
|
- 1
|
37
|
-
-
|
38
|
-
-
|
39
|
-
version: 1.
|
40
|
-
prerelease: false
|
41
|
-
name: couchrest
|
38
|
+
- 3
|
39
|
+
- 6
|
40
|
+
version: 1.3.6
|
42
41
|
version_requirements: *id001
|
43
|
-
|
42
|
+
name: aws-sdk
|
43
|
+
prerelease: false
|
44
44
|
type: :runtime
|
45
|
+
- !ruby/object:Gem::Dependency
|
45
46
|
requirement: &id002 !ruby/object:Gem::Requirement
|
46
47
|
none: false
|
47
48
|
requirements:
|
48
49
|
- - ~>
|
49
50
|
- !ruby/object:Gem::Version
|
50
|
-
hash:
|
51
|
+
hash: 3
|
51
52
|
segments:
|
52
53
|
- 1
|
53
|
-
- 3
|
54
54
|
- 6
|
55
|
-
version: 1.
|
56
|
-
prerelease: false
|
57
|
-
name: aws-sdk
|
55
|
+
version: "1.6"
|
58
56
|
version_requirements: *id002
|
59
|
-
|
57
|
+
name: rest-client
|
58
|
+
prerelease: false
|
60
59
|
type: :runtime
|
60
|
+
- !ruby/object:Gem::Dependency
|
61
61
|
requirement: &id003 !ruby/object:Gem::Requirement
|
62
62
|
none: false
|
63
63
|
requirements:
|
64
64
|
- - "="
|
65
65
|
- !ruby/object:Gem::Version
|
66
|
-
hash:
|
66
|
+
hash: -54897454
|
67
67
|
segments:
|
68
68
|
- 6
|
69
69
|
- 8
|
70
70
|
- 0
|
71
71
|
- beta
|
72
72
|
- 200
|
73
|
-
-
|
74
|
-
-
|
73
|
+
- 883
|
74
|
+
- f
|
75
|
+
- 5
|
76
|
+
- f
|
77
|
+
- 63
|
75
78
|
- b
|
76
|
-
|
77
|
-
version: 6.8.0.beta.200.869.9609b39
|
78
|
-
prerelease: false
|
79
|
-
name: kvom
|
79
|
+
version: 6.8.0.beta.200.883.f5f063b
|
80
80
|
version_requirements: *id003
|
81
|
+
name: kvom
|
82
|
+
prerelease: false
|
83
|
+
type: :runtime
|
81
84
|
description: The Cloud Connector for Infopark CMS Fiona enables you to develop modern, dynamic Web 2.0 applications using Ruby on Rails and at the same time display CMS managed content.
|
82
85
|
email: info@infopark.de
|
83
86
|
executables: []
|
@@ -96,8 +99,6 @@ files:
|
|
96
99
|
- lib/rails_connector/cms_base_model.rb
|
97
100
|
- lib/rails_connector/content_cache.rb
|
98
101
|
- lib/rails_connector/controller_runtime.rb
|
99
|
-
- lib/rails_connector/couch_blob.rb
|
100
|
-
- lib/rails_connector/couchdb_views_source_path.rb
|
101
102
|
- lib/rails_connector/date_attribute.rb
|
102
103
|
- lib/rails_connector/default_search_request.rb
|
103
104
|
- lib/rails_connector/dict_storage.rb
|
@@ -1,38 +0,0 @@
|
|
1
|
-
module RailsConnector
|
2
|
-
|
3
|
-
class CouchBlob
|
4
|
-
|
5
|
-
def self.find(id, options)
|
6
|
-
ActiveSupport::Notifications.instrumenter.instrument("cms_load.rails_connector",
|
7
|
-
:name => "Blob Load", :index => "blobs", :keys => [options[:context]]
|
8
|
-
) do
|
9
|
-
new(id, CmsBaseModel.adapter.blob_attachment(id))
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
def self.configure(spec)
|
14
|
-
# connection is taken from CmsBaseModel on demand
|
15
|
-
end
|
16
|
-
|
17
|
-
attr_reader :id, :attachment
|
18
|
-
|
19
|
-
def initialize(id, attachment)
|
20
|
-
@id = id
|
21
|
-
@attachment = attachment
|
22
|
-
end
|
23
|
-
|
24
|
-
def url
|
25
|
-
CmsBaseModel.adapter.blob_url(id)
|
26
|
-
end
|
27
|
-
|
28
|
-
def content_type
|
29
|
-
attachment["content_type"]
|
30
|
-
end
|
31
|
-
|
32
|
-
def length
|
33
|
-
attachment['length']
|
34
|
-
end
|
35
|
-
|
36
|
-
end
|
37
|
-
|
38
|
-
end # module RailsConnector
|