infopark_fiona_connector 7.0.1.5.2.3.rc8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (95) hide show
  1. checksums.yaml +7 -0
  2. data/.yardopts +5 -0
  3. data/app/assets/images/admin/minus.gif +0 -0
  4. data/app/assets/images/bg80.png +0 -0
  5. data/app/assets/images/edit.png +0 -0
  6. data/app/assets/images/icons/mm_generic.png +0 -0
  7. data/app/assets/images/icons/mm_menu.png +0 -0
  8. data/app/assets/javascripts/editmarker.js +240 -0
  9. data/app/assets/javascripts/infopark_rails_connector.js.erb +0 -0
  10. data/app/assets/stylesheets/editmarker.css +70 -0
  11. data/app/assets/stylesheets/infopark_rails_connector.css.erb +0 -0
  12. data/app/controllers/cms_controller.rb +7 -0
  13. data/app/controllers/rails_connector/default_cms_controller.rb +41 -0
  14. data/app/helpers/cms_helper.rb +7 -0
  15. data/app/helpers/cms_routing_helper.rb +7 -0
  16. data/app/helpers/rails_connector/cms_asset_helper.rb +54 -0
  17. data/app/helpers/rails_connector/cms_tag_helper.rb +4 -0
  18. data/app/helpers/rails_connector/default_cms_helper.rb +21 -0
  19. data/app/helpers/rails_connector/default_cms_routing_helper.rb +119 -0
  20. data/app/helpers/rails_connector/display_helper.rb +124 -0
  21. data/app/helpers/rails_connector/editing_helper.rb +7 -0
  22. data/app/helpers/rails_connector/layout_helper.rb +26 -0
  23. data/app/helpers/rails_connector/marker_helper.rb +371 -0
  24. data/app/helpers/rails_connector/table_of_contents_helper.rb +20 -0
  25. data/app/models/named_link.rb +2 -0
  26. data/app/views/cms/_index.html.erb +7 -0
  27. data/app/views/cms/index.html.erb +1 -0
  28. data/app/views/errors/403_forbidden.html.erb +3 -0
  29. data/app/views/errors/410_gone.html.erb +7 -0
  30. data/config/cms_routes.rb +17 -0
  31. data/config/locales/de.rails_connector.errors.yml +11 -0
  32. data/config/locales/de.rails_connector.lib.yml +6 -0
  33. data/config/locales/de.rails_connector.views.yml +9 -0
  34. data/config/locales/en.rails_connector.errors.yml +10 -0
  35. data/config/locales/en.rails_connector.lib.yml +6 -0
  36. data/config/locales/en.rails_connector.views.yml +9 -0
  37. data/lib/gem_dependencies.rb +68 -0
  38. data/lib/generators/rails_connector/install/install_generator.rb +37 -0
  39. data/lib/generators/rails_connector/install/templates/app/models/obj.rb.erb +5 -0
  40. data/lib/generators/rails_connector/install/templates/initializers/rails_connector.rb +2 -0
  41. data/lib/generators/rails_connector/install/templates/local/configuration.rb +2 -0
  42. data/lib/infopark_fiona_connector.rb +44 -0
  43. data/lib/meta_eager_loader.rb +1 -0
  44. data/lib/obj.rb +3 -0
  45. data/lib/rails_connector/attr_dict.rb +169 -0
  46. data/lib/rails_connector/attr_value_provider.bundle +0 -0
  47. data/lib/rails_connector/attr_value_provider.so +0 -0
  48. data/lib/rails_connector/attr_value_provider64.so +0 -0
  49. data/lib/rails_connector/attribute.rb +93 -0
  50. data/lib/rails_connector/authenticable.rb +37 -0
  51. data/lib/rails_connector/basic_obj.rb +571 -0
  52. data/lib/rails_connector/blob.rb +75 -0
  53. data/lib/rails_connector/blob_mapping.rb +15 -0
  54. data/lib/rails_connector/blob_mysql.rb +30 -0
  55. data/lib/rails_connector/blob_oracle.rb +37 -0
  56. data/lib/rails_connector/cache_middleware.rb +13 -0
  57. data/lib/rails_connector/channel.rb +18 -0
  58. data/lib/rails_connector/cms_accessible.rb +111 -0
  59. data/lib/rails_connector/cms_base_model.rb +62 -0
  60. data/lib/rails_connector/cms_dispatch_controller.rb +43 -0
  61. data/lib/rails_connector/cms_env.rb +65 -0
  62. data/lib/rails_connector/cms_test_request.rb +8 -0
  63. data/lib/rails_connector/configuration.rb +174 -0
  64. data/lib/rails_connector/content.rb +7 -0
  65. data/lib/rails_connector/core_extensions.rb +1 -0
  66. data/lib/rails_connector/core_extensions/time.rb +17 -0
  67. data/lib/rails_connector/date_attribute.rb +26 -0
  68. data/lib/rails_connector/default_search_request.rb +6 -0
  69. data/lib/rails_connector/engine.rb +65 -0
  70. data/lib/rails_connector/errors.rb +6 -0
  71. data/lib/rails_connector/fiona_datetime.rb +14 -0
  72. data/lib/rails_connector/fiona_engine.rb +8 -0
  73. data/lib/rails_connector/html_string.rb +17 -0
  74. data/lib/rails_connector/job.rb +10 -0
  75. data/lib/rails_connector/link.rb +148 -0
  76. data/lib/rails_connector/link_list.rb +28 -0
  77. data/lib/rails_connector/link_resolvable.rb +5 -0
  78. data/lib/rails_connector/lucene_search_request.rb +102 -0
  79. data/lib/rails_connector/markdown_string.rb +17 -0
  80. data/lib/rails_connector/meta.rb +143 -0
  81. data/lib/rails_connector/meta/eager_loader.rb +84 -0
  82. data/lib/rails_connector/named_link.rb +90 -0
  83. data/lib/rails_connector/news.rb +20 -0
  84. data/lib/rails_connector/obj_class.rb +138 -0
  85. data/lib/rails_connector/obj_class_attr.rb +5 -0
  86. data/lib/rails_connector/object_with_meta_data.rb +13 -0
  87. data/lib/rails_connector/permission.rb +37 -0
  88. data/lib/rails_connector/rack_middlewares.rb +5 -0
  89. data/lib/rails_connector/ses.rb +78 -0
  90. data/lib/rails_connector/ses/verity_accessor.rb +127 -0
  91. data/lib/rails_connector/string_tagging.rb +26 -0
  92. data/lib/rails_connector/verity_search_request.rb +86 -0
  93. data/lib/search_request.rb +2 -0
  94. data/lib/version.rb +7 -0
  95. metadata +277 -0
