infopark_fiona_connector 6.8.0.539.93842523 → 6.8.1

Sign up to get free protection for your applications and to get access to all the features.
data/README CHANGED
@@ -2,4 +2,4 @@
2
2
 
3
3
  Infopark Fiona Connector integrates {https://rubygems.org/gems/infopark_rails_connector Infopark Rails Connector} with Infopark CMS Fiona.
4
4
 
5
- For more information about Infopark Rails and Fiona Connector, please visit {http://kb.infopark.de/ Infopark’s Knowledge Base}.
5
+ For more information about Infopark Rails and Fiona Connector, please visit {http://kb.infopark.de/ Infopark’s Knowledge Base}. Details about recent changes to the Fiona Connector can be found in the {https://kb.infopark.de/fiona-connector-news Latest News on Rails Connector for CMS Fiona}.
@@ -16,8 +16,6 @@ module RailsConnector
16
16
  end
17
17
 
18
18
  autoload_all_sources
19
-
20
- autoload :AttrValueProvider, "rails_connector/attr_value_provider_loader"
21
19
  end
22
20
 
23
21
  autoload :Comment, "comment"
@@ -36,10 +36,13 @@ module RailsConnector
36
36
  def self.initialize_blob_streaming_for(adapter_name)
37
37
  # Redefines store_data:
38
38
  case adapter_name
39
- when /mysql/i:
39
+ when /mysql$/i
40
+ raise "Adapter 'mysql' no longer supported. " +
41
+ "Please change adapter in your database.yml to 'mysql2'."
42
+ when /mysql2/i
40
43
  require "rails_connector/blob_mysql"
41
44
  include BlobMysql
42
- when /oracle/i:
45
+ when /oracle/i
43
46
  require "rails_connector/blob_oracle"
44
47
  include BlobOracle
45
48
  end
@@ -59,7 +62,7 @@ module RailsConnector
59
62
 
60
63
  def store_data_atomically(&block)
61
64
  tmp_file = "#{path}.#{Process.pid}"
62
- File.open(tmp_file, "w", &block)
65
+ File.open(tmp_file, "wb", &block)
63
66
  File.rename(tmp_file, path)
64
67
  end
65
68
  end
@@ -1,4 +1,4 @@
1
- require 'mysql'
1
+ require 'mysql2'
2
2
  require 'mysql_blob_streaming'
3
3
 
4
4
  module RailsConnector
@@ -13,30 +13,20 @@ module RailsConnector
13
13
  end
14
14
 
15
15
  def fetch_into_file(file)
16
- mysql = connection.instance_variable_get '@connection'
17
- stmt = mysql.prepare("SELECT blob_data FROM #{self.class.table_name} WHERE #{self.class.primary_key}=?")
18
-
19
- class << stmt
20
- include MysqlBlobStreaming
21
-
22
- attr_accessor :file
23
- attr_accessor :logger
24
-
25
- def handle_data(data)
26
- @file << data
27
- data = nil
28
- GC.start
29
- end
16
+ mysql2_client = connection.instance_variable_get '@connection'
17
+ ActiveRecord::Base.logger.debug "Streaming blob from MySQL2 into #{file.path}"
18
+
19
+ table_name = mysql2_client.escape(self.class.table_name)
20
+ primary_key = mysql2_client.escape(self.class.primary_key)
21
+ escaped_id = mysql2_client.escape(id)
22
+ query = "SELECT `blob_data` FROM `#{table_name}` WHERE `#{primary_key}`='#{escaped_id}'"
23
+
24
+ MysqlBlobStreaming.stream(mysql2_client, query, 1.megabyte) do |chunk|
25
+ file << chunk
26
+ chunk = nil
27
+ GC.start
30
28
  end
31
-
32
- stmt.logger = ActiveRecord::Base.logger
33
- stmt.logger.debug "Streaming blob from MySQL into #{file.path}"
34
- stmt.file = file
35
- stmt.execute(id)
36
- stmt.stream(1.megabyte)
37
- ensure
38
- stmt.close if stmt
39
29
  end
40
30
  end
41
31
 
42
- end
32
+ end
@@ -68,7 +68,7 @@ module RailsConnector
68
68
  conditions[:object_type] = 'NOT object_type:image'
69
69
  conditions[:suppress_export] = 'NOT suppress_export:1'
70
70
  now = Time.now
71
- conditions[:valid_from] = "NOT valid_from:[#{now.succ.to_iso} TO *]"
71
+ conditions[:valid_from] = "NOT valid_from:[#{(now + 1.second).to_iso} TO *]"
72
72
  conditions[:valid_until] = "NOT valid_until:[* TO #{now.to_iso}]"
73
73
  conditions.merge(@options[:filter_query] || {})
74
74
  end
@@ -1,4 +1,5 @@
1
1
  require "json"
2
+ require 'openssl'
2
3
 
3
4
  module RailsConnector
4
5
 
@@ -8,7 +9,10 @@ module RailsConnector
8
9
  # [parent] the Obj of which this one is a child - nil for the root object
9
10
  # @api public
10
11
  class Obj < CmsBaseModel
11
- include AttrValueProvider
12
+ CRYPT_KEY = "\xd7\x28\x9c\x63\xd6\x29\xdf\x20\xcd\x32\xcf\x30\xcf\x30\xcf\x30\xdf\x20\xb6\x49"\
13
+ "\x91\x6e\x99\x66\x90\x6f\x8f\x70\x9e\x61\x8d\x72\x94\x6b\xdf\x20\xbe\x41\xb8\x47\xc4\x3b"\
14
+ "\xdf\x20\xbd\x42\x9a\x65\x8d\x72\x93\x6c\x96\x69\x91\x6e".freeze
15
+
12
16
  include DateAttribute
13
17
  include SEO
14
18
 
@@ -419,7 +423,26 @@ module RailsConnector
419
423
 
420
424
  # Returns a nested hash of attribute values.
421
425
  def attr_values
422
- @attr_values ||= fetch_attr_values
426
+ @attr_values ||= begin
427
+ encoded_and_encrypted_attr_values = read_attribute(:attr_values)
428
+ return {} unless encoded_and_encrypted_attr_values
429
+ encrypted_attr_values = Base64.decode64(encoded_and_encrypted_attr_values)
430
+ if !encrypted_attr_values.starts_with?('Salted__') || encrypted_attr_values.length < 16
431
+ raise 'attr_values has wrong format'
432
+ end
433
+ cipher = OpenSSL::Cipher.new('rc4')
434
+ cipher.decrypt
435
+ salt = encrypted_attr_values[8..15]
436
+ cipher.pkcs5_keyivgen(CRYPT_KEY, salt, 1)
437
+ encrypted_attr_values = encrypted_attr_values[16..-1]
438
+ if encrypted_attr_values.present?
439
+ decrypted_attr_values = cipher.update(encrypted_attr_values)
440
+ decrypted_attr_values << cipher.final
441
+ JSON.parse(decrypted_attr_values)
442
+ else
443
+ {}
444
+ end
445
+ end
423
446
  end
424
447
 
425
448
  # Returns a nested hash of attribute definitions.
@@ -26,7 +26,7 @@ module RailsConnector
26
26
  :collections => ['cm-contents'],
27
27
  :base_query => nil
28
28
  }.merge(options)
29
- @options[:collections] = options[:collection].to_a.flatten if options.has_key?(:collection)
29
+ @options[:collections] = Array(options[:collection]).flatten if options.has_key?(:collection)
30
30
  end
31
31
 
32
32
  # Queries the SES and returns a SearchResult.
@@ -1,3 +1,4 @@
1
+ # encoding: utf-8
1
2
  module RailsConnector
2
3
 
3
4
  # This class provides an implementation for accessing the Verity based search server.
metadata CHANGED
@@ -1,81 +1,72 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: infopark_fiona_connector
3
- version: !ruby/object:Gem::Version
4
- hash: 187682853
3
+ version: !ruby/object:Gem::Version
4
+ version: 6.8.1
5
5
  prerelease:
6
- segments:
7
- - 6
8
- - 8
9
- - 0
10
- - 539
11
- - 93842523
12
- version: 6.8.0.539.93842523
13
6
  platform: ruby
14
- authors:
7
+ authors:
15
8
  - Infopark AG
16
9
  autorequire:
17
10
  bindir: bin
18
11
  cert_chain: []
19
-
20
- date: 2013-01-11 00:00:00 +01:00
21
- default_executable:
22
- dependencies:
23
- - !ruby/object:Gem::Dependency
24
- requirement: &id001 !ruby/object:Gem::Requirement
12
+ date: 2013-01-24 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: mime-types
16
+ requirement: !ruby/object:Gem::Requirement
25
17
  none: false
26
- requirements:
18
+ requirements:
27
19
  - - ~>
28
- - !ruby/object:Gem::Version
29
- hash: 47
30
- segments:
31
- - 1
32
- - 16
33
- version: "1.16"
34
- version_requirements: *id001
35
- name: mime-types
36
- prerelease: false
20
+ - !ruby/object:Gem::Version
21
+ version: '1.16'
37
22
  type: :runtime
38
- - !ruby/object:Gem::Dependency
39
- requirement: &id002 !ruby/object:Gem::Requirement
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
40
25
  none: false
41
- requirements:
26
+ requirements:
42
27
  - - ~>
43
- - !ruby/object:Gem::Version
44
- hash: 21
45
- segments:
46
- - 1
47
- - 1
48
- - 3
49
- version: 1.1.3
50
- version_requirements: *id002
28
+ - !ruby/object:Gem::Version
29
+ version: '1.16'
30
+ - !ruby/object:Gem::Dependency
51
31
  name: mysql_blob_streaming
52
- prerelease: false
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ~>
36
+ - !ruby/object:Gem::Version
37
+ version: 2.0.0
53
38
  type: :runtime
54
- - !ruby/object:Gem::Dependency
55
- requirement: &id003 !ruby/object:Gem::Requirement
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
56
41
  none: false
57
- requirements:
42
+ requirements:
58
43
  - - ~>
59
- - !ruby/object:Gem::Version
60
- hash: 23
61
- segments:
62
- - 1
63
- - 0
64
- - 0
65
- version: 1.0.0
66
- version_requirements: *id003
44
+ - !ruby/object:Gem::Version
45
+ version: 2.0.0
46
+ - !ruby/object:Gem::Dependency
67
47
  name: rsolr
68
- prerelease: false
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ~>
52
+ - !ruby/object:Gem::Version
53
+ version: 1.0.0
69
54
  type: :runtime
70
- description: The Fiona 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.
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: 1.0.0
62
+ description: The Fiona Connector for Infopark CMS Fiona enables you to develop modern,
63
+ dynamic Web 2.0 applications using Ruby on Rails and at the same time display CMS
64
+ managed content.
71
65
  email: info@infopark.de
72
66
  executables: []
73
-
74
67
  extensions: []
75
-
76
68
  extra_rdoc_files: []
77
-
78
- files:
69
+ files:
79
70
  - .yardopts
80
71
  - README
81
72
  - app/helpers/rails_connector/marker_helper.rb
@@ -85,7 +76,6 @@ files:
85
76
  - lib/rails_connector/attr_value_provider.bundle
86
77
  - lib/rails_connector/attr_value_provider.so
87
78
  - lib/rails_connector/attr_value_provider64.so
88
- - lib/rails_connector/attr_value_provider_loader.rb
89
79
  - lib/rails_connector/blob.rb
90
80
  - lib/rails_connector/blob_mysql.rb
91
81
  - lib/rails_connector/blob_oracle.rb
@@ -106,41 +96,32 @@ files:
106
96
  - lib/rails_connector/ses/verity_accessor.rb
107
97
  - lib/rails_connector/verity_search_request.rb
108
98
  - lib/rating.rb
109
- has_rdoc: yard
110
99
  homepage: http://www.infopark.de
111
100
  licenses: []
112
-
113
101
  post_install_message:
114
102
  rdoc_options: []
115
-
116
- require_paths:
103
+ require_paths:
117
104
  - lib
118
- required_ruby_version: !ruby/object:Gem::Requirement
105
+ required_ruby_version: !ruby/object:Gem::Requirement
119
106
  none: false
120
- requirements:
121
- - - ">="
122
- - !ruby/object:Gem::Version
123
- hash: 3
124
- segments:
107
+ requirements:
108
+ - - ! '>='
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ segments:
125
112
  - 0
126
- version: "0"
127
- required_rubygems_version: !ruby/object:Gem::Requirement
113
+ hash: -935364721
114
+ required_rubygems_version: !ruby/object:Gem::Requirement
128
115
  none: false
129
- requirements:
130
- - - ">="
131
- - !ruby/object:Gem::Version
132
- hash: 17
133
- segments:
134
- - 1
135
- - 3
136
- - 5
116
+ requirements:
117
+ - - ! '>='
118
+ - !ruby/object:Gem::Version
137
119
  version: 1.3.5
138
120
  requirements: []
139
-
140
121
  rubyforge_project:
141
- rubygems_version: 1.6.2
122
+ rubygems_version: 1.8.23
142
123
  signing_key:
143
124
  specification_version: 3
144
125
  summary: Infopark Fiona Connector
145
126
  test_files: []
146
-
127
+ has_rdoc: yard
@@ -1,11 +0,0 @@
1
- begin
2
- require "rails_connector/attr_value_provider64"
3
- rescue LoadError => e1
4
- begin
5
- require "rails_connector/attr_value_provider"
6
- rescue LoadError => e2
7
- raise "Could neither load attr_value_provider (#{e2.message}) " +
8
- "nor attr_value_provider64 (#{e1.message})."
9
- end
10
- end
11
-