@@ -0,0 +1,86 @@
1
+ module RailsConnector
2
+ # This class provides an implementation for accessing the Verity based search server.
3
+ # It should be customized by subclassing.
4
+ # @api public
5
+ class VeritySearchRequest
6
+ attr_reader :query_string
7
+
8
+ # Sanitizes the given +query_string+ and takes +options+ for accessing the SES.
9
+ #
10
+ # +query_string+ is a VQL search query.
11
+ # +options+ is a hash and may be used to tweek the query.
12
+ #
13
+ # Options:
14
+ # <tt>:host</tt>:: The SES server host, default: <tt>'localhost'</tt>
15
+ # <tt>:port</tt>:: The SES server port, default: <tt>3011</tt>
16
+ # <tt>:offset</tt>:: The search offset, default: <tt>0</tt>
17
+ # <tt>:limit</tt>:: The maximum number of hits in the SearchResult, default: <tt>10</tt>
18
+ # <tt>:min_relevance</tt>:: The minimum relevance in percent, default: <tt>50</tt>
19
+ # <tt>:max_docs</tt>:: The maximum number of documents to be searched, default: <tt>'unlimited'</tt>
20
+ # <tt>:parser</tt>:: The VQL query parser to be used, default: <tt>'simple'</tt>
21
+ # <tt>:sort_order</tt>:: The sort order of the hits, a list of key-value pairs, each consisting of the sortkey and the sort direction ("asc"=ascending, "desc"=descending), default: <tt>[["score", "desc"], ["name", "asc"]]</tt>
22
+ # <tt>:collections</tt>:: The collections to be searched, default: <tt>['cm-contents']</tt>
23
+ # <tt>:base_query</tt>:: The VQL base query, default: <tt>nil</tt>
24
+ # @api public
25
+ def initialize(query_string, options = nil)
26
+ @query_string = self.class.sanitize(query_string)
27
+ @options = Configuration.search_options.merge(options || {})
28
+ end
29
+
30
+ # Accesses the SES and fetches search hits.
31
+ #
32
+ # Uses the #base_query and +options+ given in #new.
33
+ # @api public
34
+ def fetch_hits
35
+ SES::VerityAccessor.new(vql_query_for(@query_string), { base_query: base_query }.merge(@options)).search
36
+ end
37
+
38
+ # Removes unwanted characters from +text+.
39
+ def self.sanitize(text)
40
+ text.strip.gsub(/[<>"'´`,()\[\]{}=!@\\]/, "")
41
+ end
42
+
43
+ def vql_query_for(query_string = "")
44
+ words = query_string.split(/\s+/).map do |word|
45
+ word unless %w(and or not).include?(word.downcase)
46
+ end.compact.join(", ")
47
+ "<#AND> (#{words})"
48
+ end
49
+
50
+ # Combines base query conditions to a single base query (see #base_query_conditions).
51
+ #
52
+ # A base query is used to reduce the number of documents before executing the actual query.
53
+ # By default, all base query conditions must be met, they are combined using the +AND+ operator.
54
+ def base_query
55
+ "<#AND> (#{base_query_conditions.values.compact.join(", ")})"
56
+ end
57
+
58
+ # A hash of conditions, combined to a base query by #base_query.
59
+ # Note that all values of the hash must be valid VQL syntax.
60
+ # The keys have no meaning and exist only so single conditions can be replaced
61
+ # in a subclass:
62
+ #
63
+ # class SearchRequest < VeritySearchRequest
64
+ # def base_query_conditions
65
+ # super.merge(:content => '("edited" <#IN> state)'
66
+ # end
67
+ # end
68
+ # @api public
69
+ def base_query_conditions
70
+ conditions = {}
71
+ conditions[:objTypes] = '<#ANY> (
72
+ ("generic" <#IN> objType),
73
+ ("document" <#IN> objType),
74
+ ("publication" <#IN> objType)
75
+ )'
76
+ conditions[:content] = '("released" <#IN> state)'
77
+ conditions[:suppressExport] = '("0" <#IN> suppressExport)'
78
+ conditions[:validFrom] = "(validFrom < #{Time.now.to_iso})"
79
+ conditions[:validUntil] = %!<#OR> (
80
+ (validUntil = ""),
81
+ (validUntil > #{Time.now.to_iso})
82
+ )!
83
+ conditions
84
+ end
85
+ end
86
+ end
@@ -0,0 +1,2 @@
1
+ class SearchRequest < RailsConnector::DefaultSearchRequest
2
+ end
@@ -0,0 +1,7 @@
1
+ module RailsConnector
2
+ module Version
3
+ def self.get
4
+ "7.0.1.5.2.3.rc8"
5
+ end
6
+ end
7
+ end
metadata ADDED
@@ -0,0 +1,277 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: infopark_fiona_connector
3
+ version: !ruby/object:Gem::Version
4
+ version: 7.0.1.5.2.3.rc8
5
+ platform: ruby
6
+ authors:
7
+ - Infopark AG
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2020-07-21 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rails
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '5.0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '5.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: activerecord
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '5.0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '5.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '12.3'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '12.3'
55
+ - !ruby/object:Gem::Dependency
56
+ name: json
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '2.3'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '2.3'
69
+ - !ruby/object:Gem::Dependency
70
+ name: maruku
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '0.7'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '0.7'
83
+ - !ruby/object:Gem::Dependency
84
+ name: jquery-rails
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '4.3'
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '4.3'
97
+ - !ruby/object:Gem::Dependency
98
+ name: mime-types
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '3.1'
104
+ type: :runtime
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: '3.1'
111
+ - !ruby/object:Gem::Dependency
112
+ name: mysql_blob_streaming
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: '2.3'
118
+ type: :runtime
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: '2.3'
125
+ - !ruby/object:Gem::Dependency
126
+ name: rsolr
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: 2.1.0s
132
+ type: :runtime
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - "~>"
137
+ - !ruby/object:Gem::Version
138
+ version: 2.1.0s
139
+ - !ruby/object:Gem::Dependency
140
+ name: helpful_configuration
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - "~>"
144
+ - !ruby/object:Gem::Version
145
+ version: 0.1.0
146
+ type: :runtime
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - "~>"
151
+ - !ruby/object:Gem::Version
152
+ version: 0.1.0
153
+ description: Fiona Connector for Infopark CMS Fiona enables you to develop modern,
154
+ dynamic web applications using Ruby on Rails and at the same time display CMS managed
155
+ content.
156
+ email: info@infopark.de
157
+ executables: []
158
+ extensions: []
159
+ extra_rdoc_files: []
160
+ files:
161
+ - ".yardopts"
162
+ - app/assets/images/admin/minus.gif
163
+ - app/assets/images/bg80.png
164
+ - app/assets/images/edit.png
165
+ - app/assets/images/icons/mm_generic.png
166
+ - app/assets/images/icons/mm_menu.png
167
+ - app/assets/javascripts/editmarker.js
168
+ - app/assets/javascripts/infopark_rails_connector.js.erb
169
+ - app/assets/stylesheets/editmarker.css
170
+ - app/assets/stylesheets/infopark_rails_connector.css.erb
171
+ - app/controllers/cms_controller.rb
172
+ - app/controllers/rails_connector/default_cms_controller.rb
173
+ - app/helpers/cms_helper.rb
174
+ - app/helpers/cms_routing_helper.rb
175
+ - app/helpers/rails_connector/cms_asset_helper.rb
176
+ - app/helpers/rails_connector/cms_tag_helper.rb
177
+ - app/helpers/rails_connector/default_cms_helper.rb
178
+ - app/helpers/rails_connector/default_cms_routing_helper.rb
179
+ - app/helpers/rails_connector/display_helper.rb
180
+ - app/helpers/rails_connector/editing_helper.rb
181
+ - app/helpers/rails_connector/layout_helper.rb
182
+ - app/helpers/rails_connector/marker_helper.rb
183
+ - app/helpers/rails_connector/table_of_contents_helper.rb
184
+ - app/models/named_link.rb
185
+ - app/views/cms/_index.html.erb
186
+ - app/views/cms/index.html.erb
187
+ - app/views/errors/403_forbidden.html.erb
188
+ - app/views/errors/410_gone.html.erb
189
+ - config/cms_routes.rb
190
+ - config/locales/de.rails_connector.errors.yml
191
+ - config/locales/de.rails_connector.lib.yml
192
+ - config/locales/de.rails_connector.views.yml
193
+ - config/locales/en.rails_connector.errors.yml
194
+ - config/locales/en.rails_connector.lib.yml
195
+ - config/locales/en.rails_connector.views.yml
196
+ - lib/gem_dependencies.rb
197
+ - lib/generators/rails_connector/install/install_generator.rb
198
+ - lib/generators/rails_connector/install/templates/app/models/obj.rb.erb
199
+ - lib/generators/rails_connector/install/templates/initializers/rails_connector.rb
200
+ - lib/generators/rails_connector/install/templates/local/configuration.rb
201
+ - lib/infopark_fiona_connector.rb
202
+ - lib/meta_eager_loader.rb
203
+ - lib/obj.rb
204
+ - lib/rails_connector/attr_dict.rb
205
+ - lib/rails_connector/attr_value_provider.bundle
206
+ - lib/rails_connector/attr_value_provider.so
207
+ - lib/rails_connector/attr_value_provider64.so
208
+ - lib/rails_connector/attribute.rb
209
+ - lib/rails_connector/authenticable.rb
210
+ - lib/rails_connector/basic_obj.rb
211
+ - lib/rails_connector/blob.rb
212
+ - lib/rails_connector/blob_mapping.rb
213
+ - lib/rails_connector/blob_mysql.rb
214
+ - lib/rails_connector/blob_oracle.rb
215
+ - lib/rails_connector/cache_middleware.rb
216
+ - lib/rails_connector/channel.rb
217
+ - lib/rails_connector/cms_accessible.rb
218
+ - lib/rails_connector/cms_base_model.rb
219
+ - lib/rails_connector/cms_dispatch_controller.rb
220
+ - lib/rails_connector/cms_env.rb
221
+ - lib/rails_connector/cms_test_request.rb
222
+ - lib/rails_connector/configuration.rb
223
+ - lib/rails_connector/content.rb
224
+ - lib/rails_connector/core_extensions.rb
225
+ - lib/rails_connector/core_extensions/time.rb
226
+ - lib/rails_connector/date_attribute.rb
227
+ - lib/rails_connector/default_search_request.rb
228
+ - lib/rails_connector/engine.rb
229
+ - lib/rails_connector/errors.rb
230
+ - lib/rails_connector/fiona_datetime.rb
231
+ - lib/rails_connector/fiona_engine.rb
232
+ - lib/rails_connector/html_string.rb
233
+ - lib/rails_connector/job.rb
234
+ - lib/rails_connector/link.rb
235
+ - lib/rails_connector/link_list.rb
236
+ - lib/rails_connector/link_resolvable.rb
237
+ - lib/rails_connector/lucene_search_request.rb
238
+ - lib/rails_connector/markdown_string.rb
239
+ - lib/rails_connector/meta.rb
240
+ - lib/rails_connector/meta/eager_loader.rb
241
+ - lib/rails_connector/named_link.rb
242
+ - lib/rails_connector/news.rb
243
+ - lib/rails_connector/obj_class.rb
244
+ - lib/rails_connector/obj_class_attr.rb
245
+ - lib/rails_connector/object_with_meta_data.rb
246
+ - lib/rails_connector/permission.rb
247
+ - lib/rails_connector/rack_middlewares.rb
248
+ - lib/rails_connector/ses.rb
249
+ - lib/rails_connector/ses/verity_accessor.rb
250
+ - lib/rails_connector/string_tagging.rb
251
+ - lib/rails_connector/verity_search_request.rb
252
+ - lib/search_request.rb
253
+ - lib/version.rb
254
+ homepage: http://www.infopark.de
255
+ licenses:
256
+ - LGPL-3.0
257
+ metadata: {}
258
+ post_install_message:
259
+ rdoc_options: []
260
+ require_paths:
261
+ - lib
262
+ required_ruby_version: !ruby/object:Gem::Requirement
263
+ requirements:
264
+ - - ">="
265
+ - !ruby/object:Gem::Version
266
+ version: '0'
267
+ required_rubygems_version: !ruby/object:Gem::Requirement
268
+ requirements:
269
+ - - ">="
270
+ - !ruby/object:Gem::Version
271
+ version: 1.3.5
272
+ requirements: []
273
+ rubygems_version: 3.0.3
274
+ signing_key:
275
+ specification_version: 4
276
+ summary: Infopark Fiona Connector
277
+ test_files: []